Practical “I hit X, what’s wrong” guide for the 1.0.0 SDK. Every recipe assumes you have anDocumentation Index
Fetch the complete documentation index at: https://developers.paxoslabs.com/llms.txt
Use this file to discover all available pages before exploring further.
AmplifyClient constructed like this:
Cannot find module '@paxoslabs/amplify-sdk'
Cannot find module '@paxoslabs/amplify-sdk'
Cause: Package isn’t installed, or it’s installed but TypeScript can’t resolve it.Fix:There are no required peer dependencies — the SDK ships its own HTTP layer. You still need a wallet/RPC client (e.g.
viem, wagmi, ethers) to submit the calldata returned by prepareDeposit / prepareWithdrawal, but those are your choice.If installation succeeds but the import still fails, see “Types resolve to any” below — it’s almost always a moduleResolution issue.AmplifyError: 401 Unauthorized
AmplifyError: 401 Unauthorized
AmplifyError: 403 Forbidden
AmplifyError: 403 Forbidden
Cause: API key is valid, but the account associated with it doesn’t have access to the vault or operation you’re calling.Fix: Verify the vault is enabled for your API key.
client.vaults.list() only returns vaults your key can see, so a 403 on prepareDeposit for a vault that doesn’t appear in list() is the expected behaviour — request access from your Paxos Labs contact.AmplifyError: 400 on prepareDeposit
AmplifyError: 400 on prepareDeposit
Cause: Almost always a bad input. The most common offenders, in order:
- Bad
vaultAddress— must be0x+ 40 hex chars (the BoringVault contract address). Get it fromclient.vaults.list()→deployments[].boringVaultAddress. - Wrong
chainId— the vault isn’t deployed on that chain. EachVaultDto.deployments[]entry has its ownchainId; pass the one that matches your wallet’s network. depositAmountin human units instead of base units —depositAmountis a decimal string in base units."1.5"USDC is wrong;"1500000"(1.5 USDC at 6 decimals) is right.- Missing
userAddress— required even whentois also passed.
AmplifyError: 404 on prepareWithdrawal
AmplifyError: 404 on prepareWithdrawal
Cause:
wantAsset is not an asset this vault redeems to on this chain.A vault accepts deposits in one set of assets and pays out withdrawals in another. The withdrawable set is on each vault’s assets[] entry where withdrawable: true.Fix:Withdrawal submitOrder reverts with panic 0x11
Withdrawal submitOrder reverts with panic 0x11
Panic EIP-2612 permit is not supported for vault shares —
0x11 is an arithmetic underflow. On the withdraw path it has two distinct causes — fix the right one.Cause 1 — wrong approval spender. The single most common mistake is approving the vault address (the share token itself) as the spender. The spender must be the WithdrawQueue address from the same vault.Fix: Read vault.withdrawQueueAddress and pass that as the spender on a standard ERC-20 approve:client.permit.authorize with tokenAddress: vaultAddress returns method: 'approval' or method: 'already_approved'. There is no permit-signature path on the withdraw flow.Cause 2 — fee consumes the entire offer. When the offer-fee percentage plus the flat fee adds up to ≥ shareAmount, the post-fee math inside submitOrder underflows and panics. Common on small redemptions of vaults that carry a non-trivial flat fee.Fix: Call client.withdraw.calculateFee before prepareWithdrawal and bail out when feeAmount >= shareAmount:AmplifyError: 422 on permit.authorize
AmplifyError: 422 on permit.authorize
AmplifyTimeoutError
AmplifyTimeoutError
Cause: The request exceeded
requestOptions.timeoutInSeconds (default 60). Usually a transient network or backend slowness.Fix: Retry with backoff. Each method accepts a per-call requestOptions.maxRetries (default 2); set a higher cap when you control retry budget yourself:Deposit reverts on-chain — decimal mismatch
Deposit reverts on-chain — decimal mismatch
Cause: For an Amplify vault, the depositor token, base token, and share token must all share the same number of If they don’t match, you’ve picked the wrong vault for this asset — check
decimals. The vault math collapses if they don’t, and an on-chain deposit will revert.Fix: Read decimals() from each token via viem (or your wallet client) and compare against the vault’s configured assets:client.vaults.listAssets({ filter: 'depositable=true' }) for valid pairings.client.vaults.list() returns no vaults
client.vaults.list() returns no vaults
Cause: Almost always a missing/invalid API key or a filter that excludes everything.Fix:
- Call without a filter to see what your key has access to:
- If that’s empty, the key has zero vault access — see “401 Unauthorized” / “403 Forbidden”.
- If non-empty, narrow with a filter that matches the vault you want. AIP-160-style filters use
ANDand=:
Types resolve to `any`
Types resolve to `any`
Cause: Then restart your TS server.
tsconfig.json moduleResolution is set to node (the legacy CJS resolver) and can’t see the package’s exports map.Fix: Set moduleResolution to bundler (Vite/Next/most modern toolchains) or node16 / nodenext:import type { Amplify } from '@paxoslabs/amplify-sdk' should resolve to a namespace of DTOs.Type imports — what to import where
Type imports — what to import where
The SDK draws a clean line between runtime and types:
Amplify is a type-only namespace re-export. Importing it as a value (import { Amplify }) works at runtime but is meaningless — there are no runtime properties on it. Use import type to make intent obvious and to let the bundler tree-shake it.Migrating from 0.5.x
Migrating from 0.5.x
The 1.0.0 SDK is a clean break —
initAmplifySDK, LogLevel, every flat function export (prepareDeposit, prepareWithdrawal, getVaultsByConfig, etc.), every typed error class, and all ABI/EIP-712 helpers are gone. Everything now hangs off AmplifyClient subclients, and the only error types are AmplifyError and AmplifyTimeoutError.See Migrating from 0.5.x for a function-by-function mapping.Inspecting an AmplifyError
Every non-2xx response, network failure, and JSON parse error throws AmplifyError. The shape is small and stable:
body is unknown because the backend may return any JSON shape. Narrow defensively before reading fields off it — never destructure blind.
Getting help
If a request is failing in a way none of the recipes above explain, capture the fullAmplifyError (including statusCode, body, and the request input that triggered it) and reach out to support@paxoslabs.com.