Struct stable_swap_client::state::SwapInfo
source · [−]#[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: bool
Initialized state
is_paused: bool
Paused state
nonce: u8
Nonce 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: u64
Initial amplification coefficient (A)
target_amp_factor: u64
Target amplification coefficient (A)
start_ramp_ts: i64
Ramp A start timestamp
stop_ramp_ts: i64
Ramp A stop timestamp
future_admin_deadline: i64
Deadline to transfer admin control to future_admin_key
future_admin_key: Pubkey
Public key of the admin account to be applied
admin_key: Pubkey
Public key of admin account to execute admin instructions
token_a: SwapTokenInfo
Token A
token_b: SwapTokenInfo
Token B
pool_mint: Pubkey
Pool tokens are issued when A or B tokens are deposited. Pool tokens can be withdrawn back to the original A or B token.
fees: Fees
Fees
Trait Implementations
sourceimpl IsInitialized for SwapInfo
impl IsInitialized for SwapInfo
sourcefn is_initialized(&self) -> bool
fn is_initialized(&self) -> bool
Is initialized
sourceimpl Pack for SwapInfo
impl Pack for SwapInfo
sourcefn get_packed_len() -> usize
fn get_packed_len() -> usize
Get the packed length
sourcefn 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
sourcefn 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 RefUnwindSafe for SwapInfo
impl Send for SwapInfo
impl Sync for SwapInfo
impl Unpin for SwapInfo
impl UnwindSafe for SwapInfo
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more