@metamask-previews/config-registry-controller 0.2.0-preview-ae9b6b322 → 0.2.0-preview-a1caffc9c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -6
- 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
|
@@ -9,16 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
9
9
|
|
|
10
10
|
### Changed
|
|
11
11
|
|
|
12
|
-
- Bump `@metamask/keyring-controller` from `^25.1.1` to `^25.
|
|
12
|
+
- Bump `@metamask/keyring-controller` from `^25.1.1` to `^25.2.0` ([#8363](https://github.com/MetaMask/core/pull/8363))
|
|
13
13
|
- Bump `@metamask/profile-sync-controller` from `^28.0.1` to `^28.0.2` ([#8325](https://github.com/MetaMask/core/pull/8325))
|
|
14
14
|
- 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.
|
|
15
|
+
- Bump `@metamask/messenger` from `^1.0.0` to `^1.1.1` ([#8364](https://github.com/MetaMask/core/pull/8364), [#8373](https://github.com/MetaMask/core/pull/8373))
|
|
16
16
|
- Bump `@metamask/base-controller` from `^9.0.1` to `^9.1.0` ([#8457](https://github.com/MetaMask/core/pull/8457))
|
|
17
17
|
|
|
18
|
-
### Fixed
|
|
19
|
-
|
|
20
|
-
- `ConfigRegistryApiService` now accepts chains with no `assets.listUrl` property ([#8624](https://github.com/MetaMask/core/pull/8624))
|
|
21
|
-
|
|
22
18
|
## [0.2.0]
|
|
23
19
|
|
|
24
20
|
### Changed
|
|
@@ -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.
|
|
14
|
+
listUrl: (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,
|
|
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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,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;IAC3C,MAAM,EAAE,YAAY;IACpB,YAAY,EAAE,kBAAkB;IAChC,iBAAiB,EAAE,uBAAuB;IAC1C,MAAM,EAAE,iBAAiB;CAC1B,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';\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: 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,6 +9,7 @@ export declare const RegistryNetworkConfigSchema: import("@metamask/superstruct"
|
|
|
9
9
|
chainId: string;
|
|
10
10
|
coingeckoPlatformId: string;
|
|
11
11
|
assets: {
|
|
12
|
+
listUrl: string;
|
|
12
13
|
native: {
|
|
13
14
|
symbol: string;
|
|
14
15
|
name: string;
|
|
@@ -17,7 +18,6 @@ export declare const RegistryNetworkConfigSchema: import("@metamask/superstruct"
|
|
|
17
18
|
decimals: number;
|
|
18
19
|
coingeckoCoinId: string;
|
|
19
20
|
};
|
|
20
|
-
listUrl?: string | undefined;
|
|
21
21
|
governance?: {
|
|
22
22
|
symbol: string;
|
|
23
23
|
name: string;
|
|
@@ -56,6 +56,7 @@ 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;
|
|
59
60
|
native: {
|
|
60
61
|
symbol: string;
|
|
61
62
|
name: string;
|
|
@@ -64,7 +65,6 @@ export declare const RegistryNetworkConfigSchema: import("@metamask/superstruct"
|
|
|
64
65
|
decimals: number;
|
|
65
66
|
coingeckoCoinId: string;
|
|
66
67
|
};
|
|
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
|
|
77
|
+
listUrl: import("@metamask/superstruct").Struct<string, null>;
|
|
78
78
|
native: import("@metamask/superstruct").Struct<{
|
|
79
79
|
symbol: string;
|
|
80
80
|
name: string;
|
|
@@ -163,6 +163,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
163
163
|
chainId: string;
|
|
164
164
|
coingeckoPlatformId: string;
|
|
165
165
|
assets: {
|
|
166
|
+
listUrl: string;
|
|
166
167
|
native: {
|
|
167
168
|
symbol: string;
|
|
168
169
|
name: string;
|
|
@@ -171,7 +172,6 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
171
172
|
decimals: number;
|
|
172
173
|
coingeckoCoinId: string;
|
|
173
174
|
};
|
|
174
|
-
listUrl?: string | undefined;
|
|
175
175
|
governance?: {
|
|
176
176
|
symbol: string;
|
|
177
177
|
name: string;
|
|
@@ -215,6 +215,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
215
215
|
chainId: string;
|
|
216
216
|
coingeckoPlatformId: string;
|
|
217
217
|
assets: {
|
|
218
|
+
listUrl: string;
|
|
218
219
|
native: {
|
|
219
220
|
symbol: string;
|
|
220
221
|
name: string;
|
|
@@ -223,7 +224,6 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
223
224
|
decimals: number;
|
|
224
225
|
coingeckoCoinId: string;
|
|
225
226
|
};
|
|
226
|
-
listUrl?: string | undefined;
|
|
227
227
|
governance?: {
|
|
228
228
|
symbol: string;
|
|
229
229
|
name: string;
|
|
@@ -265,6 +265,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
265
265
|
chainId: string;
|
|
266
266
|
coingeckoPlatformId: string;
|
|
267
267
|
assets: {
|
|
268
|
+
listUrl: string;
|
|
268
269
|
native: {
|
|
269
270
|
symbol: string;
|
|
270
271
|
name: string;
|
|
@@ -273,7 +274,6 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
273
274
|
decimals: number;
|
|
274
275
|
coingeckoCoinId: string;
|
|
275
276
|
};
|
|
276
|
-
listUrl?: string | undefined;
|
|
277
277
|
governance?: {
|
|
278
278
|
symbol: string;
|
|
279
279
|
name: string;
|
|
@@ -311,6 +311,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
311
311
|
chainId: string;
|
|
312
312
|
coingeckoPlatformId: string;
|
|
313
313
|
assets: {
|
|
314
|
+
listUrl: string;
|
|
314
315
|
native: {
|
|
315
316
|
symbol: string;
|
|
316
317
|
name: string;
|
|
@@ -319,7 +320,6 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
319
320
|
decimals: number;
|
|
320
321
|
coingeckoCoinId: string;
|
|
321
322
|
};
|
|
322
|
-
listUrl?: string | undefined;
|
|
323
323
|
governance?: {
|
|
324
324
|
symbol: string;
|
|
325
325
|
name: string;
|
|
@@ -358,6 +358,7 @@ 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;
|
|
361
362
|
native: {
|
|
362
363
|
symbol: string;
|
|
363
364
|
name: string;
|
|
@@ -366,7 +367,6 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
366
367
|
decimals: number;
|
|
367
368
|
coingeckoCoinId: string;
|
|
368
369
|
};
|
|
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
|
|
379
|
+
listUrl: import("@metamask/superstruct").Struct<string, null>;
|
|
380
380
|
native: import("@metamask/superstruct").Struct<{
|
|
381
381
|
symbol: string;
|
|
382
382
|
name: string;
|
|
@@ -9,6 +9,7 @@ export declare const RegistryNetworkConfigSchema: import("@metamask/superstruct"
|
|
|
9
9
|
chainId: string;
|
|
10
10
|
coingeckoPlatformId: string;
|
|
11
11
|
assets: {
|
|
12
|
+
listUrl: string;
|
|
12
13
|
native: {
|
|
13
14
|
symbol: string;
|
|
14
15
|
name: string;
|
|
@@ -17,7 +18,6 @@ export declare const RegistryNetworkConfigSchema: import("@metamask/superstruct"
|
|
|
17
18
|
decimals: number;
|
|
18
19
|
coingeckoCoinId: string;
|
|
19
20
|
};
|
|
20
|
-
listUrl?: string | undefined;
|
|
21
21
|
governance?: {
|
|
22
22
|
symbol: string;
|
|
23
23
|
name: string;
|
|
@@ -56,6 +56,7 @@ 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;
|
|
59
60
|
native: {
|
|
60
61
|
symbol: string;
|
|
61
62
|
name: string;
|
|
@@ -64,7 +65,6 @@ export declare const RegistryNetworkConfigSchema: import("@metamask/superstruct"
|
|
|
64
65
|
decimals: number;
|
|
65
66
|
coingeckoCoinId: string;
|
|
66
67
|
};
|
|
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
|
|
77
|
+
listUrl: import("@metamask/superstruct").Struct<string, null>;
|
|
78
78
|
native: import("@metamask/superstruct").Struct<{
|
|
79
79
|
symbol: string;
|
|
80
80
|
name: string;
|
|
@@ -163,6 +163,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
163
163
|
chainId: string;
|
|
164
164
|
coingeckoPlatformId: string;
|
|
165
165
|
assets: {
|
|
166
|
+
listUrl: string;
|
|
166
167
|
native: {
|
|
167
168
|
symbol: string;
|
|
168
169
|
name: string;
|
|
@@ -171,7 +172,6 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
171
172
|
decimals: number;
|
|
172
173
|
coingeckoCoinId: string;
|
|
173
174
|
};
|
|
174
|
-
listUrl?: string | undefined;
|
|
175
175
|
governance?: {
|
|
176
176
|
symbol: string;
|
|
177
177
|
name: string;
|
|
@@ -215,6 +215,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
215
215
|
chainId: string;
|
|
216
216
|
coingeckoPlatformId: string;
|
|
217
217
|
assets: {
|
|
218
|
+
listUrl: string;
|
|
218
219
|
native: {
|
|
219
220
|
symbol: string;
|
|
220
221
|
name: string;
|
|
@@ -223,7 +224,6 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
223
224
|
decimals: number;
|
|
224
225
|
coingeckoCoinId: string;
|
|
225
226
|
};
|
|
226
|
-
listUrl?: string | undefined;
|
|
227
227
|
governance?: {
|
|
228
228
|
symbol: string;
|
|
229
229
|
name: string;
|
|
@@ -265,6 +265,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
265
265
|
chainId: string;
|
|
266
266
|
coingeckoPlatformId: string;
|
|
267
267
|
assets: {
|
|
268
|
+
listUrl: string;
|
|
268
269
|
native: {
|
|
269
270
|
symbol: string;
|
|
270
271
|
name: string;
|
|
@@ -273,7 +274,6 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
273
274
|
decimals: number;
|
|
274
275
|
coingeckoCoinId: string;
|
|
275
276
|
};
|
|
276
|
-
listUrl?: string | undefined;
|
|
277
277
|
governance?: {
|
|
278
278
|
symbol: string;
|
|
279
279
|
name: string;
|
|
@@ -311,6 +311,7 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
311
311
|
chainId: string;
|
|
312
312
|
coingeckoPlatformId: string;
|
|
313
313
|
assets: {
|
|
314
|
+
listUrl: string;
|
|
314
315
|
native: {
|
|
315
316
|
symbol: string;
|
|
316
317
|
name: string;
|
|
@@ -319,7 +320,6 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
319
320
|
decimals: number;
|
|
320
321
|
coingeckoCoinId: string;
|
|
321
322
|
};
|
|
322
|
-
listUrl?: string | undefined;
|
|
323
323
|
governance?: {
|
|
324
324
|
symbol: string;
|
|
325
325
|
name: string;
|
|
@@ -358,6 +358,7 @@ 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;
|
|
361
362
|
native: {
|
|
362
363
|
symbol: string;
|
|
363
364
|
name: string;
|
|
@@ -366,7 +367,6 @@ export declare const RegistryConfigApiResponseSchema: import("@metamask/superstr
|
|
|
366
367
|
decimals: number;
|
|
367
368
|
coingeckoCoinId: string;
|
|
368
369
|
};
|
|
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
|
|
379
|
+
listUrl: import("@metamask/superstruct").Struct<string, 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,
|
|
1
|
+
{"version":3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CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC;IAC9C,OAAO,EAAE,MAAM,EAAE;IACjB,IAAI,EAAE,MAAM,EAAE;IACd,QAAQ,EAAE,MAAM,EAAE;IAClB,mBAAmB,EAAE,MAAM,EAAE;IAC7B,uBAAuB,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IAC3C,MAAM,EAAE,YAAY;IACpB,YAAY,EAAE,kBAAkB;IAChC,iBAAiB,EAAE,uBAAuB;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: 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,6 +20,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
20
20
|
chainId: string;
|
|
21
21
|
coingeckoPlatformId: string;
|
|
22
22
|
assets: {
|
|
23
|
+
listUrl: string;
|
|
23
24
|
native: {
|
|
24
25
|
symbol: string;
|
|
25
26
|
name: string;
|
|
@@ -28,7 +29,6 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
28
29
|
decimals: number;
|
|
29
30
|
coingeckoCoinId: string;
|
|
30
31
|
};
|
|
31
|
-
listUrl?: string | undefined;
|
|
32
32
|
governance?: {
|
|
33
33
|
symbol: string;
|
|
34
34
|
name: string;
|
|
@@ -71,6 +71,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
71
71
|
chainId: string;
|
|
72
72
|
coingeckoPlatformId: string;
|
|
73
73
|
assets: {
|
|
74
|
+
listUrl: string;
|
|
74
75
|
native: {
|
|
75
76
|
symbol: string;
|
|
76
77
|
name: string;
|
|
@@ -79,7 +80,6 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
79
80
|
decimals: number;
|
|
80
81
|
coingeckoCoinId: string;
|
|
81
82
|
};
|
|
82
|
-
listUrl?: string | undefined;
|
|
83
83
|
governance?: {
|
|
84
84
|
symbol: string;
|
|
85
85
|
name: string;
|
|
@@ -117,6 +117,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
117
117
|
chainId: string;
|
|
118
118
|
coingeckoPlatformId: string;
|
|
119
119
|
assets: {
|
|
120
|
+
listUrl: string;
|
|
120
121
|
native: {
|
|
121
122
|
symbol: string;
|
|
122
123
|
name: string;
|
|
@@ -125,7 +126,6 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
125
126
|
decimals: number;
|
|
126
127
|
coingeckoCoinId: string;
|
|
127
128
|
};
|
|
128
|
-
listUrl?: string | undefined;
|
|
129
129
|
governance?: {
|
|
130
130
|
symbol: string;
|
|
131
131
|
name: string;
|
|
@@ -164,6 +164,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
164
164
|
chainId: string;
|
|
165
165
|
coingeckoPlatformId: string;
|
|
166
166
|
assets: {
|
|
167
|
+
listUrl: string;
|
|
167
168
|
native: {
|
|
168
169
|
symbol: string;
|
|
169
170
|
name: string;
|
|
@@ -172,7 +173,6 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
172
173
|
decimals: number;
|
|
173
174
|
coingeckoCoinId: string;
|
|
174
175
|
};
|
|
175
|
-
listUrl?: string | undefined;
|
|
176
176
|
governance?: {
|
|
177
177
|
symbol: string;
|
|
178
178
|
name: string;
|
|
@@ -210,6 +210,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
210
210
|
chainId: string;
|
|
211
211
|
coingeckoPlatformId: string;
|
|
212
212
|
assets: {
|
|
213
|
+
listUrl: string;
|
|
213
214
|
native: {
|
|
214
215
|
symbol: string;
|
|
215
216
|
name: string;
|
|
@@ -218,7 +219,6 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
218
219
|
decimals: number;
|
|
219
220
|
coingeckoCoinId: string;
|
|
220
221
|
};
|
|
221
|
-
listUrl?: string | undefined;
|
|
222
222
|
governance?: {
|
|
223
223
|
symbol: string;
|
|
224
224
|
name: string;
|
|
@@ -261,6 +261,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
261
261
|
chainId: string;
|
|
262
262
|
coingeckoPlatformId: string;
|
|
263
263
|
assets: {
|
|
264
|
+
listUrl: string;
|
|
264
265
|
native: {
|
|
265
266
|
symbol: string;
|
|
266
267
|
name: string;
|
|
@@ -269,7 +270,6 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
269
270
|
decimals: number;
|
|
270
271
|
coingeckoCoinId: string;
|
|
271
272
|
};
|
|
272
|
-
listUrl?: string | undefined;
|
|
273
273
|
governance?: {
|
|
274
274
|
symbol: string;
|
|
275
275
|
name: string;
|
package/dist/selectors.d.mts
CHANGED
|
@@ -20,6 +20,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
20
20
|
chainId: string;
|
|
21
21
|
coingeckoPlatformId: string;
|
|
22
22
|
assets: {
|
|
23
|
+
listUrl: string;
|
|
23
24
|
native: {
|
|
24
25
|
symbol: string;
|
|
25
26
|
name: string;
|
|
@@ -28,7 +29,6 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
28
29
|
decimals: number;
|
|
29
30
|
coingeckoCoinId: string;
|
|
30
31
|
};
|
|
31
|
-
listUrl?: string | undefined;
|
|
32
32
|
governance?: {
|
|
33
33
|
symbol: string;
|
|
34
34
|
name: string;
|
|
@@ -71,6 +71,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
71
71
|
chainId: string;
|
|
72
72
|
coingeckoPlatformId: string;
|
|
73
73
|
assets: {
|
|
74
|
+
listUrl: string;
|
|
74
75
|
native: {
|
|
75
76
|
symbol: string;
|
|
76
77
|
name: string;
|
|
@@ -79,7 +80,6 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
79
80
|
decimals: number;
|
|
80
81
|
coingeckoCoinId: string;
|
|
81
82
|
};
|
|
82
|
-
listUrl?: string | undefined;
|
|
83
83
|
governance?: {
|
|
84
84
|
symbol: string;
|
|
85
85
|
name: string;
|
|
@@ -117,6 +117,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
117
117
|
chainId: string;
|
|
118
118
|
coingeckoPlatformId: string;
|
|
119
119
|
assets: {
|
|
120
|
+
listUrl: string;
|
|
120
121
|
native: {
|
|
121
122
|
symbol: string;
|
|
122
123
|
name: string;
|
|
@@ -125,7 +126,6 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
125
126
|
decimals: number;
|
|
126
127
|
coingeckoCoinId: string;
|
|
127
128
|
};
|
|
128
|
-
listUrl?: string | undefined;
|
|
129
129
|
governance?: {
|
|
130
130
|
symbol: string;
|
|
131
131
|
name: string;
|
|
@@ -164,6 +164,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
164
164
|
chainId: string;
|
|
165
165
|
coingeckoPlatformId: string;
|
|
166
166
|
assets: {
|
|
167
|
+
listUrl: string;
|
|
167
168
|
native: {
|
|
168
169
|
symbol: string;
|
|
169
170
|
name: string;
|
|
@@ -172,7 +173,6 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
172
173
|
decimals: number;
|
|
173
174
|
coingeckoCoinId: string;
|
|
174
175
|
};
|
|
175
|
-
listUrl?: string | undefined;
|
|
176
176
|
governance?: {
|
|
177
177
|
symbol: string;
|
|
178
178
|
name: string;
|
|
@@ -210,6 +210,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
210
210
|
chainId: string;
|
|
211
211
|
coingeckoPlatformId: string;
|
|
212
212
|
assets: {
|
|
213
|
+
listUrl: string;
|
|
213
214
|
native: {
|
|
214
215
|
symbol: string;
|
|
215
216
|
name: string;
|
|
@@ -218,7 +219,6 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
218
219
|
decimals: number;
|
|
219
220
|
coingeckoCoinId: string;
|
|
220
221
|
};
|
|
221
|
-
listUrl?: string | undefined;
|
|
222
222
|
governance?: {
|
|
223
223
|
symbol: string;
|
|
224
224
|
name: string;
|
|
@@ -261,6 +261,7 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
261
261
|
chainId: string;
|
|
262
262
|
coingeckoPlatformId: string;
|
|
263
263
|
assets: {
|
|
264
|
+
listUrl: string;
|
|
264
265
|
native: {
|
|
265
266
|
symbol: string;
|
|
266
267
|
name: string;
|
|
@@ -269,7 +270,6 @@ export declare const selectFeaturedNetworks: ((state: ConfigRegistryControllerSt
|
|
|
269
270
|
decimals: number;
|
|
270
271
|
coingeckoCoinId: string;
|
|
271
272
|
};
|
|
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.2.0-preview-
|
|
3
|
+
"version": "0.2.0-preview-a1caffc9c",
|
|
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.2.0",
|
|
60
|
+
"@metamask/messenger": "^1.1.1",
|
|
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",
|