signTypedData or eth_signTypedData_v4.
In most cases you should use
prepareDepositAuthorization() which calls this function internally and returns the permit data as part of its result. Use prepareDepositPermitSignature directly when you need fine-grained control over the permit parameters, or need to pre-fetch token metadata to avoid extra RPC calls.Import
Usage
Parameters
The optional
nonce, decimals, tokenName, and tokenVersion parameters are performance optimizations. When provided, they skip the corresponding on-chain multicall reads, reducing latency in applications that already have this token metadata.Return Type
signTypedData, wagmi’s useSignTypedData, and eth_signTypedData_v4. The account field is the user address passed as the to parameter.
Examples
- Viem — direct signing
- Privy — eth_signTypedData_v4
- With pre-fetched metadata
Helper: toEthSignTypedDataV4
PermitSignatureData to a JSON string format compatible with eth_signTypedData_v4 (adds the EIP712Domain type entry and serializes bigints as strings):
Helper: parsePermitSignature
v, r, s components:
v-based and modern yParity-based signature formats.
Error Handling
Related
- Deposit Workflow - Unified API (recommended)
- prepareDepositWithPermitTxData - Build deposit tx after signing
- getVaultsByConfig - Discover account names