Deposits
Unified deposit API with automatic permit/approval detection. Handles all deposit scenarios with a single entry point.
Withdraw
Prepare withdrawal transactions to redeem vault shares for underlying assets.
Function Naming Convention
All transaction preparation functions use the*TxData suffix:
| Function | Purpose |
|---|---|
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 |
Recommended Approach
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