Active-Routes

Returns route details

v2/route/active-routes

How this endpoint is to be used :

  • This endpoint returns details about a given route using activeRouteId

Returns details about a given route

GET https://api.socket.tech/active-routes

Request Body

NameTypeDescription

activeRouteId*

string

ID of active route

{
  "success": true,
  "result": {
    "activeRouteId": 420,
    "userAddress": "string",
    "totalUserTx": 3,
    "userTxs": [
    {
            "sender": "string",
            "txType": "string",
            "chainId": 137,
            "gasFees": {
               "asset": {
                  "icon": "string",
                  "name": "string",
                  "symbol": "string",
                  "address": "string",
                  "chainId": 137,
                  "logoURI": "https://maticnetwork.github.io/polygon-token-assets/assets/matic.svg",
                  "decimals": 18
               },
               "gasLimit":376962,
               "feesInUsd":0.0284040867
            },
            "toAsset":{
               "icon":"https://maticnetwork.github.io/polygon-token-assets/assets/usdt.svg",
               "name":"Tether USD",
               "symbol":"USDT",
               "address":"0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
               "chainId":137,
               "logoURI":"https://maticnetwork.github.io/polygon-token-assets/assets/usdt.svg",
               "decimals":6
            },
            "protocol":{
               "icon":"https://bridgelogos.s3.ap-south-1.amazonaws.com/1inch.png",
               "name":"oneinch",
               "displayName":"1Inch"
            },
            "toAmount":"99970386",
            "fromAsset":{
               "icon":"https://maticnetwork.github.io/polygon-token-assets/assets/usdc.svg",
               "name":"USD Coin",
               "symbol":"USDC",
               "address":"0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
               "chainId":137,
               "logoURI":"https://maticnetwork.github.io/polygon-token-assets/assets/usdc.svg",
               "decimals":6
            },
            "recepient":"0x3e8cB4bd04d81498aB4b94a392c334F5328b237b",
            "fromAmount":"100000000",
            "userTxType":"dex-swap",
            "userTxIndex":0,
            "approvalData":{
               "owner":"0x3e8cB4bd04d81498aB4b94a392c334F5328b237b",
               "allowanceTarget":"0x2ddf16BA6d0180e5357d5e170eF1917a01b41fc0",
               "approvalTokenAddress":"0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
               "minimumApprovalAmount":"100000000"
            }
    ],
    "fromChainId": 137,
    "toChainId": 56,
    "fromAssetAddress": "string",
    "toAssetAddress": "string",
    "fromAmount": "string",
    "toAmount": "string",
    "routeStatus": "PENDING",
    "createdAt": "string",
    "updatedAt": "string",
    "currentUserTxIndex": 1642009930239,
    "fromAsset": {
      "name": "USD Coin",
      "address": "0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
      "icon": "https://maticnetwork.github.io/polygon-token-assets/assets/usdc.svg",
      "decimals": 6,
      "symbol": "USDC",
      "chainId": "137",
      "logoURI": "https://maticnetwork.github.io/polygon-token-assets/assets/usdc.svg"
    },
    "toAsset": {
      "name": "USD Coin",
      "address": "0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
      "icon": "https://maticnetwork.github.io/polygon-token-assets/assets/usdc.svg",
      "decimals": 6,
      "symbol": "USDC",
      "chainId": "137",
      "logoURI": "https://maticnetwork.github.io/polygon-token-assets/assets/usdc.svg"
    }
  }
}

API-KEY needs to be passed in the headers while making the GET request

Description of response parameters :

ParameterDescription

success

Indicates successful response from endpoint, as intended.

activeRouteId

ID of route

userAddress

Address of user bridging via the route

totalUserTx

Number of transactions user has to perform on the route

userTxs

Array of objects breaking down each user transaction

userTxs.sender

Address of tx sender

userTxs.txType

Type of transaction. Values in Types page

userTxs.chainId

ID of chain for transaction

userTxs.gasFees.asset

Object with metadata of gas token for chain

userTxs.gasFees.gasLimit

Estimated gasLimit for transaction

userTxs.gasFees.feesInUsd

Estimated gas fee in USD to display on UI. This could vary as per gas prices.

userTxs.toAsset

Object with metadata of receiving token in given tx

userTxs.protocol

Object with metadata of protocol

userTxs.toAmount

Amount of toAsset token to be received in given tx

userTxs.fromAsset

Object with metadata of sending token in given tx

userTxs.recipient

Address of recipient in given tx

userTxs.fromAmount

Amount of fromAsset token sent in given tx

userTxs.userTxType

Action of transaction user performs. Values in Types page

userTxs.userTxIndex

Index of transaction from totalUserTx

userTxs.approvalData

Object with data for token approval

fromChainId

ID of source chain

toChainId

ID of destination chain

fromAssetAddress

Address of sending token

toAssetAddress

Address of receiving token

fromAmount

Amount of sending token being bridged

toAmount

Amount of destination token received

routeStatus

Status of route. Values on Types page.

transactionData

Object with hashes of transactions performed by user

createdAt

Timestamp of route being created

updatedAt

Timestamp of route being updated

currentUserTxIndex

Index of transaction user last performed

fromAsset

Object with metadata of sending token

toAsset

Object with metadata of receiving token

TEST QUERY :

https://api.socket.tech/v2/swagger/#/Routes/ActiveRoutesController_getActiveRoutes

Last updated