Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
bac9bd9
feat: add config-registry-controller package
wantedsystem Dec 3, 2025
c36c531
chore: continue adding config registry controller
wantedsystem Dec 3, 2025
be2165a
feat: add polling and fallback support
wantedsystem Dec 4, 2025
e82db65
feat: add configregistryqpiservice and integrate with controller
wantedsystem Dec 11, 2025
7987032
feat: add network transformer functions for API response processing
wantedsystem Dec 15, 2025
a4dbfca
feat: add feature flag support
wantedsystem Dec 16, 2025
3f3ce9c
fix: fix polling-controller version in config registry controller
wantedsystem Jan 16, 2026
6e2a128
chore: restructure state to nest networks under configs
wantedsystem Jan 19, 2026
77e35fd
chore: remove metadat from config network response
wantedsystem Jan 20, 2026
d2bee1f
fix: fix tests
wantedsystem Jan 20, 2026
be0831f
Merge branch 'main' into feat/add-config-registry-controller
wantedsystem Jan 20, 2026
d1f2251
fix: fix cursor comments
wantedsystem Jan 20, 2026
416e8e9
chore: update changelog
wantedsystem Jan 20, 2026
61d9942
fix: update yarn.lock
wantedsystem Jan 21, 2026
bd0fd60
Merge remote-tracking branch 'origin/main' into feat/add-config-regis…
wantedsystem Jan 21, 2026
980ac4e
chore: update yarn.lock
wantedsystem Jan 21, 2026
945154a
chore: update config-registry-controller package.json
wantedsystem Jan 21, 2026
ab102d8
chore: update yarn.lock
wantedsystem Jan 22, 2026
5f11236
fix: fix lint
wantedsystem Jan 22, 2026
0503c7d
feat: add test coverage
wantedsystem Jan 22, 2026
339d975
fix: add missing CODEOWNER
wantedsystem Jan 22, 2026
01aabb3
fix: fix feedbacks
wantedsystem Jan 23, 2026
d628f08
fix: fix feedbacks
wantedsystem Jan 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
/packages/build-utils @MetaMask/core-platform
/packages/composable-controller @MetaMask/core-platform
/packages/connectivity-controller @MetaMask/core-platform
/packages/config-registry-controller @MetaMask/core-platform
/packages/controller-utils @MetaMask/core-platform
/packages/error-reporting-service @MetaMask/core-platform
/packages/eth-json-rpc-middleware @MetaMask/core-platform
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ scripts/coverage
!.yarn/releases
!.yarn/sdks
!.yarn/versions

.yalc
yalc.lock
# typescript
packages/*/*.tsbuildinfo

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Each package in this repository has its own README where you can find installati
- [`@metamask/chain-agnostic-permission`](packages/chain-agnostic-permission)
- [`@metamask/claims-controller`](packages/claims-controller)
- [`@metamask/composable-controller`](packages/composable-controller)
- [`@metamask/config-registry-controller`](packages/config-registry-controller)
- [`@metamask/connectivity-controller`](packages/connectivity-controller)
- [`@metamask/controller-utils`](packages/controller-utils)
- [`@metamask/core-backend`](packages/core-backend)
Expand Down Expand Up @@ -113,6 +114,7 @@ linkStyle default opacity:0.5
chain_agnostic_permission(["@metamask/chain-agnostic-permission"]);
claims_controller(["@metamask/claims-controller"]);
composable_controller(["@metamask/composable-controller"]);
config_registry_controller(["@metamask/config-registry-controller"]);
connectivity_controller(["@metamask/connectivity-controller"]);
controller_utils(["@metamask/controller-utils"]);
core_backend(["@metamask/core-backend"]);
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@
"@keystonehq/bc-ur-registry-eth>hdkey>secp256k1": true,
"babel-runtime>core-js": false,
"simple-git-hooks": false,
"tsx>esbuild": false
"tsx>esbuild": false,
"eslint-plugin-import-x>unrs-resolver": false
}
}
}
21 changes: 21 additions & 0 deletions packages/config-registry-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Initial release of `@metamask/config-registry-controller` ([#7668](https://github.com/MetaMask/core/pull/7668))
- Controller for fetching and managing network configurations from a remote API
- ConfigRegistryApiService with ETag support, retries, circuit breaker, and timeout handling
- Network filtering to only include featured, active, non-testnet networks
- Feature flag integration using `config_registry_api_enabled` to enable/disable API fetching
- Fallback configuration support when API is unavailable or feature flag is disabled
- State persistence for configs, version, lastFetched, and etag
- Uses StaticIntervalPollingController for periodic updates (default: 24 hours)

[Unreleased]: https://github.com/MetaMask/core/
20 changes: 20 additions & 0 deletions packages/config-registry-controller/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
MIT License

Copyright (c) 2025 MetaMask

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
15 changes: 15 additions & 0 deletions packages/config-registry-controller/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# `@metamask/config-registry-controller`

Manages configuration registry for MetaMask

## Installation

`yarn add @metamask/config-registry-controller`

or

`npm install @metamask/config-registry-controller`

## Contributing

This package is part of a monorepo. Instructions for contributing can be found in the [monorepo README](https://github.com/MetaMask/core#readme).
26 changes: 26 additions & 0 deletions packages/config-registry-controller/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/configuration
*/

const merge = require('deepmerge');
const path = require('path');

const baseConfig = require('../../jest.config.packages');

const displayName = path.basename(__dirname);

module.exports = merge(baseConfig, {
// The display name when running multiple projects
displayName,

// An object that configures minimum threshold enforcement for coverage results
coverageThreshold: {
global: {
branches: 100,
functions: 100,
lines: 100,
statements: 100,
},
},
});
80 changes: 80 additions & 0 deletions packages/config-registry-controller/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"name": "@metamask/config-registry-controller",
"version": "0.0.1",
"description": "Manages configuration registry for MetaMask",
"keywords": [
"MetaMask",
"Ethereum"
],
"homepage": "https://github.com/MetaMask/core/tree/main/packages/config-registry-controller#readme",
"bugs": {
"url": "https://github.com/MetaMask/core/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/MetaMask/core.git"
},
"license": "MIT",
"sideEffects": false,
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"./package.json": "./package.json"
},
"main": "./dist/index.cjs",
"types": "./dist/index.d.cts",
"files": [
"dist/"
],
"scripts": {
"build": "ts-bridge --project tsconfig.build.json --verbose --clean --no-references",
"build:all": "ts-bridge --project tsconfig.build.json --verbose --clean",
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/config-registry-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/config-registry-controller",
"publish:preview": "yarn npm publish --tag preview",
"since-latest-release": "../../scripts/since-latest-release.sh",
"test": "NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter",
"test:clean": "NODE_OPTIONS=--experimental-vm-modules jest --clearCache",
"test:verbose": "NODE_OPTIONS=--experimental-vm-modules jest --verbose",
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
},
"dependencies": {
"@metamask/base-controller": "^9.0.0",
"@metamask/controller-utils": "^11.18.0",
"@metamask/messenger": "^0.3.0",
"@metamask/network-controller": "^29.0.0",
"@metamask/polling-controller": "^16.0.2",
"@metamask/remote-feature-flag-controller": "^4.0.0",
"@metamask/utils": "^11.9.0"
},
"devDependencies": {
"@lavamoat/allow-scripts": "^3.0.4",
"@metamask/auto-changelog": "^3.4.4",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^27.4.1",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"nock": "^13.3.1",
"sinon": "^9.2.4",
"ts-jest": "^27.1.4",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~5.3.3"
},
"engines": {
"node": "^18.18 || >=20"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
}
}
Loading
Loading