Struct access_protocol::state::StakeAccount
source · pub struct StakeAccount {
pub tag: Tag,
pub owner: Pubkey,
pub stake_amount: u64,
pub stake_pool: Pubkey,
pub last_claimed_offset: u64,
pub pool_minimum_at_creation: u64,
}Fields§
§tag: TagTag
owner: PubkeyOwner of the stake account
stake_amount: u64Amount staked in the account
stake_pool: PubkeyStake pool to which the account belongs to
last_claimed_offset: u64Offset of a last day where rewards were claimed from the contract creation date
pool_minimum_at_creation: u64Minimum stakeable amount of the pool when the account was created
Implementations§
source§impl StakeAccount
impl StakeAccount
pub const SEED: &'static [u8; 13] = b"stake_account"
pub fn new( owner: Pubkey, stake_pool: Pubkey, pool_minimum_at_creation: u64 ) -> Self
pub fn create_key( nonce: &u8, owner: &Pubkey, stake_pool: &Pubkey, program_id: &Pubkey ) -> Result<Pubkey, ProgramError>
pub fn find_key( owner: &Pubkey, stake_pool: &Pubkey, program_id: &Pubkey ) -> (Pubkey, u8)
pub fn save(&self, dst: &mut [u8]) -> ProgramResult
pub fn from_account_info( a: &AccountInfo<'_> ) -> Result<StakeAccount, ProgramError>
pub fn close(&mut self)
pub fn deposit(&mut self, amount: u64) -> ProgramResult
pub fn withdraw(&mut self, amount: u64) -> ProgramResult
Trait Implementations§
source§impl BorshDeserialize for StakeAccount
impl BorshDeserialize for StakeAccount
source§impl BorshSerialize for StakeAccount
impl BorshSerialize for StakeAccount
Auto Trait Implementations§
impl RefUnwindSafe for StakeAccount
impl Send for StakeAccount
impl Sync for StakeAccount
impl Unpin for StakeAccount
impl UnwindSafe for StakeAccount
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more