AptosAptos Network's breakthrough technology and seamless user experience are now available on QuickNode.
Start building today!The API credit value for this method is 40 . To learn more about API credits and each method's value, visit the API Credits page.
Parameters:
Commitment - string - (optional) The level of commitment required for the query. The options include:
Finalized - string - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized
Confirmed - string - The node will query the most recent block that has been voted on by supermajority of the cluster
epoch - integer - (optional) An epoch for which the reward occurs. If omitted, the previous epoch will be used
minContextSlot - integer - (optional) The minimum slot that the request can be evaluated at
Returns:
epoch - The epoch during which the reward was received
effectiveSlot - The slot at which the rewards become active
amount - The reward value in lamports
postBalance - The account balance after the transaction in lamports
commission - The commission rate of the vote account at the time the reward was credited
Code Examples:
curl http://sample-endpoint-name.network.quiknode.pro/token-goes-here/ \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1, "method":"getInflationReward", "params": [["ADDRESS_TO_SEARCH_1", "ADDRESS_TO_SEARCH_2"], {"epoch": 2}] }'
const web3 = require("@solana/web3.js"); (async () => { const pubkey1 = new web3.PublicKey("YOUR_ADDRESS_1"); const pubkey2 = new web3.PublicKey("YOUR_ADDRESS_2"); const solana = new web3.Connection("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/"); console.log(await solana.getInflationReward([pubkey1, pubkey2])); })();
require "uri" require "json" require "net/http" url = URI("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getInflationReward", "params": [ [ "ADDRESS_TO_SEARCH_1", "ADDRESS_TO_SEARCH_2" ], { "epoch": 2 } ] }) response = https.request(request) puts response.read_body
from jsonrpcclient import request, parse, Ok import logging import requests response = requests.post("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/", json=request("getInflationReward", params=[["ADDRESS_TO_SEARCH_1","ADDRESS_TO_SEARCH_2"],{"epoch": 2}])) parsed = parse(response.json()) if isinstance(parsed, Ok): print(parsed.result) else: logging.error(parsed.message)