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
Auto Trait Implementations§
impl<'a> Freeze for ClientMessageBuilder<'a>
impl<'a> !RefUnwindSafe for ClientMessageBuilder<'a>
impl<'a> Send for ClientMessageBuilder<'a>
impl<'a> Sync for ClientMessageBuilder<'a>
impl<'a> Unpin for ClientMessageBuilder<'a>
impl<'a> !UnwindSafe for ClientMessageBuilder<'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
Mutably borrows from an owned value. Read more