pub struct TransactionBuilder { /* private fields */ }
Expand description
Transaction builder allows to create and prepare transactions with minimal developers efforts.
Implementations§
Source§impl TransactionBuilder
impl TransactionBuilder
Sourcepub const fn depends_on(self, depends_on: U256) -> Self
pub const fn depends_on(self, depends_on: U256) -> Self
Mark a transaction as dependent on another one.
Sourcepub const fn gas_price_coef(self, gas_price_coef: u8) -> Self
pub const fn gas_price_coef(self, gas_price_coef: u8) -> Self
Set gas price coefficient for transaction.
Sourcepub const fn expiration(self, expiration: u32) -> Self
pub const fn expiration(self, expiration: u32) -> Self
Set expiration for transaction in blocks, starting from block_ref
.
Sourcepub const fn block_ref(self, block_ref: u64) -> Self
pub const fn block_ref(self, block_ref: u64) -> Self
Set block_ref for transaction to count expiration
from.
Sourcepub fn add_transfer<T: Into<U256>>(self, recipient: Address, value: T) -> Self
pub fn add_transfer<T: Into<U256>>(self, recipient: Address, value: T) -> Self
Add a simple transfer to clauses.
Sourcepub fn add_contract_create(self, contract_bytes: Bytes) -> Self
pub fn add_contract_create(self, contract_bytes: Bytes) -> Self
Add a contract creation clause.
Sourcepub fn add_contract_call(
self,
contract_address: Address,
call_bytes: Bytes,
) -> Self
pub fn add_contract_call( self, contract_address: Address, call_bytes: Bytes, ) -> Self
Add a contract method call clause.
Sourcepub fn add_clause(self, clause: Clause) -> Self
pub fn add_clause(self, clause: Clause) -> Self
Add an arbitrary, user-provided clause.
Sourcepub async fn build(&self) -> Result<Transaction, TransactionBuilderError>
pub async fn build(&self) -> Result<Transaction, TransactionBuilderError>
Prepare a Transaction
. This may perform a network request
to identify appropriate parameters.
Trait Implementations§
Source§impl Clone for TransactionBuilder
impl Clone for TransactionBuilder
Source§fn clone(&self) -> TransactionBuilder
fn clone(&self) -> TransactionBuilder
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for TransactionBuilder
impl RefUnwindSafe for TransactionBuilder
impl Send for TransactionBuilder
impl Sync for TransactionBuilder
impl Unpin for TransactionBuilder
impl UnwindSafe for TransactionBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more