@metamask-previews/config-registry-controller 3.0.0-preview-bbf9454b2 → 3.0.0-preview-d23deb68f

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 CHANGED
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Added
11
+
12
+ - Add optional `isAutoEnabled?: boolean` property to `RegistryNetworkConfig.config` ([#9879](https://github.com/MetaMask/core/pull/9879))
13
+ - Add `selectEvmAutoEnabledNetworksChainIds` selector to retrieve the CAIP-2 chain IDs of all EVM networks that are auto-enabled ([#9879](https://github.com/MetaMask/core/pull/9879))
14
+
10
15
  ### Changed
11
16
 
12
17
  - Bump `@metamask/remote-feature-flag-controller` from `^5.0.0` to `^6.0.0` ([#9945](https://github.com/MetaMask/core/pull/9945))
@@ -36,6 +36,7 @@ const ChainConfigSchema = (0, superstruct_1.type)({
36
36
  isFeatured: (0, superstruct_1.boolean)(),
37
37
  isDeprecated: (0, superstruct_1.boolean)(),
38
38
  isDeletable: (0, superstruct_1.boolean)(),
39
+ isAutoEnabled: (0, superstruct_1.optional)((0, superstruct_1.boolean)()),
39
40
  priority: (0, superstruct_1.number)(),
40
41
  });
41
42
  const NetworkContractsSchema = (0, superstruct_1.type)({
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../src/config-registry-api-service/types.ts"],"names":[],"mappings":";;;AACA,uDAQ+B;AAC/B,2CAAqE;AAErE,MAAM,WAAW,GAAG,IAAA,kBAAI,EAAC;IACvB,OAAO,EAAE,IAAA,oBAAM,GAAE;IACjB,QAAQ,EAAE,IAAA,oBAAM,GAAE;IAClB,IAAI,EAAE,IAAA,oBAAM,GAAE;IACd,MAAM,EAAE,IAAA,oBAAM,GAAE;IAChB,QAAQ,EAAE,IAAA,oBAAM,GAAE;IAClB,eAAe,EAAE,IAAA,sB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AAG,IAAA,kBAAI,EAAC;IAC9C,OAAO,EAAE,yBAAiB;IAC1B,IAAI,EAAE,IAAA,oBAAM,GAAE;IACd,QAAQ,EAAE,IAAA,oBAAM,GAAE;IAClB,mBAAmB,EAAE,IAAA,oBAAM,GAAE;IAC7B,uBAAuB,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;IAC3C,MAAM,EAAE,YAAY;IACpB,YAAY,EAAE,kBAAkB;IAChC,iBAAiB,EAAE,uBAAuB;IAC1C,MAAM,EAAE,iBAAiB;IACzB,SAAS,EAAE,IAAA,sBAAQ,EAAC,sBAAsB,CAAC;CAC5C,CAAC,CAAC;AAEH;;GAEG;AACU,QAAA,+BAA+B,GAAG,IAAA,kBAAI,EAAC;IAClD,IAAI,EAAE,IAAA,kBAAI,EAAC;QACT,OAAO,EAAE,IAAA,oBAAM,GAAE;QACjB,SAAS,EAAE,IAAA,oBAAM,GAAE;QACnB,MAAM,EAAE,IAAA,mBAAK,EAAC,mCAA2B,CAAC;KAC3C,CAAC;CACH,CAAC,CAAC;AAQH,SAAgB,iCAAiC,CAC/C,IAAa;IAEb,IAAA,oBAAM,EAAC,IAAI,EAAE,uCAA+B,CAAC,CAAC;AAChD,CAAC;AAJD,8EAIC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n array,\n assert,\n boolean,\n number,\n optional,\n string,\n type,\n} from '@metamask/superstruct';\nimport { CaipChainIdStruct, StrictHexStruct } from '@metamask/utils';\n\nconst AssetSchema = type({\n assetId: string(),\n imageUrl: string(),\n name: string(),\n symbol: string(),\n decimals: number(),\n coingeckoCoinId: optional(string()),\n});\n\nconst AssetsSchema = type({\n listUrl: optional(string()),\n native: AssetSchema,\n governance: optional(AssetSchema),\n});\n\nconst RpcProviderSchema = type({\n url: string(),\n type: string(),\n networkClientId: string(),\n});\n\nconst RpcProvidersSchema = type({\n default: RpcProviderSchema,\n fallbacks: array(string()),\n});\n\nconst BlockExplorerUrlsSchema = type({\n default: string(),\n fallbacks: array(string()),\n});\n\nconst ChainConfigSchema = type({\n isActive: boolean(),\n isTestnet: boolean(),\n isDefault: boolean(),\n isFeatured: boolean(),\n isDeprecated: boolean(),\n isDeletable: boolean(),\n priority: number(),\n});\n\nconst NetworkContractsSchema = type({\n multicall3: optional(StrictHexStruct),\n});\n\n/**\n * Schema for a single chain in the CAIP-2 config registry API response.\n * chainId is in CAIP-2 format (e.g. \"eip155:1\", \"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp\").\n */\nexport const RegistryNetworkConfigSchema = type({\n chainId: CaipChainIdStruct,\n name: string(),\n imageUrl: string(),\n coingeckoPlatformId: string(),\n geckoTerminalPlatformId: optional(string()),\n assets: AssetsSchema,\n rpcProviders: RpcProvidersSchema,\n blockExplorerUrls: BlockExplorerUrlsSchema,\n config: ChainConfigSchema,\n contracts: optional(NetworkContractsSchema),\n});\n\n/**\n * Top-level API response shape. Uses `data.chains` (CAIP-2) and `data.version`.\n */\nexport const RegistryConfigApiResponseSchema = type({\n data: type({\n version: string(),\n timestamp: number(),\n chains: array(RegistryNetworkConfigSchema),\n }),\n});\n\nexport type RegistryNetworkConfig = Infer<typeof RegistryNetworkConfigSchema>;\n\nexport type RegistryConfigApiResponse = Infer<\n typeof RegistryConfigApiResponseSchema\n>;\n\nexport function validateRegistryConfigApiResponse(\n data: unknown,\n): asserts data is RegistryConfigApiResponse {\n assert(data, RegistryConfigApiResponseSchema);\n}\n\nexport type FetchConfigOptions = {\n etag?: string;\n};\n\nexport type FetchConfigResult =\n | {\n modified: false;\n etag?: string;\n /**\n * Cached data from the service when available (e.g. after a previous\n * successful fetch). Omitted when the service has no cache yet.\n */\n data?: RegistryConfigApiResponse;\n }\n | {\n modified: true;\n data: RegistryConfigApiResponse;\n etag?: string;\n };\n"]}
1
+ {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../src/config-registry-api-service/types.ts"],"names":[],"mappings":";;;AACA,uDAQ+B;AAC/B,2CAAqE;AAErE,M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GAAE;IACvB,WAAW,EAAE,IAAA,qBAAO,GAAE;IACtB,aAAa,EAAE,IAAA,sBAAQ,EAAC,IAAA,qBAAO,GAAE,CAAC;IAClC,QAAQ,EAAE,IAAA,oBAAM,GAAE;CACnB,CAAC,CAAC;AAEH,MAAM,sBAAsB,GAAG,IAAA,kBAAI,EAAC;IAClC,UAAU,EAAE,IAAA,sBAAQ,EAAC,uBAAe,CAAC;CACtC,CAAC,CAAC;AAEH;;;GAGG;AACU,QAAA,2BAA2B,GAAG,IAAA,kBAAI,EAAC;IAC9C,OAAO,EAAE,yBAAiB;IAC1B,IAAI,EAAE,IAAA,oBAAM,GAAE;IACd,QAAQ,EAAE,IAAA,oBAAM,GAAE;IAClB,mBAAmB,EAAE,IAAA,oBAAM,GAAE;IAC7B,uBAAuB,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;IAC3C,MAAM,EAAE,YAAY;IACpB,YAAY,EAAE,kBAAkB;IAChC,iBAAiB,EAAE,uBAAuB;IAC1C,MAAM,EAAE,iBAAiB;IACzB,SAAS,EAAE,IAAA,sBAAQ,EAAC,sBAAsB,CAAC;CAC5C,CAAC,CAAC;AAEH;;GAEG;AACU,QAAA,+BAA+B,GAAG,IAAA,kBAAI,EAAC;IAClD,IAAI,EAAE,IAAA,kBAAI,EAAC;QACT,OAAO,EAAE,IAAA,oBAAM,GAAE;QACjB,SAAS,EAAE,IAAA,oBAAM,GAAE;QACnB,MAAM,EAAE,IAAA,mBAAK,EAAC,mCAA2B,CAAC;KAC3C,CAAC;CACH,CAAC,CAAC;AAQH,SAAgB,iCAAiC,CAC/C,IAAa;IAEb,IAAA,oBAAM,EAAC,IAAI,EAAE,uCAA+B,CAAC,CAAC;AAChD,CAAC;AAJD,8EAIC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n array,\n assert,\n boolean,\n number,\n optional,\n string,\n type,\n} from '@metamask/superstruct';\nimport { CaipChainIdStruct, StrictHexStruct } from '@metamask/utils';\n\nconst AssetSchema = type({\n assetId: string(),\n imageUrl: string(),\n name: string(),\n symbol: string(),\n decimals: number(),\n coingeckoCoinId: optional(string()),\n});\n\nconst AssetsSchema = type({\n listUrl: optional(string()),\n native: AssetSchema,\n governance: optional(AssetSchema),\n});\n\nconst RpcProviderSchema = type({\n url: string(),\n type: string(),\n networkClientId: string(),\n});\n\nconst RpcProvidersSchema = type({\n default: RpcProviderSchema,\n fallbacks: array(string()),\n});\n\nconst BlockExplorerUrlsSchema = type({\n default: string(),\n fallbacks: array(string()),\n});\n\nconst ChainConfigSchema = type({\n isActive: boolean(),\n isTestnet: boolean(),\n isDefault: boolean(),\n isFeatured: boolean(),\n isDeprecated: boolean(),\n isDeletable: boolean(),\n isAutoEnabled: optional(boolean()),\n priority: number(),\n});\n\nconst NetworkContractsSchema = type({\n multicall3: optional(StrictHexStruct),\n});\n\n/**\n * Schema for a single chain in the CAIP-2 config registry API response.\n * chainId is in CAIP-2 format (e.g. \"eip155:1\", \"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp\").\n */\nexport const RegistryNetworkConfigSchema = type({\n chainId: CaipChainIdStruct,\n name: string(),\n imageUrl: string(),\n coingeckoPlatformId: string(),\n geckoTerminalPlatformId: optional(string()),\n assets: AssetsSchema,\n rpcProviders: RpcProvidersSchema,\n blockExplorerUrls: BlockExplorerUrlsSchema,\n config: ChainConfigSchema,\n contracts: optional(NetworkContractsSchema),\n});\n\n/**\n * Top-level API response shape. Uses `data.chains` (CAIP-2) and `data.version`.\n */\nexport const RegistryConfigApiResponseSchema = type({\n data: type({\n version: string(),\n timestamp: number(),\n chains: array(RegistryNetworkConfigSchema),\n }),\n});\n\nexport type RegistryNetworkConfig = Infer<typeof RegistryNetworkConfigSchema>;\n\nexport type RegistryConfigApiResponse = Infer<\n typeof RegistryConfigApiResponseSchema\n>;\n\nexport function validateRegistryConfigApiResponse(\n data: unknown,\n): asserts data is RegistryConfigApiResponse {\n assert(data, RegistryConfigApiResponseSchema);\n}\n\nexport type FetchConfigOptions = {\n etag?: string;\n};\n\nexport type FetchConfigResult =\n | {\n modified: false;\n etag?: string;\n /**\n * Cached data from the service when available (e.g. after a previous\n * successful fetch). Omitted when the service has no cache yet.\n */\n data?: RegistryConfigApiResponse;\n }\n | {\n modified: true;\n data: RegistryConfigApiResponse;\n etag?: string;\n };\n"]}
@@ -47,6 +47,7 @@ export declare const RegistryNetworkConfigSchema: import("@metamask/superstruct"
47
47
  isDeprecated: boolean;
48
48
  isDeletable: boolean;
49
49
  priority: number;
50
+ isAutoEnabled?: boolean | undefined;
50
51
  };
51
52
  geckoTerminalPlatformId?: string | undefined;
52
53
  contracts?: {
@@ -143,6 +144,7 @@ export declare const RegistryNetworkConfigSchema: import("@metamask/superstruct"
143
144
  isDeprecated: boolean;
144
145
  isDeletable: boolean;
145
146
  priority: number;
147
+ isAutoEnabled?: boolean | undefined;
146
148
  }, {
147
149
  isActive: import("@metamask/superstruct").Struct<boolean, null>;
148
150
  isTestnet: import("@metamask/superstruct").Struct<boolean, null>;
@@ -150,6 +152,7 @@ export declare const RegistryNetworkConfigSchema: import("@metamask/superstruct"
150
152
  isFeatured: import("@metamask/superstruct").Struct<boolean, null>;
151
153
  isDeprecated: import("@metamask/superstruct").Struct<boolean, null>;
152
154
  isDeletable: import("@metamask/superstruct").Struct<boolean, null>;
155
+ isAutoEnabled: import("@metamask/superstruct").Struct<boolean | undefined, null>;
153
156
  priority: import("@metamask/superstruct").Struct<number, null>;
154
157
  }>;
155
158
  contracts: import("@metamask/superstruct").Struct<{
@@ -209,6 +212,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
209
212
  isDeprecated: boolean;
210
213
  isDeletable: boolean;
211
214
  priority: number;
215
+ isAutoEnabled?: boolean | undefined;
212
216
  };
213
217
  geckoTerminalPlatformId?: string | undefined;
214
218
  contracts?: {
@@ -264,6 +268,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
264
268
  isDeprecated: boolean;
265
269
  isDeletable: boolean;
266
270
  priority: number;
271
+ isAutoEnabled?: boolean | undefined;
267
272
  };
268
273
  geckoTerminalPlatformId?: string | undefined;
269
274
  contracts?: {
@@ -317,6 +322,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
317
322
  isDeprecated: boolean;
318
323
  isDeletable: boolean;
319
324
  priority: number;
325
+ isAutoEnabled?: boolean | undefined;
320
326
  };
321
327
  geckoTerminalPlatformId?: string | undefined;
322
328
  contracts?: {
@@ -366,6 +372,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
366
372
  isDeprecated: boolean;
367
373
  isDeletable: boolean;
368
374
  priority: number;
375
+ isAutoEnabled?: boolean | undefined;
369
376
  };
370
377
  geckoTerminalPlatformId?: string | undefined;
371
378
  contracts?: {
@@ -462,6 +469,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
462
469
  isDeprecated: boolean;
463
470
  isDeletable: boolean;
464
471
  priority: number;
472
+ isAutoEnabled?: boolean | undefined;
465
473
  }, {
466
474
  isActive: import("@metamask/superstruct").Struct<boolean, null>;
467
475
  isTestnet: import("@metamask/superstruct").Struct<boolean, null>;
@@ -469,6 +477,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
469
477
  isFeatured: import("@metamask/superstruct").Struct<boolean, null>;
470
478
  isDeprecated: import("@metamask/superstruct").Struct<boolean, null>;
471
479
  isDeletable: import("@metamask/superstruct").Struct<boolean, null>;
480
+ isAutoEnabled: import("@metamask/superstruct").Struct<boolean | undefined, null>;
472
481
  priority: import("@metamask/superstruct").Struct<number, null>;
473
482
  }>;
474
483
  contracts: import("@metamask/superstruct").Struct<{
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../src/config-registry-api-service/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAyDnD;;;GAGG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;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AC;CAClC,GACD;IACE,QAAQ,EAAE,IAAI,CAAC;IACf,IAAI,EAAE,yBAAyB,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC"}
@@ -47,6 +47,7 @@ export declare const RegistryNetworkConfigSchema: import("@metamask/superstruct"
47
47
  isDeprecated: boolean;
48
48
  isDeletable: boolean;
49
49
  priority: number;
50
+ isAutoEnabled?: boolean | undefined;
50
51
  };
51
52
  geckoTerminalPlatformId?: string | undefined;
52
53
  contracts?: {
@@ -143,6 +144,7 @@ export declare const RegistryNetworkConfigSchema: import("@metamask/superstruct"
143
144
  isDeprecated: boolean;
144
145
  isDeletable: boolean;
145
146
  priority: number;
147
+ isAutoEnabled?: boolean | undefined;
146
148
  }, {
147
149
  isActive: import("@metamask/superstruct").Struct<boolean, null>;
148
150
  isTestnet: import("@metamask/superstruct").Struct<boolean, null>;
@@ -150,6 +152,7 @@ export declare const RegistryNetworkConfigSchema: import("@metamask/superstruct"
150
152
  isFeatured: import("@metamask/superstruct").Struct<boolean, null>;
151
153
  isDeprecated: import("@metamask/superstruct").Struct<boolean, null>;
152
154
  isDeletable: import("@metamask/superstruct").Struct<boolean, null>;
155
+ isAutoEnabled: import("@metamask/superstruct").Struct<boolean | undefined, null>;
153
156
  priority: import("@metamask/superstruct").Struct<number, null>;
154
157
  }>;
155
158
  contracts: import("@metamask/superstruct").Struct<{
@@ -209,6 +212,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
209
212
  isDeprecated: boolean;
210
213
  isDeletable: boolean;
211
214
  priority: number;
215
+ isAutoEnabled?: boolean | undefined;
212
216
  };
213
217
  geckoTerminalPlatformId?: string | undefined;
214
218
  contracts?: {
@@ -264,6 +268,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
264
268
  isDeprecated: boolean;
265
269
  isDeletable: boolean;
266
270
  priority: number;
271
+ isAutoEnabled?: boolean | undefined;
267
272
  };
268
273
  geckoTerminalPlatformId?: string | undefined;
269
274
  contracts?: {
@@ -317,6 +322,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
317
322
  isDeprecated: boolean;
318
323
  isDeletable: boolean;
319
324
  priority: number;
325
+ isAutoEnabled?: boolean | undefined;
320
326
  };
321
327
  geckoTerminalPlatformId?: string | undefined;
322
328
  contracts?: {
@@ -366,6 +372,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
366
372
  isDeprecated: boolean;
367
373
  isDeletable: boolean;
368
374
  priority: number;
375
+ isAutoEnabled?: boolean | undefined;
369
376
  };
370
377
  geckoTerminalPlatformId?: string | undefined;
371
378
  contracts?: {
@@ -462,6 +469,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
462
469
  isDeprecated: boolean;
463
470
  isDeletable: boolean;
464
471
  priority: number;
472
+ isAutoEnabled?: boolean | undefined;
465
473
  }, {
466
474
  isActive: import("@metamask/superstruct").Struct<boolean, null>;
467
475
  isTestnet: import("@metamask/superstruct").Struct<boolean, null>;
@@ -469,6 +477,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
469
477
  isFeatured: import("@metamask/superstruct").Struct<boolean, null>;
470
478
  isDeprecated: import("@metamask/superstruct").Struct<boolean, null>;
471
479
  isDeletable: import("@metamask/superstruct").Struct<boolean, null>;
480
+ isAutoEnabled: import("@metamask/superstruct").Struct<boolean | undefined, null>;
472
481
  priority: import("@metamask/superstruct").Struct<number, null>;
473
482
  }>;
474
483
  contracts: import("@metamask/superstruct").Struct<{
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/config-registry-api-service/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAyDnD;;;GAGG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AE,MAAM,CAAC;CACf,CAAC"}
@@ -33,6 +33,7 @@ const ChainConfigSchema = type({
33
33
  isFeatured: boolean(),
34
34
  isDeprecated: boolean(),
35
35
  isDeletable: boolean(),
36
+ isAutoEnabled: optional(boolean()),
36
37
  priority: number(),
37
38
  });
38
39
  const NetworkContractsSchema = type({
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../src/config-registry-api-service/types.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,EACL,MAAM,EACN,OAAO,EACP,MAAM,EACN,QAAQ,EACR,MAAM,EACN,IAAI,EACL,8BAA8B;AAC/B,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,wBAAwB;AAErE,MAAM,WAAW,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,EAAE;IACjB,QAAQ,EAAE,MAAM,EAAE;IAClB,IAAI,EAAE,MAAM,EAAE;IACd,MAAM,EAAE,MAAM,EAAE;IAChB,QAAQ,EAAE,MAAM,EAAE;IAClB,eAAe,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;CACpC,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IAC3B,MAAM,EAAE,WAAW;IACnB,UAAU,EAAE,QAAQ,CAAC,WAAW,CAAC;CAClC,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAG,IAAI,CAAC;IAC7B,GAAG,EAAE,MAAM,EAAE;IACb,IAAI,EAAE,MAAM,EAAE;IACd,eAAe,EAAE,MAAM,EAAE;CAC1B,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,iBAAiB;IAC1B,SAAS,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;CAC3B,CAAC,CAAC;AAEH,MAAM,uBAAuB,GAAG,IAAI,CAAC;IACnC,OAAO,EAAE,MAAM,EAAE;IACjB,SAA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optional,\n string,\n type,\n} from '@metamask/superstruct';\nimport { CaipChainIdStruct, StrictHexStruct } from '@metamask/utils';\n\nconst AssetSchema = type({\n assetId: string(),\n imageUrl: string(),\n name: string(),\n symbol: string(),\n decimals: number(),\n coingeckoCoinId: optional(string()),\n});\n\nconst AssetsSchema = type({\n listUrl: optional(string()),\n native: AssetSchema,\n governance: optional(AssetSchema),\n});\n\nconst RpcProviderSchema = type({\n url: string(),\n type: string(),\n networkClientId: string(),\n});\n\nconst RpcProvidersSchema = type({\n default: RpcProviderSchema,\n fallbacks: array(string()),\n});\n\nconst BlockExplorerUrlsSchema = type({\n default: string(),\n fallbacks: array(string()),\n});\n\nconst ChainConfigSchema = type({\n isActive: boolean(),\n isTestnet: boolean(),\n isDefault: boolean(),\n isFeatured: boolean(),\n isDeprecated: boolean(),\n isDeletable: boolean(),\n priority: number(),\n});\n\nconst NetworkContractsSchema = type({\n multicall3: optional(StrictHexStruct),\n});\n\n/**\n * Schema for a single chain in the CAIP-2 config registry API response.\n * chainId is in CAIP-2 format (e.g. \"eip155:1\", \"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp\").\n */\nexport const RegistryNetworkConfigSchema = type({\n chainId: CaipChainIdStruct,\n name: string(),\n imageUrl: string(),\n coingeckoPlatformId: string(),\n geckoTerminalPlatformId: optional(string()),\n assets: AssetsSchema,\n rpcProviders: RpcProvidersSchema,\n blockExplorerUrls: BlockExplorerUrlsSchema,\n config: ChainConfigSchema,\n contracts: optional(NetworkContractsSchema),\n});\n\n/**\n * Top-level API response shape. Uses `data.chains` (CAIP-2) and `data.version`.\n */\nexport const RegistryConfigApiResponseSchema = type({\n data: type({\n version: string(),\n timestamp: number(),\n chains: array(RegistryNetworkConfigSchema),\n }),\n});\n\nexport type RegistryNetworkConfig = Infer<typeof RegistryNetworkConfigSchema>;\n\nexport type RegistryConfigApiResponse = Infer<\n typeof RegistryConfigApiResponseSchema\n>;\n\nexport function validateRegistryConfigApiResponse(\n data: unknown,\n): asserts data is RegistryConfigApiResponse {\n assert(data, RegistryConfigApiResponseSchema);\n}\n\nexport type FetchConfigOptions = {\n etag?: string;\n};\n\nexport type FetchConfigResult =\n | {\n modified: false;\n etag?: string;\n /**\n * Cached data from the service when available (e.g. after a previous\n * successful fetch). Omitted when the service has no cache yet.\n */\n data?: RegistryConfigApiResponse;\n }\n | {\n modified: true;\n data: RegistryConfigApiResponse;\n etag?: string;\n };\n"]}
1
+ {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../src/config-registry-api-service/types.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,EACL,MAAM,EACN,OAAO,EACP,MAAM,EACN,QAAQ,EACR,MAAM,EACN,IAAI,EACL,8BAA8B;AAC/B,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,wBAAwB;AAErE,MAAM,WAAW,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,EAAE;IACjB,QAAQ,EAAE,MAAM,EAAE;IAClB,IAAI,EAAE,MAAM,EAAE;IACd,MAAM,EAAE,MAAM,EAAE;IAChB,QAAQ,EAAE,MAAM,EAAE;IAClB,eAAe,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;CACpC,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IAC3B,MAAM,EAAE,WAAW;IACnB,UAAU,EAAE,QAAQ,CAAC,WAAW,CAAC;CAClC,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAG,IAAI,CAAC;IAC7B,GAAG,EAAE,MAAM,EAAE;IACb,IAAI,EAAE,MAAM,EAAE;IACd,eAAe,EAAE,MAAM,EAAE;CAC1B,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,iBAAiB;IAC1B,SAAS,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;CAC3B,CAAC,CAAC;AAEH,MAAM,uBAAuB,GA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I,EAAE,+BAA+B,CAAC,CAAC;AAChD,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n array,\n assert,\n boolean,\n number,\n optional,\n string,\n type,\n} from '@metamask/superstruct';\nimport { CaipChainIdStruct, StrictHexStruct } from '@metamask/utils';\n\nconst AssetSchema = type({\n assetId: string(),\n imageUrl: string(),\n name: string(),\n symbol: string(),\n decimals: number(),\n coingeckoCoinId: optional(string()),\n});\n\nconst AssetsSchema = type({\n listUrl: optional(string()),\n native: AssetSchema,\n governance: optional(AssetSchema),\n});\n\nconst RpcProviderSchema = type({\n url: string(),\n type: string(),\n networkClientId: string(),\n});\n\nconst RpcProvidersSchema = type({\n default: RpcProviderSchema,\n fallbacks: array(string()),\n});\n\nconst BlockExplorerUrlsSchema = type({\n default: string(),\n fallbacks: array(string()),\n});\n\nconst ChainConfigSchema = type({\n isActive: boolean(),\n isTestnet: boolean(),\n isDefault: boolean(),\n isFeatured: boolean(),\n isDeprecated: boolean(),\n isDeletable: boolean(),\n isAutoEnabled: optional(boolean()),\n priority: number(),\n});\n\nconst NetworkContractsSchema = type({\n multicall3: optional(StrictHexStruct),\n});\n\n/**\n * Schema for a single chain in the CAIP-2 config registry API response.\n * chainId is in CAIP-2 format (e.g. \"eip155:1\", \"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp\").\n */\nexport const RegistryNetworkConfigSchema = type({\n chainId: CaipChainIdStruct,\n name: string(),\n imageUrl: string(),\n coingeckoPlatformId: string(),\n geckoTerminalPlatformId: optional(string()),\n assets: AssetsSchema,\n rpcProviders: RpcProvidersSchema,\n blockExplorerUrls: BlockExplorerUrlsSchema,\n config: ChainConfigSchema,\n contracts: optional(NetworkContractsSchema),\n});\n\n/**\n * Top-level API response shape. Uses `data.chains` (CAIP-2) and `data.version`.\n */\nexport const RegistryConfigApiResponseSchema = type({\n data: type({\n version: string(),\n timestamp: number(),\n chains: array(RegistryNetworkConfigSchema),\n }),\n});\n\nexport type RegistryNetworkConfig = Infer<typeof RegistryNetworkConfigSchema>;\n\nexport type RegistryConfigApiResponse = Infer<\n typeof RegistryConfigApiResponseSchema\n>;\n\nexport function validateRegistryConfigApiResponse(\n data: unknown,\n): asserts data is RegistryConfigApiResponse {\n assert(data, RegistryConfigApiResponseSchema);\n}\n\nexport type FetchConfigOptions = {\n etag?: string;\n};\n\nexport type FetchConfigResult =\n | {\n modified: false;\n etag?: string;\n /**\n * Cached data from the service when available (e.g. after a previous\n * successful fetch). Omitted when the service has no cache yet.\n */\n data?: RegistryConfigApiResponse;\n }\n | {\n modified: true;\n data: RegistryConfigApiResponse;\n etag?: string;\n };\n"]}
package/dist/index.cjs CHANGED
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.filterNetworks = exports.ConfigRegistryApiEnv = exports.ConfigRegistryApiService = exports.selectNetworks = exports.selectFeaturedNetworks = exports.DEFAULT_POLLING_INTERVAL = exports.ConfigRegistryController = void 0;
3
+ exports.filterNetworks = exports.ConfigRegistryApiEnv = exports.ConfigRegistryApiService = exports.selectEvmAutoEnabledNetworksChainIds = exports.selectNetworks = exports.selectFeaturedNetworks = exports.DEFAULT_POLLING_INTERVAL = exports.ConfigRegistryController = void 0;
4
4
  var ConfigRegistryController_js_1 = require("./ConfigRegistryController.cjs");
5
5
  Object.defineProperty(exports, "ConfigRegistryController", { enumerable: true, get: function () { return ConfigRegistryController_js_1.ConfigRegistryController; } });
6
6
  Object.defineProperty(exports, "DEFAULT_POLLING_INTERVAL", { enumerable: true, get: function () { return ConfigRegistryController_js_1.DEFAULT_POLLING_INTERVAL; } });
7
7
  var selectors_js_1 = require("./selectors.cjs");
8
8
  Object.defineProperty(exports, "selectFeaturedNetworks", { enumerable: true, get: function () { return selectors_js_1.selectFeaturedNetworks; } });
9
9
  Object.defineProperty(exports, "selectNetworks", { enumerable: true, get: function () { return selectors_js_1.selectNetworks; } });
10
+ Object.defineProperty(exports, "selectEvmAutoEnabledNetworksChainIds", { enumerable: true, get: function () { return selectors_js_1.selectEvmAutoEnabledNetworksChainIds; } });
10
11
  var config_registry_api_service_js_1 = require("./config-registry-api-service/config-registry-api-service.cjs");
11
12
  Object.defineProperty(exports, "ConfigRegistryApiService", { enumerable: true, get: function () { return config_registry_api_service_js_1.ConfigRegistryApiService; } });
12
13
  Object.defineProperty(exports, "ConfigRegistryApiEnv", { enumerable: true, get: function () { return config_registry_api_service_js_1.ConfigRegistryApiEnv; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAaA,8EAGuC;AAFrC,uIAAA,wBAAwB,OAAA;AACxB,uIAAA,wBAAwB,OAAA;AAE1B,gDAAwE;AAA/D,sHAAA,sBAAsB,OAAA;AAAE,8GAAA,cAAc,OAAA;AAkB/C,gHAGsE;AAFpE,0IAAA,wBAAwB,OAAA;AACxB,sIAAA,oBAAoB,OAAA;AAEtB,wEAA0E;AAAjE,4GAAA,cAAc,OAAA","sourcesContent":["export type {\n ConfigRegistryControllerState,\n ConfigRegistryControllerOptions,\n ConfigRegistryControllerActions,\n ConfigRegistryControllerGetStateAction,\n ConfigRegistryControllerEvents,\n ConfigRegistryControllerMessenger,\n} from './ConfigRegistryController.js';\nexport type {\n ConfigRegistryControllerStartPollingAction,\n ConfigRegistryControllerStopPollingAction,\n ConfigRegistryControllerGetNetworkConfigByCaip2ChainIdAction,\n} from './ConfigRegistryController-method-action-types.js';\nexport {\n ConfigRegistryController,\n DEFAULT_POLLING_INTERVAL,\n} from './ConfigRegistryController.js';\nexport { selectFeaturedNetworks, selectNetworks } from './selectors.js';\nexport type {\n FetchConfigOptions,\n FetchConfigResult,\n RegistryNetworkConfig,\n RegistryConfigApiResponse,\n} from './config-registry-api-service/types.js';\nexport type {\n ConfigRegistryApiServiceOptions,\n ConfigRegistryApiServiceActions,\n ConfigRegistryApiServiceEvents,\n ConfigRegistryApiServiceMessenger,\n} from './config-registry-api-service/config-registry-api-service.js';\nexport type {\n ConfigRegistryApiServiceFetchConfigAction,\n ConfigRegistryApiServiceMethodActions,\n} from './config-registry-api-service/config-registry-api-service-method-action-types.js';\nexport type { NetworkFilterOptions } from './config-registry-api-service/filters.js';\nexport {\n ConfigRegistryApiService,\n ConfigRegistryApiEnv,\n} from './config-registry-api-service/config-registry-api-service.js';\nexport { filterNetworks } from './config-registry-api-service/filters.js';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAcA,8EAGuC;AAFrC,uIAAA,wBAAwB,OAAA;AACxB,uIAAA,wBAAwB,OAAA;AAE1B,gDAIwB;AAHtB,sHAAA,sBAAsB,OAAA;AACtB,8GAAA,cAAc,OAAA;AACd,oIAAA,oCAAoC,OAAA;AAmBtC,gHAGsE;AAFpE,0IAAA,wBAAwB,OAAA;AACxB,sIAAA,oBAAoB,OAAA;AAEtB,wEAA0E;AAAjE,4GAAA,cAAc,OAAA","sourcesContent":["export type {\n ConfigRegistryControllerState,\n ConfigRegistryControllerOptions,\n ConfigRegistryControllerActions,\n ConfigRegistryControllerGetStateAction,\n ConfigRegistryControllerStateChangedEvent,\n ConfigRegistryControllerEvents,\n ConfigRegistryControllerMessenger,\n} from './ConfigRegistryController.js';\nexport type {\n ConfigRegistryControllerStartPollingAction,\n ConfigRegistryControllerStopPollingAction,\n ConfigRegistryControllerGetNetworkConfigByCaip2ChainIdAction,\n} from './ConfigRegistryController-method-action-types.js';\nexport {\n ConfigRegistryController,\n DEFAULT_POLLING_INTERVAL,\n} from './ConfigRegistryController.js';\nexport {\n selectFeaturedNetworks,\n selectNetworks,\n selectEvmAutoEnabledNetworksChainIds,\n} from './selectors.js';\nexport type {\n FetchConfigOptions,\n FetchConfigResult,\n RegistryNetworkConfig,\n RegistryConfigApiResponse,\n} from './config-registry-api-service/types.js';\nexport type {\n ConfigRegistryApiServiceOptions,\n ConfigRegistryApiServiceActions,\n ConfigRegistryApiServiceEvents,\n ConfigRegistryApiServiceMessenger,\n} from './config-registry-api-service/config-registry-api-service.js';\nexport type {\n ConfigRegistryApiServiceFetchConfigAction,\n ConfigRegistryApiServiceMethodActions,\n} from './config-registry-api-service/config-registry-api-service-method-action-types.js';\nexport type { NetworkFilterOptions } from './config-registry-api-service/filters.js';\nexport {\n ConfigRegistryApiService,\n ConfigRegistryApiEnv,\n} from './config-registry-api-service/config-registry-api-service.js';\nexport { filterNetworks } from './config-registry-api-service/filters.js';\n"]}
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- export type { ConfigRegistryControllerState, ConfigRegistryControllerOptions, ConfigRegistryControllerActions, ConfigRegistryControllerGetStateAction, ConfigRegistryControllerEvents, ConfigRegistryControllerMessenger, } from "./ConfigRegistryController.cjs";
1
+ export type { ConfigRegistryControllerState, ConfigRegistryControllerOptions, ConfigRegistryControllerActions, ConfigRegistryControllerGetStateAction, ConfigRegistryControllerStateChangedEvent, ConfigRegistryControllerEvents, ConfigRegistryControllerMessenger, } from "./ConfigRegistryController.cjs";
2
2
  export type { ConfigRegistryControllerStartPollingAction, ConfigRegistryControllerStopPollingAction, ConfigRegistryControllerGetNetworkConfigByCaip2ChainIdAction, } from "./ConfigRegistryController-method-action-types.cjs";
3
3
  export { ConfigRegistryController, DEFAULT_POLLING_INTERVAL, } from "./ConfigRegistryController.cjs";
4
- export { selectFeaturedNetworks, selectNetworks } from "./selectors.cjs";
4
+ export { selectFeaturedNetworks, selectNetworks, selectEvmAutoEnabledNetworksChainIds, } from "./selectors.cjs";
5
5
  export type { FetchConfigOptions, FetchConfigResult, RegistryNetworkConfig, RegistryConfigApiResponse, } from "./config-registry-api-service/types.cjs";
6
6
  export type { ConfigRegistryApiServiceOptions, ConfigRegistryApiServiceActions, ConfigRegistryApiServiceEvents, ConfigRegistryApiServiceMessenger, } from "./config-registry-api-service/config-registry-api-service.cjs";
7
7
  export type { ConfigRegistryApiServiceFetchConfigAction, ConfigRegistryApiServiceMethodActions, } from "./config-registry-api-service/config-registry-api-service-method-action-types.cjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,6BAA6B,EAC7B,+BAA+B,EAC/B,+BAA+B,EAC/B,sCAAsC,EACtC,8BAA8B,EAC9B,iCAAiC,GAClC,uCAAsC;AACvC,YAAY,EACV,0CAA0C,EAC1C,yCAAyC,EACzC,4DAA4D,GAC7D,2DAA0D;AAC3D,OAAO,EACL,wBAAwB,EACxB,wBAAwB,GACzB,uCAAsC;AACvC,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,wBAAuB;AACxE,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,GAC1B,gDAA+C;AAChD,YAAY,EACV,+BAA+B,EAC/B,+BAA+B,EAC/B,8BAA8B,EAC9B,iCAAiC,GAClC,sEAAqE;AACtE,YAAY,EACV,yCAAyC,EACzC,qCAAqC,GACtC,0FAAyF;AAC1F,YAAY,EAAE,oBAAoB,EAAE,kDAAiD;AACrF,OAAO,EACL,wBAAwB,EACxB,oBAAoB,GACrB,sEAAqE;AACtE,OAAO,EAAE,cAAc,EAAE,kDAAiD"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,6BAA6B,EAC7B,+BAA+B,EAC/B,+BAA+B,EAC/B,sCAAsC,EACtC,yCAAyC,EACzC,8BAA8B,EAC9B,iCAAiC,GAClC,uCAAsC;AACvC,YAAY,EACV,0CAA0C,EAC1C,yCAAyC,EACzC,4DAA4D,GAC7D,2DAA0D;AAC3D,OAAO,EACL,wBAAwB,EACxB,wBAAwB,GACzB,uCAAsC;AACvC,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,oCAAoC,GACrC,wBAAuB;AACxB,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,GAC1B,gDAA+C;AAChD,YAAY,EACV,+BAA+B,EAC/B,+BAA+B,EAC/B,8BAA8B,EAC9B,iCAAiC,GAClC,sEAAqE;AACtE,YAAY,EACV,yCAAyC,EACzC,qCAAqC,GACtC,0FAAyF;AAC1F,YAAY,EAAE,oBAAoB,EAAE,kDAAiD;AACrF,OAAO,EACL,wBAAwB,EACxB,oBAAoB,GACrB,sEAAqE;AACtE,OAAO,EAAE,cAAc,EAAE,kDAAiD"}
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- export type { ConfigRegistryControllerState, ConfigRegistryControllerOptions, ConfigRegistryControllerActions, ConfigRegistryControllerGetStateAction, ConfigRegistryControllerEvents, ConfigRegistryControllerMessenger, } from "./ConfigRegistryController.mjs";
1
+ export type { ConfigRegistryControllerState, ConfigRegistryControllerOptions, ConfigRegistryControllerActions, ConfigRegistryControllerGetStateAction, ConfigRegistryControllerStateChangedEvent, ConfigRegistryControllerEvents, ConfigRegistryControllerMessenger, } from "./ConfigRegistryController.mjs";
2
2
  export type { ConfigRegistryControllerStartPollingAction, ConfigRegistryControllerStopPollingAction, ConfigRegistryControllerGetNetworkConfigByCaip2ChainIdAction, } from "./ConfigRegistryController-method-action-types.mjs";
3
3
  export { ConfigRegistryController, DEFAULT_POLLING_INTERVAL, } from "./ConfigRegistryController.mjs";
4
- export { selectFeaturedNetworks, selectNetworks } from "./selectors.mjs";
4
+ export { selectFeaturedNetworks, selectNetworks, selectEvmAutoEnabledNetworksChainIds, } from "./selectors.mjs";
5
5
  export type { FetchConfigOptions, FetchConfigResult, RegistryNetworkConfig, RegistryConfigApiResponse, } from "./config-registry-api-service/types.mjs";
6
6
  export type { ConfigRegistryApiServiceOptions, ConfigRegistryApiServiceActions, ConfigRegistryApiServiceEvents, ConfigRegistryApiServiceMessenger, } from "./config-registry-api-service/config-registry-api-service.mjs";
7
7
  export type { ConfigRegistryApiServiceFetchConfigAction, ConfigRegistryApiServiceMethodActions, } from "./config-registry-api-service/config-registry-api-service-method-action-types.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,6BAA6B,EAC7B,+BAA+B,EAC/B,+BAA+B,EAC/B,sCAAsC,EACtC,8BAA8B,EAC9B,iCAAiC,GAClC,uCAAsC;AACvC,YAAY,EACV,0CAA0C,EAC1C,yCAAyC,EACzC,4DAA4D,GAC7D,2DAA0D;AAC3D,OAAO,EACL,wBAAwB,EACxB,wBAAwB,GACzB,uCAAsC;AACvC,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,wBAAuB;AACxE,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,GAC1B,gDAA+C;AAChD,YAAY,EACV,+BAA+B,EAC/B,+BAA+B,EAC/B,8BAA8B,EAC9B,iCAAiC,GAClC,sEAAqE;AACtE,YAAY,EACV,yCAAyC,EACzC,qCAAqC,GACtC,0FAAyF;AAC1F,YAAY,EAAE,oBAAoB,EAAE,kDAAiD;AACrF,OAAO,EACL,wBAAwB,EACxB,oBAAoB,GACrB,sEAAqE;AACtE,OAAO,EAAE,cAAc,EAAE,kDAAiD"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,6BAA6B,EAC7B,+BAA+B,EAC/B,+BAA+B,EAC/B,sCAAsC,EACtC,yCAAyC,EACzC,8BAA8B,EAC9B,iCAAiC,GAClC,uCAAsC;AACvC,YAAY,EACV,0CAA0C,EAC1C,yCAAyC,EACzC,4DAA4D,GAC7D,2DAA0D;AAC3D,OAAO,EACL,wBAAwB,EACxB,wBAAwB,GACzB,uCAAsC;AACvC,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,oCAAoC,GACrC,wBAAuB;AACxB,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,GAC1B,gDAA+C;AAChD,YAAY,EACV,+BAA+B,EAC/B,+BAA+B,EAC/B,8BAA8B,EAC9B,iCAAiC,GAClC,sEAAqE;AACtE,YAAY,EACV,yCAAyC,EACzC,qCAAqC,GACtC,0FAAyF;AAC1F,YAAY,EAAE,oBAAoB,EAAE,kDAAiD;AACrF,OAAO,EACL,wBAAwB,EACxB,oBAAoB,GACrB,sEAAqE;AACtE,OAAO,EAAE,cAAc,EAAE,kDAAiD"}
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  export { ConfigRegistryController, DEFAULT_POLLING_INTERVAL } from "./ConfigRegistryController.mjs";
2
- export { selectFeaturedNetworks, selectNetworks } from "./selectors.mjs";
2
+ export { selectFeaturedNetworks, selectNetworks, selectEvmAutoEnabledNetworksChainIds } from "./selectors.mjs";
3
3
  export { ConfigRegistryApiService, ConfigRegistryApiEnv } from "./config-registry-api-service/config-registry-api-service.mjs";
4
4
  export { filterNetworks } from "./config-registry-api-service/filters.mjs";
5
5
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACzB,uCAAsC;AACvC,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,wBAAuB;AAkBxE,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACrB,sEAAqE;AACtE,OAAO,EAAE,cAAc,EAAE,kDAAiD","sourcesContent":["export type {\n ConfigRegistryControllerState,\n ConfigRegistryControllerOptions,\n ConfigRegistryControllerActions,\n ConfigRegistryControllerGetStateAction,\n ConfigRegistryControllerEvents,\n ConfigRegistryControllerMessenger,\n} from './ConfigRegistryController.js';\nexport type {\n ConfigRegistryControllerStartPollingAction,\n ConfigRegistryControllerStopPollingAction,\n ConfigRegistryControllerGetNetworkConfigByCaip2ChainIdAction,\n} from './ConfigRegistryController-method-action-types.js';\nexport {\n ConfigRegistryController,\n DEFAULT_POLLING_INTERVAL,\n} from './ConfigRegistryController.js';\nexport { selectFeaturedNetworks, selectNetworks } from './selectors.js';\nexport type {\n FetchConfigOptions,\n FetchConfigResult,\n RegistryNetworkConfig,\n RegistryConfigApiResponse,\n} from './config-registry-api-service/types.js';\nexport type {\n ConfigRegistryApiServiceOptions,\n ConfigRegistryApiServiceActions,\n ConfigRegistryApiServiceEvents,\n ConfigRegistryApiServiceMessenger,\n} from './config-registry-api-service/config-registry-api-service.js';\nexport type {\n ConfigRegistryApiServiceFetchConfigAction,\n ConfigRegistryApiServiceMethodActions,\n} from './config-registry-api-service/config-registry-api-service-method-action-types.js';\nexport type { NetworkFilterOptions } from './config-registry-api-service/filters.js';\nexport {\n ConfigRegistryApiService,\n ConfigRegistryApiEnv,\n} from './config-registry-api-service/config-registry-api-service.js';\nexport { filterNetworks } from './config-registry-api-service/filters.js';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACzB,uCAAsC;AACvC,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,oCAAoC,EACrC,wBAAuB;AAkBxB,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACrB,sEAAqE;AACtE,OAAO,EAAE,cAAc,EAAE,kDAAiD","sourcesContent":["export type {\n ConfigRegistryControllerState,\n ConfigRegistryControllerOptions,\n ConfigRegistryControllerActions,\n ConfigRegistryControllerGetStateAction,\n ConfigRegistryControllerStateChangedEvent,\n ConfigRegistryControllerEvents,\n ConfigRegistryControllerMessenger,\n} from './ConfigRegistryController.js';\nexport type {\n ConfigRegistryControllerStartPollingAction,\n ConfigRegistryControllerStopPollingAction,\n ConfigRegistryControllerGetNetworkConfigByCaip2ChainIdAction,\n} from './ConfigRegistryController-method-action-types.js';\nexport {\n ConfigRegistryController,\n DEFAULT_POLLING_INTERVAL,\n} from './ConfigRegistryController.js';\nexport {\n selectFeaturedNetworks,\n selectNetworks,\n selectEvmAutoEnabledNetworksChainIds,\n} from './selectors.js';\nexport type {\n FetchConfigOptions,\n FetchConfigResult,\n RegistryNetworkConfig,\n RegistryConfigApiResponse,\n} from './config-registry-api-service/types.js';\nexport type {\n ConfigRegistryApiServiceOptions,\n ConfigRegistryApiServiceActions,\n ConfigRegistryApiServiceEvents,\n ConfigRegistryApiServiceMessenger,\n} from './config-registry-api-service/config-registry-api-service.js';\nexport type {\n ConfigRegistryApiServiceFetchConfigAction,\n ConfigRegistryApiServiceMethodActions,\n} from './config-registry-api-service/config-registry-api-service-method-action-types.js';\nexport type { NetworkFilterOptions } from './config-registry-api-service/filters.js';\nexport {\n ConfigRegistryApiService,\n ConfigRegistryApiEnv,\n} from './config-registry-api-service/config-registry-api-service.js';\nexport { filterNetworks } from './config-registry-api-service/filters.js';\n"]}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.selectFeaturedNetworks = exports.selectNetworks = void 0;
3
+ exports.selectEvmAutoEnabledNetworksChainIds = exports.selectFeaturedNetworks = exports.selectNetworks = void 0;
4
+ const utils_1 = require("@metamask/utils");
4
5
  const reselect_1 = require("reselect");
5
6
  const filters_js_1 = require("./config-registry-api-service/filters.cjs");
6
7
  /**
@@ -31,4 +32,23 @@ exports.selectFeaturedNetworks = (0, reselect_1.createSelector)(exports.selectNe
31
32
  });
32
33
  return result;
33
34
  });
35
+ /**
36
+ * Returns the list of CAIP-2 chain IDs for networks that are auto-enabled in the
37
+ * config registry.
38
+ *
39
+ * @param state - The config registry controller state.
40
+ * @returns The list of CAIP-2 chain IDs for auto-enabled networks.
41
+ */
42
+ exports.selectEvmAutoEnabledNetworksChainIds = (0, reselect_1.createSelector)(exports.selectNetworks, (networks) => Object.values(networks)
43
+ .filter(({ chainId, config }) => chainId.startsWith(utils_1.KnownCaipNamespace.Eip155) &&
44
+ config.isAutoEnabled &&
45
+ config.isActive &&
46
+ !config.isDeprecated)
47
+ .map((config) => config.chainId), {
48
+ // Messenger selector subscriptions only skip work when the result is
49
+ // referentially equal, so keep the previous array when the IDs are the same.
50
+ memoizeOptions: {
51
+ resultEqualityCheck: (a, b) => a.length === b.length && a.every((chainId, i) => chainId === b[i]),
52
+ },
53
+ });
34
54
  //# sourceMappingURL=selectors.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"selectors.cjs","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":";;;AAAA,uCAA0C;AAE1C,0EAA0E;AAI1E;;;;;GAKG;AACI,MAAM,cAAc,GAAG,CAC5B,KAAoC,EACG,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;AAFtD,QAAA,cAAc,kBAEwC;AAEnE;;;;;;GAMG;AACU,QAAA,sBAAsB,GAAG,IAAA,yBAAc,EAClD,sBAAc,EACd,CAAC,QAAQ,EAAyC,EAAE;IAClD,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAG,IAAA,2BAAc,EAAC,YAAY,EAAE;QAC5C,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,KAAK;KACjB,CAAC,CAAC;IACH,MAAM,MAAM,GAA0C,EAAE,CAAC;IACzD,QAAQ,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QAC1B,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC;IAClC,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC,CACF,CAAC","sourcesContent":["import { createSelector } from 'reselect';\n\nimport { filterNetworks } from './config-registry-api-service/filters.js';\nimport type { RegistryNetworkConfig } from './config-registry-api-service/types.js';\nimport type { ConfigRegistryControllerState } from './ConfigRegistryController.js';\n\n/**\n * Base selector to get all networks from the controller state.\n *\n * @param state - The ConfigRegistryController state\n * @returns All network configurations keyed by chain ID\n */\nexport const selectNetworks = (\n state: ConfigRegistryControllerState,\n): Record<string, RegistryNetworkConfig> => state.configs.networks;\n\n/**\n * Selector to get featured, active, non-testnet networks.\n * Use this for the default network list (e.g. main network picker).\n *\n * @param state - The ConfigRegistryController state\n * @returns Filtered network configurations keyed by chain ID\n */\nexport const selectFeaturedNetworks = createSelector(\n selectNetworks,\n (networks): Record<string, RegistryNetworkConfig> => {\n const networkArray = Object.values(networks);\n const filtered = filterNetworks(networkArray, {\n isFeatured: true,\n isActive: true,\n isTestnet: false,\n });\n const result: Record<string, RegistryNetworkConfig> = {};\n filtered.forEach((config) => {\n result[config.chainId] = config;\n });\n return result;\n },\n);\n"]}
1
+ {"version":3,"file":"selectors.cjs","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":";;;AAAA,2CAAkE;AAClE,uCAA0C;AAE1C,0EAA0E;AAI1E;;;;;GAKG;AACI,MAAM,cAAc,GAAG,CAC5B,KAAoC,EACG,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;AAFtD,QAAA,cAAc,kBAEwC;AAEnE;;;;;;GAMG;AACU,QAAA,sBAAsB,GAAG,IAAA,yBAAc,EAClD,sBAAc,EACd,CAAC,QAAQ,EAAyC,EAAE;IAClD,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAG,IAAA,2BAAc,EAAC,YAAY,EAAE;QAC5C,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,KAAK;KACjB,CAAC,CAAC;IACH,MAAM,MAAM,GAA0C,EAAE,CAAC;IACzD,QAAQ,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QAC1B,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC;IAClC,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC,CACF,CAAC;AAEF;;;;;;GAMG;AACU,QAAA,oCAAoC,GAAG,IAAA,yBAAc,EAChE,sBAAc,EACd,CAAC,QAAQ,EAAiB,EAAE,CAC1B,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;KACpB,MAAM,CACL,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,CACtB,OAAO,CAAC,UAAU,CAAC,0BAAkB,CAAC,MAAM,CAAC;IAC7C,MAAM,CAAC,aAAa;IACpB,MAAM,CAAC,QAAQ;IACf,CAAC,MAAM,CAAC,YAAY,CACvB;KACA,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,EACpC;IACE,qEAAqE;IACrE,6EAA6E;IAC7E,cAAc,EAAE;QACd,mBAAmB,EAAE,CAAC,CAAgB,EAAE,CAAgB,EAAE,EAAE,CAC1D,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KACrE;CACF,CACF,CAAC","sourcesContent":["import { CaipChainId, KnownCaipNamespace } from '@metamask/utils';\nimport { createSelector } from 'reselect';\n\nimport { filterNetworks } from './config-registry-api-service/filters.js';\nimport type { RegistryNetworkConfig } from './config-registry-api-service/types.js';\nimport type { ConfigRegistryControllerState } from './ConfigRegistryController.js';\n\n/**\n * Base selector to get all networks from the controller state.\n *\n * @param state - The ConfigRegistryController state\n * @returns All network configurations keyed by chain ID\n */\nexport const selectNetworks = (\n state: ConfigRegistryControllerState,\n): Record<string, RegistryNetworkConfig> => state.configs.networks;\n\n/**\n * Selector to get featured, active, non-testnet networks.\n * Use this for the default network list (e.g. main network picker).\n *\n * @param state - The ConfigRegistryController state\n * @returns Filtered network configurations keyed by chain ID\n */\nexport const selectFeaturedNetworks = createSelector(\n selectNetworks,\n (networks): Record<string, RegistryNetworkConfig> => {\n const networkArray = Object.values(networks);\n const filtered = filterNetworks(networkArray, {\n isFeatured: true,\n isActive: true,\n isTestnet: false,\n });\n const result: Record<string, RegistryNetworkConfig> = {};\n filtered.forEach((config) => {\n result[config.chainId] = config;\n });\n return result;\n },\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 const selectEvmAutoEnabledNetworksChainIds = createSelector(\n selectNetworks,\n (networks): CaipChainId[] =>\n Object.values(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 // Messenger selector subscriptions only skip work when the result is\n // referentially equal, so keep the previous array when the IDs are the same.\n memoizeOptions: {\n resultEqualityCheck: (a: CaipChainId[], b: CaipChainId[]) =>\n a.length === b.length && a.every((chainId, i) => chainId === b[i]),\n },\n },\n);\n"]}
@@ -58,6 +58,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
58
58
  isDeprecated: boolean;
59
59
  isDeletable: boolean;
60
60
  priority: number;
61
+ isAutoEnabled?: boolean | undefined;
61
62
  };
62
63
  geckoTerminalPlatformId?: string | undefined;
63
64
  contracts?: {
@@ -112,6 +113,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
112
113
  isDeprecated: boolean;
113
114
  isDeletable: boolean;
114
115
  priority: number;
116
+ isAutoEnabled?: boolean | undefined;
115
117
  };
116
118
  geckoTerminalPlatformId?: string | undefined;
117
119
  contracts?: {
@@ -161,6 +163,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
161
163
  isDeprecated: boolean;
162
164
  isDeletable: boolean;
163
165
  priority: number;
166
+ isAutoEnabled?: boolean | undefined;
164
167
  };
165
168
  geckoTerminalPlatformId?: string | undefined;
166
169
  contracts?: {
@@ -211,6 +214,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
211
214
  isDeprecated: boolean;
212
215
  isDeletable: boolean;
213
216
  priority: number;
217
+ isAutoEnabled?: boolean | undefined;
214
218
  };
215
219
  geckoTerminalPlatformId?: string | undefined;
216
220
  contracts?: {
@@ -260,6 +264,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
260
264
  isDeprecated: boolean;
261
265
  isDeletable: boolean;
262
266
  priority: number;
267
+ isAutoEnabled?: boolean | undefined;
263
268
  };
264
269
  geckoTerminalPlatformId?: string | undefined;
265
270
  contracts?: {
@@ -314,6 +319,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
314
319
  isDeprecated: boolean;
315
320
  isDeletable: boolean;
316
321
  priority: number;
322
+ isAutoEnabled?: boolean | undefined;
317
323
  };
318
324
  geckoTerminalPlatformId?: string | undefined;
319
325
  contracts?: {
@@ -329,4 +335,132 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
329
335
  argsMemoize: typeof import("reselect").weakMapMemoize;
330
336
  memoize: typeof import("reselect").weakMapMemoize;
331
337
  };
338
+ /**
339
+ * Returns the list of CAIP-2 chain IDs for networks that are auto-enabled in the
340
+ * config registry.
341
+ *
342
+ * @param state - The config registry controller state.
343
+ * @returns The list of CAIP-2 chain IDs for auto-enabled networks.
344
+ */
345
+ export declare const selectEvmAutoEnabledNetworksChainIds: ((state: ConfigRegistryControllerState) => `${string}:${string}`[]) & {
346
+ clearCache: () => void;
347
+ resultsCount: () => number;
348
+ resetResultsCount: () => void;
349
+ } & {
350
+ resultFunc: (resultFuncArgs_0: Record<string, {
351
+ imageUrl: string;
352
+ name: string;
353
+ chainId: `${string}:${string}`;
354
+ coingeckoPlatformId: string;
355
+ assets: {
356
+ native: {
357
+ symbol: string;
358
+ assetId: string;
359
+ imageUrl: string;
360
+ name: string;
361
+ decimals: number;
362
+ coingeckoCoinId?: string | undefined;
363
+ };
364
+ listUrl?: string | undefined;
365
+ governance?: {
366
+ symbol: string;
367
+ assetId: string;
368
+ imageUrl: string;
369
+ name: string;
370
+ decimals: number;
371
+ coingeckoCoinId?: string | undefined;
372
+ } | undefined;
373
+ };
374
+ rpcProviders: {
375
+ default: {
376
+ url: string;
377
+ type: string;
378
+ networkClientId: string;
379
+ };
380
+ fallbacks: string[];
381
+ };
382
+ blockExplorerUrls: {
383
+ default: string;
384
+ fallbacks: string[];
385
+ };
386
+ config: {
387
+ isActive: boolean;
388
+ isTestnet: boolean;
389
+ isDefault: boolean;
390
+ isFeatured: boolean;
391
+ isDeprecated: boolean;
392
+ isDeletable: boolean;
393
+ priority: number;
394
+ isAutoEnabled?: boolean | undefined;
395
+ };
396
+ geckoTerminalPlatformId?: string | undefined;
397
+ contracts?: {
398
+ multicall3?: `0x${string}` | undefined;
399
+ } | undefined;
400
+ }>) => `${string}:${string}`[];
401
+ memoizedResultFunc: ((resultFuncArgs_0: Record<string, {
402
+ imageUrl: string;
403
+ name: string;
404
+ chainId: `${string}:${string}`;
405
+ coingeckoPlatformId: string;
406
+ assets: {
407
+ native: {
408
+ symbol: string;
409
+ assetId: string;
410
+ imageUrl: string;
411
+ name: string;
412
+ decimals: number;
413
+ coingeckoCoinId?: string | undefined;
414
+ };
415
+ listUrl?: string | undefined;
416
+ governance?: {
417
+ symbol: string;
418
+ assetId: string;
419
+ imageUrl: string;
420
+ name: string;
421
+ decimals: number;
422
+ coingeckoCoinId?: string | undefined;
423
+ } | undefined;
424
+ };
425
+ rpcProviders: {
426
+ default: {
427
+ url: string;
428
+ type: string;
429
+ networkClientId: string;
430
+ };
431
+ fallbacks: string[];
432
+ };
433
+ blockExplorerUrls: {
434
+ default: string;
435
+ fallbacks: string[];
436
+ };
437
+ config: {
438
+ isActive: boolean;
439
+ isTestnet: boolean;
440
+ isDefault: boolean;
441
+ isFeatured: boolean;
442
+ isDeprecated: boolean;
443
+ isDeletable: boolean;
444
+ priority: number;
445
+ isAutoEnabled?: boolean | undefined;
446
+ };
447
+ geckoTerminalPlatformId?: string | undefined;
448
+ contracts?: {
449
+ multicall3?: `0x${string}` | undefined;
450
+ } | undefined;
451
+ }>) => `${string}:${string}`[]) & {
452
+ clearCache: () => void;
453
+ resultsCount: () => number;
454
+ resetResultsCount: () => void;
455
+ };
456
+ lastResult: () => `${string}:${string}`[];
457
+ dependencies: [(state: ConfigRegistryControllerState) => Record<string, RegistryNetworkConfig>];
458
+ recomputations: () => number;
459
+ resetRecomputations: () => void;
460
+ dependencyRecomputations: () => number;
461
+ resetDependencyRecomputations: () => void;
462
+ } & {
463
+ argsMemoize: typeof import("reselect").weakMapMemoize;
464
+ memoize: typeof import("reselect").weakMapMemoize;
465
+ };
332
466
  //# sourceMappingURL=selectors.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"selectors.d.cts","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gDAA+C;AACpF,OAAO,KAAK,EAAE,6BAA6B,EAAE,uCAAsC;AAEnF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,UAClB,6BAA6B,KACnC,OAAO,MAAM,EAAE,qBAAqB,CAA2B,CAAC;AAEnE;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAV1B,6BAA6B,KACnC,OAAO,MAAM,EAAE,qBAAqB,CAAC;;;;;;;;CAwBvC,CAAC"}
1
+ {"version":3,"file":"selectors.d.cts","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gDAA+C;AACpF,OAAO,KAAK,EAAE,6BAA6B,EAAE,uCAAsC;AAEnF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,UAClB,6BAA6B,KACnC,OAAO,MAAM,EAAE,qBAAqB,CAA2B,CAAC;AAEnE;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAV1B,6BAA6B,KACnC,OAAO,MAAM,EAAE,qBAAqB,CAAC;;;;;;;;CAwBvC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAlCxC,6BAA6B,KACnC,OAAO,MAAM,EAAE,qBAAqB,CAAC;;;;;;;;CAqDvC,CAAC"}
@@ -58,6 +58,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
58
58
  isDeprecated: boolean;
59
59
  isDeletable: boolean;
60
60
  priority: number;
61
+ isAutoEnabled?: boolean | undefined;
61
62
  };
62
63
  geckoTerminalPlatformId?: string | undefined;
63
64
  contracts?: {
@@ -112,6 +113,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
112
113
  isDeprecated: boolean;
113
114
  isDeletable: boolean;
114
115
  priority: number;
116
+ isAutoEnabled?: boolean | undefined;
115
117
  };
116
118
  geckoTerminalPlatformId?: string | undefined;
117
119
  contracts?: {
@@ -161,6 +163,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
161
163
  isDeprecated: boolean;
162
164
  isDeletable: boolean;
163
165
  priority: number;
166
+ isAutoEnabled?: boolean | undefined;
164
167
  };
165
168
  geckoTerminalPlatformId?: string | undefined;
166
169
  contracts?: {
@@ -211,6 +214,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
211
214
  isDeprecated: boolean;
212
215
  isDeletable: boolean;
213
216
  priority: number;
217
+ isAutoEnabled?: boolean | undefined;
214
218
  };
215
219
  geckoTerminalPlatformId?: string | undefined;
216
220
  contracts?: {
@@ -260,6 +264,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
260
264
  isDeprecated: boolean;
261
265
  isDeletable: boolean;
262
266
  priority: number;
267
+ isAutoEnabled?: boolean | undefined;
263
268
  };
264
269
  geckoTerminalPlatformId?: string | undefined;
265
270
  contracts?: {
@@ -314,6 +319,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
314
319
  isDeprecated: boolean;
315
320
  isDeletable: boolean;
316
321
  priority: number;
322
+ isAutoEnabled?: boolean | undefined;
317
323
  };
318
324
  geckoTerminalPlatformId?: string | undefined;
319
325
  contracts?: {
@@ -329,4 +335,132 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
329
335
  argsMemoize: typeof import("reselect").weakMapMemoize;
330
336
  memoize: typeof import("reselect").weakMapMemoize;
331
337
  };
338
+ /**
339
+ * Returns the list of CAIP-2 chain IDs for networks that are auto-enabled in the
340
+ * config registry.
341
+ *
342
+ * @param state - The config registry controller state.
343
+ * @returns The list of CAIP-2 chain IDs for auto-enabled networks.
344
+ */
345
+ export declare const selectEvmAutoEnabledNetworksChainIds: ((state: ConfigRegistryControllerState) => `${string}:${string}`[]) & {
346
+ clearCache: () => void;
347
+ resultsCount: () => number;
348
+ resetResultsCount: () => void;
349
+ } & {
350
+ resultFunc: (resultFuncArgs_0: Record<string, {
351
+ imageUrl: string;
352
+ name: string;
353
+ chainId: `${string}:${string}`;
354
+ coingeckoPlatformId: string;
355
+ assets: {
356
+ native: {
357
+ symbol: string;
358
+ assetId: string;
359
+ imageUrl: string;
360
+ name: string;
361
+ decimals: number;
362
+ coingeckoCoinId?: string | undefined;
363
+ };
364
+ listUrl?: string | undefined;
365
+ governance?: {
366
+ symbol: string;
367
+ assetId: string;
368
+ imageUrl: string;
369
+ name: string;
370
+ decimals: number;
371
+ coingeckoCoinId?: string | undefined;
372
+ } | undefined;
373
+ };
374
+ rpcProviders: {
375
+ default: {
376
+ url: string;
377
+ type: string;
378
+ networkClientId: string;
379
+ };
380
+ fallbacks: string[];
381
+ };
382
+ blockExplorerUrls: {
383
+ default: string;
384
+ fallbacks: string[];
385
+ };
386
+ config: {
387
+ isActive: boolean;
388
+ isTestnet: boolean;
389
+ isDefault: boolean;
390
+ isFeatured: boolean;
391
+ isDeprecated: boolean;
392
+ isDeletable: boolean;
393
+ priority: number;
394
+ isAutoEnabled?: boolean | undefined;
395
+ };
396
+ geckoTerminalPlatformId?: string | undefined;
397
+ contracts?: {
398
+ multicall3?: `0x${string}` | undefined;
399
+ } | undefined;
400
+ }>) => `${string}:${string}`[];
401
+ memoizedResultFunc: ((resultFuncArgs_0: Record<string, {
402
+ imageUrl: string;
403
+ name: string;
404
+ chainId: `${string}:${string}`;
405
+ coingeckoPlatformId: string;
406
+ assets: {
407
+ native: {
408
+ symbol: string;
409
+ assetId: string;
410
+ imageUrl: string;
411
+ name: string;
412
+ decimals: number;
413
+ coingeckoCoinId?: string | undefined;
414
+ };
415
+ listUrl?: string | undefined;
416
+ governance?: {
417
+ symbol: string;
418
+ assetId: string;
419
+ imageUrl: string;
420
+ name: string;
421
+ decimals: number;
422
+ coingeckoCoinId?: string | undefined;
423
+ } | undefined;
424
+ };
425
+ rpcProviders: {
426
+ default: {
427
+ url: string;
428
+ type: string;
429
+ networkClientId: string;
430
+ };
431
+ fallbacks: string[];
432
+ };
433
+ blockExplorerUrls: {
434
+ default: string;
435
+ fallbacks: string[];
436
+ };
437
+ config: {
438
+ isActive: boolean;
439
+ isTestnet: boolean;
440
+ isDefault: boolean;
441
+ isFeatured: boolean;
442
+ isDeprecated: boolean;
443
+ isDeletable: boolean;
444
+ priority: number;
445
+ isAutoEnabled?: boolean | undefined;
446
+ };
447
+ geckoTerminalPlatformId?: string | undefined;
448
+ contracts?: {
449
+ multicall3?: `0x${string}` | undefined;
450
+ } | undefined;
451
+ }>) => `${string}:${string}`[]) & {
452
+ clearCache: () => void;
453
+ resultsCount: () => number;
454
+ resetResultsCount: () => void;
455
+ };
456
+ lastResult: () => `${string}:${string}`[];
457
+ dependencies: [(state: ConfigRegistryControllerState) => Record<string, RegistryNetworkConfig>];
458
+ recomputations: () => number;
459
+ resetRecomputations: () => void;
460
+ dependencyRecomputations: () => number;
461
+ resetDependencyRecomputations: () => void;
462
+ } & {
463
+ argsMemoize: typeof import("reselect").weakMapMemoize;
464
+ memoize: typeof import("reselect").weakMapMemoize;
465
+ };
332
466
  //# sourceMappingURL=selectors.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"selectors.d.mts","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gDAA+C;AACpF,OAAO,KAAK,EAAE,6BAA6B,EAAE,uCAAsC;AAEnF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,UAClB,6BAA6B,KACnC,OAAO,MAAM,EAAE,qBAAqB,CAA2B,CAAC;AAEnE;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAlCxC,6BAA6B,KACnC,OAAO,MAAM,EAAE,qBAAqB,CAAC;;;;;;;;CAqDvC,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { KnownCaipNamespace } from "@metamask/utils";
1
2
  import { createSelector } from "reselect";
2
3
  import { filterNetworks } from "./config-registry-api-service/filters.mjs";
3
4
  /**
@@ -27,4 +28,23 @@ export const selectFeaturedNetworks = createSelector(selectNetworks, (networks)
27
28
  });
28
29
  return result;
29
30
  });
31
+ /**
32
+ * Returns the list of CAIP-2 chain IDs for networks that are auto-enabled in the
33
+ * config registry.
34
+ *
35
+ * @param state - The config registry controller state.
36
+ * @returns The list of CAIP-2 chain IDs for auto-enabled networks.
37
+ */
38
+ export const selectEvmAutoEnabledNetworksChainIds = createSelector(selectNetworks, (networks) => Object.values(networks)
39
+ .filter(({ chainId, config }) => chainId.startsWith(KnownCaipNamespace.Eip155) &&
40
+ config.isAutoEnabled &&
41
+ config.isActive &&
42
+ !config.isDeprecated)
43
+ .map((config) => config.chainId), {
44
+ // Messenger selector subscriptions only skip work when the result is
45
+ // referentially equal, so keep the previous array when the IDs are the same.
46
+ memoizeOptions: {
47
+ resultEqualityCheck: (a, b) => a.length === b.length && a.every((chainId, i) => chainId === b[i]),
48
+ },
49
+ });
30
50
  //# sourceMappingURL=selectors.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"selectors.mjs","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB;AAE1C,OAAO,EAAE,cAAc,EAAE,kDAAiD;AAI1E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,KAAoC,EACG,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,cAAc,CAClD,cAAc,EACd,CAAC,QAAQ,EAAyC,EAAE;IAClD,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAG,cAAc,CAAC,YAAY,EAAE;QAC5C,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,KAAK;KACjB,CAAC,CAAC;IACH,MAAM,MAAM,GAA0C,EAAE,CAAC;IACzD,QAAQ,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QAC1B,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC;IAClC,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC,CACF,CAAC","sourcesContent":["import { createSelector } from 'reselect';\n\nimport { filterNetworks } from './config-registry-api-service/filters.js';\nimport type { RegistryNetworkConfig } from './config-registry-api-service/types.js';\nimport type { ConfigRegistryControllerState } from './ConfigRegistryController.js';\n\n/**\n * Base selector to get all networks from the controller state.\n *\n * @param state - The ConfigRegistryController state\n * @returns All network configurations keyed by chain ID\n */\nexport const selectNetworks = (\n state: ConfigRegistryControllerState,\n): Record<string, RegistryNetworkConfig> => state.configs.networks;\n\n/**\n * Selector to get featured, active, non-testnet networks.\n * Use this for the default network list (e.g. main network picker).\n *\n * @param state - The ConfigRegistryController state\n * @returns Filtered network configurations keyed by chain ID\n */\nexport const selectFeaturedNetworks = createSelector(\n selectNetworks,\n (networks): Record<string, RegistryNetworkConfig> => {\n const networkArray = Object.values(networks);\n const filtered = filterNetworks(networkArray, {\n isFeatured: true,\n isActive: true,\n isTestnet: false,\n });\n const result: Record<string, RegistryNetworkConfig> = {};\n filtered.forEach((config) => {\n result[config.chainId] = config;\n });\n return result;\n },\n);\n"]}
1
+ {"version":3,"file":"selectors.mjs","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,kBAAkB,EAAE,wBAAwB;AAClE,OAAO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CAAgB,EAAE,CAAgB,EAAE,EAAE,CAC1D,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KACrE;CACF,CACF,CAAC","sourcesContent":["import { CaipChainId, KnownCaipNamespace } from '@metamask/utils';\nimport { createSelector } from 'reselect';\n\nimport { filterNetworks } from './config-registry-api-service/filters.js';\nimport type { RegistryNetworkConfig } from './config-registry-api-service/types.js';\nimport type { ConfigRegistryControllerState } from './ConfigRegistryController.js';\n\n/**\n * Base selector to get all networks from the controller state.\n *\n * @param state - The ConfigRegistryController state\n * @returns All network configurations keyed by chain ID\n */\nexport const selectNetworks = (\n state: ConfigRegistryControllerState,\n): Record<string, RegistryNetworkConfig> => state.configs.networks;\n\n/**\n * Selector to get featured, active, non-testnet networks.\n * Use this for the default network list (e.g. main network picker).\n *\n * @param state - The ConfigRegistryController state\n * @returns Filtered network configurations keyed by chain ID\n */\nexport const selectFeaturedNetworks = createSelector(\n selectNetworks,\n (networks): Record<string, RegistryNetworkConfig> => {\n const networkArray = Object.values(networks);\n const filtered = filterNetworks(networkArray, {\n isFeatured: true,\n isActive: true,\n isTestnet: false,\n });\n const result: Record<string, RegistryNetworkConfig> = {};\n filtered.forEach((config) => {\n result[config.chainId] = config;\n });\n return result;\n },\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 const selectEvmAutoEnabledNetworksChainIds = createSelector(\n selectNetworks,\n (networks): CaipChainId[] =>\n Object.values(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 // Messenger selector subscriptions only skip work when the result is\n // referentially equal, so keep the previous array when the IDs are the same.\n memoizeOptions: {\n resultEqualityCheck: (a: CaipChainId[], b: CaipChainId[]) =>\n a.length === b.length && a.every((chainId, i) => chainId === b[i]),\n },\n },\n);\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/config-registry-controller",
3
- "version": "3.0.0-preview-bbf9454b2",
3
+ "version": "3.0.0-preview-d23deb68f",
4
4
  "description": "Manages configuration registry for MetaMask",
5
5
  "keywords": [
6
6
  "Ethereum",