Skip to main content

EthApiTypes

Trait EthApiTypes 

Source
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§

Source

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

Extension of FromEthApiError, with network specific errors.

Source

type NetworkTypes: RpcTypes

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

Source

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

Conversion methods for transaction RPC type.

Required Methods§

Source

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".

Implementors§

Source§

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