import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche({
network: "mainnet",
});
async function run() {
const result = await avalanche.data.primaryNetwork.getSubnetById({
subnetId: "11111111111111111111111111111111LpoYY",
});
console.log(result);
}
run();{
"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>"
}
}Get details of the Subnet 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.getSubnetById({
subnetId: "11111111111111111111111111111111LpoYY",
});
console.log(result);
}
run();{
"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>"
}
}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 Subnet ID to fetch details for
Successful response
This field is deprecated. Use subnetOwnershipInfo instead.
This field is deprecated. Use subnetOwnershipInfo instead.
This field is deprecated. Use subnetOwnershipInfo instead.
Latest subnet owner details for this Subnet.
Show child attributes
Whether the subnet is an L1 or not.
Show child attributes
Transaction hash of ConvertSubnetToL1Tx which converted this Subnet to L1.
L1 validator manager details.
Show child attributes
Was this page helpful?