From ce8827490ab3b11b9c61e1581edc7464c1226ddc Mon Sep 17 00:00:00 2001 From: mikesposito Date: Wed, 22 Jul 2026 17:24:58 +0200 Subject: [PATCH 1/3] feat(config-registry-controller)!: index network configs by caip2 chain id --- packages/config-registry-controller/CHANGELOG.md | 3 ++- .../src/ConfigRegistryController.ts | 6 +++--- .../src/config-registry-api-service/types.ts | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/config-registry-controller/CHANGELOG.md b/packages/config-registry-controller/CHANGELOG.md index f78e83636aa..e4d57949a52 100644 --- a/packages/config-registry-controller/CHANGELOG.md +++ b/packages/config-registry-controller/CHANGELOG.md @@ -10,12 +10,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Add `ConfigRegistryControllerStateChangedEvent` (`ConfigRegistryController:stateChanged`) to the controller's events ([#9595](https://github.com/MetaMask/core/pull/9595)) -- Add `ConfigRegistryController.getNetworkConfigByCaip2ChainId` method to retrieve a network config by its CAIP-2 chain ID ([#9597](https://github.com/MetaMask/core/pull/9597)) +- Add `ConfigRegistryController.getNetworkConfigByCaip2ChainId` method to retrieve a network config by its CAIP-2 chain ID ([#9597](https://github.com/MetaMask/core/pull/9597), [#0000](https://github.com/MetaMask/core/pull/0000)) - 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` instead of a `Record` ([#0000](https://github.com/MetaMask/core/pull/0000)) - Bump `@metamask/utils` from `^11.9.0` to `^11.11.0` ([#9074](https://github.com/MetaMask/core/pull/9074)) - Bump `@metamask/controller-utils` from `^12.1.1` to `^12.3.0` ([#9083](https://github.com/MetaMask/core/pull/9083), [#9218](https://github.com/MetaMask/core/pull/9218)) - Bump `@metamask/profile-sync-controller` from `^28.1.1` to `^28.3.0` ([#9119](https://github.com/MetaMask/core/pull/9119), [#9463](https://github.com/MetaMask/core/pull/9463)) diff --git a/packages/config-registry-controller/src/ConfigRegistryController.ts b/packages/config-registry-controller/src/ConfigRegistryController.ts index 2903f8ce5fa..3348a65a833 100644 --- a/packages/config-registry-controller/src/ConfigRegistryController.ts +++ b/packages/config-registry-controller/src/ConfigRegistryController.ts @@ -12,7 +12,7 @@ import type { Messenger } from '@metamask/messenger'; import { StaticIntervalPollingController } from '@metamask/polling-controller'; import type { RemoteFeatureFlagControllerGetStateAction } from '@metamask/remote-feature-flag-controller'; import type { RemoteFeatureFlagControllerStateChangeEvent } from '@metamask/remote-feature-flag-controller'; -import { Duration, inMilliseconds, Json } from '@metamask/utils'; +import { CaipChainId, Duration, inMilliseconds, Json } from '@metamask/utils'; import type { ConfigRegistryApiServiceFetchConfigAction } from './config-registry-api-service/config-registry-api-service-method-action-types.js'; import type { RegistryNetworkConfig } from './config-registry-api-service/types.js'; @@ -37,7 +37,7 @@ export type ConfigRegistryControllerState = { * Use selectors (e.g. selectFeaturedNetworks) to filter when needed. */ configs: { - networks: Record; + networks: Record; }; /** * Semantic version string of the configuration data from the API. @@ -216,7 +216,7 @@ export class ConfigRegistryController extends StaticIntervalPollingController Date: Wed, 22 Jul 2026 17:34:41 +0200 Subject: [PATCH 2/3] update changelog Co-authored-by: Michele Esposito <34438276+mikesposito@users.noreply.github.com> --- packages/config-registry-controller/CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/config-registry-controller/CHANGELOG.md b/packages/config-registry-controller/CHANGELOG.md index e4d57949a52..7c860b9e4be 100644 --- a/packages/config-registry-controller/CHANGELOG.md +++ b/packages/config-registry-controller/CHANGELOG.md @@ -10,13 +10,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Add `ConfigRegistryControllerStateChangedEvent` (`ConfigRegistryController:stateChanged`) to the controller's events ([#9595](https://github.com/MetaMask/core/pull/9595)) -- Add `ConfigRegistryController.getNetworkConfigByCaip2ChainId` method to retrieve a network config by its CAIP-2 chain ID ([#9597](https://github.com/MetaMask/core/pull/9597), [#0000](https://github.com/MetaMask/core/pull/0000)) +- Add `ConfigRegistryController.getNetworkConfigByCaip2ChainId` method to retrieve a network config by its CAIP-2 chain ID ([#9597](https://github.com/MetaMask/core/pull/9597), [#9606](https://github.com/MetaMask/core/pull/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` instead of a `Record` ([#0000](https://github.com/MetaMask/core/pull/0000)) +**BREAKING:** `ConfigRegistryControllerState.configs.networks` is now a `Record` instead of a `Record` ([#9606](https://github.com/MetaMask/core/pull/9606)) - Bump `@metamask/utils` from `^11.9.0` to `^11.11.0` ([#9074](https://github.com/MetaMask/core/pull/9074)) - Bump `@metamask/controller-utils` from `^12.1.1` to `^12.3.0` ([#9083](https://github.com/MetaMask/core/pull/9083), [#9218](https://github.com/MetaMask/core/pull/9218)) - Bump `@metamask/profile-sync-controller` from `^28.1.1` to `^28.3.0` ([#9119](https://github.com/MetaMask/core/pull/9119), [#9463](https://github.com/MetaMask/core/pull/9463)) From 8c8a1f8170ef2cbdae9d97bc87cd8d0da1921648 Mon Sep 17 00:00:00 2001 From: Michele Esposito <34438276+mikesposito@users.noreply.github.com> Date: Wed, 22 Jul 2026 17:37:59 +0200 Subject: [PATCH 3/3] fix changelog --- packages/config-registry-controller/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/config-registry-controller/CHANGELOG.md b/packages/config-registry-controller/CHANGELOG.md index 7c860b9e4be..f5cab6f568e 100644 --- a/packages/config-registry-controller/CHANGELOG.md +++ b/packages/config-registry-controller/CHANGELOG.md @@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -**BREAKING:** `ConfigRegistryControllerState.configs.networks` is now a `Record` instead of a `Record` ([#9606](https://github.com/MetaMask/core/pull/9606)) +- **BREAKING:** `ConfigRegistryControllerState.configs.networks` is now a `Record` instead of a `Record` ([#9606](https://github.com/MetaMask/core/pull/9606)) - Bump `@metamask/utils` from `^11.9.0` to `^11.11.0` ([#9074](https://github.com/MetaMask/core/pull/9074)) - Bump `@metamask/controller-utils` from `^12.1.1` to `^12.3.0` ([#9083](https://github.com/MetaMask/core/pull/9083), [#9218](https://github.com/MetaMask/core/pull/9218)) - Bump `@metamask/profile-sync-controller` from `^28.1.1` to `^28.3.0` ([#9119](https://github.com/MetaMask/core/pull/9119), [#9463](https://github.com/MetaMask/core/pull/9463))