suix_getValidatorsApy - Sui
Example code for the suix_getValidatorsApy JSON-RPC method. Complete guide on how to use suix_getValidatorsApy JSON-RPC in GetBlock Web3 documentation.
Parameters
Request Example
curl -X POST https://go.getblock.io/<ACCESS-TOKEN>/ \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": "getblock.io",
"method": "suix_getValidatorsApy",
"params": []
}'const axios = require('axios');
const payload = {
jsonrpc: '2.0',
id: 'getblock.io',
method: 'suix_getValidatorsApy',
params: []
};
axios.post('https://go.getblock.io/<ACCESS-TOKEN>/', payload)
.then(response => console.log(response.data));import requests
payload = {
"jsonrpc": "2.0",
"id": "getblock.io",
"method": "suix_getValidatorsApy",
"params": []
}
response = requests.post("https://go.getblock.io/<ACCESS-TOKEN>/", json=payload)
print(response.json())Response Example
{
"jsonrpc": "2.0",
"result": {
"apys": [
{
"address": "0x3befb84f03a24386492bd3b05b1fd386172eb450e5059ce7df0ea6d9d6cefcaa",
"apy": 0.0345
},
{
"address": "0x9c76d5157eaa77c41a7bfda8db98a8e8080f7cb53b7313088ed085c73f866f21",
"apy": 0.0312
}
],
"epoch": "1001"
},
"id": "getblock.io"
}Response Parameters
Parameter
Type
Description
Use Cases
Error Handling
Error Code
Description
SDK Integration
Last updated
Was this helpful?