feat: Expose NetworkController methods through messenger#8350
Open
cryptodev-2s wants to merge 11 commits intomainfrom
Open
feat: Expose NetworkController methods through messenger#8350cryptodev-2s wants to merge 11 commits intomainfrom
cryptodev-2s wants to merge 11 commits intomainfrom
Conversation
Migrate NetworkController to use MESSENGER_EXPOSED_METHODS and registerMethodActionHandlers, replacing manual registerActionHandler calls. Auto-generate action types via generate-method-action-types script. - Add public getEthQuery() method (replaces lambda) - Expose 11 previously unregistered public methods as messenger actions - Deprecate old type aliases missing Action suffix
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.
mcmire
reviewed
Mar 31, 2026
mcmire
reviewed
Mar 31, 2026
Contributor
mcmire
left a comment
There was a problem hiding this comment.
One more thing, and then I can approve.
mcmire
reviewed
Mar 31, 2026
…er messenger type fixes
…er messenger type fixes
Contributor
Author
Sorry I made this new commit 3db94fa for wrong sections order. |
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
Migrates
NetworkControllerto useMESSENGER_EXPOSED_METHODSandregisterMethodActionHandlers, replacing manualregisterActionHandlercalls. Thegenerate-method-action-typesscript is used to auto-generate action types.getEthQuery()method (replaces lambda accessing private field)Actionsuffix (NetworkControllerGetNetworkConfigurationByNetworkClientId)References
Changelog
Added
enableRpcFailover,disableRpcFailover,getProviderAndBlockTracker,getNetworkClientRegistry,initializeProvider,lookupNetwork,lookupNetworkByClientId,get1559CompatibilityWithNetworkClientId,resetConnection,rollbackToPreviousProvider,loadBackupDeprecated
NetworkControllerGetNetworkConfigurationByNetworkClientId→ useNetworkControllerGetNetworkConfigurationByNetworkClientIdActionChecklist
Note
Medium Risk
Expands and refactors
NetworkControllermessenger action registration and exported types, which can affect downstream consumers’ typing and any code calling these actions. Runtime behavior should be unchanged, but mis-registration or method list drift could break integrations.Overview
Exposes additional
NetworkControllermethods via the messenger by switching from many manualregisterActionHandlercalls toregisterMethodActionHandlersdriven by a centralizedMESSENGER_EXPOSED_METHODSlist.Adds an auto-generated
NetworkController-method-action-types.tsfile (plus agenerate-method-action-typesscript andtsxdev dependency) and re-exports these new action types fromindex.ts, including new actions like RPC failover toggles and connection/provider lifecycle methods.Updates assets controllers to import
NetworkControllerFindNetworkClientIdByChainIdActionfrom@metamask/network-controller(removing relative-package type imports) and records the consumer-facing typing fixes in changelogs; removes now-unneededimport-x/no-relative-packageseslint suppressions.Written by Cursor Bugbot for commit 3db94fa. This will update automatically on new commits. Configure here.