@paxoslabs/amplify-sdk@1.0.0, instantiate AmplifyClient once, and call its subclient methods.
Requirements
- Node.js
>= 24 - An API key from Paxos Labs
viem (and optionally wagmi) to sign and broadcast the transactions the SDK returns.
Install
- pnpm
- npm
- yarn
- bun
Optional signing / wallet libraries
These are not pulled in by the SDK, but you’ll typically install them in the consumer:- Viem only
- Wagmi (React)
Get an API key
API keys are issued through the Paxos Labs onboarding process — contact your Paxos Labs representative if you don’t have one yet. Store the secret in a server-side environment variable; never bundle it into a browser.Instantiate the client
Construct anAmplifyClient once and reuse it across requests on a server.
Constructor options
The SDK defaults to production (
AmplifyEnvironment.Production). You only need to pass environment or baseUrl for non-production use cases.Server-side vs. client-side usage
The API key authenticates every call and must not ship to the browser. The recommended pattern is:- Browser code calls your own backend (a Next.js Route Handler, a Server Action, an Express route, etc.).
- Your backend constructs the
AmplifyClient, calls the SDK, and returns the prepared{ to, data, value }payload. - Browser code signs and broadcasts the transaction with the user’s wallet (wagmi / viem / Privy / Dynamic / etc.).
Next.js Route Handler
Browser-side submission
First call
A quick smoke test to confirm your key works:AmplifyError (see Errors).
Response format
By default,prepare* and cancel calls return ABI-encoded calldata only:
responseFormat: 'full' if you want the ABI fragment, function name, and args alongside the encoded calldata — useful when you want to re-encode in your own ABI plumbing or render the call in a UI.
Decimals
The SDK accepts and returns token amounts as base-units decimal strings. It never parses human-readable inputs. Convert before calling:decimals() live from the token contract (e.g. via viem’s readContract or wagmi’s useBalance).
Errors
Every method throwsAmplifyError on non-2xx responses, network failures, and serialization errors. Timeouts throw AmplifyTimeoutError.
Next steps
- Deposits guide — full deposit flow with permit and approval branches
- Withdrawals guide —
submitOrder, fee estimation, listing, and cancel - AI Coding Reference — every subclient method, with params and response shapes
- Migrating from 0.5.x — for upgrading an existing integration