[][src]Struct ethcontract::transaction::TransactionBuilder

#[must_use =
  "transactions do nothing unless you `.build()` or `.send()` them"]pub struct TransactionBuilder<T: Transport> {
    pub from: Option<Account>,
    pub to: Option<Address>,
    pub gas: Option<U256>,
    pub gas_price: Option<GasPrice>,
    pub value: Option<U256>,
    pub data: Option<Bytes>,
    pub nonce: Option<U256>,
    pub resolve: Option<ResolveCondition>,
    // some fields omitted
}

Data used for building a transaction that modifies the blockchain. These transactions can either be sent to be signed locally by the node or can be signed offline.

Fields

from: Option<Account>

The sender of the transaction with the signing strategy to use. Defaults to locally signing on the node with the default acount.

to: Option<Address>

The receiver of the transaction.

gas: Option<U256>

Optional gas amount to use for transaction. Defaults to estimated gas.

gas_price: Option<GasPrice>

Optional gas price to use for transaction. Defaults to estimated gas price from the node (i.e. GasPrice::Standard).

value: Option<U256>

The ETH value to send with the transaction. Defaults to 0.

data: Option<Bytes>

The data for the transaction. Defaults to empty data.

nonce: Option<U256>

Optional nonce to use. Defaults to the signing account's current transaction count.

resolve: Option<ResolveCondition>

Optional resolve conditions. Defaults to waiting the transaction to be mined without any extra confirmation blocks.

Methods

impl<T: Transport> TransactionBuilder<T>[src]

pub fn new(web3: Web3<T>) -> Self[src]

Creates a new builder for a transaction.

pub fn from(self, value: Account) -> Self[src]

Specify the signing method to use for the transaction, if not specified the the transaction will be locally signed with the default user.

pub fn to(self, value: Address) -> Self[src]

Specify the recepient of the transaction, if not specified the transaction will be sent to the 0 address (for deploying contracts).

pub fn gas(self, value: U256) -> Self[src]

Secify amount of gas to use, if not specified then a gas estimate will be used.

pub fn gas_price(self, value: GasPrice) -> Self[src]

Specify the gas price to use, if not specified then the estimated gas price will be used.

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

Specify what how much ETH to transfer with the transaction, if not specified then no ETH will be sent.

pub fn data(self, value: Bytes) -> Self[src]

Specify the data to use for the transaction, if not specified, then empty data will be used.

pub fn nonce(self, value: U256) -> Self[src]

Specify the nonce for the transation, if not specified will use the current transaction count for the signing account.

pub fn resolve(self, value: ResolveCondition) -> Self[src]

Specify the resolve condition, if not specified will default to waiting for the transaction to be mined (but not confirmed by any extra blocks).

pub fn confirmations(self, value: usize) -> Self[src]

Specify the number of confirmations to use for the confirmation options. This is a utility method for specifying the resolve condition.

pub fn estimate_gas(self) -> EstimateGasFuture<T>[src]

Estimate the gas required for this transaction.

pub fn build(self) -> BuildFuture<T>[src]

Build a prepared transaction that is ready to send.

pub fn send(self) -> SendFuture<T>[src]

Sign (if required) and send the transaction. Returns the transaction hash that can be used to retrieve transaction information.

Trait Implementations

impl<T: Clone + Transport> Clone for TransactionBuilder<T>[src]

impl<T: Debug + Transport> Debug for TransactionBuilder<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for TransactionBuilder<T> where
    T: RefUnwindSafe

impl<T> Send for TransactionBuilder<T> where
    T: Send

impl<T> Sync for TransactionBuilder<T> where
    T: Sync

impl<T> Unpin for TransactionBuilder<T> where
    T: Unpin

impl<T> UnwindSafe for TransactionBuilder<T> where
    T: UnwindSafe

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, U> Into<U> for T where
    U: From<T>, 
[src]

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<T> Typeable for T where
    T: Any

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