Skip to main content

POST 

https://api.socket.tech/v2/route/start

Function that takes in a route and starts the selected route. Function is responsible for

  • Saving the selected route to bridge tokens from one chain to another.
  • Saving the fromChain, toChain, and fromAsssetAddress and toAssetAddress
  • Returns the Active Route Id, Current Tx, Total number of txs, txType

Request​

Header Parameters

    API-KEY string

Body

required

    fromChainId stringrequired

    Possible values: [MAINNET_CHAIN_ID, OPTIMISM_CHAIN_ID, BSC_CHAIN_ID, XDAI_CHAIN_ID, POLYGON_CHAIN_ID, FANTOM_CHAIN_ID, ZKSYNC_ERA_CHAIN_ID, POLYGON_ZKEVM_CHAIN_ID, MANTLE_CHAIN_ID, BASE_CHAIN_ID, MODE_CHAIN_ID, ARBITRUM_CHAIN_ID, AVAX_CHAIN_ID, LINEA_CHAIN_ID, BLAST_CHAIN_ID, SCROLL_CHAIN_ID, ZORA_CHAIN_ID, AURORA_CHAIN_ID]

    Chain id of source chain.

    toChainId stringrequired

    Possible values: [MAINNET_CHAIN_ID, OPTIMISM_CHAIN_ID, BSC_CHAIN_ID, XDAI_CHAIN_ID, POLYGON_CHAIN_ID, FANTOM_CHAIN_ID, ZKSYNC_ERA_CHAIN_ID, POLYGON_ZKEVM_CHAIN_ID, MANTLE_CHAIN_ID, BASE_CHAIN_ID, MODE_CHAIN_ID, ARBITRUM_CHAIN_ID, AVAX_CHAIN_ID, LINEA_CHAIN_ID, BLAST_CHAIN_ID, SCROLL_CHAIN_ID, ZORA_CHAIN_ID, AURORA_CHAIN_ID]

    Chain id of destination chain.

    fromAssetAddress stringrequired

    Token address on source chain.

    toAssetAddress stringrequired

    Token address on destination chain.

    includeFirstTxDetails boolean

    Include the tx details for the first user transaction. If true it will return the txData txType etc. If false, it will only return the active route Id of the selected route.

    route

    object

    required

    routeId stringrequired

    Unique id for each route.

    isOnlySwapRoute booleanrequired

    Contains only on single swap.

    fromAmount stringrequired

    Sending token amount.

    chainGasBalances objectrequired
    minimumGasBalances objectrequired
    toAmount stringrequired

    Approximate receiving token amount.

    usedBridgeNames string[]required

    Possible values: [hop, hopCctp, anyswap, anyswap-router-v4, anyswap-router-v6, polygon-bridge, arbitrum-bridge, hyphen, across, optimism-bridge, celer, refuel-bridge, stargate, connext, cctp, synapse, base-bridge, zora-bridge, zksync-native, symbiosis, gnosis-native-bridge, mantle-native-bridge, scroll-native-bridge, mode-native-bridge, super-bridge, stargate-v2]

    Array of bridges used in the route

    totalUserTx numberrequired

    Total number of transactions for the route.

    totalGasFeesInUsd numberrequired

    Combined USD gas fees for all transactions in the route.

    recipient stringrequired

    Address of user receiving the amount.

    sender stringrequired

    Address of user making the transactions.

    userTxs object[]required

    Array of user transactions.

    receivedValueInUsd number

    Receive Value

    inputValueInUsd number
    outputValueInUsd number
    serviceTime numberrequired

    Estimate of total time in seconds, excluding the transaction time.

    maxServiceTime numberrequired

    Estimate of max time to exit from the chain in seconds.

    integratorFee

    object

    required

    feeTakerAddress string
    amount string

    asset

    object

    name string

    Name of token.

    address string

    Address of token.

    icon string

    URL for icon of token.

    decimals number

    Decimal used for token.

    symbol string

    Symbol of token.

    chainId string

    Possible values: [MAINNET_CHAIN_ID, OPTIMISM_CHAIN_ID, BSC_CHAIN_ID, XDAI_CHAIN_ID, POLYGON_CHAIN_ID, FANTOM_CHAIN_ID, ZKSYNC_ERA_CHAIN_ID, POLYGON_ZKEVM_CHAIN_ID, MANTLE_CHAIN_ID, BASE_CHAIN_ID, MODE_CHAIN_ID, ARBITRUM_CHAIN_ID, AVAX_CHAIN_ID, LINEA_CHAIN_ID, BLAST_CHAIN_ID, SCROLL_CHAIN_ID, ZORA_CHAIN_ID, AURORA_CHAIN_ID]

    Chain id of the token

    logoURI string

    URL for icon of token.

    chainAgnosticId string

    Unique Id over all chains

    t2bReceiverAddress string
    extraData object

    refuel

    object

    required

    fromAmount stringrequired
    toAmount stringrequired

    gasFees

    object

    required

    gasLimit numberrequired

    Approx Gas Limit of the transaction.

    feesInUsd numberrequired

    USD value of gas fees at current gas price.

    asset

    object

    required

    Gas token details.

    name string

    Name of token.

    address stringrequired

    Address of token.

    icon string

    URL for icon of token.

    decimals number

    Decimal used for token.

    symbol stringrequired

    Symbol of token.

    chainId stringrequired

    Possible values: [MAINNET_CHAIN_ID, OPTIMISM_CHAIN_ID, BSC_CHAIN_ID, XDAI_CHAIN_ID, POLYGON_CHAIN_ID, FANTOM_CHAIN_ID, ZKSYNC_ERA_CHAIN_ID, POLYGON_ZKEVM_CHAIN_ID, MANTLE_CHAIN_ID, BASE_CHAIN_ID, MODE_CHAIN_ID, ARBITRUM_CHAIN_ID, AVAX_CHAIN_ID, LINEA_CHAIN_ID, BLAST_CHAIN_ID, SCROLL_CHAIN_ID, ZORA_CHAIN_ID, AURORA_CHAIN_ID]

    Chain id of the token

    logoURI string

    URL for icon of token.

    chainAgnosticId string

    Unique Id over all chains

    gasAmount stringrequired

    Estimated Amount of gas token will be used

    recipient stringrequired
    serviceTime numberrequired

    fromAsset

    object

    required

    name string

    Name of token.

    address stringrequired

    Address of token.

    icon string

    URL for icon of token.

    decimals number

    Decimal used for token.

    symbol stringrequired

    Symbol of token.

    chainId stringrequired

    Possible values: [MAINNET_CHAIN_ID, OPTIMISM_CHAIN_ID, BSC_CHAIN_ID, XDAI_CHAIN_ID, POLYGON_CHAIN_ID, FANTOM_CHAIN_ID, ZKSYNC_ERA_CHAIN_ID, POLYGON_ZKEVM_CHAIN_ID, MANTLE_CHAIN_ID, BASE_CHAIN_ID, MODE_CHAIN_ID, ARBITRUM_CHAIN_ID, AVAX_CHAIN_ID, LINEA_CHAIN_ID, BLAST_CHAIN_ID, SCROLL_CHAIN_ID, ZORA_CHAIN_ID, AURORA_CHAIN_ID]

    Chain id of the token

    logoURI string

    URL for icon of token.

    chainAgnosticId string

    Unique Id over all chains

    toAsset

    object

    required

    name string

    Name of token.

    address stringrequired

    Address of token.

    icon string

    URL for icon of token.

    decimals number

    Decimal used for token.

    symbol stringrequired

    Symbol of token.

    chainId stringrequired

    Possible values: [MAINNET_CHAIN_ID, OPTIMISM_CHAIN_ID, BSC_CHAIN_ID, XDAI_CHAIN_ID, POLYGON_CHAIN_ID, FANTOM_CHAIN_ID, ZKSYNC_ERA_CHAIN_ID, POLYGON_ZKEVM_CHAIN_ID, MANTLE_CHAIN_ID, BASE_CHAIN_ID, MODE_CHAIN_ID, ARBITRUM_CHAIN_ID, AVAX_CHAIN_ID, LINEA_CHAIN_ID, BLAST_CHAIN_ID, SCROLL_CHAIN_ID, ZORA_CHAIN_ID, AURORA_CHAIN_ID]

    Chain id of the token

    logoURI string

    URL for icon of token.

    chainAgnosticId string

    Unique Id over all chains

    fromChainId numberrequired
    toChainId numberrequired

    destinationCallData

    object

    destinationPayload stringrequired
    destinationGasLimit stringrequired

    bridgeInsuranceData

    object

    amount stringrequired

    Amount of token to be used in insurance.

Responses​

Starts the Active Route and gives back the data to start the route

Schema

    userTxType string

    Possible values: [approve, fund-movr, claim, dex-swap, sign]

    txTarget string
    chainId string

    Possible values: [MAINNET_CHAIN_ID, OPTIMISM_CHAIN_ID, BSC_CHAIN_ID, XDAI_CHAIN_ID, POLYGON_CHAIN_ID, FANTOM_CHAIN_ID, ZKSYNC_ERA_CHAIN_ID, POLYGON_ZKEVM_CHAIN_ID, MANTLE_CHAIN_ID, BASE_CHAIN_ID, MODE_CHAIN_ID, ARBITRUM_CHAIN_ID, AVAX_CHAIN_ID, LINEA_CHAIN_ID, BLAST_CHAIN_ID, SCROLL_CHAIN_ID, ZORA_CHAIN_ID, AURORA_CHAIN_ID]

    activeRouteId numberrequired
    txData string
    txType string

    Possible values: [eth_sendTransaction, eth_signMessage]

    value string
    userTxIndex number
    totalUserTx numberrequired

    approvalData

    object

    minimumApprovalAmount stringrequired

    Minimum amount of approval needed.

    approvalTokenAddress stringrequired

    Address of token for which approval is required.

    allowanceTarget stringrequired

    Contract address that needs approval.

    owner stringrequired

    Address of owner.

Loading...