#[repr(C)]pub struct SwapInfo {Show 14 fields
pub is_initialized: bool,
pub is_paused: bool,
pub nonce: u8,
pub initial_amp_factor: u64,
pub target_amp_factor: u64,
pub start_ramp_ts: i64,
pub stop_ramp_ts: i64,
pub future_admin_deadline: i64,
pub future_admin_key: Pubkey,
pub admin_key: Pubkey,
pub token_a: SwapTokenInfo,
pub token_b: SwapTokenInfo,
pub pool_mint: Pubkey,
pub fees: Fees,
}Expand description
Program states.
Fields§
§is_initialized: boolInitialized state
is_paused: boolPaused state
nonce: u8Nonce used in program address The program address is created deterministically with the nonce, swap program id, and swap account pubkey. This program address has authority over the swap’s token A account, token B account, and pool token mint.
initial_amp_factor: u64Initial amplification coefficient (A)
target_amp_factor: u64Target amplification coefficient (A)
start_ramp_ts: i64Ramp A start timestamp
stop_ramp_ts: i64Ramp A stop timestamp
future_admin_deadline: i64Deadline to transfer admin control to future_admin_key
future_admin_key: PubkeyPublic key of the admin account to be applied
admin_key: PubkeyPublic key of admin account to execute admin instructions
token_a: SwapTokenInfoToken A
token_b: SwapTokenInfoToken B
pool_mint: PubkeyPool tokens are issued when A or B tokens are deposited. Pool tokens can be withdrawn back to the original A or B token.
fees: FeesFees
Trait Implementations§
Source§impl IsInitialized for SwapInfo
impl IsInitialized for SwapInfo
Source§fn is_initialized(&self) -> bool
fn is_initialized(&self) -> bool
Is initialized
Source§impl Pack for SwapInfo
impl Pack for SwapInfo
Source§fn get_packed_len() -> usize
fn get_packed_len() -> usize
Get the packed length
Source§fn unpack(input: &[u8]) -> Result<Self, ProgramError>where
Self: IsInitialized,
fn unpack(input: &[u8]) -> Result<Self, ProgramError>where
Self: IsInitialized,
Unpack from slice and check if initialized
Source§fn unpack_unchecked(input: &[u8]) -> Result<Self, ProgramError>
fn unpack_unchecked(input: &[u8]) -> Result<Self, ProgramError>
Unpack from slice without checking if initialized
impl Copy for SwapInfo
impl Sealed for SwapInfo
impl StructuralPartialEq for SwapInfo
Auto Trait Implementations§
impl Freeze for SwapInfo
impl RefUnwindSafe for SwapInfo
impl Send for SwapInfo
impl Sync for SwapInfo
impl Unpin for SwapInfo
impl UnwindSafe for SwapInfo
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<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