Skip to content

Improve wallet address API #898

@LLFourn

Description

@LLFourn

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).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions