@metamask-previews/config-registry-controller 0.2.0-preview-45a82ea8e → 0.3.0-preview-d8ff44d
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 +10 -3
- package/dist/config-registry-api-service/types.cjs +1 -1
- package/dist/config-registry-api-service/types.cjs.map +1 -1
- package/dist/config-registry-api-service/types.d.cts +9 -9
- package/dist/config-registry-api-service/types.d.mts +9 -9
- package/dist/config-registry-api-service/types.mjs +1 -1
- package/dist/config-registry-api-service/types.mjs.map +1 -1
- package/dist/selectors.d.cts +6 -6
- package/dist/selectors.d.mts +6 -6
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -7,14 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.3.0]
|
|
11
|
+
|
|
10
12
|
### Changed
|
|
11
13
|
|
|
12
|
-
- Bump `@metamask/keyring-controller` from `^25.1.1` to `^25.
|
|
14
|
+
- Bump `@metamask/keyring-controller` from `^25.1.1` to `^25.3.0` ([#8363](https://github.com/MetaMask/core/pull/8363), [#8634](https://github.com/MetaMask/core/pull/8634))
|
|
13
15
|
- Bump `@metamask/profile-sync-controller` from `^28.0.1` to `^28.0.2` ([#8325](https://github.com/MetaMask/core/pull/8325))
|
|
14
16
|
- Bump `@metamask/controller-utils` from `^11.19.0` to `^11.20.0` ([#8344](https://github.com/MetaMask/core/pull/8344))
|
|
15
|
-
- Bump `@metamask/messenger` from `^1.0.0` to `^1.
|
|
17
|
+
- Bump `@metamask/messenger` from `^1.0.0` to `^1.2.0` ([#8364](https://github.com/MetaMask/core/pull/8364), [#8373](https://github.com/MetaMask/core/pull/8373), [#8632](https://github.com/MetaMask/core/pull/8632))
|
|
16
18
|
- Bump `@metamask/base-controller` from `^9.0.1` to `^9.1.0` ([#8457](https://github.com/MetaMask/core/pull/8457))
|
|
17
19
|
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- `ConfigRegistryApiService` now accepts chains with no `assets.listUrl` property ([#8624](https://github.com/MetaMask/core/pull/8624))
|
|
23
|
+
|
|
18
24
|
## [0.2.0]
|
|
19
25
|
|
|
20
26
|
### Changed
|
|
@@ -39,7 +45,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
39
45
|
|
|
40
46
|
- Initial release ([#7668](https://github.com/MetaMask/core/pull/7668), [#7809](https://github.com/MetaMask/core/pull/7809))
|
|
41
47
|
|
|
42
|
-
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/config-registry-controller@0.
|
|
48
|
+
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/config-registry-controller@0.3.0...HEAD
|
|
49
|
+
[0.3.0]: https://github.com/MetaMask/core/compare/@metamask/config-registry-controller@0.2.0...@metamask/config-registry-controller@0.3.0
|
|
43
50
|
[0.2.0]: https://github.com/MetaMask/core/compare/@metamask/config-registry-controller@0.1.1...@metamask/config-registry-controller@0.2.0
|
|
44
51
|
[0.1.1]: https://github.com/MetaMask/core/compare/@metamask/config-registry-controller@0.1.0...@metamask/config-registry-controller@0.1.1
|
|
45
52
|
[0.1.0]: https://github.com/MetaMask/core/releases/tag/@metamask/config-registry-controller@0.1.0
|
|
@@ -11,7 +11,7 @@ const AssetSchema = (0, superstruct_1.type)({
|
|
|
11
11
|
coingeckoCoinId: (0, superstruct_1.string)(),
|
|
12
12
|
});
|
|
13
13
|
const AssetsSchema = (0, superstruct_1.type)({
|
|
14
|
-
listUrl: (0, superstruct_1.string)(),
|
|
14
|
+
listUrl: (0, superstruct_1.optional)((0, superstruct_1.string)()),
|
|
15
15
|
native: AssetSchema,
|
|
16
16
|
governance: (0, superstruct_1.optional)(AssetSchema),
|
|
17
17
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../src/config-registry-api-service/types.ts"],"names":[],"mappings":";;;AACA,uDAQ+B;AAE/B,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,oBAAM,GAAE;CAC1B,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,IAAA,kBAAI,EAAC;IACxB,OAAO,EAAE,IAAA,oBAAM,GAAE;
|
|
1
|
+
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../src/config-registry-api-service/types.ts"],"names":[],"mappings":";;;AACA,uDAQ+B;AAE/B,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,oBAAM,GAAE;CAC1B,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,IAAA,kBAAI,EAAC;IACxB,OAAO,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;IAC3B,MAAM,EAAE,WAAW;IACnB,UAAU,EAAE,IAAA,sBAAQ,EAAC,WAAW,CAAC;CAClC,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAG,IAAA,kBAAI,EAAC;IAC7B,GAAG,EAAE,IAAA,oBAAM,GAAE;IACb,IAAI,EAAE,IAAA,oBAAM,GAAE;IACd,eAAe,EAAE,IAAA,oBAAM,GAAE;CAC1B,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG,IAAA,kBAAI,EAAC;IAC9B,OAA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;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';\n\nconst AssetSchema = type({\n assetId: string(),\n imageUrl: string(),\n name: string(),\n symbol: string(),\n decimals: number(),\n coingeckoCoinId: 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\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: string(),\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});\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"]}
|
|
@@ -9,7 +9,6 @@ export declare const RegistryNetworkConfigSchema: import("@metamask/superstruct"
|
|
|
9
9
|
chainId: string;
|
|
10
10
|
coingeckoPlatformId: string;
|
|
11
11
|
assets: {
|
|
12
|
-
listUrl: string;
|
|
13
12
|
native: {
|
|
14
13
|
symbol: string;
|
|
15
14
|
name: string;
|
|
@@ -18,6 +17,7 @@ export declare const RegistryNetworkConfigSchema: import("@metamask/superstruct"
|
|
|
18
17
|
decimals: number;
|
|
19
18
|
coingeckoCoinId: string;
|
|
20
19
|
};
|
|
20
|
+
listUrl?: string | undefined;
|
|
21
21
|
governance?: {
|
|
22
22
|
symbol: string;
|
|
23
23
|
name: string;
|
|
@@ -56,7 +56,6 @@ export declare const RegistryNetworkConfigSchema: import("@metamask/superstruct"
|
|
|
56
56
|
coingeckoPlatformId: import("@metamask/superstruct").Struct<string, null>;
|
|
57
57
|
geckoTerminalPlatformId: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
58
58
|
assets: import("@metamask/superstruct").Struct<{
|
|
59
|
-
listUrl: string;
|
|
60
59
|
native: {
|
|
61
60
|
symbol: string;
|
|
62
61
|
name: string;
|
|
@@ -65,6 +64,7 @@ export declare const RegistryNetworkConfigSchema: import("@metamask/superstruct"
|
|
|
65
64
|
decimals: number;
|
|
66
65
|
coingeckoCoinId: string;
|
|
67
66
|
};
|
|
67
|
+
listUrl?: string | undefined;
|
|
68
68
|
governance?: {
|
|
69
69
|
symbol: string;
|
|
70
70
|
name: string;
|
|
@@ -74,7 +74,7 @@ export declare const RegistryNetworkConfigSchema: import("@metamask/superstruct"
|
|
|
74
74
|
coingeckoCoinId: string;
|
|
75
75
|
} | undefined;
|
|
76
76
|
}, {
|
|
77
|
-
listUrl: import("@metamask/superstruct").Struct<string, null>;
|
|
77
|
+
listUrl: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
78
78
|
native: import("@metamask/superstruct").Struct<{
|
|
79
79
|
symbol: string;
|
|
80
80
|
name: string;
|
|
@@ -163,7 +163,6 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
163
163
|
chainId: string;
|
|
164
164
|
coingeckoPlatformId: string;
|
|
165
165
|
assets: {
|
|
166
|
-
listUrl: string;
|
|
167
166
|
native: {
|
|
168
167
|
symbol: string;
|
|
169
168
|
name: string;
|
|
@@ -172,6 +171,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
172
171
|
decimals: number;
|
|
173
172
|
coingeckoCoinId: string;
|
|
174
173
|
};
|
|
174
|
+
listUrl?: string | undefined;
|
|
175
175
|
governance?: {
|
|
176
176
|
symbol: string;
|
|
177
177
|
name: string;
|
|
@@ -215,7 +215,6 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
215
215
|
chainId: string;
|
|
216
216
|
coingeckoPlatformId: string;
|
|
217
217
|
assets: {
|
|
218
|
-
listUrl: string;
|
|
219
218
|
native: {
|
|
220
219
|
symbol: string;
|
|
221
220
|
name: string;
|
|
@@ -224,6 +223,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
224
223
|
decimals: number;
|
|
225
224
|
coingeckoCoinId: string;
|
|
226
225
|
};
|
|
226
|
+
listUrl?: string | undefined;
|
|
227
227
|
governance?: {
|
|
228
228
|
symbol: string;
|
|
229
229
|
name: string;
|
|
@@ -265,7 +265,6 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
265
265
|
chainId: string;
|
|
266
266
|
coingeckoPlatformId: string;
|
|
267
267
|
assets: {
|
|
268
|
-
listUrl: string;
|
|
269
268
|
native: {
|
|
270
269
|
symbol: string;
|
|
271
270
|
name: string;
|
|
@@ -274,6 +273,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
274
273
|
decimals: number;
|
|
275
274
|
coingeckoCoinId: string;
|
|
276
275
|
};
|
|
276
|
+
listUrl?: string | undefined;
|
|
277
277
|
governance?: {
|
|
278
278
|
symbol: string;
|
|
279
279
|
name: string;
|
|
@@ -311,7 +311,6 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
311
311
|
chainId: string;
|
|
312
312
|
coingeckoPlatformId: string;
|
|
313
313
|
assets: {
|
|
314
|
-
listUrl: string;
|
|
315
314
|
native: {
|
|
316
315
|
symbol: string;
|
|
317
316
|
name: string;
|
|
@@ -320,6 +319,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
320
319
|
decimals: number;
|
|
321
320
|
coingeckoCoinId: string;
|
|
322
321
|
};
|
|
322
|
+
listUrl?: string | undefined;
|
|
323
323
|
governance?: {
|
|
324
324
|
symbol: string;
|
|
325
325
|
name: string;
|
|
@@ -358,7 +358,6 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
358
358
|
coingeckoPlatformId: import("@metamask/superstruct").Struct<string, null>;
|
|
359
359
|
geckoTerminalPlatformId: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
360
360
|
assets: import("@metamask/superstruct").Struct<{
|
|
361
|
-
listUrl: string;
|
|
362
361
|
native: {
|
|
363
362
|
symbol: string;
|
|
364
363
|
name: string;
|
|
@@ -367,6 +366,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
367
366
|
decimals: number;
|
|
368
367
|
coingeckoCoinId: string;
|
|
369
368
|
};
|
|
369
|
+
listUrl?: string | undefined;
|
|
370
370
|
governance?: {
|
|
371
371
|
symbol: string;
|
|
372
372
|
name: string;
|
|
@@ -376,7 +376,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
376
376
|
coingeckoCoinId: string;
|
|
377
377
|
} | undefined;
|
|
378
378
|
}, {
|
|
379
|
-
listUrl: import("@metamask/superstruct").Struct<string, null>;
|
|
379
|
+
listUrl: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
380
380
|
native: import("@metamask/superstruct").Struct<{
|
|
381
381
|
symbol: string;
|
|
382
382
|
name: string;
|
|
@@ -9,7 +9,6 @@ export declare const RegistryNetworkConfigSchema: import("@metamask/superstruct"
|
|
|
9
9
|
chainId: string;
|
|
10
10
|
coingeckoPlatformId: string;
|
|
11
11
|
assets: {
|
|
12
|
-
listUrl: string;
|
|
13
12
|
native: {
|
|
14
13
|
symbol: string;
|
|
15
14
|
name: string;
|
|
@@ -18,6 +17,7 @@ export declare const RegistryNetworkConfigSchema: import("@metamask/superstruct"
|
|
|
18
17
|
decimals: number;
|
|
19
18
|
coingeckoCoinId: string;
|
|
20
19
|
};
|
|
20
|
+
listUrl?: string | undefined;
|
|
21
21
|
governance?: {
|
|
22
22
|
symbol: string;
|
|
23
23
|
name: string;
|
|
@@ -56,7 +56,6 @@ export declare const RegistryNetworkConfigSchema: import("@metamask/superstruct"
|
|
|
56
56
|
coingeckoPlatformId: import("@metamask/superstruct").Struct<string, null>;
|
|
57
57
|
geckoTerminalPlatformId: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
58
58
|
assets: import("@metamask/superstruct").Struct<{
|
|
59
|
-
listUrl: string;
|
|
60
59
|
native: {
|
|
61
60
|
symbol: string;
|
|
62
61
|
name: string;
|
|
@@ -65,6 +64,7 @@ export declare const RegistryNetworkConfigSchema: import("@metamask/superstruct"
|
|
|
65
64
|
decimals: number;
|
|
66
65
|
coingeckoCoinId: string;
|
|
67
66
|
};
|
|
67
|
+
listUrl?: string | undefined;
|
|
68
68
|
governance?: {
|
|
69
69
|
symbol: string;
|
|
70
70
|
name: string;
|
|
@@ -74,7 +74,7 @@ export declare const RegistryNetworkConfigSchema: import("@metamask/superstruct"
|
|
|
74
74
|
coingeckoCoinId: string;
|
|
75
75
|
} | undefined;
|
|
76
76
|
}, {
|
|
77
|
-
listUrl: import("@metamask/superstruct").Struct<string, null>;
|
|
77
|
+
listUrl: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
78
78
|
native: import("@metamask/superstruct").Struct<{
|
|
79
79
|
symbol: string;
|
|
80
80
|
name: string;
|
|
@@ -163,7 +163,6 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
163
163
|
chainId: string;
|
|
164
164
|
coingeckoPlatformId: string;
|
|
165
165
|
assets: {
|
|
166
|
-
listUrl: string;
|
|
167
166
|
native: {
|
|
168
167
|
symbol: string;
|
|
169
168
|
name: string;
|
|
@@ -172,6 +171,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
172
171
|
decimals: number;
|
|
173
172
|
coingeckoCoinId: string;
|
|
174
173
|
};
|
|
174
|
+
listUrl?: string | undefined;
|
|
175
175
|
governance?: {
|
|
176
176
|
symbol: string;
|
|
177
177
|
name: string;
|
|
@@ -215,7 +215,6 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
215
215
|
chainId: string;
|
|
216
216
|
coingeckoPlatformId: string;
|
|
217
217
|
assets: {
|
|
218
|
-
listUrl: string;
|
|
219
218
|
native: {
|
|
220
219
|
symbol: string;
|
|
221
220
|
name: string;
|
|
@@ -224,6 +223,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
224
223
|
decimals: number;
|
|
225
224
|
coingeckoCoinId: string;
|
|
226
225
|
};
|
|
226
|
+
listUrl?: string | undefined;
|
|
227
227
|
governance?: {
|
|
228
228
|
symbol: string;
|
|
229
229
|
name: string;
|
|
@@ -265,7 +265,6 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
265
265
|
chainId: string;
|
|
266
266
|
coingeckoPlatformId: string;
|
|
267
267
|
assets: {
|
|
268
|
-
listUrl: string;
|
|
269
268
|
native: {
|
|
270
269
|
symbol: string;
|
|
271
270
|
name: string;
|
|
@@ -274,6 +273,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
274
273
|
decimals: number;
|
|
275
274
|
coingeckoCoinId: string;
|
|
276
275
|
};
|
|
276
|
+
listUrl?: string | undefined;
|
|
277
277
|
governance?: {
|
|
278
278
|
symbol: string;
|
|
279
279
|
name: string;
|
|
@@ -311,7 +311,6 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
311
311
|
chainId: string;
|
|
312
312
|
coingeckoPlatformId: string;
|
|
313
313
|
assets: {
|
|
314
|
-
listUrl: string;
|
|
315
314
|
native: {
|
|
316
315
|
symbol: string;
|
|
317
316
|
name: string;
|
|
@@ -320,6 +319,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
320
319
|
decimals: number;
|
|
321
320
|
coingeckoCoinId: string;
|
|
322
321
|
};
|
|
322
|
+
listUrl?: string | undefined;
|
|
323
323
|
governance?: {
|
|
324
324
|
symbol: string;
|
|
325
325
|
name: string;
|
|
@@ -358,7 +358,6 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
358
358
|
coingeckoPlatformId: import("@metamask/superstruct").Struct<string, null>;
|
|
359
359
|
geckoTerminalPlatformId: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
360
360
|
assets: import("@metamask/superstruct").Struct<{
|
|
361
|
-
listUrl: string;
|
|
362
361
|
native: {
|
|
363
362
|
symbol: string;
|
|
364
363
|
name: string;
|
|
@@ -367,6 +366,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
367
366
|
decimals: number;
|
|
368
367
|
coingeckoCoinId: string;
|
|
369
368
|
};
|
|
369
|
+
listUrl?: string | undefined;
|
|
370
370
|
governance?: {
|
|
371
371
|
symbol: string;
|
|
372
372
|
name: string;
|
|
@@ -376,7 +376,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
376
376
|
coingeckoCoinId: string;
|
|
377
377
|
} | undefined;
|
|
378
378
|
}, {
|
|
379
|
-
listUrl: import("@metamask/superstruct").Struct<string, null>;
|
|
379
|
+
listUrl: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
380
380
|
native: import("@metamask/superstruct").Struct<{
|
|
381
381
|
symbol: string;
|
|
382
382
|
name: string;
|
|
@@ -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;AAE/B,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,MAAM,EAAE;CAC1B,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,EAAE;
|
|
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;AAE/B,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,EAA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;IAC1C,MAAM,EAAE,iBAAiB;CAC1B,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,IAAI,CAAC;IAClD,IAAI,EAAE,IAAI,CAAC;QACT,OAAO,EAAE,MAAM,EAAE;QACjB,SAAS,EAAE,MAAM,EAAE;QACnB,MAAM,EAAE,KAAK,CAAC,2BAA2B,CAAC;KAC3C,CAAC;CACH,CAAC,CAAC;AAQH,MAAM,UAAU,iCAAiC,CAC/C,IAAa;IAEb,MAAM,CAAC,IAAI,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';\n\nconst AssetSchema = type({\n assetId: string(),\n imageUrl: string(),\n name: string(),\n symbol: string(),\n decimals: number(),\n coingeckoCoinId: 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\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: string(),\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});\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/selectors.d.cts
CHANGED
|
@@ -20,7 +20,6 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
20
20
|
chainId: string;
|
|
21
21
|
coingeckoPlatformId: string;
|
|
22
22
|
assets: {
|
|
23
|
-
listUrl: string;
|
|
24
23
|
native: {
|
|
25
24
|
symbol: string;
|
|
26
25
|
name: string;
|
|
@@ -29,6 +28,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
29
28
|
decimals: number;
|
|
30
29
|
coingeckoCoinId: string;
|
|
31
30
|
};
|
|
31
|
+
listUrl?: string | undefined;
|
|
32
32
|
governance?: {
|
|
33
33
|
symbol: string;
|
|
34
34
|
name: string;
|
|
@@ -71,7 +71,6 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
71
71
|
chainId: string;
|
|
72
72
|
coingeckoPlatformId: string;
|
|
73
73
|
assets: {
|
|
74
|
-
listUrl: string;
|
|
75
74
|
native: {
|
|
76
75
|
symbol: string;
|
|
77
76
|
name: string;
|
|
@@ -80,6 +79,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
80
79
|
decimals: number;
|
|
81
80
|
coingeckoCoinId: string;
|
|
82
81
|
};
|
|
82
|
+
listUrl?: string | undefined;
|
|
83
83
|
governance?: {
|
|
84
84
|
symbol: string;
|
|
85
85
|
name: string;
|
|
@@ -117,7 +117,6 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
117
117
|
chainId: string;
|
|
118
118
|
coingeckoPlatformId: string;
|
|
119
119
|
assets: {
|
|
120
|
-
listUrl: string;
|
|
121
120
|
native: {
|
|
122
121
|
symbol: string;
|
|
123
122
|
name: string;
|
|
@@ -126,6 +125,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
126
125
|
decimals: number;
|
|
127
126
|
coingeckoCoinId: string;
|
|
128
127
|
};
|
|
128
|
+
listUrl?: string | undefined;
|
|
129
129
|
governance?: {
|
|
130
130
|
symbol: string;
|
|
131
131
|
name: string;
|
|
@@ -164,7 +164,6 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
164
164
|
chainId: string;
|
|
165
165
|
coingeckoPlatformId: string;
|
|
166
166
|
assets: {
|
|
167
|
-
listUrl: string;
|
|
168
167
|
native: {
|
|
169
168
|
symbol: string;
|
|
170
169
|
name: string;
|
|
@@ -173,6 +172,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
173
172
|
decimals: number;
|
|
174
173
|
coingeckoCoinId: string;
|
|
175
174
|
};
|
|
175
|
+
listUrl?: string | undefined;
|
|
176
176
|
governance?: {
|
|
177
177
|
symbol: string;
|
|
178
178
|
name: string;
|
|
@@ -210,7 +210,6 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
210
210
|
chainId: string;
|
|
211
211
|
coingeckoPlatformId: string;
|
|
212
212
|
assets: {
|
|
213
|
-
listUrl: string;
|
|
214
213
|
native: {
|
|
215
214
|
symbol: string;
|
|
216
215
|
name: string;
|
|
@@ -219,6 +218,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
219
218
|
decimals: number;
|
|
220
219
|
coingeckoCoinId: string;
|
|
221
220
|
};
|
|
221
|
+
listUrl?: string | undefined;
|
|
222
222
|
governance?: {
|
|
223
223
|
symbol: string;
|
|
224
224
|
name: string;
|
|
@@ -261,7 +261,6 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
261
261
|
chainId: string;
|
|
262
262
|
coingeckoPlatformId: string;
|
|
263
263
|
assets: {
|
|
264
|
-
listUrl: string;
|
|
265
264
|
native: {
|
|
266
265
|
symbol: string;
|
|
267
266
|
name: string;
|
|
@@ -270,6 +269,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
270
269
|
decimals: number;
|
|
271
270
|
coingeckoCoinId: string;
|
|
272
271
|
};
|
|
272
|
+
listUrl?: string | undefined;
|
|
273
273
|
governance?: {
|
|
274
274
|
symbol: string;
|
|
275
275
|
name: string;
|
package/dist/selectors.d.mts
CHANGED
|
@@ -20,7 +20,6 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
20
20
|
chainId: string;
|
|
21
21
|
coingeckoPlatformId: string;
|
|
22
22
|
assets: {
|
|
23
|
-
listUrl: string;
|
|
24
23
|
native: {
|
|
25
24
|
symbol: string;
|
|
26
25
|
name: string;
|
|
@@ -29,6 +28,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
29
28
|
decimals: number;
|
|
30
29
|
coingeckoCoinId: string;
|
|
31
30
|
};
|
|
31
|
+
listUrl?: string | undefined;
|
|
32
32
|
governance?: {
|
|
33
33
|
symbol: string;
|
|
34
34
|
name: string;
|
|
@@ -71,7 +71,6 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
71
71
|
chainId: string;
|
|
72
72
|
coingeckoPlatformId: string;
|
|
73
73
|
assets: {
|
|
74
|
-
listUrl: string;
|
|
75
74
|
native: {
|
|
76
75
|
symbol: string;
|
|
77
76
|
name: string;
|
|
@@ -80,6 +79,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
80
79
|
decimals: number;
|
|
81
80
|
coingeckoCoinId: string;
|
|
82
81
|
};
|
|
82
|
+
listUrl?: string | undefined;
|
|
83
83
|
governance?: {
|
|
84
84
|
symbol: string;
|
|
85
85
|
name: string;
|
|
@@ -117,7 +117,6 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
117
117
|
chainId: string;
|
|
118
118
|
coingeckoPlatformId: string;
|
|
119
119
|
assets: {
|
|
120
|
-
listUrl: string;
|
|
121
120
|
native: {
|
|
122
121
|
symbol: string;
|
|
123
122
|
name: string;
|
|
@@ -126,6 +125,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
126
125
|
decimals: number;
|
|
127
126
|
coingeckoCoinId: string;
|
|
128
127
|
};
|
|
128
|
+
listUrl?: string | undefined;
|
|
129
129
|
governance?: {
|
|
130
130
|
symbol: string;
|
|
131
131
|
name: string;
|
|
@@ -164,7 +164,6 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
164
164
|
chainId: string;
|
|
165
165
|
coingeckoPlatformId: string;
|
|
166
166
|
assets: {
|
|
167
|
-
listUrl: string;
|
|
168
167
|
native: {
|
|
169
168
|
symbol: string;
|
|
170
169
|
name: string;
|
|
@@ -173,6 +172,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
173
172
|
decimals: number;
|
|
174
173
|
coingeckoCoinId: string;
|
|
175
174
|
};
|
|
175
|
+
listUrl?: string | undefined;
|
|
176
176
|
governance?: {
|
|
177
177
|
symbol: string;
|
|
178
178
|
name: string;
|
|
@@ -210,7 +210,6 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
210
210
|
chainId: string;
|
|
211
211
|
coingeckoPlatformId: string;
|
|
212
212
|
assets: {
|
|
213
|
-
listUrl: string;
|
|
214
213
|
native: {
|
|
215
214
|
symbol: string;
|
|
216
215
|
name: string;
|
|
@@ -219,6 +218,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
219
218
|
decimals: number;
|
|
220
219
|
coingeckoCoinId: string;
|
|
221
220
|
};
|
|
221
|
+
listUrl?: string | undefined;
|
|
222
222
|
governance?: {
|
|
223
223
|
symbol: string;
|
|
224
224
|
name: string;
|
|
@@ -261,7 +261,6 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
261
261
|
chainId: string;
|
|
262
262
|
coingeckoPlatformId: string;
|
|
263
263
|
assets: {
|
|
264
|
-
listUrl: string;
|
|
265
264
|
native: {
|
|
266
265
|
symbol: string;
|
|
267
266
|
name: string;
|
|
@@ -270,6 +269,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
270
269
|
decimals: number;
|
|
271
270
|
coingeckoCoinId: string;
|
|
272
271
|
};
|
|
272
|
+
listUrl?: string | undefined;
|
|
273
273
|
governance?: {
|
|
274
274
|
symbol: string;
|
|
275
275
|
name: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/config-registry-controller",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-preview-d8ff44d",
|
|
4
4
|
"description": "Manages configuration registry for MetaMask",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ethereum",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@metamask/base-controller": "^9.1.0",
|
|
58
58
|
"@metamask/controller-utils": "^11.20.0",
|
|
59
|
-
"@metamask/keyring-controller": "^25.
|
|
60
|
-
"@metamask/messenger": "^1.
|
|
59
|
+
"@metamask/keyring-controller": "^25.3.0",
|
|
60
|
+
"@metamask/messenger": "^1.2.0",
|
|
61
61
|
"@metamask/polling-controller": "^16.0.4",
|
|
62
62
|
"@metamask/profile-sync-controller": "^28.0.2",
|
|
63
63
|
"@metamask/remote-feature-flag-controller": "^4.2.0",
|