Avalanche SDK Client
    Preparing search index...

    Function getAllValidatorsAt

    • 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.

      Type Parameters

      • chain extends undefined | Chain

      Parameters

      Returns Promise<GetAllValidatorsAtReturnType>

      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
      })