platform.getCurrentValidators - AVAX
Example code for the platform.getCurrentValidators JSON-RPC method. Complete guide on how to use platform.getCurrentValidators JSON-RPC in GetBlock Web3 documentation.
Parameters
Parameter
Type
Required
Description
Request Example
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/ext/bc/P' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "platform.getCurrentValidators",
"params": {},
"id": "getblock.io"
}'import axios from 'axios';
const data = JSON.stringify({
"jsonrpc": "2.0",
"method": "platform.getCurrentValidators",
"params": {},
"id": "getblock.io"
});
const config = {
method: 'post',
url: 'https://go.getblock.io/<ACCESS-TOKEN>/ext/bc/P',
headers: {
'Content-Type': 'application/json'
},
data: data
};
axios(config)
.then(response => console.log(JSON.stringify(response.data, null, 2)))
.catch(error => console.log(error));Response Example
{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": {
"validators": [
{
"txID": "2kxwWpHvZPhMsJcSTmM7a3Da7sExB8pPyF7t4cr2NSwnYqNHni",
"startTime": "1700000000",
"endTime": "1731536000",
"stakeAmount": "2000000000000",
"nodeID": "NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg",
"weight": "2000000000000",
"rewardOwner": {
"locktime": "0",
"threshold": "1",
"addresses": [
"P-avax1fw57u4tp7xzx0k6ufn7tj9caua59mt9gqcvy7m"
]
},
"potentialReward": "12000000000",
"delegationFee": "2.0000",
"uptime": "0.9876",
"connected": true,
"delegators": []
}
]
}
}Response Parameters
Field
Type
Description
Use Cases
Error Handling
Status Code
Error Message
Cause
SDK Integration
Last updated
Was this helpful?