Commit ce6ee5c
The Major Wallet module refactoring.
This commits refactors the wallet to work with generic Keychains.
A default wallet is defined as `Wallet<D, KeychainKind>`. Which has the API
that will only work with a `KeychainKind` keychain type.
A generic <D, K> wallet impl is defined to add the multi descriptor wallet
API.
New APIs are added which are only applicable in multi descriptor
environment.
- new_multi_descriptor() : create a multi descriptor wallet.
- add_descriptor() : Adds a descriptor and marks it with a `K`.
- get_address_by_keychain (): Get an address for a given keychain.
- list_utxos_by_keychain (): does what it says.
- list_transactions_by_keychain() : ''
- get_balance_by_keychain() : Get a balance for one keychain. The unconfirmed
balance is reported as trusted.
- get_balance_for_keychains() : Get accumulated balance for a list of keychains.
uses `should_trust` predicate to determine "untrusted" keychains.
- create_tx_multi() : The multi descriptor create transaction API. It takes in a list of keychains to spend from. And a list of change keychains to
generate change address from. For `change_keychains` is an iterator instead of a single keychain, because later we wanna add recipient address matching
capability of the change address. Currently it does nothing.
The default wallet APIs are changed to work over the multi-desc API as
special cases. All other APIs remains same.
Co-authored-by: Vladimir Fomene <vladimirfomene@gmail.com>1 parent aba7b96 commit ce6ee5c
1 file changed
+1003
-671
lines changed
0 commit comments