@metamask-previews/config-registry-controller 0.0.0-preview-32ed9958c
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 +14 -0
- package/LICENSE +20 -0
- package/README.md +15 -0
- package/dist/ConfigRegistryController.cjs +132 -0
- package/dist/ConfigRegistryController.cjs.map +1 -0
- package/dist/ConfigRegistryController.d.cts +134 -0
- package/dist/ConfigRegistryController.d.cts.map +1 -0
- package/dist/ConfigRegistryController.d.mts +134 -0
- package/dist/ConfigRegistryController.d.mts.map +1 -0
- package/dist/ConfigRegistryController.mjs +128 -0
- package/dist/ConfigRegistryController.mjs.map +1 -0
- package/dist/config-registry-api-service/config-registry-api-service.cjs +123 -0
- package/dist/config-registry-api-service/config-registry-api-service.cjs.map +1 -0
- package/dist/config-registry-api-service/config-registry-api-service.d.cts +56 -0
- package/dist/config-registry-api-service/config-registry-api-service.d.cts.map +1 -0
- package/dist/config-registry-api-service/config-registry-api-service.d.mts +56 -0
- package/dist/config-registry-api-service/config-registry-api-service.d.mts.map +1 -0
- package/dist/config-registry-api-service/config-registry-api-service.mjs +119 -0
- package/dist/config-registry-api-service/config-registry-api-service.mjs.map +1 -0
- package/dist/config-registry-api-service/filters.cjs +30 -0
- package/dist/config-registry-api-service/filters.cjs.map +1 -0
- package/dist/config-registry-api-service/filters.d.cts +15 -0
- package/dist/config-registry-api-service/filters.d.cts.map +1 -0
- package/dist/config-registry-api-service/filters.d.mts +15 -0
- package/dist/config-registry-api-service/filters.d.mts.map +1 -0
- package/dist/config-registry-api-service/filters.mjs +26 -0
- package/dist/config-registry-api-service/filters.mjs.map +1 -0
- package/dist/config-registry-api-service/index.cjs +8 -0
- package/dist/config-registry-api-service/index.cjs.map +1 -0
- package/dist/config-registry-api-service/index.d.cts +6 -0
- package/dist/config-registry-api-service/index.d.cts.map +1 -0
- package/dist/config-registry-api-service/index.d.mts +6 -0
- package/dist/config-registry-api-service/index.d.mts.map +1 -0
- package/dist/config-registry-api-service/index.mjs +3 -0
- package/dist/config-registry-api-service/index.mjs.map +1 -0
- package/dist/config-registry-api-service/types.cjs +69 -0
- package/dist/config-registry-api-service/types.cjs.map +1 -0
- package/dist/config-registry-api-service/types.d.cts +476 -0
- package/dist/config-registry-api-service/types.d.cts.map +1 -0
- package/dist/config-registry-api-service/types.d.mts +476 -0
- package/dist/config-registry-api-service/types.d.mts.map +1 -0
- package/dist/config-registry-api-service/types.mjs +65 -0
- package/dist/config-registry-api-service/types.mjs.map +1 -0
- package/dist/index.cjs +15 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +7 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +7 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +5 -0
- package/dist/index.mjs.map +1 -0
- package/dist/selectors.cjs +34 -0
- package/dist/selectors.cjs.map +1 -0
- package/dist/selectors.d.cts +314 -0
- package/dist/selectors.d.cts.map +1 -0
- package/dist/selectors.d.mts +314 -0
- package/dist/selectors.d.mts.map +1 -0
- package/dist/selectors.mjs +30 -0
- package/dist/selectors.mjs.map +1 -0
- package/dist/utils/feature-flags.cjs +27 -0
- package/dist/utils/feature-flags.cjs.map +1 -0
- package/dist/utils/feature-flags.d.cts +9 -0
- package/dist/utils/feature-flags.d.cts.map +1 -0
- package/dist/utils/feature-flags.d.mts +9 -0
- package/dist/utils/feature-flags.d.mts.map +1 -0
- package/dist/utils/feature-flags.mjs +23 -0
- package/dist/utils/feature-flags.mjs.map +1 -0
- package/package.json +81 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateRegistryConfigApiResponse = exports.RegistryConfigApiResponseSchema = exports.RegistryNetworkConfigSchema = void 0;
|
|
4
|
+
const superstruct_1 = require("@metamask/superstruct");
|
|
5
|
+
const AssetSchema = (0, superstruct_1.type)({
|
|
6
|
+
assetId: (0, superstruct_1.string)(),
|
|
7
|
+
imageUrl: (0, superstruct_1.string)(),
|
|
8
|
+
name: (0, superstruct_1.string)(),
|
|
9
|
+
symbol: (0, superstruct_1.string)(),
|
|
10
|
+
decimals: (0, superstruct_1.number)(),
|
|
11
|
+
coingeckoCoinId: (0, superstruct_1.string)(),
|
|
12
|
+
});
|
|
13
|
+
const AssetsSchema = (0, superstruct_1.type)({
|
|
14
|
+
listUrl: (0, superstruct_1.string)(),
|
|
15
|
+
native: AssetSchema,
|
|
16
|
+
governance: (0, superstruct_1.optional)(AssetSchema),
|
|
17
|
+
});
|
|
18
|
+
const RpcProviderSchema = (0, superstruct_1.type)({
|
|
19
|
+
url: (0, superstruct_1.string)(),
|
|
20
|
+
type: (0, superstruct_1.string)(),
|
|
21
|
+
networkClientId: (0, superstruct_1.string)(),
|
|
22
|
+
});
|
|
23
|
+
const RpcProvidersSchema = (0, superstruct_1.type)({
|
|
24
|
+
default: RpcProviderSchema,
|
|
25
|
+
fallbacks: (0, superstruct_1.array)((0, superstruct_1.string)()),
|
|
26
|
+
});
|
|
27
|
+
const BlockExplorerUrlsSchema = (0, superstruct_1.type)({
|
|
28
|
+
default: (0, superstruct_1.string)(),
|
|
29
|
+
fallbacks: (0, superstruct_1.array)((0, superstruct_1.string)()),
|
|
30
|
+
});
|
|
31
|
+
const ChainConfigSchema = (0, superstruct_1.type)({
|
|
32
|
+
isActive: (0, superstruct_1.boolean)(),
|
|
33
|
+
isTestnet: (0, superstruct_1.boolean)(),
|
|
34
|
+
isDefault: (0, superstruct_1.boolean)(),
|
|
35
|
+
isFeatured: (0, superstruct_1.boolean)(),
|
|
36
|
+
isDeprecated: (0, superstruct_1.boolean)(),
|
|
37
|
+
isDeletable: (0, superstruct_1.boolean)(),
|
|
38
|
+
priority: (0, superstruct_1.number)(),
|
|
39
|
+
});
|
|
40
|
+
/**
|
|
41
|
+
* Schema for a single chain in the CAIP-2 config registry API response.
|
|
42
|
+
* chainId is in CAIP-2 format (e.g. "eip155:1", "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp").
|
|
43
|
+
*/
|
|
44
|
+
exports.RegistryNetworkConfigSchema = (0, superstruct_1.type)({
|
|
45
|
+
chainId: (0, superstruct_1.string)(),
|
|
46
|
+
name: (0, superstruct_1.string)(),
|
|
47
|
+
imageUrl: (0, superstruct_1.string)(),
|
|
48
|
+
coingeckoPlatformId: (0, superstruct_1.string)(),
|
|
49
|
+
geckoTerminalPlatformId: (0, superstruct_1.optional)((0, superstruct_1.string)()),
|
|
50
|
+
assets: AssetsSchema,
|
|
51
|
+
rpcProviders: RpcProvidersSchema,
|
|
52
|
+
blockExplorerUrls: BlockExplorerUrlsSchema,
|
|
53
|
+
config: ChainConfigSchema,
|
|
54
|
+
});
|
|
55
|
+
/**
|
|
56
|
+
* Top-level API response shape. Uses `data.chains` (CAIP-2) and `data.version`.
|
|
57
|
+
*/
|
|
58
|
+
exports.RegistryConfigApiResponseSchema = (0, superstruct_1.type)({
|
|
59
|
+
data: (0, superstruct_1.type)({
|
|
60
|
+
version: (0, superstruct_1.string)(),
|
|
61
|
+
timestamp: (0, superstruct_1.number)(),
|
|
62
|
+
chains: (0, superstruct_1.array)(exports.RegistryNetworkConfigSchema),
|
|
63
|
+
}),
|
|
64
|
+
});
|
|
65
|
+
function validateRegistryConfigApiResponse(data) {
|
|
66
|
+
(0, superstruct_1.assert)(data, exports.RegistryConfigApiResponseSchema);
|
|
67
|
+
}
|
|
68
|
+
exports.validateRegistryConfigApiResponse = validateRegistryConfigApiResponse;
|
|
69
|
+
//# sourceMappingURL=types.cjs.map
|
|
@@ -0,0 +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;IACjB,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,OAAO,EAAE,iBAAiB;IAC1B,SAAS,EAAE,IAAA,mBAAK,EAAC,IAAA,oBAAM,GAAE,CAAC;CAC3B,CAAC,CAAC;AAEH,MAAM,uBAAuB,GAAG,IAAA,kBAAI,EAAC;IACnC,OAAO,EAAE,IAAA,oBAAM,GAAE;IACjB,SAAS,EAAE,IAAA,mBAAK,EAAC,IAAA,oBAAM,GAAE,CAAC;CAC3B,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAG,IAAA,kBAAI,EAAC;IAC7B,QAAQ,EAAE,IAAA,qBAAO,GAAE;IACnB,SAAS,EAAE,IAAA,qBAAO,GAAE;IACpB,SAAS,EAAE,IAAA,qBAAO,GAAE;IACpB,UAAU,EAAE,IAAA,qBAAO,GAAE;IACrB,YAAY,EAAE,IAAA,qBAAO,GAAE;IACvB,WAAW,EAAE,IAAA,qBAAO,GAAE;IACtB,QAAQ,EAAE,IAAA,oBAAM,GAAE;CACnB,CAAC,CAAC;AAEH;;;GAGG;AACU,QAAA,2BAA2B,GAAG,IAAA,kBAAI,EAAC;IAC9C,OAAO,EAAE,IAAA,oBAAM,GAAE;IACjB,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;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"]}
|
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
import type { Infer } from "@metamask/superstruct";
|
|
2
|
+
/**
|
|
3
|
+
* Schema for a single chain in the CAIP-2 config registry API response.
|
|
4
|
+
* chainId is in CAIP-2 format (e.g. "eip155:1", "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp").
|
|
5
|
+
*/
|
|
6
|
+
export declare const RegistryNetworkConfigSchema: import("@metamask/superstruct").Struct<{
|
|
7
|
+
imageUrl: string;
|
|
8
|
+
name: string;
|
|
9
|
+
chainId: string;
|
|
10
|
+
coingeckoPlatformId: string;
|
|
11
|
+
assets: {
|
|
12
|
+
listUrl: string;
|
|
13
|
+
native: {
|
|
14
|
+
symbol: string;
|
|
15
|
+
assetId: string;
|
|
16
|
+
imageUrl: string;
|
|
17
|
+
name: string;
|
|
18
|
+
decimals: number;
|
|
19
|
+
coingeckoCoinId: string;
|
|
20
|
+
};
|
|
21
|
+
governance?: {
|
|
22
|
+
symbol: string;
|
|
23
|
+
assetId: string;
|
|
24
|
+
imageUrl: string;
|
|
25
|
+
name: string;
|
|
26
|
+
decimals: number;
|
|
27
|
+
coingeckoCoinId: string;
|
|
28
|
+
} | undefined;
|
|
29
|
+
};
|
|
30
|
+
rpcProviders: {
|
|
31
|
+
default: {
|
|
32
|
+
url: string;
|
|
33
|
+
type: string;
|
|
34
|
+
networkClientId: string;
|
|
35
|
+
};
|
|
36
|
+
fallbacks: string[];
|
|
37
|
+
};
|
|
38
|
+
blockExplorerUrls: {
|
|
39
|
+
default: string;
|
|
40
|
+
fallbacks: string[];
|
|
41
|
+
};
|
|
42
|
+
config: {
|
|
43
|
+
isActive: boolean;
|
|
44
|
+
isTestnet: boolean;
|
|
45
|
+
isDefault: boolean;
|
|
46
|
+
isFeatured: boolean;
|
|
47
|
+
isDeprecated: boolean;
|
|
48
|
+
isDeletable: boolean;
|
|
49
|
+
priority: number;
|
|
50
|
+
};
|
|
51
|
+
geckoTerminalPlatformId?: string | undefined;
|
|
52
|
+
}, {
|
|
53
|
+
chainId: import("@metamask/superstruct").Struct<string, null>;
|
|
54
|
+
name: import("@metamask/superstruct").Struct<string, null>;
|
|
55
|
+
imageUrl: import("@metamask/superstruct").Struct<string, null>;
|
|
56
|
+
coingeckoPlatformId: import("@metamask/superstruct").Struct<string, null>;
|
|
57
|
+
geckoTerminalPlatformId: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
58
|
+
assets: import("@metamask/superstruct").Struct<{
|
|
59
|
+
listUrl: string;
|
|
60
|
+
native: {
|
|
61
|
+
symbol: string;
|
|
62
|
+
assetId: string;
|
|
63
|
+
imageUrl: string;
|
|
64
|
+
name: string;
|
|
65
|
+
decimals: number;
|
|
66
|
+
coingeckoCoinId: string;
|
|
67
|
+
};
|
|
68
|
+
governance?: {
|
|
69
|
+
symbol: string;
|
|
70
|
+
assetId: string;
|
|
71
|
+
imageUrl: string;
|
|
72
|
+
name: string;
|
|
73
|
+
decimals: number;
|
|
74
|
+
coingeckoCoinId: string;
|
|
75
|
+
} | undefined;
|
|
76
|
+
}, {
|
|
77
|
+
listUrl: import("@metamask/superstruct").Struct<string, null>;
|
|
78
|
+
native: import("@metamask/superstruct").Struct<{
|
|
79
|
+
symbol: string;
|
|
80
|
+
assetId: string;
|
|
81
|
+
imageUrl: string;
|
|
82
|
+
name: string;
|
|
83
|
+
decimals: number;
|
|
84
|
+
coingeckoCoinId: string;
|
|
85
|
+
}, {
|
|
86
|
+
assetId: import("@metamask/superstruct").Struct<string, null>;
|
|
87
|
+
imageUrl: import("@metamask/superstruct").Struct<string, null>;
|
|
88
|
+
name: import("@metamask/superstruct").Struct<string, null>;
|
|
89
|
+
symbol: import("@metamask/superstruct").Struct<string, null>;
|
|
90
|
+
decimals: import("@metamask/superstruct").Struct<number, null>;
|
|
91
|
+
coingeckoCoinId: import("@metamask/superstruct").Struct<string, null>;
|
|
92
|
+
}>;
|
|
93
|
+
governance: import("@metamask/superstruct").Struct<{
|
|
94
|
+
symbol: string;
|
|
95
|
+
assetId: string;
|
|
96
|
+
imageUrl: string;
|
|
97
|
+
name: string;
|
|
98
|
+
decimals: number;
|
|
99
|
+
coingeckoCoinId: string;
|
|
100
|
+
} | undefined, {
|
|
101
|
+
assetId: import("@metamask/superstruct").Struct<string, null>;
|
|
102
|
+
imageUrl: import("@metamask/superstruct").Struct<string, null>;
|
|
103
|
+
name: import("@metamask/superstruct").Struct<string, null>;
|
|
104
|
+
symbol: import("@metamask/superstruct").Struct<string, null>;
|
|
105
|
+
decimals: import("@metamask/superstruct").Struct<number, null>;
|
|
106
|
+
coingeckoCoinId: import("@metamask/superstruct").Struct<string, null>;
|
|
107
|
+
}>;
|
|
108
|
+
}>;
|
|
109
|
+
rpcProviders: import("@metamask/superstruct").Struct<{
|
|
110
|
+
default: {
|
|
111
|
+
url: string;
|
|
112
|
+
type: string;
|
|
113
|
+
networkClientId: string;
|
|
114
|
+
};
|
|
115
|
+
fallbacks: string[];
|
|
116
|
+
}, {
|
|
117
|
+
default: import("@metamask/superstruct").Struct<{
|
|
118
|
+
url: string;
|
|
119
|
+
type: string;
|
|
120
|
+
networkClientId: string;
|
|
121
|
+
}, {
|
|
122
|
+
url: import("@metamask/superstruct").Struct<string, null>;
|
|
123
|
+
type: import("@metamask/superstruct").Struct<string, null>;
|
|
124
|
+
networkClientId: import("@metamask/superstruct").Struct<string, null>;
|
|
125
|
+
}>;
|
|
126
|
+
fallbacks: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
127
|
+
}>;
|
|
128
|
+
blockExplorerUrls: import("@metamask/superstruct").Struct<{
|
|
129
|
+
default: string;
|
|
130
|
+
fallbacks: string[];
|
|
131
|
+
}, {
|
|
132
|
+
default: import("@metamask/superstruct").Struct<string, null>;
|
|
133
|
+
fallbacks: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
134
|
+
}>;
|
|
135
|
+
config: import("@metamask/superstruct").Struct<{
|
|
136
|
+
isActive: boolean;
|
|
137
|
+
isTestnet: boolean;
|
|
138
|
+
isDefault: boolean;
|
|
139
|
+
isFeatured: boolean;
|
|
140
|
+
isDeprecated: boolean;
|
|
141
|
+
isDeletable: boolean;
|
|
142
|
+
priority: number;
|
|
143
|
+
}, {
|
|
144
|
+
isActive: import("@metamask/superstruct").Struct<boolean, null>;
|
|
145
|
+
isTestnet: import("@metamask/superstruct").Struct<boolean, null>;
|
|
146
|
+
isDefault: import("@metamask/superstruct").Struct<boolean, null>;
|
|
147
|
+
isFeatured: import("@metamask/superstruct").Struct<boolean, null>;
|
|
148
|
+
isDeprecated: import("@metamask/superstruct").Struct<boolean, null>;
|
|
149
|
+
isDeletable: import("@metamask/superstruct").Struct<boolean, null>;
|
|
150
|
+
priority: import("@metamask/superstruct").Struct<number, null>;
|
|
151
|
+
}>;
|
|
152
|
+
}>;
|
|
153
|
+
/**
|
|
154
|
+
* Top-level API response shape. Uses `data.chains` (CAIP-2) and `data.version`.
|
|
155
|
+
*/
|
|
156
|
+
export declare const RegistryConfigApiResponseSchema: import("@metamask/superstruct").Struct<{
|
|
157
|
+
data: {
|
|
158
|
+
version: string;
|
|
159
|
+
timestamp: number;
|
|
160
|
+
chains: {
|
|
161
|
+
imageUrl: string;
|
|
162
|
+
name: string;
|
|
163
|
+
chainId: string;
|
|
164
|
+
coingeckoPlatformId: string;
|
|
165
|
+
assets: {
|
|
166
|
+
listUrl: string;
|
|
167
|
+
native: {
|
|
168
|
+
symbol: string;
|
|
169
|
+
assetId: string;
|
|
170
|
+
imageUrl: string;
|
|
171
|
+
name: string;
|
|
172
|
+
decimals: number;
|
|
173
|
+
coingeckoCoinId: string;
|
|
174
|
+
};
|
|
175
|
+
governance?: {
|
|
176
|
+
symbol: string;
|
|
177
|
+
assetId: string;
|
|
178
|
+
imageUrl: string;
|
|
179
|
+
name: string;
|
|
180
|
+
decimals: number;
|
|
181
|
+
coingeckoCoinId: string;
|
|
182
|
+
} | undefined;
|
|
183
|
+
};
|
|
184
|
+
rpcProviders: {
|
|
185
|
+
default: {
|
|
186
|
+
url: string;
|
|
187
|
+
type: string;
|
|
188
|
+
networkClientId: string;
|
|
189
|
+
};
|
|
190
|
+
fallbacks: string[];
|
|
191
|
+
};
|
|
192
|
+
blockExplorerUrls: {
|
|
193
|
+
default: string;
|
|
194
|
+
fallbacks: string[];
|
|
195
|
+
};
|
|
196
|
+
config: {
|
|
197
|
+
isActive: boolean;
|
|
198
|
+
isTestnet: boolean;
|
|
199
|
+
isDefault: boolean;
|
|
200
|
+
isFeatured: boolean;
|
|
201
|
+
isDeprecated: boolean;
|
|
202
|
+
isDeletable: boolean;
|
|
203
|
+
priority: number;
|
|
204
|
+
};
|
|
205
|
+
geckoTerminalPlatformId?: string | undefined;
|
|
206
|
+
}[];
|
|
207
|
+
};
|
|
208
|
+
}, {
|
|
209
|
+
data: import("@metamask/superstruct").Struct<{
|
|
210
|
+
version: string;
|
|
211
|
+
timestamp: number;
|
|
212
|
+
chains: {
|
|
213
|
+
imageUrl: string;
|
|
214
|
+
name: string;
|
|
215
|
+
chainId: string;
|
|
216
|
+
coingeckoPlatformId: string;
|
|
217
|
+
assets: {
|
|
218
|
+
listUrl: string;
|
|
219
|
+
native: {
|
|
220
|
+
symbol: string;
|
|
221
|
+
assetId: string;
|
|
222
|
+
imageUrl: string;
|
|
223
|
+
name: string;
|
|
224
|
+
decimals: number;
|
|
225
|
+
coingeckoCoinId: string;
|
|
226
|
+
};
|
|
227
|
+
governance?: {
|
|
228
|
+
symbol: string;
|
|
229
|
+
assetId: string;
|
|
230
|
+
imageUrl: string;
|
|
231
|
+
name: string;
|
|
232
|
+
decimals: number;
|
|
233
|
+
coingeckoCoinId: string;
|
|
234
|
+
} | undefined;
|
|
235
|
+
};
|
|
236
|
+
rpcProviders: {
|
|
237
|
+
default: {
|
|
238
|
+
url: string;
|
|
239
|
+
type: string;
|
|
240
|
+
networkClientId: string;
|
|
241
|
+
};
|
|
242
|
+
fallbacks: string[];
|
|
243
|
+
};
|
|
244
|
+
blockExplorerUrls: {
|
|
245
|
+
default: string;
|
|
246
|
+
fallbacks: string[];
|
|
247
|
+
};
|
|
248
|
+
config: {
|
|
249
|
+
isActive: boolean;
|
|
250
|
+
isTestnet: boolean;
|
|
251
|
+
isDefault: boolean;
|
|
252
|
+
isFeatured: boolean;
|
|
253
|
+
isDeprecated: boolean;
|
|
254
|
+
isDeletable: boolean;
|
|
255
|
+
priority: number;
|
|
256
|
+
};
|
|
257
|
+
geckoTerminalPlatformId?: string | undefined;
|
|
258
|
+
}[];
|
|
259
|
+
}, {
|
|
260
|
+
version: import("@metamask/superstruct").Struct<string, null>;
|
|
261
|
+
timestamp: import("@metamask/superstruct").Struct<number, null>;
|
|
262
|
+
chains: import("@metamask/superstruct").Struct<{
|
|
263
|
+
imageUrl: string;
|
|
264
|
+
name: string;
|
|
265
|
+
chainId: string;
|
|
266
|
+
coingeckoPlatformId: string;
|
|
267
|
+
assets: {
|
|
268
|
+
listUrl: string;
|
|
269
|
+
native: {
|
|
270
|
+
symbol: string;
|
|
271
|
+
assetId: string;
|
|
272
|
+
imageUrl: string;
|
|
273
|
+
name: string;
|
|
274
|
+
decimals: number;
|
|
275
|
+
coingeckoCoinId: string;
|
|
276
|
+
};
|
|
277
|
+
governance?: {
|
|
278
|
+
symbol: string;
|
|
279
|
+
assetId: string;
|
|
280
|
+
imageUrl: string;
|
|
281
|
+
name: string;
|
|
282
|
+
decimals: number;
|
|
283
|
+
coingeckoCoinId: string;
|
|
284
|
+
} | undefined;
|
|
285
|
+
};
|
|
286
|
+
rpcProviders: {
|
|
287
|
+
default: {
|
|
288
|
+
url: string;
|
|
289
|
+
type: string;
|
|
290
|
+
networkClientId: string;
|
|
291
|
+
};
|
|
292
|
+
fallbacks: string[];
|
|
293
|
+
};
|
|
294
|
+
blockExplorerUrls: {
|
|
295
|
+
default: string;
|
|
296
|
+
fallbacks: string[];
|
|
297
|
+
};
|
|
298
|
+
config: {
|
|
299
|
+
isActive: boolean;
|
|
300
|
+
isTestnet: boolean;
|
|
301
|
+
isDefault: boolean;
|
|
302
|
+
isFeatured: boolean;
|
|
303
|
+
isDeprecated: boolean;
|
|
304
|
+
isDeletable: boolean;
|
|
305
|
+
priority: number;
|
|
306
|
+
};
|
|
307
|
+
geckoTerminalPlatformId?: string | undefined;
|
|
308
|
+
}[], import("@metamask/superstruct").Struct<{
|
|
309
|
+
imageUrl: string;
|
|
310
|
+
name: string;
|
|
311
|
+
chainId: string;
|
|
312
|
+
coingeckoPlatformId: string;
|
|
313
|
+
assets: {
|
|
314
|
+
listUrl: string;
|
|
315
|
+
native: {
|
|
316
|
+
symbol: string;
|
|
317
|
+
assetId: string;
|
|
318
|
+
imageUrl: string;
|
|
319
|
+
name: string;
|
|
320
|
+
decimals: number;
|
|
321
|
+
coingeckoCoinId: string;
|
|
322
|
+
};
|
|
323
|
+
governance?: {
|
|
324
|
+
symbol: string;
|
|
325
|
+
assetId: string;
|
|
326
|
+
imageUrl: string;
|
|
327
|
+
name: string;
|
|
328
|
+
decimals: number;
|
|
329
|
+
coingeckoCoinId: string;
|
|
330
|
+
} | undefined;
|
|
331
|
+
};
|
|
332
|
+
rpcProviders: {
|
|
333
|
+
default: {
|
|
334
|
+
url: string;
|
|
335
|
+
type: string;
|
|
336
|
+
networkClientId: string;
|
|
337
|
+
};
|
|
338
|
+
fallbacks: string[];
|
|
339
|
+
};
|
|
340
|
+
blockExplorerUrls: {
|
|
341
|
+
default: string;
|
|
342
|
+
fallbacks: string[];
|
|
343
|
+
};
|
|
344
|
+
config: {
|
|
345
|
+
isActive: boolean;
|
|
346
|
+
isTestnet: boolean;
|
|
347
|
+
isDefault: boolean;
|
|
348
|
+
isFeatured: boolean;
|
|
349
|
+
isDeprecated: boolean;
|
|
350
|
+
isDeletable: boolean;
|
|
351
|
+
priority: number;
|
|
352
|
+
};
|
|
353
|
+
geckoTerminalPlatformId?: string | undefined;
|
|
354
|
+
}, {
|
|
355
|
+
chainId: import("@metamask/superstruct").Struct<string, null>;
|
|
356
|
+
name: import("@metamask/superstruct").Struct<string, null>;
|
|
357
|
+
imageUrl: import("@metamask/superstruct").Struct<string, null>;
|
|
358
|
+
coingeckoPlatformId: import("@metamask/superstruct").Struct<string, null>;
|
|
359
|
+
geckoTerminalPlatformId: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
360
|
+
assets: import("@metamask/superstruct").Struct<{
|
|
361
|
+
listUrl: string;
|
|
362
|
+
native: {
|
|
363
|
+
symbol: string;
|
|
364
|
+
assetId: string;
|
|
365
|
+
imageUrl: string;
|
|
366
|
+
name: string;
|
|
367
|
+
decimals: number;
|
|
368
|
+
coingeckoCoinId: string;
|
|
369
|
+
};
|
|
370
|
+
governance?: {
|
|
371
|
+
symbol: string;
|
|
372
|
+
assetId: string;
|
|
373
|
+
imageUrl: string;
|
|
374
|
+
name: string;
|
|
375
|
+
decimals: number;
|
|
376
|
+
coingeckoCoinId: string;
|
|
377
|
+
} | undefined;
|
|
378
|
+
}, {
|
|
379
|
+
listUrl: import("@metamask/superstruct").Struct<string, null>;
|
|
380
|
+
native: import("@metamask/superstruct").Struct<{
|
|
381
|
+
symbol: string;
|
|
382
|
+
assetId: string;
|
|
383
|
+
imageUrl: string;
|
|
384
|
+
name: string;
|
|
385
|
+
decimals: number;
|
|
386
|
+
coingeckoCoinId: string;
|
|
387
|
+
}, {
|
|
388
|
+
assetId: import("@metamask/superstruct").Struct<string, null>;
|
|
389
|
+
imageUrl: import("@metamask/superstruct").Struct<string, null>;
|
|
390
|
+
name: import("@metamask/superstruct").Struct<string, null>;
|
|
391
|
+
symbol: import("@metamask/superstruct").Struct<string, null>;
|
|
392
|
+
decimals: import("@metamask/superstruct").Struct<number, null>;
|
|
393
|
+
coingeckoCoinId: import("@metamask/superstruct").Struct<string, null>;
|
|
394
|
+
}>;
|
|
395
|
+
governance: import("@metamask/superstruct").Struct<{
|
|
396
|
+
symbol: string;
|
|
397
|
+
assetId: string;
|
|
398
|
+
imageUrl: string;
|
|
399
|
+
name: string;
|
|
400
|
+
decimals: number;
|
|
401
|
+
coingeckoCoinId: string;
|
|
402
|
+
} | undefined, {
|
|
403
|
+
assetId: import("@metamask/superstruct").Struct<string, null>;
|
|
404
|
+
imageUrl: import("@metamask/superstruct").Struct<string, null>;
|
|
405
|
+
name: import("@metamask/superstruct").Struct<string, null>;
|
|
406
|
+
symbol: import("@metamask/superstruct").Struct<string, null>;
|
|
407
|
+
decimals: import("@metamask/superstruct").Struct<number, null>;
|
|
408
|
+
coingeckoCoinId: import("@metamask/superstruct").Struct<string, null>;
|
|
409
|
+
}>;
|
|
410
|
+
}>;
|
|
411
|
+
rpcProviders: import("@metamask/superstruct").Struct<{
|
|
412
|
+
default: {
|
|
413
|
+
url: string;
|
|
414
|
+
type: string;
|
|
415
|
+
networkClientId: string;
|
|
416
|
+
};
|
|
417
|
+
fallbacks: string[];
|
|
418
|
+
}, {
|
|
419
|
+
default: import("@metamask/superstruct").Struct<{
|
|
420
|
+
url: string;
|
|
421
|
+
type: string;
|
|
422
|
+
networkClientId: string;
|
|
423
|
+
}, {
|
|
424
|
+
url: import("@metamask/superstruct").Struct<string, null>;
|
|
425
|
+
type: import("@metamask/superstruct").Struct<string, null>;
|
|
426
|
+
networkClientId: import("@metamask/superstruct").Struct<string, null>;
|
|
427
|
+
}>;
|
|
428
|
+
fallbacks: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
429
|
+
}>;
|
|
430
|
+
blockExplorerUrls: import("@metamask/superstruct").Struct<{
|
|
431
|
+
default: string;
|
|
432
|
+
fallbacks: string[];
|
|
433
|
+
}, {
|
|
434
|
+
default: import("@metamask/superstruct").Struct<string, null>;
|
|
435
|
+
fallbacks: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
436
|
+
}>;
|
|
437
|
+
config: import("@metamask/superstruct").Struct<{
|
|
438
|
+
isActive: boolean;
|
|
439
|
+
isTestnet: boolean;
|
|
440
|
+
isDefault: boolean;
|
|
441
|
+
isFeatured: boolean;
|
|
442
|
+
isDeprecated: boolean;
|
|
443
|
+
isDeletable: boolean;
|
|
444
|
+
priority: number;
|
|
445
|
+
}, {
|
|
446
|
+
isActive: import("@metamask/superstruct").Struct<boolean, null>;
|
|
447
|
+
isTestnet: import("@metamask/superstruct").Struct<boolean, null>;
|
|
448
|
+
isDefault: import("@metamask/superstruct").Struct<boolean, null>;
|
|
449
|
+
isFeatured: import("@metamask/superstruct").Struct<boolean, null>;
|
|
450
|
+
isDeprecated: import("@metamask/superstruct").Struct<boolean, null>;
|
|
451
|
+
isDeletable: import("@metamask/superstruct").Struct<boolean, null>;
|
|
452
|
+
priority: import("@metamask/superstruct").Struct<number, null>;
|
|
453
|
+
}>;
|
|
454
|
+
}>>;
|
|
455
|
+
}>;
|
|
456
|
+
}>;
|
|
457
|
+
export type RegistryNetworkConfig = Infer<typeof RegistryNetworkConfigSchema>;
|
|
458
|
+
export type RegistryConfigApiResponse = Infer<typeof RegistryConfigApiResponseSchema>;
|
|
459
|
+
export declare function validateRegistryConfigApiResponse(data: unknown): asserts data is RegistryConfigApiResponse;
|
|
460
|
+
export type FetchConfigOptions = {
|
|
461
|
+
etag?: string;
|
|
462
|
+
};
|
|
463
|
+
export type FetchConfigResult = {
|
|
464
|
+
modified: false;
|
|
465
|
+
etag?: string;
|
|
466
|
+
/**
|
|
467
|
+
* Cached data from the service when available (e.g. after a previous
|
|
468
|
+
* successful fetch). Omitted when the service has no cache yet.
|
|
469
|
+
*/
|
|
470
|
+
data?: RegistryConfigApiResponse;
|
|
471
|
+
} | {
|
|
472
|
+
modified: true;
|
|
473
|
+
data: RegistryConfigApiResponse;
|
|
474
|
+
etag?: string;
|
|
475
|
+
};
|
|
476
|
+
//# sourceMappingURL=types.d.cts.map
|
|
@@ -0,0 +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;AAoDnD;;;GAGG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUtC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAM1C,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAE9E,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAC3C,OAAO,+BAA+B,CACvC,CAAC;AAEF,wBAAgB,iCAAiC,CAC/C,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC,IAAI,IAAI,yBAAyB,CAE3C;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,iBAAiB,GACzB;IACE,QAAQ,EAAE,KAAK,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,IAAI,CAAC,EAAE,yBAAyB,CAAC;CAClC,GACD;IACE,QAAQ,EAAE,IAAI,CAAC;IACf,IAAI,EAAE,yBAAyB,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC"}
|