[][src]Struct web3::types::TransactionParameters

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>,
}

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)

Trait Implementations

impl Clone for TransactionParameters[src]

impl Debug for TransactionParameters[src]

impl Default for TransactionParameters[src]

impl From<CallRequest> for TransactionParameters[src]

impl Into<CallRequest> for TransactionParameters[src]

impl PartialEq<TransactionParameters> for TransactionParameters[src]

impl StructuralPartialEq for TransactionParameters[src]

Auto Trait Implementations

impl RefUnwindSafe for TransactionParameters

impl Send for TransactionParameters

impl Sync for TransactionParameters

impl Unpin for TransactionParameters

impl UnwindSafe for TransactionParameters

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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