0% found this document useful (0 votes)
54 views4 pages

SwapRouterBaseIn in Raydium - Amm - v3 - Instructions - Swap - Router - Base - in - Rust

Uploaded by

tifes20847
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views4 pages

SwapRouterBaseIn in Raydium - Amm - v3 - Instructions - Swap - Router - Base - in - Rust

Uploaded by

tifes20847
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

  ▼  ▼  Rust ▼

Struct raydium_amm_v3::instructions::swap_router_base_in::
SwapRouterBaseIn

pub struct SwapRouterBaseIn<'info> {


pub payer: Signer<'info>,
pub input_token_account: InterfaceAccount<'info, TokenAccount>,
pub input_token_mint: InterfaceAccount<'info, Mint>,
pub other_pool_state: AccountLoader<'info, PoolState>,
pub token_program: Program<'info, Token>,
pub token_program_2022: Program<'info, Token2022>,
pub memo_program: UncheckedAccount<'info>,
pub system_program: Program<'info, System>,
}

Fields

payer: Signer<'info>
The user performing the swap
input_token_account: InterfaceAccount<'info, TokenAccount>
The token account that pays input tokens for the swap
input_token_mint: InterfaceAccount<'info, Mint>
The mint of input token
other_pool_state: AccountLoader<'info, PoolState>
token_program: Program<'info, Token>
SPL program for token transfers
token_program_2022: Program<'info, Token2022>
SPL program 2022 for token transfers
memo_program: UncheckedAccount<'info>
CHECK:
system_program: Program<'info, System>

Trait Implementations

impl<'info> Accounts<'info, SwapRouterBaseInBumps> for


SwapRouterBaseIn<'info>
where
'info: 'info,

fn try_accounts(
__program_id: &Pubkey,
__accounts: &mut &'info [AccountInfo<'info>],
__ix_data: &[u8],
__bumps: &mut SwapRouterBaseInBumps,
__reallocs: &mut BTreeSet<Pubkey>
) -> Result<Self>

Returns the validated accounts struct. What constitutes “valid” is program dependent. However,
users of these types should never have to worry about account substitution attacks. For example, if
a program expects a Mint account from the SPL token program in a particular field, then it
should be impossible for this method to return Ok if any other account type is given–from the SPL
token program or elsewhere. Read more

impl<'info> AccountsExit<'info> for SwapRouterBaseIn<'info>


where
'info: 'info,

fn exit(&self, program_id: &Pubkey) -> Result<()>

program_id is the currently executing program.

impl<'info> Bumps for SwapRouterBaseIn<'info>


where
'info: 'info,

type Bumps = SwapRouterBaseInBumps

Struct to hold account bump seeds.

impl<'info> ToAccountInfos<'info> for SwapRouterBaseIn<'info>


where
'info: 'info,

fn to_account_infos(&self) -> Vec<AccountInfo<'info>>

impl<'info> ToAccountMetas for SwapRouterBaseIn<'info>

fn to_account_metas(&self, is_signer: Option<bool>) -> Vec<AccountMeta>


is_signer is given as an optional override for the signer meta field. This covers the edge case
when a program-derived-address needs to relay a transaction from a client to another program
but sign the transaction before the relay. The client cannot mark the field as a signer, and so we
have to override the is_signer meta field given by the client.

Auto Trait Implementations

impl<'info> !RefUnwindSafe for SwapRouterBaseIn<'info>

impl<'info> !Send for SwapRouterBaseIn<'info>

impl<'info> !Sync for SwapRouterBaseIn<'info>

impl<'info> Unpin for SwapRouterBaseIn<'info>

impl<'info> !UnwindSafe for SwapRouterBaseIn<'info>

Blanket Implementations

impl<T> AbiExample for T

impl<T> Any for T


where
T: 'static + ?Sized,

impl<T> Borrow<T> for T


where
T: ?Sized,

impl<T> BorrowMut<T> for T


where
T: ?Sized,

impl<T> From<T> for T

impl<T, U> Into<U> for T


where
U: From<T>,

impl<T> Pointable for T

impl<T> Same for T

impl<T, U> TryFrom<U> for T


where
U: Into<T>,

impl<T, U> TryInto<U> for T


where
U: TryFrom<T>,

impl<V, T> VZip<V> for T


where
V: MultiLane<T>,

You might also like