EthApiTypes

Trait EthApiTypes 

pub trait EthApiTypes:
    Send
    + Sync
    + Clone {
    type Error: Into<ErrorObject<'static>> + FromEthApiError + AsEthApiError + From<<Self::RpcConvert as RpcConvert>::Error> + Error + Send + Sync;
    type NetworkTypes: RpcTypes;
    type RpcConvert: RpcConvert<Network = Self::NetworkTypes>;

    // Required method
    fn converter(&self) -> &Self::RpcConvert;
}
Expand description

Network specific eth API types.

This trait defines the network specific rpc types and helpers required for the eth_ and adjacent endpoints. NetworkTypes is [alloy_network::Network] as defined by the alloy crate, see also [alloy_network::Ethereum].

This type is stateful so that it can provide additional context if necessary, e.g. populating receipts with additional data.

Required Associated Types§

type Error: Into<ErrorObject<'static>> + FromEthApiError + AsEthApiError + From<<Self::RpcConvert as RpcConvert>::Error> + Error + Send + Sync

Extension of FromEthApiError, with network specific errors.

type NetworkTypes: RpcTypes

Blockchain primitive types, specific to network, e.g. block and transaction.

type RpcConvert: RpcConvert<Network = Self::NetworkTypes>

Conversion methods for transaction RPC type.

Required Methods§

fn converter(&self) -> &Self::RpcConvert

Returns reference to transaction response builder.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<N, Rpc> EthApiTypes for EthApi<N, Rpc>
where N: RpcNodeCore, Rpc: RpcConvert<Error = EthApiError>,