@metamask-previews/network-controller 35.0.1-preview-2c4135ed6 → 35.0.1-preview-fa46676

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.
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getConfigRegistryEvmAutoEnabledChains = exports.getRpcFailoverMode = void 0;
4
- const utils_1 = require("@metamask/utils");
3
+ exports.getRpcFailoverMode = void 0;
5
4
  /**
6
5
  * Reads the RPC failover mode from the remote feature flags, defaulting to
7
6
  * `disabled` when the flag is absent or not a recognized value.
@@ -14,20 +13,4 @@ function getRpcFailoverMode(state) {
14
13
  return mode === 'enabled' || mode === 'forced' ? mode : 'disabled';
15
14
  }
16
15
  exports.getRpcFailoverMode = getRpcFailoverMode;
17
- /**
18
- * Returns the list of CAIP-2 chain IDs for networks that are auto-enabled in the
19
- * config registry.
20
- *
21
- * @param state - The config registry controller state.
22
- * @returns The list of CAIP-2 chain IDs for auto-enabled networks.
23
- */
24
- function getConfigRegistryEvmAutoEnabledChains(state) {
25
- return Object.values(state.configs.networks)
26
- .filter(({ chainId, config }) => chainId.startsWith(utils_1.KnownCaipNamespace.Eip155) &&
27
- config.isAutoEnabled &&
28
- config.isActive &&
29
- !config.isDeprecated)
30
- .map((config) => config.chainId);
31
- }
32
- exports.getConfigRegistryEvmAutoEnabledChains = getConfigRegistryEvmAutoEnabledChains;
33
16
  //# sourceMappingURL=selectors.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"selectors.cjs","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":";;;AAEA,2CAAkE;AAelE;;;;;;GAMG;AACH,SAAgB,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;AALD,gDAKC;AAED;;;;;;GAMG;AACH,SAAgB,qCAAqC,CACnD,KAAoC;IAEpC,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;SACzC,MAAM,CACL,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,CACtB,OAAO,CAAC,UAAU,CAAC,0BAAkB,CAAC,MAAM,CAAC;QAC7C,MAAM,CAAC,aAAa;QACpB,MAAM,CAAC,QAAQ;QACf,CAAC,MAAM,CAAC,YAAY,CACvB;SACA,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC;AAZD,sFAYC","sourcesContent":["import { ConfigRegistryControllerState } from '@metamask/config-registry-controller';\nimport { RemoteFeatureFlagControllerState } from '@metamask/remote-feature-flag-controller';\nimport { CaipChainId, KnownCaipNamespace } from '@metamask/utils';\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\n/**\n * Returns the list of CAIP-2 chain IDs for networks that are auto-enabled in the\n * config registry.\n *\n * @param state - The config registry controller state.\n * @returns The list of CAIP-2 chain IDs for auto-enabled networks.\n */\nexport function getConfigRegistryEvmAutoEnabledChains(\n state: ConfigRegistryControllerState,\n): CaipChainId[] {\n return Object.values(state.configs.networks)\n .filter(\n ({ chainId, config }) =>\n chainId.startsWith(KnownCaipNamespace.Eip155) &&\n config.isAutoEnabled &&\n config.isActive &&\n !config.isDeprecated,\n )\n .map((config) => config.chainId);\n}\n"]}
1
+ {"version":3,"file":"selectors.cjs","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":";;;AAeA;;;;;;GAMG;AACH,SAAgB,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;AALD,gDAKC","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"]}
@@ -1,6 +1,4 @@
1
- import { ConfigRegistryControllerState } from "@metamask/config-registry-controller";
2
1
  import { RemoteFeatureFlagControllerState } from "@metamask/remote-feature-flag-controller";
3
- import { CaipChainId } from "@metamask/utils";
4
2
  /**
5
3
  * The RPC failover behavior for Infura networks, controlled by the
6
4
  * `corePlatformRpcFailoverMode` remote feature flag.
@@ -21,12 +19,4 @@ export type RpcFailoverMode = 'disabled' | 'enabled' | 'forced';
21
19
  * @returns The RPC failover mode.
22
20
  */
23
21
  export declare function getRpcFailoverMode(state: RemoteFeatureFlagControllerState): RpcFailoverMode;
24
- /**
25
- * Returns the list of CAIP-2 chain IDs for networks that are auto-enabled in the
26
- * config registry.
27
- *
28
- * @param state - The config registry controller state.
29
- * @returns The list of CAIP-2 chain IDs for auto-enabled networks.
30
- */
31
- export declare function getConfigRegistryEvmAutoEnabledChains(state: ConfigRegistryControllerState): CaipChainId[];
32
22
  //# sourceMappingURL=selectors.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"selectors.d.cts","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,6CAA6C;AACrF,OAAO,EAAE,gCAAgC,EAAE,iDAAiD;AAC5F,OAAO,EAAE,WAAW,EAAsB,wBAAwB;AAElE;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEhE;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,gCAAgC,GACtC,eAAe,CAGjB;AAED;;;;;;GAMG;AACH,wBAAgB,qCAAqC,CACnD,KAAK,EAAE,6BAA6B,GACnC,WAAW,EAAE,CAUf"}
1
+ {"version":3,"file":"selectors.d.cts","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,iDAAiD;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"}
@@ -1,6 +1,4 @@
1
- import { ConfigRegistryControllerState } from "@metamask/config-registry-controller";
2
1
  import { RemoteFeatureFlagControllerState } from "@metamask/remote-feature-flag-controller";
3
- import { CaipChainId } from "@metamask/utils";
4
2
  /**
5
3
  * The RPC failover behavior for Infura networks, controlled by the
6
4
  * `corePlatformRpcFailoverMode` remote feature flag.
@@ -21,12 +19,4 @@ export type RpcFailoverMode = 'disabled' | 'enabled' | 'forced';
21
19
  * @returns The RPC failover mode.
22
20
  */
23
21
  export declare function getRpcFailoverMode(state: RemoteFeatureFlagControllerState): RpcFailoverMode;
24
- /**
25
- * Returns the list of CAIP-2 chain IDs for networks that are auto-enabled in the
26
- * config registry.
27
- *
28
- * @param state - The config registry controller state.
29
- * @returns The list of CAIP-2 chain IDs for auto-enabled networks.
30
- */
31
- export declare function getConfigRegistryEvmAutoEnabledChains(state: ConfigRegistryControllerState): CaipChainId[];
32
22
  //# sourceMappingURL=selectors.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"selectors.d.mts","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,6CAA6C;AACrF,OAAO,EAAE,gCAAgC,EAAE,iDAAiD;AAC5F,OAAO,EAAE,WAAW,EAAsB,wBAAwB;AAElE;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEhE;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,gCAAgC,GACtC,eAAe,CAGjB;AAED;;;;;;GAMG;AACH,wBAAgB,qCAAqC,CACnD,KAAK,EAAE,6BAA6B,GACnC,WAAW,EAAE,CAUf"}
1
+ {"version":3,"file":"selectors.d.mts","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,iDAAiD;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"}
@@ -1,4 +1,3 @@
1
- import { KnownCaipNamespace } from "@metamask/utils";
2
1
  /**
3
2
  * Reads the RPC failover mode from the remote feature flags, defaulting to
4
3
  * `disabled` when the flag is absent or not a recognized value.
@@ -10,19 +9,4 @@ export function getRpcFailoverMode(state) {
10
9
  const mode = state.remoteFeatureFlags.corePlatformRpcFailoverMode;
11
10
  return mode === 'enabled' || mode === 'forced' ? mode : 'disabled';
12
11
  }
13
- /**
14
- * Returns the list of CAIP-2 chain IDs for networks that are auto-enabled in the
15
- * config registry.
16
- *
17
- * @param state - The config registry controller state.
18
- * @returns The list of CAIP-2 chain IDs for auto-enabled networks.
19
- */
20
- export function getConfigRegistryEvmAutoEnabledChains(state) {
21
- return Object.values(state.configs.networks)
22
- .filter(({ chainId, config }) => chainId.startsWith(KnownCaipNamespace.Eip155) &&
23
- config.isAutoEnabled &&
24
- config.isActive &&
25
- !config.isDeprecated)
26
- .map((config) => config.chainId);
27
- }
28
12
  //# sourceMappingURL=selectors.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"selectors.mjs","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,kBAAkB,EAAE,wBAAwB;AAelE;;;;;;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;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qCAAqC,CACnD,KAAoC;IAEpC,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;SACzC,MAAM,CACL,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,CACtB,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC,MAAM,CAAC;QAC7C,MAAM,CAAC,aAAa;QACpB,MAAM,CAAC,QAAQ;QACf,CAAC,MAAM,CAAC,YAAY,CACvB;SACA,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC","sourcesContent":["import { ConfigRegistryControllerState } from '@metamask/config-registry-controller';\nimport { RemoteFeatureFlagControllerState } from '@metamask/remote-feature-flag-controller';\nimport { CaipChainId, KnownCaipNamespace } from '@metamask/utils';\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\n/**\n * Returns the list of CAIP-2 chain IDs for networks that are auto-enabled in the\n * config registry.\n *\n * @param state - The config registry controller state.\n * @returns The list of CAIP-2 chain IDs for auto-enabled networks.\n */\nexport function getConfigRegistryEvmAutoEnabledChains(\n state: ConfigRegistryControllerState,\n): CaipChainId[] {\n return Object.values(state.configs.networks)\n .filter(\n ({ chainId, config }) =>\n chainId.startsWith(KnownCaipNamespace.Eip155) &&\n config.isAutoEnabled &&\n config.isActive &&\n !config.isDeprecated,\n )\n .map((config) => config.chainId);\n}\n"]}
1
+ {"version":3,"file":"selectors.mjs","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": "35.0.1-preview-2c4135ed6",
3
+ "version": "35.0.1-preview-fa46676",
4
4
  "description": "Provides an interface to the currently selected network via a MetaMask-compatible provider object",
5
5
  "keywords": [
6
6
  "Ethereum",
@@ -57,7 +57,6 @@
57
57
  "dependencies": {
58
58
  "@metamask/analytics-controller": "^2.0.0",
59
59
  "@metamask/base-controller": "^9.1.0",
60
- "@metamask/config-registry-controller": "^3.0.0",
61
60
  "@metamask/connectivity-controller": "^0.3.0",
62
61
  "@metamask/controller-utils": "^12.3.0",
63
62
  "@metamask/eth-block-tracker": "^15.0.1",