Documentation Index
Fetch the complete documentation index at: https://developers.paxoslabs.com/llms.txt
Use this file to discover all available pages before exploring further.
@paxoslabs/amplify-sdk@1.0.0 is wallet-agnostic. Every prepare / cancel method returns
walletClient signers.
If you arrived from the v0.5.x docs, the SDK no longer exposes
smart-wallet-specific helpers, auth-method enums, or type guards. The flow
is now: call
permit.authorize, branch on auth.method, then submit
prepared.transaction. See
Migrating from 0.5
for the full mapping.What the SDK gives you
prepared.transaction is the same shape regardless of vault, chain, or wallet:
{ to, data, value } to whichever sender the connected wallet exposes. The rest of this guide shows that routing for the wallet types Amplify integrators most often use.
userAddress vs. to
Two address fields appear on most prepare requests:
| Field | Meaning |
|---|---|
userAddress | The account that submits the transaction. For EOAs, the signer. For AA, the smart-account address. |
to | (Optional) The address that receives the resulting shares (deposits) or assets (withdrawals settlement). |
to explicitly when a session key submits the transaction but the smart account should own the shares:
intendedDepositor, receiver, and refundReceiver — pass each explicitly when the submitter and the share/asset owner differ. See the Withdrawals guide.
Permit vs. approval on smart wallets
For deposits you first callclient.permit.authorize(...). It returns one of three shapes:
- Smart wallets that expose
signTypedData(EIP-712) — most Privy embedded smart wallets, Dynamic embedded wallets, and Safe — can sign EIP-2612 permits. Treatmethod: 'permit'identically to an EOA: sign the typed data, passpermitSignature+permitDeadlinetoprepareDeposit, and submit one transaction. - Smart wallets without typed-data signing (some session-key flows, restricted policy-engine accounts) cannot produce a permit. Fall back to the approval path: submit
approvalTransaction.encodedto the deposit asset, wait for confirmation, then callprepareDepositwithoutpermitSignature/permitDeadline.
auth.method === 'approval' path applies to withdrawals — except tokenAddress is the share token (vaultAddress), and the only valid response shapes are approval or already_approved.
Pattern 1 — Privy / Dynamic smart wallets (UserOps under the hood)
Both Privy’suseSmartWallets and Dynamic’s embedded smart-account adapter expose a sendTransaction-style API that internally builds a UserOperation, sends it to a bundler, and resolves with a hash. From the SDK’s perspective they are identical — just pass prepared.transaction.{to,data,value} through.
The hook signatures,
sendTransaction parameters, and how gas sponsorship is
configured are dictated by Privy and Dynamic — not by the Amplify SDK. The
code above is illustrative; consult the wallet provider’s docs for the
authoritative API.signTypedData, you can collapse to a single call by signing the permit first and skipping the approval step entirely.
Pattern 2 — ERC-4337 bundlers (Alchemy, Pimlico, Biconomy)
Native ERC-4337 SDKs expose batched submission assendTransactions({ requests }) or sendUserOperation. The response is a userOpHash, not a transaction hash:
- Do not use wagmi’s
useWaitForTransactionReceiptwith auserOpHash— poll the bundler instead (waitForUserOperationReceipt). - Gas sponsorship is configured on the smart-account client (paymaster), not on the prepared transaction. The SDK never sets
gasPriceormaxFeePerGas.
Pattern 3 — viem walletClient (EOA or AA exposed as JSON-RPC)
For non-AA wallets and for AA wallets exposed through a viem walletClient (Safe via safe-apps-sdk, MetaMask Smart Account, etc.), submit directly:
Pattern 4 — Server-side signers
When the signer lives on your backend (custodial flows, automation), the samewalletClient works with an in-memory account:
Error handling
Smart-wallet submission can fail in three distinct layers — handle each:Checklist
The wallet supports EIP-712 signTypedData
The wallet supports EIP-712 signTypedData
Use the
permit path. One UserOp / one transaction for the whole deposit.The wallet does not support typed-data signing
The wallet does not support typed-data signing
Use the
approval path. Batch approve + deposit calls together so the
user signs once. If the wallet cannot batch (rare for modern AA), submit
sequentially and wait for the approval receipt before preparing the
deposit.Session keys / delegated signers
Session keys / delegated signers
Pass the session-key address as
userAddress, and the smart account as
to (deposits) or intendedDepositor / receiver / refundReceiver
(withdrawals). The session key submits the tx; the smart account owns the
shares.Server-side custodial signers
Server-side custodial signers
Use a viem
walletClient with a privateKeyToAccount. Keep the key out
of the browser; expose only the prepared transaction shape to clients.Related
- Deposits guide — full deposit flow with viem + wagmi.
- Withdrawals guide — share-token approval +
submitOrder. - AI Coding Reference — every subclient method.
- Migrating from 0.5 — old smart-wallet helpers and their 1.0.0 equivalents.