Skip to content

feat(config-registry-controller): add getNetworkConfigByCaip2ChainId - #9597

Merged
mikesposito merged 2 commits into
mainfrom
me/get-network-config-by-caip2-chain-id
Jul 22, 2026
Merged

feat(config-registry-controller): add getNetworkConfigByCaip2ChainId#9597
mikesposito merged 2 commits into
mainfrom
me/get-network-config-by-caip2-chain-id

Conversation

@mikesposito

@mikesposito mikesposito commented Jul 22, 2026

Copy link
Copy Markdown
Member

Explanation

Adding ConfigRegistryController:getNetworkConfigByCaip2ChainId to make it more ergonomic for other controllers to consume ConfigRegistryController's network configs.

References

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

Low Risk
Read-only state lookup with no mutation, polling, or security-sensitive logic; additive API only.

Overview
Adds getNetworkConfigByCaip2ChainId so consumers can resolve a network config by CAIP-2 chain ID (e.g. eip155:1) without reading controller state directly. The method returns the matching RegistryNetworkConfig or undefined.

The method is registered in MESSENGER_EXPOSED_METHODS, so other controllers can call ConfigRegistryController:getNetworkConfigByCaip2ChainId through the messenger. Auto-generated method action types and changelog are updated; unit tests cover a hit and a missing chain ID.

Reviewed by Cursor Bugbot for commit 318ec0e. Bugbot is set up for automated code reviews on this repo. Configure here.

@mikesposito mikesposito changed the title feat(ConfigRegistryController): add getNetworkConfigByCaip2ChainId feat(config-registry-controller): add getNetworkConfigByCaip2ChainId Jul 22, 2026
Comment thread packages/config-registry-controller/CHANGELOG.md Outdated
@mikesposito
mikesposito marked this pull request as ready for review July 22, 2026 12:45
@mikesposito
mikesposito requested review from a team as code owners July 22, 2026 12:45
@mikesposito
mikesposito enabled auto-merge July 22, 2026 12:52
* @returns The network configuration if found, otherwise undefined.
*/
getNetworkConfigByCaip2ChainId(
caip2ChainId: string,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance we can do slightly better than string here as a type ? I often saw ${string}:${string}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The state is typed Record<string, _> so the argument is matching the state key type, but we can change both

@mikesposito
mikesposito added this pull request to the merge queue Jul 22, 2026
Merged via the queue into main with commit f3ac43c Jul 22, 2026
431 checks passed
@mikesposito
mikesposito deleted the me/get-network-config-by-caip2-chain-id branch July 22, 2026 13:07
pull Bot pushed a commit to firas9941/metamask-extension that referenced this pull request Aug 4, 2026
…er` (MetaMask#44766)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
~~Using preview build from MetaMask/core#9611

Bumping `@metamask/network-enablement-controller` to `^6.0.0`
```markdown
## [6.0.0]

### Added

- Expose missing public `NetworkEnablementController` method through its messenger ([MetaMask#9660](MetaMask/core#9660))
  - The following action is now available:
    - `NetworkEnablementController:restoreEnabledNetworkMap`
  - Corresponding action type (`NetworkEnablementControllerRestoreEnabledNetworkMapAction`) is available as well.

### Changed

- **BREAKING:** Popular-network classification is now augmented by `ConfigRegistryController` ([MetaMask#9611](MetaMask/core#9611))
  - `NetworkEnablementControllerMessenger` now requires the `ConfigRegistryController:getState` action to be available.
- Bump `@metamask/transaction-controller` from `^69.0.0` to `^69.3.0` ([MetaMask#9568](MetaMask/core#9568), [MetaMask#9589](MetaMask/core#9589), [MetaMask#9593](MetaMask/core#9593), [MetaMask#9693](MetaMask/core#9693))
- Bump `@metamask/keyring-api` from `^23.5.0` to `^23.7.0` ([MetaMask#9676](MetaMask/core#9676))
- Bump `@metamask/config-registry-controller` from `^0.4.1` to `^1.0.0` ([MetaMask#9706](MetaMask/core#9706))
```

and `@metamask/config-registry-controller` to `^1.0.0`
```markdown
## [1.0.0]

### Added

- Add `ConfigRegistryControllerStateChangedEvent` (`ConfigRegistryController:stateChanged`) to the controller's events ([MetaMask#9595](MetaMask/core#9595))
- Add `ConfigRegistryController.getNetworkConfigByCaip2ChainId` method to retrieve a network config by its CAIP-2 chain ID ([MetaMask#9597](MetaMask/core#9597), [MetaMask#9606](MetaMask/core#9606))
  - The method returns the network config if found, or `undefined` if not found.
  - The method is also accessible via the controller's messenger as `ConfigRegistryController:getNetworkConfigByCaip2ChainId`.

### Changed

- **BREAKING:** `ConfigRegistryControllerState.configs.networks` is now a `Record<Caip2ChainId, RegistryNetworkConfig>` instead of a `Record<string, RegistryNetworkConfig>` ([MetaMask#9606](MetaMask/core#9606))
- Bump `@metamask/utils` from `^11.9.0` to `^11.11.0` ([MetaMask#9074](MetaMask/core#9074))
- Bump `@metamask/controller-utils` from `^12.1.1` to `^12.3.0` ([MetaMask#9083](MetaMask/core#9083), [MetaMask#9218](MetaMask/core#9218))
- Bump `@metamask/profile-sync-controller` from `^28.1.1` to `^28.3.0` ([MetaMask#9119](MetaMask/core#9119), [MetaMask#9463](MetaMask/core#9463))
- Bump `@metamask/keyring-controller` from `^27.0.0` to `^27.1.0` ([MetaMask#9129](MetaMask/core#9129))
- Bump `@metamask/polling-controller` from `^16.0.6` to `^16.0.8` ([MetaMask#9218](MetaMask/core#9218), [MetaMask#9349](MetaMask/core#9349))
- Bump `@metamask/messenger` from `^1.2.0` to `^2.0.0` ([MetaMask#9392](MetaMask/core#9392))

### Removed

- **BREAKING:** Removed `ConfigRegistryControllerStateChangeEvent` type in favor of `ConfigRegistryControllerStateChangedEvent` ([MetaMask#9595](MetaMask/core#9595))
```

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Related: https://consensyssoftware.atlassian.net/browse/WPN-1710

## **Manual testing steps**

1. Verify the network switching and asset polling work same as before

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Popular-network behavior now depends on config registry state at
runtime; incorrect messenger wiring would break network enablement, but
the change is limited to dependency versions and one delegate action.
> 
> **Overview**
> Bumps **`@metamask/network-enablement-controller`** to `^6.0.0` and
**`@metamask/config-registry-controller`** to `^1.0.0`, with lockfile
updates.
> 
> Wires **`NetworkEnablementController`** to the config registry by
delegating **`ConfigRegistryController:getState`** on its messenger so
v6 can use registry data for popular-network classification.
> 
> Config-registry selector tests now build mock registry entries with
the **`RegistryNetworkConfig`** type instead of untyped inline objects,
matching the v1 typed `configs.networks` shape.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
1ddf8cd. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
Co-authored-by: Guillaume Roux <guillaumeroux123@gmail.com>
n3ps pushed a commit to MetaMask/metamask-extension that referenced this pull request Aug 5, 2026
…er` (#44766)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
~~Using preview build from MetaMask/core#9611

Bumping `@metamask/network-enablement-controller` to `^6.0.0`
```markdown
## [6.0.0]

### Added

- Expose missing public `NetworkEnablementController` method through its messenger ([#9660](MetaMask/core#9660))
  - The following action is now available:
    - `NetworkEnablementController:restoreEnabledNetworkMap`
  - Corresponding action type (`NetworkEnablementControllerRestoreEnabledNetworkMapAction`) is available as well.

### Changed

- **BREAKING:** Popular-network classification is now augmented by `ConfigRegistryController` ([#9611](MetaMask/core#9611))
  - `NetworkEnablementControllerMessenger` now requires the `ConfigRegistryController:getState` action to be available.
- Bump `@metamask/transaction-controller` from `^69.0.0` to `^69.3.0` ([#9568](MetaMask/core#9568), [#9589](MetaMask/core#9589), [#9593](MetaMask/core#9593), [#9693](MetaMask/core#9693))
- Bump `@metamask/keyring-api` from `^23.5.0` to `^23.7.0` ([#9676](MetaMask/core#9676))
- Bump `@metamask/config-registry-controller` from `^0.4.1` to `^1.0.0` ([#9706](MetaMask/core#9706))
```

and `@metamask/config-registry-controller` to `^1.0.0`
```markdown
## [1.0.0]

### Added

- Add `ConfigRegistryControllerStateChangedEvent` (`ConfigRegistryController:stateChanged`) to the controller's events ([#9595](MetaMask/core#9595))
- Add `ConfigRegistryController.getNetworkConfigByCaip2ChainId` method to retrieve a network config by its CAIP-2 chain ID ([#9597](MetaMask/core#9597), [#9606](MetaMask/core#9606))
  - The method returns the network config if found, or `undefined` if not found.
  - The method is also accessible via the controller's messenger as `ConfigRegistryController:getNetworkConfigByCaip2ChainId`.

### Changed

- **BREAKING:** `ConfigRegistryControllerState.configs.networks` is now a `Record<Caip2ChainId, RegistryNetworkConfig>` instead of a `Record<string, RegistryNetworkConfig>` ([#9606](MetaMask/core#9606))
- Bump `@metamask/utils` from `^11.9.0` to `^11.11.0` ([#9074](MetaMask/core#9074))
- Bump `@metamask/controller-utils` from `^12.1.1` to `^12.3.0` ([#9083](MetaMask/core#9083), [#9218](MetaMask/core#9218))
- Bump `@metamask/profile-sync-controller` from `^28.1.1` to `^28.3.0` ([#9119](MetaMask/core#9119), [#9463](MetaMask/core#9463))
- Bump `@metamask/keyring-controller` from `^27.0.0` to `^27.1.0` ([#9129](MetaMask/core#9129))
- Bump `@metamask/polling-controller` from `^16.0.6` to `^16.0.8` ([#9218](MetaMask/core#9218), [#9349](MetaMask/core#9349))
- Bump `@metamask/messenger` from `^1.2.0` to `^2.0.0` ([#9392](MetaMask/core#9392))

### Removed

- **BREAKING:** Removed `ConfigRegistryControllerStateChangeEvent` type in favor of `ConfigRegistryControllerStateChangedEvent` ([#9595](MetaMask/core#9595))
```

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Related: https://consensyssoftware.atlassian.net/browse/WPN-1710

## **Manual testing steps**

1. Verify the network switching and asset polling work same as before

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Popular-network behavior now depends on config registry state at
runtime; incorrect messenger wiring would break network enablement, but
the change is limited to dependency versions and one delegate action.
> 
> **Overview**
> Bumps **`@metamask/network-enablement-controller`** to `^6.0.0` and
**`@metamask/config-registry-controller`** to `^1.0.0`, with lockfile
updates.
> 
> Wires **`NetworkEnablementController`** to the config registry by
delegating **`ConfigRegistryController:getState`** on its messenger so
v6 can use registry data for popular-network classification.
> 
> Config-registry selector tests now build mock registry entries with
the **`RegistryNetworkConfig`** type instead of untyped inline objects,
matching the v1 typed `configs.networks` shape.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
1ddf8cd. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
Co-authored-by: Guillaume Roux <guillaumeroux123@gmail.com>
Bigshmow pushed a commit to MetaMask/metamask-extension that referenced this pull request Aug 5, 2026
…er` (#44766)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
~~Using preview build from MetaMask/core#9611

Bumping `@metamask/network-enablement-controller` to `^6.0.0`
```markdown
## [6.0.0]

### Added

- Expose missing public `NetworkEnablementController` method through its messenger ([#9660](MetaMask/core#9660))
  - The following action is now available:
    - `NetworkEnablementController:restoreEnabledNetworkMap`
  - Corresponding action type (`NetworkEnablementControllerRestoreEnabledNetworkMapAction`) is available as well.

### Changed

- **BREAKING:** Popular-network classification is now augmented by `ConfigRegistryController` ([#9611](MetaMask/core#9611))
  - `NetworkEnablementControllerMessenger` now requires the `ConfigRegistryController:getState` action to be available.
- Bump `@metamask/transaction-controller` from `^69.0.0` to `^69.3.0` ([#9568](MetaMask/core#9568), [#9589](MetaMask/core#9589), [#9593](MetaMask/core#9593), [#9693](MetaMask/core#9693))
- Bump `@metamask/keyring-api` from `^23.5.0` to `^23.7.0` ([#9676](MetaMask/core#9676))
- Bump `@metamask/config-registry-controller` from `^0.4.1` to `^1.0.0` ([#9706](MetaMask/core#9706))
```

and `@metamask/config-registry-controller` to `^1.0.0`
```markdown
## [1.0.0]

### Added

- Add `ConfigRegistryControllerStateChangedEvent` (`ConfigRegistryController:stateChanged`) to the controller's events ([#9595](MetaMask/core#9595))
- Add `ConfigRegistryController.getNetworkConfigByCaip2ChainId` method to retrieve a network config by its CAIP-2 chain ID ([#9597](MetaMask/core#9597), [#9606](MetaMask/core#9606))
  - The method returns the network config if found, or `undefined` if not found.
  - The method is also accessible via the controller's messenger as `ConfigRegistryController:getNetworkConfigByCaip2ChainId`.

### Changed

- **BREAKING:** `ConfigRegistryControllerState.configs.networks` is now a `Record<Caip2ChainId, RegistryNetworkConfig>` instead of a `Record<string, RegistryNetworkConfig>` ([#9606](MetaMask/core#9606))
- Bump `@metamask/utils` from `^11.9.0` to `^11.11.0` ([#9074](MetaMask/core#9074))
- Bump `@metamask/controller-utils` from `^12.1.1` to `^12.3.0` ([#9083](MetaMask/core#9083), [#9218](MetaMask/core#9218))
- Bump `@metamask/profile-sync-controller` from `^28.1.1` to `^28.3.0` ([#9119](MetaMask/core#9119), [#9463](MetaMask/core#9463))
- Bump `@metamask/keyring-controller` from `^27.0.0` to `^27.1.0` ([#9129](MetaMask/core#9129))
- Bump `@metamask/polling-controller` from `^16.0.6` to `^16.0.8` ([#9218](MetaMask/core#9218), [#9349](MetaMask/core#9349))
- Bump `@metamask/messenger` from `^1.2.0` to `^2.0.0` ([#9392](MetaMask/core#9392))

### Removed

- **BREAKING:** Removed `ConfigRegistryControllerStateChangeEvent` type in favor of `ConfigRegistryControllerStateChangedEvent` ([#9595](MetaMask/core#9595))
```

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Related: https://consensyssoftware.atlassian.net/browse/WPN-1710

## **Manual testing steps**

1. Verify the network switching and asset polling work same as before

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Popular-network behavior now depends on config registry state at
runtime; incorrect messenger wiring would break network enablement, but
the change is limited to dependency versions and one delegate action.
> 
> **Overview**
> Bumps **`@metamask/network-enablement-controller`** to `^6.0.0` and
**`@metamask/config-registry-controller`** to `^1.0.0`, with lockfile
updates.
> 
> Wires **`NetworkEnablementController`** to the config registry by
delegating **`ConfigRegistryController:getState`** on its messenger so
v6 can use registry data for popular-network classification.
> 
> Config-registry selector tests now build mock registry entries with
the **`RegistryNetworkConfig`** type instead of untyped inline objects,
matching the v1 typed `configs.networks` shape.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
1ddf8cd. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
Co-authored-by: Guillaume Roux <guillaumeroux123@gmail.com>
n3ps pushed a commit to MetaMask/metamask-extension that referenced this pull request Aug 6, 2026
…er` (#44766)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
~~Using preview build from MetaMask/core#9611

Bumping `@metamask/network-enablement-controller` to `^6.0.0`
```markdown
## [6.0.0]

### Added

- Expose missing public `NetworkEnablementController` method through its messenger ([#9660](MetaMask/core#9660))
  - The following action is now available:
    - `NetworkEnablementController:restoreEnabledNetworkMap`
  - Corresponding action type (`NetworkEnablementControllerRestoreEnabledNetworkMapAction`) is available as well.

### Changed

- **BREAKING:** Popular-network classification is now augmented by `ConfigRegistryController` ([#9611](MetaMask/core#9611))
  - `NetworkEnablementControllerMessenger` now requires the `ConfigRegistryController:getState` action to be available.
- Bump `@metamask/transaction-controller` from `^69.0.0` to `^69.3.0` ([#9568](MetaMask/core#9568), [#9589](MetaMask/core#9589), [#9593](MetaMask/core#9593), [#9693](MetaMask/core#9693))
- Bump `@metamask/keyring-api` from `^23.5.0` to `^23.7.0` ([#9676](MetaMask/core#9676))
- Bump `@metamask/config-registry-controller` from `^0.4.1` to `^1.0.0` ([#9706](MetaMask/core#9706))
```

and `@metamask/config-registry-controller` to `^1.0.0`
```markdown
## [1.0.0]

### Added

- Add `ConfigRegistryControllerStateChangedEvent` (`ConfigRegistryController:stateChanged`) to the controller's events ([#9595](MetaMask/core#9595))
- Add `ConfigRegistryController.getNetworkConfigByCaip2ChainId` method to retrieve a network config by its CAIP-2 chain ID ([#9597](MetaMask/core#9597), [#9606](MetaMask/core#9606))
  - The method returns the network config if found, or `undefined` if not found.
  - The method is also accessible via the controller's messenger as `ConfigRegistryController:getNetworkConfigByCaip2ChainId`.

### Changed

- **BREAKING:** `ConfigRegistryControllerState.configs.networks` is now a `Record<Caip2ChainId, RegistryNetworkConfig>` instead of a `Record<string, RegistryNetworkConfig>` ([#9606](MetaMask/core#9606))
- Bump `@metamask/utils` from `^11.9.0` to `^11.11.0` ([#9074](MetaMask/core#9074))
- Bump `@metamask/controller-utils` from `^12.1.1` to `^12.3.0` ([#9083](MetaMask/core#9083), [#9218](MetaMask/core#9218))
- Bump `@metamask/profile-sync-controller` from `^28.1.1` to `^28.3.0` ([#9119](MetaMask/core#9119), [#9463](MetaMask/core#9463))
- Bump `@metamask/keyring-controller` from `^27.0.0` to `^27.1.0` ([#9129](MetaMask/core#9129))
- Bump `@metamask/polling-controller` from `^16.0.6` to `^16.0.8` ([#9218](MetaMask/core#9218), [#9349](MetaMask/core#9349))
- Bump `@metamask/messenger` from `^1.2.0` to `^2.0.0` ([#9392](MetaMask/core#9392))

### Removed

- **BREAKING:** Removed `ConfigRegistryControllerStateChangeEvent` type in favor of `ConfigRegistryControllerStateChangedEvent` ([#9595](MetaMask/core#9595))
```

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Related: https://consensyssoftware.atlassian.net/browse/WPN-1710

## **Manual testing steps**

1. Verify the network switching and asset polling work same as before

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Popular-network behavior now depends on config registry state at
runtime; incorrect messenger wiring would break network enablement, but
the change is limited to dependency versions and one delegate action.
> 
> **Overview**
> Bumps **`@metamask/network-enablement-controller`** to `^6.0.0` and
**`@metamask/config-registry-controller`** to `^1.0.0`, with lockfile
updates.
> 
> Wires **`NetworkEnablementController`** to the config registry by
delegating **`ConfigRegistryController:getState`** on its messenger so
v6 can use registry data for popular-network classification.
> 
> Config-registry selector tests now build mock registry entries with
the **`RegistryNetworkConfig`** type instead of untyped inline objects,
matching the v1 typed `configs.networks` shape.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
1ddf8cd. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
Co-authored-by: Guillaume Roux <guillaumeroux123@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants