Skip to content

Commit

Permalink
feat: expose Wallet::list_unused_addresses method
Browse files Browse the repository at this point in the history
  • Loading branch information
thunderbiscuit committed Oct 1, 2024
1 parent f9c5d6e commit a58599f
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 @@ -390,6 +390,8 @@ interface Wallet {

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

sequence<AddressInfo> list_unused_addresses(KeychainKind keychain);

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 @@ -99,6 +99,13 @@ impl Wallet {
.collect()
}

pub fn list_unused_addresses(&self, keychain: KeychainKind) -> Vec<AddressInfo> {
self.get_wallet()
.list_unused_addresses(keychain)
.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 a58599f

Please sign in to comment.