import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche({
network: "mainnet",
});
async function run() {
const result = await avalanche.data.primaryNetwork.listSubnets({
pageSize: 10,
sortOrder: "asc",
});
for await (const page of result) {
console.log(page);
}
}
run();{
"subnets": [
{
"createBlockTimestamp": 123,
"createBlockIndex": "<string>",
"subnetId": "<string>",
"ownerAddresses": [
"<string>"
],
"threshold": 123,
"locktime": 123,
"subnetOwnershipInfo": {
"locktime": 123,
"threshold": 123,
"addresses": [
"<string>"
]
},
"isL1": true,
"blockchains": [
{
"createBlockTimestamp": 123,
"createBlockNumber": "<string>",
"blockchainId": "<string>",
"vmId": "<string>",
"subnetId": "<string>",
"blockchainName": "<string>",
"evmChainId": 43114,
"genesisData": "{\"chainId\": 43114}"
}
],
"l1ConversionTransactionHash": "<string>",
"l1ValidatorManagerDetails": {
"blockchainId": "<string>",
"contractAddress": "<string>"
}
}
],
"nextPageToken": "<string>"
}Lists all subnets 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.listSubnets({
pageSize: 10,
sortOrder: "asc",
});
for await (const page of result) {
console.log(page);
}
}
run();{
"subnets": [
{
"createBlockTimestamp": 123,
"createBlockIndex": "<string>",
"subnetId": "<string>",
"ownerAddresses": [
"<string>"
],
"threshold": 123,
"locktime": 123,
"subnetOwnershipInfo": {
"locktime": 123,
"threshold": 123,
"addresses": [
"<string>"
]
},
"isL1": true,
"blockchains": [
{
"createBlockTimestamp": 123,
"createBlockNumber": "<string>",
"blockchainId": "<string>",
"vmId": "<string>",
"subnetId": "<string>",
"blockchainName": "<string>",
"evmChainId": 43114,
"genesisData": "{\"chainId\": 43114}"
}
],
"l1ConversionTransactionHash": "<string>",
"l1ValidatorManagerDetails": {
"blockchainId": "<string>",
"contractAddress": "<string>"
}
}
],
"nextPageToken": "<string>"
}Api keys provide higher access to rate limits. To obtain an api key, sign up for an account at https://avacloud.io/.
Either mainnet or testnet/fuji.
mainnet, fuji, testnet A page token, received from a previous list call. Provide this to retrieve the subsequent page.
The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 10000.
1 <= x <= 10000The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the sortBy query parameter, if provided.
asc, desc Was this page helpful?