pub trait TreasuryOps<C> {
Show 19 methods
// Required methods
fn initialize_config(
&self,
store: &Pubkey,
) -> TransactionBuilder<'_, C, Pubkey>;
fn set_treasury_vault_config(
&self,
store: &Pubkey,
treasury_vault_config: &Pubkey,
) -> TransactionBuilder<'_, C>;
fn set_gt_factor(
&self,
store: &Pubkey,
factor: u128,
) -> Result<TransactionBuilder<'_, C>>;
fn set_buyback_factor(
&self,
store: &Pubkey,
factor: u128,
) -> Result<TransactionBuilder<'_, C>>;
fn initialize_treasury_vault_config(
&self,
store: &Pubkey,
index: u16,
) -> TransactionBuilder<'_, C, Pubkey>;
fn insert_token_to_treasury(
&self,
store: &Pubkey,
treasury_vault_config: Option<&Pubkey>,
token_mint: &Pubkey,
) -> impl Future<Output = Result<TransactionBuilder<'_, C>>>;
fn remove_token_from_treasury(
&self,
store: &Pubkey,
treasury_vault_config: Option<&Pubkey>,
token_mint: &Pubkey,
) -> impl Future<Output = Result<TransactionBuilder<'_, C>>>;
fn toggle_token_flag(
&self,
store: &Pubkey,
treasury_vault_config: Option<&Pubkey>,
token_mint: &Pubkey,
flag: TokenFlag,
value: bool,
) -> impl Future<Output = Result<TransactionBuilder<'_, C>>>;
fn deposit_to_treasury_valut(
&self,
store: &Pubkey,
treasury_vault_config_hint: Option<&Pubkey>,
token_mint: &Pubkey,
token_program_id: Option<&Pubkey>,
time_window: u32,
) -> impl Future<Output = Result<TransactionBuilder<'_, C, Pubkey>>>;
fn withdraw_from_treasury_vault(
&self,
store: &Pubkey,
treasury_vault_config_hint: Option<&Pubkey>,
token_mint: &Pubkey,
token_program_id: Option<&Pubkey>,
amount: u64,
decimals: u8,
target: &Pubkey,
) -> impl Future<Output = Result<TransactionBuilder<'_, C>>>;
fn confirm_gt_buyback(
&self,
store: &Pubkey,
gt_exchange_vault: &Pubkey,
oracle: &Pubkey,
) -> ConfirmGtBuybackBuilder<'_, C>;
fn transfer_receiver(
&self,
store: &Pubkey,
new_receiver: &Pubkey,
) -> TransactionBuilder<'_, C>;
fn set_referral_reward(
&self,
store: &Pubkey,
factors: Vec<u128>,
) -> TransactionBuilder<'_, C>;
fn claim_fees_to_receiver_vault(
&self,
store: &Pubkey,
market_token: &Pubkey,
token_mint: &Pubkey,
min_amount: u64,
) -> TransactionBuilder<'_, C>;
fn prepare_gt_bank(
&self,
store: &Pubkey,
treasury_vault_config_hint: Option<&Pubkey>,
gt_exchange_vault: &Pubkey,
) -> impl Future<Output = Result<TransactionBuilder<'_, C, Pubkey>>>;
fn sync_gt_bank(
&self,
store: &Pubkey,
treasury_vault_config_hint: Option<&Pubkey>,
gt_exchange_vault: &Pubkey,
token_mint: &Pubkey,
token_program_id: Option<&Pubkey>,
) -> impl Future<Output = Result<TransactionBuilder<'_, C>>>;
fn complete_gt_exchange(
&self,
store: &Pubkey,
exchange: &Pubkey,
treasury_vault_config_hint: Option<&Pubkey>,
tokens_hint: Option<Vec<(Pubkey, Pubkey)>>,
gt_exchange_vault_hint: Option<&Pubkey>,
) -> impl Future<Output = Result<TransactionBuilder<'_, C>>>;
fn create_treasury_swap(
&self,
store: &Pubkey,
market_token: &Pubkey,
swap_in_token: &Pubkey,
swap_out_token: &Pubkey,
swap_in_token_amount: u64,
options: CreateTreasurySwapOptions,
) -> impl Future<Output = Result<TransactionBuilder<'_, C, Pubkey>>>;
fn cancel_treasury_swap(
&self,
store: &Pubkey,
order: &Pubkey,
hint: Option<(&Pubkey, &Pubkey)>,
) -> impl Future<Output = Result<TransactionBuilder<'_, C>>>;
}
Expand description
Treasury instructions.
Required Methods§
Sourcefn initialize_config(&self, store: &Pubkey) -> TransactionBuilder<'_, C, Pubkey>
fn initialize_config(&self, store: &Pubkey) -> TransactionBuilder<'_, C, Pubkey>
Initialize Config
account.
Sourcefn set_treasury_vault_config(
&self,
store: &Pubkey,
treasury_vault_config: &Pubkey,
) -> TransactionBuilder<'_, C>
fn set_treasury_vault_config( &self, store: &Pubkey, treasury_vault_config: &Pubkey, ) -> TransactionBuilder<'_, C>
Set treasury vault config.
Sourcefn set_gt_factor(
&self,
store: &Pubkey,
factor: u128,
) -> Result<TransactionBuilder<'_, C>>
fn set_gt_factor( &self, store: &Pubkey, factor: u128, ) -> Result<TransactionBuilder<'_, C>>
Set GT factor.
Sourcefn set_buyback_factor(
&self,
store: &Pubkey,
factor: u128,
) -> Result<TransactionBuilder<'_, C>>
fn set_buyback_factor( &self, store: &Pubkey, factor: u128, ) -> Result<TransactionBuilder<'_, C>>
Set buyback factor.
Sourcefn initialize_treasury_vault_config(
&self,
store: &Pubkey,
index: u16,
) -> TransactionBuilder<'_, C, Pubkey>
fn initialize_treasury_vault_config( &self, store: &Pubkey, index: u16, ) -> TransactionBuilder<'_, C, Pubkey>
Initialize TreasuryVaultConfig
.
Sourcefn insert_token_to_treasury(
&self,
store: &Pubkey,
treasury_vault_config: Option<&Pubkey>,
token_mint: &Pubkey,
) -> impl Future<Output = Result<TransactionBuilder<'_, C>>>
fn insert_token_to_treasury( &self, store: &Pubkey, treasury_vault_config: Option<&Pubkey>, token_mint: &Pubkey, ) -> impl Future<Output = Result<TransactionBuilder<'_, C>>>
Insert token to treasury.
Sourcefn remove_token_from_treasury(
&self,
store: &Pubkey,
treasury_vault_config: Option<&Pubkey>,
token_mint: &Pubkey,
) -> impl Future<Output = Result<TransactionBuilder<'_, C>>>
fn remove_token_from_treasury( &self, store: &Pubkey, treasury_vault_config: Option<&Pubkey>, token_mint: &Pubkey, ) -> impl Future<Output = Result<TransactionBuilder<'_, C>>>
Remove token from treasury.
Sourcefn toggle_token_flag(
&self,
store: &Pubkey,
treasury_vault_config: Option<&Pubkey>,
token_mint: &Pubkey,
flag: TokenFlag,
value: bool,
) -> impl Future<Output = Result<TransactionBuilder<'_, C>>>
fn toggle_token_flag( &self, store: &Pubkey, treasury_vault_config: Option<&Pubkey>, token_mint: &Pubkey, flag: TokenFlag, value: bool, ) -> impl Future<Output = Result<TransactionBuilder<'_, C>>>
Toggle token flag.
Sourcefn deposit_to_treasury_valut(
&self,
store: &Pubkey,
treasury_vault_config_hint: Option<&Pubkey>,
token_mint: &Pubkey,
token_program_id: Option<&Pubkey>,
time_window: u32,
) -> impl Future<Output = Result<TransactionBuilder<'_, C, Pubkey>>>
fn deposit_to_treasury_valut( &self, store: &Pubkey, treasury_vault_config_hint: Option<&Pubkey>, token_mint: &Pubkey, token_program_id: Option<&Pubkey>, time_window: u32, ) -> impl Future<Output = Result<TransactionBuilder<'_, C, Pubkey>>>
Deposit to treasury vault.
Sourcefn withdraw_from_treasury_vault(
&self,
store: &Pubkey,
treasury_vault_config_hint: Option<&Pubkey>,
token_mint: &Pubkey,
token_program_id: Option<&Pubkey>,
amount: u64,
decimals: u8,
target: &Pubkey,
) -> impl Future<Output = Result<TransactionBuilder<'_, C>>>
fn withdraw_from_treasury_vault( &self, store: &Pubkey, treasury_vault_config_hint: Option<&Pubkey>, token_mint: &Pubkey, token_program_id: Option<&Pubkey>, amount: u64, decimals: u8, target: &Pubkey, ) -> impl Future<Output = Result<TransactionBuilder<'_, C>>>
Withdraw from treasury vault.
Sourcefn confirm_gt_buyback(
&self,
store: &Pubkey,
gt_exchange_vault: &Pubkey,
oracle: &Pubkey,
) -> ConfirmGtBuybackBuilder<'_, C>
fn confirm_gt_buyback( &self, store: &Pubkey, gt_exchange_vault: &Pubkey, oracle: &Pubkey, ) -> ConfirmGtBuybackBuilder<'_, C>
Confirm GT buyback.
Sourcefn transfer_receiver(
&self,
store: &Pubkey,
new_receiver: &Pubkey,
) -> TransactionBuilder<'_, C>
fn transfer_receiver( &self, store: &Pubkey, new_receiver: &Pubkey, ) -> TransactionBuilder<'_, C>
Transfer receiver.
Sourcefn set_referral_reward(
&self,
store: &Pubkey,
factors: Vec<u128>,
) -> TransactionBuilder<'_, C>
fn set_referral_reward( &self, store: &Pubkey, factors: Vec<u128>, ) -> TransactionBuilder<'_, C>
Set referral reward factors.
Sourcefn claim_fees_to_receiver_vault(
&self,
store: &Pubkey,
market_token: &Pubkey,
token_mint: &Pubkey,
min_amount: u64,
) -> TransactionBuilder<'_, C>
fn claim_fees_to_receiver_vault( &self, store: &Pubkey, market_token: &Pubkey, token_mint: &Pubkey, min_amount: u64, ) -> TransactionBuilder<'_, C>
Claim fees to receiver vault.
Sourcefn prepare_gt_bank(
&self,
store: &Pubkey,
treasury_vault_config_hint: Option<&Pubkey>,
gt_exchange_vault: &Pubkey,
) -> impl Future<Output = Result<TransactionBuilder<'_, C, Pubkey>>>
fn prepare_gt_bank( &self, store: &Pubkey, treasury_vault_config_hint: Option<&Pubkey>, gt_exchange_vault: &Pubkey, ) -> impl Future<Output = Result<TransactionBuilder<'_, C, Pubkey>>>
Prepare GT bank.
Sourcefn sync_gt_bank(
&self,
store: &Pubkey,
treasury_vault_config_hint: Option<&Pubkey>,
gt_exchange_vault: &Pubkey,
token_mint: &Pubkey,
token_program_id: Option<&Pubkey>,
) -> impl Future<Output = Result<TransactionBuilder<'_, C>>>
fn sync_gt_bank( &self, store: &Pubkey, treasury_vault_config_hint: Option<&Pubkey>, gt_exchange_vault: &Pubkey, token_mint: &Pubkey, token_program_id: Option<&Pubkey>, ) -> impl Future<Output = Result<TransactionBuilder<'_, C>>>
Sync GT bank.
Sourcefn complete_gt_exchange(
&self,
store: &Pubkey,
exchange: &Pubkey,
treasury_vault_config_hint: Option<&Pubkey>,
tokens_hint: Option<Vec<(Pubkey, Pubkey)>>,
gt_exchange_vault_hint: Option<&Pubkey>,
) -> impl Future<Output = Result<TransactionBuilder<'_, C>>>
fn complete_gt_exchange( &self, store: &Pubkey, exchange: &Pubkey, treasury_vault_config_hint: Option<&Pubkey>, tokens_hint: Option<Vec<(Pubkey, Pubkey)>>, gt_exchange_vault_hint: Option<&Pubkey>, ) -> impl Future<Output = Result<TransactionBuilder<'_, C>>>
Complete GT exchange.
Sourcefn create_treasury_swap(
&self,
store: &Pubkey,
market_token: &Pubkey,
swap_in_token: &Pubkey,
swap_out_token: &Pubkey,
swap_in_token_amount: u64,
options: CreateTreasurySwapOptions,
) -> impl Future<Output = Result<TransactionBuilder<'_, C, Pubkey>>>
fn create_treasury_swap( &self, store: &Pubkey, market_token: &Pubkey, swap_in_token: &Pubkey, swap_out_token: &Pubkey, swap_in_token_amount: u64, options: CreateTreasurySwapOptions, ) -> impl Future<Output = Result<TransactionBuilder<'_, C, Pubkey>>>
Create a swap.
Sourcefn cancel_treasury_swap(
&self,
store: &Pubkey,
order: &Pubkey,
hint: Option<(&Pubkey, &Pubkey)>,
) -> impl Future<Output = Result<TransactionBuilder<'_, C>>>
fn cancel_treasury_swap( &self, store: &Pubkey, order: &Pubkey, hint: Option<(&Pubkey, &Pubkey)>, ) -> impl Future<Output = Result<TransactionBuilder<'_, C>>>
Cancel a swap.
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.