pub struct SwapExactInBuilder { /* private fields */ }Expand description
Instruction builder for SwapExactIn.
§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[optional]instructions_sysvar (default toSysvar1nstructions1111111111111111111111111)
Implementations§
Source§impl SwapExactInBuilder
impl SwapExactInBuilder
pub fn new() -> Self
The authority
The authority’s token account for token a
The authority’s token account for token b
Sourcepub fn market_a(&mut self, market_a: Pubkey) -> &mut Self
pub fn market_a(&mut self, market_a: Pubkey) -> &mut Self
The treasury token account for token a
Sourcepub fn token_program_a(&mut self, token_program_a: Pubkey) -> &mut Self
pub fn token_program_a(&mut self, token_program_a: Pubkey) -> &mut Self
The token program for token a
Sourcepub fn token_program_b(&mut self, token_program_b: Pubkey) -> &mut Self
pub fn token_program_b(&mut self, token_program_b: Pubkey) -> &mut Self
The token program for token b
Sourcepub fn memo_program(&mut self, memo_program: Pubkey) -> &mut Self
pub fn memo_program(&mut self, memo_program: Pubkey) -> &mut Self
The memo program
Sourcepub fn instructions_sysvar(&mut self, instructions_sysvar: Pubkey) -> &mut Self
pub fn instructions_sysvar(&mut self, instructions_sysvar: Pubkey) -> &mut Self
[optional account, default to 'Sysvar1nstructions1111111111111111111111111']
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: AccountMeta) -> &mut Self
pub fn add_remaining_account(&mut self, account: AccountMeta) -> &mut Self
Add an additional account to the instruction.
Sourcepub fn add_remaining_accounts(&mut self, accounts: &[AccountMeta]) -> &mut Self
pub fn add_remaining_accounts(&mut self, accounts: &[AccountMeta]) -> &mut Self
Add additional accounts to the instruction.
pub fn instruction(&self) -> Instruction
Trait Implementations§
Source§impl Clone for SwapExactInBuilder
impl Clone for SwapExactInBuilder
Source§fn clone(&self) -> SwapExactInBuilder
fn clone(&self) -> SwapExactInBuilder
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 moreSource§impl Debug for SwapExactInBuilder
impl Debug for SwapExactInBuilder
Source§impl Default for SwapExactInBuilder
impl Default for SwapExactInBuilder
Source§fn default() -> SwapExactInBuilder
fn default() -> SwapExactInBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SwapExactInBuilder
impl RefUnwindSafe for SwapExactInBuilder
impl Send for SwapExactInBuilder
impl Sync for SwapExactInBuilder
impl Unpin for SwapExactInBuilder
impl UnsafeUnpin for SwapExactInBuilder
impl UnwindSafe for SwapExactInBuilder
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