diff --git a/bdk-ffi/src/bdk.udl b/bdk-ffi/src/bdk.udl index 3a34b85f..89eaeca6 100644 --- a/bdk-ffi/src/bdk.udl +++ b/bdk-ffi/src/bdk.udl @@ -405,6 +405,9 @@ interface Wallet { [Throws=SignerError] boolean sign(Psbt psbt); + [Throws=SignerError] + boolean finalize_psbt(Psbt psbt); + SentAndReceivedValues sent_and_received([ByRef] Transaction tx); sequence transactions(); diff --git a/bdk-ffi/src/wallet.rs b/bdk-ffi/src/wallet.rs index 16409a1d..bdb506d0 100644 --- a/bdk-ffi/src/wallet.rs +++ b/bdk-ffi/src/wallet.rs @@ -144,6 +144,13 @@ impl Wallet { .map_err(SignerError::from) } + pub fn finalize_psbt(&self, psbt: Arc) -> Result { + let mut psbt = psbt.0.lock().unwrap(); + self.get_wallet() + .finalize_psbt(&mut psbt, SignOptions::default()) + .map_err(SignerError::from) + } + pub fn sent_and_received(&self, tx: &Transaction) -> SentAndReceivedValues { let (sent, received) = self.get_wallet().sent_and_received(&tx.into()); SentAndReceivedValues {