Struct access_protocol::state::BondAccount
source · pub struct BondAccount {Show 16 fields
pub tag: Tag,
pub owner: Pubkey,
pub total_amount_sold: u64,
pub total_staked: u64,
pub total_quote_amount: u64,
pub quote_mint: Pubkey,
pub seller_token_account: Pubkey,
pub unlock_start_date: i64,
pub unlock_period: i64,
pub unlock_amount: u64,
pub last_unlock_time: i64,
pub total_unlocked_amount: u64,
pub pool_minimum_at_creation: u64,
pub stake_pool: Pubkey,
pub last_claimed_offset: u64,
pub sellers: Vec<Pubkey>,
}
Fields§
§tag: Tag
§owner: Pubkey
§total_amount_sold: u64
§total_staked: u64
§total_quote_amount: u64
§quote_mint: Pubkey
§seller_token_account: Pubkey
§unlock_start_date: i64
§unlock_period: i64
§unlock_amount: u64
§last_unlock_time: i64
§total_unlocked_amount: u64
§pool_minimum_at_creation: u64
§stake_pool: Pubkey
§last_claimed_offset: u64
§sellers: Vec<Pubkey>
Implementations§
source§impl BondAccount
impl BondAccount
pub const SEED: &'static [u8; 12] = b"bond_account"
pub fn create_key( owner: &Pubkey, total_amount_sold: u64, program_id: &Pubkey ) -> (Pubkey, u8)
pub fn new( owner: Pubkey, total_amount_sold: u64, total_quote_amount: u64, quote_mint: Pubkey, seller_token_account: Pubkey, unlock_start_date: i64, unlock_period: i64, unlock_amount: u64, last_unlock_time: i64, pool_minimum_at_creation: u64, stake_pool: Pubkey, seller: Pubkey ) -> Self
pub fn save(&self, dst: &mut [u8]) -> ProgramResult
pub fn is_active(&self) -> bool
pub fn activate(&mut self, current_offset: u64) -> ProgramResult
pub fn from_account_info( a: &AccountInfo<'_>, allow_inactive: bool ) -> Result<BondAccount, ProgramError>
pub fn calc_unlock_amount( &self, missed_periods: u64 ) -> Result<u64, ProgramError>
Trait Implementations§
source§impl BorshDeserialize for BondAccountwhere
Tag: BorshDeserialize,
Pubkey: BorshDeserialize,
u64: BorshDeserialize,
i64: BorshDeserialize,
Vec<Pubkey>: BorshDeserialize,
impl BorshDeserialize for BondAccountwhere
Tag: BorshDeserialize,
Pubkey: BorshDeserialize,
u64: BorshDeserialize,
i64: BorshDeserialize,
Vec<Pubkey>: BorshDeserialize,
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
source§impl BorshSerialize for BondAccountwhere
Tag: BorshSerialize,
Pubkey: BorshSerialize,
u64: BorshSerialize,
i64: BorshSerialize,
Vec<Pubkey>: BorshSerialize,
impl BorshSerialize for BondAccountwhere
Tag: BorshSerialize,
Pubkey: BorshSerialize,
u64: BorshSerialize,
i64: BorshSerialize,
Vec<Pubkey>: BorshSerialize,
Auto Trait Implementations§
impl RefUnwindSafe for BondAccount
impl Send for BondAccount
impl Sync for BondAccount
impl Unpin for BondAccount
impl UnwindSafe for BondAccount
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