Module solana_stake_program::stake_state
source · Expand description
Stake state
- delegate stakes to vote accounts
- keep track of rewards
- own mining pools
Structs
- captures a rewards round as lamports to be awarded and the total points over which those lamports are to be distributed
- After calling
validate_delegated_amount()
, this struct contains calculated values that are used by the caller. - After calling
validate_split_amount()
, this struct contains calculated values that are used by the caller.
Enums
Functions
- Authorize the given pubkey to manage stake (deactivate, withdraw). This may be called multiple times, but will implicitly withdraw authorization from the previously authorized staker. The default staker is the owner of the stake account’s pubkey.
- for a given stake and vote_state, calculate how many points were earned (credits * stake) and new value for credits_observed were the points paid
- for a given stake and vote_state, calculate what distributions and what updates should be made returns a tuple in the case of a payout of:
- Calculate the effective credits observed for two stakes when merging
- Ensure the stake delegation amount is valid. This checks that the account meets the minimum balance requirements of delegated stake. If not, return an error.
- Ensure the split amount is valid. This checks the source and destination accounts meet the minimum balance requirements, which is the rent exempt reserve plus the minimum stake delegation, and that the source account has enough lamports for the request split amount. If not, return an error.