Latest Release
Terminology Change
Starting in v0.5.3, the documentation and UI refer to “accounts” instead of “vaults”. This is a naming change only — all SDK API identifiers (getVaultsByConfig, AmplifyVault, vaultName, vaultAddress, etc.) remain unchanged. No code migration is required.New Features
- Supply cap awareness — The SDK now reads and enforces account deposit supply caps on-chain. Deposits that would exceed the account’s
supplyCapInBase(read from theDistributorCodeDepositorcontract) are rejected with a descriptiveAPIErrorbefore submitting a transaction. The cachedAmplifyVaulttype exposes a newdepositCap?: VaultDepositCapfield withsupplyCapInBaseandhasDepositCap. getDepositCap()— New display helper that reads the supply cap and fee module address from the DCD contract on-chain. ReturnssupplyCapInBase,hasDepositCap,depositFeeModuleAddress, andhasFees.getCurrentSupply()— New display helper that reads the current total account supply from the BoringVault and Accountant contracts. ReturnstotalShareSupply,exchangeRate,accountantDecimals, andtotalValueInBasefor comparing against the supply cap.calculateDepositFee()— New display helper that reads deposit fee parameters from the on-chain fee module. Returns a full fee breakdown:feePercentage,flatFee,variableFeeAmount,totalFeeAmount,depositAmountAfterFees, andassetDecimals.getShareValue()— New display helper that calculates the value of account shares in a quote asset using the on-chaingetRateInQuoteexchange rate. Accepts either auserAddress(readsbalanceOfon-chain) or an explicitshareAmount.- Deposit fee data on accounts —
AmplifyVault.depositFees?: VaultDepositFeescarries per-asset fee data from the indexer, enriched with defaults when the fee module is configured but indexer data is missing. IncludeshasFees,feeModuleAddress, and per-assetfeePercentage/flatFee. - Withdraw fee data on accounts —
AmplifyVault.withdrawFees?: VaultWithdrawFeescarries withdraw queue fee metadata from the indexer. IncludeshasFees,feeModuleAddress,offerFeeBps, andofferFeeRate. - Account enrichment —
getVaults()now automatically enriches accounts with on-chain supply caps and default fee structures during cache population. Supply cap reads only run for accounts with both acommunityCodeDepositorAddressanddepositFeeModuleAddress.
Improvements
VaultContractsexpanded — AddeddepositFeeModuleAddressandwithdrawFeeModuleAddressfields to the account contracts interface.- Deposit cap enforcement —
prepareDepositTxData()andprepareDepositWithPermitTxData()now validate deposits against the supply cap before building the transaction, comparing the deposit amount (converted to base units via accountant rate) against remaining capacity.
Migration from v0.5.2
Upgrade is non-breaking. Install@paxoslabs/amplify-sdk@0.5.3 to pick up the new features.The new depositCap, depositFees, and withdrawFees fields on AmplifyVault are optional — existing code that destructures account objects will not break. If you want to display fee or cap information, use the new display helpers:Direct Contract Integration — KYT Accounts
- KYT-only deposit documentation — The Direct Contract deposits guide now documents the
DistributorCodeDepositorV1(KYT) contract exclusively. Bothdeposit()anddepositWithPermit()include the required_attestationtuple parameter with empty/zero default values. Contact the Paxos Labs team to implement a compliance policy. - KYT callout on Direct Contract overview — Added a warning banner to the Direct Contract overview page about the KYT account requirement.
Documentation Fixes
- Permit deposit
txDatashape corrected — Code examples in the Deposit Workflow, Deposits Guide (Privy, Wagmi, and Viem tabs), and Quickstart now use the flattxDatastructure (txData.abi,txData.functionName,txData.args) introduced in v0.5.2. Previously these examples incorrectly referenced the pre-v0.5.2 nested shape (txData.data.abi). - BigInt serialization fix for Privy permit signing — Replaced
JSON.stringify(auth.permitData)with the SDK’stoEthSignTypedDataV4()helper in the Deposits Guide (Privy tab) and Quickstart.JSON.stringifythrows aTypeErroron BigInt values inpermitData.message. getRateInQuoteSafeABI corrected — The Accountant ABI in the Direct Contract Deposits and Withdrawals guides now includes the requiredquote: addressinput parameter. The previous ABI had an emptyinputsarray, which would produce the wrong function selector on-chain.VaultContractsfield name corrected — RenameddistributorCodeDepositorAddresstocommunityCodeDepositorAddressin the Types reference to match the SDK’s actualVaultContractsinterface.AmplifyVaulttype updated — Added missinginDeprecation: booleanandenterpriseConfig?: EnterpriseConfigfields to theAmplifyVaultinterface in the Types reference,getVaultsByConfig,findVaultByConfig, and AI Reference docs.getWithdrawalFee()parameters corrected — Fixed parameter names (withdrawAssetAddress→assetAddress,withdrawAmount→amount) and added missing required parameters (offerAsset,wantAsset,receiver) in the AI Reference. Return type corrected fromstringtobigint.getMinimumWithdrawalOrderSize()parameter corrected — Fixed parameter name (withdrawAssetAddress→assetAddress) in the AI Reference. Return type corrected fromstringtobigintwith additionalshareDecimals: numberfield.
New Features
- KYT deposit routing — Deposits automatically route to the KYT-enabled
DistributorCodeDepositorV1contract when an account hasenterpriseConfig.predicatePolicyIdset. The SDK returns a discriminated union (StandardDepositTxData | KytDepositTxData) with adepositTypefield so consumers can distinguish between standard and KYT deposits. Type guardsisKytDeposit()andisStandardDeposit()are exported for narrowing. - Account deprecation warnings — Accounts with
inDeprecation: truenow trigger a warning via the SDK logger whenprepareDepositTxData()orprepareDepositWithPermitTxData()is called. TheAmplifyVaulttype exposes the newinDeprecation: booleanfield. - Enterprise config on accounts —
AmplifyVault.enterpriseConfigcarriespredicatePolicyIdfrom the GraphQL schema, enabling client-side KYT policy awareness.
Improvements
- Flattened permit deposit return —
prepareDepositWithPermitTxData()now returns a flat object ({ depositType, abi, address, functionName, args, chainId }) matching the shape ofprepareDepositTxData(). Previously the ABI and args were nested under a.dataproperty. This makes both functions directly spreadable into viem’swriteContract.
Migration from v0.5.1
Upgrade is non-breaking for standard deposits. If you useprepareDepositWithPermitTxData() directly, update property access:prepareDeposit() workflow, no changes are needed — it handles the new shape internally.New Features
- Base mainnet — Base (
chainId8453) is included in the SDK’s built-in chain map, sogetVaultsByConfig(), deposit and withdrawal preparation, and on-chain reads resolve a properviemChainfor Base without extra configuration. PasschainId: 8453anywhere you already pass Ethereum or HyperEVM IDs. - Cross-chain chain resolution — When the wallet’s chain differs from the account’s chain (for example, multi-chain or bridged-asset flows), chain utilities can resolve the correct built-in chain config for the user’s
chainIdas well as the account’s.
@paxoslabs/amplify-sdk@0.5.1 (or latest patch) to pick up Base support.Breaking Changes
| Change | Before (v0.4.2) | After (v0.5.0) |
|---|---|---|
| Account identifier in transaction functions | yieldType: YieldType | vaultName: string |
| Account identifier in display helpers | yieldType: YieldType | vaultName: string |
| Account discovery | Implicit (SDK resolved internally) | Explicit via getVaultsByConfig() |
| Withdrawal asset discovery | Not available | getWithdrawSupportedAssets() |
| Account 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 account discovery. Filter byyieldType,chainId,depositAssetAddress,withdrawAssetAddress, andsettlementAssetAddress.getWithdrawSupportedAssets()— Fetch all supported withdrawal assets grouped by token with their available accounts.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 account identifier. This worked when each yield type mapped to a single account per chain, but broke down as multiple accounts with the same yield type launched on the same chain. The vaultName identifier is unique per account and future-proof.The new pattern is: discover → then transact.Step 1 — Add account discovery
Step 1 — Add account 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 an account 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 account 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 accounts
- Complete deposit functionality with approval management
- Slippage protection for all operations
- Comprehensive
-
Withdraw Flow
prepareWithdrawTransactionData()for transaction preparation- Automatic account data fetching via
fetchSupportedAssets() - Three-field account 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.