Trait WithOracleExt

Source
pub trait WithOracleExt<'info>: WithOracle<'info> {
    // Provided methods
    fn set_prices_from_price_feed_ctx(
        &self,
        feeds: Vec<AccountInfo<'info>>,
    ) -> CpiContext<'_, '_, '_, 'info, SetPricesFromPriceFeed<'info>> { ... }
    fn clear_all_prices_ctx(
        &self,
    ) -> CpiContext<'_, '_, '_, 'info, ClearAllPrices<'info>> { ... }
    fn with_oracle_prices<T>(
        &mut self,
        tokens: Vec<Pubkey>,
        remaining_accounts: &'info [AccountInfo<'info>],
        signer_seeds: &[&[u8]],
        f: impl FnOnce(&mut Self, &'info [AccountInfo<'info>]) -> Result<T>,
    ) -> Result<T> { ... }
}
Expand description

Extension trait for WithOracle.

Provided Methods§

Source

fn set_prices_from_price_feed_ctx( &self, feeds: Vec<AccountInfo<'info>>, ) -> CpiContext<'_, '_, '_, 'info, SetPricesFromPriceFeed<'info>>

Get the CPI context for set prices.

Source

fn clear_all_prices_ctx( &self, ) -> CpiContext<'_, '_, '_, 'info, ClearAllPrices<'info>>

Get the CPI context for clear all prices.

Source

fn with_oracle_prices<T>( &mut self, tokens: Vec<Pubkey>, remaining_accounts: &'info [AccountInfo<'info>], signer_seeds: &[&[u8]], f: impl FnOnce(&mut Self, &'info [AccountInfo<'info>]) -> Result<T>, ) -> Result<T>

Run the given function inside the scope with oracle prices.

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<'info, T> WithOracleExt<'info> for T
where T: WithOracle<'info>,