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§
Sourcefn set_prices_from_price_feed_ctx(
&self,
feeds: Vec<AccountInfo<'info>>,
) -> CpiContext<'_, '_, '_, 'info, SetPricesFromPriceFeed<'info>>
fn set_prices_from_price_feed_ctx( &self, feeds: Vec<AccountInfo<'info>>, ) -> CpiContext<'_, '_, '_, 'info, SetPricesFromPriceFeed<'info>>
Get the CPI context for set prices.
Sourcefn clear_all_prices_ctx(
&self,
) -> CpiContext<'_, '_, '_, 'info, ClearAllPrices<'info>>
fn clear_all_prices_ctx( &self, ) -> CpiContext<'_, '_, '_, 'info, ClearAllPrices<'info>>
Get the CPI context for clear all prices.
Sourcefn 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>
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".