Struct access_protocol::state::BondV2Account
source · pub struct BondV2Account {
pub tag: Tag,
pub owner: Pubkey,
pub amount: u64,
pub pool: Pubkey,
pub last_claimed_offset: u64,
pub pool_minimum_at_creation: u64,
pub unlock_timestamp: Option<i64>,
}
Fields§
§tag: Tag
Tag
owner: Pubkey
Owner of the bond account
amount: u64
Amount locked in the account
pool: Pubkey
Pool which the account belongs to
last_claimed_offset: u64
Offset of a last day when rewards were claimed as an offset from the contract creation date
pool_minimum_at_creation: u64
Minimum lockable amount of the pool when the account was created
unlock_timestamp: Option<i64>
Unlock start date
Implementations§
source§impl BondV2Account
impl BondV2Account
pub const SEED: &'static [u8; 15] = b"bond_v2_account"
pub fn create_key( owner: &Pubkey, pool: &Pubkey, unlock_timestamp: Option<i64>, program_id: &Pubkey ) -> (Pubkey, u8)
pub fn new( owner: Pubkey, pool: Pubkey, pool_minimum_at_creation: u64, unlock_timestamp: Option<i64> ) -> Self
pub fn save(&self, dst: &mut [u8]) -> ProgramResult
pub fn from_account_info( a: &AccountInfo<'_> ) -> Result<BondV2Account, ProgramError>
pub fn withdraw(&mut self, amount: u64) -> ProgramResult
Trait Implementations§
source§impl BorshDeserialize for BondV2Accountwhere
Tag: BorshDeserialize,
Pubkey: BorshDeserialize,
u64: BorshDeserialize,
Option<i64>: BorshDeserialize,
impl BorshDeserialize for BondV2Accountwhere
Tag: BorshDeserialize,
Pubkey: BorshDeserialize,
u64: BorshDeserialize,
Option<i64>: 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 BondV2Accountwhere
Tag: BorshSerialize,
Pubkey: BorshSerialize,
u64: BorshSerialize,
Option<i64>: BorshSerialize,
impl BorshSerialize for BondV2Accountwhere
Tag: BorshSerialize,
Pubkey: BorshSerialize,
u64: BorshSerialize,
Option<i64>: BorshSerialize,
Auto Trait Implementations§
impl Freeze for BondV2Account
impl RefUnwindSafe for BondV2Account
impl Send for BondV2Account
impl Sync for BondV2Account
impl Unpin for BondV2Account
impl UnwindSafe for BondV2Account
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