getInflationReward
Learn getInflationReward use cases, code examples, request parameters, response structure, and tips.
Last updated
{
"jsonrpc": "2.0",
"id": 1,
"method": "getInflationReward",
"params": [
["AccountPublicKey1", "AccountPublicKey2"],
{
"epoch": 512,
"commitment": "finalized"
}
]
}const fetch = require('node-fetch');
async function getInflationReward(rpcUrl) {
try {
const response = await fetch(rpcUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'getInflationReward',
"params": [
[
"6dmNQ5jwLeLk5REvio1JcMshcbvkYMwy26sJ8pbkvStu",
"BGsqMegLpV6n6Ve146sSX2dTjUMj3M92HnU8BbNRMhF2"
],
{
"epoch": 822,
"commitment": "finalized"
}
]
}),
});
const data = await response.json();
// Print the exact full response
console.log('Full RPC Response:');
console.log(JSON.stringify(data, null, 2));
return data;
} catch (error) {
console.error('Error getting health:', error.message);
return null;
}
}
// Example usage
const RPC_URL = 'https://rpc.coinvera.io/?x-api-key=your-coinvera-x-api-key';
getInflationReward(RPC_URL);import requests
import json
def get_inflation_reward(rpc_url):
try:
response = requests.post(
rpc_url,
headers={
'Content-Type': 'application/json',
},
json={
'jsonrpc': '2.0',
'id': 1,
'method': 'getInflationReward',
'params': [
[
'6dmNQ5jwLeLk5REvio1JcMshcbvkYMwy26sJ8pbkvStu',
'BGsqMegLpV6n6Ve146sSX2dTjUMj3M92HnU8BbNRMhF2'
],
{
'epoch': 822,
'commitment': 'finalized'
}
]
}
)
data = response.json()
# Print the exact full response
print('Full RPC Response:')
print(json.dumps(data, indent=2))
return data
except Exception as error:
print(f'Error getting health: {error}')
return None
# Example usage
RPC_URL = 'https://rpc.coinvera.io/?x-api-key=your-coinvera-x-api-key'
get_inflation_reward(RPC_URL){
"jsonrpc": "2.0",
"error": {
"code": -32004,
"message": "Block not available for slot 355536000"
},
"id": 1
}