pub struct TransactionRequest<State = Initial> { /* private fields */ }Expand description
A builder for constructing signed transactions ready for submission.
Follows a typestate pattern: start with TransactionRequest::new(), attach an
unsigned transaction with with_transaction(),
optionally add extra authorizations, then call build()
to seal and sign.
ⓘ
let tx = TransactionRequest::default()
.with_transaction(unsigned_tx)
.build(provider.wallet())
.await?;Implementations§
Source§impl TransactionRequest<Initial>
impl TransactionRequest<Initial>
pub fn new() -> Self
pub fn with_transaction( self, builder: UnsignedTransaction, ) -> TransactionRequest<WithTx>
Source§impl<State> TransactionRequest<State>
impl<State> TransactionRequest<State>
Source§impl TransactionRequest<WithTx>
impl TransactionRequest<WithTx>
Sourcepub fn build_unsealed(self) -> UnsealedTransaction
pub fn build_unsealed(self) -> UnsealedTransaction
The transaction with the caller’s authorizations attached, but unsealed. Only build can add
the seal signer’s own authorizations, since those commit to the key it seals with.
pub async fn build( self, seal_signer: &dyn TransactionSealSigner, ) -> WalletResult<Transaction>
Trait Implementations§
Source§impl<State: Clone> Clone for TransactionRequest<State>
impl<State: Clone> Clone for TransactionRequest<State>
Source§fn clone(&self) -> TransactionRequest<State>
fn clone(&self) -> TransactionRequest<State>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<State: Debug> Debug for TransactionRequest<State>
impl<State: Debug> Debug for TransactionRequest<State>
Source§impl<State: Default> Default for TransactionRequest<State>
impl<State: Default> Default for TransactionRequest<State>
Source§fn default() -> TransactionRequest<State>
fn default() -> TransactionRequest<State>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<State> Freeze for TransactionRequest<State>where
State: Freeze,
impl<State> RefUnwindSafe for TransactionRequest<State>where
State: RefUnwindSafe,
impl<State> Send for TransactionRequest<State>where
State: Send,
impl<State> Sync for TransactionRequest<State>where
State: Sync,
impl<State> Unpin for TransactionRequest<State>where
State: Unpin,
impl<State> UnsafeUnpin for TransactionRequest<State>where
State: UnsafeUnpin,
impl<State> UnwindSafe for TransactionRequest<State>where
State: UnwindSafe,
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,
impl<T> DebugAny for T
Source§impl<T, B> FromByteType<T> for Bwhere
T: ConvertFromByteType<B>,
impl<T, B> FromByteType<T> for Bwhere
T: ConvertFromByteType<B>,
type Error = <T as ConvertFromByteType<B>>::Error
fn try_from_byte_type(&self) -> Result<T, <B as FromByteType<T>>::Error>
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