GET
/
v1
/
networks
/
{network}
/
blockchains
/
{blockchainId}
JavaScript
import { Avalanche } from "@avalanche-sdk/chainkit";

const avalanche = new Avalanche({
  network: "mainnet",
});

async function run() {
  const result = await avalanche.data.primaryNetwork.getBlockchainById({
    blockchainId: "2q9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAX5UQxse55x1Q5",
  });

  console.log(result);
}

run();
{
  "createBlockTimestamp": 123,
  "createBlockNumber": "<string>",
  "blockchainId": "<string>",
  "vmId": "<string>",
  "subnetId": "<string>",
  "blockchainName": "<string>",
  "evmChainId": 43114,
  "genesisData": "{\"chainId\": 43114}"
}

Authorizations

x-glacier-api-key
string
header
required

Api keys provide higher access to rate limits. To obtain an api key, sign up for an account at https://avacloud.io/.

Path Parameters

blockchainId
string
required

The blockchain ID of the blockchain to retrieve.

network
enum<string>
required

Either mainnet or testnet/fuji.

Available options:
mainnet,
fuji,
testnet

Response

Successful response

createBlockTimestamp
number
required
createBlockNumber
string
required
blockchainId
string
required
vmId
string
required
subnetId
string
required
blockchainName
string
required
evmChainId
number
required

EVM Chain ID for the EVM-based chains. This field is extracted from genesis data, and may be present for non-EVM chains as well.

Example:

43114

genesisData
object

The genesis data of the blockchain.

Example:

"{\"chainId\": 43114}"