Skip to content

feat(keyring-controller): add withKeyringV2 and deprecate withKeyring#8372

Draft
mathieuartu wants to merge 3 commits intomainfrom
ma/add-withkeyringv2-keyring-controller
Draft

feat(keyring-controller): add withKeyringV2 and deprecate withKeyring#8372
mathieuartu wants to merge 3 commits intomainfrom
ma/add-withkeyringv2-keyring-controller

Conversation

@mathieuartu
Copy link
Copy Markdown
Contributor

@mathieuartu mathieuartu commented Apr 2, 2026

Explanation

References

For example:

  • Fixes #12345
  • Related to #67890
    -->

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Adds a new atomic keyring-operation API that wraps V1 keyrings into KeyringV2 adapters and introduces new builder registration, which could affect keyring mutation/persistence and error handling paths. Dependency bumps for keyring packages also change transitive behavior/types used by the controller.

Overview
Introduces KeyringController.withKeyringV2 (and messenger action KeyringController:withKeyringV2) to run mutually-exclusive, persist-or-rollback operations against a selected keyring using the KeyringV2 API, including safeguards against returning the wrapped keyring instance.

Adds a keyringV2Builders constructor option plus default V2 builders for HD and Simple keyrings (HdKeyringV2, SimpleKeyringV2), and throws a new KeyringV2NotSupported error when no builder exists. Marks withKeyring as deprecated in favor of withKeyringV2, updates tests accordingly, and bumps @metamask/eth-hd-keyring / @metamask/eth-simple-keyring to versions that provide the V2 adapters.

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

@mathieuartu mathieuartu self-assigned this Apr 2, 2026
@mathieuartu mathieuartu requested review from a team as code owners April 2, 2026 20:09
@mathieuartu mathieuartu changed the title feat(keyring-controller): add withKeyringV2 and deprecate withKeyring feat(keyring-controller): add withKeyringV2 and deprecate withKeyring Apr 2, 2026
@socket-security
Copy link
Copy Markdown

socket-security bot commented Apr 2, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​metamask/​eth-simple-keyring@​11.0.0 ⏵ 11.1.19910010092 +8100

View full report

@mathieuartu mathieuartu marked this pull request as draft April 2, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant