The client to use. AvalancheCoreClient
The subnet ID GetCurrentValidatorsParameters
The current validators. GetCurrentValidatorsReturnType
import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getCurrentValidators } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const validators = await getCurrentValidators(client, {
subnetID: "11111111111111111111111111111111LpoYY"
})
Get the current validators of the specified Subnet.