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

source

pub const SEED: &'static [u8; 12] = b"bond_account"

source

pub fn create_key( owner: &Pubkey, total_amount_sold: u64, program_id: &Pubkey ) -> (Pubkey, u8)

source

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

source

pub fn save(&self, dst: &mut [u8]) -> ProgramResult

source

pub fn is_active(&self) -> bool

source

pub fn activate(&mut self, current_offset: u64) -> ProgramResult

source

pub fn from_account_info( a: &AccountInfo<'_>, allow_inactive: bool ) -> Result<BondAccount, ProgramError>

source

pub fn calc_unlock_amount( &self, missed_periods: u64 ) -> Result<u64, ProgramError>

Trait Implementations§

source§

impl BorshDeserialize for BondAccount

source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>

source§

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>

Deserialize this instance from a slice of bytes.
source§

fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>
where R: Read,

source§

impl BorshSerialize for BondAccount

source§

fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), Error>

source§

fn try_to_vec(&self) -> Result<Vec<u8>, Error>

Serialize this instance into a vector of bytes.
source§

impl BorshSize for BondAccount

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> AbiExample for T

§

default fn example() -> T

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V