@metamask-previews/config-registry-controller 5.0.0-preview-701acab40 → 6.0.0-preview-d8f16be

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,12 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [6.0.0]
11
+
10
12
  ### Added
11
13
 
12
14
  - Add support for Node.js 26 ([#10981](https://github.com/MetaMask/core/pull/10981))
13
15
 
14
16
  ### Changed
15
17
 
18
+ - Accept full RPC provider objects (not just URL strings) in `rpcProviders.fallbacks`, so a single chain using the new object form (e.g. Pharos Mainnet) no longer fails validation for the entire networks config response ([#11436](https://github.com/MetaMask/core/pull/11436))
16
19
  - **BREAKING:** Change `FetchConfigResult` and `FetchEventsConfigResult` to use `null` instead of omitted properties ([#11134](https://github.com/MetaMask/core/pull/11134))
17
20
  - `etag` is now `string | null`, and is `null` when the response has no `ETag` header. Previously it was `undefined`.
18
21
  - `data` is now `null` when the server returns 304 and the service has no cached data. Previously it was omitted.
@@ -202,7 +205,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
202
205
 
203
206
  - Initial release ([#7668](https://github.com/MetaMask/core/pull/7668), [#7809](https://github.com/MetaMask/core/pull/7809))
204
207
 
205
- [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/config-registry-controller@5.0.0...HEAD
208
+ [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/config-registry-controller@6.0.0...HEAD
209
+ [6.0.0]: https://github.com/MetaMask/core/compare/@metamask/config-registry-controller@5.0.0...@metamask/config-registry-controller@6.0.0
206
210
  [5.0.0]: https://github.com/MetaMask/core/compare/@metamask/config-registry-controller@4.0.0...@metamask/config-registry-controller@5.0.0
207
211
  [4.0.0]: https://github.com/MetaMask/core/compare/@metamask/config-registry-controller@3.1.0...@metamask/config-registry-controller@4.0.0
208
212
  [3.1.0]: https://github.com/MetaMask/core/compare/@metamask/config-registry-controller@3.0.0...@metamask/config-registry-controller@3.1.0
@@ -34,7 +34,11 @@ export declare const RegistryNetworkConfigSchema: import("@metamask/superstruct"
34
34
  type: string;
35
35
  networkClientId: string;
36
36
  };
37
- fallbacks: string[];
37
+ fallbacks: (string | {
38
+ url: string;
39
+ type: string;
40
+ networkClientId: string;
41
+ })[];
38
42
  };
39
43
  blockExplorerUrls: {
40
44
  default: string;
@@ -116,7 +120,11 @@ export declare const RegistryNetworkConfigSchema: import("@metamask/superstruct"
116
120
  type: string;
117
121
  networkClientId: string;
118
122
  };
119
- fallbacks: string[];
123
+ fallbacks: (string | {
124
+ url: string;
125
+ type: string;
126
+ networkClientId: string;
127
+ })[];
120
128
  }, {
121
129
  default: import("@metamask/superstruct").Struct<{
122
130
  url: string;
@@ -127,7 +135,15 @@ export declare const RegistryNetworkConfigSchema: import("@metamask/superstruct"
127
135
  type: import("@metamask/superstruct").Struct<string, null>;
128
136
  networkClientId: import("@metamask/superstruct").Struct<string, null>;
129
137
  }>;
130
- fallbacks: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
138
+ fallbacks: import("@metamask/superstruct").Struct<(string | {
139
+ url: string;
140
+ type: string;
141
+ networkClientId: string;
142
+ })[], import("@metamask/superstruct").Struct<string | {
143
+ url: string;
144
+ type: string;
145
+ networkClientId: string;
146
+ }, null>>;
131
147
  }>;
132
148
  blockExplorerUrls: import("@metamask/superstruct").Struct<{
133
149
  default: string;
@@ -199,7 +215,11 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
199
215
  type: string;
200
216
  networkClientId: string;
201
217
  };
202
- fallbacks: string[];
218
+ fallbacks: (string | {
219
+ url: string;
220
+ type: string;
221
+ networkClientId: string;
222
+ })[];
203
223
  };
204
224
  blockExplorerUrls: {
205
225
  default: string;
@@ -255,7 +275,11 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
255
275
  type: string;
256
276
  networkClientId: string;
257
277
  };
258
- fallbacks: string[];
278
+ fallbacks: (string | {
279
+ url: string;
280
+ type: string;
281
+ networkClientId: string;
282
+ })[];
259
283
  };
260
284
  blockExplorerUrls: {
261
285
  default: string;
@@ -309,7 +333,11 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
309
333
  type: string;
310
334
  networkClientId: string;
311
335
  };
312
- fallbacks: string[];
336
+ fallbacks: (string | {
337
+ url: string;
338
+ type: string;
339
+ networkClientId: string;
340
+ })[];
313
341
  };
314
342
  blockExplorerUrls: {
315
343
  default: string;
@@ -359,7 +387,11 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
359
387
  type: string;
360
388
  networkClientId: string;
361
389
  };
362
- fallbacks: string[];
390
+ fallbacks: (string | {
391
+ url: string;
392
+ type: string;
393
+ networkClientId: string;
394
+ })[];
363
395
  };
364
396
  blockExplorerUrls: {
365
397
  default: string;
@@ -441,7 +473,11 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
441
473
  type: string;
442
474
  networkClientId: string;
443
475
  };
444
- fallbacks: string[];
476
+ fallbacks: (string | {
477
+ url: string;
478
+ type: string;
479
+ networkClientId: string;
480
+ })[];
445
481
  }, {
446
482
  default: import("@metamask/superstruct").Struct<{
447
483
  url: string;
@@ -452,7 +488,15 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
452
488
  type: import("@metamask/superstruct").Struct<string, null>;
453
489
  networkClientId: import("@metamask/superstruct").Struct<string, null>;
454
490
  }>;
455
- fallbacks: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
491
+ fallbacks: import("@metamask/superstruct").Struct<(string | {
492
+ url: string;
493
+ type: string;
494
+ networkClientId: string;
495
+ })[], import("@metamask/superstruct").Struct<string | {
496
+ url: string;
497
+ type: string;
498
+ networkClientId: string;
499
+ }, null>>;
456
500
  }>;
457
501
  blockExplorerUrls: import("@metamask/superstruct").Struct<{
458
502
  default: string;
@@ -554,7 +598,11 @@ export declare const FetchConfigResultStruct: import("@metamask/superstruct").St
554
598
  type: string;
555
599
  networkClientId: string;
556
600
  };
557
- fallbacks: string[];
601
+ fallbacks: (string | {
602
+ url: string;
603
+ type: string;
604
+ networkClientId: string;
605
+ })[];
558
606
  };
559
607
  blockExplorerUrls: {
560
608
  default: string;
@@ -614,7 +662,11 @@ export declare const FetchConfigResultStruct: import("@metamask/superstruct").St
614
662
  type: string;
615
663
  networkClientId: string;
616
664
  };
617
- fallbacks: string[];
665
+ fallbacks: (string | {
666
+ url: string;
667
+ type: string;
668
+ networkClientId: string;
669
+ })[];
618
670
  };
619
671
  blockExplorerUrls: {
620
672
  default: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config-registry-api-service/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AA6DnD;;;GAGG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWtC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAWlC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;QAWxC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,WAAW,CAAC,IAAI,IACjB;IACE,QAAQ,EAAE,KAAK,CAAC;IAChB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB;;;OAGG;IACH,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;CACnB,GACD;IACE,QAAQ,EAAE,IAAI,CAAC;IACf,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AAEN,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC,yBAAyB,CAAC,CAAC;AAEvE,MAAM,MAAM,uBAAuB,GACjC,WAAW,CAAC,+BAA+B,CAAC,CAAC"}
@@ -20,7 +20,10 @@ const RpcProviderSchema = type({
20
20
  });
21
21
  const RpcProvidersSchema = type({
22
22
  default: RpcProviderSchema,
23
- fallbacks: array(string()),
23
+ // The registry API historically served plain RPC URL strings here and now
24
+ // also serves full provider objects; both shapes are accepted so a single
25
+ // new-style chain does not fail validation for the entire response.
26
+ fallbacks: array(union([string(), RpcProviderSchema])),
24
27
  });
25
28
  const BlockExplorerUrlsSchema = type({
26
29
  default: string(),
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/config-registry-api-service/types.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,EACL,OAAO,EACP,OAAO,EACP,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,MAAM,EACN,MAAM,EACN,IAAI,EACJ,KAAK,GACN,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AA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AAI,CAAC;QACvB,IAAI,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;QACxB,IAAI,EAAE,+BAA+B;KACtC,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,6BAA6B,GAAG,KAAK,CAAC;IACjD,IAAI,CAAC;QACH,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC;QACxB,IAAI,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;QACxB,IAAI,EAAE,QAAQ,CAAC,qCAAqC,CAAC;KACtD,CAAC;IACF,IAAI,CAAC;QACH,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC;QACvB,IAAI,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;QACxB,IAAI,EAAE,qCAAqC;KAC5C,CAAC;CACH,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n array,\n boolean,\n literal,\n nullable,\n number,\n optional,\n record,\n string,\n type,\n union,\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\n/**\n * Schema for the events-config API response.\n * Maps event names to their allowed analytics purposes.\n */\nexport const RegistryEventsConfigApiResponseSchema = type({\n data: type({\n schemaVersion: string(),\n version: string(),\n timestamp: number(),\n events: record(string(), array(string())),\n }),\n});\n\nexport type RegistryEventsConfigApiResponse = Infer<\n typeof RegistryEventsConfigApiResponseSchema\n>;\n\nexport type RegistryEventsConfig = RegistryEventsConfigApiResponse['data'];\n\nexport const FetchConfigResultStruct = union([\n type({\n modified: literal(false),\n etag: nullable(string()),\n data: nullable(RegistryConfigApiResponseSchema),\n }),\n type({\n modified: literal(true),\n etag: nullable(string()),\n data: RegistryConfigApiResponseSchema,\n }),\n]);\n\nexport const FetchEventsConfigResultStruct = union([\n type({\n modified: literal(false),\n etag: nullable(string()),\n data: nullable(RegistryEventsConfigApiResponseSchema),\n }),\n type({\n modified: literal(true),\n etag: nullable(string()),\n data: RegistryEventsConfigApiResponseSchema,\n }),\n]);\n\nexport type FetchConfigOptions = {\n etag?: string;\n};\n\ntype FetchResult<Data> =\n | {\n modified: false;\n etag: string | null;\n /**\n * Cached data from the service when available (e.g. after a previous\n * successful fetch). `null` when the service has no cache yet.\n */\n data: Data | null;\n }\n | {\n modified: true;\n etag: string | null;\n data: Data;\n };\n\nexport type FetchConfigResult = FetchResult<RegistryConfigApiResponse>;\n\nexport type FetchEventsConfigResult =\n FetchResult<RegistryEventsConfigApiResponse>;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/config-registry-api-service/types.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,EACL,OAAO,EACP,OAAO,EACP,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,MAAM,EACN,MAAM,EACN,IAAI,EACJ,KAAK,GACN,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;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,0EAA0E;IAC1E,0EAA0E;IAC1E,oEAAoE;IACpE,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,E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CACH,CAAC,CAAC;AAQH;;;GAGG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,IAAI,CAAC;IACxD,IAAI,EAAE,IAAI,CAAC;QACT,aAAa,EAAE,MAAM,EAAE;QACvB,OAAO,EAAE,MAAM,EAAE;QACjB,SAAS,EAAE,MAAM,EAAE;QACnB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;KAC1C,CAAC;CACH,CAAC,CAAC;AAQH,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,CAAC;IAC3C,IAAI,CAAC;QACH,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC;QACxB,IAAI,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;QACxB,IAAI,EAAE,QAAQ,CAAC,+BAA+B,CAAC;KAChD,CAAC;IACF,IAAI,CAAC;QACH,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC;QACvB,IAAI,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;QACxB,IAAI,EAAE,+BAA+B;KACtC,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,6BAA6B,GAAG,KAAK,CAAC;IACjD,IAAI,CAAC;QACH,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC;QACxB,IAAI,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;QACxB,IAAI,EAAE,QAAQ,CAAC,qCAAqC,CAAC;KACtD,CAAC;IACF,IAAI,CAAC;QACH,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC;QACvB,IAAI,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;QACxB,IAAI,EAAE,qCAAqC;KAC5C,CAAC;CACH,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n array,\n boolean,\n literal,\n nullable,\n number,\n optional,\n record,\n string,\n type,\n union,\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 // The registry API historically served plain RPC URL strings here and now\n // also serves full provider objects; both shapes are accepted so a single\n // new-style chain does not fail validation for the entire response.\n fallbacks: array(union([string(), RpcProviderSchema])),\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\n/**\n * Schema for the events-config API response.\n * Maps event names to their allowed analytics purposes.\n */\nexport const RegistryEventsConfigApiResponseSchema = type({\n data: type({\n schemaVersion: string(),\n version: string(),\n timestamp: number(),\n events: record(string(), array(string())),\n }),\n});\n\nexport type RegistryEventsConfigApiResponse = Infer<\n typeof RegistryEventsConfigApiResponseSchema\n>;\n\nexport type RegistryEventsConfig = RegistryEventsConfigApiResponse['data'];\n\nexport const FetchConfigResultStruct = union([\n type({\n modified: literal(false),\n etag: nullable(string()),\n data: nullable(RegistryConfigApiResponseSchema),\n }),\n type({\n modified: literal(true),\n etag: nullable(string()),\n data: RegistryConfigApiResponseSchema,\n }),\n]);\n\nexport const FetchEventsConfigResultStruct = union([\n type({\n modified: literal(false),\n etag: nullable(string()),\n data: nullable(RegistryEventsConfigApiResponseSchema),\n }),\n type({\n modified: literal(true),\n etag: nullable(string()),\n data: RegistryEventsConfigApiResponseSchema,\n }),\n]);\n\nexport type FetchConfigOptions = {\n etag?: string;\n};\n\ntype FetchResult<Data> =\n | {\n modified: false;\n etag: string | null;\n /**\n * Cached data from the service when available (e.g. after a previous\n * successful fetch). `null` when the service has no cache yet.\n */\n data: Data | null;\n }\n | {\n modified: true;\n etag: string | null;\n data: Data;\n };\n\nexport type FetchConfigResult = FetchResult<RegistryConfigApiResponse>;\n\nexport type FetchEventsConfigResult =\n FetchResult<RegistryEventsConfigApiResponse>;\n"]}
@@ -45,7 +45,11 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
45
45
  type: string;
46
46
  networkClientId: string;
47
47
  };
48
- fallbacks: string[];
48
+ fallbacks: (string | {
49
+ url: string;
50
+ type: string;
51
+ networkClientId: string;
52
+ })[];
49
53
  };
50
54
  blockExplorerUrls: {
51
55
  default: string;
@@ -100,7 +104,11 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
100
104
  type: string;
101
105
  networkClientId: string;
102
106
  };
103
- fallbacks: string[];
107
+ fallbacks: (string | {
108
+ url: string;
109
+ type: string;
110
+ networkClientId: string;
111
+ })[];
104
112
  };
105
113
  blockExplorerUrls: {
106
114
  default: string;
@@ -150,7 +158,11 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
150
158
  type: string;
151
159
  networkClientId: string;
152
160
  };
153
- fallbacks: string[];
161
+ fallbacks: (string | {
162
+ url: string;
163
+ type: string;
164
+ networkClientId: string;
165
+ })[];
154
166
  };
155
167
  blockExplorerUrls: {
156
168
  default: string;
@@ -201,7 +213,11 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
201
213
  type: string;
202
214
  networkClientId: string;
203
215
  };
204
- fallbacks: string[];
216
+ fallbacks: (string | {
217
+ url: string;
218
+ type: string;
219
+ networkClientId: string;
220
+ })[];
205
221
  };
206
222
  blockExplorerUrls: {
207
223
  default: string;
@@ -251,7 +267,11 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
251
267
  type: string;
252
268
  networkClientId: string;
253
269
  };
254
- fallbacks: string[];
270
+ fallbacks: (string | {
271
+ url: string;
272
+ type: string;
273
+ networkClientId: string;
274
+ })[];
255
275
  };
256
276
  blockExplorerUrls: {
257
277
  default: string;
@@ -306,7 +326,11 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
306
326
  type: string;
307
327
  networkClientId: string;
308
328
  };
309
- fallbacks: string[];
329
+ fallbacks: (string | {
330
+ url: string;
331
+ type: string;
332
+ networkClientId: string;
333
+ })[];
310
334
  };
311
335
  blockExplorerUrls: {
312
336
  default: string;
@@ -378,7 +402,11 @@ export declare const selectEvmAutoEnabledNetworksChainIds: ((state: ConfigRegist
378
402
  type: string;
379
403
  networkClientId: string;
380
404
  };
381
- fallbacks: string[];
405
+ fallbacks: (string | {
406
+ url: string;
407
+ type: string;
408
+ networkClientId: string;
409
+ })[];
382
410
  };
383
411
  blockExplorerUrls: {
384
412
  default: string;
@@ -429,7 +457,11 @@ export declare const selectEvmAutoEnabledNetworksChainIds: ((state: ConfigRegist
429
457
  type: string;
430
458
  networkClientId: string;
431
459
  };
432
- fallbacks: string[];
460
+ fallbacks: (string | {
461
+ url: string;
462
+ type: string;
463
+ networkClientId: string;
464
+ })[];
433
465
  };
434
466
  blockExplorerUrls: {
435
467
  default: string;
@@ -1 +1 @@
1
- {"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAEnF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,UAClB,6BAA6B,KACnC,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAA2B,CAAC;AAEnE;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAelC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoBhD,CAAC"}
1
+ {"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAEnF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,UAClB,6BAA6B,KACnC,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAA2B,CAAC;AAEnE;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAelC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoBhD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/config-registry-controller",
3
- "version": "5.0.0-preview-701acab40",
3
+ "version": "6.0.0-preview-d8f16be",
4
4
  "description": "Manages configuration registry for MetaMask",
5
5
  "keywords": [
6
6
  "Ethereum",