Module bdk::wallet::tx_builder
source · [−]Expand description
Transaction builder
Example
// create a TxBuilder from a wallet
let mut tx_builder = wallet.build_tx();
tx_builder
// Create a transaction with one output to `to_address` of 50_000 satoshi
.add_recipient(to_address.script_pubkey(), 50_000)
// With a custom fee rate of 5.0 satoshi/vbyte
.fee_rate(FeeRate::from_sat_per_vb(5.0))
// Only spend non-change outputs
.do_not_spend_change()
// Turn on RBF signaling
.enable_rbf();
let (psbt, tx_details) = tx_builder.finish()?;
Structs
Marker type to indicate the TxBuilder
is being used to bump the fee of an existing transaction.
Marker type to indicate the TxBuilder
is being used to create a new transaction (as opposed
to bumping the fee of an existing one).
A transaction builder
Enums
Policy regarding the use of change outputs when creating a transaction
Ordering of the transaction’s inputs and outputs
Traits
Context in which the TxBuilder
is valid