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: u64,
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 authorization_list: Option<Vec<SignedAuthorization>>,
}
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: u64
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(4) for EIP-7702 transaction, Some(3) for EIP-4844 transaction, Some(2) for EIP-1559 transaction, Some(1) for AccessList transaction, None or Some(0) for Legacy
The signed authorization list is a list of tuples that store the address to code which the signer desires to execute in the context of their EOA and their signature.
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§impl Serialize for Transaction
impl Serialize for Transaction
source§impl Transaction for Transaction
impl Transaction for Transaction
source§fn max_fee_per_gas(&self) -> u128
fn max_fee_per_gas(&self) -> u128
source§fn max_priority_fee_per_gas(&self) -> Option<u128>
fn max_priority_fee_per_gas(&self) -> Option<u128>
source§fn max_fee_per_blob_gas(&self) -> Option<u128>
fn max_fee_per_blob_gas(&self) -> Option<u128>
source§fn priority_fee_or_price(&self) -> u128
fn priority_fee_or_price(&self) -> u128
source§fn access_list(&self) -> Option<&AccessList>
fn access_list(&self) -> Option<&AccessList>
access_list
for the particular transaction type. Returns None
for
older transaction types.source§fn blob_versioned_hashes(&self) -> Option<&[B256]>
fn blob_versioned_hashes(&self) -> Option<&[B256]>
None
.SignedAuthorization
list of the transaction. Read moresource§impl TransactionResponse for Transaction
impl TransactionResponse for Transaction
source§fn block_hash(&self) -> Option<BlockHash>
fn block_hash(&self) -> Option<BlockHash>
source§fn block_number(&self) -> Option<u64>
fn block_number(&self) -> Option<u64>
source§fn transaction_index(&self) -> Option<u64>
fn transaction_index(&self) -> Option<u64>
source§fn to(&self) -> Option<Address>
fn to(&self) -> Option<Address>
None
if transaction is a contract creation.source§fn gas_price(&self) -> Option<u128>
fn gas_price(&self) -> Option<u128>
max_fee_per_gas
, pre-eip-1559.source§fn max_fee_per_gas(&self) -> Option<u128>
fn max_fee_per_gas(&self) -> Option<u128>
gas_price
is used instead.source§fn transaction_type(&self) -> Option<u8>
fn transaction_type(&self) -> Option<u8>
source§impl TryFrom<Transaction> for Signed<TxEip1559>
impl TryFrom<Transaction> for Signed<TxEip1559>
source§type Error = ConversionError
type Error = ConversionError
source§impl TryFrom<Transaction> for Signed<TxEip2930>
impl TryFrom<Transaction> for Signed<TxEip2930>
source§type Error = ConversionError
type Error = ConversionError
source§impl TryFrom<Transaction> for Signed<TxEip4844>
impl TryFrom<Transaction> for Signed<TxEip4844>
source§type Error = ConversionError
type Error = ConversionError
source§impl TryFrom<Transaction> for Signed<TxEip4844Variant>
impl TryFrom<Transaction> for Signed<TxEip4844Variant>
source§type Error = ConversionError
type Error = ConversionError
source§impl TryFrom<Transaction> for Signed<TxEip7702>
impl TryFrom<Transaction> for Signed<TxEip7702>
source§type Error = ConversionError
type Error = ConversionError
source§impl TryFrom<Transaction> for Signed<TxLegacy>
impl TryFrom<Transaction> for Signed<TxLegacy>
source§type Error = ConversionError
type Error = ConversionError
source§impl TryFrom<Transaction> for TxEnvelope
impl TryFrom<Transaction> for TxEnvelope
source§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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 more