Trait TokenConfigOps

Source
pub trait TokenConfigOps<C> {
Show 13 methods // Required methods fn initialize_token_map<'a>( &'a self, store: &Pubkey, token_map: &'a dyn Signer, ) -> (TransactionBuilder<'a, C>, Pubkey); fn insert_token_config( &self, store: &Pubkey, token_map: &Pubkey, name: &str, token: &Pubkey, builder: UpdateTokenConfigParams, enable: bool, new: bool, ) -> TransactionBuilder<'_, C>; fn insert_synthetic_token_config( &self, store: &Pubkey, token_map: &Pubkey, name: &str, token: &Pubkey, decimals: u8, builder: UpdateTokenConfigParams, enable: bool, new: bool, ) -> TransactionBuilder<'_, C>; fn toggle_token_config( &self, store: &Pubkey, token_map: &Pubkey, token: &Pubkey, enable: bool, ) -> TransactionBuilder<'_, C>; fn set_expected_provider( &self, store: &Pubkey, token_map: &Pubkey, token: &Pubkey, provider: PriceProviderKind, ) -> TransactionBuilder<'_, C>; fn token_name( &self, token_map: &Pubkey, token: &Pubkey, ) -> TransactionBuilder<'_, C>; fn token_decimals( &self, token_map: &Pubkey, token: &Pubkey, ) -> TransactionBuilder<'_, C>; fn token_precision( &self, token_map: &Pubkey, token: &Pubkey, ) -> TransactionBuilder<'_, C>; fn is_token_config_enabled( &self, token_map: &Pubkey, token: &Pubkey, ) -> TransactionBuilder<'_, C>; fn token_expected_provider( &self, token_map: &Pubkey, token: &Pubkey, ) -> TransactionBuilder<'_, C>; fn token_feed( &self, token_map: &Pubkey, token: &Pubkey, provider: PriceProviderKind, ) -> TransactionBuilder<'_, C>; fn token_timestamp_adjustment( &self, token_map: &Pubkey, token: &Pubkey, provider: PriceProviderKind, ) -> TransactionBuilder<'_, C>; fn token_config( &self, token_map: &Pubkey, token: &Pubkey, ) -> impl Future<Output = Result<TokenConfig>>;
}
Expand description

Token config management for GMSOL.

Required Methods§

Source

fn initialize_token_map<'a>( &'a self, store: &Pubkey, token_map: &'a dyn Signer, ) -> (TransactionBuilder<'a, C>, Pubkey)

Initialize a TokenMap account.

Source

fn insert_token_config( &self, store: &Pubkey, token_map: &Pubkey, name: &str, token: &Pubkey, builder: UpdateTokenConfigParams, enable: bool, new: bool, ) -> TransactionBuilder<'_, C>

Insert or update config for the given token.

Source

fn insert_synthetic_token_config( &self, store: &Pubkey, token_map: &Pubkey, name: &str, token: &Pubkey, decimals: u8, builder: UpdateTokenConfigParams, enable: bool, new: bool, ) -> TransactionBuilder<'_, C>

Insert or update config the given synthetic token.

Source

fn toggle_token_config( &self, store: &Pubkey, token_map: &Pubkey, token: &Pubkey, enable: bool, ) -> TransactionBuilder<'_, C>

Toggle token config.

Source

fn set_expected_provider( &self, store: &Pubkey, token_map: &Pubkey, token: &Pubkey, provider: PriceProviderKind, ) -> TransactionBuilder<'_, C>

Set expected provider.

Source

fn token_name( &self, token_map: &Pubkey, token: &Pubkey, ) -> TransactionBuilder<'_, C>

Get the name for the given token.

Source

fn token_decimals( &self, token_map: &Pubkey, token: &Pubkey, ) -> TransactionBuilder<'_, C>

Get the token decimals for the given token.

Source

fn token_precision( &self, token_map: &Pubkey, token: &Pubkey, ) -> TransactionBuilder<'_, C>

Get the price precision for the given token.

Source

fn is_token_config_enabled( &self, token_map: &Pubkey, token: &Pubkey, ) -> TransactionBuilder<'_, C>

Check if the config of the given token is enbaled.

Source

fn token_expected_provider( &self, token_map: &Pubkey, token: &Pubkey, ) -> TransactionBuilder<'_, C>

Get expected provider for the given token.

Source

fn token_feed( &self, token_map: &Pubkey, token: &Pubkey, provider: PriceProviderKind, ) -> TransactionBuilder<'_, C>

Get feed address of the provider of the given token.

Source

fn token_timestamp_adjustment( &self, token_map: &Pubkey, token: &Pubkey, provider: PriceProviderKind, ) -> TransactionBuilder<'_, C>

Get timestamp adjustment of the given token and provider.

Source

fn token_config( &self, token_map: &Pubkey, token: &Pubkey, ) -> impl Future<Output = Result<TokenConfig>>

Get basic token config.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<C, S> TokenConfigOps<C> for Client<C>
where C: Deref<Target = S> + Clone, S: Signer,