> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orbitflare.com/llms.txt
> Use this file to discover all available pages before exploring further.

# getInflationReward

> Returns the inflation reward for a list of addresses for an epoch

## Parameters

<ParamField query="addresses" type="array" required>
  An array of addresses to query, as base-58 encoded strings
</ParamField>

<ParamField query="config" type="object" optional>
  <Expandable title="config fields">
    <ParamField name="epoch" type="number" optional>
      An epoch for which the reward occurs. If omitted, the previous epoch will be used
    </ParamField>

    <ParamField name="minContextSlot" type="number" optional>
      The minimum slot that the request can be evaluated at
    </ParamField>
  </Expandable>
</ParamField>

## Response

<ResponseField name="result" type="array">
  <Expandable title="result elements">
    <ResponseField name="epoch" type="number">
      Epoch for which reward occured
    </ResponseField>

    <ResponseField name="effectiveSlot" type="number">
      The slot in which the rewards are effective
    </ResponseField>

    <ResponseField name="amount" type="number">
      Reward amount in lamports
    </ResponseField>

    <ResponseField name="postBalance" type="number">
      Post balance of the account in lamports
    </ResponseField>

    <ResponseField name="commission" type="number | null">
      Vote account commission when the reward was credited
    </ResponseField>
  </Expandable>
</ResponseField>

## Code Examples

### Basic Request

```bash theme={null}
curl http://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getInflationReward",
  "params": [
    [
      "6dmNQ5jwLeLk5REvio1JcMshcbvkYMwy26sJ8pbkvStu",
      "BGsqMegLpV6n6Ve146sSX2dTjUMj3M92HnU8BbNRMhF2"
    ],
    {"epoch": 2}
  ]
}'
```

### Using web3.js

```typescript theme={null}
import { Connection } from '@solana/web3.js';

const connection = new Connection('http://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY');
const addresses = [
  '6dmNQ5jwLeLk5REvio1JcMshcbvkYMwy26sJ8pbkvStu',
  'BGsqMegLpV6n6Ve146sSX2dTjUMj3M92HnU8BbNRMhF2'
];
const rewards = await connection.getInflationReward(addresses, 2);
console.log(rewards);
```

### Using Python

```python theme={null}
from solana.rpc.api import Client

client = Client("http://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY")
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
