Skip to main content
Prepares transaction data for a deposit using an EIP-2612 permit signature. This enables single-transaction deposits without a separate approval step.
For most use cases, use the unified deposit workflow which handles authorization automatically.

Import

Usage

Parameters

ParameterTypeRequiredDescription
vaultNamestringYesAccount name from AmplifyVault.name (e.g. from getVaultsByConfig())
depositAssetAddressYesToken contract address to deposit
depositAmountstringYesAmount to deposit as decimal string (e.g., "100.50")
toAddressYesRecipient address for account shares
chainIdnumberYesBlockchain network ID
signatureHexYesPermit signature from wallet signing
deadlinebigintYesPermit deadline (must match signed deadline)
slippagenumberNoSlippage tolerance in basis points (default: 50)
distributorCodestringNoDistributor code for fee attribution

Return Type

Returns a discriminated union based on account configuration, matching the same flat shape as prepareDepositTxData().
As of v0.5.2, the return structure is flatabi, functionName, and args are top-level properties, matching prepareDepositTxData(). You can spread the result directly into writeContract.

Examples

Permit Support

Not all tokens support EIP-2612 permits. Use prepareDepositAuthorization() to check:
TokenSupports Permit
USDCYes
USDGYes
pyUSDYes
USDTNo
Smart contract wallets (like Privy Smart Wallets or Safe) cannot sign permits. Use the approval flow with transaction batching instead.

Error Handling

Error Message PatternDescriptionResolution
"SDK not initialized"SDK not initializedCall initAmplifySDK() first
"Vault not found"No account matches vaultNameVerify account name via getVaultsByConfig()
"does not support EIP-2612 permit"Token lacks permit supportUse approval flow instead
"Invalid permit signature format"Signature parsing failedRe-sign with correct typed data
"Invalid slippage value"Slippage outside 0–10000 bpsProvide value between 0 and 10000