Skip to content

Commit

Permalink
fix: support byte array messages with viem signer
Browse files Browse the repository at this point in the history
  • Loading branch information
rygine committed Sep 26, 2023
1 parent a12ecdf commit 2decefa
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/utils/viem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ export function convertWalletClientToSigner(

return {
getAddress: async () => account.address,
signMessage: async (message: string) => {
const signature = await walletClient.signMessage({ message, account })
return signature
},
signMessage: async (message: string | Uint8Array) =>
walletClient.signMessage({
message: typeof message === 'string' ? message : { raw: message },
account,
}),
}
}

0 comments on commit 2decefa

Please sign in to comment.