Skip to content

feat: add optional createAccounts method based on KeyringV2#448

Merged
ccharly merged 21 commits intomainfrom
cc/feat/snap-keyring-createAccounts
Feb 5, 2026
Merged

feat: add optional createAccounts method based on KeyringV2#448
ccharly merged 21 commits intomainfrom
cc/feat/snap-keyring-createAccounts

Conversation

@ccharly
Copy link
Contributor

@ccharly ccharly commented Jan 28, 2026

Adding a new optional createAccounts method that we could already leverage today without having the full implementation of KeyringV2.


Note

Medium Risk
Touches core account-creation pathways and introduces batch mutation with rollback and locking, which could affect state consistency and Snap interactions if edge cases are missed.

Overview
Introduces an optional Keyring.createAccounts method plus a new keyring_createAccounts RPC (KeyringRpcMethod.CreateAccounts) that accepts typed v2 CreateAccountOptions and returns an array of accounts.

Wires the new RPC end-to-end: keyring-snap-sdk dispatches keyring_createAccounts (and errors when unimplemented), keyring-snap-client adds KeyringClient.createAccounts, and SnapKeyring implements batch creation by validating/adding returned accounts to internal state (without per-account notify:accountCreated), enforcing idempotency, rejecting duplicates/unsupported generic accounts, rolling back Snap state via deleteAccount on failure, and serializing concurrent calls via an async-mutex lock.

Written by Cursor Bugbot for commit 7ec3108. This will update automatically on new commits. Configure here.

@ccharly ccharly force-pushed the cc/feat/snap-keyring-createAccounts branch from a1cd60d to 3840f34 Compare February 3, 2026 17:13
@ccharly ccharly marked this pull request as ready for review February 3, 2026 17:14
@ccharly ccharly requested a review from a team as a code owner February 3, 2026 17:14
@ccharly
Copy link
Contributor Author

ccharly commented Feb 5, 2026

@metamaskbot publish-preview

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@ccharly ccharly added this pull request to the merge queue Feb 5, 2026
Merged via the queue into main with commit 42541ee Feb 5, 2026
37 checks passed
@ccharly ccharly deleted the cc/feat/snap-keyring-createAccounts branch February 5, 2026 14:25
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