import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche({
network: "mainnet",
});
async function run() {
const result = await avalanche.data.primaryNetwork.listL1Validators({
pageSize: 10,
l1ValidationId: "BsSpTd1SDvdhaoYAuKJvRj1WnoRyu8mAuMZeuz9g7brGj6KhX",
nodeId: "NodeID-111111111111111111116DBWJs",
subnetId: "11111111111111111111111111111111LpoYY",
});
for await (const page of result) {
console.log(page);
}
}
run();{
"validators": [
{
"validationId": "<string>",
"validationIdHex": "<string>",
"nodeId": "<string>",
"subnetId": "<string>",
"weight": 123,
"remainingBalance": 123,
"creationTimestamp": 123,
"blsCredentials": {},
"remainingBalanceOwner": {
"addresses": [
"<string>"
],
"threshold": 123
},
"deactivationOwner": {
"addresses": [
"<string>"
],
"threshold": 123
}
}
],
"blockHeight": "<string>",
"nextPageToken": "<string>"
}Lists details for L1 validators. By default, returns details for all active L1 validators. Filterable by validator node ids, subnet id, and validation id.
import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche({
network: "mainnet",
});
async function run() {
const result = await avalanche.data.primaryNetwork.listL1Validators({
pageSize: 10,
l1ValidationId: "BsSpTd1SDvdhaoYAuKJvRj1WnoRyu8mAuMZeuz9g7brGj6KhX",
nodeId: "NodeID-111111111111111111116DBWJs",
subnetId: "11111111111111111111111111111111LpoYY",
});
for await (const page of result) {
console.log(page);
}
}
run();{
"validators": [
{
"validationId": "<string>",
"validationIdHex": "<string>",
"nodeId": "<string>",
"subnetId": "<string>",
"weight": 123,
"remainingBalance": 123,
"creationTimestamp": 123,
"blsCredentials": {},
"remainingBalanceOwner": {
"addresses": [
"<string>"
],
"threshold": 123
},
"deactivationOwner": {
"addresses": [
"<string>"
],
"threshold": 123
}
}
],
"blockHeight": "<string>",
"nextPageToken": "<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 A page token, received from a previous list call. Provide this to retrieve the subsequent page.
The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
1 <= x <= 100The L1 Validator's validation ID to filter by. If not provided, then all L1 Validators will be returned.
A valid node ID in format 'NodeID-HASH'.
Successful response
The list of L1 validations for the given Subnet ID, NodeId or validationId
Show child attributes
Block height at which the L1 validator's remaining balance is calculated
A token, which can be sent as pageToken to retrieve the next page. If this field is omitted or empty, there are no subsequent pages.
Was this page helpful?