pub struct SwapExactOutBuilder { /* private fields */ }Expand description
Instruction builder for SwapExactOut.
§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 SwapExactOutBuilder
impl SwapExactOutBuilder
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 market_b(&mut self, market_b: Pubkey) -> &mut Self
pub fn market_b(&mut self, market_b: Pubkey) -> &mut Self
The treasury token account for token b
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_out(&mut self, amount_out: 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 SwapExactOutBuilder
impl Clone for SwapExactOutBuilder
Source§fn clone(&self) -> SwapExactOutBuilder
fn clone(&self) -> SwapExactOutBuilder
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 SwapExactOutBuilder
impl Debug for SwapExactOutBuilder
Source§impl Default for SwapExactOutBuilder
impl Default for SwapExactOutBuilder
Source§fn default() -> SwapExactOutBuilder
fn default() -> SwapExactOutBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SwapExactOutBuilder
impl RefUnwindSafe for SwapExactOutBuilder
impl Send for SwapExactOutBuilder
impl Sync for SwapExactOutBuilder
impl Unpin for SwapExactOutBuilder
impl UnsafeUnpin for SwapExactOutBuilder
impl UnwindSafe for SwapExactOutBuilder
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