Skip to content

feat: wire keyring_createAccounts (Batch accounts 4/5)#611

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

feat: wire keyring_createAccounts (Batch accounts 4/5)#611
gantunesr wants to merge 1 commit into
gar/feat/batch-accounts/part-3from
gar/feat/batch-accounts/part-4

Conversation

@gantunesr
Copy link
Copy Markdown
Member

@gantunesr gantunesr commented May 14, 2026

Stack part 4 of 5 split from #601. Routes keyring_createAccounts, validates supported BIP-44 index/index-range options, chunks ranges internally in batches of 100, and maps responses back to KeyringAccount objects.


Note

Medium Risk
Introduces a new RPC pathway for batch account creation and adds input validation plus internal chunking logic, which could affect account provisioning behavior and ordering/trace handling if edge cases are missed.

Overview
Adds support for the keyring_createAccounts RPC in KeyringHandler, validating that only Bip44DeriveIndex and Bip44DeriveIndexRange are accepted and enforcing non-negative, inclusive index ranges.

Implements batched account creation via AccountUseCases.createMany, hard-coding v1 constraints (bitcoin mainnet + P2WPKH only), splitting requests into internal chunks of up to 100, and wrapping the operation in snap tracing (Create Bitcoin Accounts Batch) with endTrace guaranteed in finally.

Extends KeyringHandler.test.ts with comprehensive coverage for range handling, ordering, batching behavior, unsupported types, address-type constraints, error propagation, and tracing; adds a small expectDefined helper for type narrowing in tests.

Reviewed by Cursor Bugbot for commit c10b933. 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 4/6] Wire keyring_createAccounts feat: wire keyring_createAccounts (Batch accounts 4/6) May 14, 2026
@gantunesr gantunesr changed the title feat: wire keyring_createAccounts (Batch accounts 4/6) feat: wire keyring_createAccounts (Batch accounts 4/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