pub struct SwapArgs {
pub deadline: i64,
pub amount_searcher: u64,
pub amount_user: u64,
pub referral_fee_bps: u16,
pub fee_token: FeeToken,
}
Expand description
For all swap instructions and contexts, the mint is defined with respect to the party that provides that token in the swap.
So mint_searcher
refers to the token that the searcher provides in the swap,
and mint_user
refers to the token that the user provides in the swap.
The {X}_ta/ata_mint_{Y}
notation indicates the (associated) token account belonging to X for the mint of the token Y provides in the swap.
For example, searcher_ta_mint_searcher
is the searcher’s token account of the mint the searcher provides in the swap,
and user_ata_mint_searcher
is the user’s token account of the same mint.
Fields§
§deadline: i64
§amount_searcher: u64
§amount_user: u64
§referral_fee_bps: u16
§fee_token: FeeToken
Trait Implementations§
Source§impl BorshDeserialize for SwapArgswhere
i64: BorshDeserialize,
u64: BorshDeserialize,
u16: BorshDeserialize,
FeeToken: BorshDeserialize,
impl BorshDeserialize for SwapArgswhere
i64: BorshDeserialize,
u64: BorshDeserialize,
u16: BorshDeserialize,
FeeToken: BorshDeserialize,
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for SwapArgs
impl BorshSerialize for SwapArgs
impl Copy for SwapArgs
impl Eq for SwapArgs
impl StructuralPartialEq for SwapArgs
Auto Trait Implementations§
impl Freeze for SwapArgs
impl RefUnwindSafe for SwapArgs
impl Send for SwapArgs
impl Sync for SwapArgs
impl Unpin for SwapArgs
impl UnwindSafe for SwapArgs
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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