Enum ethers_core::types::transaction::eip2718::TypedTransaction
source · pub enum TypedTransaction {
Legacy(TransactionRequest),
Eip2930(Eip2930TransactionRequest),
Eip1559(Eip1559TransactionRequest),
DepositTransaction(DepositTransaction),
}
Expand description
The TypedTransaction enum represents all Ethereum transaction types.
Its variants correspond to specific allowed transactions:
- Legacy (pre-EIP2718)
TransactionRequest
- EIP2930 (state access lists)
Eip2930TransactionRequest
- EIP1559
Eip1559TransactionRequest
To support Kovan and other non-London-compatbile networks, please enable
the legacy
crate feature. This will disable the type
flag in the
serialized transaction, and cause contract calls and other common actions
to default to using the legacy transaction type.
Variants§
Legacy(TransactionRequest)
Eip2930(Eip2930TransactionRequest)
Eip1559(Eip1559TransactionRequest)
DepositTransaction(DepositTransaction)
Implementations§
source§impl TypedTransaction
impl TypedTransaction
pub fn from(&self) -> Option<&Address>
pub fn set_from(&mut self, from: Address) -> &mut Self
pub fn to(&self) -> Option<&NameOrAddress>
pub fn to_addr(&self) -> Option<&Address>
pub fn set_to<T: Into<NameOrAddress>>(&mut self, to: T) -> &mut Self
pub fn nonce(&self) -> Option<&U256>
pub fn set_nonce<T: Into<U256>>(&mut self, nonce: T) -> &mut Self
pub fn value(&self) -> Option<&U256>
pub fn set_value<T: Into<U256>>(&mut self, value: T) -> &mut Self
pub fn gas(&self) -> Option<&U256>
pub fn gas_mut(&mut self) -> &mut Option<U256>
pub fn set_gas<T: Into<U256>>(&mut self, gas: T) -> &mut Self
pub fn gas_price(&self) -> Option<U256>
pub fn set_gas_price<T: Into<U256>>(&mut self, gas_price: T) -> &mut Self
pub fn chain_id(&self) -> Option<U64>
pub fn set_chain_id<T: Into<U64>>(&mut self, chain_id: T) -> &mut Self
pub fn data(&self) -> Option<&Bytes>
pub fn access_list(&self) -> Option<&AccessList>
pub fn set_access_list(&mut self, access_list: AccessList) -> &mut Self
pub fn set_data(&mut self, data: Bytes) -> &mut Self
pub fn rlp_signed(&self, signature: &Signature) -> Bytes
pub fn rlp(&self) -> Bytes
sourcepub fn hash(&self, signature: &Signature) -> H256
pub fn hash(&self, signature: &Signature) -> H256
Hashes the transaction’s data with the included signature.
sourcepub fn decode_signed(
rlp: &Rlp<'_>
) -> Result<(Self, Signature), TypedTransactionError>
pub fn decode_signed( rlp: &Rlp<'_> ) -> Result<(Self, Signature), TypedTransactionError>
Decodes a signed TypedTransaction from a rlp encoded byte stream
source§impl TypedTransaction
impl TypedTransaction
pub fn as_legacy_ref(&self) -> Option<&TransactionRequest>
pub fn as_eip2930_ref(&self) -> Option<&Eip2930TransactionRequest>
pub fn as_eip1559_ref(&self) -> Option<&Eip1559TransactionRequest>
pub fn as_optimism_deposited_ref(&self) -> Option<&DepositTransaction>
pub fn as_legacy_mut(&mut self) -> Option<&mut TransactionRequest>
pub fn as_eip2930_mut(&mut self) -> Option<&mut Eip2930TransactionRequest>
pub fn as_eip1559_mut(&mut self) -> Option<&mut Eip1559TransactionRequest>
pub fn as_optimism_deposited_mut(&mut self) -> Option<&mut DepositTransaction>
Trait Implementations§
source§impl Clone for TypedTransaction
impl Clone for TypedTransaction
source§fn clone(&self) -> TypedTransaction
fn clone(&self) -> TypedTransaction
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TypedTransaction
impl Debug for TypedTransaction
source§impl Decodable for TypedTransaction
impl Decodable for TypedTransaction
Get a TypedTransaction directly from a rlp encoded byte stream
source§impl Default for TypedTransaction
impl Default for TypedTransaction
source§impl<'de> Deserialize<'de> for TypedTransaction
impl<'de> Deserialize<'de> for TypedTransaction
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<&Transaction> for TypedTransaction
impl From<&Transaction> for TypedTransaction
source§fn from(tx: &Transaction) -> TypedTransaction
fn from(tx: &Transaction) -> TypedTransaction
Converts to this type from the input type.
source§impl From<DepositTransaction> for TypedTransaction
impl From<DepositTransaction> for TypedTransaction
source§fn from(src: DepositTransaction) -> TypedTransaction
fn from(src: DepositTransaction) -> TypedTransaction
Converts to this type from the input type.
source§impl From<Eip1559TransactionRequest> for TypedTransaction
impl From<Eip1559TransactionRequest> for TypedTransaction
source§fn from(src: Eip1559TransactionRequest) -> TypedTransaction
fn from(src: Eip1559TransactionRequest) -> TypedTransaction
Converts to this type from the input type.
source§impl From<Eip2930TransactionRequest> for TypedTransaction
impl From<Eip2930TransactionRequest> for TypedTransaction
source§fn from(src: Eip2930TransactionRequest) -> TypedTransaction
fn from(src: Eip2930TransactionRequest) -> TypedTransaction
Converts to this type from the input type.
source§impl From<TransactionRequest> for TypedTransaction
impl From<TransactionRequest> for TypedTransaction
source§fn from(src: TransactionRequest) -> TypedTransaction
fn from(src: TransactionRequest) -> TypedTransaction
Converts to this type from the input type.
source§impl From<TypedTransaction> for Eip1559TransactionRequest
impl From<TypedTransaction> for Eip1559TransactionRequest
source§fn from(src: TypedTransaction) -> Eip1559TransactionRequest
fn from(src: TypedTransaction) -> Eip1559TransactionRequest
Converts to this type from the input type.
source§impl From<TypedTransaction> for Eip2930TransactionRequest
impl From<TypedTransaction> for Eip2930TransactionRequest
source§fn from(src: TypedTransaction) -> Eip2930TransactionRequest
fn from(src: TypedTransaction) -> Eip2930TransactionRequest
Converts to this type from the input type.
source§impl From<TypedTransaction> for TransactionRequest
impl From<TypedTransaction> for TransactionRequest
source§fn from(src: TypedTransaction) -> TransactionRequest
fn from(src: TypedTransaction) -> TransactionRequest
Converts to this type from the input type.
source§impl PartialEq for TypedTransaction
impl PartialEq for TypedTransaction
source§fn eq(&self, other: &TypedTransaction) -> bool
fn eq(&self, other: &TypedTransaction) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for TypedTransaction
impl Serialize for TypedTransaction
impl Eq for TypedTransaction
impl StructuralPartialEq for TypedTransaction
Auto Trait Implementations§
impl RefUnwindSafe for TypedTransaction
impl Send for TypedTransaction
impl Sync for TypedTransaction
impl Unpin for TypedTransaction
impl UnwindSafe for TypedTransaction
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
Mutably borrows from an owned value. Read more