feat!: expose snap-only keyring methods through service + use explicit keyring.v1 for v1 account management Snaps#9390
Open
ccharly wants to merge 23 commits into
Open
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
9cd4cab to
0221bce
Compare
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
keyring.v1 for v1 account management Snaps
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3065189. Configure here.
…rations in withKeyringV2
8c7abb2 to
803c8d6
Compare
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
hmalik88
reviewed
Jul 7, 2026
hmalik88
reviewed
Jul 7, 2026
Co-authored-by: Hassan Malik <41640681+hmalik88@users.noreply.github.com>
Co-authored-by: Hassan Malik <41640681+hmalik88@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Explanation
The new
SnapKeyring(v2), is no longer inheritingSnapKeyringV1(to make v1 calls more explicit).This PR now uses this new pattern (
keyring.v1) and also re-expose Snap-only methods that were part of the v1 keyring-API on theSnapAccountServicedirectly. Those methods can also be called using a standardKeyringClient(v1 or v2), but using the service is generally preferred to remove the need of constructing a keyring client to submit the request to the Snap.References
N/A
Checklist
Note
High Risk
Breaking API changes on
RestrictedSnapKeyringandSnapAccountServicemessenger actions affect account creation, selection forwarding, and keyring message handling across multichain and Snap account flows.Overview
This PR aligns core with eth-snap-keyring v23, where v1 Snap APIs are no longer mixed onto the v2 keyring surface. Call sites must use
keyring.v1when it exists, and v2-only Snaps exposev1asundefined.multichain-account-service:RestrictedSnapKeyringdrops top-levelcreateAccountin favor of optionalv1.createAccount. BTC, SOL, TRX, and XLM providers guard onkeyring.v1and throw if the Snap is v2-only.SnapAccountProviderbuilds the restricted keyring accordingly and routes v2 batch work through#withSnapKeyring.snap-account-service(breaking): New messenger-backed methods proxyKeyringInternalSnapClientafterensureReady:getAccountAssets,getAccountBalances,getAccountTransactions,resolveAccountAddress, andsetSelectedAccounts. The service now requiresSnapController:handleRequest.setSelectedAccountsand account-group forwarding usekeyring.v1.setSelectedAccountsfor v1 Snaps and the RPC client for v2-only Snaps.handleKeyringSnapMessagerejects v2-only keyrings instead of delegating blindly.Dependency bumps across the monorepo:
@metamask/eth-snap-keyring^23,@metamask/keyring-api^23.5,@metamask/keyring-snap-client/ SDK ^9.2, pluskeyring-internal-snap-clienton snap-account-service.Reviewed by Cursor Bugbot for commit 94b00b0. Bugbot is set up for automated code reviews on this repo. Configure here.