Skip to main content
GET
/
v2
/
chains
JavaScript
import { Avalanche } from "@avalanche-sdk/chainkit";

const avalanche = new Avalanche();

async function run() {
  const result = await avalanche.metrics.chains.list({
    network: "mainnet",
  });

  for await (const page of result) {
    console.log(page);
  }
}

run();
{
  "chains": [
    {
      "evmChainId": 123,
      "chainName": "<string>",
      "blockchainId": "<string>",
      "subnetId": "<string>",
      "network": "mainnet"
    }
  ],
  "nextPageToken": "<string>"
}

Query Parameters

pageToken
string

A page token, received from a previous list call. Provide this to retrieve the subsequent page.

network
enum<string>

Either mainnet or testnet/fuji.

Available options:
mainnet,
fuji,
testnet

Response

Successful response

chains
object[]
required

Array of Subnet - EVM Chain ID mappings whose metrics we support.

nextPageToken
string

A token, which can be sent as pageToken to retrieve the next page. If this field is omitted or empty, there are no subsequent pages.