Skip to main content
@paxoslabs/amplify-sdk@1.0.0 is wallet-agnostic. Every prepare / cancel method returns
The SDK does not bundle, sign, or submit anything. It just produces calldata. That means you can submit Amplify transactions from any wallet that can issue a contract call — EOAs via wagmi/viem, smart-contract accounts via Privy or Dynamic, ERC-4337 bundlers via Alchemy or Pimlico, and server-side 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 authorization.detect, 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:
Your job is to route { 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: Set to explicitly when a session key submits the transaction but the smart account should own the shares:
Withdrawals expose the same idea via 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 call client.core.authorization.detect(...). 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. Treat method: 'permit' identically to an EOA: sign the typed data, pass permitSignature + permitDeadline to prepare, 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.encoded to the deposit asset, wait for confirmation, then call prepare without permitSignature / permitDeadline.
A defensive client handles all three branches:
The same 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’s useSmartWallets 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.
If the asset supports permit and the smart wallet supports 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 as sendTransactions({ requests }) or sendUserOperation. The response is a userOpHash, not a transaction hash:
Two things to remember:
  1. Do not use wagmi’s useWaitForTransactionReceipt with a userOpHash — poll the bundler instead (waitForUserOperationReceipt).
  2. Gas sponsorship is configured on the smart-account client (paymaster), not on the prepared transaction. The SDK never sets gasPrice or maxFeePerGas.

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:
Permit signing uses the same client:

Pattern 4 — Server-side signers

When the signer lives on your backend (custodial flows, automation), the same walletClient works with an in-memory account:
Server-side keys must never be sent to a browser. Keep the signer behind a trusted endpoint and surface only prepared.transaction to clients that need to display previews.

Error handling

Smart-wallet submission can fail in three distinct layers — handle each:

Checklist

Use the permit path. One UserOp / one transaction for the whole deposit.
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.
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.
Use a viem walletClient with a privateKeyToAccount. Keep the key out of the browser; expose only the prepared transaction shape to clients.