Skip to main content
EIP-712 defines a standard way to sign structured data so wallets can present human-readable information to the user instead of an opaque hex blob. You can sign typed data with any EVM wallet account by creating a Viem WalletClient for it and calling signTypedData.

Usage

Notes

  • The wallet account must be an EVM account. Use isEvmWalletAccount to narrow the type before calling createWalletClientForWalletAccount.
  • signTypedData will use the wallet’s currently active chain. If you need a different chain, switch first with switchActiveNetwork.
  • The signature is 0x-prefixed hex (Hex); recover the signer with viem’s recoverTypedDataAddress or verify on-chain.
  • If the wallet account is not currently selected in the user’s wallet app, the call throws WalletAccountNotSelectedError. Prompt the user to switch accounts and retry.
Last modified on June 24, 2026