pub struct ClientBlockBuilder<'a> { /* private fields */ }
client
only.Expand description
Builder of the block API
Implementations§
Source§impl<'a> ClientBlockBuilder<'a>
impl<'a> ClientBlockBuilder<'a>
Sourcepub async fn prepare_transaction(&self) -> Result<PreparedTransactionData>
pub async fn prepare_transaction(&self) -> Result<PreparedTransactionData>
Prepare a transaction
Sourcepub async fn sign_transaction(
&self,
prepared_transaction_data: PreparedTransactionData,
) -> Result<TransactionPayload>
pub async fn sign_transaction( &self, prepared_transaction_data: PreparedTransactionData, ) -> Result<TransactionPayload>
Sign the transaction
Source§impl<'a> ClientBlockBuilder<'a>
impl<'a> ClientBlockBuilder<'a>
Sourcepub fn with_burn(self, burn: impl Into<Option<Burn>>) -> Self
pub fn with_burn(self, burn: impl Into<Option<Burn>>) -> Self
Sets explicit burning of aliases, nfts, foundries and native tokens.
Sourcepub fn with_secret_manager(self, manager: &'a SecretManager) -> Self
pub fn with_secret_manager(self, manager: &'a SecretManager) -> Self
Sets the seed.
Sourcepub fn with_coin_type(self, coin_type: u32) -> Self
pub fn with_coin_type(self, coin_type: u32) -> Self
Sets the coin type.
Sourcepub fn with_account_index(self, account_index: u32) -> Self
pub fn with_account_index(self, account_index: u32) -> Self
Sets the account index.
Sourcepub fn with_initial_address_index(self, initial_address_index: u32) -> Self
pub fn with_initial_address_index(self, initial_address_index: u32) -> Self
Sets the index of the address to start looking for balance.
Sourcepub fn with_input(self, input: UtxoInput) -> Result<Self>
pub fn with_input(self, input: UtxoInput) -> Result<Self>
Set a custom input(transaction output)
Sourcepub fn with_input_range(self, range: Range<u32>) -> Self
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
Sourcepub async fn with_output(
self,
address: impl ConvertTo<Bech32Address>,
amount: u64,
) -> Result<ClientBlockBuilder<'a>>
pub async fn with_output( self, address: impl ConvertTo<Bech32Address>, amount: u64, ) -> Result<ClientBlockBuilder<'a>>
Set a transfer to the builder
Sourcepub fn with_outputs(
self,
outputs: impl IntoIterator<Item = Output>,
) -> Result<Self>
pub fn with_outputs( self, outputs: impl IntoIterator<Item = Output>, ) -> Result<Self>
Set outputs to the builder
Sourcepub async fn with_output_hex(
self,
address: &str,
amount: u64,
) -> Result<ClientBlockBuilder<'a>>
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
Sourcepub fn with_custom_remainder_address(
self,
address: impl ConvertTo<Bech32Address>,
) -> Result<Self>
pub fn with_custom_remainder_address( self, address: impl ConvertTo<Bech32Address>, ) -> Result<Self>
Set a custom remainder address
Sourcepub fn with_parents(
self,
parent_ids: impl Into<Option<Vec<BlockId>>>,
) -> Result<Self>
pub fn with_parents( self, parent_ids: impl Into<Option<Vec<BlockId>>>, ) -> Result<Self>
Set 1-8 custom parent block ids
Sourcepub async fn set_options(
self,
options: ClientBlockBuilderOptions,
) -> Result<ClientBlockBuilder<'a>>
pub async fn set_options( self, options: ClientBlockBuilderOptions, ) -> Result<ClientBlockBuilder<'a>>
Set multiple options from client block builder options type Useful for bindings
Sourcepub async fn finish(self) -> Result<Block>
pub async fn finish(self) -> Result<Block>
Consume the builder, post the block to the node and get the API result
Sourcepub async fn finish_tagged_data(self) -> Result<Block>
pub async fn finish_tagged_data(self) -> Result<Block>
Consume the builder and get the API result
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> 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
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>
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>
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