Sign/Verify a message
You can sign and verify messages in just 1 line of code.
import { createPublicClient, http } from "viem"
const message = "hello world";
const signature = await smartAccountClient.account.signMessage({ message });
export const publicClient = createPublicClient({
chain,
transport: http()
})
const valid = await publicClient.verifyMessage({
address: smartAccountClient.account.address,
message,
signature,
})Last updated