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}"
}Get details of the blockchain registered on the network.
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}"
}Api keys provide higher access to rate limits. To obtain an api key, sign up for an account at https://avacloud.io/.
The blockchain ID of the blockchain to retrieve.
Either mainnet or testnet/fuji.
mainnet, fuji, testnet Successful response
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.
43114
The genesis data of the blockchain.
"{\"chainId\": 43114}"
Was this page helpful?