Skip to content

Commit f38a7fc

Browse files
committed
docs(psbt): Document PsbtParams members
1 parent 6b039f4 commit f38a7fc

1 file changed

Lines changed: 25 additions & 11 deletions

File tree

src/psbt/params.rs

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,39 +30,53 @@ pub type Rbf = ReplaceTx;
3030
/// Parameters to create a PSBT.
3131
#[derive(Debug)]
3232
pub struct PsbtParams<C> {
33-
// Inputs
33+
/// Set of selected UTXO outpoints.
3434
pub(crate) set: HashSet<OutPoint>,
35+
/// List of UTXO outpoints to spend.
3536
pub(crate) utxos: Vec<OutPoint>,
37+
/// List of planned transaction [`Input`]s.
3638
pub(crate) inputs: Vec<Input>,
37-
38-
// Outputs
39+
/// List of recipient script/amount pairs.
3940
pub(crate) recipients: Vec<(ScriptBuf, Amount)>,
41+
/// Optional script or descriptor designated for change.
4042
pub(crate) change_script: Option<ScriptSource>,
41-
42-
// Coin Selection
43+
/// Optional assets for creating a spend plan.
4344
pub(crate) assets: Option<Assets>,
45+
/// Fee targeting strategy.
4446
pub(crate) fee_strategy: FeeStrategy,
47+
/// Policy for creating change outputs.
4548
pub(crate) change_policy: ChangePolicy,
49+
/// Whether to spend all available coins.
4650
pub(crate) drain_wallet: bool,
51+
/// Coin selection strategy to use.
4752
pub(crate) coin_selection: SelectionStrategy,
53+
/// Parameters for transaction canonicalization.
4854
pub(crate) canonical_params: CanonicalizationParams,
55+
/// UTXO filtering function.
4956
pub(crate) utxo_filter: UtxoFilter,
57+
/// Optional height for evaluating coinbase maturity.
5058
pub(crate) maturity_height: Option<u32>,
59+
/// Only allow spending UTXOs which are selected manually.
5160
pub(crate) manually_selected_only: bool,
52-
53-
// PSBT
61+
/// Optional transaction [`Version`].
5462
pub(crate) version: Option<Version>,
63+
/// Optional transaction [`LockTime`](absolute::LockTime).
5564
pub(crate) locktime: Option<absolute::LockTime>,
65+
/// Optional fallback [`Sequence`] for inputs.
5666
pub(crate) fallback_sequence: Option<Sequence>,
67+
/// Ordering of the transaction's inputs and outputs.
5768
pub(crate) ordering: TxOrdering<Input, Output>,
69+
/// Only set the [`witness_utxo`](bitcoin::psbt::Input::witness_utxo) in PSBT inputs. This
70+
/// allows opting out of setting the
71+
/// [`non_witness_utxo`](bitcoin::psbt::Input::non_witness_utxo).
5872
pub(crate) only_witness_utxo: bool,
73+
/// Optional PSBT sighash type.
5974
pub(crate) sighash_type: Option<PsbtSighashType>,
75+
/// Whether to try filling in the PSBT global xpubs from the wallet's descriptors.
6076
pub(crate) add_global_xpubs: bool,
61-
62-
// RBF
77+
/// Set of txids being replaced if this is a RBF transaction.
6378
pub(crate) replace: HashSet<Txid>,
64-
65-
/// Context marker.
79+
/// The context in which the params are used.
6680
pub(crate) marker: core::marker::PhantomData<C>,
6781
}
6882

0 commit comments

Comments
 (0)