The client to use. AvalancheCoreClient
The number of validators to sample and subnet ID SampleValidatorsParameters
The sampled validators. SampleValidatorsReturnType
import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { sampleValidators } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const validators = await sampleValidators(client, {
size: 2,
subnetID: "11111111111111111111111111111111LpoYY"
})
Sample validators from the specified Subnet.