@metamask-previews/network-controller 37.1.1-preview-9dfb538be → 37.1.1-preview-677dff22f
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.
- package/CHANGELOG.md +2 -7
- package/dist/NetworkController.d.ts +64 -12
- package/dist/NetworkController.d.ts.map +1 -1
- package/dist/NetworkController.js +26 -28
- package/dist/NetworkController.js.map +1 -1
- package/dist/selectors.d.ts +8 -22
- package/dist/selectors.d.ts.map +1 -1
- package/dist/selectors.js +7 -32
- package/dist/selectors.js.map +1 -1
- package/package.json +6 -8
package/dist/selectors.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { RemoteFeatureFlagControllerState } from '@metamask/remote-feature-flag-controller';
|
|
2
2
|
/**
|
|
3
|
-
* The
|
|
4
|
-
*
|
|
5
|
-
* feature flag).
|
|
3
|
+
* The RPC failover behavior for Infura networks, controlled by the
|
|
4
|
+
* `corePlatformRpcFailoverMode` remote feature flag.
|
|
6
5
|
*
|
|
7
6
|
* - `disabled`: failover URLs are ignored; traffic stays on the primary
|
|
8
7
|
* endpoint.
|
|
@@ -11,26 +10,13 @@ import { RemoteFeatureFlagControllerState } from '@metamask/remote-feature-flag-
|
|
|
11
10
|
* - `forced`: Infura endpoints that have failover URLs route all traffic to
|
|
12
11
|
* those failover URLs, bypassing Infura entirely.
|
|
13
12
|
*/
|
|
14
|
-
export
|
|
13
|
+
export type RpcFailoverMode = 'disabled' | 'enabled' | 'forced';
|
|
15
14
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
15
|
+
* Reads the RPC failover mode from the remote feature flags, defaulting to
|
|
16
|
+
* `disabled` when the flag is absent or not a recognized value.
|
|
18
17
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* - `enabled`: traffic automatically diverts to failover URLs when the primary
|
|
22
|
-
* endpoint is unavailable.
|
|
23
|
-
* - `forced`: Infura endpoints that have failover URLs route all traffic to
|
|
24
|
-
* those failover URLs, bypassing Infura entirely.
|
|
25
|
-
*/
|
|
26
|
-
export type RpcFailoverMode = (typeof RPC_FAILOVER_MODES)[number];
|
|
27
|
-
/**
|
|
28
|
-
* Reads the `corePlatformRpcFailoverMode` feature flag and attempts to
|
|
29
|
-
* interpret it.
|
|
30
|
-
*
|
|
31
|
-
* @param state - The RemoteFeatureFlagController state.
|
|
32
|
-
* @returns The RPC failover mode from `corePlatformRpcFailoverMode` if
|
|
33
|
-
* recognized, or `null` otherwise.
|
|
18
|
+
* @param state - The remote feature flag controller state.
|
|
19
|
+
* @returns The RPC failover mode.
|
|
34
20
|
*/
|
|
35
|
-
export declare function
|
|
21
|
+
export declare function getRpcFailoverMode(state: RemoteFeatureFlagControllerState): RpcFailoverMode;
|
|
36
22
|
//# sourceMappingURL=selectors.d.ts.map
|
package/dist/selectors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,0CAA0C,CAAC;
|
|
1
|
+
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,0CAA0C,CAAC;AAE5F;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEhE;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,gCAAgC,GACtC,eAAe,CAGjB"}
|
package/dist/selectors.js
CHANGED
|
@@ -1,37 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* feature flag).
|
|
2
|
+
* Reads the RPC failover mode from the remote feature flags, defaulting to
|
|
3
|
+
* `disabled` when the flag is absent or not a recognized value.
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* - `enabled`: traffic automatically diverts to failover URLs when the primary
|
|
9
|
-
* endpoint is unavailable.
|
|
10
|
-
* - `forced`: Infura endpoints that have failover URLs route all traffic to
|
|
11
|
-
* those failover URLs, bypassing Infura entirely.
|
|
5
|
+
* @param state - The remote feature flag controller state.
|
|
6
|
+
* @returns The RPC failover mode.
|
|
12
7
|
*/
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
* `corePlatformRpcFailoverMode` feature flag) is one of the possible RPC
|
|
17
|
-
* failover modes.
|
|
18
|
-
*
|
|
19
|
-
* @param value - A value to check.
|
|
20
|
-
* @returns True if given a true RPC failover mode, false otherwise.
|
|
21
|
-
*/
|
|
22
|
-
function isRpcFailoverMode(value) {
|
|
23
|
-
return RPC_FAILOVER_MODES.includes(value);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Reads the `corePlatformRpcFailoverMode` feature flag and attempts to
|
|
27
|
-
* interpret it.
|
|
28
|
-
*
|
|
29
|
-
* @param state - The RemoteFeatureFlagController state.
|
|
30
|
-
* @returns The RPC failover mode from `corePlatformRpcFailoverMode` if
|
|
31
|
-
* recognized, or `null` otherwise.
|
|
32
|
-
*/
|
|
33
|
-
export function selectRpcFailoverModeFeatureFlag(state) {
|
|
34
|
-
const rpcFailoverMode = state.remoteFeatureFlags.corePlatformRpcFailoverMode;
|
|
35
|
-
return isRpcFailoverMode(rpcFailoverMode) ? rpcFailoverMode : null;
|
|
8
|
+
export function getRpcFailoverMode(state) {
|
|
9
|
+
const mode = state.remoteFeatureFlags.corePlatformRpcFailoverMode;
|
|
10
|
+
return mode === 'enabled' || mode === 'forced' ? mode : 'disabled';
|
|
36
11
|
}
|
|
37
12
|
//# sourceMappingURL=selectors.js.map
|
package/dist/selectors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.js","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"selectors.js","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"AAeA;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAAuC;IAEvC,MAAM,IAAI,GAAG,KAAK,CAAC,kBAAkB,CAAC,2BAA2B,CAAC;IAClE,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC;AACrE,CAAC","sourcesContent":["import { RemoteFeatureFlagControllerState } from '@metamask/remote-feature-flag-controller';\n\n/**\n * The RPC failover behavior for Infura networks, controlled by the\n * `corePlatformRpcFailoverMode` remote feature flag.\n *\n * - `disabled`: failover URLs are ignored; traffic stays on the primary\n * endpoint.\n * - `enabled`: traffic automatically diverts to failover URLs when the primary\n * endpoint is unavailable.\n * - `forced`: Infura endpoints that have failover URLs route all traffic to\n * those failover URLs, bypassing Infura entirely.\n */\nexport type RpcFailoverMode = 'disabled' | 'enabled' | 'forced';\n\n/**\n * Reads the RPC failover mode from the remote feature flags, defaulting to\n * `disabled` when the flag is absent or not a recognized value.\n *\n * @param state - The remote feature flag controller state.\n * @returns The RPC failover mode.\n */\nexport function getRpcFailoverMode(\n state: RemoteFeatureFlagControllerState,\n): RpcFailoverMode {\n const mode = state.remoteFeatureFlags.corePlatformRpcFailoverMode;\n return mode === 'enabled' || mode === 'forced' ? mode : 'disabled';\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/network-controller",
|
|
3
|
-
"version": "37.1.1-preview-
|
|
3
|
+
"version": "37.1.1-preview-677dff22f",
|
|
4
4
|
"description": "Provides an interface to the currently selected network via a MetaMask-compatible provider object",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ethereum",
|
|
@@ -32,14 +32,13 @@
|
|
|
32
32
|
"registry": "https://registry.npmjs.org/"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
|
-
"allow-scripts": "yarn workspace @metamask/core-monorepo run allow-scripts",
|
|
36
35
|
"build": "tsc --project tsconfig.build.json",
|
|
37
36
|
"build:all": "tsc --build tsconfig.build.json --verbose",
|
|
38
37
|
"build:clean": "yarn build:only-clean && yarn build",
|
|
39
38
|
"build:docs": "typedoc",
|
|
40
39
|
"build:only-clean": "rimraf './dist' './tsconfig.build.tsbuildinfo'",
|
|
41
40
|
"changelog:update": "../../scripts/update-changelog.sh @metamask/network-controller",
|
|
42
|
-
"changelog:validate": "../../scripts/validate-changelog.sh",
|
|
41
|
+
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/network-controller",
|
|
43
42
|
"lint:tsconfigs": "node --import ../../scripts/resolver/register.ts ../../scripts/lint-tsconfigs/lint-tsconfigs.ts",
|
|
44
43
|
"lint:tsconfigs:fix": "node --import ../../scripts/resolver/register.ts ../../scripts/lint-tsconfigs/lint-tsconfigs.ts --fix",
|
|
45
44
|
"messenger-action-types:check": "node --import ../../scripts/resolver/register.ts ../../packages/messenger-cli/src/cli.ts --formatter oxfmt --esm --check",
|
|
@@ -47,12 +46,11 @@
|
|
|
47
46
|
"since-latest-release": "../../scripts/since-latest-release.sh",
|
|
48
47
|
"test": "vitest",
|
|
49
48
|
"test:clean": "vitest --clearCache",
|
|
50
|
-
"test:coverage": "vitest --coverage",
|
|
51
49
|
"test:verbose": "vitest --reporter=verbose",
|
|
52
50
|
"test:watch": "vitest --watch"
|
|
53
51
|
},
|
|
54
52
|
"dependencies": {
|
|
55
|
-
"@metamask/analytics-controller": "^4.
|
|
53
|
+
"@metamask/analytics-controller": "^4.1.0",
|
|
56
54
|
"@metamask/base-controller": "^10.1.0",
|
|
57
55
|
"@metamask/config-registry-controller": "^5.0.0",
|
|
58
56
|
"@metamask/connectivity-controller": "^1.0.0",
|
|
@@ -74,11 +72,11 @@
|
|
|
74
72
|
"loglevel": "^1.9.2",
|
|
75
73
|
"reselect": "^5.3.0",
|
|
76
74
|
"uri-js": "^4.4.1",
|
|
77
|
-
"uuid": "^14.0.
|
|
75
|
+
"uuid": "^14.0.0"
|
|
78
76
|
},
|
|
79
77
|
"devDependencies": {
|
|
80
78
|
"@json-rpc-specification/meta-schema": "^1.0.6",
|
|
81
|
-
"@metamask/auto-changelog": "^
|
|
79
|
+
"@metamask/auto-changelog": "^6.2.1",
|
|
82
80
|
"@types/deep-freeze-strict": "^1.1.0",
|
|
83
81
|
"@types/lodash-es": "^4.17.12",
|
|
84
82
|
"@types/node-fetch": "^2.6.12",
|
|
@@ -94,7 +92,7 @@
|
|
|
94
92
|
"typedoc": "^0.28.20",
|
|
95
93
|
"typedoc-plugin-missing-exports": "^4.1.4",
|
|
96
94
|
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
97
|
-
"vitest": "5.0.
|
|
95
|
+
"vitest": "^5.0.0"
|
|
98
96
|
},
|
|
99
97
|
"engines": {
|
|
100
98
|
"node": "^22.14.0 || ^24 || ^26"
|