Struct alloy_rpc_types_eth::transaction::Transaction
source · pub struct Transaction {Show 20 fields
pub hash: TxHash,
pub nonce: u64,
pub block_hash: Option<BlockHash>,
pub block_number: Option<u64>,
pub transaction_index: Option<u64>,
pub from: Address,
pub to: Option<Address>,
pub value: U256,
pub gas_price: Option<u128>,
pub gas: u128,
pub max_fee_per_gas: Option<u128>,
pub max_priority_fee_per_gas: Option<u128>,
pub max_fee_per_blob_gas: Option<u128>,
pub input: Bytes,
pub signature: Option<Signature>,
pub chain_id: Option<ChainId>,
pub blob_versioned_hashes: Option<Vec<B256>>,
pub access_list: Option<AccessList>,
pub transaction_type: Option<u8>,
pub other: OtherFields,
}
Expand description
Transaction object used in RPC
Fields§
§hash: TxHash
Hash
nonce: u64
Nonce
block_hash: Option<BlockHash>
Block hash
block_number: Option<u64>
Block number
transaction_index: Option<u64>
Transaction Index
from: Address
Sender
to: Option<Address>
Recipient
value: U256
Transferred value
gas_price: Option<u128>
Gas Price
gas: u128
Gas amount
max_fee_per_gas: Option<u128>
Max BaseFeePerGas the user is willing to pay.
max_priority_fee_per_gas: Option<u128>
The miner’s tip.
max_fee_per_blob_gas: Option<u128>
Configured max fee per blob gas for eip-4844 transactions
input: Bytes
Data
signature: Option<Signature>
All flattened fields of the transaction signature.
Note: this is an option so special transaction types without a signature (e.g. https://github.com/ethereum-optimism/optimism/blob/0bf643c4147b43cd6f25a759d331ef3a2a61a2a3/specs/deposits.md#the-deposited-transaction-type) can be supported.
chain_id: Option<ChainId>
The chain id of the transaction, if any.
blob_versioned_hashes: Option<Vec<B256>>
Contains the blob hashes for eip-4844 transactions.
access_list: Option<AccessList>
EIP2930
Pre-pay to warm storage access.
transaction_type: Option<u8>
EIP2718
Transaction type, Some(3) for EIP-4844 transaction, Some(2) for EIP-1559 transaction, Some(1) for AccessList transaction, None or Some(0) for Legacy
other: OtherFields
Arbitrary extra fields.
This captures fields that are not native to ethereum but included in ethereum adjacent networks, for example fields the optimism eth_getTransactionByHash
request returns additional fields that this type will capture
Implementations§
source§impl Transaction
impl Transaction
sourcepub const fn is_legacy_gas(&self) -> bool
pub const fn is_legacy_gas(&self) -> bool
Returns true if the transaction is a legacy or 2930 transaction.
sourcepub fn into_request(self) -> TransactionRequest
pub fn into_request(self) -> TransactionRequest
Converts Transaction into TransactionRequest.
During this conversion data for TransactionRequest::sidecar is not populated as it is not part of Transaction.
Trait Implementations§
source§impl<'arbitrary> Arbitrary<'arbitrary> for Transaction
impl<'arbitrary> Arbitrary<'arbitrary> for Transaction
source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self
from the given unstructured data. Read moresource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self
from the entirety of the given
unstructured data. Read moresource§impl Clone for Transaction
impl Clone for Transaction
source§fn clone(&self) -> Transaction
fn clone(&self) -> Transaction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Transaction
impl Debug for Transaction
source§impl Default for Transaction
impl Default for Transaction
source§fn default() -> Transaction
fn default() -> Transaction
source§impl<'de> Deserialize<'de> for Transaction
impl<'de> Deserialize<'de> for Transaction
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl From<&Transaction> for TransactionInfo
impl From<&Transaction> for TransactionInfo
source§fn from(tx: &Transaction) -> Self
fn from(tx: &Transaction) -> Self
source§impl From<Transaction> for TransactionRequest
impl From<Transaction> for TransactionRequest
source§fn from(tx: Transaction) -> Self
fn from(tx: Transaction) -> Self
source§impl PartialEq for Transaction
impl PartialEq for Transaction
source§fn eq(&self, other: &Transaction) -> bool
fn eq(&self, other: &Transaction) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for Transaction
impl Serialize for Transaction
source§impl TryFrom<Transaction> for Signed<TxEip1559>
impl TryFrom<Transaction> for Signed<TxEip1559>
§type Error = ConversionError
type Error = ConversionError
source§impl TryFrom<Transaction> for Signed<TxEip2930>
impl TryFrom<Transaction> for Signed<TxEip2930>
§type Error = ConversionError
type Error = ConversionError
source§impl TryFrom<Transaction> for Signed<TxEip4844>
impl TryFrom<Transaction> for Signed<TxEip4844>
§type Error = ConversionError
type Error = ConversionError
source§impl TryFrom<Transaction> for Signed<TxEip4844Variant>
impl TryFrom<Transaction> for Signed<TxEip4844Variant>
§type Error = ConversionError
type Error = ConversionError
source§impl TryFrom<Transaction> for Signed<TxLegacy>
impl TryFrom<Transaction> for Signed<TxLegacy>
§type Error = ConversionError
type Error = ConversionError
source§impl TryFrom<Transaction> for TxEnvelope
impl TryFrom<Transaction> for TxEnvelope
§type Error = ConversionError
type Error = ConversionError
impl Eq for Transaction
impl StructuralPartialEq for Transaction
Auto Trait Implementations§
impl !Freeze for Transaction
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnwindSafe for Transaction
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreimpl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 560 bytes