Struct iota_client::api::ClientBlockBuilder
source · [−]pub struct ClientBlockBuilder<'a> { /* private fields */ }Expand description
Builder of the block API
Implementations
sourceimpl<'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<Payload>
pub async fn sign_transaction(
&self,
prepared_transaction_data: PreparedTransactionData
) -> Result<Payload>
Sign the transaction
sourceimpl<'a> ClientBlockBuilder<'a>
impl<'a> ClientBlockBuilder<'a>
sourcepub fn with_burning_allowed(self, allow_burning: bool) -> Self
pub fn with_burning_allowed(self, allow_burning: bool) -> Self
Allow burning of native tokens when custom inputs are provided.
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 fn with_output(self, address: &str, amount: u64) -> Result<Self>
pub fn with_output(self, address: &str, amount: u64) -> Result<Self>
Set a transfer to the builder
sourcepub fn with_outputs(self, outputs: Vec<Output>) -> Result<Self>
pub fn with_outputs(self, outputs: Vec<Output>) -> Result<Self>
Set outputs to the builder
sourcepub fn with_output_hex(self, address: &str, amount: u64) -> Result<Self>
pub fn with_output_hex(self, address: &str, amount: u64) -> Result<Self>
Set a transfer to the builder, address needs to be hex encoded
sourcepub fn with_custom_remainder_address(self, address: &str) -> Result<Self>
pub fn with_custom_remainder_address(self, address: &str) -> Result<Self>
Set a custom remainder address
sourcepub fn with_parents(self, parent_ids: Vec<BlockId>) -> Result<Self>
pub fn with_parents(self, parent_ids: Vec<BlockId>) -> Result<Self>
Set 1-8 custom parent block ids
sourcepub fn set_options(self, options: ClientBlockBuilderOptions) -> Result<Self>
pub fn set_options(self, options: ClientBlockBuilderOptions) -> Result<Self>
Set multiple options from client block builder options type Useful for bindings
sourcepub fn get_output_amount_and_address(
output: &Output,
governance_transition: Option<HashSet<AliasId>>,
current_time: u32
) -> Result<(u64, Address)>
pub fn get_output_amount_and_address(
output: &Output,
governance_transition: Option<HashSet<AliasId>>,
current_time: u32
) -> Result<(u64, Address)>
Get output amount and address from an OutputDto, governance_transition for Alias Outputs so we get the unlock condition we’re interested in
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