pub struct SwapExactInCpiBuilder<'a, 'b> { /* private fields */ }Expand description
Instruction builder for SwapExactIn via CPI.
§Accounts:
[signer]authority[writable]market[]mint_a[]mint_b[writable]authority_a[writable]authority_b[writable]market_a[writable]market_b[]token_program_a[]token_program_b[]memo_program[]instructions_sysvar
Implementations§
Source§impl<'a, 'b> SwapExactInCpiBuilder<'a, 'b>
impl<'a, 'b> SwapExactInCpiBuilder<'a, 'b>
pub fn new(program: &'b AccountInfo<'a>) -> Self
The authority
Sourcepub fn market(&mut self, market: &'b AccountInfo<'a>) -> &mut Self
pub fn market(&mut self, market: &'b AccountInfo<'a>) -> &mut Self
The market
Sourcepub fn mint_a(&mut self, mint_a: &'b AccountInfo<'a>) -> &mut Self
pub fn mint_a(&mut self, mint_a: &'b AccountInfo<'a>) -> &mut Self
The token a mint
Sourcepub fn mint_b(&mut self, mint_b: &'b AccountInfo<'a>) -> &mut Self
pub fn mint_b(&mut self, mint_b: &'b AccountInfo<'a>) -> &mut Self
The token b mint
The authority’s token account for token a
The authority’s token account for token b
Sourcepub fn market_a(&mut self, market_a: &'b AccountInfo<'a>) -> &mut Self
pub fn market_a(&mut self, market_a: &'b AccountInfo<'a>) -> &mut Self
The treasury token account for token a
Sourcepub fn market_b(&mut self, market_b: &'b AccountInfo<'a>) -> &mut Self
pub fn market_b(&mut self, market_b: &'b AccountInfo<'a>) -> &mut Self
The market token account for token b
Sourcepub fn token_program_a(
&mut self,
token_program_a: &'b AccountInfo<'a>,
) -> &mut Self
pub fn token_program_a( &mut self, token_program_a: &'b AccountInfo<'a>, ) -> &mut Self
The token program for token a
Sourcepub fn token_program_b(
&mut self,
token_program_b: &'b AccountInfo<'a>,
) -> &mut Self
pub fn token_program_b( &mut self, token_program_b: &'b AccountInfo<'a>, ) -> &mut Self
The token program for token b
Sourcepub fn memo_program(&mut self, memo_program: &'b AccountInfo<'a>) -> &mut Self
pub fn memo_program(&mut self, memo_program: &'b AccountInfo<'a>) -> &mut Self
The memo program
Sourcepub fn instructions_sysvar(
&mut self,
instructions_sysvar: &'b AccountInfo<'a>,
) -> &mut Self
pub fn instructions_sysvar( &mut self, instructions_sysvar: &'b AccountInfo<'a>, ) -> &mut Self
The instructions sysvar
pub fn amount_in(&mut self, amount_in: u64) -> &mut Self
pub fn amount_is_token_a(&mut self, amount_is_token_a: bool) -> &mut Self
pub fn slippage_tolerance( &mut self, slippage_tolerance: SlippageTolerance, ) -> &mut Self
pub fn allow_partial_fill(&mut self, allow_partial_fill: bool) -> &mut Self
Sourcepub fn add_remaining_account(
&mut self,
account: &'b AccountInfo<'a>,
is_writable: bool,
is_signer: bool,
) -> &mut Self
pub fn add_remaining_account( &mut self, account: &'b AccountInfo<'a>, is_writable: bool, is_signer: bool, ) -> &mut Self
Add an additional account to the instruction.
Sourcepub fn add_remaining_accounts(
&mut self,
accounts: &[(&'b AccountInfo<'a>, bool, bool)],
) -> &mut Self
pub fn add_remaining_accounts( &mut self, accounts: &[(&'b AccountInfo<'a>, bool, bool)], ) -> &mut Self
Add additional accounts to the instruction.
Each account is represented by a tuple of the AccountInfo, a bool indicating whether the
account is writable or not, and a bool indicating whether the account is a signer or
not.
pub fn invoke(&self) -> ProgramResult
pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> ProgramResult
Trait Implementations§
Source§impl<'a, 'b> Clone for SwapExactInCpiBuilder<'a, 'b>
impl<'a, 'b> Clone for SwapExactInCpiBuilder<'a, 'b>
Source§fn clone(&self) -> SwapExactInCpiBuilder<'a, 'b>
fn clone(&self) -> SwapExactInCpiBuilder<'a, 'b>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a, 'b> Freeze for SwapExactInCpiBuilder<'a, 'b>
impl<'a, 'b> !RefUnwindSafe for SwapExactInCpiBuilder<'a, 'b>
impl<'a, 'b> !Send for SwapExactInCpiBuilder<'a, 'b>
impl<'a, 'b> !Sync for SwapExactInCpiBuilder<'a, 'b>
impl<'a, 'b> Unpin for SwapExactInCpiBuilder<'a, 'b>
impl<'a, 'b> UnsafeUnpin for SwapExactInCpiBuilder<'a, 'b>
impl<'a, 'b> !UnwindSafe for SwapExactInCpiBuilder<'a, 'b>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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