getInflationReward
Last updated:
getInflationReward returns the inflation (staking) reward credited to each of
a list of addresses for a single epoch. Each address in the request maps to one
entry in the returned array, in the same order as the input. The reward
amount is reported in lamports (1 SOL = 1,000,000,000 lamports), so divide
by 1e9 to display a SOL figure.
Only stake accounts and vote accounts earn inflation rewards. If an address is
not a reward-bearing account, or earned no reward for the requested epoch, its
slot in the result array is null. The array length always equals the number of
addresses you passed.
By default the reward for the previous epoch is returned. Pass epoch in
the config object to query a specific historical epoch. Note that nodes only
retain reward data for a limited window of recent epochs; very old epochs may no
longer be available.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| addresses | array | Yes | |
| config | GetInflationRewardConfig | No |
Returns
| Field | Type |
|---|---|
| result | array |
Examples
curl https://triport.io/sol \
-X POST -H 'Content-Type: application/json' \
-H 'Authorization: Bearer <api-key>' \
-d '{"id":1,"method":"getInflationReward","params":["<addresses>","<config>"],"jsonrpc":"2.0"}'const res = await fetch("https://triport.io/sol", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: "Bearer <api-key>" },
body: JSON.stringify({
"id": 1,
"method": "getInflationReward",
"params": [
"<addresses>",
"<config>"
],
"jsonrpc": "2.0"
}),
});
const data = await res.json();import requests
resp = requests.post(
"https://triport.io/sol",
headers={"Authorization": "Bearer <api-key>"},
json={"id":1,"method":"getInflationReward","params":["<addresses>","<config>"],"jsonrpc":"2.0"},
)
print(resp.json())Usage
- Transport: HTTP (JSON-RPC).
- Networks: mainnet, devnet, testnet.
- Credit cost: 1 per call.
FAQ
- What does getInflationReward do?
- Returns the inflation / staking reward earned by a list of addresses for a given Solana epoch.
- How many credits does getInflationReward cost?
- getInflationReward costs 1 credit(s) per call on Triport by default.
- Is getInflationReward available over WebSocket?
- getInflationReward is an HTTP JSON-RPC method.