solana_sdk::sysvar

Module stake_history

Source
Expand description

History of stake activations and de-activations.

The stake history sysvar provides access to the StakeHistory type.

The Sysvar::get method always returns ProgramError::UnsupportedSysvar, and in practice the data size of this sysvar is too large to process on chain. One can still use the SysvarId::id, SysvarId::check_id and Sysvar::size_of methods in an on-chain program, and it can be accessed off-chain through RPC.

§Examples

Calling via the RPC client:

fn print_sysvar_stake_history(client: &RpcClient) -> Result<()> {
    let stake_history = client.get_account(&stake_history::ID)?;
    let data: StakeHistory = bincode::deserialize(&stake_history.data)?;

    Ok(())
}

Structs§

Constants§

  • The const program ID.

Functions§

  • Returns true if given pubkey is the program ID.
  • Returns the program ID.