pub struct TransactionConfig {Show 17 fields
pub wrap_and_unwrap_sol: bool,
pub allow_optimized_wrapped_sol_token_account: bool,
pub fee_account: Option<Pubkey>,
pub destination_token_account: Option<Pubkey>,
pub tracking_account: Option<Pubkey>,
pub compute_unit_price_micro_lamports: Option<ComputeUnitPriceMicroLamports>,
pub prioritization_fee_lamports: Option<PrioritizationFeeLamports>,
pub dynamic_compute_unit_limit: bool,
pub as_legacy_transaction: bool,
pub use_shared_accounts: Option<bool>,
pub use_token_ledger: bool,
pub skip_user_accounts_rpc_calls: bool,
pub keyed_ui_accounts: Option<Vec<KeyedUiAccount>>,
pub program_authority_id: Option<u8>,
pub dynamic_slippage: Option<DynamicSlippageSettings>,
pub blockhash_slots_to_expiry: Option<u8>,
pub correct_last_valid_block_height: bool,
}
Fields§
§wrap_and_unwrap_sol: bool
Wrap and unwrap SOL. Will be ignored if destination_token_account
is set because the destination_token_account
may belong to a different user that we have no authority to close.
allow_optimized_wrapped_sol_token_account: bool
Allow optimized WSOL token account by using transfer, assign with seed, allocate with seed then initialize account 3 instead of the expensive associated token account process
fee_account: Option<Pubkey>
Fee token account for the output token, it is derived using the seeds = [“referral_ata”, referral_account, mint] and the REFER4ZgmyYx9c6He5XfaTMiGfdLwRnkV4RPp9t9iF3
referral contract (only pass in if you set a feeBps and make sure that the feeAccount has been created)
destination_token_account: Option<Pubkey>
Public key of the token account that will be used to receive the token out of the swap. If not provided, the user’s ATA will be used. If provided, we assume that the token account is already initialized.
tracking_account: Option<Pubkey>
Add a readonly, non signer tracking account that isn’t used by jupiter
compute_unit_price_micro_lamports: Option<ComputeUnitPriceMicroLamports>
compute unit price to prioritize the transaction, the additional fee will be compute unit consumed * computeUnitPriceMicroLamports
prioritization_fee_lamports: Option<PrioritizationFeeLamports>
Prioritization fee lamports paid for the transaction in addition to the signatures fee.
Mutually exclusive with compute_unit_price_micro_lamports
.
dynamic_compute_unit_limit: bool
When enabled, it will do a swap simulation to get the compute unit used and set it in ComputeBudget’s compute unit limit. This will increase latency slightly since there will be one extra RPC call to simulate this. Default is false.
as_legacy_transaction: bool
Request a legacy transaction rather than the default versioned transaction, needs to be paired with a quote using asLegacyTransaction otherwise the transaction might be too large
Default: false
This enables the usage of shared program accounts. That means no intermediate token accounts or open orders accounts need to be created. But it also means that the likelihood of hot accounts is higher.
Default: Optimized internally
use_token_ledger: bool
This is useful when the instruction before the swap has a transfer that increases the input token amount. Then, the swap will just use the difference between the token ledger token amount and post token amount.
Default: false
skip_user_accounts_rpc_calls: bool
Skip RPC calls and assume the user account do not exist, as a result all setup instruction will be populated but no RPC call will be done for user related accounts (token accounts, openbook open orders…)
keyed_ui_accounts: Option<Vec<KeyedUiAccount>>
Providing keyed ui accounts allow loading AMMs that are not in the market cache If a keyed ui account is the AMM state, it has to be provided with its params according to the market cache format
The program authority ID
dynamic_slippage: Option<DynamicSlippageSettings>
Dynamic slippage
blockhash_slots_to_expiry: Option<u8>
Slots to expiry of the blockhash
correct_last_valid_block_height: bool
Requests a correct last valid block height, this is to allow a smooth transition to agave 2.0 for all consumers, see https://github.com/solana-labs/solana/issues/24526
Trait Implementations§
Source§impl Clone for TransactionConfig
impl Clone for TransactionConfig
Source§fn clone(&self) -> TransactionConfig
fn clone(&self) -> TransactionConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TransactionConfig
impl Debug for TransactionConfig
Source§impl Default for TransactionConfig
impl Default for TransactionConfig
Source§impl<'de> Deserialize<'de> for TransactionConfigwhere
TransactionConfig: Default,
impl<'de> Deserialize<'de> for TransactionConfigwhere
TransactionConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for TransactionConfig
impl PartialEq for TransactionConfig
Source§impl Serialize for TransactionConfig
impl Serialize for TransactionConfig
impl StructuralPartialEq for TransactionConfig
Auto Trait Implementations§
impl Freeze for TransactionConfig
impl RefUnwindSafe for TransactionConfig
impl Send for TransactionConfig
impl Sync for TransactionConfig
impl Unpin for TransactionConfig
impl UnwindSafe for TransactionConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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