[][src]Struct ethers_core::types::TransactionRequest

pub struct TransactionRequest {
    pub from: Option<Address>,
    pub to: Option<NameOrAddress>,
    pub gas: Option<U256>,
    pub gas_price: Option<U256>,
    pub value: Option<U256>,
    pub data: Option<Bytes>,
    pub nonce: Option<U256>,
    pub fee_currency: Option<Address>,
    pub gateway_fee_recipient: Option<Address>,
    pub gateway_fee: Option<U256>,
}

Parameters for sending a transaction

Fields

from: Option<Address>

Sender address or ENS name

to: Option<NameOrAddress>

Recipient address (None for contract creation)

gas: Option<U256>

Supplied gas (None for sensible default)

gas_price: Option<U256>

Gas price (None for sensible default)

value: Option<U256>

Transfered value (None for no transfer)

data: Option<Bytes>

The compiled code of a contract OR the first 4 bytes of the hash of the invoked method signature and encoded parameters. For details see Ethereum Contract ABI

nonce: Option<U256>

Transaction nonce (None for next available nonce)

fee_currency: Option<Address>
This is supported on feature="celo" only.

The currency fees are paid in (None for native currency)

gateway_fee_recipient: Option<Address>
This is supported on feature="celo" only.

Gateway fee recipient (None for no gateway fee paid)

gateway_fee: Option<U256>
This is supported on feature="celo" only.

Gateway fee amount (None for no gateway fee paid)

Implementations

impl TransactionRequest[src]

pub fn new() -> Self[src]

Creates an empty transaction request with all fields left empty

pub fn pay<T: Into<NameOrAddress>, V: Into<U256>>(to: T, value: V) -> Self[src]

Convenience function for sending a new payment transaction to the receiver.

pub fn from<T: Into<Address>>(self, from: T) -> Self[src]

Sets the from field in the transaction to the provided value

pub fn send_to_str(self, to: &str) -> Result<Self, FromHexError>[src]

Sets the to field in the transaction to the provided value

pub fn to<T: Into<NameOrAddress>>(self, to: T) -> Self[src]

Sets the to field in the transaction to the provided value

pub fn gas<T: Into<U256>>(self, gas: T) -> Self[src]

Sets the gas field in the transaction to the provided value

pub fn gas_price<T: Into<U256>>(self, gas_price: T) -> Self[src]

Sets the gas_price field in the transaction to the provided value

pub fn value<T: Into<U256>>(self, value: T) -> Self[src]

Sets the value field in the transaction to the provided value

pub fn data<T: Into<Bytes>>(self, data: T) -> Self[src]

Sets the data field in the transaction to the provided value

pub fn nonce<T: Into<U256>>(self, nonce: T) -> Self[src]

Sets the nonce field in the transaction to the provided value

pub fn sighash<T: Into<U64>>(&self, chain_id: Option<T>) -> H256[src]

Hashes the transaction's data with the provided chain id

pub fn rlp_signed(&self, signature: &Signature) -> Bytes[src]

Produces the RLP encoding of the transaction with the provided signature

impl TransactionRequest[src]

pub fn fee_currency<T: Into<Address>>(self, fee_currency: T) -> Self[src]

This is supported on feature="celo" only.

Sets the fee_currency field in the transaction to the provided value

pub fn gateway_fee<T: Into<U256>>(self, gateway_fee: T) -> Self[src]

This is supported on feature="celo" only.

Sets the gateway_fee field in the transaction to the provided value

pub fn gateway_fee_recipient<T: Into<Address>>(
    self,
    gateway_fee_recipient: T
) -> Self
[src]

This is supported on feature="celo" only.

Sets the gateway_fee_recipient field in the transaction to the provided value

Trait Implementations

impl Clone for TransactionRequest[src]

impl Debug for TransactionRequest[src]

impl Default for TransactionRequest[src]

impl<'de> Deserialize<'de> for TransactionRequest[src]

impl Eq for TransactionRequest[src]

impl PartialEq<TransactionRequest> for TransactionRequest[src]

impl Serialize for TransactionRequest[src]

impl StructuralEq for TransactionRequest[src]

impl StructuralPartialEq for TransactionRequest[src]

Auto Trait Implementations

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> 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>,