Skip to main content

Overview

When you create a swap via POST /api/v2/swaps, the response includes a deposit_actions array. Each transfer action contains the destination address, amount, and a blockchain-specific call_data payload — everything you need to construct and submit a transaction on the source chain. After broadcasting the transaction, you notify Layerswap with the transaction hash via the speedup endpoint so it can match the deposit and complete the swap.

Transfer Action Schema

Each item in the deposit_actions array has the following structure:
string
Either transfer (wallet transaction) or manual_transfer (manual deposit to an address). Use the action with type: "transfer" for programmatic transfers.
string
The deposit address to send funds to.
number
The amount to transfer in human-readable units (e.g. 0.1 ETH, not wei).
string
The amount in the token’s smallest unit (e.g. wei for ETH, satoshi for BTC).
string
Blockchain-specific payload used to construct the transaction. The format varies by chain — see the chain-specific guides below.
object
The source network object, including name, type, chain_id, and node_url.
object
The token being transferred, including symbol, decimals, and contract (null for native tokens).
object
The token used to pay transaction fees on this network.
number
Execution order if there are multiple transfer actions.

Step-by-Step Flow

1

Create a Swap

Call POST /api/v2/swaps with use_deposit_address: false and include the source_address parameter. The response will contain deposit_actions.
Starknet, Paradex, and TON only support the transfer flow — use_deposit_address: true is rejected for these networks. All other source networks accept either mode.
2

Extract the Transfer Action

From the response, find the transfer action with type: "transfer":
3

Execute the Transaction

Use the call_data, to_address, and amount to construct and send a blockchain-specific transaction. See the chain guides below for implementation details.
4

Notify Layerswap

After the transaction is submitted, call the speedup endpoint so Layerswap can match it faster:
5

Monitor Status

Poll GET /api/v2/swaps/{swap_id} or use webhooks to track the swap through its lifecycle.

call_data Format by Chain

The call_data field is the key piece — its format depends on the source blockchain: