Skip to main content

RpcResponseConverter

Trait RpcResponseConverter 

Source
pub trait RpcResponseConverter<N: Network>:
    Send
    + Sync
    + Debug
    + 'static {
    type Block;
    type Transaction;
    type Receipt;

    // Required methods
    fn block(
        &self,
        response: N::BlockResponse,
    ) -> Result<Self::Block, RpcResponseConverterError>;
    fn transaction(
        &self,
        response: N::TransactionResponse,
    ) -> Result<Self::Transaction, RpcResponseConverterError>;
    fn receipt(
        &self,
        response: N::ReceiptResponse,
    ) -> Result<Self::Receipt, RpcResponseConverterError>;
}
Expand description

Converts RPC network responses (blocks, transactions, receipts) into primitive types.

Required Associated Types§

Source

type Block

Primitive block type.

Source

type Transaction

Primitive transaction type.

Source

type Receipt

Primitive receipt type.

Required Methods§

Source

fn block( &self, response: N::BlockResponse, ) -> Result<Self::Block, RpcResponseConverterError>

Converts a network block response to a primitive block.

Source

fn transaction( &self, response: N::TransactionResponse, ) -> Result<Self::Transaction, RpcResponseConverterError>

Converts a network transaction response to a primitive transaction.

Source

fn receipt( &self, response: N::ReceiptResponse, ) -> Result<Self::Receipt, RpcResponseConverterError>

Converts a network receipt response to a primitive receipt.

Implementors§

Source§

impl RpcResponseConverter<Ethereum> for EthRpcConverter

Source§

type Block = Block<EthereumTxEnvelope<TxEip4844>>

Source§

type Transaction = EthereumTxEnvelope<TxEip4844>

Source§

type Receipt = EthereumReceipt