I can pull the staking rewards (inflation rewards) associated with a particular Solana address using the following:
import requests
import json
url = "https://api.mainnet-beta.solana.com"
payload = {
"jsonrpc": "2.0",
"id": 1,
"method": "getInflationReward",
"params": [
[my_staking_address], {"epoch": 231}
]
}
response = requests.post(url, json=payload).json()
print(response)
The issue with this is that I have to specify the epoch. Is it possible to get a list of all staking rewards associated with the address in a single request? It will take a while to iterate over each epoch.
I'm just hoping there is a better way to get the history of inflation rewards than creating a new request for each epoch.