Skip to content

Add Mnemonic type and key constructors from string #212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions src/bdk.udl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
namespace bdk {
[Throws=Error]
string generate_mnemonic(WordCount word_count);

};

[Error]
Expand Down Expand Up @@ -48,6 +47,12 @@ enum Error {
"Rusqlite",
};

interface Mnemonic {
constructor(WordCount word_count)

string as_string();
};

dictionary AddressInfo {
u32 index;
string address;
Expand Down Expand Up @@ -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);
Expand All @@ -296,6 +305,9 @@ interface DescriptorSecretKey {
};

interface DescriptorPublicKey {
[Throws=Error]
constructor(Network network, string key);

[Throws=Error]
DescriptorPublicKey derive(DerivationPath path);

Expand Down