Trait EthFeeMarketApiServer

Source
pub trait EthFeeMarketApiServer:
    Sized
    + Send
    + Sync
    + 'static {
    // Required methods
    fn gas_price<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = RpcResult<U256>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn max_priority_fee_per_gas<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = RpcResult<U256>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn fee_history<'life0, 'async_trait>(
        &'life0 self,
        block_count: U256,
        newest_block: BlockNumberOrTag,
        reward_percentiles: Option<Vec<f64>>,
    ) -> Pin<Box<dyn Future<Output = RpcResult<FeeHistoryResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn into_rpc(self) -> RpcModule<Self> { ... }
}
Expand description

Server trait implementation for the EthFeeMarketApi RPC API.

Required Methods§

Source

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

Returns the current price per gas in wei.

Source

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

Returns the current maxPriorityFeePerGas per gas in wei, which introduced in EIP-1159.

Source

fn fee_history<'life0, 'async_trait>( &'life0 self, block_count: U256, newest_block: BlockNumberOrTag, reward_percentiles: Option<Vec<f64>>, ) -> Pin<Box<dyn Future<Output = RpcResult<FeeHistoryResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns transaction base fee per gas and effective priority fee per gas for the requested/supported block range.

Transaction fee history, which is introduced in EIP-1159.

Provided Methods§

Source

fn into_rpc(self) -> RpcModule<Self>

Collects all the methods and subscriptions defined in the trait and adds them into a single RpcModule.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§