• Preparing search index...
  • The search index is not available
Solana JavaScript SDK
  • Solana JavaScript SDK
  • @solana/sysvars
  • fetchSysvarEpochRewards

Function fetchSysvarEpochRewards

  • fetchSysvarEpochRewards(
        rpc: Rpc<GetAccountInfoApi>,
        config?: FetchAccountConfig,
    ): Promise<SysvarEpochRewards>
  • Fetch the EpochRewards sysvar.

    Tracks the progress of epoch rewards distribution. It includes:

    • Total rewards for the current epoch, in lamports.
    • Rewards for the current epoch distributed so far, in lamports.
    • Distribution completed block height, i.e. distribution of all staking rewards for the current epoch will be completed at this block height.

    Note that EpochRewards only lasts for a handful of blocks at the start of an epoch. When all rewards have been distributed, the sysvar is deleted. See https://github.com/solana-labs/solana/blob/e0203f22dc83cb792fa97f91dbe6e924cbd08af1/docs/src/runtime/sysvars.md?plain=1#L155-L168

    Parameters

    • rpc: Rpc<GetAccountInfoApi>
    • Optionalconfig: FetchAccountConfig

    Returns Promise<SysvarEpochRewards>

    • Defined in packages/sysvars/src/epoch-rewards.ts:75

Settings

Member Visibility
Solana JavaScript SDK
  • Loading...

Generated using TypeDoc