Skip to main content

Overview

When you create a swap via POST /api/v2/swaps, the response includes a deposit_actions array. A deposit action is the exact on-chain transaction to submit on the source chain to fund the swap: a target to_address, an amount, and a blockchain-specific call_data payload. Submit it and Layerswap detects the deposit and delivers the funds on the destination chain. This page is the reference for the deposit action object and the funding modes. The per-chain guides below show how to build and submit the transaction on each blockchain. For the end-to-end flow (discover → quote → create → execute → track), see the API Integration guide.

Funding modes

The method you choose when creating the swap determines the deposit action you receive:
  • Direct transfer (default) and Depository (use_depository: true) return a type: "transfer" action with call_data to submit (Depository also adds gas_limit and encoded_args).
  • Deposit address (use_deposit_address: true) returns a type: "manual_transfer" action — a generated address with call_data: null.
See Choosing a method for the full comparison and when to use each.
use_depository and use_deposit_address are mutually exclusive. Some networks support only a subset of modes (e.g. Starknet and TON support only the transfer flow) — see each chain guide.

Deposit action schema

Each item in the deposit_actions array has the following structure:
type
string
Either transfer (submit a transaction built from call_data) or manual_transfer (send funds to a generated deposit address; call_data is null).
to_address
string
The transaction target — the solver address, a generated deposit address, or the Depository contract, depending on the funding mode.
amount
number
The amount to send in human-readable units (e.g. 0.1 ETH, not wei). 0 for ERC20 depository deposits (the amount is carried inside call_data).
amount_in_base_units
string
The amount in the token’s smallest unit (wei for ETH, satoshi for BTC, …). For native transfers, send this as the transaction value.
call_data
string | null
Blockchain-specific payload used to construct the transaction. null for manual_transfer. The format varies by chain — see the guides below.
network
object
The source network object, including name, type, chain_id, and node_url.
token
object
The token being deposited, including symbol, decimals, and contract (null for native tokens).
fee_token
object
The token used to pay transaction fees on this network.
order
number
Execution order. There is normally a single action; if more than one is returned, execute them in ascending order.
gas_limit
string
Suggested gas limit for the contract call. Returned only for Depository deposits.
encoded_args
string[]
The individual, decoded contract-call arguments, for integrators who prefer to build the call themselves. Returned only for Depository deposits.

Step-by-step flow

1

Create a swap

Call POST /api/v2/swaps. The response contains the deposit_actions array.
2

Read the deposit action

Take the first action (or iterate in order):
3

Submit the transaction

Build and broadcast the transaction on the source chain using call_data, to_address, and the amount. The mechanics differ per chain — follow the matching guide below (and Depository for depository deposits).
Submit the returned call_data verbatim. It encodes the swap id and the assigned receiver; altering it means Layerswap can’t match your deposit to the swap.
4

Speed up matching (optional)

Report the transaction hash so Layerswap matches it without waiting for routine polling:
5

Track the swap

Poll GET /api/v2/swaps/{swapId} and follow the swap lifecycle to completion.

call_data format by chain

The call_data format depends on the source blockchain: For funding via the on-chain contract (use_depository: true), see the Depository guide.