Struct iota_client::api::ClientMessageBuilder
source · pub struct ClientMessageBuilder<'a> { /* private fields */ }
Expand description
Builder of the message API
Implementations§
source§impl<'a> ClientMessageBuilder<'a>
impl<'a> ClientMessageBuilder<'a>
sourcepub fn with_account_index(self, account_index: usize) -> Self
pub fn with_account_index(self, account_index: usize) -> Self
Sets the account index.
sourcepub fn with_initial_address_index(self, initial_address_index: usize) -> Self
pub fn with_initial_address_index(self, initial_address_index: usize) -> Self
Sets the index of the address to start looking for balance.
sourcepub fn with_input(self, input: UtxoInput) -> Self
pub fn with_input(self, input: UtxoInput) -> Self
Set a custom input(transaction output)
sourcepub fn with_input_range(self, range: Range<usize>) -> Self
pub fn with_input_range(self, range: Range<usize>) -> 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_dust_allowance_output(
self,
address: &str,
amount: u64
) -> Result<Self>
pub fn with_dust_allowance_output( self, address: &str, amount: u64 ) -> Result<Self>
Set a dust allowance transfer to the builder, address needs to be Bech32 encoded
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_index<I: AsRef<[u8]>>(self, index: I) -> Self
pub fn with_index<I: AsRef<[u8]>>(self, index: I) -> Self
Set indexation to the builder
sourcepub fn with_parents(self, parent_ids: Vec<MessageId>) -> Result<Self>
pub fn with_parents(self, parent_ids: Vec<MessageId>) -> Result<Self>
Set 1-8 custom parent message ids
sourcepub fn get_output_amount_and_address(
output: &OutputDto
) -> Result<(u64, Address, bool)>
pub fn get_output_amount_and_address( output: &OutputDto ) -> Result<(u64, Address, bool)>
Get output amount and address from an OutputDto (bool true == SignatureLockedSingle, false == SignatureLockedDustAllowance)
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,
seed: Option<&'a Seed>,
inputs_range: Option<Range<usize>>
) -> Result<Payload>
pub async fn sign_transaction( &self, prepared_transaction_data: PreparedTransactionData, seed: Option<&'a Seed>, inputs_range: Option<Range<usize>> ) -> Result<Payload>
Sign the transaction
sourcepub async fn finish_indexation(self) -> Result<Message>
pub async fn finish_indexation(self) -> Result<Message>
Consume the builder and get the API result