Sign typed data
To request a typed data signature from a wallet, first find your desired wallet from the wallets
array and get its EIP-1193 provider via its getEthereumProvider
method:
Then, using the provider’s request
method, send an eth_signTypedData_v4
JSON-RPC to the wallet. In the params
array, include the wallet’s address as the first entry, and the typed data as the second entry.
If you’ve integrated Privy with another web3 library, you can also use that library’s syntax for requesting a typed data signature from the wallet:
Library | Method |
---|---|
Viem | Use the wallet client’s signTypedData method. |
Ethers | Use the signer’s signTypedData method. |
Wagmi | Use the useSignTypedData hook. |
When requesting a signature from an embedded wallet, you can customize the signature prompt by using Privy’s native signTypedData method.
Was this page helpful?