@talismn/chaindata-provider 2.1.0 → 2.2.0
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/README.md +4 -0
- package/dist/index.d.mts +480 -121
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +479 -120
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +290 -212
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +290 -214
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -627,7 +627,7 @@ const githubChaindataRepo = "chaindata";
|
|
|
627
627
|
const githubChaindataBranch = CHAINDATA_BRANCH;
|
|
628
628
|
const githubChaindataDistDir = CHAINDATA_PUB_FOLDER;
|
|
629
629
|
const githubChaindataBaseUrl = `${githubCdn}/${githubChaindataOrg}/${githubChaindataRepo}/${githubChaindataBranch}`;
|
|
630
|
-
const
|
|
630
|
+
const DEFAULT_CHAINDATA_URL = `${`${githubChaindataBaseUrl}/${githubChaindataDistDir}`}/chaindata.min.json`;
|
|
631
631
|
const githubChaindataTokensAssetsDir = "assets/tokens";
|
|
632
632
|
//#endregion
|
|
633
633
|
//#region src/getBlockExplorerUrls.ts
|
|
@@ -1082,94 +1082,6 @@ const getCleanToken = (token) => {
|
|
|
1082
1082
|
return rest;
|
|
1083
1083
|
};
|
|
1084
1084
|
//#endregion
|
|
1085
|
-
//#region src/state/validatedCache.ts
|
|
1086
|
-
/**
|
|
1087
|
-
* Tracks objects that have already passed chaindata schema validation, so the expensive
|
|
1088
|
-
* validation (thousands of tokens) runs at most ONCE per object instead of on every
|
|
1089
|
-
* emission through the pipeline.
|
|
1090
|
-
*
|
|
1091
|
-
* Safe because parse output is immutable-by-convention in this package, and re-parsing
|
|
1092
|
-
* already-parsed data is idempotent (defaults filled, token key order already applied).
|
|
1093
|
-
*/
|
|
1094
|
-
const validated = /* @__PURE__ */ new WeakSet();
|
|
1095
|
-
const markChaindataValidated = (data) => {
|
|
1096
|
-
validated.add(data);
|
|
1097
|
-
return data;
|
|
1098
|
-
};
|
|
1099
|
-
const isChaindataValidated = (data) => typeof data === "object" && data !== null && validated.has(data);
|
|
1100
|
-
//#endregion
|
|
1101
|
-
//#region src/state/net.ts
|
|
1102
|
-
const CHAINDATA_CONSOLIDATED_URL = `${githubChaindataDistUrl}/chaindata.min.json`;
|
|
1103
|
-
const getFallbackUrl = (url) => {
|
|
1104
|
-
if (url.startsWith("https://raw.githubusercontent.com/")) {
|
|
1105
|
-
const fallbackUrl = url.replace(/^https:\/\/raw\.githubusercontent\.com\/([^/]+)\/([^/]+)\//i, "https://cdn.jsdelivr.net/gh/$1/$2@");
|
|
1106
|
-
return fallbackUrl !== url ? fallbackUrl : null;
|
|
1107
|
-
}
|
|
1108
|
-
return null;
|
|
1109
|
-
};
|
|
1110
|
-
const fetchJsonFromGithubUrl = async (url, { signal, validate } = {}) => {
|
|
1111
|
-
const req = await fetch(url, { signal });
|
|
1112
|
-
if (!req.ok) {
|
|
1113
|
-
const fallbackUrl = getFallbackUrl(url);
|
|
1114
|
-
if (fallbackUrl) return fetchJsonFromGithubUrl(fallbackUrl, {
|
|
1115
|
-
validate,
|
|
1116
|
-
signal
|
|
1117
|
-
});
|
|
1118
|
-
throw new Error(`Failed to fetch from ${url}: ${req.status} ${req.statusText}`);
|
|
1119
|
-
}
|
|
1120
|
-
const data = await req.json();
|
|
1121
|
-
if (validate) {
|
|
1122
|
-
const start = performance.now();
|
|
1123
|
-
const result = await validate(data, signal);
|
|
1124
|
-
log_default.debug(`[ChaindataProvider] Validating downloaded ${url?.split("/").pop()} took ${performance.now() - start} ms`);
|
|
1125
|
-
if (!result.success) {
|
|
1126
|
-
log_default.error("Failed to parse data from", url, { error: result.error });
|
|
1127
|
-
throw new Error(`Schema validation failed for ${url}`);
|
|
1128
|
-
}
|
|
1129
|
-
return result.data;
|
|
1130
|
-
}
|
|
1131
|
-
return data;
|
|
1132
|
-
};
|
|
1133
|
-
const fetchChaindata = (signal) => fetchJsonFromGithubUrl(CHAINDATA_CONSOLIDATED_URL, {
|
|
1134
|
-
validate: async (data, signal) => {
|
|
1135
|
-
const result = await parseChaindataFileChunked(data, { signal });
|
|
1136
|
-
if (result.success) markChaindataValidated(result.data);
|
|
1137
|
-
return result;
|
|
1138
|
-
},
|
|
1139
|
-
signal
|
|
1140
|
-
});
|
|
1141
|
-
//#endregion
|
|
1142
|
-
//#region src/state/githubChaindata.ts
|
|
1143
|
-
const REFRESH_INTERVAL = 3e5;
|
|
1144
|
-
let lastUpdatedAt = 0;
|
|
1145
|
-
const githubChaindata$ = new rxjs.Observable((subscriber) => {
|
|
1146
|
-
const controller = new AbortController();
|
|
1147
|
-
subscriber.add(() => controller.abort());
|
|
1148
|
-
let timeout = null;
|
|
1149
|
-
subscriber.add(() => timeout && clearTimeout(timeout));
|
|
1150
|
-
const refresh = async () => {
|
|
1151
|
-
try {
|
|
1152
|
-
const delay = Math.max(0, lastUpdatedAt + 6e4 - Date.now());
|
|
1153
|
-
if (delay > 0) await new Promise((resolve) => setTimeout(resolve, delay));
|
|
1154
|
-
if (controller.signal.aborted) return;
|
|
1155
|
-
log_default.debug("[defaultChaindata$] Refreshing chaindata from GitHub");
|
|
1156
|
-
const data = await fetchChaindata(controller.signal);
|
|
1157
|
-
lastUpdatedAt = Date.now();
|
|
1158
|
-
subscriber.next(data);
|
|
1159
|
-
} catch (error) {
|
|
1160
|
-
if ((0, _talismn_util.isAbortError)(error)) return;
|
|
1161
|
-
log_default.error("Failed to fetch chaindata", error);
|
|
1162
|
-
if (!subscriber.closed) subscriber.error(error);
|
|
1163
|
-
} finally {
|
|
1164
|
-
if (!controller.signal.aborted) timeout = setTimeout(refresh, REFRESH_INTERVAL);
|
|
1165
|
-
}
|
|
1166
|
-
};
|
|
1167
|
-
refresh();
|
|
1168
|
-
}).pipe((0, rxjs.shareReplay)({
|
|
1169
|
-
bufferSize: 1,
|
|
1170
|
-
refCount: true
|
|
1171
|
-
}));
|
|
1172
|
-
//#endregion
|
|
1173
1085
|
//#region src/state/initChaindata.json
|
|
1174
1086
|
var initChaindata_default = {
|
|
1175
1087
|
networks: [
|
|
@@ -1190,11 +1102,11 @@ var initChaindata_default = {
|
|
|
1190
1102
|
"blockExplorerUrls": ["https://etherscan.io"],
|
|
1191
1103
|
"platform": "ethereum",
|
|
1192
1104
|
"rpcs": [
|
|
1193
|
-
"https://ethereum-rpc.publicnode.com",
|
|
1194
1105
|
"https://mempool.merkle.io/rpc/eth/pk_mbs_1412a7392bd47753ca2b4bb3d123f6a1",
|
|
1106
|
+
"https://ethereum-rpc.publicnode.com",
|
|
1107
|
+
"https://xrpc.cl/eth",
|
|
1195
1108
|
"https://one.valve.city/rpc/vk_demo/evm/1",
|
|
1196
|
-
"https://public.1rpc.io/eth"
|
|
1197
|
-
"https://rpc.mevblocker.io"
|
|
1109
|
+
"https://public.1rpc.io/eth"
|
|
1198
1110
|
],
|
|
1199
1111
|
"feeType": "eip-1559",
|
|
1200
1112
|
"contracts": {
|
|
@@ -1253,7 +1165,7 @@ var initChaindata_default = {
|
|
|
1253
1165
|
"https://bsc-dataseed2.binance.org",
|
|
1254
1166
|
"https://bsc-dataseed3.binance.org",
|
|
1255
1167
|
"https://bsc-dataseed4.binance.org",
|
|
1256
|
-
"https://
|
|
1168
|
+
"https://xrpc.cl/bsc"
|
|
1257
1169
|
],
|
|
1258
1170
|
"contracts": {
|
|
1259
1171
|
"Erc20Aggregator": "0x21741D68121db79Fd1e9eA34028D3B2e87056DBd",
|
|
@@ -1278,10 +1190,10 @@ var initChaindata_default = {
|
|
|
1278
1190
|
"platform": "ethereum",
|
|
1279
1191
|
"rpcs": [
|
|
1280
1192
|
"https://mempool.merkle.io/rpc/polygon/pk_mbs_1412a7392bd47753ca2b4bb3d123f6a1",
|
|
1193
|
+
"https://xrpc.cl/polygon",
|
|
1281
1194
|
"https://public.1rpc.io/matic",
|
|
1282
1195
|
"https://polygon-bor-rpc.publicnode.com",
|
|
1283
|
-
"https://polygon.drpc.org"
|
|
1284
|
-
"https://poly.api.pocket.network"
|
|
1196
|
+
"https://polygon.drpc.org"
|
|
1285
1197
|
],
|
|
1286
1198
|
"contracts": {
|
|
1287
1199
|
"Erc20Aggregator": "0xb1EFd1407104Cf00F7b9983C1Fa474A2702B5874",
|
|
@@ -1337,8 +1249,8 @@ var initChaindata_default = {
|
|
|
1337
1249
|
"https://mempool.merkle.io/rpc/base/pk_mbs_1412a7392bd47753ca2b4bb3d123f6a1",
|
|
1338
1250
|
"https://base.publicnode.com",
|
|
1339
1251
|
"https://developer-access-mainnet.base.org/",
|
|
1340
|
-
"https://
|
|
1341
|
-
"https://
|
|
1252
|
+
"https://xrpc.cl/base",
|
|
1253
|
+
"https://public.1rpc.io/base"
|
|
1342
1254
|
],
|
|
1343
1255
|
"feeType": "eip-1559",
|
|
1344
1256
|
"l2FeeType": { "type": "op-stack" },
|
|
@@ -1364,11 +1276,11 @@ var initChaindata_default = {
|
|
|
1364
1276
|
"blockExplorerUrls": ["https://arbiscan.io/"],
|
|
1365
1277
|
"platform": "ethereum",
|
|
1366
1278
|
"rpcs": [
|
|
1367
|
-
"https://mempool.merkle.io/rpc/arbitrum/pk_mbs_1412a7392bd47753ca2b4bb3d123f6a1",
|
|
1368
1279
|
"https://arb1.arbitrum.io/rpc",
|
|
1280
|
+
"https://mempool.merkle.io/rpc/arbitrum/pk_mbs_1412a7392bd47753ca2b4bb3d123f6a1",
|
|
1281
|
+
"https://xrpc.cl/arbitrum",
|
|
1369
1282
|
"https://public.1rpc.io/arb",
|
|
1370
|
-
"https://arbitrum-one-rpc.publicnode.com"
|
|
1371
|
-
"https://arbitrum.meowrpc.com"
|
|
1283
|
+
"https://arbitrum-one-rpc.publicnode.com"
|
|
1372
1284
|
],
|
|
1373
1285
|
"contracts": {
|
|
1374
1286
|
"Erc20Aggregator": "0x180c2f0A65788258524Ab1e5c3c398EC46211b89",
|
|
@@ -1427,7 +1339,7 @@ var initChaindata_default = {
|
|
|
1427
1339
|
"platform": "polkadot",
|
|
1428
1340
|
"chainName": "Bittensor",
|
|
1429
1341
|
"specName": "node-subtensor",
|
|
1430
|
-
"specVersion":
|
|
1342
|
+
"specVersion": 475,
|
|
1431
1343
|
"account": "*25519",
|
|
1432
1344
|
"chainspecQrUrl": "https://metadata.novasama.io/qr/node-subtensor_specs.png",
|
|
1433
1345
|
"latestMetadataQrUrl": "https://metadata.novasama.io/qr/node-subtensor_metadata_latest.apng",
|
|
@@ -1468,10 +1380,10 @@ var initChaindata_default = {
|
|
|
1468
1380
|
"oldPrefix": 63,
|
|
1469
1381
|
"rpcs": [
|
|
1470
1382
|
"wss://hydration-rpc.n.dwellir.com",
|
|
1383
|
+
"wss://hydration.rotko.net",
|
|
1471
1384
|
"wss://subway.sin.hydration.cloud",
|
|
1472
1385
|
"wss://subway.coke.hydration.cloud",
|
|
1473
|
-
"wss://rpc.kril.hydration.cloud"
|
|
1474
|
-
"wss://rpc-catfish-1.catfish.hydration.cloud"
|
|
1386
|
+
"wss://rpc.kril.hydration.cloud"
|
|
1475
1387
|
],
|
|
1476
1388
|
"hasCheckMetadataHash": true,
|
|
1477
1389
|
"isUnknownFeeToken": true,
|
|
@@ -2918,12 +2830,12 @@ var initChaindata_default = {
|
|
|
2918
2830
|
"type": "substrate-dtao",
|
|
2919
2831
|
"symbol": "Ա",
|
|
2920
2832
|
"decimals": 9,
|
|
2921
|
-
"name": "SN103 |
|
|
2833
|
+
"name": "SN103 | Deprecated Ա",
|
|
2922
2834
|
"coingeckoId": "happyai-2",
|
|
2923
|
-
"logo": "https://raw.githubusercontent.com/TalismanSociety/chaindata/main/assets/tokens/
|
|
2835
|
+
"logo": "https://raw.githubusercontent.com/TalismanSociety/chaindata/main/assets/tokens/coingecko/happyai-2.webp",
|
|
2924
2836
|
"isDefault": true,
|
|
2925
2837
|
"netuid": 103,
|
|
2926
|
-
"subnetName": "
|
|
2838
|
+
"subnetName": "Deprecated",
|
|
2927
2839
|
"isTransferable": true
|
|
2928
2840
|
},
|
|
2929
2841
|
{
|
|
@@ -3128,12 +3040,12 @@ var initChaindata_default = {
|
|
|
3128
3040
|
"type": "substrate-dtao",
|
|
3129
3041
|
"symbol": "ъ",
|
|
3130
3042
|
"decimals": 9,
|
|
3131
|
-
"name": "SN116 |
|
|
3043
|
+
"name": "SN116 | Carbon ъ",
|
|
3132
3044
|
"coingeckoId": "solmev",
|
|
3133
|
-
"logo": "https://raw.githubusercontent.com/TalismanSociety/chaindata/main/assets/tokens/
|
|
3045
|
+
"logo": "https://raw.githubusercontent.com/TalismanSociety/chaindata/main/assets/tokens/dtao/bittensor-sn116-665ce7b0.webp",
|
|
3134
3046
|
"isDefault": true,
|
|
3135
3047
|
"netuid": 116,
|
|
3136
|
-
"subnetName": "
|
|
3048
|
+
"subnetName": "Carbon",
|
|
3137
3049
|
"isTransferable": true
|
|
3138
3050
|
},
|
|
3139
3051
|
{
|
|
@@ -4073,12 +3985,12 @@ var initChaindata_default = {
|
|
|
4073
3985
|
"type": "substrate-dtao",
|
|
4074
3986
|
"symbol": "خ",
|
|
4075
3987
|
"decimals": 9,
|
|
4076
|
-
"name": "SN58 |
|
|
3988
|
+
"name": "SN58 | Attune خ",
|
|
4077
3989
|
"coingeckoId": "dippy-speech",
|
|
4078
|
-
"logo": "https://raw.githubusercontent.com/TalismanSociety/chaindata/main/assets/tokens/
|
|
3990
|
+
"logo": "https://raw.githubusercontent.com/TalismanSociety/chaindata/main/assets/tokens/dtao/bittensor-sn58-72a691bd.webp",
|
|
4079
3991
|
"isDefault": true,
|
|
4080
3992
|
"netuid": 58,
|
|
4081
|
-
"subnetName": "",
|
|
3993
|
+
"subnetName": "Attune",
|
|
4082
3994
|
"isTransferable": true
|
|
4083
3995
|
},
|
|
4084
3996
|
{
|
|
@@ -4374,7 +4286,7 @@ var initChaindata_default = {
|
|
|
4374
4286
|
"decimals": 9,
|
|
4375
4287
|
"name": "SN76 | Ormas ن",
|
|
4376
4288
|
"coingeckoId": "safe-scan",
|
|
4377
|
-
"logo": "https://raw.githubusercontent.com/TalismanSociety/chaindata/main/assets/tokens/dtao/bittensor-sn76-
|
|
4289
|
+
"logo": "https://raw.githubusercontent.com/TalismanSociety/chaindata/main/assets/tokens/dtao/bittensor-sn76-b912954f.webp",
|
|
4378
4290
|
"isDefault": true,
|
|
4379
4291
|
"netuid": 76,
|
|
4380
4292
|
"subnetName": "Ormas",
|
|
@@ -5289,7 +5201,7 @@ var initChaindata_default = {
|
|
|
5289
5201
|
"type": "substrate-hydration",
|
|
5290
5202
|
"symbol": "HYPE",
|
|
5291
5203
|
"decimals": 18,
|
|
5292
|
-
"name": "Hyperliquid
|
|
5204
|
+
"name": "Hyperliquid",
|
|
5293
5205
|
"isDefault": true,
|
|
5294
5206
|
"onChainId": 1001355,
|
|
5295
5207
|
"assetType": "Token",
|
|
@@ -5303,7 +5215,7 @@ var initChaindata_default = {
|
|
|
5303
5215
|
"type": "substrate-hydration",
|
|
5304
5216
|
"symbol": "SPY",
|
|
5305
5217
|
"decimals": 18,
|
|
5306
|
-
"name": "SPY
|
|
5218
|
+
"name": "SPY",
|
|
5307
5219
|
"isDefault": true,
|
|
5308
5220
|
"onChainId": 1001356,
|
|
5309
5221
|
"assetType": "Token",
|
|
@@ -6833,6 +6745,22 @@ var initChaindata_default = {
|
|
|
6833
6745
|
"isSufficient": false,
|
|
6834
6746
|
"existentialDeposit": "1"
|
|
6835
6747
|
},
|
|
6748
|
+
{
|
|
6749
|
+
"id": "polkadot-asset-hub:substrate-assets:7873",
|
|
6750
|
+
"platform": "polkadot",
|
|
6751
|
+
"networkId": "polkadot-asset-hub",
|
|
6752
|
+
"type": "substrate-assets",
|
|
6753
|
+
"symbol": "dotUSD",
|
|
6754
|
+
"decimals": 6,
|
|
6755
|
+
"name": "dotUSD",
|
|
6756
|
+
"coingeckoId": "dotusd",
|
|
6757
|
+
"logo": "https://raw.githubusercontent.com/TalismanSociety/chaindata/main/assets/tokens/dotusd.svg",
|
|
6758
|
+
"isDefault": true,
|
|
6759
|
+
"assetId": "7873",
|
|
6760
|
+
"isFrozen": false,
|
|
6761
|
+
"isSufficient": true,
|
|
6762
|
+
"existentialDeposit": "10000"
|
|
6763
|
+
},
|
|
6836
6764
|
{
|
|
6837
6765
|
"id": "polkadot-asset-hub:substrate-foreignassets:N4IgDghgTgpgdgFwM4gFwCYA0ICWiZQ4D2UaoCAnmDGiABoCMI2AbhADYCuNq5VPIAOLsiAIw4BhInCTwknFKw7cyIStVoBpBRAC2EEAF9jhoA",
|
|
6838
6766
|
"platform": "polkadot",
|
|
@@ -7022,6 +6950,22 @@ var initChaindata_default = {
|
|
|
7022
6950
|
"isSufficient": false,
|
|
7023
6951
|
"existentialDeposit": "1"
|
|
7024
6952
|
},
|
|
6953
|
+
{
|
|
6954
|
+
"id": "polkadot-asset-hub:substrate-foreignassets:N4IgDghgTgpgdgFwM4gFwCYA0ICWiZQ4D2UaoCAnmDGiABrojYBuEANgK42oDa5V3EAHE2RAEbsAwkThJ4SDihbsuZEJWq0AoggAWBGBwC2TEK07dQAY10Q8AfRwATWmJwBzPAlQBGEAF9AzH5NVBAAQSsrIg5EAGkYCnQABlNzVVRQAGtE2mSADx8ICRgIHwAzAHYrAA4AZmSxJxqATggogDZKmCsAFghygFYfDvQa3rEfMSs6uqsA-wBdQKA",
|
|
6955
|
+
"platform": "polkadot",
|
|
6956
|
+
"networkId": "polkadot-asset-hub",
|
|
6957
|
+
"type": "substrate-foreignassets",
|
|
6958
|
+
"symbol": "EURC.e",
|
|
6959
|
+
"decimals": 6,
|
|
6960
|
+
"name": "Euro Coin",
|
|
6961
|
+
"coingeckoId": "euro-coin",
|
|
6962
|
+
"logo": "https://raw.githubusercontent.com/TalismanSociety/chaindata/main/assets/tokens/coingecko/euro-coin.webp",
|
|
6963
|
+
"isDefault": true,
|
|
6964
|
+
"onChainId": "{\"parents\":2,\"interior\":{\"type\":\"X2\",\"value\":[{\"type\":\"GlobalConsensus\",\"value\":{\"type\":\"Ethereum\",\"value\":{\"chain_id\":\"bigint:1\"}}},{\"type\":\"AccountKey20\",\"value\":{\"key\":\"0x1abaea1f7c830bd89acc67ec4af516284b1bc33c\"}}]}}",
|
|
6965
|
+
"isFrozen": false,
|
|
6966
|
+
"isSufficient": false,
|
|
6967
|
+
"existentialDeposit": "1"
|
|
6968
|
+
},
|
|
7025
6969
|
{
|
|
7026
6970
|
"id": "polkadot-asset-hub:substrate-foreignassets:N4IgDghgTgpgdgFwM4gFwCYA0ICWiZQ4D2UaoCAnmDGiABrojYBuEANgK42oDa5V3EAHE2RAEbsAwkThJ4SDihbsuZEJWq0AoggAWBGBwC2TEK07dQAY10Q8AfRwATWmJwBzPAlQBGEAF9AzH5NVBAAQSsrIg5EAGkYCnQABlNzVVRQAGtE2mSADycIKx8AdgAzAE4AVgAOJ3QYGGr0AGYIdBSANm7KyoAWasrSktanWtafGCtSgP8AXUCgA",
|
|
7027
6971
|
"platform": "polkadot",
|
|
@@ -8089,10 +8033,10 @@ var initChaindata_default = {
|
|
|
8089
8033
|
"extra": null
|
|
8090
8034
|
},
|
|
8091
8035
|
{
|
|
8092
|
-
"id": "
|
|
8093
|
-
"source": "substrate-
|
|
8036
|
+
"id": "1f2fdda5a53e0abbfade7f61c63b384c",
|
|
8037
|
+
"source": "substrate-assets",
|
|
8094
8038
|
"chainId": "bittensor",
|
|
8095
|
-
"specVersion":
|
|
8039
|
+
"specVersion": 475,
|
|
8096
8040
|
"version": "v14",
|
|
8097
8041
|
"data": null,
|
|
8098
8042
|
"extra": null
|
|
@@ -8222,15 +8166,6 @@ var initChaindata_default = {
|
|
|
8222
8166
|
"data": null,
|
|
8223
8167
|
"extra": { "palletId": "Tokens" }
|
|
8224
8168
|
},
|
|
8225
|
-
{
|
|
8226
|
-
"id": "60ebcec9b613f320c394eea4a77946cf",
|
|
8227
|
-
"source": "substrate-tokens",
|
|
8228
|
-
"chainId": "bittensor",
|
|
8229
|
-
"specVersion": 470,
|
|
8230
|
-
"version": "v14",
|
|
8231
|
-
"data": null,
|
|
8232
|
-
"extra": { "palletId": "Tokens" }
|
|
8233
|
-
},
|
|
8234
8169
|
{
|
|
8235
8170
|
"id": "643c414b19bf92a482edaa24978fdbdd",
|
|
8236
8171
|
"source": "substrate-dtao",
|
|
@@ -8249,15 +8184,6 @@ var initChaindata_default = {
|
|
|
8249
8184
|
"data": "0x6d6574610f48000c1c73705f636f72651863727970746f2c4163636f756e7449643332000004000401205b75383b2033325d0000040000032000000008000800000503000c00000208001000000505001400000507001800000500001c04184f7074696f6e04045401140108104e6f6e6500000010536f6d6504001400000100002004184f7074696f6e04045401240108104e6f6e6500000010536f6d650400240000010000240c4c626f756e6465645f636f6c6c656374696f6e732c626f756e6465645f76656328426f756e64656456656308045401080453000004000c01185665633c543e0000280c5470616c6c65745f61737365745f72656769737472791474797065732441737365745479706500011814546f6b656e0000000c58594b00010028537461626c655377617000020010426f6e640003002045787465726e616c000400144572633230000500002c04184f7074696f6e04045401080108104e6f6e6500000010536f6d650400080000010000300c5470616c6c65745f61737365745f726567697374727914747970657330417373657444657461696c73042c537472696e674c696d697400001c01106e616d652001644f7074696f6e3c4e616d653c537472696e674c696d69743e3e00012861737365745f7479706528012441737365745479706500014c6578697374656e7469616c5f6465706f73697414011c42616c616e636500011873796d626f6c20016c4f7074696f6e3c53796d626f6c3c537472696e674c696d69743e3e000120646563696d616c732c01284f7074696f6e3c75383e00013878636d5f726174655f6c696d69741c013c4f7074696f6e3c42616c616e63653e00013469735f73756666696369656e74180110626f6f6c0000340000040800100038082c6f726d6c5f746f6b656e732c4163636f756e7444617461041c42616c616e63650114000c01106672656514011c42616c616e6365000120726573657276656414011c42616c616e636500011866726f7a656e14011c42616c616e636500003c088470616c6c65745f63757272656e636965735f7270635f72756e74696d655f6170692c4163636f756e7444617461041c42616c616e63650114000c01106672656514011c42616c616e6365000120726573657276656414011c42616c616e636500011866726f7a656e14011c42616c616e636500004000000244004400000408103c000834417373657452656769737472790134417373657452656769737472790418417373657473000104021030040004542044657461696c73206f6620616e2061737365742e00000000330018546f6b656e730118546f6b656e7304204163636f756e747301010802053438c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018b8205468652062616c616e6365206f66206120746f6b656e207479706520756e64657220616e206163636f756e742e00fc204e4f54453a2049662074686520746f74616c2069732065766572207a65726f2c206465637265617365206163636f756e7420726566206163636f756e742e001901204e4f54453a2054686973206973206f6e6c79207573656420696e20746865206361736520746861742074686973206d6f64756c65206973207573656420746f2073746f7265282062616c616e6365732e000000004d000400000000009d0f043443757272656e6369657341706904206163636f756e7473040c77686f0040000000000000",
|
|
8250
8185
|
"extra": null
|
|
8251
8186
|
},
|
|
8252
|
-
{
|
|
8253
|
-
"id": "672bd4dcf46610ac3b280a2b6e414b33",
|
|
8254
|
-
"source": "substrate-dtao",
|
|
8255
|
-
"chainId": "bittensor",
|
|
8256
|
-
"specVersion": 470,
|
|
8257
|
-
"version": "v14",
|
|
8258
|
-
"data": "0x6d6574610fc8000c1c73705f636f72651863727970746f2c4163636f756e7449643332000004000401205b75383b2033325d0000040000032000000008000800000503000c0000050500100c6073756274656e736f725f72756e74696d655f636f6d6d6f6e2063757272656e63792854616f42616c616e63650000040014010c75363400001400000506001800000507001c000005000020000006140024000002080028086073756274656e736f725f72756e74696d655f636f6d6d6f6e184e6574556964000004002c010c75313600002c0000050400300c6073756274656e736f725f72756e74696d655f636f6d6d6f6e2063757272656e637930416c70686142616c616e63650000040014010c753634000034000006280038083c7375627374726174655f666978656424466978656455313238041046726163013c00040110626974731801107531323800003c0c447375627374726174655f747970656e756d1075696e741055496e740804550140044201600008010c6d73624001045500010c6c7362600104420000400c447375627374726174655f747970656e756d1075696e741055496e740804550144044201600008010c6d73624401045500010c6c7362600104420000440c447375627374726174655f747970656e756d1075696e741055496e740804550148044201600008010c6d73624801045500010c6c7362600104420000480c447375627374726174655f747970656e756d1075696e741055496e74080455014c044201600008010c6d73624c01045500010c6c73626001044200004c0c447375627374726174655f747970656e756d1075696e741055496e740804550150044201600008010c6d73625001045500010c6c7362600104420000500c447375627374726174655f747970656e756d1075696e741055496e740804550154044201600008010c6d73625401045500010c6c7362600104420000540c447375627374726174655f747970656e756d1075696e741055496e7408045501580442015c0008010c6d73625801045500010c6c73625c0104420000580c447375627374726174655f747970656e756d1075696e7414555465726d000000005c0c447375627374726174655f747970656e756d0c62697408423100000000600c447375627374726174655f747970656e756d0c626974084230000000006404184f7074696f6e04045401680108104e6f6e6500000010536f6d650400680000010000680c4070616c6c65745f73756274656e736f721870616c6c6574405375626e65744964656e746974795633000020012c7375626e65745f6e616d6524011c5665633c75383e00012c6769746875625f7265706f24011c5665633c75383e0001387375626e65745f636f6e7461637424011c5665633c75383e0001287375626e65745f75726c24011c5665633c75383e00011c646973636f726424011c5665633c75383e00012c6465736372697074696f6e24011c5665633c75383e0001206c6f676f5f75726c24011c5665633c75383e0001286164646974696f6e616c24011c5665633c75383e00006c0000061000700000020000740000040800280078083c7375627374726174655f666978656424466978656449313238041046726163014000040110626974737c01106931323800007c0000050d00800000040c0028000084104070616c6c65745f73756274656e736f721c7374616b696e67106c6f636b244c6f636b537461746500000c012c6c6f636b65645f6d617373300130416c70686142616c616e6365000128636f6e76696374696f6e38011855363446363400012c6c6173745f75706461746514010c753634000088000004080000008c0000062c009000000630009400000298009804184f7074696f6e040454019c0108104e6f6e6500000010536f6d6504009c00000100009c104070616c6c65745f73756274656e736f72207270635f696e666f3064796e616d69635f696e666f2c44796e616d6963496e666f04244163636f756e7449640100005401186e657475696434013c436f6d706163743c4e65745569643e0001306f776e65725f686f746b65790001244163636f756e7449640001346f776e65725f636f6c646b65790001244163636f756e74496400012c7375626e65745f6e616d65a001405665633c436f6d706163743c75383e3e000130746f6b656e5f73796d626f6ca001405665633c436f6d706163743c75383e3e00011474656d706f8c0130436f6d706163743c7531363e0001246c6173745f73746570200130436f6d706163743c7536343e000158626c6f636b735f73696e63655f6c6173745f73746570200130436f6d706163743c7536343e000120656d697373696f6e200130436f6d706163743c7536343e000120616c7068615f696e900154436f6d706163743c416c70686142616c616e63653e000124616c7068615f6f7574900154436f6d706163743c416c70686142616c616e63653e00011874616f5f696e6c014c436f6d706163743c54616f42616c616e63653e000148616c7068615f6f75745f656d697373696f6e900154436f6d706163743c416c70686142616c616e63653e000144616c7068615f696e5f656d697373696f6e900154436f6d706163743c416c70686142616c616e63653e00013c74616f5f696e5f656d697373696f6e6c014c436f6d706163743c54616f42616c616e63653e00015870656e64696e675f616c7068615f656d697373696f6e900154436f6d706163743c416c70686142616c616e63653e00015470656e64696e675f726f6f745f656d697373696f6e6c014c436f6d706163743c54616f42616c616e63653e0001347375626e65745f766f6c756d65a80134436f6d706163743c753132383e0001546e6574776f726b5f726567697374657265645f6174200130436f6d706163743c7536343e00013c7375626e65745f6964656e746974796401604f7074696f6e3c5375626e65744964656e7469747956333e0001306d6f76696e675f70726963657801184939364633320000a0000002a400a40000060800a80000061800ac000002b000b0104070616c6c65745f73756274656e736f72207270635f696e666f287374616b655f696e666f245374616b65496e666f04244163636f756e744964010000240118686f746b65790001244163636f756e74496400011c636f6c646b65790001244163636f756e7449640001186e657475696434013c436f6d706163743c4e65745569643e0001147374616b65900154436f6d706163743c416c70686142616c616e63653e0001186c6f636b6564200130436f6d706163743c7536343e000120656d697373696f6e900154436f6d706163743c416c70686142616c616e63653e00013074616f5f656d697373696f6e6c014c436f6d706163743c54616f42616c616e63653e000114647261696e200130436f6d706163743c7536343e00013469735f726567697374657265641c0110626f6f6c0000b4000002b800b80000040800ac00bc04184f7074696f6e04045401840108104e6f6e6500000010536f6d650400840000010000c0104070616c6c65745f73756274656e736f72207270635f696e666f2c6261736b65745f696e666f484261736b6574436c61696d5072657669657704244163636f756e744964010000280118686f746b65790001244163636f756e74496400012c6f7765645f73686172657314010c75363400012c616363727565645f74616f10012854616f42616c616e636500013872656465656d61626c655f74616f10012854616f42616c616e6365000144666f726665697465645f74616f5f65737410012854616f42616c616e6365000110726f77730c010c753332000130726f77735f746f5f73656c6c0c010c753332000124647573745f726f77730c010c75333200011473776570740c010c75333200013c666c75736865645f637265646974730c010c7533320000c4000002c000081853797374656d011853797374656d04184e756d62657201000c1000000000040901205468652063757272656e7420626c6f636b206e756d626572206265696e672070726f6365737365642e205365742062792060657865637574655f626c6f636b602e0000000000003c53756274656e736f724d6f64756c65013c53756274656e736f724d6f64756c6514104c6f636b00010c0206028084040004690120444d4150202820636f6c646b65792c206e65747569642c20686f746b65792029202d2d3e204c6f636b5374617465207c204578706f6e656e7469616c206c6f636b2070657220636f6c646b657920706572207375626e65742e304465636179696e674c6f636b0001080206741c0400087d0120444d4150202820636f6c646b65792c206e65747569642029202d2d3e2066616c7365207c205768656e2070726573656e7420616e642066616c73652c207468697320636f6c646b65792773206c6f636b2069732070657270657475616c2ec4204d697373696e6720656e7472696573206d65616e20746865206c6f636b206465636179732062792064656661756c742e385472616e73666572546f67676c6501010406281c0401048c204d41502028206e65747569642029202d2d3e207472616e736665725f746f67676c656c4c617374436f6c646b6579486f746b65795374616b65426c6f636b0001080505881404000c2501204d61702028636f6c646b65792c20686f746b657929202d2d3e2075363420746865206c61737420626c6f636b206174207768696368202a2a726f6f742a2a207374616b652077617319012061646465642f72656d6f7665642f636c61696d656420666f72207468617420706169722e205573656420736f6c656c79206173207468652061676520626173697320666f721d012060526f6f745374616b65556e6c6f636b496e74657276616c602e204e6f6e2d726f6f74207374616b65206f7073206d757374206e6f742077726974652074686973206d61702e5c526f6f745374616b65556e6c6f636b496e74657276616c0100142000000000000000001c3501204d696e696d756d206e756d626572206f6620626c6f636b7320726f6f7420286e6574756964203029207374616b65206d7573742062652068656c64206265666f72652069742063616e2062652d012072656d6f7665642066726f6d20726f6f742028766961206072656d6f76655f7374616b65602c206d6f76652f737761702f7472616e73666572206f666620726f6f742c206574632e292c2901206b65796564206f666620604c617374436f6c646b6579486f746b65795374616b65426c6f636b602e206030602064697361626c65732074686520686f6c64202864656661756c74292c45012070726573657276696e67206c6567616379206265686176696f75722e205768656e20736574203e3d206f6e652074656d706f206974206e65757472616c697365732065706f63682d626f756e64617279410120226a7573742d696e2d74696d6522206469766964656e6420736e6970696e673a20726f6f74207374616b6520697320313a312054414f2077697468206e6f20414d4d20736c6970706167652c20736f450120776974686f75742074686973206672696374696f6e206120736e697065722063616e207374616b65207269676874206265666f7265206120626f756e646172792c206361707475726520612066756c6c35012074656d706f277320726f6f74206469766964656e642070726f2d7261746120746f20696e7374616e74616e656f7573207374616b652c20616e64206578697420696d6d6564696174656c792e000000000700040000000000c1010c505375626e6574496e666f52756e74696d6541706904506765745f616c6c5f64796e616d69635f696e666f009400004c5374616b65496e666f52756e74696d65417069086c6765745f7374616b655f696e666f5f666f725f636f6c646b6579730440636f6c646b65795f6163636f756e747370b400406765745f636f6c646b65795f6c6f636b081c636f6c646b657900186e657475696428bc000050426574614261736b657452756e74696d6541706904786765745f726f6f745f6261736b65745f636c61696d5f7072657669657773041c636f6c646b657900c4041901205468652073616d6520666f722065766572792076616c696461746f72206120636f6c646b65792d776964652060636c61696d5f726f6f746020776f756c6420746f7563682e0000000000",
|
|
8259
|
-
"extra": null
|
|
8260
|
-
},
|
|
8261
8187
|
{
|
|
8262
8188
|
"id": "67f905d9e8fe69fbee590d6903e4f26a",
|
|
8263
8189
|
"source": "substrate-native",
|
|
@@ -8301,16 +8227,13 @@ var initChaindata_default = {
|
|
|
8301
8227
|
}
|
|
8302
8228
|
},
|
|
8303
8229
|
{
|
|
8304
|
-
"id": "
|
|
8305
|
-
"source": "substrate-
|
|
8230
|
+
"id": "7c338f58aafd9be3207e75eae087a08e",
|
|
8231
|
+
"source": "substrate-psp22",
|
|
8306
8232
|
"chainId": "bittensor",
|
|
8307
|
-
"specVersion":
|
|
8233
|
+
"specVersion": 475,
|
|
8308
8234
|
"version": "v14",
|
|
8309
|
-
"data":
|
|
8310
|
-
"extra":
|
|
8311
|
-
"useLegacyTransferableCalculation": false,
|
|
8312
|
-
"existentialDeposit": "500"
|
|
8313
|
-
}
|
|
8235
|
+
"data": null,
|
|
8236
|
+
"extra": null
|
|
8314
8237
|
},
|
|
8315
8238
|
{
|
|
8316
8239
|
"id": "83ec68365fc9b7555fbe768d061b9eec",
|
|
@@ -8339,6 +8262,24 @@ var initChaindata_default = {
|
|
|
8339
8262
|
"data": null,
|
|
8340
8263
|
"extra": null
|
|
8341
8264
|
},
|
|
8265
|
+
{
|
|
8266
|
+
"id": "99f8c18b0187944c80d4eb71595b2d03",
|
|
8267
|
+
"source": "substrate-hydration",
|
|
8268
|
+
"chainId": "bittensor",
|
|
8269
|
+
"specVersion": 475,
|
|
8270
|
+
"version": "v14",
|
|
8271
|
+
"data": null,
|
|
8272
|
+
"extra": null
|
|
8273
|
+
},
|
|
8274
|
+
{
|
|
8275
|
+
"id": "9b0f5d80c01f441df50e81e2060a675c",
|
|
8276
|
+
"source": "substrate-tokens",
|
|
8277
|
+
"chainId": "bittensor",
|
|
8278
|
+
"specVersion": 475,
|
|
8279
|
+
"version": "v14",
|
|
8280
|
+
"data": null,
|
|
8281
|
+
"extra": { "palletId": "Tokens" }
|
|
8282
|
+
},
|
|
8342
8283
|
{
|
|
8343
8284
|
"id": "9cc83ef0f02af9d2f7adac07f29db115",
|
|
8344
8285
|
"source": "substrate-assets",
|
|
@@ -8348,6 +8289,15 @@ var initChaindata_default = {
|
|
|
8348
8289
|
"data": null,
|
|
8349
8290
|
"extra": null
|
|
8350
8291
|
},
|
|
8292
|
+
{
|
|
8293
|
+
"id": "9f4b5cfec1977ed9102bfb087eadb8c6",
|
|
8294
|
+
"source": "substrate-dtao",
|
|
8295
|
+
"chainId": "bittensor",
|
|
8296
|
+
"specVersion": 475,
|
|
8297
|
+
"version": "v14",
|
|
8298
|
+
"data": "0x6d6574610fc8000c1c73705f636f72651863727970746f2c4163636f756e7449643332000004000401205b75383b2033325d0000040000032000000008000800000503000c0000050500100c6073756274656e736f725f72756e74696d655f636f6d6d6f6e2063757272656e63792854616f42616c616e63650000040014010c75363400001400000506001800000507001c000005000020000006140024000002080028086073756274656e736f725f72756e74696d655f636f6d6d6f6e184e6574556964000004002c010c75313600002c0000050400300c6073756274656e736f725f72756e74696d655f636f6d6d6f6e2063757272656e637930416c70686142616c616e63650000040014010c753634000034000006280038083c7375627374726174655f666978656424466978656455313238041046726163013c00040110626974731801107531323800003c0c447375627374726174655f747970656e756d1075696e741055496e740804550140044201600008010c6d73624001045500010c6c7362600104420000400c447375627374726174655f747970656e756d1075696e741055496e740804550144044201600008010c6d73624401045500010c6c7362600104420000440c447375627374726174655f747970656e756d1075696e741055496e740804550148044201600008010c6d73624801045500010c6c7362600104420000480c447375627374726174655f747970656e756d1075696e741055496e74080455014c044201600008010c6d73624c01045500010c6c73626001044200004c0c447375627374726174655f747970656e756d1075696e741055496e740804550150044201600008010c6d73625001045500010c6c7362600104420000500c447375627374726174655f747970656e756d1075696e741055496e740804550154044201600008010c6d73625401045500010c6c7362600104420000540c447375627374726174655f747970656e756d1075696e741055496e7408045501580442015c0008010c6d73625801045500010c6c73625c0104420000580c447375627374726174655f747970656e756d1075696e7414555465726d000000005c0c447375627374726174655f747970656e756d0c62697408423100000000600c447375627374726174655f747970656e756d0c626974084230000000006404184f7074696f6e04045401680108104e6f6e6500000010536f6d650400680000010000680c4070616c6c65745f73756274656e736f721870616c6c6574405375626e65744964656e746974795633000020012c7375626e65745f6e616d6524011c5665633c75383e00012c6769746875625f7265706f24011c5665633c75383e0001387375626e65745f636f6e7461637424011c5665633c75383e0001287375626e65745f75726c24011c5665633c75383e00011c646973636f726424011c5665633c75383e00012c6465736372697074696f6e24011c5665633c75383e0001206c6f676f5f75726c24011c5665633c75383e0001286164646974696f6e616c24011c5665633c75383e00006c0000061000700000020000740000040800280078083c7375627374726174655f666978656424466978656449313238041046726163014000040110626974737c01106931323800007c0000050d00800000040c0028000084104070616c6c65745f73756274656e736f721c7374616b696e67106c6f636b244c6f636b537461746500000c012c6c6f636b65645f6d617373300130416c70686142616c616e6365000128636f6e76696374696f6e38011855363446363400012c6c6173745f75706461746514010c753634000088000004080000008c0000062c009000000630009400000298009804184f7074696f6e040454019c0108104e6f6e6500000010536f6d6504009c00000100009c104070616c6c65745f73756274656e736f72207270635f696e666f3064796e616d69635f696e666f2c44796e616d6963496e666f04244163636f756e7449640100005401186e657475696434013c436f6d706163743c4e65745569643e0001306f776e65725f686f746b65790001244163636f756e7449640001346f776e65725f636f6c646b65790001244163636f756e74496400012c7375626e65745f6e616d65a001405665633c436f6d706163743c75383e3e000130746f6b656e5f73796d626f6ca001405665633c436f6d706163743c75383e3e00011474656d706f8c0130436f6d706163743c7531363e0001246c6173745f73746570200130436f6d706163743c7536343e000158626c6f636b735f73696e63655f6c6173745f73746570200130436f6d706163743c7536343e000120656d697373696f6e200130436f6d706163743c7536343e000120616c7068615f696e900154436f6d706163743c416c70686142616c616e63653e000124616c7068615f6f7574900154436f6d706163743c416c70686142616c616e63653e00011874616f5f696e6c014c436f6d706163743c54616f42616c616e63653e000148616c7068615f6f75745f656d697373696f6e900154436f6d706163743c416c70686142616c616e63653e000144616c7068615f696e5f656d697373696f6e900154436f6d706163743c416c70686142616c616e63653e00013c74616f5f696e5f656d697373696f6e6c014c436f6d706163743c54616f42616c616e63653e00015870656e64696e675f616c7068615f656d697373696f6e900154436f6d706163743c416c70686142616c616e63653e00015470656e64696e675f726f6f745f656d697373696f6e6c014c436f6d706163743c54616f42616c616e63653e0001347375626e65745f766f6c756d65a80134436f6d706163743c753132383e0001546e6574776f726b5f726567697374657265645f6174200130436f6d706163743c7536343e00013c7375626e65745f6964656e746974796401604f7074696f6e3c5375626e65744964656e7469747956333e0001306d6f76696e675f70726963657801184939364633320000a0000002a400a40000060800a80000061800ac000002b000b0104070616c6c65745f73756274656e736f72207270635f696e666f287374616b655f696e666f245374616b65496e666f04244163636f756e744964010000240118686f746b65790001244163636f756e74496400011c636f6c646b65790001244163636f756e7449640001186e657475696434013c436f6d706163743c4e65745569643e0001147374616b65900154436f6d706163743c416c70686142616c616e63653e0001186c6f636b6564200130436f6d706163743c7536343e000120656d697373696f6e900154436f6d706163743c416c70686142616c616e63653e00013074616f5f656d697373696f6e6c014c436f6d706163743c54616f42616c616e63653e000114647261696e200130436f6d706163743c7536343e00013469735f726567697374657265641c0110626f6f6c0000b4000002b800b80000040800ac00bc04184f7074696f6e04045401840108104e6f6e6500000010536f6d650400840000010000c0104070616c6c65745f73756274656e736f72207270635f696e666f2c6261736b65745f696e666f484261736b6574436c61696d5072657669657704244163636f756e744964010000280118686f746b65790001244163636f756e74496400012c6f7765645f73686172657314010c75363400012c616363727565645f74616f10012854616f42616c616e636500013872656465656d61626c655f74616f10012854616f42616c616e6365000144666f726665697465645f74616f5f65737410012854616f42616c616e6365000110726f77730c010c753332000130726f77735f746f5f73656c6c0c010c753332000124647573745f726f77730c010c75333200011473776570740c010c75333200013c666c75736865645f637265646974730c010c7533320000c4000002c000081853797374656d011853797374656d04184e756d62657201000c1000000000040901205468652063757272656e7420626c6f636b206e756d626572206265696e672070726f6365737365642e205365742062792060657865637574655f626c6f636b602e0000000000003c53756274656e736f724d6f64756c65013c53756274656e736f724d6f64756c6514104c6f636b00010c0206028084040004690120444d4150202820636f6c646b65792c206e65747569642c20686f746b65792029202d2d3e204c6f636b5374617465207c204578706f6e656e7469616c206c6f636b2070657220636f6c646b657920706572207375626e65742e304465636179696e674c6f636b0001080206741c0400087d0120444d4150202820636f6c646b65792c206e65747569642029202d2d3e2066616c7365207c205768656e2070726573656e7420616e642066616c73652c207468697320636f6c646b65792773206c6f636b2069732070657270657475616c2ec4204d697373696e6720656e7472696573206d65616e20746865206c6f636b206465636179732062792064656661756c742e385472616e73666572546f67676c6501010406281c0401048c204d41502028206e65747569642029202d2d3e207472616e736665725f746f67676c656c4c617374436f6c646b6579486f746b65795374616b65426c6f636b0001080505881404000c2501204d61702028636f6c646b65792c20686f746b657929202d2d3e2075363420746865206c61737420626c6f636b206174207768696368202a2a726f6f742a2a207374616b652077617319012061646465642f72656d6f7665642f636c61696d656420666f72207468617420706169722e205573656420736f6c656c79206173207468652061676520626173697320666f721d012060526f6f745374616b65556e6c6f636b496e74657276616c602e204e6f6e2d726f6f74207374616b65206f7073206d757374206e6f742077726974652074686973206d61702e5c526f6f745374616b65556e6c6f636b496e74657276616c0100142000000000000000001c3501204d696e696d756d206e756d626572206f6620626c6f636b7320726f6f7420286e6574756964203029207374616b65206d7573742062652068656c64206265666f72652069742063616e2062652d012072656d6f7665642066726f6d20726f6f742028766961206072656d6f76655f7374616b65602c206d6f76652f737761702f7472616e73666572206f666620726f6f742c206574632e292c2901206b65796564206f666620604c617374436f6c646b6579486f746b65795374616b65426c6f636b602e206030602064697361626c65732074686520686f6c64202864656661756c74292c45012070726573657276696e67206c6567616379206265686176696f75722e205768656e20736574203e3d206f6e652074656d706f206974206e65757472616c697365732065706f63682d626f756e64617279410120226a7573742d696e2d74696d6522206469766964656e6420736e6970696e673a20726f6f74207374616b6520697320313a312054414f2077697468206e6f20414d4d20736c6970706167652c20736f450120776974686f75742074686973206672696374696f6e206120736e697065722063616e207374616b65207269676874206265666f7265206120626f756e646172792c206361707475726520612066756c6c35012074656d706f277320726f6f74206469766964656e642070726f2d7261746120746f20696e7374616e74616e656f7573207374616b652c20616e64206578697420696d6d6564696174656c792e000000000700040000000000c5010c505375626e6574496e666f52756e74696d6541706904506765745f616c6c5f64796e616d69635f696e666f009400004c5374616b65496e666f52756e74696d65417069086c6765745f7374616b655f696e666f5f666f725f636f6c646b6579730440636f6c646b65795f6163636f756e747370b400406765745f636f6c646b65795f6c6f636b081c636f6c646b657900186e657475696428bc000050426574614261736b657452756e74696d6541706904786765745f726f6f745f6261736b65745f636c61696d5f7072657669657773041c636f6c646b657900c4041901205468652073616d6520666f722065766572792076616c696461746f72206120636f6c646b65792d776964652060636c61696d5f726f6f746020776f756c6420746f7563682e0000000000",
|
|
8299
|
+
"extra": null
|
|
8300
|
+
},
|
|
8351
8301
|
{
|
|
8352
8302
|
"id": "a179ac50b24314e959bbb01b3e807d29",
|
|
8353
8303
|
"source": "substrate-native",
|
|
@@ -8406,24 +8356,6 @@ var initChaindata_default = {
|
|
|
8406
8356
|
"data": null,
|
|
8407
8357
|
"extra": null
|
|
8408
8358
|
},
|
|
8409
|
-
{
|
|
8410
|
-
"id": "d621159823513db0d82e95c4fd543704",
|
|
8411
|
-
"source": "substrate-psp22",
|
|
8412
|
-
"chainId": "bittensor",
|
|
8413
|
-
"specVersion": 470,
|
|
8414
|
-
"version": "v14",
|
|
8415
|
-
"data": null,
|
|
8416
|
-
"extra": null
|
|
8417
|
-
},
|
|
8418
|
-
{
|
|
8419
|
-
"id": "d7a6757b921e7e99748d6ccbf0695d93",
|
|
8420
|
-
"source": "substrate-hydration",
|
|
8421
|
-
"chainId": "bittensor",
|
|
8422
|
-
"specVersion": 470,
|
|
8423
|
-
"version": "v14",
|
|
8424
|
-
"data": null,
|
|
8425
|
-
"extra": null
|
|
8426
|
-
},
|
|
8427
8359
|
{
|
|
8428
8360
|
"id": "dc1f3f476a7adc159c8d948df27ad00a",
|
|
8429
8361
|
"source": "substrate-dtao",
|
|
@@ -8491,6 +8423,27 @@ var initChaindata_default = {
|
|
|
8491
8423
|
"data": null,
|
|
8492
8424
|
"extra": null
|
|
8493
8425
|
},
|
|
8426
|
+
{
|
|
8427
|
+
"id": "f225e4b874f64c73cdfd47e6d4a5aacb",
|
|
8428
|
+
"source": "substrate-foreignassets",
|
|
8429
|
+
"chainId": "bittensor",
|
|
8430
|
+
"specVersion": 475,
|
|
8431
|
+
"version": "v14",
|
|
8432
|
+
"data": null,
|
|
8433
|
+
"extra": null
|
|
8434
|
+
},
|
|
8435
|
+
{
|
|
8436
|
+
"id": "f5211aa4fa5aba940e8b289bbbfb4d8a",
|
|
8437
|
+
"source": "substrate-native",
|
|
8438
|
+
"chainId": "bittensor",
|
|
8439
|
+
"specVersion": 475,
|
|
8440
|
+
"version": "v14",
|
|
8441
|
+
"data": "0x6d6574610f90000c1c73705f636f72651863727970746f2c4163636f756e7449643332000004000401205b75383b2033325d0000040000032000000008000800000503000c08306672616d655f73797374656d2c4163636f756e74496e666f08144e6f6e636501102c4163636f756e74446174610114001401146e6f6e63651001144e6f6e6365000124636f6e73756d657273100120526566436f756e7400012470726f766964657273100120526566436f756e7400012c73756666696369656e7473100120526566436f756e740001106461746114012c4163636f756e74446174610000100000050500140c3c70616c6c65745f62616c616e6365731474797065732c4163636f756e7444617461041c42616c616e63650118001001106672656518011c42616c616e6365000120726573657276656418011c42616c616e636500011866726f7a656e18011c42616c616e6365000114666c6167732001284578747261466c6167730000180c6073756274656e736f725f72756e74696d655f636f6d6d6f6e2063757272656e63792854616f42616c616e6365000004001c010c75363400001c0000050600200c3c70616c6c65745f62616c616e636573147479706573284578747261466c616773000004002401107531323800002400000507002800000504002c040c436f7704045401300004003000000030000005020034082873705f76657273696f6e3852756e74696d6556657273696f6e0000200124737065635f6e616d652c0144436f773c277374617469632c207374723e000124696d706c5f6e616d652c0144436f773c277374617469632c207374723e000144617574686f72696e675f76657273696f6e10010c753332000130737065635f76657273696f6e10010c753332000130696d706c5f76657273696f6e10010c7533320001106170697338011c4170697356656300014c7472616e73616374696f6e5f76657273696f6e10010c75333200013873797374656d5f76657273696f6e0801087538000038040c436f77040454013c0004003c0000003c0000024000400000040844100044000003080000000800480c4c626f756e6465645f636f6c6c656374696f6e73407765616b5f626f756e6465645f766563385765616b426f756e646564566563080454014c0453000004005401185665633c543e00004c0c3c70616c6c65745f62616c616e6365731474797065732c42616c616e63654c6f636b041c42616c616e63650118000c010869644401384c6f636b4964656e746966696572000118616d6f756e7418011c42616c616e636500011c726561736f6e7350011c526561736f6e730000500c3c70616c6c65745f62616c616e6365731474797065731c526561736f6e7300010c0c466565000000104d6973630001000c416c6c00020000540000024c00580c4c626f756e6465645f636f6c6c656374696f6e732c626f756e6465645f76656328426f756e646564566563080454015c0453000004006001185665633c543e00005c0c3c70616c6c65745f62616c616e6365731474797065732c52657365727665446174610844526573657276654964656e74696669657201441c42616c616e63650118000801086964440144526573657276654964656e746966696572000118616d6f756e7418011c42616c616e63650000600000025c00640c4c626f756e6465645f636f6c6c656374696f6e732c626f756e6465645f76656328426f756e64656456656308045401680453000004007c01185665633c543e00006814346672616d655f737570706f72741874726169747318746f6b656e73106d697363204964416d6f756e7408084964016c1c42616c616e636501180008010869646c01084964000118616d6f756e7418011c42616c616e636500006c08586e6f64655f73756274656e736f725f72756e74696d654452756e74696d65486f6c64526561736f6e00010c20507265696d616765040070016c70616c6c65745f707265696d6167653a3a486f6c64526561736f6e000e0020536166654d6f6465040074017070616c6c65745f736166655f6d6f64653a3a486f6c64526561736f6e00140024436f6e747261637473040078017070616c6c65745f636f6e7472616374733a3a486f6c64526561736f6e001d0000700c3c70616c6c65745f707265696d6167651870616c6c657428486f6c64526561736f6e00010420507265696d61676500000000740c4070616c6c65745f736166655f6d6f64651870616c6c657428486f6c64526561736f6e00010434456e7465724f72457874656e6400000000780c4070616c6c65745f636f6e7472616374731870616c6c657428486f6c64526561736f6e00010860436f646555706c6f61644465706f736974526573657276650000005453746f726167654465706f73697452657365727665000100007c0000026800800c4c626f756e6465645f636f6c6c656374696f6e732c626f756e6465645f76656328426f756e64656456656308045401840453000004008c01185665633c543e00008414346672616d655f737570706f72741874726169747318746f6b656e73106d697363204964416d6f756e740808496401881c42616c616e636501180008010869648801084964000118616d6f756e7418011c42616c616e636500008808586e6f64655f73756274656e736f725f72756e74696d654c52756e74696d65467265657a65526561736f6e000100008c0000028400081853797374656d011853797374656d041c4163636f756e7401010402000ce0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008004e8205468652066756c6c206163636f756e7420696e666f726d6174696f6e20666f72206120706172746963756c6172206163636f756e742049442e0000081c56657273696f6e347105386e6f64652d73756274656e736f72386e6f64652d73756274656e736f7201000000db0100000100000064df6acb689907609b0500000037e397fc7c91f5e40200000040fe3ad401f8959a06000000fbc577b9d747efd601000000d2bc9897eed08f1503000000f78b278be53f454c02000000dd718d5cc53262d401000000ab3c0572291feb8b01000000ed99c5acb25eedf503000000bc9d89904f5b923f0100000037c8bb1350a9a2a804000000f3ff14d5ab52705903000000582211f65bb14b8906000000e65b00e46cedd0aa0200000068b66ba122c93fa70200000042e62be4a39e5b6001000000806df4ccaa9ed485010000008375104b299b74c5020000005d1fbfbe852f280701000000c6886e2f8e598b0a0100000043580abff6baab4505000000c0de4984d112f3b401000000cbca25e39f14238702000000a8b093e6508d9e9c010000001c4585bd5c7072020100000001000000010484204765742074686520636861696e277320696e2d636f64652076657273696f6e2e285353353850726566697828082a0014a8205468652064657369676e61746564205353353820707265666978206f66207468697320636861696e2e0039012054686973207265706c6163657320746865202273733538466f726d6174222070726f7065727479206465636c6172656420696e2074686520636861696e20737065632e20526561736f6e20697331012074686174207468652072756e74696d652073686f756c64206b6e6f772061626f7574207468652070726566697820696e206f7264657220746f206d616b6520757365206f662069742061737020616e206964656e746966696572206f662074686520636861696e2e0000002042616c616e636573012042616c616e63657310144c6f636b73010104020048040010b820416e79206c6971756964697479206c6f636b73206f6e20736f6d65206163636f756e742062616c616e6365732e2501204e4f54453a2053686f756c64206f6e6c79206265206163636573736564207768656e2073657474696e672c206368616e67696e6720616e642066726565696e672061206c6f636b2e00ad0120557365206f66206c6f636b73206973206465707265636174656420696e206661766f7572206f6620667265657a65732e20536565206068747470733a2f2f6769746875622e636f6d2f706172697479746563682f7375627374726174652f70756c6c2f31323935312f6020526573657276657301010402005804000ca4204e616d6564207265736572766573206f6e20736f6d65206163636f756e742062616c616e6365732e00b10120557365206f66207265736572766573206973206465707265636174656420696e206661766f7572206f6620686f6c64732e20536565206068747470733a2f2f6769746875622e636f6d2f706172697479746563682f7375627374726174652f70756c6c2f31323935312f6014486f6c64730101040200640400046c20486f6c6473206f6e206163636f756e742062616c616e6365732e1c467265657a65730101040200800400048820467265657a65206c6f636b73206f6e206163636f756e742062616c616e6365732e000000000500040000000000c5010000000000",
|
|
8442
|
+
"extra": {
|
|
8443
|
+
"useLegacyTransferableCalculation": false,
|
|
8444
|
+
"existentialDeposit": "500"
|
|
8445
|
+
}
|
|
8446
|
+
},
|
|
8494
8447
|
{
|
|
8495
8448
|
"id": "f6968d187460262f60f1cf67a3fdc971",
|
|
8496
8449
|
"source": "substrate-assets",
|
|
@@ -8508,75 +8461,197 @@ var initChaindata_default = {
|
|
|
8508
8461
|
"version": "v14",
|
|
8509
8462
|
"data": null,
|
|
8510
8463
|
"extra": { "palletId": "Tokens" }
|
|
8511
|
-
},
|
|
8512
|
-
{
|
|
8513
|
-
"id": "fc37f3bb6c1b05596f4e9f74724ed12f",
|
|
8514
|
-
"source": "substrate-assets",
|
|
8515
|
-
"chainId": "bittensor",
|
|
8516
|
-
"specVersion": 470,
|
|
8517
|
-
"version": "v14",
|
|
8518
|
-
"data": null,
|
|
8519
|
-
"extra": null
|
|
8520
8464
|
}
|
|
8521
8465
|
]
|
|
8522
8466
|
};
|
|
8523
8467
|
//#endregion
|
|
8468
|
+
//#region src/state/validatedCache.ts
|
|
8469
|
+
/**
|
|
8470
|
+
* Validation results by input object, so the expensive validation (thousands of tokens)
|
|
8471
|
+
* runs at most ONCE per object instead of on every emission or resubscription.
|
|
8472
|
+
*
|
|
8473
|
+
* Safe because chaindata objects are immutable by convention in this package, and a valid
|
|
8474
|
+
* output maps to its own result: re-parsing already-parsed data is idempotent (defaults
|
|
8475
|
+
* filled, token key order already applied).
|
|
8476
|
+
*/
|
|
8477
|
+
const results = /* @__PURE__ */ new WeakMap();
|
|
8478
|
+
const validateChaindata = async (data, options) => {
|
|
8479
|
+
if (typeof data !== "object" || data === null) return parseChaindataFileChunked(data, options);
|
|
8480
|
+
const cached = results.get(data);
|
|
8481
|
+
if (cached) return cached;
|
|
8482
|
+
const result = await parseChaindataFileChunked(data, options);
|
|
8483
|
+
results.set(data, result);
|
|
8484
|
+
if (result.success) results.set(result.data, result);
|
|
8485
|
+
return result;
|
|
8486
|
+
};
|
|
8487
|
+
//#endregion
|
|
8488
|
+
//#region src/state/net.ts
|
|
8489
|
+
const getFallbackUrl = (url) => {
|
|
8490
|
+
if (url.startsWith("https://raw.githubusercontent.com/")) {
|
|
8491
|
+
const fallbackUrl = url.replace(/^https:\/\/raw\.githubusercontent\.com\/([^/]+)\/([^/]+)\//i, "https://cdn.jsdelivr.net/gh/$1/$2@");
|
|
8492
|
+
return fallbackUrl !== url ? fallbackUrl : null;
|
|
8493
|
+
}
|
|
8494
|
+
return null;
|
|
8495
|
+
};
|
|
8496
|
+
const fetchJson = async (url, { signal, validate, fallbackUrl } = {}) => {
|
|
8497
|
+
const req = await fetch(url, { signal });
|
|
8498
|
+
if (!req.ok) {
|
|
8499
|
+
if (fallbackUrl) return fetchJson(fallbackUrl, {
|
|
8500
|
+
validate,
|
|
8501
|
+
signal
|
|
8502
|
+
});
|
|
8503
|
+
throw new Error(`Failed to fetch from ${url}: ${req.status} ${req.statusText}`);
|
|
8504
|
+
}
|
|
8505
|
+
const data = await req.json();
|
|
8506
|
+
if (validate) {
|
|
8507
|
+
const start = performance.now();
|
|
8508
|
+
const result = await validate(data, signal);
|
|
8509
|
+
log_default.debug(`[ChaindataProvider] Validating downloaded ${url?.split("/").pop()} took ${performance.now() - start} ms`);
|
|
8510
|
+
if (!result.success) {
|
|
8511
|
+
log_default.error("Failed to parse data from", url, { error: result.error });
|
|
8512
|
+
throw new Error(`Schema validation failed for ${url}`);
|
|
8513
|
+
}
|
|
8514
|
+
return result.data;
|
|
8515
|
+
}
|
|
8516
|
+
return data;
|
|
8517
|
+
};
|
|
8518
|
+
const fetchChaindata = (url = DEFAULT_CHAINDATA_URL, signal) => fetchJson(url, {
|
|
8519
|
+
validate: (data, signal) => validateChaindata(data, { signal }),
|
|
8520
|
+
signal,
|
|
8521
|
+
fallbackUrl: url === DEFAULT_CHAINDATA_URL ? getFallbackUrl(url) : null
|
|
8522
|
+
});
|
|
8523
|
+
//#endregion
|
|
8524
|
+
//#region src/state/remoteChaindata.ts
|
|
8525
|
+
const REFRESH_INTERVAL = 3e5;
|
|
8526
|
+
const MIN_REFRESH_INTERVAL = 6e4;
|
|
8527
|
+
const remoteChaindataByUrl = /* @__PURE__ */ new Map();
|
|
8528
|
+
/**
|
|
8529
|
+
* Downloads the chaindata file at `url` and refreshes it every 5 minutes. Equivalent spellings
|
|
8530
|
+
* of a url share one observable. Throws if `url` is not a valid url.
|
|
8531
|
+
*
|
|
8532
|
+
* Emitted objects are shared and already validated: treat them as immutable, and filter them
|
|
8533
|
+
* by returning new objects.
|
|
8534
|
+
*/
|
|
8535
|
+
const getRemoteChaindata$ = (url) => {
|
|
8536
|
+
const href = parseChaindataUrl(url);
|
|
8537
|
+
const existing = remoteChaindataByUrl.get(href);
|
|
8538
|
+
if (existing) return existing;
|
|
8539
|
+
const remoteChaindata$ = createRemoteChaindata$(href);
|
|
8540
|
+
remoteChaindataByUrl.set(href, remoteChaindata$);
|
|
8541
|
+
return remoteChaindata$;
|
|
8542
|
+
};
|
|
8543
|
+
const parseChaindataUrl = (url) => {
|
|
8544
|
+
try {
|
|
8545
|
+
return new URL(url).href;
|
|
8546
|
+
} catch (cause) {
|
|
8547
|
+
throw new Error(`Invalid chaindata url: "${url}"`, { cause });
|
|
8548
|
+
}
|
|
8549
|
+
};
|
|
8550
|
+
const createRemoteChaindata$ = (url) => {
|
|
8551
|
+
let lastUpdatedAt = 0;
|
|
8552
|
+
let lastData = null;
|
|
8553
|
+
return new rxjs.Observable((subscriber) => {
|
|
8554
|
+
const controller = new AbortController();
|
|
8555
|
+
subscriber.add(() => controller.abort());
|
|
8556
|
+
let timeout = null;
|
|
8557
|
+
subscriber.add(() => timeout && clearTimeout(timeout));
|
|
8558
|
+
if (lastData && Date.now() < lastUpdatedAt + MIN_REFRESH_INTERVAL) subscriber.next(lastData);
|
|
8559
|
+
else lastData = null;
|
|
8560
|
+
const refresh = async () => {
|
|
8561
|
+
try {
|
|
8562
|
+
const delay = Math.max(0, lastUpdatedAt + MIN_REFRESH_INTERVAL - Date.now());
|
|
8563
|
+
if (delay > 0) await new Promise((resolve) => setTimeout(resolve, delay));
|
|
8564
|
+
if (controller.signal.aborted) return;
|
|
8565
|
+
log_default.debug("[remoteChaindata$] Refreshing chaindata from", url);
|
|
8566
|
+
const data = await fetchChaindata(url, controller.signal);
|
|
8567
|
+
lastUpdatedAt = Date.now();
|
|
8568
|
+
lastData = data;
|
|
8569
|
+
subscriber.next(data);
|
|
8570
|
+
} catch (error) {
|
|
8571
|
+
if ((0, _talismn_util.isAbortError)(error)) return;
|
|
8572
|
+
log_default.error("Failed to fetch chaindata", error);
|
|
8573
|
+
if (!subscriber.closed) subscriber.error(error);
|
|
8574
|
+
} finally {
|
|
8575
|
+
if (!controller.signal.aborted) timeout = setTimeout(refresh, REFRESH_INTERVAL);
|
|
8576
|
+
}
|
|
8577
|
+
};
|
|
8578
|
+
refresh();
|
|
8579
|
+
}).pipe((0, rxjs.shareReplay)({
|
|
8580
|
+
bufferSize: 1,
|
|
8581
|
+
refCount: true
|
|
8582
|
+
}));
|
|
8583
|
+
};
|
|
8584
|
+
//#endregion
|
|
8524
8585
|
//#region src/state/defaultChaindata.ts
|
|
8525
8586
|
const EMPTY_DATA = {
|
|
8526
8587
|
networks: [],
|
|
8527
8588
|
tokens: [],
|
|
8528
8589
|
miniMetadatas: []
|
|
8529
8590
|
};
|
|
8530
|
-
const
|
|
8531
|
-
|
|
8532
|
-
|
|
8591
|
+
const RETRY_BASE_DELAY = 3e4;
|
|
8592
|
+
const RETRY_MAX_DELAY = 3e5;
|
|
8593
|
+
const getRetryDelay = (retryCount) => Math.min(RETRY_BASE_DELAY * 2 ** (retryCount - 1), RETRY_MAX_DELAY);
|
|
8594
|
+
const validateProvidedChaindata = (providedChaindata$) => providedChaindata$.pipe((0, _talismn_util.switchMapChunked)(async (data, { slicer }) => {
|
|
8595
|
+
const validation = await validateChaindata(data, { slicer });
|
|
8596
|
+
if (!validation.success) {
|
|
8597
|
+
log_default.error("[defaultChaindata$] Invalid chaindata provided", { error: validation.error });
|
|
8598
|
+
return null;
|
|
8599
|
+
}
|
|
8600
|
+
return validation.data;
|
|
8601
|
+
}), (0, rxjs.filter)(_talismn_util.isNotNil), (0, rxjs.tap)({ error: (cause) => log_default.error("[defaultChaindata$] Provided chaindata failed", { cause }) }));
|
|
8602
|
+
const getDefaultChaindata$ = (storage$, providedChaindata$) => {
|
|
8533
8603
|
const storageValidated$ = storage$.pipe((0, _talismn_util.switchMapChunked)(async (data, { slicer }) => {
|
|
8534
|
-
if (isChaindataValidated(data)) return data;
|
|
8535
|
-
if (data === lastInput) return lastOutput;
|
|
8536
8604
|
const start = performance.now();
|
|
8537
|
-
const validation = await
|
|
8605
|
+
const validation = await validateChaindata(data, { slicer });
|
|
8538
8606
|
log_default.debug("[storageValidated$] Chaindata schema validation: %sms", (performance.now() - start).toFixed(2));
|
|
8539
|
-
if (
|
|
8540
|
-
|
|
8541
|
-
|
|
8542
|
-
return lastOutput;
|
|
8607
|
+
if (validation.success) return validation.data;
|
|
8608
|
+
log_default.warn("[storageValidated$] Chaindata schema validation failed", { error: validation.error });
|
|
8609
|
+
return EMPTY_DATA;
|
|
8543
8610
|
}), (0, rxjs.shareReplay)({
|
|
8544
8611
|
bufferSize: 1,
|
|
8545
8612
|
refCount: true
|
|
8546
8613
|
}));
|
|
8547
8614
|
return new rxjs.Observable((subscriber) => {
|
|
8548
|
-
const
|
|
8549
|
-
|
|
8550
|
-
|
|
8551
|
-
|
|
8552
|
-
|
|
8553
|
-
|
|
8554
|
-
|
|
8555
|
-
|
|
8556
|
-
log_default.error("[defaultChaindata$] initChaindata failed schema validation", { error: validation.error });
|
|
8557
|
-
return;
|
|
8558
|
-
}
|
|
8559
|
-
storage$.next(markChaindataValidated(validation.data));
|
|
8560
|
-
log_default.info("[defaultChaindata$] Initial chaindata file imported successfully");
|
|
8561
|
-
} catch (cause) {
|
|
8562
|
-
log_default.error("[defaultChaindata$] Failed to import initial chaindata file", { cause });
|
|
8615
|
+
const provisionInitialChaindata = async () => {
|
|
8616
|
+
const storageData = await (0, rxjs.firstValueFrom)(storageValidated$);
|
|
8617
|
+
if (storageData.networks.length || storageData.tokens.length || storageData.miniMetadatas.length) return log_default.info("[defaultChaindata$] DB is not empty, skipping initial data provision", storageData);
|
|
8618
|
+
try {
|
|
8619
|
+
log_default.info("[defaultChaindata$] Importing initial chaindata file");
|
|
8620
|
+
const validation = await validateChaindata(initChaindata_default);
|
|
8621
|
+
if (!validation.success) {
|
|
8622
|
+
log_default.error("[defaultChaindata$] initChaindata failed schema validation", { error: validation.error });
|
|
8563
8623
|
return;
|
|
8564
8624
|
}
|
|
8565
|
-
|
|
8566
|
-
|
|
8567
|
-
|
|
8568
|
-
|
|
8569
|
-
|
|
8570
|
-
if (!!await chaindataEqualWithYield(storageData, githubData)) return log_default.debug(`[defaultChaindata$] No db updates needed: ${performance.now() - now}ms`);
|
|
8571
|
-
log_default.debug(`[defaultChaindata$] Updating chaindata in DB (networks:${githubData.networks.length}, tokens:${githubData.tokens.length}, meta:${githubData.miniMetadatas.length})`);
|
|
8572
|
-
storage$.next(githubData);
|
|
8573
|
-
log_default.info(`[defaultChaindata$] Db synchronized with GitHub :${performance.now() - now}ms`);
|
|
8574
|
-
} catch (cause) {
|
|
8575
|
-
log_default.error("[defaultChaindata$] Failed to sync chaindata", { cause });
|
|
8576
|
-
}
|
|
8625
|
+
storage$.next(validation.data);
|
|
8626
|
+
log_default.info("[defaultChaindata$] Initial chaindata file imported successfully");
|
|
8627
|
+
} catch (cause) {
|
|
8628
|
+
log_default.error("[defaultChaindata$] Failed to import initial chaindata file", { cause });
|
|
8629
|
+
return;
|
|
8577
8630
|
}
|
|
8578
|
-
}
|
|
8579
|
-
|
|
8631
|
+
};
|
|
8632
|
+
const getStorageUpdate = async (sourceData, { slicer }) => {
|
|
8633
|
+
const now = performance.now();
|
|
8634
|
+
try {
|
|
8635
|
+
const storageData = await (0, rxjs.firstValueFrom)(storageValidated$);
|
|
8636
|
+
if (!await chaindataEqualWithYield(storageData, sourceData, { slicer })) return sourceData;
|
|
8637
|
+
log_default.debug(`[defaultChaindata$] No db updates needed: ${performance.now() - now}ms`);
|
|
8638
|
+
return null;
|
|
8639
|
+
} catch (cause) {
|
|
8640
|
+
if ((0, _talismn_util.isAbortError)(cause)) throw cause;
|
|
8641
|
+
log_default.error("[defaultChaindata$] Failed to sync chaindata", { cause });
|
|
8642
|
+
return null;
|
|
8643
|
+
}
|
|
8644
|
+
};
|
|
8645
|
+
const writeToStorage = (sourceData) => {
|
|
8646
|
+
log_default.debug(`[defaultChaindata$] Updating chaindata in DB (networks:${sourceData.networks.length}, tokens:${sourceData.tokens.length}, meta:${sourceData.miniMetadatas.length})`);
|
|
8647
|
+
storage$.next(sourceData);
|
|
8648
|
+
log_default.info("[defaultChaindata$] Db synchronized with chaindata source");
|
|
8649
|
+
};
|
|
8650
|
+
const sourceToStorageSubscription = (providedChaindata$ ? validateProvidedChaindata(providedChaindata$) : getRemoteChaindata$(DEFAULT_CHAINDATA_URL).pipe((0, rxjs.tap)({ error: provisionInitialChaindata }))).pipe((0, rxjs.retry)({
|
|
8651
|
+
delay: (_, retryCount) => (0, rxjs.timer)(getRetryDelay(retryCount)),
|
|
8652
|
+
resetOnSuccess: true
|
|
8653
|
+
}), (0, _talismn_util.switchMapChunked)(getStorageUpdate), (0, rxjs.filter)(_talismn_util.isNotNil)).subscribe(writeToStorage);
|
|
8654
|
+
subscriber.add(sourceToStorageSubscription);
|
|
8580
8655
|
const outputFromStorageSubscription = storageValidated$.subscribe(subscriber);
|
|
8581
8656
|
subscriber.add(outputFromStorageSubscription);
|
|
8582
8657
|
}).pipe((0, rxjs.shareReplay)({
|
|
@@ -8604,7 +8679,7 @@ var ChaindataProvider = class {
|
|
|
8604
8679
|
#chaindata$;
|
|
8605
8680
|
#dynamicTokens$;
|
|
8606
8681
|
#dynamicTokensWriteQueue = Promise.resolve();
|
|
8607
|
-
constructor({ persistedStorage, customChaindata$, dynamicTokens$ } = {}) {
|
|
8682
|
+
constructor({ persistedStorage, customChaindata$, dynamicTokens$, chaindata$ } = {}) {
|
|
8608
8683
|
tryToDeleteOldChaindataDb();
|
|
8609
8684
|
const mergedStorage = (0, _talismn_util.isPromise)(persistedStorage) ? persistedStorage.then((storage) => ({
|
|
8610
8685
|
...DEFAULT_STORAGE,
|
|
@@ -8614,7 +8689,8 @@ var ChaindataProvider = class {
|
|
|
8614
8689
|
...persistedStorage
|
|
8615
8690
|
};
|
|
8616
8691
|
this.#storage$ = (0, _talismn_util.replaySubjectFrom)(mergedStorage);
|
|
8617
|
-
const
|
|
8692
|
+
const providedChaindata$ = chaindata$ && ((0, rxjs.isObservable)(chaindata$) ? chaindata$ : (0, rxjs.of)(chaindata$));
|
|
8693
|
+
const defaultChaindata$ = getDefaultChaindata$(this.#storage$, providedChaindata$);
|
|
8618
8694
|
this.#dynamicTokens$ = (0, _talismn_util.replaySubjectFrom)(dynamicTokens$ ?? []);
|
|
8619
8695
|
this.#chaindata$ = getCombinedChaindata$(defaultChaindata$, customChaindata$, this.#dynamicTokens$);
|
|
8620
8696
|
}
|
|
@@ -8885,6 +8961,7 @@ exports.AnyMiniMetadataSchema = AnyMiniMetadataSchema;
|
|
|
8885
8961
|
exports.ChaindataFileSchema = ChaindataFileSchema;
|
|
8886
8962
|
exports.ChaindataProvider = ChaindataProvider;
|
|
8887
8963
|
exports.CustomChaindataSchema = CustomChaindataSchema;
|
|
8964
|
+
exports.DEFAULT_CHAINDATA_URL = DEFAULT_CHAINDATA_URL;
|
|
8888
8965
|
exports.DotNetworkBalancesConfigSchema = DotNetworkBalancesConfigSchema;
|
|
8889
8966
|
exports.DotNetworkSchema = DotNetworkSchema;
|
|
8890
8967
|
exports.DotNetworkTopologySchema = DotNetworkTopologySchema;
|
|
@@ -8942,6 +9019,7 @@ exports.getGithubBittensorHotkeyAssetUrl = getGithubBittensorHotkeyAssetUrl;
|
|
|
8942
9019
|
exports.getGithubTokenLogoUrl = getGithubTokenLogoUrl;
|
|
8943
9020
|
exports.getGithubTokenLogoUrlByCoingeckoId = getGithubTokenLogoUrlByCoingeckoId;
|
|
8944
9021
|
exports.getNetworkGenesisHash = getNetworkGenesisHash;
|
|
9022
|
+
exports.getRemoteChaindata$ = getRemoteChaindata$;
|
|
8945
9023
|
exports.isAccountPlatformCompatibleWithNetwork = isAccountPlatformCompatibleWithNetwork;
|
|
8946
9024
|
exports.isNativeToken = isNativeToken;
|
|
8947
9025
|
exports.isNativeTokenType = isNativeTokenType;
|