feat: add missing methods#176
Merged
Merged
Conversation
gantunesr
approved these changes
May 5, 2026
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.
Summary
Adds support for the new keyring methods that
@metamask/eth-snap-keyring@^22invokes against installed snaps:keyring_setSelectedAccounts— called when MetaMask switches the active account; the snap now persists the selected account IDs in its state.keyring_resolveAccountAddress— called when MetaMask needs to determine which account a signing request belongs to; the snap inspects the EVM signing request params (personal_sign,eth_sign,eth_signTransaction,eth_signTypedData_v1/v3/v4), looks up the matching wallet by address, and returns a CAIP-10 account ID (ornullif no match).Without these, the previous version of this snap fails to load in builds running on
eth-snap-keyring@22+because permission checks reject the new outbound calls and the snap throws on the unimplemented methods, crashing the snap and breaking e2e flows inmetamask-extension#42334.Changes
setSelectedAccountsandresolveAccountAddressonSimpleKeyring.selectedAccounts: string[]field toKeyringState(with default[]).metamaskorigin permission to callkeyring_createAccount,keyring_resolveAccountAddress, andkeyring_setSelectedAccounts.snap.manifest.jsonshasum.Notes
keyring_createAccounts(the v2 batch variant) is intentionally not implemented here. It is only invoked through the extension'sMultichainAccountService, which is wired up exclusively for Solana/Bitcoin/Tron account providers. SSK is EVM-only and goes through the singularkeyring_createAccountpath.Note
Medium Risk
Medium risk: adds new keyring RPC methods and expands
metamaskorigin permissions, which affects how signing requests are mapped to accounts and persisted in snap state.Overview
Adds support for MetaMask keyring method calls required by
@metamask/eth-snap-keyring@^22: implementskeyring_setSelectedAccounts(persist selected account IDs) andkeyring_resolveAccountAddress(derive the signing account from EVM request params and return a CAIP-10 address).Updates snap state to include
selectedAccounts, expandsmetamaskorigin permissions to allowkeyring_createAccount/keyring_resolveAccountAddress/keyring_setSelectedAccounts, and refreshes the built snapshasumplus changelog entry.Reviewed by Cursor Bugbot for commit cae665a. Bugbot is set up for automated code reviews on this repo. Configure here.