Struct TransactionConfig

Source
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

§use_shared_accounts: Option<bool>

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

§program_authority_id: Option<u8>

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

Source§

fn clone(&self) -> TransactionConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TransactionConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TransactionConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for TransactionConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for TransactionConfig

Source§

fn eq(&self, other: &TransactionConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for TransactionConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for TransactionConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Encode for T
where T: Serialize + ?Sized,

Source§

fn encode<W>(&self, writer: W) -> Result<(), Box<ErrorKind>>
where W: Write,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,