Latest Release
Breaking Changes
| Change | Before (v0.4.2) | After (v0.5.0) |
|---|---|---|
| Vault identifier in transaction functions | yieldType: YieldType | vaultName: string |
| Vault identifier in display helpers | yieldType: YieldType | vaultName: string |
| Vault discovery | Implicit (SDK resolved internally) | Explicit via getVaultsByConfig() |
| Withdrawal asset discovery | Not available | getWithdrawSupportedAssets() |
| Vault fetching | fetchVaults() | getVaults() |
| Asset fetching | fetchSupportedAssets() | getSupportedAssets() |
yieldType parameter has been replaced by vaultName in all of the following:| Category | Functions |
|---|---|
| Deposit | prepareDepositAuthorization, prepareDeposit, prepareDepositTxData, prepareDepositPermitSignature, prepareDepositWithPermitTxData, prepareApproveDepositTokenTxData |
| Withdrawal | prepareWithdrawalAuthorization, prepareWithdrawal, prepareWithdrawOrderTxData, prepareApproveWithdrawOrderTxData, prepareCancelWithdrawOrderTxData |
| Display | getMinimumMint, getWithdrawalFee, getMinimumWithdrawalOrderSize |
New Features
getVaults()— Renamed fromfetchVaults(). Same cache-first behavior, new name for consistency.getSupportedAssets()— Renamed fromfetchSupportedAssets(). Same cache-first behavior, new name for consistency.getVaultsByConfig()— Multi-filter vault discovery. Filter byyieldType,chainId,depositAssetAddress,withdrawAssetAddress, andsettlementAssetAddress.getWithdrawSupportedAssets()— Fetch all supported withdrawal assets grouped by token with their available vaults.vaultNameparameter on display helpers —getVaultAPY,getVaultTVL, andgetWithdrawalRequestsnow acceptvaultNameas an alternative tovaultAddress.- Cache management — Fully documented:
initializeCache(),getCache(),refreshVaultCache(),isCacheReady(),waitForCacheReady().
Migration Guide
Why this change?
In v0.4.2,yieldType served as the vault identifier. This worked when each yield type mapped to a single vault per chain, but broke down as multiple vaults with the same yield type launched on the same chain. The vaultName identifier is unique per vault and future-proof.The new pattern is: discover → then transact.Step 1 — Add vault discovery
Step 1 — Add vault discovery
Add a call to
getVaultsByConfig() wherever you previously passed yieldType directly to a transaction function. Cache the result for the session.Step 2 — Update deposit calls
Step 2 — Update deposit calls
Replace The same change applies to:
yieldType with vaultName in every deposit function call.prepareDepositAuthorization()prepareDeposit()prepareDepositPermitSignature()prepareDepositWithPermitTxData()prepareApproveDepositTokenTxData()
Step 3 — Update withdrawal calls
Step 3 — Update withdrawal calls
prepareWithdrawal()prepareWithdrawOrderTxData()prepareApproveWithdrawOrderTxData()prepareCancelWithdrawOrderTxData()
Step 4 — Update display helper calls
Step 4 — Update display helper calls
Display helpers that previously used The same change applies to:
yieldType to locate a vault now use vaultName.getWithdrawalFee()getMinimumWithdrawalOrderSize()
getVaultAPY(), getVaultTVL(), and getWithdrawalRequests() now accept vaultName as an alternative to vaultAddress:Step 5 — Update React hooks and components
Step 5 — Update React hooks and components
If you wrapped SDK calls in React hooks, update the interface and params:Use
getVaultsByConfig() in a useQuery or useEffect to discover the vault name at component mount time, then pass it to your deposit/withdrawal hooks.Regex for bulk find-and-replace
Regex for bulk find-and-replace
Use these patterns to locate all call sites in your codebase:
Breaking Changes
- Withdrawal flow migrated from AtomicQueue to WithdrawQueue.
- Renamed withdrawal APIs:
prepareWithdrawTransactionData()->prepareWithdrawOrderTxData()prepareApproveWithdrawToken()->prepareApproveWithdrawOrderTxData()
- Added
prepareCancelWithdrawOrderTxData()for order cancellation. - Withdrawal slippage parameters removed from the new flow.
Highlights
- Added unified
prepareWithdrawal()wrapper for withdrawal execution. - Added unified
prepareWithdrawalAuthorization()wrapper. - Added smart-wallet detection for deposit/withdraw authorization routing.
- Added
forceMethodparameter for explicit authorization routing.
Breaking Changes
| Change | Before | After |
|---|---|---|
| Deposit parameter names | depositToken, recipientAddress | depositAsset, to |
| Node.js requirement | 20+ | 22+ |
| Yield type constants | PRIME, TBILL, LENDING | CORE, TREASURY, FRONTIER |
Migration: Update deposit function calls
Migration: Update deposit function calls
Migration: Update YieldType references
Migration: Update YieldType references
Features
- Improved TypeScript inference for deposit functions
- Added
eth_signTypedData_v4helper for better wallet compatibility
Bug Fixes
- Fixed
instanceofchecks forAPIErrorandWithdrawErrorin transpiled code
Refactoring
- Standardized parameter naming across deposit APIs to match contract terminology
- Removed deprecated display module and bridge functionality
- Added explicit exports for tree-shaking optimization
Previous Releases
0.2.3-beta.2 - January 15, 2025
0.2.3-beta.2 - January 15, 2025
Bug Fixes
- Fixed spender address and decimals for permit flow
- Improved cache-based lookup for token address resolution
- Aligned
EIP712Domainwith viem’sTypedDataDomain
0.2.0-beta.4 - January 10, 2025
0.2.0-beta.4 - January 10, 2025
0.2.0-beta.0 - January 5, 2025
0.2.0-beta.0 - January 5, 2025
Refactoring
- Converted
LogLevelenum toas constpattern for better tree-shaking
0.2.0-alpha.0 - January 1, 2025
0.2.0-alpha.0 - January 1, 2025
Features
- Unified Deposit API: Added
prepareDepositandprepareDepositAuthorizationwrapper functions - Observability: Added logging and telemetry infrastructure
- ERC-20 Enhancements: Added
getTokenPermitInfoWithAllowancewith unified multicall
Bug Fixes
- Updated Sei chain ID from 713715 to 1329
- Fixed missing multicall mock in deposit-with-permit tests
- Prevented duplicate buffer-full warning messages in telemetry
Refactoring
- Converted
DepositAuthMethodenum toas constpattern - Centralized
API_BASE_URLconstant - Use unified multicall for
isDepositSpendApproved
0.1.1 - December 10, 2024
0.1.1 - December 10, 2024
0.1.0 - December 8, 2024
0.1.0 - December 8, 2024
0.0.1-alpha.1 - November 1, 2024
0.0.1-alpha.1 - November 1, 2024
Features
-
Initial SDK Release
- Comprehensive
AmplifyVaultsupport - Multi-chain support for yield vaults
- Complete deposit functionality with approval management
- Slippage protection for all operations
- Comprehensive
-
Withdraw Flow
prepareWithdrawTransactionData()for transaction preparation- Automatic vault data fetching via
fetchSupportedAssets() - Three-field vault resolution (yieldType + wantToken + chainId)
- Configurable slippage protection (default 0.5%)
-
Developer Experience
- Full TypeScript support with type safety
- Comprehensive error handling with specific error codes
- Exchange rate calculations
Build System
- Automated release workflow with conventional commits
- Semantic versioning with alpha/beta/rc support
- CI/CD pipeline with quality gates
- Security auditing and dependency scanning
- Automated NPM publishing with provenance
SDK Rename Migration
The SDK was renamed from Earn SDK to Amplify SDK in version 0.1.0.
Follow the migration steps below if upgrading from
@paxoslabs/earn-sdk.API endpoints continue to use
/v1/earn-sdk/* for backwards compatibility. No backend changes required.