Solana
¿Listo para usar esto en producción?
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
Solana
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
getInflationReward returns the actual SOL staking rewards that specific Solana stake accounts earned during a given epoch. Where getInflationRate tells you the network-wide rate, this method tells you what real lamports landed in each account when an epoch's rewards were paid out. Send a JSON-RPC 2.0 POST with positional params — an array of base-58 stake account addresses followed by an optional config object — to https://solana.therpc.io/YOUR_API_KEY. For each address the node returns an entry containing epoch, effectiveSlot (the slot the reward took effect), amount (the reward in lamports), postBalance (the account balance after the payout), and commission (the validator commission applied), or null if that account earned no reward in the requested epoch.
amount (in lamports) against postBalance so users can see their stake growing epoch by epoch.commission on each entry: the amount is already net of commission, and the field tells you how much the validator retained.| # | Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|---|
| 1 | addresses | array | Sí | Array of base-58 stake account addresses. |
| 2 | config | object | No | Options: commitment, epoch, minContextSlot. |
| Tipo | Descripción |
|---|---|
| array | Array of { epoch, effectiveSlot, amount, postBalance, commission } or null per address. |
| Código | Mensaje | Causa |
|---|---|---|
-32602 | Invalid params | A param is missing, of the wrong type, or malformed (e.g. a non-base58 pubkey or a bad config field). |
-32603 | Internal error | The node hit an internal error serving the request — retry, and reduce the requested range/encoding if it persists. |
null even if it owns staked SOL.null entry simply means that account earned no reward in the requested epoch (for example it was not yet delegated or was deactivating). Handle nulls per address instead of assuming every entry is populated.epoch config field to query the most recently completed epoch; set it explicitly when you need rewards for a particular historical epoch.