QuoteController_getT2BQuote
GEThttps://api.socket.tech/v2/quote/t2b
QuoteController_getT2BQuote
Request​
Query Parameters
Chain id of source chain.
Token address on source chain.
Chain id of destination chain.
Token address on destination chain.
Amount of sending tokens.
Address of user. This will be used to check approvals.
Address of recipient. This will be used to check approvals.
Flag to return only best route per bridge using the sort criteria
Flag to specify if routes that have dex swap should be ignored.
Possible values: [oneinch
, zerox
, rainbow
]
Specify Dexes that should be included in routes.
Possible values: [oneinch
, zerox
, rainbow
]
Specify Dexes that should be excluded in routes. This option will be ignored if includeDexes is specified.
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
]
Specify Bridges that should be included in routes.
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
]
Specify Bridges that should be excluded in routes. This option will be ignored if includeBridges is specified.
Possible values: [output
, gas
, time
]
Param to sort routes based on.
Maximum number of transactions. This option will be ignored if singleTxOnly is marked as true.
Only get quotes with one user transaction to bridge.
Only get quotes with that are compatible with contracts
include gas transfer with bridging tx
include insurance with bridging tx
default bridge slippage for the route in percent between 0 and 100. Default Slippage assumed if not passed. NOTE - Slippage is not present for all bridges.
default swap slippage for the route in percent between 0 and 100. Default Slippage assumed if not passed.
destination payload for contract call
destination gas limit for contract call
feePercentage to be cut, this is only available on SocketGateway Contracts.
feeTakerAddress is the address where the fee is sent, this is only available on Socket Gateway Contracts.
Header Parameters
Responses​
- 200
Returns all the possible routes for bridging tokens from one chain to another. One of the routes can be selected and passed in to start the route.
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
Status of API.
result
object
required
routes
object[]
Unique id for each route.
Contains only on single swap.
Sending token amount.
chainGasBalances
object
required
minimumGasBalances
object
required
Approximate receiving token amount.
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
Total number of transactions for the route.
Combined USD gas fees for all transactions in the route.
Address of user receiving the amount.
Address of user making the transactions.
Array of user transactions.
Receive Value
Estimate of total time in seconds, excluding the transaction time.
Estimate of max time to exit from the chain in seconds.
integratorFee
object
required
asset
object
Name of token.
Address of token.
URL for icon of token.
Decimal used for token.
Symbol of token.
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
URL for icon of token.
Unique Id over all chains
fromAsset
object
Name of token.
Address of token.
URL for icon of token.
Decimal used for token.
Symbol of token.
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
URL for icon of token.
Unique Id over all chains
toAsset
object
Name of token.
Address of token.
URL for icon of token.
Decimal used for token.
Symbol of token.
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
URL for icon of token.
Unique Id over all chains
refuel
object
nullable
gasFees
object
required
Approx Gas Limit of the transaction.
USD value of gas fees at current gas price.
asset
object
required
Gas token details.
Name of token.
Address of token.
URL for icon of token.
Decimal used for token.
Symbol of token.
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
URL for icon of token.
Unique Id over all chains
Estimated Amount of gas token will be used
fromAsset
object
required
Name of token.
Address of token.
URL for icon of token.
Decimal used for token.
Symbol of token.
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
URL for icon of token.
Unique Id over all chains
toAsset
object
required
Name of token.
Address of token.
URL for icon of token.
Decimal used for token.
Symbol of token.
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
URL for icon of token.
Unique Id over all chains
{
"success": true,
"result": {
"routes": [
{
"routeId": "6a4c26b6-b008-431d-a37c-028e0b30482b",
"isOnlySwapRoute": false,
"fromAmount": "100000000000000000000",
"chainGasBalances": {},
"minimumGasBalances": {},
"toAmount": "100000000000000000000",
"usedBridgeNames": "[anyswap-router-v4]",
"totalUserTx": 3,
"totalGasFeesInUsd": 125.4,
"recipient": "0x3e8cB4bd04d81498aB4b94a392c334F5328b237b",
"sender": "0x3e8cB4bd04d81498aB4b94a392c334F5328b237b",
"userTxs": [
{}
],
"receivedValueInUsd": 0,
"inputValueInUsd": 0,
"outputValueInUsd": 0,
"serviceTime": 600,
"maxServiceTime": 600,
"integratorFee": {
"feeTakerAddress": "string",
"amount": "string",
"asset": {
"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",
"chainAgnosticId": "DAI"
}
},
"t2bReceiverAddress": "string",
"extraData": {}
}
],
"fromChainId": 0,
"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",
"chainAgnosticId": "DAI"
},
"toChainId": 0,
"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",
"chainAgnosticId": "DAI"
},
"refuel": {
"fromAmount": "string",
"toAmount": "string",
"gasFees": {
"gasLimit": 250000,
"feesInUsd": 125.4,
"asset": {
"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",
"chainAgnosticId": "DAI"
},
"gasAmount": "string"
},
"recipient": "string",
"serviceTime": 0,
"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",
"chainAgnosticId": "DAI"
},
"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",
"chainAgnosticId": "DAI"
},
"fromChainId": 0,
"toChainId": 0
}
}
}