Skip to content

refactor: cache account response metadata (Batch accounts 5/5)#612

Open
gantunesr wants to merge 1 commit into
gar/feat/batch-accounts/part-4from
gar/feat/batch-accounts/part-5
Open

refactor: cache account response metadata (Batch accounts 5/5)#612
gantunesr wants to merge 1 commit into
gar/feat/batch-accounts/part-4from
gar/feat/batch-accounts/part-5

Conversation

@gantunesr
Copy link
Copy Markdown
Member

@gantunesr gantunesr commented May 14, 2026

Stack part 5 of 5 split from #601. Adds cached account metadata and StoredAccountAdapter so keyring-response-oriented lookups can avoid loading full BDK wallets when metadata is present.


Note

Medium Risk
Introduces a new lightweight account-loading path based on persisted metadata, which could cause runtime errors if callers assume full wallet capabilities from repository lookups.

Overview
Adds optional persisted AccountMetadata (address, addressType, network, publicDescriptor) to AccountState and stores it whenever accounts are inserted.

Introduces StoredAccountAdapter, a metadata-only BitcoinAccount implementation that supports keyring-oriented fields but throws on wallet operations, and updates BdkAccountRepository.getByDerivationPaths to prefer this adapter when metadata is present (avoiding ChangeSet/BDK wallet loading). Tests are updated to validate the cached-metadata path and new persistence fields.

Reviewed by Cursor Bugbot for commit 5319470. Bugbot is set up for automated code reviews on this repo. Configure here.

@gantunesr gantunesr requested a review from a team as a code owner May 14, 2026 21:02
@gantunesr gantunesr changed the title [Batch accounts 5/6] Cache account response metadata refactor: cache account response metadata (Batch accounts 5/5) May 14, 2026
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.

1 participant