pub struct TransactionParams {
pub user_public_key: Pubkey,
pub close_input_token_account: Option<bool>,
pub create_output_token_account: Option<bool>,
pub fee_account: Option<Pubkey>,
pub fee_bps: Option<u16>,
pub fee_from_input_mint: Option<bool>,
pub output_account: Option<Pubkey>,
}Expand description
Parameters for how transaction data should be generated for swaps.
Fields§
§user_public_key: PubkeyPublic key of the user requesting the swap, needed for transaction generation.
close_input_token_account: Option<bool>If true, close the input token account as part of the transaction.
create_output_token_account: Option<bool>If true, an idempotent ATA will be added to the transactions, if supported by the providers.
fee_account: Option<Pubkey>The address of an associated token account that will be used to collect fees.
Unless fee_is_input_mint is set to true, must be in terms of the output mint.
The fee acount must already exist, or the user must add the ATA creation instruction themselves.
fee_bps: Option<u16>Fee amount to take, in basis points.
If not specified, default fee for the requester is used.
fee_from_input_mint: Option<bool>Whether the fee should be taken in terms of the input mint. Default is false, in which case the fee is taken in terms of the output mint.
output_account: Option<Pubkey>Address of the token account into which to place the output of the swap. If not specified, the funds will be deposited into an ATA associated with the user’s wallet.
Trait Implementations§
Source§impl Clone for TransactionParams
impl Clone for TransactionParams
Source§fn clone(&self) -> TransactionParams
fn clone(&self) -> TransactionParams
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TransactionParams
impl Debug for TransactionParams
Source§impl Default for TransactionParams
impl Default for TransactionParams
Source§fn default() -> TransactionParams
fn default() -> TransactionParams
Source§impl<'de> Deserialize<'de> for TransactionParams
impl<'de> Deserialize<'de> for TransactionParams
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransactionParams, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransactionParams, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for TransactionParams
impl PartialEq for TransactionParams
Source§impl Serialize for TransactionParams
impl Serialize for TransactionParams
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for TransactionParams
impl StructuralPartialEq for TransactionParams
Auto Trait Implementations§
impl Freeze for TransactionParams
impl RefUnwindSafe for TransactionParams
impl Send for TransactionParams
impl Sync for TransactionParams
impl Unpin for TransactionParams
impl UnwindSafe for TransactionParams
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
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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>
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