Skip to main content
For supported routes, the API returns a Depository contract address and encoded call that a wallet or smart contract can use to fund the swap. This method works well for server wallets, batched calls, and sponsored transactions. The EVM contract has been audited by Hexens.

Create the swap

Depository action fields

The response includes deposit_actions. For the contract action:
string
Depository contract address and, for ERC-20 deposits, the approval spender.
string
Encoded deposit call to submit unchanged.
string[] | null
Function argument values in call order. Use them to reconstruct the contract call when needed.
string
Native transaction value in base units. This is normally 0 for an ERC-20 call.
string | null
Gas estimate returned by the API, when available.
The API response is authoritative for the target and arguments.

Approve and submit the deposit action

viem
For native deposits, the approval is skipped and the returned amount_in_base_units is sent as value. Never replace the swap ID, receiver, or target embedded in call_data.
The examples’ 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 use GET /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.