op_alloy_network::primitives

Trait TransactionResponse

pub trait TransactionResponse: Transaction {
    type Signature;

    // Required methods
    fn tx_hash(&self) -> FixedBytes<32>;
    fn block_hash(&self) -> Option<FixedBytes<32>>;
    fn block_number(&self) -> Option<u64>;
    fn transaction_index(&self) -> Option<u64>;
    fn from(&self) -> Address;
    fn signature(&self) -> Option<Self::Signature>;

    // Provided methods
    fn to(&self) -> Option<Address> { ... }
    fn gas_price(&self) -> Option<u128> { ... }
    fn max_fee_per_gas(&self) -> Option<u128> { ... }
    fn transaction_type(&self) -> Option<u8> { ... }
}
Expand description

Transaction JSON-RPC response. Aggregates transaction data with its block and signer context.

Required Associated Types§

type Signature

Signature type of the transaction

Required Methods§

fn tx_hash(&self) -> FixedBytes<32>

Hash of the transaction

fn block_hash(&self) -> Option<FixedBytes<32>>

Block hash

fn block_number(&self) -> Option<u64>

Block number

fn transaction_index(&self) -> Option<u64>

Transaction Index

fn from(&self) -> Address

Sender of the transaction

fn signature(&self) -> Option<Self::Signature>

Transaction signature

Provided Methods§

fn to(&self) -> Option<Address>

Recipient of the transaction. Returns None if transaction is a contract creation.

fn gas_price(&self) -> Option<u128>

Gas Price, this is the RPC format for max_fee_per_gas, pre-eip-1559.

fn max_fee_per_gas(&self) -> Option<u128>

Max BaseFeePerGas the user is willing to pay. For pre-eip-1559 transactions, the field label gas_price is used instead.

fn transaction_type(&self) -> Option<u8>

Transaction type format for RPC. This field is included since eip-2930.

Implementations on Foreign Types§

§

impl TransactionResponse for Transaction

§

type Signature = Signature

§

fn tx_hash(&self) -> FixedBytes<32>

§

fn block_hash(&self) -> Option<FixedBytes<32>>

§

fn block_number(&self) -> Option<u64>

§

fn transaction_index(&self) -> Option<u64>

§

fn from(&self) -> Address

§

fn signature(&self) -> Option<Signature>

§

impl TransactionResponse for Transaction

§

type Signature = Signature

§

fn tx_hash(&self) -> FixedBytes<32>

§

fn block_hash(&self) -> Option<FixedBytes<32>>

§

fn block_number(&self) -> Option<u64>

§

fn transaction_index(&self) -> Option<u64>

§

fn from(&self) -> Address

§

fn to(&self) -> Option<Address>

§

fn signature(&self) -> Option<<Transaction as TransactionResponse>::Signature>

§

impl<T> TransactionResponse for WithOtherFields<T>

§

type Signature = <T as TransactionResponse>::Signature

§

fn tx_hash(&self) -> FixedBytes<32>

§

fn block_hash(&self) -> Option<FixedBytes<32>>

§

fn block_number(&self) -> Option<u64>

§

fn transaction_index(&self) -> Option<u64>

§

fn from(&self) -> Address

§

fn signature(&self) -> Option<<T as TransactionResponse>::Signature>

Implementors§