Struct ethers_iqkms::types::Transaction
source · [−]pub struct Transaction {Show 20 fields
pub hash: H256,
pub nonce: U256,
pub block_hash: Option<H256>,
pub block_number: Option<U64>,
pub transaction_index: Option<U64>,
pub from: H160,
pub to: Option<H160>,
pub value: U256,
pub gas_price: Option<U256>,
pub gas: U256,
pub input: Bytes,
pub v: U64,
pub r: U256,
pub s: U256,
pub transaction_type: Option<U64>,
pub access_list: Option<AccessList>,
pub max_priority_fee_per_gas: Option<U256>,
pub max_fee_per_gas: Option<U256>,
pub chain_id: Option<U256>,
pub other: OtherFields,
}Expand description
Details of a signed transaction
Fields
hash: H256The transaction’s hash
nonce: U256The transaction’s nonce
block_hash: Option<H256>Block hash. None when pending.
block_number: Option<U64>Block number. None when pending.
transaction_index: Option<U64>Transaction Index. None when pending.
from: H160Sender
to: Option<H160>Recipient (None when contract creation)
value: U256Transferred value
gas_price: Option<U256>Gas Price, null for Type 2 transactions
gas: U256Gas amount
input: BytesInput data
v: U64ECDSA recovery id
r: U256ECDSA signature r
s: U256ECDSA signature s
transaction_type: Option<U64>Transaction type, Some(2) for EIP-1559 transaction, Some(1) for AccessList transaction, None for Legacy
access_list: Option<AccessList>max_priority_fee_per_gas: Option<U256>Represents the maximum tx fee that will go to the miner as part of the user’s fee payment. It serves 3 purposes:
- Compensates miners for the uncle/ommer risk + fixed costs of including transaction in a block; 2. Allows users with high opportunity costs to pay a premium to miners;
- In times where demand exceeds the available block space (i.e. 100% full, 30mm gas), this component allows first price auctions (i.e. the pre-1559 fee model) to happen on the priority fee.
More context here
max_fee_per_gas: Option<U256>Represents the maximum amount that a user is willing to pay for their tx (inclusive of baseFeePerGas and maxPriorityFeePerGas). The difference between maxFeePerGas and baseFeePerGas + maxPriorityFeePerGas is “refunded” to the user.
chain_id: Option<U256>other: OtherFieldsCaptures unknown fields such as additional fields used by L2s
Implementations
sourceimpl Transaction
impl Transaction
pub fn hash(&self) -> H256
pub fn rlp(&self) -> Bytes
sourcepub fn recover_from(&self) -> Result<H160, SignatureError>
pub fn recover_from(&self) -> Result<H160, SignatureError>
Recover the sender of the tx from signature
sourcepub fn recover_from_mut(&mut self) -> Result<H160, SignatureError>
pub fn recover_from_mut(&mut self) -> Result<H160, SignatureError>
Recover the sender of the tx from signature and set the from field
Trait Implementations
sourceimpl Clone for Transaction
impl Clone for Transaction
sourcefn clone(&self) -> Transaction
fn clone(&self) -> Transaction
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source. Read moresourceimpl Debug for Transaction
impl Debug for Transaction
sourceimpl Decodable for Transaction
impl Decodable for Transaction
Get a Transaction directly from a rlp encoded byte stream
sourcefn decode(rlp: &Rlp<'_>) -> Result<Transaction, DecoderError>
fn decode(rlp: &Rlp<'_>) -> Result<Transaction, DecoderError>
sourceimpl Default for Transaction
impl Default for Transaction
sourcefn default() -> Transaction
fn default() -> Transaction
sourceimpl<'de> Deserialize<'de> for Transaction
impl<'de> Deserialize<'de> for Transaction
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<Transaction, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Transaction, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
sourceimpl From<&Transaction> for Eip1559TransactionRequest
impl From<&Transaction> for Eip1559TransactionRequest
sourcefn from(tx: &Transaction) -> Eip1559TransactionRequest
fn from(tx: &Transaction) -> Eip1559TransactionRequest
sourceimpl From<&Transaction> for Eip2930TransactionRequest
impl From<&Transaction> for Eip2930TransactionRequest
sourcefn from(tx: &Transaction) -> Eip2930TransactionRequest
fn from(tx: &Transaction) -> Eip2930TransactionRequest
sourceimpl From<&Transaction> for TransactionRequest
impl From<&Transaction> for TransactionRequest
sourcefn from(tx: &Transaction) -> TransactionRequest
fn from(tx: &Transaction) -> TransactionRequest
sourceimpl From<&Transaction> for TypedTransaction
impl From<&Transaction> for TypedTransaction
sourcefn from(tx: &Transaction) -> TypedTransaction
fn from(tx: &Transaction) -> TypedTransaction
sourceimpl PartialEq<Transaction> for Transaction
impl PartialEq<Transaction> for Transaction
sourcefn eq(&self, other: &Transaction) -> bool
fn eq(&self, other: &Transaction) -> bool
sourceimpl Serialize for Transaction
impl Serialize for Transaction
sourcefn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for Transaction
impl StructuralEq for Transaction
impl StructuralPartialEq for Transaction
Auto Trait Implementations
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnwindSafe for Transaction
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request