v1

latestOpenAPI 3.1.02026-07-24223580832.9 KB
bridge

Create Bridge Swap Transaction

Enables seamless, cross-chain token exchanges by swapping assets between supported blockchain networks. This endpoint processes the swap transaction securely and efficiently, converting tokens from one chain to another while managing the necessary transaction parameters. The response provides key details—including source and destination chain IDs, sender and receiver addresses, transferred value, gas specifications, and a unique reference ID—allowing developers and users to verify and track the swap transaction.

💡 Compute Unit Value: 80 (Fixed)

post/defi/v1/bridge/swap

Request body

bridgeId'100' | '600' | '300' | '400' | '500'

The unique ID to specify the bridge protocol for routing cross-chain queries or transactions. Find more here.

srcTokenSymbolstring

Symbol of the token to swap.

dstChainIdstring required

The unique chain ID to specify the destination chain. Find more here.

amountInstring required

Amount of the token to be swapped.

fromstring required

Address of the token sender.

amountOutMinstring

Minimum amount accepted as the result of the swap.

gasstring

Maximum gas to be approved for the transaction.

tostring required

Address of the token recipient.

dstTokenSymbolstring

Symbol of the token to be received after the swap.

srcChainIdstring required

The unique chain ID to specify the source chain. Find more here.

srcChainSymbolstring

Symbol of the source chain.

srcTokenAddressstring

Address of the source token.

dstTokenAddressstring

Address of the destination token.

slippagestring

Percentage of the total swap value. Defaults to 1. Valid range: 0 <= slippage <= 100.

gasPrioritystring

Specifies the priority level for gas fees (e.g., 'low', 'medium', or 'high'), which influences the transaction speed and cost.

enableFeeboolean

Flag to include a basis points fee transaction alongside the main transaction when set to true.

batchOption'EIP-5792' | 'EIP-7702'

The batch option to be used for the transaction.

batcherContractstring

The EOA address of the batcher that will be used to execute the transaction when using EIP-7702 batching. If not provided, the default batcher contract for the chain will be used.

transferModestring

Specifies the mode of token transfer. The first is taxi, where tokens are sent to the destination chain at the moment of swap. The second is bus ride. Bus ride means that multiple user swaps are batched together.

Example request

{
  "bridgeId": "100",
  "srcTokenSymbol": "usdt",
  "dstChainId": "1",
  "amountIn": "10000",
  "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
  "amountOutMin": "0",
  "gas": "100000",
  "to": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
  "dstTokenSymbol": "ETH",
  "srcChainId": "1",
  "srcChainSymbol": "ETH",
  "srcTokenAddress": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
  "dstTokenAddress": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
  "slippage": "10",
  "gasPriority": "low",
  "enableFee": false,
  "batchOption": "EIP-5792",
  "batcherContract": "0x9c933f9d2efd76ce25b0d3dde84d3f94e78a50ca",
  "transferMode": "bus"
}

Response

Successful response

statusnumber

Numeric status code indicating success or failure of the API call

msgstring

Human-readable message describing the API result or error

Example response

{
  "status": 200,
  "msg": "success",
  "data": {
    "chainId": "1",
    "from": "0xa67e9b68c41b0f26184d64c26e0b2b81466e5994",
    "to": "0x8731d54E9D02c286767d56ac03e8037C07e01e98",
    "value": "337237525068648",
    "gas": "10000",
    "data": "0x9fbf10fc000000000000000000000000000000000000000000000000000000000000006d00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e5994000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000003e8000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014a67e9b68c41b0f26184d64c26e0b2b81466e59940000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "referenceId": "d1ef36652b6c427e9a96ef4d9e151b09"
  }
}