Skip to main content
The Amplify SDK provides helper functions that prepare transaction data for vault operations. All functions require SDK initialization before use.

Function Naming Convention

All transaction preparation functions use the *TxData suffix:
FunctionPurpose
prepareDepositAuthorization()Determine optimal authorization method
prepareDeposit()Unified deposit preparation
prepareDepositTxData()Low-level deposit transaction data
prepareApproveDepositTokenTxData()ERC20 approval for deposits
prepareDepositWithPermitTxData()Deposit with permit signature
prepareWithdrawTxData()Withdrawal transaction data
prepareApproveWithdrawTxData()ERC20 approval for withdrawals
Use the Unified Deposit API (prepareDepositAuthorization + prepareDeposit) for the best developer experience. It automatically:
  • Detects if the token supports EIP-2612 permits
  • Checks existing allowances
  • Routes to the optimal authorization flow
  • Provides type-safe discriminated unions for handling each case
See Deposits for complete documentation and examples.