Struct cyclos_core::accounts::SwapContext
source · [−]pub struct SwapContext {
pub signer: Pubkey,
pub input_token_account: Pubkey,
pub output_token_account: Pubkey,
pub input_vault: Pubkey,
pub output_vault: Pubkey,
pub token_program: Pubkey,
pub factory_state: Pubkey,
pub pool_state: Pubkey,
pub last_observation_state: Pubkey,
pub callback_handler: Pubkey,
}Expand description
Generated client accounts for SwapContext.
Fields
signer: PubkeyThe user performing the swap
input_token_account: PubkeyThe user token account for input token CHECK: Account validation is performed by the token program
output_token_account: PubkeyThe user token account for output token CHECK: Account validation is performed by the token program
input_vault: PubkeyThe vault token account for input token
output_vault: PubkeyThe vault token account for output token
token_program: PubkeySPL program for token transfers
factory_state: PubkeyThe factory state to read protocol fees CHECK: Safety check performed inside function body
pool_state: PubkeyThe program account of the pool in which the swap will be performed CHECK: Safety check performed inside function body
last_observation_state: PubkeyThe program account for the most recent oracle observation CHECK: Safety check performed inside function body
callback_handler: PubkeyProgram which receives swap_callback CHECK: Allow arbitrary callback handlers
Trait Implementations
sourceimpl BorshSerialize for SwapContext where
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
impl BorshSerialize for SwapContext where
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
sourceimpl ToAccountMetas for SwapContext
impl ToAccountMetas for SwapContext
sourcefn to_account_metas(&self, is_signer: Option<bool>) -> Vec<AccountMeta>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn to_account_metas(&self, is_signer: Option<bool>) -> Vec<AccountMeta>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
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. Read more
Auto Trait Implementations
impl RefUnwindSafe for SwapContext
impl Send for SwapContext
impl Sync for SwapContext
impl Unpin for SwapContext
impl UnwindSafe for SwapContext
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more