Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Sign EIP-712 structured data with the user’s smart account.
const signature = await provider.request<`0x${string}`>({ method: 'eth_signTypedData_v4', params: [ address, JSON.stringify({ domain: { name: 'My App', version: '1', chainId: 1868, verifyingContract: '0x...', }, types: { EIP712Domain: [ { name: 'name', type: 'string' }, { name: 'version', type: 'string' }, { name: 'chainId', type: 'uint256' }, { name: 'verifyingContract', type: 'address' }, ], Order: [ { name: 'item', type: 'string' }, { name: 'amount', type: 'uint256' }, ], }, primaryType: 'Order', message: { item: 'Pass', amount: '1' }, }), ], })
0x${string}
4001
4100
-32602
import { publicClient } from './viem' const isValid = await publicClient.verifyTypedData({ address, domain, types, primaryType: 'Order', message, signature, })
personal_sign