pub trait Middleware: Sync + Send + Debug {
    type Error: MiddlewareError<Inner = <Self::Inner as Middleware>::Error>;
    type Provider: JsonRpcClient;
    type Inner: Middleware<Provider = Self::Provider>;

Show 79 methods // Required method fn inner(&self) -> &Self::Inner; // Provided methods fn convert_err(p: ProviderError) -> Self::Error { ... } fn provider(&self) -> &Provider<Self::Provider> { ... } fn default_sender(&self) -> Option<H160> { ... } fn client_version<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<String, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn fill_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 mut TypedTransaction, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait { ... } fn get_block_number<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<U64, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn get_header<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T ) -> Pin<Box<dyn Future<Output = Result<Option<Block<Transaction>>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Self: 'async_trait { ... } fn send_transaction<'life0, 'async_trait, T>( &'life0 self, tx: T, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<PendingTransaction<'life0, Self::Provider>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, Self: 'async_trait { ... } fn send_escalating<'a, 'life0, 'async_trait>( &'a self, tx: &'life0 TypedTransaction, escalations: usize, policy: Box<dyn Fn(U256, usize) -> U256 + Sync + Send> ) -> Pin<Box<dyn Future<Output = Result<EscalatingPending<'a, Self::Provider>, Self::Error>> + Send + 'async_trait>> where 'a: 'async_trait, 'life0: 'async_trait, Self: 'async_trait { ... } fn resolve_name<'life0, 'life1, 'async_trait>( &'life0 self, ens_name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<H160, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait { ... } fn lookup_address<'life0, 'async_trait>( &'life0 self, address: H160 ) -> Pin<Box<dyn Future<Output = Result<String, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn resolve_avatar<'life0, 'life1, 'async_trait>( &'life0 self, ens_name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<Url, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait { ... } fn resolve_nft<'life0, 'async_trait>( &'life0 self, token: ERCNFT ) -> Pin<Box<dyn Future<Output = Result<Url, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn resolve_field<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ens_name: &'life1 str, field: &'life2 str ) -> Pin<Box<dyn Future<Output = Result<String, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait { ... } fn get_block<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T ) -> Pin<Box<dyn Future<Output = Result<Option<Block<H256>>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Self: 'async_trait { ... } fn get_block_with_txs<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T ) -> Pin<Box<dyn Future<Output = Result<Option<Block<Transaction>>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Self: 'async_trait { ... } fn get_uncle_count<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T ) -> Pin<Box<dyn Future<Output = Result<U256, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Self: 'async_trait { ... } fn get_uncle<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T, idx: U64 ) -> Pin<Box<dyn Future<Output = Result<Option<Block<H256>>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Self: 'async_trait { ... } fn get_transaction_count<'life0, 'async_trait, T>( &'life0 self, from: T, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<U256, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Self: 'async_trait { ... } fn estimate_gas<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<U256, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait { ... } fn call<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<Bytes, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait { ... } fn syncing<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<SyncingStatus, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn get_chainid<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<U256, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn get_net_version<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<String, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn get_balance<'life0, 'async_trait, T>( &'life0 self, from: T, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<U256, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Self: 'async_trait { ... } fn get_transaction<'life0, 'async_trait, T>( &'life0 self, transaction_hash: T ) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, T: 'async_trait + Send + Sync + Into<H256>, Self: 'async_trait { ... } fn get_transaction_by_block_and_index<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T, idx: U64 ) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Self: 'async_trait { ... } fn get_transaction_receipt<'life0, 'async_trait, T>( &'life0 self, transaction_hash: T ) -> Pin<Box<dyn Future<Output = Result<Option<TransactionReceipt>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, T: 'async_trait + Send + Sync + Into<H256>, Self: 'async_trait { ... } fn get_block_receipts<'life0, 'async_trait, T>( &'life0 self, block: T ) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionReceipt>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, T: 'async_trait + Into<BlockNumber> + Send + Sync, Self: 'async_trait { ... } fn get_gas_price<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<U256, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn estimate_eip1559_fees<'life0, 'async_trait>( &'life0 self, estimator: Option<fn(_: U256, _: Vec<Vec<U256>>) -> (U256, U256)> ) -> Pin<Box<dyn Future<Output = Result<(U256, U256), Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn get_accounts<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<H160>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn send_raw_transaction<'a, 'async_trait>( &'a self, tx: Bytes ) -> Pin<Box<dyn Future<Output = Result<PendingTransaction<'a, Self::Provider>, Self::Error>> + Send + 'async_trait>> where 'a: 'async_trait, Self: 'async_trait { ... } fn is_signer<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn sign<'life0, 'life1, 'async_trait, T>( &'life0 self, data: T, from: &'life1 H160 ) -> Pin<Box<dyn Future<Output = Result<Signature, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait + Into<Bytes> + Send + Sync, Self: 'async_trait { ... } fn sign_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, from: H160 ) -> Pin<Box<dyn Future<Output = Result<Signature, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait { ... } fn get_logs<'life0, 'life1, 'async_trait>( &'life0 self, filter: &'life1 Filter ) -> Pin<Box<dyn Future<Output = Result<Vec<Log>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait { ... } fn get_logs_paginated<'a>( &'a self, filter: &Filter, page_size: u64 ) -> LogQuery<'a, Self::Provider> { ... } fn watch<'a, 'life0, 'async_trait>( &'a self, filter: &'life0 Filter ) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'a, Self::Provider, Log>, Self::Error>> + Send + 'async_trait>> where 'a: 'async_trait, 'life0: 'async_trait, Self: 'async_trait { ... } fn watch_pending_transactions<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'life0, Self::Provider, H256>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn watch_blocks<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'life0, Self::Provider, H256>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn get_code<'life0, 'async_trait, T>( &'life0 self, at: T, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<Bytes, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Self: 'async_trait { ... } fn get_storage_at<'life0, 'async_trait, T>( &'life0 self, from: T, location: H256, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<H256, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Self: 'async_trait { ... } fn get_proof<'life0, 'async_trait, T>( &'life0 self, from: T, locations: Vec<H256>, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<EIP1186ProofResponse, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Self: 'async_trait { ... } fn mining<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn import_raw_key<'life0, 'async_trait>( &'life0 self, private_key: Bytes, passphrase: String ) -> Pin<Box<dyn Future<Output = Result<H160, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn unlock_account<'life0, 'async_trait, T>( &'life0 self, account: T, passphrase: String, duration: Option<u64> ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, T: 'async_trait + Into<H160> + Send + Sync, Self: 'async_trait { ... } fn add_peer<'life0, 'async_trait>( &'life0 self, enode_url: String ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn add_trusted_peer<'life0, 'async_trait>( &'life0 self, enode_url: String ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn node_info<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<NodeInfo, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn peers<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<PeerInfo>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn remove_peer<'life0, 'async_trait>( &'life0 self, enode_url: String ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn remove_trusted_peer<'life0, 'async_trait>( &'life0 self, enode_url: String ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn start_mining<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn stop_mining<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn txpool_content<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<TxpoolContent, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn txpool_inspect<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<TxpoolInspect, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn txpool_status<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<TxpoolStatus, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn debug_trace_transaction<'life0, 'async_trait>( &'life0 self, tx_hash: H256, trace_options: GethDebugTracingOptions ) -> Pin<Box<dyn Future<Output = Result<GethTrace, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn debug_trace_call<'life0, 'async_trait, T>( &'life0 self, req: T, block: Option<BlockId>, trace_options: GethDebugTracingCallOptions ) -> Pin<Box<dyn Future<Output = Result<GethTrace, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, Self: 'async_trait { ... } fn debug_trace_block_by_number<'life0, 'async_trait>( &'life0 self, block: Option<BlockNumber>, trace_options: GethDebugTracingOptions ) -> Pin<Box<dyn Future<Output = Result<Vec<GethTrace>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn debug_trace_block_by_hash<'life0, 'async_trait>( &'life0 self, block: H256, trace_options: GethDebugTracingOptions ) -> Pin<Box<dyn Future<Output = Result<Vec<GethTrace>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn trace_call<'life0, 'async_trait, T>( &'life0 self, req: T, trace_type: Vec<TraceType>, block: Option<BlockNumber> ) -> Pin<Box<dyn Future<Output = Result<BlockTrace, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, Self: 'async_trait { ... } fn trace_call_many<'life0, 'async_trait, T>( &'life0 self, req: Vec<(T, Vec<TraceType>)>, block: Option<BlockNumber> ) -> Pin<Box<dyn Future<Output = Result<Vec<BlockTrace>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, Self: 'async_trait { ... } fn trace_raw_transaction<'life0, 'async_trait>( &'life0 self, data: Bytes, trace_type: Vec<TraceType> ) -> Pin<Box<dyn Future<Output = Result<BlockTrace, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn trace_replay_transaction<'life0, 'async_trait>( &'life0 self, hash: H256, trace_type: Vec<TraceType> ) -> Pin<Box<dyn Future<Output = Result<BlockTrace, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn trace_replay_block_transactions<'life0, 'async_trait>( &'life0 self, block: BlockNumber, trace_type: Vec<TraceType> ) -> Pin<Box<dyn Future<Output = Result<Vec<BlockTrace>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn trace_block<'life0, 'async_trait>( &'life0 self, block: BlockNumber ) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn trace_filter<'life0, 'async_trait>( &'life0 self, filter: TraceFilter ) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn trace_get<'life0, 'async_trait, T>( &'life0 self, hash: H256, index: Vec<T> ) -> Pin<Box<dyn Future<Output = Result<Trace, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, T: 'async_trait + Into<U64> + Send + Sync, Self: 'async_trait { ... } fn trace_transaction<'life0, 'async_trait>( &'life0 self, hash: H256 ) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn parity_block_receipts<'life0, 'async_trait, T>( &'life0 self, block: T ) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionReceipt>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, T: 'async_trait + Into<BlockNumber> + Send + Sync, Self: 'async_trait { ... } fn subscribe_blocks<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'life0, Self::Provider, Block<H256>>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self::Provider: PubsubClient, Self: 'async_trait { ... } fn subscribe_pending_txs<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'life0, Self::Provider, H256>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self::Provider: PubsubClient, Self: 'async_trait { ... } fn subscribe_full_pending_txs<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'life0, Self::Provider, Transaction>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self::Provider: PubsubClient, Self: 'async_trait { ... } fn subscribe_logs<'a, 'life0, 'async_trait>( &'a self, filter: &'life0 Filter ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'a, Self::Provider, Log>, Self::Error>> + Send + 'async_trait>> where 'a: 'async_trait, 'life0: 'async_trait, Self::Provider: PubsubClient, Self: 'async_trait { ... } fn fee_history<'life0, 'life1, 'async_trait, T>( &'life0 self, block_count: T, last_block: BlockNumber, reward_percentiles: &'life1 [f64] ) -> Pin<Box<dyn Future<Output = Result<FeeHistory, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait + Into<U256> + Serialize + Send + Sync, Self: 'async_trait { ... } fn create_access_list<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<AccessListWithGasUsed, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait { ... }
}
Expand description

A middleware allows customizing requests send and received from an ethereum node.

Writing a middleware is as simple as:

  1. implementing the inner method to point to the next layer in the “middleware onion”, 2. implementing the MiddlewareError trait on your middleware’s error type 3. implementing any of the methods you want to override
use ethers_providers::{Middleware, MiddlewareError};
use ethers_core::types::{U64, TransactionRequest, U256, transaction::eip2718::TypedTransaction, BlockId};
use thiserror::Error;
use async_trait::async_trait;

#[derive(Debug)]
struct MyMiddleware<M>(M);

#[derive(Error, Debug)]
pub enum MyError<M: Middleware> {
    #[error("{0}")]
    MiddlewareError(M::Error),

    // Add your middleware's specific errors here
}

impl<M: Middleware> MiddlewareError for MyError<M> {
    type Inner = M::Error;

    fn from_err(src: M::Error) -> MyError<M> {
        MyError::MiddlewareError(src)
    }

    fn as_inner(&self) -> Option<&Self::Inner> {
        match self {
            MyError::MiddlewareError(e) => Some(e),
            _ => None,
        }
    }
}

#[async_trait]
impl<M> Middleware for MyMiddleware<M>
where
    M: Middleware,
{
    type Error = MyError<M>;
    type Provider = M::Provider;
    type Inner = M;

    fn inner(&self) -> &M {
        &self.0
    }

    /// Overrides the default `get_block_number` method to always return 0
    async fn get_block_number(&self) -> Result<U64, Self::Error> {
        Ok(U64::zero())
    }

    /// Overrides the default `estimate_gas` method to log that it was called,
    /// before forwarding the call to the next layer.
    async fn estimate_gas(&self, tx: &TypedTransaction, block: Option<BlockId>) -> Result<U256, Self::Error> {
        println!("Estimating gas...");
        self.inner().estimate_gas(tx, block).await.map_err(MiddlewareError::from_err)
    }
}

Required Associated Types§

source

type Error: MiddlewareError<Inner = <Self::Inner as Middleware>::Error>

Error type returned by most operations

source

type Provider: JsonRpcClient

The JSON-RPC client type at the bottom of the stack

source

type Inner: Middleware<Provider = Self::Provider>

The next-lower middleware in the middleware stack

Required Methods§

source

fn inner(&self) -> &Self::Inner

Get a reference to the next-lower middleware in the middleware stack

Provided Methods§

source

fn convert_err(p: ProviderError) -> Self::Error

Convert a provider error into the associated error type by successively converting it to every intermediate middleware error

source

fn provider(&self) -> &Provider<Self::Provider>

The HTTP or Websocket provider.

source

fn default_sender(&self) -> Option<H160>

Return the default sender (if any). This will typically be the connected node’s first address, or the address of a Signer in a lower middleware stack

source

fn client_version<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<String, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns the current client version using the web3_clientVersion RPC.

source

fn fill_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 mut TypedTransaction, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Fill necessary details of a transaction for dispatch

This function is defined on providers to behave as follows:

  1. populate the from field with the default sender
  2. resolve any ENS names in the tx to field
  3. Estimate gas usage
  4. Poll and set legacy or 1559 gas prices
  5. Set the chain_id with the provider’s, if not already set

It does NOT set the nonce by default.

Middleware are encouraged to override any values before delegating to the inner implementation AND/OR modify the values provided by the default implementation after delegating.

E.g. a middleware wanting to double gas prices should consider doing so after delegating and allowing the default implementation to poll gas.

source

fn get_block_number<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<U64, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Get the block number

source

fn get_header<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T ) -> Pin<Box<dyn Future<Output = Result<Option<Block<Transaction>>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Self: 'async_trait,

Get the block header by number or hash

source

fn send_transaction<'life0, 'async_trait, T>( &'life0 self, tx: T, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<PendingTransaction<'life0, Self::Provider>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, Self: 'async_trait,

Sends the transaction to the entire Ethereum network and returns the transaction’s hash. This will consume gas from the account that signed the transaction. This call will fail if no signer is available, and the RPC node does not have an unlocked accounts

source

fn send_escalating<'a, 'life0, 'async_trait>( &'a self, tx: &'life0 TypedTransaction, escalations: usize, policy: Box<dyn Fn(U256, usize) -> U256 + Sync + Send> ) -> Pin<Box<dyn Future<Output = Result<EscalatingPending<'a, Self::Provider>, Self::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, Self: 'async_trait,

Send a transaction with a simple escalation policy.

policy should be a boxed function that maps original_gas_price and number_of_previous_escalations -> new_gas_price.

e.g. Box::new(|start, escalation_index| start * 1250.pow(escalations) / 1000.pow(escalations))

source

fn resolve_name<'life0, 'life1, 'async_trait>( &'life0 self, ens_name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<H160, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Returns the address that the ens_name resolves to (or None if not configured).

§Panics

If the bytes returned from the ENS registrar/resolver cannot be interpreted as an address. This should theoretically never happen.

source

fn lookup_address<'life0, 'async_trait>( &'life0 self, address: H160 ) -> Pin<Box<dyn Future<Output = Result<String, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns the ENS name the address resolves to (or None if not configured).

§Panics

If the bytes returned from the ENS registrar/resolver cannot be interpreted as a string. This should theoretically never happen.

source

fn resolve_avatar<'life0, 'life1, 'async_trait>( &'life0 self, ens_name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<Url, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Returns the avatar HTTP link of the avatar that the ens_name resolves to (or None if not configured)

§Examples
let avatar = provider.resolve_avatar("parishilton.eth").await?;
assert_eq!(avatar.to_string(), "https://i.imgur.com/YW3Hzph.jpg");
§Panics

If the bytes returned from the ENS registrar/resolver cannot be interpreted as a string. This should theoretically never happen.

source

fn resolve_nft<'life0, 'async_trait>( &'life0 self, token: ERCNFT ) -> Pin<Box<dyn Future<Output = Result<Url, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns the URL (not necesserily HTTP) of the image behind a token.

§Example
use ethers_providers::erc::ERCNFT;
let token = "erc721:0xc92ceddfb8dd984a89fb494c376f9a48b999aafc/9018".parse()?;
let token_image = provider.resolve_nft(token).await?;
assert_eq!(
    token_image.to_string(),
    "https://creature.mypinata.cloud/ipfs/QmNwj3aUzXfG4twV3no7hJRYxLLAWNPk6RrfQaqJ6nVJFa/9018.jpg"
);
§Panics

If the bytes returned from the ENS registrar/resolver cannot be interpreted as a string. This should theoretically never happen.

source

fn resolve_field<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ens_name: &'life1 str, field: &'life2 str ) -> Pin<Box<dyn Future<Output = Result<String, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Fetch a field for the ens_name (no None if not configured).

§Panics

If the bytes returned from the ENS registrar/resolver cannot be interpreted as a string. This should theoretically never happen.

source

fn get_block<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T ) -> Pin<Box<dyn Future<Output = Result<Option<Block<H256>>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Self: 'async_trait,

Gets the block at block_hash_or_number (transaction hashes only)

source

fn get_block_with_txs<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T ) -> Pin<Box<dyn Future<Output = Result<Option<Block<Transaction>>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Self: 'async_trait,

Gets the block at block_hash_or_number (full transactions included)

source

fn get_uncle_count<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T ) -> Pin<Box<dyn Future<Output = Result<U256, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Self: 'async_trait,

Gets the block uncle count at block_hash_or_number

source

fn get_uncle<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T, idx: U64 ) -> Pin<Box<dyn Future<Output = Result<Option<Block<H256>>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Self: 'async_trait,

Gets the block uncle at block_hash_or_number and idx

source

fn get_transaction_count<'life0, 'async_trait, T>( &'life0 self, from: T, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<U256, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Self: 'async_trait,

Returns the nonce of the address

source

fn estimate_gas<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<U256, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Sends a transaction to a single Ethereum node and return the estimated amount of gas required (as a U256) to send it This is free, but only an estimate. Providing too little gas will result in a transaction being rejected (while still consuming all provided gas).

source

fn call<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<Bytes, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Sends the read-only (constant) transaction to a single Ethereum node and return the result (as bytes) of executing it. This is free, since it does not change any state on the blockchain.

source

fn syncing<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<SyncingStatus, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Return current client syncing status. If IsFalse sync is over.

source

fn get_chainid<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<U256, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns the currently configured chain id, a value used in replay-protected transaction signing as introduced by EIP-155.

source

fn get_net_version<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<String, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns the network version.

source

fn get_balance<'life0, 'async_trait, T>( &'life0 self, from: T, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<U256, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Self: 'async_trait,

Returns the account’s balance

source

fn get_transaction<'life0, 'async_trait, T>( &'life0 self, transaction_hash: T ) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Send + Sync + Into<H256>, Self: 'async_trait,

Gets the transaction with transaction_hash

source

fn get_transaction_by_block_and_index<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T, idx: U64 ) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Self: 'async_trait,

Gets the transaction with block and index

source

fn get_transaction_receipt<'life0, 'async_trait, T>( &'life0 self, transaction_hash: T ) -> Pin<Box<dyn Future<Output = Result<Option<TransactionReceipt>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Send + Sync + Into<H256>, Self: 'async_trait,

Gets the transaction receipt with transaction_hash

source

fn get_block_receipts<'life0, 'async_trait, T>( &'life0 self, block: T ) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionReceipt>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockNumber> + Send + Sync, Self: 'async_trait,

Returns all receipts for a block.

Note that this uses the eth_getBlockReceipts RPC, which is non-standard and currently supported by Erigon.

source

fn get_gas_price<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<U256, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Gets the current gas price as estimated by the node

source

fn estimate_eip1559_fees<'life0, 'async_trait>( &'life0 self, estimator: Option<fn(_: U256, _: Vec<Vec<U256>>) -> (U256, U256)> ) -> Pin<Box<dyn Future<Output = Result<(U256, U256), Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Gets a heuristic recommendation of max fee per gas and max priority fee per gas for EIP-1559 compatible transactions.

source

fn get_accounts<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<H160>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Gets the accounts on the node

source

fn send_raw_transaction<'a, 'async_trait>( &'a self, tx: Bytes ) -> Pin<Box<dyn Future<Output = Result<PendingTransaction<'a, Self::Provider>, Self::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, Self: 'async_trait,

Send the raw RLP encoded transaction to the entire Ethereum network and returns the transaction’s hash This will consume gas from the account that signed the transaction.

source

fn is_signer<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

This returns true if either the middleware stack contains a SignerMiddleware, or the JSON-RPC provider has an unlocked key that can sign using the eth_sign call. If none of the above conditions are met, then the middleware stack is not capable of signing data.

source

fn sign<'life0, 'life1, 'async_trait, T>( &'life0 self, data: T, from: &'life1 H160 ) -> Pin<Box<dyn Future<Output = Result<Signature, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait + Into<Bytes> + Send + Sync, Self: 'async_trait,

Signs data using a specific account. This account needs to be unlocked, or the middleware stack must contain a SignerMiddleware

source

fn sign_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, from: H160 ) -> Pin<Box<dyn Future<Output = Result<Signature, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Sign a transaction via RPC call

source

fn get_logs<'life0, 'life1, 'async_trait>( &'life0 self, filter: &'life1 Filter ) -> Pin<Box<dyn Future<Output = Result<Vec<Log>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Returns an array (possibly empty) of logs that match the filter

source

fn get_logs_paginated<'a>( &'a self, filter: &Filter, page_size: u64 ) -> LogQuery<'a, Self::Provider>

Returns a stream of logs are loaded in pages of given page size

source

fn watch<'a, 'life0, 'async_trait>( &'a self, filter: &'life0 Filter ) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'a, Self::Provider, Log>, Self::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, Self: 'async_trait,

Streams event logs matching the filter.

This function streams via a polling system, by repeatedly dispatching RPC requests. If possible, prefer using a WS or IPC connection and the stream interface

source

fn watch_pending_transactions<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'life0, Self::Provider, H256>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Streams pending transactions.

This function streams via a polling system, by repeatedly dispatching RPC requests. If possible, prefer using a WS or IPC connection and the stream interface

source

fn watch_blocks<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'life0, Self::Provider, H256>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Streams new block hashes

This function streams via a polling system, by repeatedly dispatching RPC requests. If possible, prefer using a WS or IPC connection and the stream interface

source

fn get_code<'life0, 'async_trait, T>( &'life0 self, at: T, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<Bytes, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Self: 'async_trait,

Returns the deployed code at a given address

source

fn get_storage_at<'life0, 'async_trait, T>( &'life0 self, from: T, location: H256, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<H256, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Self: 'async_trait,

Get the storage of an address for a particular slot location

source

fn get_proof<'life0, 'async_trait, T>( &'life0 self, from: T, locations: Vec<H256>, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<EIP1186ProofResponse, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Self: 'async_trait,

Returns the EIP-1186 proof response https://github.com/ethereum/EIPs/issues/1186

source

fn mining<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns an indication if this node is currently mining.

source

fn import_raw_key<'life0, 'async_trait>( &'life0 self, private_key: Bytes, passphrase: String ) -> Pin<Box<dyn Future<Output = Result<H160, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Sends the given key to the node to be encrypted with the provided passphrase and stored.

The key represents a secp256k1 private key and should be 32 bytes.

source

fn unlock_account<'life0, 'async_trait, T>( &'life0 self, account: T, passphrase: String, duration: Option<u64> ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<H160> + Send + Sync, Self: 'async_trait,

Prompts the node to decrypt the given account from its keystore.

If the duration provided is None, then the account will be unlocked indefinitely. Otherwise, the account will be unlocked for the provided number of seconds.

source

fn add_peer<'life0, 'async_trait>( &'life0 self, enode_url: String ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Requests adding the given peer, returning a boolean representing whether or not the peer was accepted for tracking.

source

fn add_trusted_peer<'life0, 'async_trait>( &'life0 self, enode_url: String ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Requests adding the given peer as a trusted peer, which the node will always connect to even when its peer slots are full.

source

fn node_info<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<NodeInfo, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns general information about the node as well as information about the running p2p protocols (e.g. eth, snap).

source

fn peers<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<PeerInfo>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns the list of peers currently connected to the node.

source

fn remove_peer<'life0, 'async_trait>( &'life0 self, enode_url: String ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Requests to remove the given peer, returning true if the enode was successfully parsed and the peer was removed.

source

fn remove_trusted_peer<'life0, 'async_trait>( &'life0 self, enode_url: String ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Requests to remove the given peer, returning a boolean representing whether or not the enode url passed was validated. A return value of true does not necessarily mean that the peer was disconnected.

source

fn start_mining<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Starts the miner.

source

fn stop_mining<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Stop terminates the miner, both at the consensus engine level as well as at the block creation level.

source

fn txpool_content<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<TxpoolContent, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns the details of all transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only. Ref: Here

source

fn txpool_inspect<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<TxpoolInspect, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns a summary of all the transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only. Ref: Here

source

fn txpool_status<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<TxpoolStatus, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns the number of transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only. Ref: Here

source

fn debug_trace_transaction<'life0, 'async_trait>( &'life0 self, tx_hash: H256, trace_options: GethDebugTracingOptions ) -> Pin<Box<dyn Future<Output = Result<GethTrace, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

After replaying any previous transactions in the same block, Replays a transaction, returning the traces configured with passed options

source

fn debug_trace_call<'life0, 'async_trait, T>( &'life0 self, req: T, block: Option<BlockId>, trace_options: GethDebugTracingCallOptions ) -> Pin<Box<dyn Future<Output = Result<GethTrace, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, Self: 'async_trait,

Executes the given call and returns a number of possible traces for it

source

fn debug_trace_block_by_number<'life0, 'async_trait>( &'life0 self, block: Option<BlockNumber>, trace_options: GethDebugTracingOptions ) -> Pin<Box<dyn Future<Output = Result<Vec<GethTrace>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Replays all transactions in a given block (specified by block number) and returns the traces configured with passed options Ref: Here

source

fn debug_trace_block_by_hash<'life0, 'async_trait>( &'life0 self, block: H256, trace_options: GethDebugTracingOptions ) -> Pin<Box<dyn Future<Output = Result<Vec<GethTrace>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Replays all transactions in a given block (specified by block hash) and returns the traces configured with passed options Ref: Here

source

fn trace_call<'life0, 'async_trait, T>( &'life0 self, req: T, trace_type: Vec<TraceType>, block: Option<BlockNumber> ) -> Pin<Box<dyn Future<Output = Result<BlockTrace, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, Self: 'async_trait,

Executes the given call and returns a number of possible traces for it

source

fn trace_call_many<'life0, 'async_trait, T>( &'life0 self, req: Vec<(T, Vec<TraceType>)>, block: Option<BlockNumber> ) -> Pin<Box<dyn Future<Output = Result<Vec<BlockTrace>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, Self: 'async_trait,

Executes given calls and returns a number of possible traces for each call

source

fn trace_raw_transaction<'life0, 'async_trait>( &'life0 self, data: Bytes, trace_type: Vec<TraceType> ) -> Pin<Box<dyn Future<Output = Result<BlockTrace, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Traces a call to eth_sendRawTransaction without making the call, returning the traces

source

fn trace_replay_transaction<'life0, 'async_trait>( &'life0 self, hash: H256, trace_type: Vec<TraceType> ) -> Pin<Box<dyn Future<Output = Result<BlockTrace, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Replays a transaction, returning the traces

source

fn trace_replay_block_transactions<'life0, 'async_trait>( &'life0 self, block: BlockNumber, trace_type: Vec<TraceType> ) -> Pin<Box<dyn Future<Output = Result<Vec<BlockTrace>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Replays all transactions in a block returning the requested traces for each transaction

source

fn trace_block<'life0, 'async_trait>( &'life0 self, block: BlockNumber ) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns traces created at given block

source

fn trace_filter<'life0, 'async_trait>( &'life0 self, filter: TraceFilter ) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Return traces matching the given filter

source

fn trace_get<'life0, 'async_trait, T>( &'life0 self, hash: H256, index: Vec<T> ) -> Pin<Box<dyn Future<Output = Result<Trace, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<U64> + Send + Sync, Self: 'async_trait,

Returns trace at the given position

source

fn trace_transaction<'life0, 'async_trait>( &'life0 self, hash: H256 ) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns all traces of a given transaction

source

fn parity_block_receipts<'life0, 'async_trait, T>( &'life0 self, block: T ) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionReceipt>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockNumber> + Send + Sync, Self: 'async_trait,

Returns all receipts for that block. Must be done on a parity node.

source

fn subscribe_blocks<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'life0, Self::Provider, Block<H256>>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self::Provider: PubsubClient, Self: 'async_trait,

Subscribe to a stream of incoming blocks.

This function is only available on pubsub clients, such as Websockets or IPC. For a polling alternative available over HTTP, use Middleware::watch_blocks. However, be aware that polling increases RPC usage drastically.

source

fn subscribe_pending_txs<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'life0, Self::Provider, H256>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self::Provider: PubsubClient, Self: 'async_trait,

Subscribe to a stream of pending transaction hashes.

This function is only available on pubsub clients, such as Websockets or IPC. For a polling alternative available over HTTP, use Middleware::watch_pending_transactions. However, be aware that polling increases RPC usage drastically.

source

fn subscribe_full_pending_txs<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'life0, Self::Provider, Transaction>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self::Provider: PubsubClient, Self: 'async_trait,

Subscribe to a stream of pending transaction bodies.

This function is only available on pubsub clients, such as Websockets or IPC. For a polling alternative available over HTTP, use Middleware::watch_pending_transactions. However, be aware that polling increases RPC usage drastically.

Note: This endpoint is compatible only with Geth client version 1.11.0 or later.

source

fn subscribe_logs<'a, 'life0, 'async_trait>( &'a self, filter: &'life0 Filter ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'a, Self::Provider, Log>, Self::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, Self::Provider: PubsubClient, Self: 'async_trait,

Subscribe to a stream of event logs matchin the provided Filter.

This function is only available on pubsub clients, such as Websockets or IPC. For a polling alternative available over HTTP, use Middleware::watch. However, be aware that polling increases RPC usage drastically.

source

fn fee_history<'life0, 'life1, 'async_trait, T>( &'life0 self, block_count: T, last_block: BlockNumber, reward_percentiles: &'life1 [f64] ) -> Pin<Box<dyn Future<Output = Result<FeeHistory, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait + Into<U256> + Serialize + Send + Sync, Self: 'async_trait,

Query the node for a FeeHistory object. This objct contains information about the EIP-1559 base fee in past blocks, as well as gas utilization within those blocks.

See the EIP-1559 documentation for details

source

fn create_access_list<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<AccessListWithGasUsed, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Query the node for an EIP-2930 Access List.

See the EIP-2930 documentation for details

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'b, U> Middleware for &'b U
where U: 'b + Middleware + ?Sized, &'b U: Sync + Send + Debug,

§

type Error = <U as Middleware>::Error

§

type Provider = <U as Middleware>::Provider

§

type Inner = <U as Middleware>::Inner

source§

fn inner(&self) -> &<&'b U as Middleware>::Inner

source§

fn convert_err(p: ProviderError) -> <&'b U as Middleware>::Error

source§

fn provider(&self) -> &Provider<<&'b U as Middleware>::Provider>

source§

fn default_sender(&self) -> Option<H160>

source§

fn client_version<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<String, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn fill_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 mut TypedTransaction, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<(), <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, &'b U: 'async_trait,

source§

fn get_block_number<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<U64, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn get_header<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T ) -> Pin<Box<dyn Future<Output = Result<Option<Block<Transaction>>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, &'b U: 'async_trait,

source§

fn send_transaction<'life0, 'async_trait, T>( &'life0 self, tx: T, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<PendingTransaction<'life0, <&'b U as Middleware>::Provider>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, &'b U: 'async_trait,

source§

fn send_escalating<'a, 'life0, 'async_trait>( &'a self, tx: &'life0 TypedTransaction, escalations: usize, policy: Box<dyn Fn(U256, usize) -> U256 + Sync + Send> ) -> Pin<Box<dyn Future<Output = Result<EscalatingPending<'a, <&'b U as Middleware>::Provider>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn resolve_name<'life0, 'life1, 'async_trait>( &'life0 self, ens_name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<H160, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, &'b U: 'async_trait,

source§

fn lookup_address<'life0, 'async_trait>( &'life0 self, address: H160 ) -> Pin<Box<dyn Future<Output = Result<String, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn resolve_avatar<'life0, 'life1, 'async_trait>( &'life0 self, ens_name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<Url, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, &'b U: 'async_trait,

source§

fn resolve_nft<'life0, 'async_trait>( &'life0 self, token: ERCNFT ) -> Pin<Box<dyn Future<Output = Result<Url, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn resolve_field<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ens_name: &'life1 str, field: &'life2 str ) -> Pin<Box<dyn Future<Output = Result<String, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, &'b U: 'async_trait,

source§

fn get_block<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T ) -> Pin<Box<dyn Future<Output = Result<Option<Block<H256>>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, &'b U: 'async_trait,

source§

fn get_block_with_txs<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T ) -> Pin<Box<dyn Future<Output = Result<Option<Block<Transaction>>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, &'b U: 'async_trait,

source§

fn get_uncle_count<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T ) -> Pin<Box<dyn Future<Output = Result<U256, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, &'b U: 'async_trait,

source§

fn get_uncle<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T, idx: U64 ) -> Pin<Box<dyn Future<Output = Result<Option<Block<H256>>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, &'b U: 'async_trait,

source§

fn get_transaction_count<'life0, 'async_trait, T>( &'life0 self, from: T, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<U256, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, &'b U: 'async_trait,

source§

fn estimate_gas<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<U256, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, &'b U: 'async_trait,

source§

fn call<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<Bytes, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, &'b U: 'async_trait,

source§

fn syncing<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<SyncingStatus, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn get_chainid<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<U256, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn get_net_version<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<String, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn get_balance<'life0, 'async_trait, T>( &'life0 self, from: T, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<U256, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, &'b U: 'async_trait,

source§

fn get_transaction<'life0, 'async_trait, T>( &'life0 self, transaction_hash: T ) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Send + Sync + Into<H256>, &'b U: 'async_trait,

source§

fn get_transaction_by_block_and_index<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T, idx: U64 ) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, &'b U: 'async_trait,

source§

fn get_transaction_receipt<'life0, 'async_trait, T>( &'life0 self, transaction_hash: T ) -> Pin<Box<dyn Future<Output = Result<Option<TransactionReceipt>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Send + Sync + Into<H256>, &'b U: 'async_trait,

source§

fn get_block_receipts<'life0, 'async_trait, T>( &'life0 self, block: T ) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionReceipt>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockNumber> + Send + Sync, &'b U: 'async_trait,

source§

fn get_gas_price<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<U256, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn estimate_eip1559_fees<'life0, 'async_trait>( &'life0 self, estimator: Option<fn(_: U256, _: Vec<Vec<U256>>) -> (U256, U256)> ) -> Pin<Box<dyn Future<Output = Result<(U256, U256), <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn get_accounts<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<H160>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn send_raw_transaction<'a, 'async_trait>( &'a self, tx: Bytes ) -> Pin<Box<dyn Future<Output = Result<PendingTransaction<'a, <&'b U as Middleware>::Provider>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, &'b U: 'async_trait,

source§

fn is_signer<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn sign<'life0, 'life1, 'async_trait, T>( &'life0 self, data: T, from: &'life1 H160 ) -> Pin<Box<dyn Future<Output = Result<Signature, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait + Into<Bytes> + Send + Sync, &'b U: 'async_trait,

source§

fn sign_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, from: H160 ) -> Pin<Box<dyn Future<Output = Result<Signature, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, &'b U: 'async_trait,

source§

fn get_logs<'life0, 'life1, 'async_trait>( &'life0 self, filter: &'life1 Filter ) -> Pin<Box<dyn Future<Output = Result<Vec<Log>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, &'b U: 'async_trait,

source§

fn get_logs_paginated<'a>( &'a self, filter: &Filter, page_size: u64 ) -> LogQuery<'a, <&'b U as Middleware>::Provider>

source§

fn watch<'a, 'life0, 'async_trait>( &'a self, filter: &'life0 Filter ) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'a, <&'b U as Middleware>::Provider, Log>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn watch_pending_transactions<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'life0, <&'b U as Middleware>::Provider, H256>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn watch_blocks<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'life0, <&'b U as Middleware>::Provider, H256>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn get_code<'life0, 'async_trait, T>( &'life0 self, at: T, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<Bytes, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, &'b U: 'async_trait,

source§

fn get_storage_at<'life0, 'async_trait, T>( &'life0 self, from: T, location: H256, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<H256, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, &'b U: 'async_trait,

source§

fn get_proof<'life0, 'async_trait, T>( &'life0 self, from: T, locations: Vec<H256>, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<EIP1186ProofResponse, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, &'b U: 'async_trait,

source§

fn mining<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<bool, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn import_raw_key<'life0, 'async_trait>( &'life0 self, private_key: Bytes, passphrase: String ) -> Pin<Box<dyn Future<Output = Result<H160, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn unlock_account<'life0, 'async_trait, T>( &'life0 self, account: T, passphrase: String, duration: Option<u64> ) -> Pin<Box<dyn Future<Output = Result<bool, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<H160> + Send + Sync, &'b U: 'async_trait,

source§

fn add_peer<'life0, 'async_trait>( &'life0 self, enode_url: String ) -> Pin<Box<dyn Future<Output = Result<bool, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn add_trusted_peer<'life0, 'async_trait>( &'life0 self, enode_url: String ) -> Pin<Box<dyn Future<Output = Result<bool, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn node_info<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<NodeInfo, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn peers<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<PeerInfo>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn remove_peer<'life0, 'async_trait>( &'life0 self, enode_url: String ) -> Pin<Box<dyn Future<Output = Result<bool, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn remove_trusted_peer<'life0, 'async_trait>( &'life0 self, enode_url: String ) -> Pin<Box<dyn Future<Output = Result<bool, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn start_mining<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn stop_mining<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn txpool_content<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<TxpoolContent, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn txpool_inspect<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<TxpoolInspect, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn txpool_status<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<TxpoolStatus, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn debug_trace_transaction<'life0, 'async_trait>( &'life0 self, tx_hash: H256, trace_options: GethDebugTracingOptions ) -> Pin<Box<dyn Future<Output = Result<GethTrace, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn debug_trace_call<'life0, 'async_trait, T>( &'life0 self, req: T, block: Option<BlockId>, trace_options: GethDebugTracingCallOptions ) -> Pin<Box<dyn Future<Output = Result<GethTrace, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, &'b U: 'async_trait,

source§

fn debug_trace_block_by_number<'life0, 'async_trait>( &'life0 self, block: Option<BlockNumber>, trace_options: GethDebugTracingOptions ) -> Pin<Box<dyn Future<Output = Result<Vec<GethTrace>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn debug_trace_block_by_hash<'life0, 'async_trait>( &'life0 self, block: H256, trace_options: GethDebugTracingOptions ) -> Pin<Box<dyn Future<Output = Result<Vec<GethTrace>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn trace_call<'life0, 'async_trait, T>( &'life0 self, req: T, trace_type: Vec<TraceType>, block: Option<BlockNumber> ) -> Pin<Box<dyn Future<Output = Result<BlockTrace, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, &'b U: 'async_trait,

source§

fn trace_call_many<'life0, 'async_trait, T>( &'life0 self, req: Vec<(T, Vec<TraceType>)>, block: Option<BlockNumber> ) -> Pin<Box<dyn Future<Output = Result<Vec<BlockTrace>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, &'b U: 'async_trait,

source§

fn trace_raw_transaction<'life0, 'async_trait>( &'life0 self, data: Bytes, trace_type: Vec<TraceType> ) -> Pin<Box<dyn Future<Output = Result<BlockTrace, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn trace_replay_transaction<'life0, 'async_trait>( &'life0 self, hash: H256, trace_type: Vec<TraceType> ) -> Pin<Box<dyn Future<Output = Result<BlockTrace, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn trace_replay_block_transactions<'life0, 'async_trait>( &'life0 self, block: BlockNumber, trace_type: Vec<TraceType> ) -> Pin<Box<dyn Future<Output = Result<Vec<BlockTrace>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn trace_block<'life0, 'async_trait>( &'life0 self, block: BlockNumber ) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn trace_filter<'life0, 'async_trait>( &'life0 self, filter: TraceFilter ) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn trace_get<'life0, 'async_trait, T>( &'life0 self, hash: H256, index: Vec<T> ) -> Pin<Box<dyn Future<Output = Result<Trace, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<U64> + Send + Sync, &'b U: 'async_trait,

source§

fn trace_transaction<'life0, 'async_trait>( &'life0 self, hash: H256 ) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, &'b U: 'async_trait,

source§

fn parity_block_receipts<'life0, 'async_trait, T>( &'life0 self, block: T ) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionReceipt>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockNumber> + Send + Sync, &'b U: 'async_trait,

source§

fn subscribe_blocks<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'life0, <&'b U as Middleware>::Provider, Block<H256>>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, <&'b U as Middleware>::Provider: PubsubClient, &'b U: 'async_trait,

source§

fn subscribe_pending_txs<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'life0, <&'b U as Middleware>::Provider, H256>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, <&'b U as Middleware>::Provider: PubsubClient, &'b U: 'async_trait,

source§

fn subscribe_full_pending_txs<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'life0, <&'b U as Middleware>::Provider, Transaction>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, <&'b U as Middleware>::Provider: PubsubClient, &'b U: 'async_trait,

source§

fn subscribe_logs<'a, 'life0, 'async_trait>( &'a self, filter: &'life0 Filter ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'a, <&'b U as Middleware>::Provider, Log>, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, <&'b U as Middleware>::Provider: PubsubClient, &'b U: 'async_trait,

source§

fn fee_history<'life0, 'life1, 'async_trait, T>( &'life0 self, block_count: T, last_block: BlockNumber, reward_percentiles: &'life1 [f64] ) -> Pin<Box<dyn Future<Output = Result<FeeHistory, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait + Into<U256> + Serialize + Send + Sync, &'b U: 'async_trait,

source§

fn create_access_list<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<AccessListWithGasUsed, <&'b U as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, &'b U: 'async_trait,

source§

impl<U> Middleware for Box<U>
where U: Middleware + ?Sized, Box<U>: Sync + Send + Debug,

§

type Error = <U as Middleware>::Error

§

type Provider = <U as Middleware>::Provider

§

type Inner = <U as Middleware>::Inner

source§

fn inner(&self) -> &<Box<U> as Middleware>::Inner

source§

fn convert_err(p: ProviderError) -> <Box<U> as Middleware>::Error

source§

fn provider(&self) -> &Provider<<Box<U> as Middleware>::Provider>

source§

fn default_sender(&self) -> Option<H160>

source§

fn client_version<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<String, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn fill_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 mut TypedTransaction, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<(), <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Box<U>: 'async_trait,

source§

fn get_block_number<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<U64, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn get_header<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T ) -> Pin<Box<dyn Future<Output = Result<Option<Block<Transaction>>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Box<U>: 'async_trait,

source§

fn send_transaction<'life0, 'async_trait, T>( &'life0 self, tx: T, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<PendingTransaction<'life0, <Box<U> as Middleware>::Provider>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, Box<U>: 'async_trait,

source§

fn send_escalating<'a, 'life0, 'async_trait>( &'a self, tx: &'life0 TypedTransaction, escalations: usize, policy: Box<dyn Fn(U256, usize) -> U256 + Sync + Send> ) -> Pin<Box<dyn Future<Output = Result<EscalatingPending<'a, <Box<U> as Middleware>::Provider>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn resolve_name<'life0, 'life1, 'async_trait>( &'life0 self, ens_name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<H160, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Box<U>: 'async_trait,

source§

fn lookup_address<'life0, 'async_trait>( &'life0 self, address: H160 ) -> Pin<Box<dyn Future<Output = Result<String, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn resolve_avatar<'life0, 'life1, 'async_trait>( &'life0 self, ens_name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<Url, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Box<U>: 'async_trait,

source§

fn resolve_nft<'life0, 'async_trait>( &'life0 self, token: ERCNFT ) -> Pin<Box<dyn Future<Output = Result<Url, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn resolve_field<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ens_name: &'life1 str, field: &'life2 str ) -> Pin<Box<dyn Future<Output = Result<String, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Box<U>: 'async_trait,

source§

fn get_block<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T ) -> Pin<Box<dyn Future<Output = Result<Option<Block<H256>>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Box<U>: 'async_trait,

source§

fn get_block_with_txs<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T ) -> Pin<Box<dyn Future<Output = Result<Option<Block<Transaction>>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Box<U>: 'async_trait,

source§

fn get_uncle_count<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T ) -> Pin<Box<dyn Future<Output = Result<U256, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Box<U>: 'async_trait,

source§

fn get_uncle<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T, idx: U64 ) -> Pin<Box<dyn Future<Output = Result<Option<Block<H256>>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Box<U>: 'async_trait,

source§

fn get_transaction_count<'life0, 'async_trait, T>( &'life0 self, from: T, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<U256, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Box<U>: 'async_trait,

source§

fn estimate_gas<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<U256, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Box<U>: 'async_trait,

source§

fn call<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<Bytes, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Box<U>: 'async_trait,

source§

fn syncing<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<SyncingStatus, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn get_chainid<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<U256, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn get_net_version<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<String, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn get_balance<'life0, 'async_trait, T>( &'life0 self, from: T, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<U256, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Box<U>: 'async_trait,

source§

fn get_transaction<'life0, 'async_trait, T>( &'life0 self, transaction_hash: T ) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Send + Sync + Into<H256>, Box<U>: 'async_trait,

source§

fn get_transaction_by_block_and_index<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T, idx: U64 ) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Box<U>: 'async_trait,

source§

fn get_transaction_receipt<'life0, 'async_trait, T>( &'life0 self, transaction_hash: T ) -> Pin<Box<dyn Future<Output = Result<Option<TransactionReceipt>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Send + Sync + Into<H256>, Box<U>: 'async_trait,

source§

fn get_block_receipts<'life0, 'async_trait, T>( &'life0 self, block: T ) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionReceipt>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockNumber> + Send + Sync, Box<U>: 'async_trait,

source§

fn get_gas_price<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<U256, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn estimate_eip1559_fees<'life0, 'async_trait>( &'life0 self, estimator: Option<fn(_: U256, _: Vec<Vec<U256>>) -> (U256, U256)> ) -> Pin<Box<dyn Future<Output = Result<(U256, U256), <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn get_accounts<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<H160>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn send_raw_transaction<'a, 'async_trait>( &'a self, tx: Bytes ) -> Pin<Box<dyn Future<Output = Result<PendingTransaction<'a, <Box<U> as Middleware>::Provider>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, Box<U>: 'async_trait,

source§

fn is_signer<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn sign<'life0, 'life1, 'async_trait, T>( &'life0 self, data: T, from: &'life1 H160 ) -> Pin<Box<dyn Future<Output = Result<Signature, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait + Into<Bytes> + Send + Sync, Box<U>: 'async_trait,

source§

fn sign_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, from: H160 ) -> Pin<Box<dyn Future<Output = Result<Signature, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Box<U>: 'async_trait,

source§

fn get_logs<'life0, 'life1, 'async_trait>( &'life0 self, filter: &'life1 Filter ) -> Pin<Box<dyn Future<Output = Result<Vec<Log>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Box<U>: 'async_trait,

source§

fn get_logs_paginated<'a>( &'a self, filter: &Filter, page_size: u64 ) -> LogQuery<'a, <Box<U> as Middleware>::Provider>

source§

fn watch<'a, 'life0, 'async_trait>( &'a self, filter: &'life0 Filter ) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'a, <Box<U> as Middleware>::Provider, Log>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn watch_pending_transactions<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'life0, <Box<U> as Middleware>::Provider, H256>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn watch_blocks<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'life0, <Box<U> as Middleware>::Provider, H256>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn get_code<'life0, 'async_trait, T>( &'life0 self, at: T, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<Bytes, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Box<U>: 'async_trait,

source§

fn get_storage_at<'life0, 'async_trait, T>( &'life0 self, from: T, location: H256, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<H256, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Box<U>: 'async_trait,

source§

fn get_proof<'life0, 'async_trait, T>( &'life0 self, from: T, locations: Vec<H256>, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<EIP1186ProofResponse, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Box<U>: 'async_trait,

source§

fn mining<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<bool, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn import_raw_key<'life0, 'async_trait>( &'life0 self, private_key: Bytes, passphrase: String ) -> Pin<Box<dyn Future<Output = Result<H160, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn unlock_account<'life0, 'async_trait, T>( &'life0 self, account: T, passphrase: String, duration: Option<u64> ) -> Pin<Box<dyn Future<Output = Result<bool, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<H160> + Send + Sync, Box<U>: 'async_trait,

source§

fn add_peer<'life0, 'async_trait>( &'life0 self, enode_url: String ) -> Pin<Box<dyn Future<Output = Result<bool, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn add_trusted_peer<'life0, 'async_trait>( &'life0 self, enode_url: String ) -> Pin<Box<dyn Future<Output = Result<bool, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn node_info<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<NodeInfo, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn peers<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<PeerInfo>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn remove_peer<'life0, 'async_trait>( &'life0 self, enode_url: String ) -> Pin<Box<dyn Future<Output = Result<bool, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn remove_trusted_peer<'life0, 'async_trait>( &'life0 self, enode_url: String ) -> Pin<Box<dyn Future<Output = Result<bool, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn start_mining<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn stop_mining<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn txpool_content<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<TxpoolContent, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn txpool_inspect<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<TxpoolInspect, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn txpool_status<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<TxpoolStatus, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn debug_trace_transaction<'life0, 'async_trait>( &'life0 self, tx_hash: H256, trace_options: GethDebugTracingOptions ) -> Pin<Box<dyn Future<Output = Result<GethTrace, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn debug_trace_call<'life0, 'async_trait, T>( &'life0 self, req: T, block: Option<BlockId>, trace_options: GethDebugTracingCallOptions ) -> Pin<Box<dyn Future<Output = Result<GethTrace, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, Box<U>: 'async_trait,

source§

fn debug_trace_block_by_number<'life0, 'async_trait>( &'life0 self, block: Option<BlockNumber>, trace_options: GethDebugTracingOptions ) -> Pin<Box<dyn Future<Output = Result<Vec<GethTrace>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn debug_trace_block_by_hash<'life0, 'async_trait>( &'life0 self, block: H256, trace_options: GethDebugTracingOptions ) -> Pin<Box<dyn Future<Output = Result<Vec<GethTrace>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn trace_call<'life0, 'async_trait, T>( &'life0 self, req: T, trace_type: Vec<TraceType>, block: Option<BlockNumber> ) -> Pin<Box<dyn Future<Output = Result<BlockTrace, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, Box<U>: 'async_trait,

source§

fn trace_call_many<'life0, 'async_trait, T>( &'life0 self, req: Vec<(T, Vec<TraceType>)>, block: Option<BlockNumber> ) -> Pin<Box<dyn Future<Output = Result<Vec<BlockTrace>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, Box<U>: 'async_trait,

source§

fn trace_raw_transaction<'life0, 'async_trait>( &'life0 self, data: Bytes, trace_type: Vec<TraceType> ) -> Pin<Box<dyn Future<Output = Result<BlockTrace, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn trace_replay_transaction<'life0, 'async_trait>( &'life0 self, hash: H256, trace_type: Vec<TraceType> ) -> Pin<Box<dyn Future<Output = Result<BlockTrace, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn trace_replay_block_transactions<'life0, 'async_trait>( &'life0 self, block: BlockNumber, trace_type: Vec<TraceType> ) -> Pin<Box<dyn Future<Output = Result<Vec<BlockTrace>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn trace_block<'life0, 'async_trait>( &'life0 self, block: BlockNumber ) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn trace_filter<'life0, 'async_trait>( &'life0 self, filter: TraceFilter ) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn trace_get<'life0, 'async_trait, T>( &'life0 self, hash: H256, index: Vec<T> ) -> Pin<Box<dyn Future<Output = Result<Trace, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<U64> + Send + Sync, Box<U>: 'async_trait,

source§

fn trace_transaction<'life0, 'async_trait>( &'life0 self, hash: H256 ) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Box<U>: 'async_trait,

source§

fn parity_block_receipts<'life0, 'async_trait, T>( &'life0 self, block: T ) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionReceipt>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockNumber> + Send + Sync, Box<U>: 'async_trait,

source§

fn subscribe_blocks<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'life0, <Box<U> as Middleware>::Provider, Block<H256>>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, <Box<U> as Middleware>::Provider: PubsubClient, Box<U>: 'async_trait,

source§

fn subscribe_pending_txs<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'life0, <Box<U> as Middleware>::Provider, H256>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, <Box<U> as Middleware>::Provider: PubsubClient, Box<U>: 'async_trait,

source§

fn subscribe_full_pending_txs<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'life0, <Box<U> as Middleware>::Provider, Transaction>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, <Box<U> as Middleware>::Provider: PubsubClient, Box<U>: 'async_trait,

source§

fn subscribe_logs<'a, 'life0, 'async_trait>( &'a self, filter: &'life0 Filter ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'a, <Box<U> as Middleware>::Provider, Log>, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, <Box<U> as Middleware>::Provider: PubsubClient, Box<U>: 'async_trait,

source§

fn fee_history<'life0, 'life1, 'async_trait, T>( &'life0 self, block_count: T, last_block: BlockNumber, reward_percentiles: &'life1 [f64] ) -> Pin<Box<dyn Future<Output = Result<FeeHistory, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait + Into<U256> + Serialize + Send + Sync, Box<U>: 'async_trait,

source§

fn create_access_list<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<AccessListWithGasUsed, <Box<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Box<U>: 'async_trait,

source§

impl<U> Middleware for Arc<U>
where U: Middleware + ?Sized, Arc<U>: Sync + Send + Debug,

§

type Error = <U as Middleware>::Error

§

type Provider = <U as Middleware>::Provider

§

type Inner = <U as Middleware>::Inner

source§

fn inner(&self) -> &<Arc<U> as Middleware>::Inner

source§

fn convert_err(p: ProviderError) -> <Arc<U> as Middleware>::Error

source§

fn provider(&self) -> &Provider<<Arc<U> as Middleware>::Provider>

source§

fn default_sender(&self) -> Option<H160>

source§

fn client_version<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<String, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn fill_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 mut TypedTransaction, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<(), <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<U>: 'async_trait,

source§

fn get_block_number<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<U64, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn get_header<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T ) -> Pin<Box<dyn Future<Output = Result<Option<Block<Transaction>>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Arc<U>: 'async_trait,

source§

fn send_transaction<'life0, 'async_trait, T>( &'life0 self, tx: T, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<PendingTransaction<'life0, <Arc<U> as Middleware>::Provider>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, Arc<U>: 'async_trait,

source§

fn send_escalating<'a, 'life0, 'async_trait>( &'a self, tx: &'life0 TypedTransaction, escalations: usize, policy: Box<dyn Fn(U256, usize) -> U256 + Sync + Send> ) -> Pin<Box<dyn Future<Output = Result<EscalatingPending<'a, <Arc<U> as Middleware>::Provider>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn resolve_name<'life0, 'life1, 'async_trait>( &'life0 self, ens_name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<H160, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<U>: 'async_trait,

source§

fn lookup_address<'life0, 'async_trait>( &'life0 self, address: H160 ) -> Pin<Box<dyn Future<Output = Result<String, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn resolve_avatar<'life0, 'life1, 'async_trait>( &'life0 self, ens_name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<Url, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<U>: 'async_trait,

source§

fn resolve_nft<'life0, 'async_trait>( &'life0 self, token: ERCNFT ) -> Pin<Box<dyn Future<Output = Result<Url, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn resolve_field<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ens_name: &'life1 str, field: &'life2 str ) -> Pin<Box<dyn Future<Output = Result<String, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Arc<U>: 'async_trait,

source§

fn get_block<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T ) -> Pin<Box<dyn Future<Output = Result<Option<Block<H256>>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Arc<U>: 'async_trait,

source§

fn get_block_with_txs<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T ) -> Pin<Box<dyn Future<Output = Result<Option<Block<Transaction>>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Arc<U>: 'async_trait,

source§

fn get_uncle_count<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T ) -> Pin<Box<dyn Future<Output = Result<U256, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Arc<U>: 'async_trait,

source§

fn get_uncle<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T, idx: U64 ) -> Pin<Box<dyn Future<Output = Result<Option<Block<H256>>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Arc<U>: 'async_trait,

source§

fn get_transaction_count<'life0, 'async_trait, T>( &'life0 self, from: T, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<U256, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Arc<U>: 'async_trait,

source§

fn estimate_gas<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<U256, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<U>: 'async_trait,

source§

fn call<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<Bytes, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<U>: 'async_trait,

source§

fn syncing<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<SyncingStatus, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn get_chainid<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<U256, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn get_net_version<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<String, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn get_balance<'life0, 'async_trait, T>( &'life0 self, from: T, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<U256, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Arc<U>: 'async_trait,

source§

fn get_transaction<'life0, 'async_trait, T>( &'life0 self, transaction_hash: T ) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Send + Sync + Into<H256>, Arc<U>: 'async_trait,

source§

fn get_transaction_by_block_and_index<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T, idx: U64 ) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Arc<U>: 'async_trait,

source§

fn get_transaction_receipt<'life0, 'async_trait, T>( &'life0 self, transaction_hash: T ) -> Pin<Box<dyn Future<Output = Result<Option<TransactionReceipt>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Send + Sync + Into<H256>, Arc<U>: 'async_trait,

source§

fn get_block_receipts<'life0, 'async_trait, T>( &'life0 self, block: T ) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionReceipt>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockNumber> + Send + Sync, Arc<U>: 'async_trait,

source§

fn get_gas_price<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<U256, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn estimate_eip1559_fees<'life0, 'async_trait>( &'life0 self, estimator: Option<fn(_: U256, _: Vec<Vec<U256>>) -> (U256, U256)> ) -> Pin<Box<dyn Future<Output = Result<(U256, U256), <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn get_accounts<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<H160>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn send_raw_transaction<'a, 'async_trait>( &'a self, tx: Bytes ) -> Pin<Box<dyn Future<Output = Result<PendingTransaction<'a, <Arc<U> as Middleware>::Provider>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, Arc<U>: 'async_trait,

source§

fn is_signer<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn sign<'life0, 'life1, 'async_trait, T>( &'life0 self, data: T, from: &'life1 H160 ) -> Pin<Box<dyn Future<Output = Result<Signature, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait + Into<Bytes> + Send + Sync, Arc<U>: 'async_trait,

source§

fn sign_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, from: H160 ) -> Pin<Box<dyn Future<Output = Result<Signature, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<U>: 'async_trait,

source§

fn get_logs<'life0, 'life1, 'async_trait>( &'life0 self, filter: &'life1 Filter ) -> Pin<Box<dyn Future<Output = Result<Vec<Log>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<U>: 'async_trait,

source§

fn get_logs_paginated<'a>( &'a self, filter: &Filter, page_size: u64 ) -> LogQuery<'a, <Arc<U> as Middleware>::Provider>

source§

fn watch<'a, 'life0, 'async_trait>( &'a self, filter: &'life0 Filter ) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'a, <Arc<U> as Middleware>::Provider, Log>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn watch_pending_transactions<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'life0, <Arc<U> as Middleware>::Provider, H256>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn watch_blocks<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'life0, <Arc<U> as Middleware>::Provider, H256>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn get_code<'life0, 'async_trait, T>( &'life0 self, at: T, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<Bytes, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Arc<U>: 'async_trait,

source§

fn get_storage_at<'life0, 'async_trait, T>( &'life0 self, from: T, location: H256, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<H256, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Arc<U>: 'async_trait,

source§

fn get_proof<'life0, 'async_trait, T>( &'life0 self, from: T, locations: Vec<H256>, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<EIP1186ProofResponse, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Arc<U>: 'async_trait,

source§

fn mining<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<bool, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn import_raw_key<'life0, 'async_trait>( &'life0 self, private_key: Bytes, passphrase: String ) -> Pin<Box<dyn Future<Output = Result<H160, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn unlock_account<'life0, 'async_trait, T>( &'life0 self, account: T, passphrase: String, duration: Option<u64> ) -> Pin<Box<dyn Future<Output = Result<bool, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<H160> + Send + Sync, Arc<U>: 'async_trait,

source§

fn add_peer<'life0, 'async_trait>( &'life0 self, enode_url: String ) -> Pin<Box<dyn Future<Output = Result<bool, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn add_trusted_peer<'life0, 'async_trait>( &'life0 self, enode_url: String ) -> Pin<Box<dyn Future<Output = Result<bool, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn node_info<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<NodeInfo, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn peers<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<PeerInfo>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn remove_peer<'life0, 'async_trait>( &'life0 self, enode_url: String ) -> Pin<Box<dyn Future<Output = Result<bool, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn remove_trusted_peer<'life0, 'async_trait>( &'life0 self, enode_url: String ) -> Pin<Box<dyn Future<Output = Result<bool, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn start_mining<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn stop_mining<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn txpool_content<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<TxpoolContent, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn txpool_inspect<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<TxpoolInspect, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn txpool_status<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<TxpoolStatus, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn debug_trace_transaction<'life0, 'async_trait>( &'life0 self, tx_hash: H256, trace_options: GethDebugTracingOptions ) -> Pin<Box<dyn Future<Output = Result<GethTrace, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn debug_trace_call<'life0, 'async_trait, T>( &'life0 self, req: T, block: Option<BlockId>, trace_options: GethDebugTracingCallOptions ) -> Pin<Box<dyn Future<Output = Result<GethTrace, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, Arc<U>: 'async_trait,

source§

fn debug_trace_block_by_number<'life0, 'async_trait>( &'life0 self, block: Option<BlockNumber>, trace_options: GethDebugTracingOptions ) -> Pin<Box<dyn Future<Output = Result<Vec<GethTrace>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn debug_trace_block_by_hash<'life0, 'async_trait>( &'life0 self, block: H256, trace_options: GethDebugTracingOptions ) -> Pin<Box<dyn Future<Output = Result<Vec<GethTrace>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn trace_call<'life0, 'async_trait, T>( &'life0 self, req: T, trace_type: Vec<TraceType>, block: Option<BlockNumber> ) -> Pin<Box<dyn Future<Output = Result<BlockTrace, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, Arc<U>: 'async_trait,

source§

fn trace_call_many<'life0, 'async_trait, T>( &'life0 self, req: Vec<(T, Vec<TraceType>)>, block: Option<BlockNumber> ) -> Pin<Box<dyn Future<Output = Result<Vec<BlockTrace>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, Arc<U>: 'async_trait,

source§

fn trace_raw_transaction<'life0, 'async_trait>( &'life0 self, data: Bytes, trace_type: Vec<TraceType> ) -> Pin<Box<dyn Future<Output = Result<BlockTrace, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn trace_replay_transaction<'life0, 'async_trait>( &'life0 self, hash: H256, trace_type: Vec<TraceType> ) -> Pin<Box<dyn Future<Output = Result<BlockTrace, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn trace_replay_block_transactions<'life0, 'async_trait>( &'life0 self, block: BlockNumber, trace_type: Vec<TraceType> ) -> Pin<Box<dyn Future<Output = Result<Vec<BlockTrace>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn trace_block<'life0, 'async_trait>( &'life0 self, block: BlockNumber ) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn trace_filter<'life0, 'async_trait>( &'life0 self, filter: TraceFilter ) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn trace_get<'life0, 'async_trait, T>( &'life0 self, hash: H256, index: Vec<T> ) -> Pin<Box<dyn Future<Output = Result<Trace, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<U64> + Send + Sync, Arc<U>: 'async_trait,

source§

fn trace_transaction<'life0, 'async_trait>( &'life0 self, hash: H256 ) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

source§

fn parity_block_receipts<'life0, 'async_trait, T>( &'life0 self, block: T ) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionReceipt>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockNumber> + Send + Sync, Arc<U>: 'async_trait,

source§

fn subscribe_blocks<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'life0, <Arc<U> as Middleware>::Provider, Block<H256>>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, <Arc<U> as Middleware>::Provider: PubsubClient, Arc<U>: 'async_trait,

source§

fn subscribe_pending_txs<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'life0, <Arc<U> as Middleware>::Provider, H256>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, <Arc<U> as Middleware>::Provider: PubsubClient, Arc<U>: 'async_trait,

source§

fn subscribe_full_pending_txs<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'life0, <Arc<U> as Middleware>::Provider, Transaction>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, <Arc<U> as Middleware>::Provider: PubsubClient, Arc<U>: 'async_trait,

source§

fn subscribe_logs<'a, 'life0, 'async_trait>( &'a self, filter: &'life0 Filter ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'a, <Arc<U> as Middleware>::Provider, Log>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, <Arc<U> as Middleware>::Provider: PubsubClient, Arc<U>: 'async_trait,

source§

fn fee_history<'life0, 'life1, 'async_trait, T>( &'life0 self, block_count: T, last_block: BlockNumber, reward_percentiles: &'life1 [f64] ) -> Pin<Box<dyn Future<Output = Result<FeeHistory, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait + Into<U256> + Serialize + Send + Sync, Arc<U>: 'async_trait,

source§

fn create_access_list<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, block: Option<BlockId> ) -> Pin<Box<dyn Future<Output = Result<AccessListWithGasUsed, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<U>: 'async_trait,

Implementors§

source§

impl<M> Middleware for GasEscalatorMiddleware<M>
where M: Middleware,

source§

impl<M> Middleware for NonceManagerMiddleware<M>
where M: Middleware,

source§

impl<M> Middleware for TimeLag<M>
where M: Middleware,

§

type Error = TimeLagError<M>

§

type Provider = <M as Middleware>::Provider

§

type Inner = M

source§

impl<M, G> Middleware for GasOracleMiddleware<M, G>
where M: Middleware, G: GasOracle,

source§

impl<M, P> Middleware for PolicyMiddleware<M, P>
where M: Middleware, P: Policy,

source§

impl<M, S> Middleware for SignerMiddleware<M, S>
where M: Middleware, S: Signer,

source§

impl<M, T> Middleware for TransformerMiddleware<M, T>
where M: Middleware, T: Transformer,

§

type Error = TransformerMiddlewareError<M>

§

type Provider = <M as Middleware>::Provider

§

type Inner = M

source§

impl<P> Middleware for Provider<P>
where P: JsonRpcClient,