diff --git a/src/bdk.udl b/src/bdk.udl index 1ccedc86..6e3b24b5 100644 --- a/src/bdk.udl +++ b/src/bdk.udl @@ -1,6 +1,5 @@ namespace bdk { - [Throws=Error] - string generate_mnemonic(WordCount word_count); + }; [Error] @@ -48,6 +47,12 @@ enum Error { "Rusqlite", }; +interface Mnemonic { + constructor(WordCount word_count) + + string as_string(); +}; + dictionary AddressInfo { u32 index; string address; @@ -280,8 +285,12 @@ interface DerivationPath { }; interface DescriptorSecretKey { + [Throws=Error] - constructor(Network network, string mnemonic, string? password); + constructor(Network network, string key); + + [Name=from_mnemonic] + constructor(Network network, Mnemonic mnemonic, string? password); [Throws=Error] DescriptorSecretKey derive(DerivationPath path); @@ -296,6 +305,9 @@ interface DescriptorSecretKey { }; interface DescriptorPublicKey { + [Throws=Error] + constructor(Network network, string key); + [Throws=Error] DescriptorPublicKey derive(DerivationPath path);