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()
// 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
})

Why is it required to obtain the list of supported tokens from Rango API?

Even if dApp has its own list of tokens and blockchains, it's still useful to get list of supported tokens by Rango:

  • To avoid extra API call when token is not supported by Rango

  • Access tokens' symbol which is required for getting quote for each token.

Why is it recommended to obtain the list of supported blockchains from Rango API?

  • For working with other API methods like quote or swap, you need to have identifier (name) of each blockchain. You could hard code blockchain names if you want to have limited chains support or get them dynamically via the API. (You could store a map of each blockchain chainId to Rango name if required.)

  • Because of different reasons like blockchains maintenance, Rango maintenance, hacks, and etc, a blockchain could be disabled in Rango. You could check which blockchains are enabled now using enabled flag for each blockchain in meta response.

Metadata Request

  • blockchains String

    • Description: Pass comma separated list of blockchains if you want to filter meta blockchains to some specific ones.

    • Example: POLYGON,ETH

  • blockchainsExclude Boolean

    • Description: A value indicating whether the specified blockchains should be excluded or included in the response.

    • Example: true

  • swappers String

    • Description: Pass comma separated list of swappers if you want to filter meta swappers to some specific ones.

    • Example: Across,OneInchEth

  • swappersExclude Boolean

    • Description: A boolean value indicating whether the specified swappers should be excluded or included in the response.

    • Example: false

  • swappersGroups String

    • Description: Pass comma separated list of swapper groups if you want to filter meta swapper groups to some specific ones.

    • Example: Across,1Inch

  • swappersGroupsExclude Boolean

    • Description: A boolean value indicating whether the specified swapper groups should be excluded or included in the response.

    • Example: false

  • transactionTypes String

    • Description: Pass comma separated list of transaction types if you want to filter blockchains types to some specific ones.

    • Example: EVM,COSMOS

  • transactionTypesExclude Boolean

    • Description: A boolean value indicating whether the specified transaction types should be excluded or included in the response.

    • Example: false

  • excludeSecondaries Boolean

    • Description: 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

  • excludeNonPopulars Boolean

    • Description: 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

  • enableCentralizedSwappers Boolean

    • Description: 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

Metadata Response

  • blockchains

  • tokens

  • swappers

    • List of all supported protocols (DEXes & Bridges)

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()

Get List of Swappers API

const swappers = await rango.swappers()

Get List of Cross-Chain Messaging Protocols API

const protocols = await rango.messagingProtocols()

Last updated