Generates a transaction for cross-chain swaps, bridges, and calls. The action includes transaction data, routing information, and fee calculations for executing the requested operation.
Limited demo key for API Reference: 5c951bc81da566bbd030ba8e20724063.
Type of action to perform Type of action to perform.
swap-action, evm-calldata-tx The address of the sender/user EVM address (20 bytes hex)
Source chain ID Chain ID. Find in the list of supported networks
Source token address EVM address (20 bytes hex)
Destination chain ID Chain ID. Find in the list of supported networks
Destination token address EVM address (20 bytes hex)
Slippage tolerance in bps
0 <= x <= 10000The exact in or exact out amount of the swap
swap-action
Swap direction for the action
swap-action
Swap direction for the action.
exact-amount-in, exact-amount-out Address to receive the swapped tokens
swap-action
EVM address (20 bytes hex)
The EVM address of the target contract (20 bytes hex)
evm-calldata-tx
EVM address (20 bytes hex)
Calldata for the transaction
evm-calldata-tx
Hex string with 0x prefix
Value to send with transaction
evm-calldata-tx
The amount of Erc20 being transferred
Optional: Use for calls requiring Erc20 transfers
evm-calldata-tx
The Erc20 spender requiring approval for the transaction call
Optional: Will default to the to address
evm-calldata-tx
EVM address (20 bytes hex)
Specific bridge protocols to use
Optional: Will default to all available protocols
Bridge protocol identifier.
optimism, arbitrum, oft, yield-oft, hyperlane, ghost, mayan, across, relay, alt-vm-1, alt-vm-2 Alternate address to receive refunds
Optional: Will default to the sender
EVM address (20 bytes hex)
Return a deposit address for deposit-based flows
Optional: Set to true to receive a deposit address in the response
Successful response with action data
Transaction data for execution
Transaction ID
Virtual machine identifier.
evm, solana, alt-vm, hypercore Expected amount to input (exclusive of slippage - recommended value to display in frontend)
Maximum amount to input (inclusive of slippage)
Expected amount delivered to users (exclusive of slippage - recommended value to display in frontend)
Minimum amount delivered to users (inclusive of slippage)
Swaps.xyz fee
Application fee (your fee!)
Exchange rate for the swap.
Estimated transaction time in seconds.
Estimated price impact percentage.
Flag indicating whether the transaction object requires a source token approval check.
All available routes for the action.
Bridge fee (from aggregated providers)
Bridge IDs used in the route.
Bridge protocol identifier.
optimism, arbitrum, oft, yield-oft, hyperlane, ghost, mayan, across, relay, alt-vm-1, alt-vm-2 Bridge route information (src chain + token, dst chain + token, BridgeId)