Parameters

addresses
array
required

An array of addresses to query, as base-58 encoded strings

config
object

Response

result
array

Code Examples

Basic Request

curl http://rpc.orbitflare.com -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getInflationReward",
  "params": [
    [
      "6dmNQ5jwLeLk5REvio1JcMshcbvkYMwy26sJ8pbkvStu",
      "BGsqMegLpV6n6Ve146sSX2dTjUMj3M92HnU8BbNRMhF2"
    ],
    {"epoch": 2}
  ]
}'

Using web3.js

import { Connection } from '@solana/web3.js';

const connection = new Connection('http://rpc.orbitflare.com');
const addresses = [
  '6dmNQ5jwLeLk5REvio1JcMshcbvkYMwy26sJ8pbkvStu',
  'BGsqMegLpV6n6Ve146sSX2dTjUMj3M92HnU8BbNRMhF2'
];
const rewards = await connection.getInflationReward(addresses, 2);
console.log(rewards);

Using Python

from solana.rpc.api import Client

client = Client("http://rpc.orbitflare.com")
addresses = [
    "6dmNQ5jwLeLk5REvio1JcMshcbvkYMwy26sJ8pbkvStu",
    "BGsqMegLpV6n6Ve146sSX2dTjUMj3M92HnU8BbNRMhF2"
]
response = client.get_inflation_reward(addresses, 2)
print(response)

Notes

  1. Returns inflation rewards for a list of addresses
  2. Results are returned as an array in the same order as the input addresses
  3. A null value in the result array means that the address has not received rewards
  4. Commission field is only present for validators (null for regular accounts)
  5. Rewards are calculated at the end of each epoch

Best Practices

  1. Provide a list of valid addresses to avoid null responses
  2. Specify the epoch parameter if you need historical reward data
  3. Handle null values in the response array appropriately
  4. Use this method to track rewards for staking accounts
  5. Handle network errors and retry when appropriate