Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance UtxoSelectionStrategy for HDWallet #487

Merged
merged 8 commits into from
Feb 15, 2025

Conversation

satran004
Copy link
Member

@satran004 satran004 commented Jan 16, 2025

API Changes / Enhancements:

  • Address:
    A new constructor to set the derivation path for the address. It's an optional property and is useful for HD Wallet implementation.

  • UtxoSupplier:
    A new method isUsedAddress(address) which returns whether the address has been used in at least one transaction. This is required to scan used addresses in HD wallet implementation.

  • UtxoSelectionStrategy:
    A new selectUtxos() method which takes an AddressIterator instead of a single address. For HD Wallets, there is an HDWalletAddressIterator which provides addresses at different indexes.

Other changes and refactoring have been made to include the above modifications.

Known Limitation:
The Wallet interface works with all non-script transactions. For ScriptTx, a few additional changes are required to handle cases when the wallet is used as a fee payer or collateral payer wallet. These will be addressed in another PR.

@satran004 satran004 marked this pull request as draft January 16, 2025 04:28
@satran004 satran004 changed the title Enhance UtxoSelectionStrategy for HDWallet Enhance UtxoSelectionStrategy for HDWallet (WIP) Jan 16, 2025
@satran004 satran004 marked this pull request as ready for review January 30, 2025 05:51
@satran004 satran004 changed the title Enhance UtxoSelectionStrategy for HDWallet (WIP) Enhance UtxoSelectionStrategy for HDWallet Feb 15, 2025
@satran004 satran004 merged commit 973e34d into master Feb 15, 2025
6 checks passed
@satran004 satran004 deleted the feat/wallet_utxosupplier_enhancement branch February 15, 2025 05:53
edridudi pushed a commit to adabox-aio/cardano-client-lib that referenced this pull request Feb 27, 2025
* New method to take AddressSupplier as parameter

* refactor: HD wallet utxo supplier enhancement initial changes

* Add derivation path to address and handle wallet in input builder

* bloxbean#487 Refactor method names for address usage checks. Added support for indexToScan in HDWalletAddressIterator

* Revert to original version and only add isUsedAddress method

* Fix equal method to consider sub-classes

* bloxbean#487 Use AddressIterator instead of Iterator and other refactoring

* Remove system out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants