Skip to content

Commit

Permalink
feat: expose Wallet::reveal_addresses_to method
Browse files Browse the repository at this point in the history
  • Loading branch information
thunderbiscuit committed Oct 1, 2024
1 parent f705318 commit f9c5d6e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bdk-ffi/src/bdk.udl
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@ interface Wallet {

boolean mark_used(KeychainKind keychain, u32 index);

sequence<AddressInfo> reveal_addresses_to(KeychainKind keychain, u32 index);

Network network();

Balance balance();
Expand Down
7 changes: 7 additions & 0 deletions bdk-ffi/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ impl Wallet {
self.get_wallet().mark_used(keychain, index)
}

pub fn reveal_addresses_to(&self, keychain: KeychainKind, index: u32) -> Vec<AddressInfo> {
self.get_wallet()
.reveal_addresses_to(keychain, index)
.map(|address_info| address_info.into())
.collect()
}

pub fn apply_update(&self, update: Arc<Update>) -> Result<(), CannotConnectError> {
self.get_wallet()
.apply_update(update.0.clone())
Expand Down

0 comments on commit f9c5d6e

Please sign in to comment.