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§

Enums§