Taking actions with a wallet
To take an action (such as a swap) with a wallet in Privy, there are two high-level approaches.| Integration | Functionality | Recommended for |
|---|---|---|
| Low-level RPC | Compute raw signatures and execute EVM and SVM JSON-RPC requests. Requires developers to construct their own transaction payloads and facilitate multi-transaction flows. | Custom use cases and lower-level flows |
| Wallet action APIs | Execute common onchain flows such as transfers, swaps, DeFi, and more via a simple, intuitive interface. Privy handles the onchain complexity. | Most use cases |
Available actions
The current set of abstracted wallet actions APIs includes the endpoints below. All endpoints begin with the route/v1/wallets/{wallet_id}/, followed by the slug.
| Action | Slug | Description |
|---|---|---|
| Transfer | transfer | Executes a transfer of stablecoins (USDC, USDT, USDB) or native tokens (ETH, SOL, POL). |
| Swap | swap | Swaps one asset for another via Uniswap. |
Wallet action lifecycle
When your application executes a wallet action via one of the endpoints listed above, Privy creates a wallet action resource to model the action and returns it in the API response. In particular, your application can inspect the wallet action resource to get:type: the type of the action ('swap','transfer', etc.)status: the current status of the actionsteps: the steps required to complete the full action, as actions may require multiple transactions in some cases. Within each step, your application can inspect details like transaction hashes, chain IDs, and more.
steps field of the wallet actions resource is intended to offer lower-level information as to how an action was executed; to generally understand whether an action succeeded or failed, we recommend relying on status.
You can fetch the wallet action resource for a given action via the REST API or subscribe to webhooks on wallet action status updates.
Gas management
By default, the wallet action APIs listed above will optimistically sponsor gas for transactions. Concretely, this means:- If your application has enabled gas sponsorship and has sufficient gas credits, any transactions executed by the wallet action will be sponsored.
- If your application does not have gas sponsorship enabled, any actions executed by the wallet action will not be sponsored, and the wallet must pay for gas from its own native token balance.
- If your application has enabled gas sponsorship, but you pass
sponsor: falsein your request body, any transactions executed by the wallet action will not be sponsored.

