Trait reth::core::rpc::api::servers::eth::helpers::LoadFee

source ·
pub trait LoadFee: LoadBlock {
    // Required methods
    fn provider(
        &self,
    ) -> impl BlockIdReader + HeaderProvider + ChainSpecProvider;
    fn cache(&self) -> &EthStateCache;
    fn gas_oracle(&self) -> &GasPriceOracle<impl BlockReaderIdExt>;
    fn fee_history_cache(&self) -> &FeeHistoryCache;

    // Provided methods
    fn legacy_gas_price(
        &self,
        gas_price: Option<Uint<256, 4>>,
    ) -> impl Future<Output = Result<Uint<256, 4>, EthApiError>> + Send { ... }
    fn eip1559_fees(
        &self,
        max_fee_per_gas: Option<Uint<256, 4>>,
        max_priority_fee_per_gas: Option<Uint<256, 4>>,
    ) -> impl Future<Output = Result<(Uint<256, 4>, Uint<256, 4>), EthApiError>> + Send { ... }
    fn eip4844_blob_fee(
        &self,
        blob_fee: Option<Uint<256, 4>>,
    ) -> impl Future<Output = Result<Uint<256, 4>, EthApiError>> + Send { ... }
    fn gas_price(
        &self,
    ) -> impl Future<Output = Result<Uint<256, 4>, EthApiError>> + Send { ... }
    fn blob_base_fee(
        &self,
    ) -> impl Future<Output = Result<Uint<256, 4>, EthApiError>> + Send { ... }
    fn suggested_priority_fee(
        &self,
    ) -> impl Future<Output = Result<Uint<256, 4>, EthApiError>> + Send
       where Self: 'static { ... }
}
Expand description

Loads fee from database.

Behaviour shared by several eth_ RPC methods, not exclusive to eth_ fees RPC methods.

Required Methods§

source

fn provider(&self) -> impl BlockIdReader + HeaderProvider + ChainSpecProvider

Data access in default (L1) trait method implementations.

source

fn cache(&self) -> &EthStateCache

Returns a handle for reading data from memory.

Data access in default (L1) trait method implementations.

source

fn gas_oracle(&self) -> &GasPriceOracle<impl BlockReaderIdExt>

Returns a handle for reading gas price.

Data access in default (L1) trait method implementations.

source

fn fee_history_cache(&self) -> &FeeHistoryCache

Returns a handle for reading fee history data from memory.

Data access in default (L1) trait method implementations.

Provided Methods§

source

fn legacy_gas_price( &self, gas_price: Option<Uint<256, 4>>, ) -> impl Future<Output = Result<Uint<256, 4>, EthApiError>> + Send

Returns the gas price if it is set, otherwise fetches a suggested gas price for legacy transactions.

source

fn eip1559_fees( &self, max_fee_per_gas: Option<Uint<256, 4>>, max_priority_fee_per_gas: Option<Uint<256, 4>>, ) -> impl Future<Output = Result<(Uint<256, 4>, Uint<256, 4>), EthApiError>> + Send

Returns the EIP-1559 fees if they are set, otherwise fetches a suggested gas price for EIP-1559 transactions.

Returns (max_fee, priority_fee)

source

fn eip4844_blob_fee( &self, blob_fee: Option<Uint<256, 4>>, ) -> impl Future<Output = Result<Uint<256, 4>, EthApiError>> + Send

Returns the EIP-4844 blob fee if it is set, otherwise fetches a blob fee.

source

fn gas_price( &self, ) -> impl Future<Output = Result<Uint<256, 4>, EthApiError>> + Send

Returns a suggestion for a gas price for legacy transactions.

See also: https://github.com/ethereum/pm/issues/328#issuecomment-853234014

source

fn blob_base_fee( &self, ) -> impl Future<Output = Result<Uint<256, 4>, EthApiError>> + Send

Returns a suggestion for a base fee for blob transactions.

source

fn suggested_priority_fee( &self, ) -> impl Future<Output = Result<Uint<256, 4>, EthApiError>> + Send
where Self: 'static,

Returns a suggestion for the priority fee (the tip)

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<Provider, Pool, Network, EvmConfig> LoadFee for EthApi<Provider, Pool, Network, EvmConfig>
where EthApi<Provider, Pool, Network, EvmConfig>: LoadBlock, Provider: BlockReaderIdExt + HeaderProvider + ChainSpecProvider,