]> Untitled Git - bdk/commit
feat(wallet): Add new address methods
authorvalued mammal <valuedmammal@protonmail.com>
Wed, 10 Apr 2024 19:16:40 +0000 (15:16 -0400)
committer志宇 <hello@evanlinjin.me>
Sat, 20 Apr 2024 07:02:55 +0000 (15:02 +0800)
commitd3763e5e37569cea0860217fba980ab0389e4e64
treea3195188dfaff72b07de17567e6af4d000893214
parentf00de9e0c192683c30298bcebfdeda6b7c2214d3
feat(wallet): Add new address methods

Introduce a new API for getting addresses from the Wallet that
reflects a similiar interface as the underlying indexer
`KeychainTxOutIndex` in preparation for removing `AddressIndex` enum.

Before this change, the only way to get an address was via the methods
`try_get{_internal}_address` which required a `&mut` reference to the
wallet, matching on the desired AddressIndex variant. This is too
restrictive since for example peeking or listing unused addresses
shouldn't change the state of the wallet. Hence we provide separate
methods for each use case which makes for a more efficient API.
crates/bdk/src/wallet/mod.rs