Added generate_mnemonic method
This commit is contained in:
parent
973013cbdf
commit
930a1f1eb4
@ -1,4 +1,7 @@
|
|||||||
namespace bdk {};
|
namespace bdk {
|
||||||
|
[Throws=BdkError]
|
||||||
|
string generate_mnemonic(WordCount word_count);
|
||||||
|
};
|
||||||
|
|
||||||
[Error]
|
[Error]
|
||||||
enum BdkError {
|
enum BdkError {
|
||||||
|
@ -627,6 +627,12 @@ impl BumpFeeTxBuilder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn generate_mnemonic(word_count: WordCount) -> Result<String, BdkError> {
|
||||||
|
let mnemonic: GeneratedKey<_, BareCtx> =
|
||||||
|
Mnemonic::generate((word_count, Language::English)).unwrap();
|
||||||
|
Ok(mnemonic.to_string())
|
||||||
|
}
|
||||||
|
|
||||||
uniffi::deps::static_assertions::assert_impl_all!(Wallet: Sync, Send);
|
uniffi::deps::static_assertions::assert_impl_all!(Wallet: Sync, Send);
|
||||||
|
|
||||||
// The goal of these tests to to ensure `bdk-ffi` intermediate code correctly calls `bdk` APIs.
|
// The goal of these tests to to ensure `bdk-ffi` intermediate code correctly calls `bdk` APIs.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user