Get Blockchains & Tokens
Get all supported blockchains, tokens and swappers meta data
Get Full Metadata API
This service gathers all the essential data needed for a swap's UI, including list of all blockchains, tokens and protocols (DEXes & Bridges) metadata.
// basic usage
const meta = await rango.meta()const response = await axios.get('https://api.rango.exchange/basic/meta', {
params: {
'apiKey': 'c6381a79-2817-4602-83bf-6a641a409e32'
}
});curl --request GET \
--url 'https://api.rango.exchange/basic/meta?apiKey=c6381a79-2817-4602-83bf-6a641a409e32'// sample for filtering response
const meta = await rango.meta({
blockchains: ['ETH', 'POLYGON'],
blockchainsExclude: false,
swappers: ['Across', 'OneInchEth'],
swappersExclude: false,
swappersGroups: ['Across', '1Inch'],
swappersGroupsExclude: false,
transactionTypes: ['EVM'],
transactionTypesExclude: false,
excludeNonPopulars: false
})const response = await axios.get('https://api.rango.exchange/basic/meta', {
params: {
'apiKey': 'c6381a79-2817-4602-83bf-6a641a409e32',
'blockchains': 'ETH,POLYGON',
'blockchainsExclude': false,
'swappers': 'Across,OneInchEth',
'swappersExclude': false,
'swapperGroups': 'Across,1Inch',
'swappersGroupsExclude': false,
'transactionTypes': 'EVM',
'transactionTypesExclude': false,
'excludeNonPopulars': false
}
});curl --request GET \
--url 'https://api.rango.exchange/basic/meta?apiKey=c6381a79-2817-4602-83bf-6a641a409e32&blockchains=ETH,POLYGON&blockchainsExclude=false&swappers=Across,OneInchEth&swappersExclude=false&swapperGroups=Across,1Inch&swappersGroupsExclude=false&transactionTypes=EVM&transactionTypesExclude=false&excludeNonPopulars=false'Metadata Request
blockchainsStringDescription: Pass comma separated list of blockchains if you want to filter meta blockchains to some specific ones.
Example:
POLYGON,ETH
blockchainsExcludeBooleanDescription: A value indicating whether the specified blockchains should be excluded or included in the response.
Example:
true
swappersStringDescription: Pass comma separated list of swappers if you want to filter meta swappers to some specific ones.
Example:
Across,OneInchEth
swappersExcludeBooleanDescription: A boolean value indicating whether the specified swappers should be excluded or included in the response.
Example:
false
swappersGroupsStringDescription: Pass comma separated list of swapper groups if you want to filter meta swapper groups to some specific ones.
Example:
Across,1Inch
swappersGroupsExcludeBooleanDescription: A boolean value indicating whether the specified swapper groups should be excluded or included in the response.
Example:
false
transactionTypesStringDescription: Pass comma separated list of transaction types if you want to filter blockchains types to some specific ones.
Example:
EVM,COSMOS
transactionTypesExcludeBooleanDescription: A boolean value indicating whether the specified transaction types should be excluded or included in the response.
Example:
false
excludeSecondariesBooleanDescription: It indicates whether secondary tokens should be excluded from the response. By secondary tokens, we mean tokens that are imported from our secondary tokens lists.
Example:
false
excludeNonPopularsBooleanDescription: It indicates whether non-popular tokens should be excluded from the response. By popular tokens, we mean native token and stable coins of each blockchain.
Example:
false
enableCentralizedSwappersBooleanDescription: Set this flag to true if you want to enable routing through the centralized solutions and obtain the associated metadata, including related swappers and tokens. The default value for this argument is false.
Example:
true
export type MetaRequest = {
blockchains?: string[]
blockchainsExclude?: boolean
swappers?: string[]
swappersExclude?: boolean
swappersGroups?: string[]
swappersGroupsExclude?: boolean
transactionTypes?: TransactionType[]
transactionTypesExclude?: boolean
excludeSecondaries?: boolean
excludeNonPopulars?: boolean
ignoreSupportedSwappers?: boolean
enableCentralizedSwappers?: boolean
}
export enum TransactionType {
EVM = 'EVM',
TRANSFER = 'TRANSFER',
COSMOS = 'COSMOS',
SOLANA = 'SOLANA',
TRON = 'TRON',
STARKNET = 'STARKNET',
TON = 'TON',
}Metadata Response
blockchainsDescription: List of all supported blockchains
tokensList of all tokens
swappersList of all supported protocols (DEXes & Bridges)
export type MetaResponse = {
blockchains: BlockchainMeta[]
tokens: Token[]
swappers: SwapperMeta[]
}
export type BlockchainMeta =
| EvmBlockchainMeta
| CosmosBlockchainMeta
| TransferBlockchainMeta
| SolanaBlockchainMeta
| StarkNetBlockchainMeta
| TronBlockchainMeta
| TonBlockchainMeta
export type SwapperMeta = {
id: string
title: string
logo: string
swapperGroup: string
types: SwapperType[]
enabled: boolean
}
export type Token = {
blockchain: string
chainId: string | null
address: string | null
symbol: string
name: string | null
decimals: number
image: string
blockchainImage: string
usdPrice: number | null
isPopular: boolean
supportedSwappers: string[]
}{
"tokens": [
{
"blockchain": "ETH",
"symbol": "USDT",
"name": "USDT",
"isPopular": true,
"chainId": "1",
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"decimals": 6,
"image": "https://rango.vip/i/r3Oex6",
"blockchainImage": "https://raw.githubusercontent.com/rango-exchange/assets/main/blockchains/ETH/icon.svg",
"usdPrice": 1.001,
"supportedSwappers": [
"ThorChain",
"Arbitrum Bridge",
"Hyphen"
]
}
],
"blockchains": [
{
"name": "ETH",
"defaultDecimals": 18,
"addressPatterns": [
"^(0x)[0-9A-Fa-f]{40}$"
],
"feeAssets": [
{
"blockchain": "ETH",
"symbol": "ETH",
"address": null
}
],
"type": "EVM",
"chainId": "0x1",
"logo": "https://raw.githubusercontent.com/rango-exchange/assets/main/blockchains/ETH/icon.svg",
"displayName": "Ethereum",
"shortName": "ETH",
"sort": 0,
"color": "#ecf0f1",
"enabled": true,
"info": {
"infoType": "EvmMetaInfo",
"chainName": "Ethereum Mainnet",
"nativeCurrency": {
"name": "ETH",
"symbol": "ETH",
"decimals": 18
},
"rpcUrls": [
"https://rpc.ankr.com/eth"
],
"blockExplorerUrls": [
"https://etherscan.io"
],
"addressUrl": "https://etherscan.io/address/{wallet}",
"transactionUrl": "https://etherscan.io/tx/{txHash}",
"enableGasV2": true
}
}
],
"swappers": [
{
"id": "MDexHeco",
"title": "MDex",
"logo": "https://raw.githubusercontent.com/rango-exchange/assets/main/swappers/MDex/icon.svg",
"swapperGroup": "MDex",
"types": [
"DEX"
],
"enabled": true
}
]
}Get Specific Part of Metadata
If you only want to load a specific part of metadata rather than full metadata, i.e. only blockchains data, tokens list or supported protocols, you can use the following methods/endpoints:
Get List of Blockchains API
const chains = await rango.chains()const response = await axios.get('https://api.rango.exchange/basic/meta/blockchains', {
params: {
'apiKey': 'c6381a79-2817-4602-83bf-6a641a409e32'
}
});curl --request GET \
--url 'https://api.rango.exchange/basic/meta/blockchains?apiKey=c6381a79-2817-4602-83bf-6a641a409e32'Get List of Swappers API
const swappers = await rango.swappers()const response = await axios.get('https://api.rango.exchange/basic/meta/swappers', {
params: {
'apiKey': 'c6381a79-2817-4602-83bf-6a641a409e32'
}
});curl --request GET \
--url 'https://api.rango.exchange/basic/meta/swappers?apiKey=c6381a79-2817-4602-83bf-6a641a409e32' Get List of Cross-Chain Messaging Protocols API
const protocols = await rango.messagingProtocols()const response = await axios.get('https://api.rango.exchange/basic/meta/messaging-protocols', {
params: {
'apiKey': 'c6381a79-2817-4602-83bf-6a641a409e32'
}
});curl --request GET \
--url 'https://api.rango.exchange/basic/meta/messaging-protocols?apiKey=c6381a79-2817-4602-83bf-6a641a409e32'Last updated
Was this helpful?