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(), Amount::from_sat(50_000))
// With a custom fee rate of 5.0 satoshi/vbyte
.fee_rate(FeeRate::from_sat_per_vb(5).expect("valid feerate"))
// Only spend non-change outputs
.do_not_spend_change();
let psbt = tx_builder.finish()?;
Structs§
- A transaction builder
Enums§
- Error returned from
TxBuilder::add_foreign_utxo
. - Error returned from
TxBuilder::add_utxo
andTxBuilder::add_utxos
- Policy regarding the use of change outputs when creating a transaction
- Ordering of the transaction’s inputs and outputs