Create the swap
Depository action fields
The response includesdeposit_actions. For the contract action:
Function argument values in call order. Use them to reconstruct the contract call when needed.
Approve and submit the deposit action
- EVM (viem)
- Tron (TronWeb)
viem
amount_in_base_units is sent as value. Never replace the swap ID, receiver, or target embedded in call_data.feeLimit and gas values are caps, not estimates — set them according to your execution policy. Do not reorder or replace the returned arguments.
Detect the deposit
Store the submitted transaction hash, then useGET /swaps/by_transaction_hash/{hash} or GET /swaps/{id}. The swap then follows the normal lifecycle.
See the Privy server wallets recipe for batching approval and deposit in a sponsored server-wallet flow.