We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
from_unsigned_tx
1 parent 5168f34 commit 5dd6863Copy full SHA for 5dd6863
bdk-ffi/src/bitcoin.rs
@@ -484,6 +484,17 @@ impl Psbt {
484
Ok(Psbt(Mutex::new(psbt)))
485
}
486
487
+ /// Creates a PSBT from an unsigned transaction.
488
+ ///
489
+ /// # Errors
490
491
+ /// If transactions is not unsigned.
492
+ #[uniffi::constructor]
493
+ pub(crate) fn from_unsigned_tx(tx: Arc<Transaction>) -> Result<Arc<Psbt>, PsbtError> {
494
+ let psbt: BdkPsbt = BdkPsbt::from_unsigned_tx(tx.0.clone())?;
495
+ Ok(Arc::new(Psbt(Mutex::new(psbt))))
496
+ }
497
+
498
/// Serialize the PSBT into a base64-encoded string.
499
pub(crate) fn serialize(&self) -> String {
500
let psbt = self.0.lock().unwrap().clone();
0 commit comments