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§
Sourcefn initialize_token_map<'a>(
&'a self,
store: &Pubkey,
token_map: &'a dyn Signer,
) -> (TransactionBuilder<'a, C>, Pubkey)
fn initialize_token_map<'a>( &'a self, store: &Pubkey, token_map: &'a dyn Signer, ) -> (TransactionBuilder<'a, C>, Pubkey)
Initialize a TokenMap
account.
Sourcefn insert_token_config(
&self,
store: &Pubkey,
token_map: &Pubkey,
name: &str,
token: &Pubkey,
builder: UpdateTokenConfigParams,
enable: bool,
new: bool,
) -> TransactionBuilder<'_, C>
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.
Sourcefn 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 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.
Sourcefn toggle_token_config(
&self,
store: &Pubkey,
token_map: &Pubkey,
token: &Pubkey,
enable: bool,
) -> TransactionBuilder<'_, C>
fn toggle_token_config( &self, store: &Pubkey, token_map: &Pubkey, token: &Pubkey, enable: bool, ) -> TransactionBuilder<'_, C>
Toggle token config.
Sourcefn set_expected_provider(
&self,
store: &Pubkey,
token_map: &Pubkey,
token: &Pubkey,
provider: PriceProviderKind,
) -> TransactionBuilder<'_, C>
fn set_expected_provider( &self, store: &Pubkey, token_map: &Pubkey, token: &Pubkey, provider: PriceProviderKind, ) -> TransactionBuilder<'_, C>
Set expected provider.
Sourcefn token_name(
&self,
token_map: &Pubkey,
token: &Pubkey,
) -> TransactionBuilder<'_, C>
fn token_name( &self, token_map: &Pubkey, token: &Pubkey, ) -> TransactionBuilder<'_, C>
Get the name for the given token.
Sourcefn token_decimals(
&self,
token_map: &Pubkey,
token: &Pubkey,
) -> TransactionBuilder<'_, C>
fn token_decimals( &self, token_map: &Pubkey, token: &Pubkey, ) -> TransactionBuilder<'_, C>
Get the token decimals for the given token.
Sourcefn token_precision(
&self,
token_map: &Pubkey,
token: &Pubkey,
) -> TransactionBuilder<'_, C>
fn token_precision( &self, token_map: &Pubkey, token: &Pubkey, ) -> TransactionBuilder<'_, C>
Get the price precision for the given token.
Sourcefn is_token_config_enabled(
&self,
token_map: &Pubkey,
token: &Pubkey,
) -> TransactionBuilder<'_, C>
fn is_token_config_enabled( &self, token_map: &Pubkey, token: &Pubkey, ) -> TransactionBuilder<'_, C>
Check if the config of the given token is enbaled.
Sourcefn token_expected_provider(
&self,
token_map: &Pubkey,
token: &Pubkey,
) -> TransactionBuilder<'_, C>
fn token_expected_provider( &self, token_map: &Pubkey, token: &Pubkey, ) -> TransactionBuilder<'_, C>
Get expected provider for the given token.
Sourcefn token_feed(
&self,
token_map: &Pubkey,
token: &Pubkey,
provider: PriceProviderKind,
) -> TransactionBuilder<'_, C>
fn token_feed( &self, token_map: &Pubkey, token: &Pubkey, provider: PriceProviderKind, ) -> TransactionBuilder<'_, C>
Get feed address of the provider of the given token.
Sourcefn token_timestamp_adjustment(
&self,
token_map: &Pubkey,
token: &Pubkey,
provider: PriceProviderKind,
) -> TransactionBuilder<'_, C>
fn token_timestamp_adjustment( &self, token_map: &Pubkey, token: &Pubkey, provider: PriceProviderKind, ) -> TransactionBuilder<'_, C>
Get timestamp adjustment of the given token and provider.
Sourcefn token_config(
&self,
token_map: &Pubkey,
token: &Pubkey,
) -> impl Future<Output = Result<TokenConfig>>
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.