Struct ClientBlockBuilder

Source
pub struct ClientBlockBuilder<'a> { /* private fields */ }
Available on crate feature client only.
Expand description

Builder of the block API

Implementations§

Source§

impl<'a> ClientBlockBuilder<'a>

Source

pub async fn prepare_transaction(&self) -> Result<PreparedTransactionData>

Prepare a transaction

Source

pub async fn sign_transaction( &self, prepared_transaction_data: PreparedTransactionData, ) -> Result<TransactionPayload>

Sign the transaction

Source§

impl<'a> ClientBlockBuilder<'a>

Source

pub fn new(client: &'a Client) -> Self

Create block builder

Source

pub fn with_burn(self, burn: impl Into<Option<Burn>>) -> Self

Sets explicit burning of aliases, nfts, foundries and native tokens.

Source

pub fn with_secret_manager(self, manager: &'a SecretManager) -> Self

Sets the seed.

Source

pub fn with_coin_type(self, coin_type: u32) -> Self

Sets the coin type.

Source

pub fn with_account_index(self, account_index: u32) -> Self

Sets the account index.

Source

pub fn with_initial_address_index(self, initial_address_index: u32) -> Self

Sets the index of the address to start looking for balance.

Source

pub fn with_input(self, input: UtxoInput) -> Result<Self>

Set a custom input(transaction output)

Source

pub fn with_input_range(self, range: Range<u32>) -> Self

Set a custom range in which to search for addresses for custom provided inputs. Default: 0..100

Source

pub async fn with_output( self, address: impl ConvertTo<Bech32Address>, amount: u64, ) -> Result<ClientBlockBuilder<'a>>

Set a transfer to the builder

Source

pub fn with_outputs( self, outputs: impl IntoIterator<Item = Output>, ) -> Result<Self>

Set outputs to the builder

Source

pub async fn with_output_hex( self, address: &str, amount: u64, ) -> Result<ClientBlockBuilder<'a>>

Set a transfer to the builder, address needs to be hex encoded

Source

pub fn with_custom_remainder_address( self, address: impl ConvertTo<Bech32Address>, ) -> Result<Self>

Set a custom remainder address

Source

pub fn with_tag(self, tag: impl Into<Option<Vec<u8>>>) -> Self

Set tagged_data to the builder

Source

pub fn with_data(self, data: impl Into<Option<Vec<u8>>>) -> Self

Set data to the builder

Source

pub fn with_parents( self, parent_ids: impl Into<Option<Vec<BlockId>>>, ) -> Result<Self>

Set 1-8 custom parent block ids

Source

pub async fn set_options( self, options: ClientBlockBuilderOptions, ) -> Result<ClientBlockBuilder<'a>>

Set multiple options from client block builder options type Useful for bindings

Source

pub async fn finish(self) -> Result<Block>

Consume the builder, post the block to the node and get the API result

Source

pub async fn finish_tagged_data(self) -> Result<Block>

Consume the builder and get the API result

Source

pub async fn finish_block(self, payload: Option<Payload>) -> Result<Block>

Builds the final block and posts it to the node

Auto Trait Implementations§

§

impl<'a> Freeze for ClientBlockBuilder<'a>

§

impl<'a> !RefUnwindSafe for ClientBlockBuilder<'a>

§

impl<'a> Send for ClientBlockBuilder<'a>

§

impl<'a> Sync for ClientBlockBuilder<'a>

§

impl<'a> Unpin for ClientBlockBuilder<'a>

§

impl<'a> !UnwindSafe for ClientBlockBuilder<'a>

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> ConvertTo<T> for T
where T: Send,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
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.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> Any for T
where T: Any,

Source§

impl<T> ErasedDestructor for T
where T: 'static,