Overview
When you create a swap viaPOST /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 thedeposit_actions array has the following structure:
Either
transfer (wallet transaction) or manual_transfer (manual deposit to an address). Use the action with type: "transfer" for programmatic transfers.The deposit address to send funds to.
The amount to transfer in human-readable units (e.g.
0.1 ETH, not wei).The amount in the token’s smallest unit (e.g. wei for ETH, satoshi for BTC).
Blockchain-specific payload used to construct the transaction. The format varies by chain — see the chain-specific guides below.
The source network object, including
name, type, chain_id, and node_url.The token being transferred, including
symbol, decimals, and contract (null for native tokens).The token used to pay transaction fees on this network.
Execution order if there are multiple transfer actions.
Step-by-Step Flow
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.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.Notify Layerswap
After the transaction is submitted, call the speedup endpoint so Layerswap can match it faster:
call_data Format by Chain
Thecall_data field is the key piece — its format depends on the source blockchain:
| Blockchain | call_data Format | Guide |
|---|---|---|
| EVM (Ethereum, Arbitrum, Base, etc.) | Hex-encoded transaction data (0x...) | EVM Guide |
| Bitcoin | Numeric memo (encoded as OP_RETURN) | Bitcoin Guide |
| Solana | Base64-encoded serialized transaction | Solana Guide |
| Starknet | JSON array of Starknet calls | Starknet Guide |
| TON | JSON object with comment (and amount for Jettons) | TON Guide |
| Tron | String memo (hex-encoded into transaction data) | Tron Guide |
| Fuel | JSON object with script and quantities | Fuel Guide |