pub struct TwoHopSwapBuilder { /* private fields */ }Expand description
Instruction builder for TwoHopSwap.
§Accounts:
[optional]token_program (default toTokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA)[signer]token_authority[writable]vortex_one[writable]vortex_two[writable]token_owner_account_one_a[writable]token_vault_one_a[writable]token_owner_account_one_b[writable]token_vault_one_b[writable]token_owner_account_two_a[writable]token_vault_two_a[writable]token_owner_account_two_b[writable]token_vault_two_b[writable]tick_array_one0[writable]tick_array_one1[writable]tick_array_one2[writable]tick_array_two0[writable]tick_array_two1[writable]tick_array_two2[]oracle_one[]oracle_two[optional]program_signer
Implementations§
Source§impl TwoHopSwapBuilder
impl TwoHopSwapBuilder
pub fn new() -> Self
Sourcepub fn token_program(&mut self, token_program: Pubkey) -> &mut Self
pub fn token_program(&mut self, token_program: Pubkey) -> &mut Self
[optional account, default to 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA']
pub fn vortex_one(&mut self, vortex_one: Pubkey) -> &mut Self
pub fn vortex_two(&mut self, vortex_two: Pubkey) -> &mut Self
pub fn token_owner_account_one_a( &mut self, token_owner_account_one_a: Pubkey, ) -> &mut Self
pub fn token_vault_one_a(&mut self, token_vault_one_a: Pubkey) -> &mut Self
pub fn token_owner_account_one_b( &mut self, token_owner_account_one_b: Pubkey, ) -> &mut Self
pub fn token_vault_one_b(&mut self, token_vault_one_b: Pubkey) -> &mut Self
pub fn token_owner_account_two_a( &mut self, token_owner_account_two_a: Pubkey, ) -> &mut Self
pub fn token_vault_two_a(&mut self, token_vault_two_a: Pubkey) -> &mut Self
pub fn token_owner_account_two_b( &mut self, token_owner_account_two_b: Pubkey, ) -> &mut Self
pub fn token_vault_two_b(&mut self, token_vault_two_b: Pubkey) -> &mut Self
pub fn tick_array_one0(&mut self, tick_array_one0: Pubkey) -> &mut Self
pub fn tick_array_one1(&mut self, tick_array_one1: Pubkey) -> &mut Self
pub fn tick_array_one2(&mut self, tick_array_one2: Pubkey) -> &mut Self
pub fn tick_array_two0(&mut self, tick_array_two0: Pubkey) -> &mut Self
pub fn tick_array_two1(&mut self, tick_array_two1: Pubkey) -> &mut Self
pub fn tick_array_two2(&mut self, tick_array_two2: Pubkey) -> &mut Self
pub fn oracle_one(&mut self, oracle_one: Pubkey) -> &mut Self
pub fn oracle_two(&mut self, oracle_two: Pubkey) -> &mut Self
Sourcepub fn program_signer(&mut self, program_signer: Option<Pubkey>) -> &mut Self
pub fn program_signer(&mut self, program_signer: Option<Pubkey>) -> &mut Self
[optional account]
The signer for Fogo Sessions token program CPIs
pub fn amount(&mut self, amount: u64) -> &mut Self
pub fn other_amount_threshold( &mut self, other_amount_threshold: u64, ) -> &mut Self
pub fn amount_specified_is_input( &mut self, amount_specified_is_input: bool, ) -> &mut Self
pub fn a_to_b_one(&mut self, a_to_b_one: bool) -> &mut Self
pub fn a_to_b_two(&mut self, a_to_b_two: bool) -> &mut Self
pub fn sqrt_price_limit_one(&mut self, sqrt_price_limit_one: u128) -> &mut Self
pub fn sqrt_price_limit_two(&mut self, sqrt_price_limit_two: u128) -> &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 TwoHopSwapBuilder
impl Clone for TwoHopSwapBuilder
Source§fn clone(&self) -> TwoHopSwapBuilder
fn clone(&self) -> TwoHopSwapBuilder
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 TwoHopSwapBuilder
impl Debug for TwoHopSwapBuilder
Source§impl Default for TwoHopSwapBuilder
impl Default for TwoHopSwapBuilder
Source§fn default() -> TwoHopSwapBuilder
fn default() -> TwoHopSwapBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TwoHopSwapBuilder
impl RefUnwindSafe for TwoHopSwapBuilder
impl Send for TwoHopSwapBuilder
impl Sync for TwoHopSwapBuilder
impl Unpin for TwoHopSwapBuilder
impl UnwindSafe for TwoHopSwapBuilder
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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