Integration
Swapping and Aggregation
Javascript SDK
Get Chains

Get Chains

getChains

Returns the list of available chains or destination chains for the provided sourceChain. If no sourceChain is provided, it returns all available chains.

getChains(sourceChain?: Chain): Promise<ChainData[]>
ParamDescriptionData type
sourceChainChain ID that allows to filter the returned chains (optional)string

Example

console.log(await swapSDK.getChains());

Sample Response

[
  {
    "id": "Ethereum",
    "name": "Ethereum",
    "isMainnet": true
  },
  {
    "id": "Polkadot",
    "name": "Polkadot",
    "isMainnet": true
  },
  {
    "id": "Bitcoin",
    "name": "Bitcoin",
    "isMainnet": true
  }
]
;