getInflationReward - Solana
Example code for the getInflationReward JSON-RPC method. Complete guide on how to use getInflationReward JSON-RPC in GetBlock Web3 documentation.
Parameters
Parameter
Type
Required
Description
Config Object
Field
Type
Required
Description
Request
curl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "getInflationReward",
"params": [["3ZT31jkAGhUaw8jsy4Q3Q3fSN6r5eYkr4wD1TThTZ4bT"], {"epoch": 860}],
"id": "getblock.io"
}'const { Connection, PublicKey } = require('@solana/web3.js');
const connection = new Connection('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', 'confirmed');
const rewards = await connection.getInflationReward(
[new PublicKey('3ZT31jkAGhUaw8jsy4Q3Q3fSN6r5eYkr4wD1TThTZ4bT')],
860
);
console.log(rewards[0]);import requests
response = requests.post(
'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
headers={'Content-Type': 'application/json'},
json={
'jsonrpc': '2.0',
'method': 'getInflationReward',
'params': [["3ZT31jkAGhUaw8jsy4Q3Q3fSN6r5eYkr4wD1TThTZ4bT"], {"epoch": 860}],
'id': 'getblock.io'
}
)
print(response.json()['result'])Response
Response Parameters
Parameter
Type
Description
Reward Entry
Field
Type
Description
Use Cases
Error Handling
Error Code
Message
Description
Last updated
Was this helpful?