Struct wallet::transaction::builder::TransactionBuilder
source · pub struct TransactionBuilder<P: Payload, SecretKey, WitnessData, Signature> {
settings: Settings,
payload: P,
validity: BlockDate,
outputs: Vec<Output<Address>>,
inputs: Vec<Input>,
witness_builders: Vec<Box<dyn WitnessBuilder<SecretKey, WitnessData, Signature>>>,
}
Fields§
§settings: Settings
§payload: P
§validity: BlockDate
§outputs: Vec<Output<Address>>
§inputs: Vec<Input>
§witness_builders: Vec<Box<dyn WitnessBuilder<SecretKey, WitnessData, Signature>>>
Implementations§
source§impl<P: Payload, SecretKey, WitnessData: AsRef<[u8]>, Signature> TransactionBuilder<P, SecretKey, WitnessData, Signature>
impl<P: Payload, SecretKey, WitnessData: AsRef<[u8]>, Signature> TransactionBuilder<P, SecretKey, WitnessData, Signature>
sourcepub fn new(settings: Settings, payload: P, validity: BlockDate) -> Self
pub fn new(settings: Settings, payload: P, validity: BlockDate) -> Self
create a new transaction builder with the given settings and outputs
pub fn inputs(&self) -> &[Input]
pub fn outputs(&self) -> &[Output<Address>]
pub fn inputs_value(&self) -> Value
pub fn outputs_value(&self) -> Value
pub fn estimate_fee_with(&self, extra_inputs: u8, extra_outputs: u8) -> Value
pub fn estimate_fee(&self) -> Value
pub fn add_input_if_worth<B: WitnessBuilder<SecretKey, WitnessData, Signature> + 'static>( &mut self, input: Input, witness_builder: B ) -> AddInputStatus
pub fn add_input<B: WitnessBuilder<SecretKey, WitnessData, Signature> + 'static>( &mut self, input: Input, witness_builder: B ) -> bool
pub fn add_output(&mut self, output: Output<Address>) -> bool
pub fn check_balance(&self) -> Balance
pub fn check_balance_with(&self, extra_inputs: u8, extra_outputs: u8) -> Balance
fn prepare_tx(&self) -> Result<TxBuilderState<SetWitnesses<P>>, Error>
pub fn get_sign_data(&self) -> Result<Vec<WitnessData>, Error>
pub fn finalize_tx( self, auth: <P as Payload>::Auth, witness_input: Vec<WitnessInput<SecretKey, Signature>> ) -> Result<Transaction<P>, Error>
fn set_validity( &self, builder: TxBuilderState<SetTtl<P>> ) -> TxBuilderState<SetIOs<P>>
fn set_ios( &self, builder: TxBuilderState<SetIOs<P>> ) -> TxBuilderState<SetWitnesses<P>>
fn set_witnesses( &self, builder: TxBuilderState<SetWitnesses<P>>, witness_input: Vec<WitnessInput<SecretKey, Signature>> ) -> Result<TxBuilderState<SetAuthData<P>>, Error>
Auto Trait Implementations§
impl<P, SecretKey, WitnessData, Signature> !RefUnwindSafe for TransactionBuilder<P, SecretKey, WitnessData, Signature>
impl<P, SecretKey, WitnessData, Signature> !Send for TransactionBuilder<P, SecretKey, WitnessData, Signature>
impl<P, SecretKey, WitnessData, Signature> !Sync for TransactionBuilder<P, SecretKey, WitnessData, Signature>
impl<P, SecretKey, WitnessData, Signature> Unpin for TransactionBuilder<P, SecretKey, WitnessData, Signature>where P: Unpin,
impl<P, SecretKey, WitnessData, Signature> !UnwindSafe for TransactionBuilder<P, SecretKey, WitnessData, Signature>
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