TransactionBuilder

Struct TransactionBuilder 

pub struct TransactionBuilder<T> { /* private fields */ }
Expand description

Helper to build transactions

Implementations§

§

impl TransactionBuilder<CommonTransactionData>

pub const fn with_nonce( self, nonce: u64, ) -> TransactionBuilder<CommonTransactionData>

Add a nonce to the transaction

pub const fn with_epoch( self, epoch: u64, ) -> TransactionBuilder<CommonTransactionData>

Add an epoch to the transaction

pub const fn with_fee( self, fee: TransactionFee, ) -> TransactionBuilder<CommonTransactionData>

Add a fee to the transaction

pub const fn with_fee_tip( self, tip: u64, ) -> TransactionBuilder<CommonTransactionData>

Add a fee tip in plancks to the transaction

pub fn with_tx<T>( self, tx_data: T, ) -> TransactionBuilder<Transaction<<T as IntoToplevel>::Toplevel>>
where T: IntoToplevel,

Add actual transaction data to the transaction

§

impl<T> TransactionBuilder<Transaction<T>>
where T: TransactionType,

pub fn build(self) -> Transaction<T>

Consume builder and return the built transaction

pub fn sign_with_ed25519( self, signer: &PrivKey, ) -> Result<SignedTransaction<T>, SignError>

Consumes this builder, creates and signs a SignedTransaction with an ed25519 signature.

Trait Implementations§

§

impl<T> Debug for TransactionBuilder<T>
where T: Debug,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<T> Default for TransactionBuilder<T>
where T: Default,

§

fn default() -> TransactionBuilder<T>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<T> Freeze for TransactionBuilder<T>
where T: Freeze,

§

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§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more