pub struct TransactionParameters {
pub nonce: Option<U256>,
pub to: Option<Address>,
pub gas: U256,
pub gas_price: Option<U256>,
pub value: U256,
pub data: Bytes,
pub chain_id: Option<u64>,
pub transaction_type: Option<U64>,
pub access_list: Option<AccessList>,
pub max_fee_per_gas: Option<U256>,
pub max_priority_fee_per_gas: Option<U256>,
}
Expand description
Transaction data for signing.
The Accounts::sign_transaction
method will fill optional fields with sane
defaults when they are omitted. Specifically the signing account’s current
transaction count will be used for the nonce
, the estimated recommended
gas price will be used for gas_price
, and the current network ID will be
used for the chain_id
.
It is worth noting that the chain ID is not equivalent to the network ID. They happen to be the same much of the time but it is recommended to set this for signing transactions.
TransactionParameters
implements Default
and uses 100_000
as the
default gas
to use for the transaction. This is more than enough for
simple transactions sending ETH between accounts but may not be enough when
interacting with complex contracts. It is recommended when interacting
with contracts to use Eth::estimate_gas
to estimate the required gas for
the transaction.
Fields§
§nonce: Option<U256>
Transaction nonce (None for account transaction count)
to: Option<Address>
To address
gas: U256
Supplied gas
gas_price: Option<U256>
Gas price (None for estimated gas price)
value: U256
Transferred value
data: Bytes
Data
chain_id: Option<u64>
The chain ID (None for network ID)
transaction_type: Option<U64>
Transaction type, Some(1) for AccessList transaction, None for Legacy
access_list: Option<AccessList>
Access list
max_fee_per_gas: Option<U256>
Max fee per gas
max_priority_fee_per_gas: Option<U256>
miner bribe
Trait Implementations§
Source§impl Clone for TransactionParameters
impl Clone for TransactionParameters
Source§fn clone(&self) -> TransactionParameters
fn clone(&self) -> TransactionParameters
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more