The client to use. AvalancheCoreClient
The height GetAllValidatorsAtParameters
All validators at that height across all Subnets. GetAllValidatorsAtReturnType
import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getAllValidatorsAt } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const validators = await getAllValidatorsAt(client, {
height: 1000001
})
Get all validators at a specific height across all Subnets and the Primary Network.
Note: The public API (api.avax.network) only support height within 1000 blocks from the P-Chain tip.