pub struct Processor {}
Expand description
Program state handler.
Implementations§
Source§impl Processor
impl Processor
Calculates the authority id by generating a program address.
Sourcepub fn transfer<'a>(
token_program_id: AccountInfo<'a>,
source_account: AccountInfo<'a>,
destination_account: AccountInfo<'a>,
program_authority_account: AccountInfo<'a>,
user_authority_account: AccountInfo<'a>,
amount: u64,
pool_pub_key: &Pubkey,
bump_seed: u8,
) -> ProgramResult
pub fn transfer<'a>( token_program_id: AccountInfo<'a>, source_account: AccountInfo<'a>, destination_account: AccountInfo<'a>, program_authority_account: AccountInfo<'a>, user_authority_account: AccountInfo<'a>, amount: u64, pool_pub_key: &Pubkey, bump_seed: u8, ) -> ProgramResult
Transfer tokens with authority
Sourcepub fn mint<'a>(
token_program_id: AccountInfo<'a>,
mint_account: AccountInfo<'a>,
destination_account: AccountInfo<'a>,
authority_account: AccountInfo<'a>,
amount: u64,
pool_pub_key: &Pubkey,
bump_seed: u8,
) -> ProgramResult
pub fn mint<'a>( token_program_id: AccountInfo<'a>, mint_account: AccountInfo<'a>, destination_account: AccountInfo<'a>, authority_account: AccountInfo<'a>, amount: u64, pool_pub_key: &Pubkey, bump_seed: u8, ) -> ProgramResult
Mint tokens
Sourcepub fn burn<'a>(
token_program_id: AccountInfo<'a>,
source_account: AccountInfo<'a>,
mint_account: AccountInfo<'a>,
program_authority_account: AccountInfo<'a>,
user_authority_account: AccountInfo<'a>,
amount: u64,
pool_pub_key: &Pubkey,
bump_seed: u8,
) -> ProgramResult
pub fn burn<'a>( token_program_id: AccountInfo<'a>, source_account: AccountInfo<'a>, mint_account: AccountInfo<'a>, program_authority_account: AccountInfo<'a>, user_authority_account: AccountInfo<'a>, amount: u64, pool_pub_key: &Pubkey, bump_seed: u8, ) -> ProgramResult
Burn tokens
Sourcepub fn process_init_pool(
program_id: &Pubkey,
accounts: &[AccountInfo<'_>],
mint_end_slot: Slot,
decide_end_slot: Slot,
bump_seed: u8,
) -> ProgramResult
pub fn process_init_pool( program_id: &Pubkey, accounts: &[AccountInfo<'_>], mint_end_slot: Slot, decide_end_slot: Slot, bump_seed: u8, ) -> ProgramResult
Initialize the pool
Sourcepub fn process_deposit(
program_id: &Pubkey,
accounts: &[AccountInfo<'_>],
amount: u64,
) -> ProgramResult
pub fn process_deposit( program_id: &Pubkey, accounts: &[AccountInfo<'_>], amount: u64, ) -> ProgramResult
Process Deposit instruction
Sourcepub fn process_withdraw(
program_id: &Pubkey,
accounts: &[AccountInfo<'_>],
amount: u64,
) -> ProgramResult
pub fn process_withdraw( program_id: &Pubkey, accounts: &[AccountInfo<'_>], amount: u64, ) -> ProgramResult
Process Withdraw instruction
Sourcepub fn process_decide(
_program_id: &Pubkey,
accounts: &[AccountInfo<'_>],
decision: bool,
) -> ProgramResult
pub fn process_decide( _program_id: &Pubkey, accounts: &[AccountInfo<'_>], decision: bool, ) -> ProgramResult
Process Decide instruction
Sourcepub fn process_instruction(
program_id: &Pubkey,
accounts: &[AccountInfo<'_>],
input: &[u8],
) -> ProgramResult
pub fn process_instruction( program_id: &Pubkey, accounts: &[AccountInfo<'_>], input: &[u8], ) -> ProgramResult
Processes an instruction
Auto Trait Implementations§
impl Freeze for Processor
impl RefUnwindSafe for Processor
impl Send for Processor
impl Sync for Processor
impl Unpin for Processor
impl UnwindSafe for Processor
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more