Struct jet_margin::TokenConfig
source · [−]pub struct TokenConfig {
pub mint: Pubkey,
pub underlying_mint: Pubkey,
pub airspace: Pubkey,
pub admin: TokenAdmin,
pub token_kind: TokenKind,
pub value_modifier: u16,
pub max_staleness: u64,
}
Expand description
The configuration account specifying parameters for a token when used in a position within a margin account.
Fields
mint: Pubkey
The mint for the token
underlying_mint: Pubkey
The mint for the underlying token represented, if any
airspace: Pubkey
The space this config is valid within
admin: TokenAdmin
The administrator of this token, which has the authority to provide information about (e.g. prices) and otherwise modify position states for these tokens.
token_kind: TokenKind
Description of this token
This determines the way the margin program values a token as a position in a margin account.
value_modifier: u16
A modifier to adjust the token value, based on the kind of token
max_staleness: u64
The maximum staleness (seconds) that’s acceptable for balances of this token
Implementations
sourceimpl TokenConfig
impl TokenConfig
Trait Implementations
sourceimpl AccountDeserialize for TokenConfig
impl AccountDeserialize for TokenConfig
sourcefn try_deserialize(buf: &mut &[u8]) -> Result<Self>
fn try_deserialize(buf: &mut &[u8]) -> Result<Self>
Deserializes previously initialized account data. Should fail for all
uninitialized accounts, where the bytes are zeroed. Implementations
should be unique to a particular account type so that one can never
successfully deserialize the data of one account type into another.
For example, if the SPL token program were to implement this trait,
it should be impossible to deserialize a
Mint
account into a token
Account
. Read moresourcefn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self>
fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self>
Deserializes account data without checking the account discriminator.
This should only be used on account initialization, when the bytes of
the account are zeroed. Read more
sourceimpl AccountSerialize for TokenConfig
impl AccountSerialize for TokenConfig
sourcefn try_serialize<W: Write>(&self, writer: &mut W) -> Result<()>
fn try_serialize<W: Write>(&self, writer: &mut W) -> Result<()>
Serializes the account data into
writer
.sourceimpl BorshDeserialize for TokenConfigwhere
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
TokenAdmin: BorshDeserialize,
TokenKind: BorshDeserialize,
u16: BorshDeserialize,
u64: BorshDeserialize,
impl BorshDeserialize for TokenConfigwhere
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
TokenAdmin: BorshDeserialize,
TokenKind: BorshDeserialize,
u16: BorshDeserialize,
u64: BorshDeserialize,
sourcefn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes. Read more
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
sourceimpl BorshSerialize for TokenConfigwhere
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
TokenAdmin: BorshSerialize,
TokenKind: BorshSerialize,
u16: BorshSerialize,
u64: BorshSerialize,
impl BorshSerialize for TokenConfigwhere
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
TokenAdmin: BorshSerialize,
TokenKind: BorshSerialize,
u16: BorshSerialize,
u64: BorshSerialize,
sourceimpl Clone for TokenConfig
impl Clone for TokenConfig
sourcefn clone(&self) -> TokenConfig
fn clone(&self) -> TokenConfig
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for TokenConfig
impl Debug for TokenConfig
sourceimpl Discriminator for TokenConfig
impl Discriminator for TokenConfig
fn discriminator() -> [u8; 8]
sourceimpl Owner for TokenConfig
impl Owner for TokenConfig
sourceimpl PartialEq<TokenConfig> for TokenConfig
impl PartialEq<TokenConfig> for TokenConfig
sourcefn eq(&self, other: &TokenConfig) -> bool
fn eq(&self, other: &TokenConfig) -> bool
impl Eq for TokenConfig
impl StructuralEq for TokenConfig
impl StructuralPartialEq for TokenConfig
Auto Trait Implementations
impl RefUnwindSafe for TokenConfig
impl Send for TokenConfig
impl Sync for TokenConfig
impl Unpin for TokenConfig
impl UnwindSafe for TokenConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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