@metamask/selected-network-controller 26.1.0 → 26.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/CHANGELOG.md +36 -16
  2. package/package.json +21 -20
package/CHANGELOG.md CHANGED
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [26.1.2]
11
+
12
+ ### Changed
13
+
14
+ - Bump `@metamask/permission-controller` from `^13.0.0` to `^13.1.1` ([#8722](https://github.com/MetaMask/core/pull/8722), [#8755](https://github.com/MetaMask/core/pull/8755))
15
+ - Bump `@metamask/json-rpc-engine` from `^10.3.0` to `^10.5.0` ([#8746](https://github.com/MetaMask/core/pull/8746), [#8753](https://github.com/MetaMask/core/pull/8753))
16
+ - Bump `@metamask/network-controller` from `^30.1.0` to `^31.0.0` ([#8755](https://github.com/MetaMask/core/pull/8755))
17
+
18
+ ## [26.1.1]
19
+
20
+ ### Changed
21
+
22
+ - Bump `@metamask/permission-controller` from `^12.3.0` to `^13.0.0` ([#8661](https://github.com/MetaMask/core/pull/8661))
23
+ - Bump `@metamask/json-rpc-engine` from `^10.2.4` to `^10.3.0` ([#8661](https://github.com/MetaMask/core/pull/8661))
24
+ - Bump `@metamask/messenger` from `^1.0.0` to `^1.2.0` ([#8364](https://github.com/MetaMask/core/pull/8364), [#8373](https://github.com/MetaMask/core/pull/8373), [#8632](https://github.com/MetaMask/core/pull/8632))
25
+ - Bump `@metamask/base-controller` from `^9.0.1` to `^9.1.0` ([#8457](https://github.com/MetaMask/core/pull/8457))
26
+ - Bump `@metamask/network-controller` from `^30.0.1` to `^30.1.0` ([#8636](https://github.com/MetaMask/core/pull/8636))
27
+
10
28
  ## [26.1.0]
11
29
 
12
30
  ### Added
@@ -148,7 +166,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
148
166
 
149
167
  ### Changed
150
168
 
151
- - Bump `@metamask/base-controller` from `^7.0.0` to `^7.1.1` ([#5079](https://github.com/MetaMask/core/pull/5079)), [#5135](https://github.com/MetaMask/core/pull/5135))
169
+ - Bump `@metamask/base-controller` from `^7.0.0` to `^7.1.1`, [#5135](https://github.com/MetaMask/core/pull/5135)) ([#5079](https://github.com/MetaMask/core/pull/5079))
152
170
  - Bump `@metamask/json-rpc-engine` from `^10.0.1` to `^10.0.2` ([#5082](https://github.com/MetaMask/core/pull/5082))
153
171
  - Bump `@metamask/utils` from `^10.0.0` to `^11.0.1` ([#5080](https://github.com/MetaMask/core/pull/5080))
154
172
  - This upgrade is not a breaking change because this package does not use `generateRandomMnemonic`.
@@ -209,7 +227,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
209
227
  ["Are the Types Wrong?"](https://arethetypeswrong.github.io/) tool as
210
228
  ["masquerading as CJS"](https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseCJS.md).
211
229
  All of the ATTW checks now pass.
212
- - Remove chunk files ([#4648](https://github.com/MetaMask/core/pull/4648)).
230
+ - Remove chunk files. ([#4648](https://github.com/MetaMask/core/pull/4648))
213
231
  - Previously, the build tool we used to generate JavaScript files extracted
214
232
  common code to "chunk" files. While this was intended to make this package
215
233
  more tree-shakeable, it also made debugging more difficult for our
@@ -355,20 +373,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
355
373
 
356
374
  ### Changed
357
375
 
358
- - **BREAKING:** `setNetworkClientIdForDomain` now throws an error if passed `metamask` for the domain param ([#3908](https://github.com/MetaMask/core/pull/3908)).
359
- - **BREAKING:** `setNetworkClientIdForDomain` now fails and throws an error if the passed in `domain` is not currently permissioned in the `PermissionsController` ([#3908](https://github.com/MetaMask/core/pull/3908)).
360
- - **BREAKING:** the `domains` state now no longer contains a `metamask` domain key. Consumers should instead use the `selectedNetworkClientId` from the `NetworkController` to get the selected network for the `metamask` domain ([#3908](https://github.com/MetaMask/core/pull/3908)).
361
- - **BREAKING:** `getProviderAndBlockTracker` now throws an error if called with any domain while the `perDomainNetwork` flag is false. Consumers should instead use the `provider` and `blockTracker` from the `NetworkController` when the `perDomainNetwork` flag is false ([#3908](https://github.com/MetaMask/core/pull/3908)).
362
- - **BREAKING:** `getProviderAndBlockTracker` now throws an error if called with a domain that does not have a networkClientId set ([#3908](https://github.com/MetaMask/core/pull/3908)).
363
- - **BREAKING:** `getNetworkClientIdForDomain` now returns the `selectedNetworkClientId` for the globally selected network if the `perDomainNetwork` flag is false or if the domain is not in the `domains` state ([#3908](https://github.com/MetaMask/core/pull/3908)).
376
+ - **BREAKING:** `setNetworkClientIdForDomain` now throws an error if passed `metamask` for the domain param. ([#3908](https://github.com/MetaMask/core/pull/3908))
377
+ - **BREAKING:** `setNetworkClientIdForDomain` now fails and throws an error if the passed in `domain` is not currently permissioned in the `PermissionsController`. ([#3908](https://github.com/MetaMask/core/pull/3908))
378
+ - **BREAKING:** the `domains` state now no longer contains a `metamask` domain key. Consumers should instead use the `selectedNetworkClientId` from the `NetworkController` to get the selected network for the `metamask` domain. ([#3908](https://github.com/MetaMask/core/pull/3908))
379
+ - **BREAKING:** `getProviderAndBlockTracker` now throws an error if called with any domain while the `perDomainNetwork` flag is false. Consumers should instead use the `provider` and `blockTracker` from the `NetworkController` when the `perDomainNetwork` flag is false. ([#3908](https://github.com/MetaMask/core/pull/3908))
380
+ - **BREAKING:** `getProviderAndBlockTracker` now throws an error if called with a domain that does not have a networkClientId set. ([#3908](https://github.com/MetaMask/core/pull/3908))
381
+ - **BREAKING:** `getNetworkClientIdForDomain` now returns the `selectedNetworkClientId` for the globally selected network if the `perDomainNetwork` flag is false or if the domain is not in the `domains` state. ([#3908](https://github.com/MetaMask/core/pull/3908))
364
382
 
365
383
  ### Removed
366
384
 
367
- - **BREAKING:** Remove logic in `selectedNetworkMiddleware` to set a default `networkClientId` for the requesting origin in the `SelectedNetworkController` when not already set. Now if `networkClientId` is not already set for the requesting origin, the middleware will not set a default `networkClientId` for that origin in the `SelectedNetworkController` but will continue to add the `selectedNetworkClientId` from the `NetworkController` to the `networkClientId` property on the request object ([#3908](https://github.com/MetaMask/core/pull/3908)).
385
+ - **BREAKING:** Remove logic in `selectedNetworkMiddleware` to set a default `networkClientId` for the requesting origin in the `SelectedNetworkController` when not already set. Now if `networkClientId` is not already set for the requesting origin, the middleware will not set a default `networkClientId` for that origin in the `SelectedNetworkController` but will continue to add the `selectedNetworkClientId` from the `NetworkController` to the `networkClientId` property on the request object. ([#3908](https://github.com/MetaMask/core/pull/3908))
368
386
 
369
387
  ### Fixed
370
388
 
371
- - The `SelectedNetworkController` now listens for `networkConfiguration` removal events on the `NetworkController` and updates domains pointed at a removed `networkClientId` to the `selectedNetworkClientId` ([#3926](https://github.com/MetaMask/core/pull/3926)).
389
+ - The `SelectedNetworkController` now listens for `networkConfiguration` removal events on the `NetworkController` and updates domains pointed at a removed `networkClientId` to the `selectedNetworkClientId`. ([#3926](https://github.com/MetaMask/core/pull/3926))
372
390
 
373
391
  ## [7.0.1]
374
392
 
@@ -398,14 +416,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
398
416
 
399
417
  ### Added
400
418
 
401
- - Add `SelectedNetworkMiddlewareJsonRpcRequest` type ([#1970](https://github.com/MetaMask/core/pull/1970)).
402
- - Add `setPerDomainNetwork` method to reset proxies when flag toggled ([#3593](https://github.com/MetaMask/core/pull/3593)).
403
- - Add `state` as a constructor argument ([#3585](https://github.com/MetaMask/core/pull/3585)).
419
+ - Add `SelectedNetworkMiddlewareJsonRpcRequest` type. ([#1970](https://github.com/MetaMask/core/pull/1970))
420
+ - Add `setPerDomainNetwork` method to reset proxies when flag toggled. ([#3593](https://github.com/MetaMask/core/pull/3593))
421
+ - Add `state` as a constructor argument. ([#3585](https://github.com/MetaMask/core/pull/3585))
404
422
 
405
423
  ### Changed
406
424
 
407
- - **BREAKING:** Rename `SelectedNetworkControllerAction` to `SelectedNetworkControllerActions` and `SelectedNetworkControllerEvent` to `SelectedNetworkControllerEvents` for consistency with corresponding type exports from other controllers ([#1970](https://github.com/MetaMask/core/pull/1970)).
408
- - **BREAKING:** `createSelectedNetworkMiddleware` return type is constrained to satisfy `JsonRpcMiddleware<JsonRpcParams, Json>`, and its `req` parameter is constrained to satisfy `SelectedNetworkMiddlewareJsonRpcRequest` ([#1970](https://github.com/MetaMask/core/pull/1970)).
425
+ - **BREAKING:** Rename `SelectedNetworkControllerAction` to `SelectedNetworkControllerActions` and `SelectedNetworkControllerEvent` to `SelectedNetworkControllerEvents` for consistency with corresponding type exports from other controllers. ([#1970](https://github.com/MetaMask/core/pull/1970))
426
+ - **BREAKING:** `createSelectedNetworkMiddleware` return type is constrained to satisfy `JsonRpcMiddleware<JsonRpcParams, Json>`, and its `req` parameter is constrained to satisfy `SelectedNetworkMiddlewareJsonRpcRequest`. ([#1970](https://github.com/MetaMask/core/pull/1970))
409
427
 
410
428
  ## [4.0.0]
411
429
 
@@ -469,7 +487,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
469
487
 
470
488
  - Initial Release ([#1643](https://github.com/MetaMask/core/pull/1643))
471
489
 
472
- [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/selected-network-controller@26.1.0...HEAD
490
+ [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/selected-network-controller@26.1.2...HEAD
491
+ [26.1.2]: https://github.com/MetaMask/core/compare/@metamask/selected-network-controller@26.1.1...@metamask/selected-network-controller@26.1.2
492
+ [26.1.1]: https://github.com/MetaMask/core/compare/@metamask/selected-network-controller@26.1.0...@metamask/selected-network-controller@26.1.1
473
493
  [26.1.0]: https://github.com/MetaMask/core/compare/@metamask/selected-network-controller@26.0.3...@metamask/selected-network-controller@26.1.0
474
494
  [26.0.3]: https://github.com/MetaMask/core/compare/@metamask/selected-network-controller@26.0.2...@metamask/selected-network-controller@26.0.3
475
495
  [26.0.2]: https://github.com/MetaMask/core/compare/@metamask/selected-network-controller@26.0.1...@metamask/selected-network-controller@26.0.2
package/package.json CHANGED
@@ -1,21 +1,26 @@
1
1
  {
2
2
  "name": "@metamask/selected-network-controller",
3
- "version": "26.1.0",
3
+ "version": "26.1.2",
4
4
  "description": "Provides an interface to the currently selected networkClientId for a given domain",
5
5
  "keywords": [
6
- "MetaMask",
7
- "Ethereum"
6
+ "Ethereum",
7
+ "MetaMask"
8
8
  ],
9
9
  "homepage": "https://github.com/MetaMask/core/tree/main/packages/selected-network-controller#readme",
10
10
  "bugs": {
11
11
  "url": "https://github.com/MetaMask/core/issues"
12
12
  },
13
+ "license": "MIT",
13
14
  "repository": {
14
15
  "type": "git",
15
16
  "url": "https://github.com/MetaMask/core.git"
16
17
  },
17
- "license": "MIT",
18
+ "files": [
19
+ "dist/"
20
+ ],
18
21
  "sideEffects": false,
22
+ "main": "./dist/index.cjs",
23
+ "types": "./dist/index.d.cts",
19
24
  "exports": {
20
25
  ".": {
21
26
  "import": {
@@ -29,18 +34,18 @@
29
34
  },
30
35
  "./package.json": "./package.json"
31
36
  },
32
- "main": "./dist/index.cjs",
33
- "types": "./dist/index.d.cts",
34
- "files": [
35
- "dist/"
36
- ],
37
+ "publishConfig": {
38
+ "access": "public",
39
+ "registry": "https://registry.npmjs.org/"
40
+ },
37
41
  "scripts": {
38
42
  "build": "ts-bridge --project tsconfig.build.json --verbose --clean --no-references",
39
43
  "build:all": "ts-bridge --project tsconfig.build.json --verbose --clean",
40
44
  "build:docs": "typedoc",
41
45
  "changelog:update": "../../scripts/update-changelog.sh @metamask/selected-network-controller",
42
46
  "changelog:validate": "../../scripts/validate-changelog.sh @metamask/selected-network-controller",
43
- "generate-method-action-types": "tsx ../../scripts/generate-method-action-types.ts",
47
+ "messenger-action-types:check": "tsx ../../packages/messenger-cli/src/cli.ts --formatter oxfmt --check",
48
+ "messenger-action-types:generate": "tsx ../../packages/messenger-cli/src/cli.ts --formatter oxfmt --generate",
44
49
  "since-latest-release": "../../scripts/since-latest-release.sh",
45
50
  "test": "NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter",
46
51
  "test:clean": "NODE_OPTIONS=--experimental-vm-modules jest --clearCache",
@@ -48,16 +53,16 @@
48
53
  "test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
49
54
  },
50
55
  "dependencies": {
51
- "@metamask/base-controller": "^9.0.1",
52
- "@metamask/json-rpc-engine": "^10.2.4",
53
- "@metamask/messenger": "^1.0.0",
54
- "@metamask/network-controller": "^30.0.1",
55
- "@metamask/permission-controller": "^12.3.0",
56
+ "@metamask/base-controller": "^9.1.0",
57
+ "@metamask/json-rpc-engine": "^10.5.0",
58
+ "@metamask/messenger": "^1.2.0",
59
+ "@metamask/network-controller": "^31.0.0",
60
+ "@metamask/permission-controller": "^13.1.1",
56
61
  "@metamask/swappable-obj-proxy": "^2.3.0",
57
62
  "@metamask/utils": "^11.9.0"
58
63
  },
59
64
  "devDependencies": {
60
- "@metamask/auto-changelog": "^3.4.4",
65
+ "@metamask/auto-changelog": "^6.1.0",
61
66
  "@ts-bridge/cli": "^0.6.4",
62
67
  "@types/jest": "^29.5.14",
63
68
  "deepmerge": "^4.2.2",
@@ -74,9 +79,5 @@
74
79
  },
75
80
  "engines": {
76
81
  "node": "^18.18 || >=20"
77
- },
78
- "publishConfig": {
79
- "access": "public",
80
- "registry": "https://registry.npmjs.org/"
81
82
  }
82
83
  }