You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add optional createAccounts method based on KeyringV2 (#448)
Adding a new optional `createAccounts` method that we could already
leverage today without having the full implementation of `KeyringV2`.
<!-- CURSOR_SUMMARY -->
---
> [!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.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
7ec3108. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
0 commit comments