Enum ethers_core::types::transaction::eip2718::TypedTransaction
source · [−]pub enum TypedTransaction {
Legacy(TransactionRequest),
Eip2930(Eip2930TransactionRequest),
Eip1559(Eip1559TransactionRequest),
}
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)
Implementations
sourceimpl 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 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
sourceimpl 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_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>
Trait Implementations
sourceimpl Clone for TypedTransaction
impl Clone for TypedTransaction
sourcefn clone(&self) -> TypedTransaction
fn clone(&self) -> TypedTransaction
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for TypedTransaction
impl Debug for TypedTransaction
sourceimpl Decodable for TypedTransaction
impl Decodable for TypedTransaction
Get a TypedTransaction directly from a rlp encoded byte stream
sourcefn decode(rlp: &Rlp<'_>) -> Result<Self, DecoderError>
fn decode(rlp: &Rlp<'_>) -> Result<Self, DecoderError>
Decode a value from RLP bytes
sourceimpl Default for TypedTransaction
impl Default for TypedTransaction
sourceimpl<'de> Deserialize<'de> for TypedTransaction
impl<'de> Deserialize<'de> for TypedTransaction
sourcefn 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
sourceimpl From<&Transaction> for TypedTransaction
impl From<&Transaction> for TypedTransaction
sourcefn from(tx: &Transaction) -> TypedTransaction
fn from(tx: &Transaction) -> TypedTransaction
Converts to this type from the input type.
sourceimpl From<Eip1559TransactionRequest> for TypedTransaction
impl From<Eip1559TransactionRequest> for TypedTransaction
sourcefn from(src: Eip1559TransactionRequest) -> TypedTransaction
fn from(src: Eip1559TransactionRequest) -> TypedTransaction
Converts to this type from the input type.
sourceimpl From<Eip2930TransactionRequest> for TypedTransaction
impl From<Eip2930TransactionRequest> for TypedTransaction
sourcefn from(src: Eip2930TransactionRequest) -> TypedTransaction
fn from(src: Eip2930TransactionRequest) -> TypedTransaction
Converts to this type from the input type.
sourceimpl From<TransactionRequest> for TypedTransaction
impl From<TransactionRequest> for TypedTransaction
sourcefn from(src: TransactionRequest) -> TypedTransaction
fn from(src: TransactionRequest) -> TypedTransaction
Converts to this type from the input type.
sourceimpl From<TypedTransaction> for Eip1559TransactionRequest
impl From<TypedTransaction> for Eip1559TransactionRequest
sourcefn from(src: TypedTransaction) -> Eip1559TransactionRequest
fn from(src: TypedTransaction) -> Eip1559TransactionRequest
Converts to this type from the input type.
sourceimpl From<TypedTransaction> for Eip2930TransactionRequest
impl From<TypedTransaction> for Eip2930TransactionRequest
sourcefn from(src: TypedTransaction) -> Eip2930TransactionRequest
fn from(src: TypedTransaction) -> Eip2930TransactionRequest
Converts to this type from the input type.
sourceimpl From<TypedTransaction> for TransactionRequest
impl From<TypedTransaction> for TransactionRequest
sourcefn from(src: TypedTransaction) -> TransactionRequest
fn from(src: TypedTransaction) -> TransactionRequest
Converts to this type from the input type.
sourceimpl PartialEq<TypedTransaction> for TypedTransaction
impl PartialEq<TypedTransaction> for TypedTransaction
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &TypedTransaction) -> bool
fn ne(&self, other: &TypedTransaction) -> bool
This method tests for !=
.
sourceimpl Serialize for TypedTransaction
impl Serialize for TypedTransaction
impl Eq for TypedTransaction
impl StructuralEq 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more