Trait reth::core::rpc::api::servers::eth::helpers::spec::EthApiSpec

source ·
pub trait EthApiSpec: Send + Sync {
    // Required methods
    fn protocol_version(
        &self,
    ) -> impl Future<Output = Result<Uint<64, 1>, RethError>> + Send;
    fn chain_id(&self) -> Uint<64, 1>;
    fn chain_info(&self) -> Result<ChainInfo, RethError>;
    fn accounts(&self) -> Vec<Address>;
    fn is_syncing(&self) -> bool;
    fn sync_status(&self) -> Result<SyncStatus, RethError>;
    fn chain_spec(&self) -> Arc<ChainSpec>;
}
Expand description

Eth API trait.

Defines core functionality of the eth API implementation.

Required Methods§

source

fn protocol_version( &self, ) -> impl Future<Output = Result<Uint<64, 1>, RethError>> + Send

Returns the current ethereum protocol version.

source

fn chain_id(&self) -> Uint<64, 1>

Returns the chain id

source

fn chain_info(&self) -> Result<ChainInfo, RethError>

Returns provider chain info

source

fn accounts(&self) -> Vec<Address>

Returns a list of addresses owned by provider.

source

fn is_syncing(&self) -> bool

Returns true if the network is undergoing sync.

source

fn sync_status(&self) -> Result<SyncStatus, RethError>

Returns the SyncStatus of the network

source

fn chain_spec(&self) -> Arc<ChainSpec>

Returns the configured [ChainSpec].

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a, T> EthApiSpec for &'a T
where T: 'a + EthApiSpec + ?Sized, &'a T: Send + Sync,

source§

fn protocol_version( &self, ) -> impl Future<Output = Result<Uint<64, 1>, RethError>> + Send

source§

fn chain_id(&self) -> Uint<64, 1>

source§

fn chain_info(&self) -> Result<ChainInfo, RethError>

source§

fn accounts(&self) -> Vec<Address>

source§

fn is_syncing(&self) -> bool

source§

fn sync_status(&self) -> Result<SyncStatus, RethError>

source§

fn chain_spec(&self) -> Arc<ChainSpec>

source§

impl<T> EthApiSpec for Arc<T>
where T: EthApiSpec + ?Sized, Arc<T>: Send + Sync,

source§

fn protocol_version( &self, ) -> impl Future<Output = Result<Uint<64, 1>, RethError>> + Send

source§

fn chain_id(&self) -> Uint<64, 1>

source§

fn chain_info(&self) -> Result<ChainInfo, RethError>

source§

fn accounts(&self) -> Vec<Address>

source§

fn is_syncing(&self) -> bool

source§

fn sync_status(&self) -> Result<SyncStatus, RethError>

source§

fn chain_spec(&self) -> Arc<ChainSpec>

Implementors§

source§

impl<Provider, Pool, Network, EvmConfig> EthApiSpec for EthApi<Provider, Pool, Network, EvmConfig>
where Pool: TransactionPool + 'static, Provider: BlockReaderIdExt + ChainSpecProvider + StateProviderFactory + EvmEnvProvider + 'static, Network: NetworkInfo + 'static, EvmConfig: ConfigureEvm,