Trait ExecuteWithPythPrices

Source
pub trait ExecuteWithPythPrices<'a, C> {
    // Required methods
    fn set_execution_fee(&mut self, lamports: u64);
    fn context(&mut self) -> impl Future<Output = Result<PythPullOracleContext>>;
    fn build_rpc_with_price_updates(
        &mut self,
        price_updates: Prices,
    ) -> impl Future<Output = Result<Vec<TransactionBuilder<'a, C, ()>>>>;

    // Provided methods
    fn should_estiamte_execution_fee(&self) -> bool { ... }
    fn execute_with_options<S>(
        &mut self,
        txns: WithPythPrices<'_, C>,
        compute_unit_price_micro_lamports: Option<u64>,
        skip_preflight: bool,
        enable_tracing: bool,
    ) -> impl Future<Output = Result<()>>
       where C: Deref<Target = S> + Clone,
             S: Signer { ... }
    fn execute<S>(
        &mut self,
        txns: WithPythPrices<'_, C>,
        skip_preflight: bool,
    ) -> impl Future<Output = Result<()>>
       where C: Deref<Target = S> + Clone,
             S: Signer { ... }
}
Expand description

Execute with pyth prices.

Required Methods§

Source

fn set_execution_fee(&mut self, lamports: u64)

Set execution fee.

Source

fn context(&mut self) -> impl Future<Output = Result<PythPullOracleContext>>

Get the oracle context.

Source

fn build_rpc_with_price_updates( &mut self, price_updates: Prices, ) -> impl Future<Output = Result<Vec<TransactionBuilder<'a, C, ()>>>>

Build RPC requests with price updates.

Provided Methods§

Source

fn should_estiamte_execution_fee(&self) -> bool

Whether to estimate the execution fee.

Source

fn execute_with_options<S>( &mut self, txns: WithPythPrices<'_, C>, compute_unit_price_micro_lamports: Option<u64>, skip_preflight: bool, enable_tracing: bool, ) -> impl Future<Output = Result<()>>
where C: Deref<Target = S> + Clone, S: Signer,

Execute with options

Source

fn execute<S>( &mut self, txns: WithPythPrices<'_, C>, skip_preflight: bool, ) -> impl Future<Output = Result<()>>
where C: Deref<Target = S> + Clone, S: Signer,

Execute.

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<'a, C: Deref<Target = impl Signer> + Clone> ExecuteWithPythPrices<'a, C> for ExecuteGlvDepositBuilder<'a, C>

Source§

impl<'a, C: Deref<Target = impl Signer> + Clone> ExecuteWithPythPrices<'a, C> for ExecuteGlvShiftBuilder<'a, C>

Source§

impl<'a, C: Deref<Target = impl Signer> + Clone> ExecuteWithPythPrices<'a, C> for ExecuteGlvWithdrawalBuilder<'a, C>