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

source

pub const fn is_legacy_gas(&self) -> bool

Returns true if the transaction is a legacy or 2930 transaction.

source

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

source§

fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>

Generate an arbitrary value of Self from the given unstructured data. Read more
source§

fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>

Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
source§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
source§

impl Clone for Transaction

source§

fn clone(&self) -> Transaction

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Transaction

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Transaction

source§

fn default() -> Transaction

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Transaction

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<&Transaction> for TransactionInfo

source§

fn from(tx: &Transaction) -> Self

Converts to this type from the input type.
source§

impl From<Transaction> for TransactionRequest

source§

fn from(tx: Transaction) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Transaction

source§

fn eq(&self, other: &Transaction) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Transaction

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<Transaction> for Signed<TxEip1559>

§

type Error = ConversionError

The type returned in the event of a conversion error.
source§

fn try_from(tx: Transaction) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Transaction> for Signed<TxEip2930>

§

type Error = ConversionError

The type returned in the event of a conversion error.
source§

fn try_from(tx: Transaction) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Transaction> for Signed<TxEip4844>

§

type Error = ConversionError

The type returned in the event of a conversion error.
source§

fn try_from(tx: Transaction) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Transaction> for Signed<TxEip4844Variant>

§

type Error = ConversionError

The type returned in the event of a conversion error.
source§

fn try_from(tx: Transaction) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Transaction> for Signed<TxLegacy>

§

type Error = ConversionError

The type returned in the event of a conversion error.
source§

fn try_from(tx: Transaction) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Transaction> for TxEnvelope

§

type Error = ConversionError

The type returned in the event of a conversion error.
source§

fn try_from(tx: Transaction) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Eq for Transaction

source§

impl StructuralPartialEq for Transaction

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where 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