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

Improve wallet address API #898

Closed
Tracked by #918
LLFourn opened this issue Mar 16, 2023 · 1 comment · Fixed by #1402
Closed
Tracked by #918

Improve wallet address API #898

LLFourn opened this issue Mar 16, 2023 · 1 comment · Fixed by #1402
Assignees
Labels
api A breaking API change module-wallet
Milestone

Comments

@LLFourn
Copy link
Contributor

LLFourn commented Mar 16, 2023

get_address with an enum of AddressIndex no longer makes much sense because the Peek variant doesn't require Wallet to be mutable but the others do.

Instead I think the methods should roughly follow what's in KeychainTracker right now.

  • LastUnused should be removed and replaced with a method unused_addresses which returns and iterator. If you really want the last one then you can do wallet.unused_addresses().last(). I know this is not what LastUnused does but this is what most people thinks it does. I'm not sure what
  • get_address should instead just take an index and so should do what Peek currently does.
  • getting a new address should be handled by a new method reveal_next_address()
  • And revealing up to a certain index can be reveal_addresses_to
  • The mark_used and unmark_used feature in KeychainTxOutIndex should probably be available to users of Wallet.
  • The methods should all take a KeychainKind as their argument (rather than having separate methods for each).
@notmandatory notmandatory self-assigned this Mar 17, 2023
@notmandatory notmandatory changed the title Improve wallet addresss API Improve wallet address API Mar 20, 2023
@notmandatory notmandatory moved this to Todo in BDK Wallet Jan 2, 2024
@notmandatory notmandatory added module-wallet api A breaking API change labels Mar 17, 2024
@notmandatory notmandatory added this to the 1.0.0-alpha milestone Mar 17, 2024
@notmandatory notmandatory moved this from Todo to In Progress in BDK Wallet Mar 25, 2024
@ValuedMammal
Copy link
Contributor

I would find it more intuitive if unmark_used was called mark_unused, is that just me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api A breaking API change module-wallet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants