Prerequisites
The integration requires:- A Privy app ID and app secret.
- A source Privy wallet.
- An authorization signature when the source wallet has an owner.
- Gas sponsorship.
1. Create the automation
Create an app-scoped automation withPOST /v1/wallet_automations.
See configure triggers and actions for the complete set of trigger, filter and action semantics we support today.
The source asset aliases below do not specify a chain. Privy expands each asset to its supported deployments. The destination includes a chain because every swap must have one destination.
- cURL
- Node SDK
- Python
id. API responses contain the resolved asset_address and caip2 values instead of input aliases.
See the create automation API reference for the complete schema.
2. Attach it to a wallet
An attachment enables the automation for one wallet. In the swap example, the params indicate that itsdestination_address receives the output of every generated swap.
- cURL
- Node SDK
- Python
Attaching an automation does not make it a general-purpose wallet signer. Privy authorizes each
execution against the attachment’s trigger, action, wallet, and destination.
3. Send a matching deposit
Send USDC or USDT to the source wallet on a supported chain. Privy detects the deposit and evaluates enabled attachments in creation order. The first matching automation creates a swap wallet action. Privy reads the current asset balance when the execution runs. Earlier funds held by the wallet can therefore be included in the swap.4. Observe the execution
Subscribe towallet_automation.submitted to receive both the automation execution ID and the generated wallet action ID.
The app can also list executions for the source wallet:
- cURL
- Node SDK
- Python
wallet_action_id to track the final swap through the wallet action lifecycle.
