generated from scaffold-eth/scaffold-eth-2
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
40fa342
commit f7024d1
Showing
2 changed files
with
41 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export const signMessage = async (message: string, wallet: any): Promise<string> => { | ||
if (!wallet) { | ||
throw new Error("No wallet found"); | ||
} | ||
|
||
const connector = wallet?.connector; | ||
|
||
if (!connector) { | ||
throw new Error("No connector found"); | ||
} | ||
|
||
return await connector.signMessage(message); | ||
}; |