expose: get_address peek

This commit is contained in:
Ed Ball 2023-01-31 22:51:44 +01:00 committed by thunderbiscuit
parent aa842c3844
commit 7fefb8a7b9
No known key found for this signature in database
GPG Key ID: 88253696EB836462
2 changed files with 9 additions and 3 deletions

View File

@ -53,9 +53,11 @@ dictionary AddressInfo {
string address;
};
enum AddressIndex {
"New",
"LastUnused",
[Enum]
interface AddressIndex {
New();
LastUnused();
Peek(u32 index);
};
enum Network {

View File

@ -69,6 +69,9 @@ pub enum AddressIndex {
/// caller is untrusted; for example when deriving donation addresses on-demand for a public
/// web page.
LastUnused,
Peek {
index: u32,
},
}
impl From<AddressIndex> for BdkAddressIndex {
@ -76,6 +79,7 @@ impl From<AddressIndex> for BdkAddressIndex {
match x {
AddressIndex::New => BdkAddressIndex::New,
AddressIndex::LastUnused => BdkAddressIndex::LastUnused,
AddressIndex::Peek { index } => BdkAddressIndex::Peek(index),
}
}
}