Socket
Search…
Quote
Returns the routes available for bridging assets

v2/quote

How this endpoint is to be used :
  • This endpoint returns the routes available between sending chain and destination chain for given sending token and receiving token.
  • The routes generated also consider any swaps needed before and after bridging
  • A refuel transaction requires bridgeWithGas param set to true. Learn more about sending gas from one chain to another along with your bridged tokens in the Refuel Guide​
get
https://api.socket.tech/v2
/quote
Returns the routes available for bridging assets
API-KEY needs to be passed in the headers while making the GET request

Note on request params :

Param
Note
amount
amount parameter in the query needs to be decimal adjusted. For example 1 USDC = 1000000 as USDC supports upto 6 decimal places. 1 UNI = 1000000000000000000 as UNI supports upto 18 decimal places.
disableSwapping
Setting disableSwapping param to true in /v2/quote also requires the param to be set to true in v2/supported/from-token-list as only tokens which can be bridged without swapping need to be shown to a user.
recipient
For receiving assets on a different address on the destination chain, the recipient param needs to be assigned to the receiving address. If it is not passed in the request, the sender is considered as recipient.
isContractCall
Needs to be set for true when from address in a tx is a smart contract. More in SC integration guide​
bridgeWithGas
When true activates Refuel+Bridge functionality, where gas token is taken from the user on the source chain and equivalent gas token is sent on the destination chain. More in Refuel guide​
NOTE : For Single Bridging Transaction, set singleTxOnly flag totrue.

Description of response parameters

Parameter
Description
routeId
Unique route ID
fromAmount
Amount of token being sent on sending chain
toAmount
Amount of token to be received on the destination chain
usedBridgeNames
Array of bridge names used by route
minimumGasBalances
Minimum balances of native token needed to pay for gas on chains involved in bridging
chainGasBalances
Deprecated, do not use!
totalUserTx
Total number of user transactions involved in route
sender
Address of transaction sender
recipient
Address of receiver on destination chain
totalGasFeesInUsd
Gas fees in USD for route
userTxs
Array of transactions in the bridging route
userTxs.userTxType
Type of transaction to be performed by user. Values on Types page.
userTxs.txType
Type of transaction. Values on Types page.
userTxs.chainId
Chain ID where the transaction is executed
userTxs.fromAsset
Object with meta data of input asset
userTxs.fromAmount
Amount of sending asset involved in step
userTxs.toAsset
Object with meta data of output asset
userTxs.toAmount
Expected output from the transaction
userTxs.stepCount
Number of steps in a transaction in route (For e.g Swap+Bridge is one transaction with 2 steps)
userTxs.routePath
ID of DEX-Bridge used in a given transaction
Socket does not charge any fees. The only fees a user needs to pay are gas fees, middleware fees (to DEX for swapping assets if needed) and bridging fees (to bridge provider)
Note : The token address for the native token of a given chain is 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
​
TEST QUERY :

NEXT STEP

  • The data returned by this endpoint needs to be shown to a user. For reference, check out the Bungee app.
  • Once a user chooses their preferred route, the transaction data for that route needs to be generated through the /v2/build-tx endpoint (Single Tx Bridging)
  • The whole route and refuel object need to be passed in the body for Refuel+Bridge transactions
  • For Multi Tx Bridging, the /v2/route/start endpoint needs to be called