Initialization
initAmplifySDK
Initialize the SDK with your API key before using any other functions.
getSupportedAssets
Fetch supported tokens and vault configurations for a yield type.
Vault Discovery
getVaultsByConfig
Discover vaults by yield type, chain, and asset. Returns
vault.name for
use in transaction functions.findVaultByConfig
Find a single vault by asset address, yield type, and chain.
Deposits
Deposit Workflow
The unified deposit API with
prepareDepositAuthorization and
prepareDeposit.prepareDepositTxData
Prepare transaction data for a standard deposit after approval.
prepareDepositWithPermitTxData
Prepare transaction data for a permit-based deposit (single transaction).
prepareDepositPermitSignature
Build EIP-712 typed data for signing a permit deposit directly.
Withdrawals
prepareWithdrawalAuthorization
Check approval requirements and prepare withdrawal authorization.
prepareWithdrawal
Prepare transaction data through the unified withdrawal wrapper.
prepareWithdrawOrderTxData
Build low-level WithdrawQueue order transaction data.
prepareApproveWithdrawOrderTxData
Build low-level approval transaction data for vault shares.
Display Helpers
Display Helpers
UI helper functions for showing vault APY, TVL, fees, share calculations,
and withdrawal history.
Function Quick Reference
| Function | Description |
|---|---|
initAmplifySDK | Initialize SDK with API key and options |
waitForCacheReady | Wait for the vault cache to be populated |
isCacheReady | Check if the vault cache is ready |
getVaults | Fetch vaults with optional filters |
getSupportedAssets | Get supported tokens for a yield type |
getVaultsByConfig | Discover vaults by yield type, chain, and asset |
findVaultByConfig | Find a single vault by asset + yield type + chain |
getWithdrawSupportedAssets | Get all assets grouped by available vaults |
prepareDepositAuthorization | Determine optimal authorization method |
prepareDeposit | Prepare deposit with auto-detected method |
prepareDepositTxData | Prepare standard deposit transaction |
prepareDepositWithPermitTxData | Prepare permit-based deposit transaction |
prepareDepositPermitSignature | Build EIP-712 permit typed data for signing |
prepareWithdrawalAuthorization | Determine if withdrawal approval is required |
prepareWithdrawal | Prepare withdrawal execution transaction |
prepareWithdrawOrderTxData | Prepare low-level WithdrawQueue submission |
prepareApproveWithdrawOrderTxData | Prepare low-level withdraw approval transaction |
prepareCancelWithdrawOrderTxData | Prepare withdrawal order cancellation |
getMinimumMint | Calculate expected vault shares for a deposit |
getVaultAPY | Fetch latest vault APY |
getVaultTVL | Fetch vault total value locked |
getWithdrawalFee | Calculate withdrawal fees |
getWithdrawalRequests | Fetch user’s withdrawal requests |
getMinimumWithdrawalOrderSize | Get minimum withdrawal order size |
Type Guards
The SDK exports type guards for handling discriminated union results:Vault Discovery Pattern
Starting in v0.5.0, transaction functions require avaultName instead of yieldType. The recommended pattern is: