From: Steve Myers Date: Tue, 18 Oct 2022 20:25:38 +0000 (-0500) Subject: Make psbt mod public and add required docs X-Git-Tag: v0.24.0-rc.1~5^2 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/enum.HexToArrayError.html?a=commitdiff_plain;h=34987d58ec9933af455e44d20c8d889bc896f869;p=bdk Make psbt mod public and add required docs --- diff --git a/src/lib.rs b/src/lib.rs index 65e35a72..56e8ea8d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -263,7 +263,7 @@ pub mod descriptor; #[cfg(feature = "test-md-docs")] mod doctest; pub mod keys; -pub(crate) mod psbt; +pub mod psbt; pub(crate) mod types; pub mod wallet; diff --git a/src/psbt/mod.rs b/src/psbt/mod.rs index f06b5297..b6119a44 100644 --- a/src/psbt/mod.rs +++ b/src/psbt/mod.rs @@ -9,11 +9,17 @@ // You may not use this file except in accordance with one or both of these // licenses. +//! Additional functions on the `rust-bitcoin` `PartiallySignedTransaction` structure. + use crate::FeeRate; use bitcoin::util::psbt::PartiallySignedTransaction as Psbt; use bitcoin::TxOut; +// TODO upstream the functions here to `rust-bitcoin`? + +/// Trait to add functions to extract utxos and calculate fees. pub trait PsbtUtils { + /// Get the `TxOut` for the specified input index, if it doesn't exist in the PSBT `None` is returned. fn get_utxo_for(&self, input_index: usize) -> Option; /// The total transaction fee amount, sum of input amounts minus sum of output amounts, in Sats.