Trait PythPullOracleOps

Source
pub trait PythPullOracleOps<C> {
    // Required methods
    fn pyth(&self) -> &Program<C>;
    fn wormhole(&self) -> &Program<C>;

    // Provided methods
    fn with_pyth_prices<'a, S, It, Fut>(
        &'a self,
        ctx: &'a PythPullOracleContext,
        update: &'a PriceUpdate,
        consume: impl FnOnce(Prices) -> Fut,
    ) -> impl Future<Output = Result<WithPythPrices<'a, C>>>
       where C: Deref<Target = S> + Clone + 'a,
             S: Signer,
             It: IntoIterator<Item = TransactionBuilder<'a, C>>,
             Fut: Future<Output = Result<It>> { ... }
    fn with_pyth_price_updates<'a, S, It, Fut>(
        &'a self,
        ctx: &'a PythPullOracleContext,
        updates: impl IntoIterator<Item = &'a BinaryPriceUpdate>,
        consume: impl FnOnce(Prices) -> Fut,
    ) -> impl Future<Output = Result<WithPythPrices<'a, C>>>
       where C: Deref<Target = S> + Clone + 'a,
             S: Signer,
             It: IntoIterator<Item = TransactionBuilder<'a, C>>,
             Fut: Future<Output = Result<It>> { ... }
    fn execute_with_pyth_price_updates<'a, 'exec, T, S>(
        &'exec self,
        updates: impl IntoIterator<Item = &'a BinaryPriceUpdate>,
        execute: &mut T,
        compute_unit_price_micro_lamports: Option<u64>,
        skip_preflight: bool,
        enable_tracing: bool,
    ) -> impl Future<Output = Result<()>>
       where C: Deref<Target = S> + Clone + 'exec,
             S: Signer,
             T: ExecuteWithPythPrices<'exec, C> { ... }
}
Expand description

Pyth Pull Oracle Ops.

Required Methods§

Source

fn pyth(&self) -> &Program<C>

Get Pyth Program.

Source

fn wormhole(&self) -> &Program<C>

Get Wormhole Program.

Provided Methods§

Source

fn with_pyth_prices<'a, S, It, Fut>( &'a self, ctx: &'a PythPullOracleContext, update: &'a PriceUpdate, consume: impl FnOnce(Prices) -> Fut, ) -> impl Future<Output = Result<WithPythPrices<'a, C>>>
where C: Deref<Target = S> + Clone + 'a, S: Signer, It: IntoIterator<Item = TransactionBuilder<'a, C>>, Fut: Future<Output = Result<It>>,

Create transactions to post price updates and consume the prices.

Source

fn with_pyth_price_updates<'a, S, It, Fut>( &'a self, ctx: &'a PythPullOracleContext, updates: impl IntoIterator<Item = &'a BinaryPriceUpdate>, consume: impl FnOnce(Prices) -> Fut, ) -> impl Future<Output = Result<WithPythPrices<'a, C>>>
where C: Deref<Target = S> + Clone + 'a, S: Signer, It: IntoIterator<Item = TransactionBuilder<'a, C>>, Fut: Future<Output = Result<It>>,

Create transactions to post price updates and consume the prices.

Source

fn execute_with_pyth_price_updates<'a, 'exec, T, S>( &'exec self, updates: impl IntoIterator<Item = &'a BinaryPriceUpdate>, execute: &mut T, compute_unit_price_micro_lamports: Option<u64>, skip_preflight: bool, enable_tracing: bool, ) -> impl Future<Output = Result<()>>
where C: Deref<Target = S> + Clone + 'exec, S: Signer, T: ExecuteWithPythPrices<'exec, C>,

Execute with pyth price updates.

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<S, C> PythPullOracleOps<C> for PythPullOracle<C>
where C: Deref<Target = S> + Clone, S: Signer,