pub trait TransactionResponse: Transaction {
// 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;
// Provided methods
fn block_hash_num(&self) -> Option<NumHash> { ... }
fn gas_price(&self) -> Option<u128> { ... }
fn max_fee_per_gas(&self) -> Option<u128> { ... }
fn transaction_type(&self) -> Option<u8> { ... }
fn inclusion_info(&self) -> Option<InclusionInfo> { ... }
}Expand description
Transaction JSON-RPC response. Aggregates transaction data with its block and signer context.
Required Methods§
Sourcefn tx_hash(&self) -> FixedBytes<32>
fn tx_hash(&self) -> FixedBytes<32>
Hash of the transaction
Sourcefn block_hash(&self) -> Option<FixedBytes<32>>
fn block_hash(&self) -> Option<FixedBytes<32>>
Returns the hash of the block this transaction was mined in.
Returns None if this transaction is still pending.
Sourcefn block_number(&self) -> Option<u64>
fn block_number(&self) -> Option<u64>
Returns the number of the block this transaction was mined in.
Returns None if this transaction is still pending.
Sourcefn transaction_index(&self) -> Option<u64>
fn transaction_index(&self) -> Option<u64>
Transaction Index
Provided Methods§
Sourcefn block_hash_num(&self) -> Option<NumHash>
fn block_hash_num(&self) -> Option<NumHash>
Returns the BlockNumHash of the block this transaction was mined in.
Returns None if this transaction is still pending.
Sourcefn gas_price(&self) -> Option<u128>
fn gas_price(&self) -> Option<u128>
Gas Price, this is the RPC format for max_fee_per_gas, pre-eip-1559.
Sourcefn max_fee_per_gas(&self) -> Option<u128>
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.
Sourcefn transaction_type(&self) -> Option<u8>
fn transaction_type(&self) -> Option<u8>
Transaction type format for RPC. This field is included since eip-2930.
Sourcefn inclusion_info(&self) -> Option<InclusionInfo>
fn inclusion_info(&self) -> Option<InclusionInfo>
Returns the InclusionInfo if the transaction has been included.
Returns None if this transaction is still pending (missing block number, hash, or index).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".