You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: bdk-ffi/src/wallet.rs
+36-2Lines changed: 36 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -67,9 +67,43 @@ impl Wallet {
67
67
})
68
68
}
69
69
70
+
/// Build a new `Wallet` from a two-path descriptor.
71
+
///
72
+
/// This function parses a multipath descriptor with exactly 2 paths and creates a wallet using the existing receive and change wallet creation logic.
73
+
///
74
+
/// Multipath descriptors follow [BIP-389](https://github.com/bitcoin/bips/blob/master/bip-0389.mediawiki) and allow defining both receive and change derivation paths in a single descriptor using the <0;1> syntax.
75
+
///
76
+
/// If you have previously created a wallet, use load instead.
77
+
///
78
+
/// Returns an error if the descriptor is invalid or not a 2-path multipath descriptor.
79
+
#[uniffi::constructor(default(lookahead = 25))]
80
+
pubfncreate_from_two_path_descriptor(
81
+
two_path_descriptor:Arc<Descriptor>,
82
+
network:Network,
83
+
persister:Arc<Persister>,
84
+
lookahead:u32,
85
+
) -> Result<Self,CreateWithPersistError>{
86
+
let descriptor = two_path_descriptor.to_string_with_secret();
0 commit comments