@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.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { assign, isEqual, keyBy, uniq, values } from "lodash-es";
|
|
|
4
4
|
import anylogger from "anylogger";
|
|
5
5
|
import { Dexie } from "dexie";
|
|
6
6
|
import { arrayItemsEqualWithYield, createTimeSlicer, forEachWithYield, isAbortError, isNotNil, isPromise, keyByWithYield, mapWithYield, replaySubjectFrom, switchMapChunked, validateArrayWithYield } from "@talismn/util";
|
|
7
|
-
import { Observable, combineLatest, distinctUntilChanged, distinctUntilKeyChanged, firstValueFrom, isObservable, map, of, shareReplay } from "rxjs";
|
|
7
|
+
import { Observable, combineLatest, distinctUntilChanged, distinctUntilKeyChanged, filter, firstValueFrom, isObservable, map, of, retry, shareReplay, tap, timer } from "rxjs";
|
|
8
8
|
//#region src/chaindata/shared/EthereumAddress.ts
|
|
9
9
|
const EthereumAddressSchema = z.string().regex(/^0x[a-fA-F0-9]{40}$/, { message: "Invalid Ethereum address" }).transform((val) => val);
|
|
10
10
|
//#endregion
|
|
@@ -601,7 +601,7 @@ const githubChaindataRepo = "chaindata";
|
|
|
601
601
|
const githubChaindataBranch = CHAINDATA_BRANCH;
|
|
602
602
|
const githubChaindataDistDir = CHAINDATA_PUB_FOLDER;
|
|
603
603
|
const githubChaindataBaseUrl = `${githubCdn}/${githubChaindataOrg}/${githubChaindataRepo}/${githubChaindataBranch}`;
|
|
604
|
-
const
|
|
604
|
+
const DEFAULT_CHAINDATA_URL = `${`${githubChaindataBaseUrl}/${githubChaindataDistDir}`}/chaindata.min.json`;
|
|
605
605
|
const githubChaindataTokensAssetsDir = "assets/tokens";
|
|
606
606
|
//#endregion
|
|
607
607
|
//#region src/getBlockExplorerUrls.ts
|
|
@@ -1056,94 +1056,6 @@ const getCleanToken = (token) => {
|
|
|
1056
1056
|
return rest;
|
|
1057
1057
|
};
|
|
1058
1058
|
//#endregion
|
|
1059
|
-
//#region src/state/validatedCache.ts
|
|
1060
|
-
/**
|
|
1061
|
-
* Tracks objects that have already passed chaindata schema validation, so the expensive
|
|
1062
|
-
* validation (thousands of tokens) runs at most ONCE per object instead of on every
|
|
1063
|
-
* emission through the pipeline.
|
|
1064
|
-
*
|
|
1065
|
-
* Safe because parse output is immutable-by-convention in this package, and re-parsing
|
|
1066
|
-
* already-parsed data is idempotent (defaults filled, token key order already applied).
|
|
1067
|
-
*/
|
|
1068
|
-
const validated = /* @__PURE__ */ new WeakSet();
|
|
1069
|
-
const markChaindataValidated = (data) => {
|
|
1070
|
-
validated.add(data);
|
|
1071
|
-
return data;
|
|
1072
|
-
};
|
|
1073
|
-
const isChaindataValidated = (data) => typeof data === "object" && data !== null && validated.has(data);
|
|
1074
|
-
//#endregion
|
|
1075
|
-
//#region src/state/net.ts
|
|
1076
|
-
const CHAINDATA_CONSOLIDATED_URL = `${githubChaindataDistUrl}/chaindata.min.json`;
|
|
1077
|
-
const getFallbackUrl = (url) => {
|
|
1078
|
-
if (url.startsWith("https://raw.githubusercontent.com/")) {
|
|
1079
|
-
const fallbackUrl = url.replace(/^https:\/\/raw\.githubusercontent\.com\/([^/]+)\/([^/]+)\//i, "https://cdn.jsdelivr.net/gh/$1/$2@");
|
|
1080
|
-
return fallbackUrl !== url ? fallbackUrl : null;
|
|
1081
|
-
}
|
|
1082
|
-
return null;
|
|
1083
|
-
};
|
|
1084
|
-
const fetchJsonFromGithubUrl = async (url, { signal, validate } = {}) => {
|
|
1085
|
-
const req = await fetch(url, { signal });
|
|
1086
|
-
if (!req.ok) {
|
|
1087
|
-
const fallbackUrl = getFallbackUrl(url);
|
|
1088
|
-
if (fallbackUrl) return fetchJsonFromGithubUrl(fallbackUrl, {
|
|
1089
|
-
validate,
|
|
1090
|
-
signal
|
|
1091
|
-
});
|
|
1092
|
-
throw new Error(`Failed to fetch from ${url}: ${req.status} ${req.statusText}`);
|
|
1093
|
-
}
|
|
1094
|
-
const data = await req.json();
|
|
1095
|
-
if (validate) {
|
|
1096
|
-
const start = performance.now();
|
|
1097
|
-
const result = await validate(data, signal);
|
|
1098
|
-
log_default.debug(`[ChaindataProvider] Validating downloaded ${url?.split("/").pop()} took ${performance.now() - start} ms`);
|
|
1099
|
-
if (!result.success) {
|
|
1100
|
-
log_default.error("Failed to parse data from", url, { error: result.error });
|
|
1101
|
-
throw new Error(`Schema validation failed for ${url}`);
|
|
1102
|
-
}
|
|
1103
|
-
return result.data;
|
|
1104
|
-
}
|
|
1105
|
-
return data;
|
|
1106
|
-
};
|
|
1107
|
-
const fetchChaindata = (signal) => fetchJsonFromGithubUrl(CHAINDATA_CONSOLIDATED_URL, {
|
|
1108
|
-
validate: async (data, signal) => {
|
|
1109
|
-
const result = await parseChaindataFileChunked(data, { signal });
|
|
1110
|
-
if (result.success) markChaindataValidated(result.data);
|
|
1111
|
-
return result;
|
|
1112
|
-
},
|
|
1113
|
-
signal
|
|
1114
|
-
});
|
|
1115
|
-
//#endregion
|
|
1116
|
-
//#region src/state/githubChaindata.ts
|
|
1117
|
-
const REFRESH_INTERVAL = 3e5;
|
|
1118
|
-
let lastUpdatedAt = 0;
|
|
1119
|
-
const githubChaindata$ = new Observable((subscriber) => {
|
|
1120
|
-
const controller = new AbortController();
|
|
1121
|
-
subscriber.add(() => controller.abort());
|
|
1122
|
-
let timeout = null;
|
|
1123
|
-
subscriber.add(() => timeout && clearTimeout(timeout));
|
|
1124
|
-
const refresh = async () => {
|
|
1125
|
-
try {
|
|
1126
|
-
const delay = Math.max(0, lastUpdatedAt + 6e4 - Date.now());
|
|
1127
|
-
if (delay > 0) await new Promise((resolve) => setTimeout(resolve, delay));
|
|
1128
|
-
if (controller.signal.aborted) return;
|
|
1129
|
-
log_default.debug("[defaultChaindata$] Refreshing chaindata from GitHub");
|
|
1130
|
-
const data = await fetchChaindata(controller.signal);
|
|
1131
|
-
lastUpdatedAt = Date.now();
|
|
1132
|
-
subscriber.next(data);
|
|
1133
|
-
} catch (error) {
|
|
1134
|
-
if (isAbortError(error)) return;
|
|
1135
|
-
log_default.error("Failed to fetch chaindata", error);
|
|
1136
|
-
if (!subscriber.closed) subscriber.error(error);
|
|
1137
|
-
} finally {
|
|
1138
|
-
if (!controller.signal.aborted) timeout = setTimeout(refresh, REFRESH_INTERVAL);
|
|
1139
|
-
}
|
|
1140
|
-
};
|
|
1141
|
-
refresh();
|
|
1142
|
-
}).pipe(shareReplay({
|
|
1143
|
-
bufferSize: 1,
|
|
1144
|
-
refCount: true
|
|
1145
|
-
}));
|
|
1146
|
-
//#endregion
|
|
1147
1059
|
//#region src/state/initChaindata.json
|
|
1148
1060
|
var initChaindata_default = {
|
|
1149
1061
|
networks: [
|
|
@@ -1164,11 +1076,11 @@ var initChaindata_default = {
|
|
|
1164
1076
|
"blockExplorerUrls": ["https://etherscan.io"],
|
|
1165
1077
|
"platform": "ethereum",
|
|
1166
1078
|
"rpcs": [
|
|
1167
|
-
"https://ethereum-rpc.publicnode.com",
|
|
1168
1079
|
"https://mempool.merkle.io/rpc/eth/pk_mbs_1412a7392bd47753ca2b4bb3d123f6a1",
|
|
1080
|
+
"https://ethereum-rpc.publicnode.com",
|
|
1081
|
+
"https://xrpc.cl/eth",
|
|
1169
1082
|
"https://one.valve.city/rpc/vk_demo/evm/1",
|
|
1170
|
-
"https://public.1rpc.io/eth"
|
|
1171
|
-
"https://rpc.mevblocker.io"
|
|
1083
|
+
"https://public.1rpc.io/eth"
|
|
1172
1084
|
],
|
|
1173
1085
|
"feeType": "eip-1559",
|
|
1174
1086
|
"contracts": {
|
|
@@ -1227,7 +1139,7 @@ var initChaindata_default = {
|
|
|
1227
1139
|
"https://bsc-dataseed2.binance.org",
|
|
1228
1140
|
"https://bsc-dataseed3.binance.org",
|
|
1229
1141
|
"https://bsc-dataseed4.binance.org",
|
|
1230
|
-
"https://
|
|
1142
|
+
"https://xrpc.cl/bsc"
|
|
1231
1143
|
],
|
|
1232
1144
|
"contracts": {
|
|
1233
1145
|
"Erc20Aggregator": "0x21741D68121db79Fd1e9eA34028D3B2e87056DBd",
|
|
@@ -1252,10 +1164,10 @@ var initChaindata_default = {
|
|
|
1252
1164
|
"platform": "ethereum",
|
|
1253
1165
|
"rpcs": [
|
|
1254
1166
|
"https://mempool.merkle.io/rpc/polygon/pk_mbs_1412a7392bd47753ca2b4bb3d123f6a1",
|
|
1167
|
+
"https://xrpc.cl/polygon",
|
|
1255
1168
|
"https://public.1rpc.io/matic",
|
|
1256
1169
|
"https://polygon-bor-rpc.publicnode.com",
|
|
1257
|
-
"https://polygon.drpc.org"
|
|
1258
|
-
"https://poly.api.pocket.network"
|
|
1170
|
+
"https://polygon.drpc.org"
|
|
1259
1171
|
],
|
|
1260
1172
|
"contracts": {
|
|
1261
1173
|
"Erc20Aggregator": "0xb1EFd1407104Cf00F7b9983C1Fa474A2702B5874",
|
|
@@ -1311,8 +1223,8 @@ var initChaindata_default = {
|
|
|
1311
1223
|
"https://mempool.merkle.io/rpc/base/pk_mbs_1412a7392bd47753ca2b4bb3d123f6a1",
|
|
1312
1224
|
"https://base.publicnode.com",
|
|
1313
1225
|
"https://developer-access-mainnet.base.org/",
|
|
1314
|
-
"https://
|
|
1315
|
-
"https://
|
|
1226
|
+
"https://xrpc.cl/base",
|
|
1227
|
+
"https://public.1rpc.io/base"
|
|
1316
1228
|
],
|
|
1317
1229
|
"feeType": "eip-1559",
|
|
1318
1230
|
"l2FeeType": { "type": "op-stack" },
|
|
@@ -1338,11 +1250,11 @@ var initChaindata_default = {
|
|
|
1338
1250
|
"blockExplorerUrls": ["https://arbiscan.io/"],
|
|
1339
1251
|
"platform": "ethereum",
|
|
1340
1252
|
"rpcs": [
|
|
1341
|
-
"https://mempool.merkle.io/rpc/arbitrum/pk_mbs_1412a7392bd47753ca2b4bb3d123f6a1",
|
|
1342
1253
|
"https://arb1.arbitrum.io/rpc",
|
|
1254
|
+
"https://mempool.merkle.io/rpc/arbitrum/pk_mbs_1412a7392bd47753ca2b4bb3d123f6a1",
|
|
1255
|
+
"https://xrpc.cl/arbitrum",
|
|
1343
1256
|
"https://public.1rpc.io/arb",
|
|
1344
|
-
"https://arbitrum-one-rpc.publicnode.com"
|
|
1345
|
-
"https://arbitrum.meowrpc.com"
|
|
1257
|
+
"https://arbitrum-one-rpc.publicnode.com"
|
|
1346
1258
|
],
|
|
1347
1259
|
"contracts": {
|
|
1348
1260
|
"Erc20Aggregator": "0x180c2f0A65788258524Ab1e5c3c398EC46211b89",
|
|
@@ -1401,7 +1313,7 @@ var initChaindata_default = {
|
|
|
1401
1313
|
"platform": "polkadot",
|
|
1402
1314
|
"chainName": "Bittensor",
|
|
1403
1315
|
"specName": "node-subtensor",
|
|
1404
|
-
"specVersion":
|
|
1316
|
+
"specVersion": 475,
|
|
1405
1317
|
"account": "*25519",
|
|
1406
1318
|
"chainspecQrUrl": "https://metadata.novasama.io/qr/node-subtensor_specs.png",
|
|
1407
1319
|
"latestMetadataQrUrl": "https://metadata.novasama.io/qr/node-subtensor_metadata_latest.apng",
|
|
@@ -1442,10 +1354,10 @@ var initChaindata_default = {
|
|
|
1442
1354
|
"oldPrefix": 63,
|
|
1443
1355
|
"rpcs": [
|
|
1444
1356
|
"wss://hydration-rpc.n.dwellir.com",
|
|
1357
|
+
"wss://hydration.rotko.net",
|
|
1445
1358
|
"wss://subway.sin.hydration.cloud",
|
|
1446
1359
|
"wss://subway.coke.hydration.cloud",
|
|
1447
|
-
"wss://rpc.kril.hydration.cloud"
|
|
1448
|
-
"wss://rpc-catfish-1.catfish.hydration.cloud"
|
|
1360
|
+
"wss://rpc.kril.hydration.cloud"
|
|
1449
1361
|
],
|
|
1450
1362
|
"hasCheckMetadataHash": true,
|
|
1451
1363
|
"isUnknownFeeToken": true,
|
|
@@ -2892,12 +2804,12 @@ var initChaindata_default = {
|
|
|
2892
2804
|
"type": "substrate-dtao",
|
|
2893
2805
|
"symbol": "Ա",
|
|
2894
2806
|
"decimals": 9,
|
|
2895
|
-
"name": "SN103 |
|
|
2807
|
+
"name": "SN103 | Deprecated Ա",
|
|
2896
2808
|
"coingeckoId": "happyai-2",
|
|
2897
|
-
"logo": "https://raw.githubusercontent.com/TalismanSociety/chaindata/main/assets/tokens/
|
|
2809
|
+
"logo": "https://raw.githubusercontent.com/TalismanSociety/chaindata/main/assets/tokens/coingecko/happyai-2.webp",
|
|
2898
2810
|
"isDefault": true,
|
|
2899
2811
|
"netuid": 103,
|
|
2900
|
-
"subnetName": "
|
|
2812
|
+
"subnetName": "Deprecated",
|
|
2901
2813
|
"isTransferable": true
|
|
2902
2814
|
},
|
|
2903
2815
|
{
|
|
@@ -3102,12 +3014,12 @@ var initChaindata_default = {
|
|
|
3102
3014
|
"type": "substrate-dtao",
|
|
3103
3015
|
"symbol": "ъ",
|
|
3104
3016
|
"decimals": 9,
|
|
3105
|
-
"name": "SN116 |
|
|
3017
|
+
"name": "SN116 | Carbon ъ",
|
|
3106
3018
|
"coingeckoId": "solmev",
|
|
3107
|
-
"logo": "https://raw.githubusercontent.com/TalismanSociety/chaindata/main/assets/tokens/
|
|
3019
|
+
"logo": "https://raw.githubusercontent.com/TalismanSociety/chaindata/main/assets/tokens/dtao/bittensor-sn116-665ce7b0.webp",
|
|
3108
3020
|
"isDefault": true,
|
|
3109
3021
|
"netuid": 116,
|
|
3110
|
-
"subnetName": "
|
|
3022
|
+
"subnetName": "Carbon",
|
|
3111
3023
|
"isTransferable": true
|
|
3112
3024
|
},
|
|
3113
3025
|
{
|
|
@@ -4047,12 +3959,12 @@ var initChaindata_default = {
|
|
|
4047
3959
|
"type": "substrate-dtao",
|
|
4048
3960
|
"symbol": "خ",
|
|
4049
3961
|
"decimals": 9,
|
|
4050
|
-
"name": "SN58 |
|
|
3962
|
+
"name": "SN58 | Attune خ",
|
|
4051
3963
|
"coingeckoId": "dippy-speech",
|
|
4052
|
-
"logo": "https://raw.githubusercontent.com/TalismanSociety/chaindata/main/assets/tokens/
|
|
3964
|
+
"logo": "https://raw.githubusercontent.com/TalismanSociety/chaindata/main/assets/tokens/dtao/bittensor-sn58-72a691bd.webp",
|
|
4053
3965
|
"isDefault": true,
|
|
4054
3966
|
"netuid": 58,
|
|
4055
|
-
"subnetName": "",
|
|
3967
|
+
"subnetName": "Attune",
|
|
4056
3968
|
"isTransferable": true
|
|
4057
3969
|
},
|
|
4058
3970
|
{
|
|
@@ -4348,7 +4260,7 @@ var initChaindata_default = {
|
|
|
4348
4260
|
"decimals": 9,
|
|
4349
4261
|
"name": "SN76 | Ormas ن",
|
|
4350
4262
|
"coingeckoId": "safe-scan",
|
|
4351
|
-
"logo": "https://raw.githubusercontent.com/TalismanSociety/chaindata/main/assets/tokens/dtao/bittensor-sn76-
|
|
4263
|
+
"logo": "https://raw.githubusercontent.com/TalismanSociety/chaindata/main/assets/tokens/dtao/bittensor-sn76-b912954f.webp",
|
|
4352
4264
|
"isDefault": true,
|
|
4353
4265
|
"netuid": 76,
|
|
4354
4266
|
"subnetName": "Ormas",
|
|
@@ -5263,7 +5175,7 @@ var initChaindata_default = {
|
|
|
5263
5175
|
"type": "substrate-hydration",
|
|
5264
5176
|
"symbol": "HYPE",
|
|
5265
5177
|
"decimals": 18,
|
|
5266
|
-
"name": "Hyperliquid
|
|
5178
|
+
"name": "Hyperliquid",
|
|
5267
5179
|
"isDefault": true,
|
|
5268
5180
|
"onChainId": 1001355,
|
|
5269
5181
|
"assetType": "Token",
|
|
@@ -5277,7 +5189,7 @@ var initChaindata_default = {
|
|
|
5277
5189
|
"type": "substrate-hydration",
|
|
5278
5190
|
"symbol": "SPY",
|
|
5279
5191
|
"decimals": 18,
|
|
5280
|
-
"name": "SPY
|
|
5192
|
+
"name": "SPY",
|
|
5281
5193
|
"isDefault": true,
|
|
5282
5194
|
"onChainId": 1001356,
|
|
5283
5195
|
"assetType": "Token",
|
|
@@ -6807,6 +6719,22 @@ var initChaindata_default = {
|
|
|
6807
6719
|
"isSufficient": false,
|
|
6808
6720
|
"existentialDeposit": "1"
|
|
6809
6721
|
},
|
|
6722
|
+
{
|
|
6723
|
+
"id": "polkadot-asset-hub:substrate-assets:7873",
|
|
6724
|
+
"platform": "polkadot",
|
|
6725
|
+
"networkId": "polkadot-asset-hub",
|
|
6726
|
+
"type": "substrate-assets",
|
|
6727
|
+
"symbol": "dotUSD",
|
|
6728
|
+
"decimals": 6,
|
|
6729
|
+
"name": "dotUSD",
|
|
6730
|
+
"coingeckoId": "dotusd",
|
|
6731
|
+
"logo": "https://raw.githubusercontent.com/TalismanSociety/chaindata/main/assets/tokens/dotusd.svg",
|
|
6732
|
+
"isDefault": true,
|
|
6733
|
+
"assetId": "7873",
|
|
6734
|
+
"isFrozen": false,
|
|
6735
|
+
"isSufficient": true,
|
|
6736
|
+
"existentialDeposit": "10000"
|
|
6737
|
+
},
|
|
6810
6738
|
{
|
|
6811
6739
|
"id": "polkadot-asset-hub:substrate-foreignassets:N4IgDghgTgpgdgFwM4gFwCYA0ICWiZQ4D2UaoCAnmDGiABoCMI2AbhADYCuNq5VPIAOLsiAIw4BhInCTwknFKw7cyIStVoBpBRAC2EEAF9jhoA",
|
|
6812
6740
|
"platform": "polkadot",
|
|
@@ -6996,6 +6924,22 @@ var initChaindata_default = {
|
|
|
6996
6924
|
"isSufficient": false,
|
|
6997
6925
|
"existentialDeposit": "1"
|
|
6998
6926
|
},
|
|
6927
|
+
{
|
|
6928
|
+
"id": "polkadot-asset-hub:substrate-foreignassets:N4IgDghgTgpgdgFwM4gFwCYA0ICWiZQ4D2UaoCAnmDGiABrojYBuEANgK42oDa5V3EAHE2RAEbsAwkThJ4SDihbsuZEJWq0AoggAWBGBwC2TEK07dQAY10Q8AfRwATWmJwBzPAlQBGEAF9AzH5NVBAAQSsrIg5EAGkYCnQABlNzVVRQAGtE2mSADx8ICRgIHwAzAHYrAA4AZmSxJxqATggogDZKmCsAFghygFYfDvQa3rEfMSs6uqsA-wBdQKA",
|
|
6929
|
+
"platform": "polkadot",
|
|
6930
|
+
"networkId": "polkadot-asset-hub",
|
|
6931
|
+
"type": "substrate-foreignassets",
|
|
6932
|
+
"symbol": "EURC.e",
|
|
6933
|
+
"decimals": 6,
|
|
6934
|
+
"name": "Euro Coin",
|
|
6935
|
+
"coingeckoId": "euro-coin",
|
|
6936
|
+
"logo": "https://raw.githubusercontent.com/TalismanSociety/chaindata/main/assets/tokens/coingecko/euro-coin.webp",
|
|
6937
|
+
"isDefault": true,
|
|
6938
|
+
"onChainId": "{\"parents\":2,\"interior\":{\"type\":\"X2\",\"value\":[{\"type\":\"GlobalConsensus\",\"value\":{\"type\":\"Ethereum\",\"value\":{\"chain_id\":\"bigint:1\"}}},{\"type\":\"AccountKey20\",\"value\":{\"key\":\"0x1abaea1f7c830bd89acc67ec4af516284b1bc33c\"}}]}}",
|
|
6939
|
+
"isFrozen": false,
|
|
6940
|
+
"isSufficient": false,
|
|
6941
|
+
"existentialDeposit": "1"
|
|
6942
|
+
},
|
|
6999
6943
|
{
|
|
7000
6944
|
"id": "polkadot-asset-hub:substrate-foreignassets:N4IgDghgTgpgdgFwM4gFwCYA0ICWiZQ4D2UaoCAnmDGiABrojYBuEANgK42oDa5V3EAHE2RAEbsAwkThJ4SDihbsuZEJWq0AoggAWBGBwC2TEK07dQAY10Q8AfRwATWmJwBzPAlQBGEAF9AzH5NVBAAQSsrIg5EAGkYCnQABlNzVVRQAGtE2mSADycIKx8AdgAzAE4AVgAOJ3QYGGr0AGYIdBSANm7KyoAWasrSktanWtafGCtSgP8AXUCgA",
|
|
7001
6945
|
"platform": "polkadot",
|
|
@@ -8063,10 +8007,10 @@ var initChaindata_default = {
|
|
|
8063
8007
|
"extra": null
|
|
8064
8008
|
},
|
|
8065
8009
|
{
|
|
8066
|
-
"id": "
|
|
8067
|
-
"source": "substrate-
|
|
8010
|
+
"id": "1f2fdda5a53e0abbfade7f61c63b384c",
|
|
8011
|
+
"source": "substrate-assets",
|
|
8068
8012
|
"chainId": "bittensor",
|
|
8069
|
-
"specVersion":
|
|
8013
|
+
"specVersion": 475,
|
|
8070
8014
|
"version": "v14",
|
|
8071
8015
|
"data": null,
|
|
8072
8016
|
"extra": null
|
|
@@ -8196,15 +8140,6 @@ var initChaindata_default = {
|
|
|
8196
8140
|
"data": null,
|
|
8197
8141
|
"extra": { "palletId": "Tokens" }
|
|
8198
8142
|
},
|
|
8199
|
-
{
|
|
8200
|
-
"id": "60ebcec9b613f320c394eea4a77946cf",
|
|
8201
|
-
"source": "substrate-tokens",
|
|
8202
|
-
"chainId": "bittensor",
|
|
8203
|
-
"specVersion": 470,
|
|
8204
|
-
"version": "v14",
|
|
8205
|
-
"data": null,
|
|
8206
|
-
"extra": { "palletId": "Tokens" }
|
|
8207
|
-
},
|
|
8208
8143
|
{
|
|
8209
8144
|
"id": "643c414b19bf92a482edaa24978fdbdd",
|
|
8210
8145
|
"source": "substrate-dtao",
|
|
@@ -8223,15 +8158,6 @@ var initChaindata_default = {
|
|
|
8223
8158
|
"data": "0x6d6574610f48000c1c73705f636f72651863727970746f2c4163636f756e7449643332000004000401205b75383b2033325d0000040000032000000008000800000503000c00000208001000000505001400000507001800000500001c04184f7074696f6e04045401140108104e6f6e6500000010536f6d6504001400000100002004184f7074696f6e04045401240108104e6f6e6500000010536f6d650400240000010000240c4c626f756e6465645f636f6c6c656374696f6e732c626f756e6465645f76656328426f756e64656456656308045401080453000004000c01185665633c543e0000280c5470616c6c65745f61737365745f72656769737472791474797065732441737365745479706500011814546f6b656e0000000c58594b00010028537461626c655377617000020010426f6e640003002045787465726e616c000400144572633230000500002c04184f7074696f6e04045401080108104e6f6e6500000010536f6d650400080000010000300c5470616c6c65745f61737365745f726567697374727914747970657330417373657444657461696c73042c537472696e674c696d697400001c01106e616d652001644f7074696f6e3c4e616d653c537472696e674c696d69743e3e00012861737365745f7479706528012441737365745479706500014c6578697374656e7469616c5f6465706f73697414011c42616c616e636500011873796d626f6c20016c4f7074696f6e3c53796d626f6c3c537472696e674c696d69743e3e000120646563696d616c732c01284f7074696f6e3c75383e00013878636d5f726174655f6c696d69741c013c4f7074696f6e3c42616c616e63653e00013469735f73756666696369656e74180110626f6f6c0000340000040800100038082c6f726d6c5f746f6b656e732c4163636f756e7444617461041c42616c616e63650114000c01106672656514011c42616c616e6365000120726573657276656414011c42616c616e636500011866726f7a656e14011c42616c616e636500003c088470616c6c65745f63757272656e636965735f7270635f72756e74696d655f6170692c4163636f756e7444617461041c42616c616e63650114000c01106672656514011c42616c616e6365000120726573657276656414011c42616c616e636500011866726f7a656e14011c42616c616e636500004000000244004400000408103c000834417373657452656769737472790134417373657452656769737472790418417373657473000104021030040004542044657461696c73206f6620616e2061737365742e00000000330018546f6b656e730118546f6b656e7304204163636f756e747301010802053438c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018b8205468652062616c616e6365206f66206120746f6b656e207479706520756e64657220616e206163636f756e742e00fc204e4f54453a2049662074686520746f74616c2069732065766572207a65726f2c206465637265617365206163636f756e7420726566206163636f756e742e001901204e4f54453a2054686973206973206f6e6c79207573656420696e20746865206361736520746861742074686973206d6f64756c65206973207573656420746f2073746f7265282062616c616e6365732e000000004d000400000000009d0f043443757272656e6369657341706904206163636f756e7473040c77686f0040000000000000",
|
|
8224
8159
|
"extra": null
|
|
8225
8160
|
},
|
|
8226
|
-
{
|
|
8227
|
-
"id": "672bd4dcf46610ac3b280a2b6e414b33",
|
|
8228
|
-
"source": "substrate-dtao",
|
|
8229
|
-
"chainId": "bittensor",
|
|
8230
|
-
"specVersion": 470,
|
|
8231
|
-
"version": "v14",
|
|
8232
|
-
"data": "0x6d6574610fc8000c1c73705f636f72651863727970746f2c4163636f756e7449643332000004000401205b75383b2033325d0000040000032000000008000800000503000c0000050500100c6073756274656e736f725f72756e74696d655f636f6d6d6f6e2063757272656e63792854616f42616c616e63650000040014010c75363400001400000506001800000507001c000005000020000006140024000002080028086073756274656e736f725f72756e74696d655f636f6d6d6f6e184e6574556964000004002c010c75313600002c0000050400300c6073756274656e736f725f72756e74696d655f636f6d6d6f6e2063757272656e637930416c70686142616c616e63650000040014010c753634000034000006280038083c7375627374726174655f666978656424466978656455313238041046726163013c00040110626974731801107531323800003c0c447375627374726174655f747970656e756d1075696e741055496e740804550140044201600008010c6d73624001045500010c6c7362600104420000400c447375627374726174655f747970656e756d1075696e741055496e740804550144044201600008010c6d73624401045500010c6c7362600104420000440c447375627374726174655f747970656e756d1075696e741055496e740804550148044201600008010c6d73624801045500010c6c7362600104420000480c447375627374726174655f747970656e756d1075696e741055496e74080455014c044201600008010c6d73624c01045500010c6c73626001044200004c0c447375627374726174655f747970656e756d1075696e741055496e740804550150044201600008010c6d73625001045500010c6c7362600104420000500c447375627374726174655f747970656e756d1075696e741055496e740804550154044201600008010c6d73625401045500010c6c7362600104420000540c447375627374726174655f747970656e756d1075696e741055496e7408045501580442015c0008010c6d73625801045500010c6c73625c0104420000580c447375627374726174655f747970656e756d1075696e7414555465726d000000005c0c447375627374726174655f747970656e756d0c62697408423100000000600c447375627374726174655f747970656e756d0c626974084230000000006404184f7074696f6e04045401680108104e6f6e6500000010536f6d650400680000010000680c4070616c6c65745f73756274656e736f721870616c6c6574405375626e65744964656e746974795633000020012c7375626e65745f6e616d6524011c5665633c75383e00012c6769746875625f7265706f24011c5665633c75383e0001387375626e65745f636f6e7461637424011c5665633c75383e0001287375626e65745f75726c24011c5665633c75383e00011c646973636f726424011c5665633c75383e00012c6465736372697074696f6e24011c5665633c75383e0001206c6f676f5f75726c24011c5665633c75383e0001286164646974696f6e616c24011c5665633c75383e00006c0000061000700000020000740000040800280078083c7375627374726174655f666978656424466978656449313238041046726163014000040110626974737c01106931323800007c0000050d00800000040c0028000084104070616c6c65745f73756274656e736f721c7374616b696e67106c6f636b244c6f636b537461746500000c012c6c6f636b65645f6d617373300130416c70686142616c616e6365000128636f6e76696374696f6e38011855363446363400012c6c6173745f75706461746514010c753634000088000004080000008c0000062c009000000630009400000298009804184f7074696f6e040454019c0108104e6f6e6500000010536f6d6504009c00000100009c104070616c6c65745f73756274656e736f72207270635f696e666f3064796e616d69635f696e666f2c44796e616d6963496e666f04244163636f756e7449640100005401186e657475696434013c436f6d706163743c4e65745569643e0001306f776e65725f686f746b65790001244163636f756e7449640001346f776e65725f636f6c646b65790001244163636f756e74496400012c7375626e65745f6e616d65a001405665633c436f6d706163743c75383e3e000130746f6b656e5f73796d626f6ca001405665633c436f6d706163743c75383e3e00011474656d706f8c0130436f6d706163743c7531363e0001246c6173745f73746570200130436f6d706163743c7536343e000158626c6f636b735f73696e63655f6c6173745f73746570200130436f6d706163743c7536343e000120656d697373696f6e200130436f6d706163743c7536343e000120616c7068615f696e900154436f6d706163743c416c70686142616c616e63653e000124616c7068615f6f7574900154436f6d706163743c416c70686142616c616e63653e00011874616f5f696e6c014c436f6d706163743c54616f42616c616e63653e000148616c7068615f6f75745f656d697373696f6e900154436f6d706163743c416c70686142616c616e63653e000144616c7068615f696e5f656d697373696f6e900154436f6d706163743c416c70686142616c616e63653e00013c74616f5f696e5f656d697373696f6e6c014c436f6d706163743c54616f42616c616e63653e00015870656e64696e675f616c7068615f656d697373696f6e900154436f6d706163743c416c70686142616c616e63653e00015470656e64696e675f726f6f745f656d697373696f6e6c014c436f6d706163743c54616f42616c616e63653e0001347375626e65745f766f6c756d65a80134436f6d706163743c753132383e0001546e6574776f726b5f726567697374657265645f6174200130436f6d706163743c7536343e00013c7375626e65745f6964656e746974796401604f7074696f6e3c5375626e65744964656e7469747956333e0001306d6f76696e675f70726963657801184939364633320000a0000002a400a40000060800a80000061800ac000002b000b0104070616c6c65745f73756274656e736f72207270635f696e666f287374616b655f696e666f245374616b65496e666f04244163636f756e744964010000240118686f746b65790001244163636f756e74496400011c636f6c646b65790001244163636f756e7449640001186e657475696434013c436f6d706163743c4e65745569643e0001147374616b65900154436f6d706163743c416c70686142616c616e63653e0001186c6f636b6564200130436f6d706163743c7536343e000120656d697373696f6e900154436f6d706163743c416c70686142616c616e63653e00013074616f5f656d697373696f6e6c014c436f6d706163743c54616f42616c616e63653e000114647261696e200130436f6d706163743c7536343e00013469735f726567697374657265641c0110626f6f6c0000b4000002b800b80000040800ac00bc04184f7074696f6e04045401840108104e6f6e6500000010536f6d650400840000010000c0104070616c6c65745f73756274656e736f72207270635f696e666f2c6261736b65745f696e666f484261736b6574436c61696d5072657669657704244163636f756e744964010000280118686f746b65790001244163636f756e74496400012c6f7765645f73686172657314010c75363400012c616363727565645f74616f10012854616f42616c616e636500013872656465656d61626c655f74616f10012854616f42616c616e6365000144666f726665697465645f74616f5f65737410012854616f42616c616e6365000110726f77730c010c753332000130726f77735f746f5f73656c6c0c010c753332000124647573745f726f77730c010c75333200011473776570740c010c75333200013c666c75736865645f637265646974730c010c7533320000c4000002c000081853797374656d011853797374656d04184e756d62657201000c1000000000040901205468652063757272656e7420626c6f636b206e756d626572206265696e672070726f6365737365642e205365742062792060657865637574655f626c6f636b602e0000000000003c53756274656e736f724d6f64756c65013c53756274656e736f724d6f64756c6514104c6f636b00010c0206028084040004690120444d4150202820636f6c646b65792c206e65747569642c20686f746b65792029202d2d3e204c6f636b5374617465207c204578706f6e656e7469616c206c6f636b2070657220636f6c646b657920706572207375626e65742e304465636179696e674c6f636b0001080206741c0400087d0120444d4150202820636f6c646b65792c206e65747569642029202d2d3e2066616c7365207c205768656e2070726573656e7420616e642066616c73652c207468697320636f6c646b65792773206c6f636b2069732070657270657475616c2ec4204d697373696e6720656e7472696573206d65616e20746865206c6f636b206465636179732062792064656661756c742e385472616e73666572546f67676c6501010406281c0401048c204d41502028206e65747569642029202d2d3e207472616e736665725f746f67676c656c4c617374436f6c646b6579486f746b65795374616b65426c6f636b0001080505881404000c2501204d61702028636f6c646b65792c20686f746b657929202d2d3e2075363420746865206c61737420626c6f636b206174207768696368202a2a726f6f742a2a207374616b652077617319012061646465642f72656d6f7665642f636c61696d656420666f72207468617420706169722e205573656420736f6c656c79206173207468652061676520626173697320666f721d012060526f6f745374616b65556e6c6f636b496e74657276616c602e204e6f6e2d726f6f74207374616b65206f7073206d757374206e6f742077726974652074686973206d61702e5c526f6f745374616b65556e6c6f636b496e74657276616c0100142000000000000000001c3501204d696e696d756d206e756d626572206f6620626c6f636b7320726f6f7420286e6574756964203029207374616b65206d7573742062652068656c64206265666f72652069742063616e2062652d012072656d6f7665642066726f6d20726f6f742028766961206072656d6f76655f7374616b65602c206d6f76652f737761702f7472616e73666572206f666620726f6f742c206574632e292c2901206b65796564206f666620604c617374436f6c646b6579486f746b65795374616b65426c6f636b602e206030602064697361626c65732074686520686f6c64202864656661756c74292c45012070726573657276696e67206c6567616379206265686176696f75722e205768656e20736574203e3d206f6e652074656d706f206974206e65757472616c697365732065706f63682d626f756e64617279410120226a7573742d696e2d74696d6522206469766964656e6420736e6970696e673a20726f6f74207374616b6520697320313a312054414f2077697468206e6f20414d4d20736c6970706167652c20736f450120776974686f75742074686973206672696374696f6e206120736e697065722063616e207374616b65207269676874206265666f7265206120626f756e646172792c206361707475726520612066756c6c35012074656d706f277320726f6f74206469766964656e642070726f2d7261746120746f20696e7374616e74616e656f7573207374616b652c20616e64206578697420696d6d6564696174656c792e000000000700040000000000c1010c505375626e6574496e666f52756e74696d6541706904506765745f616c6c5f64796e616d69635f696e666f009400004c5374616b65496e666f52756e74696d65417069086c6765745f7374616b655f696e666f5f666f725f636f6c646b6579730440636f6c646b65795f6163636f756e747370b400406765745f636f6c646b65795f6c6f636b081c636f6c646b657900186e657475696428bc000050426574614261736b657452756e74696d6541706904786765745f726f6f745f6261736b65745f636c61696d5f7072657669657773041c636f6c646b657900c4041901205468652073616d6520666f722065766572792076616c696461746f72206120636f6c646b65792d776964652060636c61696d5f726f6f746020776f756c6420746f7563682e0000000000",
|
|
8233
|
-
"extra": null
|
|
8234
|
-
},
|
|
8235
8161
|
{
|
|
8236
8162
|
"id": "67f905d9e8fe69fbee590d6903e4f26a",
|
|
8237
8163
|
"source": "substrate-native",
|
|
@@ -8275,16 +8201,13 @@ var initChaindata_default = {
|
|
|
8275
8201
|
}
|
|
8276
8202
|
},
|
|
8277
8203
|
{
|
|
8278
|
-
"id": "
|
|
8279
|
-
"source": "substrate-
|
|
8204
|
+
"id": "7c338f58aafd9be3207e75eae087a08e",
|
|
8205
|
+
"source": "substrate-psp22",
|
|
8280
8206
|
"chainId": "bittensor",
|
|
8281
|
-
"specVersion":
|
|
8207
|
+
"specVersion": 475,
|
|
8282
8208
|
"version": "v14",
|
|
8283
|
-
"data":
|
|
8284
|
-
"extra":
|
|
8285
|
-
"useLegacyTransferableCalculation": false,
|
|
8286
|
-
"existentialDeposit": "500"
|
|
8287
|
-
}
|
|
8209
|
+
"data": null,
|
|
8210
|
+
"extra": null
|
|
8288
8211
|
},
|
|
8289
8212
|
{
|
|
8290
8213
|
"id": "83ec68365fc9b7555fbe768d061b9eec",
|
|
@@ -8313,6 +8236,24 @@ var initChaindata_default = {
|
|
|
8313
8236
|
"data": null,
|
|
8314
8237
|
"extra": null
|
|
8315
8238
|
},
|
|
8239
|
+
{
|
|
8240
|
+
"id": "99f8c18b0187944c80d4eb71595b2d03",
|
|
8241
|
+
"source": "substrate-hydration",
|
|
8242
|
+
"chainId": "bittensor",
|
|
8243
|
+
"specVersion": 475,
|
|
8244
|
+
"version": "v14",
|
|
8245
|
+
"data": null,
|
|
8246
|
+
"extra": null
|
|
8247
|
+
},
|
|
8248
|
+
{
|
|
8249
|
+
"id": "9b0f5d80c01f441df50e81e2060a675c",
|
|
8250
|
+
"source": "substrate-tokens",
|
|
8251
|
+
"chainId": "bittensor",
|
|
8252
|
+
"specVersion": 475,
|
|
8253
|
+
"version": "v14",
|
|
8254
|
+
"data": null,
|
|
8255
|
+
"extra": { "palletId": "Tokens" }
|
|
8256
|
+
},
|
|
8316
8257
|
{
|
|
8317
8258
|
"id": "9cc83ef0f02af9d2f7adac07f29db115",
|
|
8318
8259
|
"source": "substrate-assets",
|
|
@@ -8322,6 +8263,15 @@ var initChaindata_default = {
|
|
|
8322
8263
|
"data": null,
|
|
8323
8264
|
"extra": null
|
|
8324
8265
|
},
|
|
8266
|
+
{
|
|
8267
|
+
"id": "9f4b5cfec1977ed9102bfb087eadb8c6",
|
|
8268
|
+
"source": "substrate-dtao",
|
|
8269
|
+
"chainId": "bittensor",
|
|
8270
|
+
"specVersion": 475,
|
|
8271
|
+
"version": "v14",
|
|
8272
|
+
"data": "0x6d6574610fc8000c1c73705f636f72651863727970746f2c4163636f756e7449643332000004000401205b75383b2033325d0000040000032000000008000800000503000c0000050500100c6073756274656e736f725f72756e74696d655f636f6d6d6f6e2063757272656e63792854616f42616c616e63650000040014010c75363400001400000506001800000507001c000005000020000006140024000002080028086073756274656e736f725f72756e74696d655f636f6d6d6f6e184e6574556964000004002c010c75313600002c0000050400300c6073756274656e736f725f72756e74696d655f636f6d6d6f6e2063757272656e637930416c70686142616c616e63650000040014010c753634000034000006280038083c7375627374726174655f666978656424466978656455313238041046726163013c00040110626974731801107531323800003c0c447375627374726174655f747970656e756d1075696e741055496e740804550140044201600008010c6d73624001045500010c6c7362600104420000400c447375627374726174655f747970656e756d1075696e741055496e740804550144044201600008010c6d73624401045500010c6c7362600104420000440c447375627374726174655f747970656e756d1075696e741055496e740804550148044201600008010c6d73624801045500010c6c7362600104420000480c447375627374726174655f747970656e756d1075696e741055496e74080455014c044201600008010c6d73624c01045500010c6c73626001044200004c0c447375627374726174655f747970656e756d1075696e741055496e740804550150044201600008010c6d73625001045500010c6c7362600104420000500c447375627374726174655f747970656e756d1075696e741055496e740804550154044201600008010c6d73625401045500010c6c7362600104420000540c447375627374726174655f747970656e756d1075696e741055496e7408045501580442015c0008010c6d73625801045500010c6c73625c0104420000580c447375627374726174655f747970656e756d1075696e7414555465726d000000005c0c447375627374726174655f747970656e756d0c62697408423100000000600c447375627374726174655f747970656e756d0c626974084230000000006404184f7074696f6e04045401680108104e6f6e6500000010536f6d650400680000010000680c4070616c6c65745f73756274656e736f721870616c6c6574405375626e65744964656e746974795633000020012c7375626e65745f6e616d6524011c5665633c75383e00012c6769746875625f7265706f24011c5665633c75383e0001387375626e65745f636f6e7461637424011c5665633c75383e0001287375626e65745f75726c24011c5665633c75383e00011c646973636f726424011c5665633c75383e00012c6465736372697074696f6e24011c5665633c75383e0001206c6f676f5f75726c24011c5665633c75383e0001286164646974696f6e616c24011c5665633c75383e00006c0000061000700000020000740000040800280078083c7375627374726174655f666978656424466978656449313238041046726163014000040110626974737c01106931323800007c0000050d00800000040c0028000084104070616c6c65745f73756274656e736f721c7374616b696e67106c6f636b244c6f636b537461746500000c012c6c6f636b65645f6d617373300130416c70686142616c616e6365000128636f6e76696374696f6e38011855363446363400012c6c6173745f75706461746514010c753634000088000004080000008c0000062c009000000630009400000298009804184f7074696f6e040454019c0108104e6f6e6500000010536f6d6504009c00000100009c104070616c6c65745f73756274656e736f72207270635f696e666f3064796e616d69635f696e666f2c44796e616d6963496e666f04244163636f756e7449640100005401186e657475696434013c436f6d706163743c4e65745569643e0001306f776e65725f686f746b65790001244163636f756e7449640001346f776e65725f636f6c646b65790001244163636f756e74496400012c7375626e65745f6e616d65a001405665633c436f6d706163743c75383e3e000130746f6b656e5f73796d626f6ca001405665633c436f6d706163743c75383e3e00011474656d706f8c0130436f6d706163743c7531363e0001246c6173745f73746570200130436f6d706163743c7536343e000158626c6f636b735f73696e63655f6c6173745f73746570200130436f6d706163743c7536343e000120656d697373696f6e200130436f6d706163743c7536343e000120616c7068615f696e900154436f6d706163743c416c70686142616c616e63653e000124616c7068615f6f7574900154436f6d706163743c416c70686142616c616e63653e00011874616f5f696e6c014c436f6d706163743c54616f42616c616e63653e000148616c7068615f6f75745f656d697373696f6e900154436f6d706163743c416c70686142616c616e63653e000144616c7068615f696e5f656d697373696f6e900154436f6d706163743c416c70686142616c616e63653e00013c74616f5f696e5f656d697373696f6e6c014c436f6d706163743c54616f42616c616e63653e00015870656e64696e675f616c7068615f656d697373696f6e900154436f6d706163743c416c70686142616c616e63653e00015470656e64696e675f726f6f745f656d697373696f6e6c014c436f6d706163743c54616f42616c616e63653e0001347375626e65745f766f6c756d65a80134436f6d706163743c753132383e0001546e6574776f726b5f726567697374657265645f6174200130436f6d706163743c7536343e00013c7375626e65745f6964656e746974796401604f7074696f6e3c5375626e65744964656e7469747956333e0001306d6f76696e675f70726963657801184939364633320000a0000002a400a40000060800a80000061800ac000002b000b0104070616c6c65745f73756274656e736f72207270635f696e666f287374616b655f696e666f245374616b65496e666f04244163636f756e744964010000240118686f746b65790001244163636f756e74496400011c636f6c646b65790001244163636f756e7449640001186e657475696434013c436f6d706163743c4e65745569643e0001147374616b65900154436f6d706163743c416c70686142616c616e63653e0001186c6f636b6564200130436f6d706163743c7536343e000120656d697373696f6e900154436f6d706163743c416c70686142616c616e63653e00013074616f5f656d697373696f6e6c014c436f6d706163743c54616f42616c616e63653e000114647261696e200130436f6d706163743c7536343e00013469735f726567697374657265641c0110626f6f6c0000b4000002b800b80000040800ac00bc04184f7074696f6e04045401840108104e6f6e6500000010536f6d650400840000010000c0104070616c6c65745f73756274656e736f72207270635f696e666f2c6261736b65745f696e666f484261736b6574436c61696d5072657669657704244163636f756e744964010000280118686f746b65790001244163636f756e74496400012c6f7765645f73686172657314010c75363400012c616363727565645f74616f10012854616f42616c616e636500013872656465656d61626c655f74616f10012854616f42616c616e6365000144666f726665697465645f74616f5f65737410012854616f42616c616e6365000110726f77730c010c753332000130726f77735f746f5f73656c6c0c010c753332000124647573745f726f77730c010c75333200011473776570740c010c75333200013c666c75736865645f637265646974730c010c7533320000c4000002c000081853797374656d011853797374656d04184e756d62657201000c1000000000040901205468652063757272656e7420626c6f636b206e756d626572206265696e672070726f6365737365642e205365742062792060657865637574655f626c6f636b602e0000000000003c53756274656e736f724d6f64756c65013c53756274656e736f724d6f64756c6514104c6f636b00010c0206028084040004690120444d4150202820636f6c646b65792c206e65747569642c20686f746b65792029202d2d3e204c6f636b5374617465207c204578706f6e656e7469616c206c6f636b2070657220636f6c646b657920706572207375626e65742e304465636179696e674c6f636b0001080206741c0400087d0120444d4150202820636f6c646b65792c206e65747569642029202d2d3e2066616c7365207c205768656e2070726573656e7420616e642066616c73652c207468697320636f6c646b65792773206c6f636b2069732070657270657475616c2ec4204d697373696e6720656e7472696573206d65616e20746865206c6f636b206465636179732062792064656661756c742e385472616e73666572546f67676c6501010406281c0401048c204d41502028206e65747569642029202d2d3e207472616e736665725f746f67676c656c4c617374436f6c646b6579486f746b65795374616b65426c6f636b0001080505881404000c2501204d61702028636f6c646b65792c20686f746b657929202d2d3e2075363420746865206c61737420626c6f636b206174207768696368202a2a726f6f742a2a207374616b652077617319012061646465642f72656d6f7665642f636c61696d656420666f72207468617420706169722e205573656420736f6c656c79206173207468652061676520626173697320666f721d012060526f6f745374616b65556e6c6f636b496e74657276616c602e204e6f6e2d726f6f74207374616b65206f7073206d757374206e6f742077726974652074686973206d61702e5c526f6f745374616b65556e6c6f636b496e74657276616c0100142000000000000000001c3501204d696e696d756d206e756d626572206f6620626c6f636b7320726f6f7420286e6574756964203029207374616b65206d7573742062652068656c64206265666f72652069742063616e2062652d012072656d6f7665642066726f6d20726f6f742028766961206072656d6f76655f7374616b65602c206d6f76652f737761702f7472616e73666572206f666620726f6f742c206574632e292c2901206b65796564206f666620604c617374436f6c646b6579486f746b65795374616b65426c6f636b602e206030602064697361626c65732074686520686f6c64202864656661756c74292c45012070726573657276696e67206c6567616379206265686176696f75722e205768656e20736574203e3d206f6e652074656d706f206974206e65757472616c697365732065706f63682d626f756e64617279410120226a7573742d696e2d74696d6522206469766964656e6420736e6970696e673a20726f6f74207374616b6520697320313a312054414f2077697468206e6f20414d4d20736c6970706167652c20736f450120776974686f75742074686973206672696374696f6e206120736e697065722063616e207374616b65207269676874206265666f7265206120626f756e646172792c206361707475726520612066756c6c35012074656d706f277320726f6f74206469766964656e642070726f2d7261746120746f20696e7374616e74616e656f7573207374616b652c20616e64206578697420696d6d6564696174656c792e000000000700040000000000c5010c505375626e6574496e666f52756e74696d6541706904506765745f616c6c5f64796e616d69635f696e666f009400004c5374616b65496e666f52756e74696d65417069086c6765745f7374616b655f696e666f5f666f725f636f6c646b6579730440636f6c646b65795f6163636f756e747370b400406765745f636f6c646b65795f6c6f636b081c636f6c646b657900186e657475696428bc000050426574614261736b657452756e74696d6541706904786765745f726f6f745f6261736b65745f636c61696d5f7072657669657773041c636f6c646b657900c4041901205468652073616d6520666f722065766572792076616c696461746f72206120636f6c646b65792d776964652060636c61696d5f726f6f746020776f756c6420746f7563682e0000000000",
|
|
8273
|
+
"extra": null
|
|
8274
|
+
},
|
|
8325
8275
|
{
|
|
8326
8276
|
"id": "a179ac50b24314e959bbb01b3e807d29",
|
|
8327
8277
|
"source": "substrate-native",
|
|
@@ -8380,24 +8330,6 @@ var initChaindata_default = {
|
|
|
8380
8330
|
"data": null,
|
|
8381
8331
|
"extra": null
|
|
8382
8332
|
},
|
|
8383
|
-
{
|
|
8384
|
-
"id": "d621159823513db0d82e95c4fd543704",
|
|
8385
|
-
"source": "substrate-psp22",
|
|
8386
|
-
"chainId": "bittensor",
|
|
8387
|
-
"specVersion": 470,
|
|
8388
|
-
"version": "v14",
|
|
8389
|
-
"data": null,
|
|
8390
|
-
"extra": null
|
|
8391
|
-
},
|
|
8392
|
-
{
|
|
8393
|
-
"id": "d7a6757b921e7e99748d6ccbf0695d93",
|
|
8394
|
-
"source": "substrate-hydration",
|
|
8395
|
-
"chainId": "bittensor",
|
|
8396
|
-
"specVersion": 470,
|
|
8397
|
-
"version": "v14",
|
|
8398
|
-
"data": null,
|
|
8399
|
-
"extra": null
|
|
8400
|
-
},
|
|
8401
8333
|
{
|
|
8402
8334
|
"id": "dc1f3f476a7adc159c8d948df27ad00a",
|
|
8403
8335
|
"source": "substrate-dtao",
|
|
@@ -8465,6 +8397,27 @@ var initChaindata_default = {
|
|
|
8465
8397
|
"data": null,
|
|
8466
8398
|
"extra": null
|
|
8467
8399
|
},
|
|
8400
|
+
{
|
|
8401
|
+
"id": "f225e4b874f64c73cdfd47e6d4a5aacb",
|
|
8402
|
+
"source": "substrate-foreignassets",
|
|
8403
|
+
"chainId": "bittensor",
|
|
8404
|
+
"specVersion": 475,
|
|
8405
|
+
"version": "v14",
|
|
8406
|
+
"data": null,
|
|
8407
|
+
"extra": null
|
|
8408
|
+
},
|
|
8409
|
+
{
|
|
8410
|
+
"id": "f5211aa4fa5aba940e8b289bbbfb4d8a",
|
|
8411
|
+
"source": "substrate-native",
|
|
8412
|
+
"chainId": "bittensor",
|
|
8413
|
+
"specVersion": 475,
|
|
8414
|
+
"version": "v14",
|
|
8415
|
+
"data": "0x6d6574610f90000c1c73705f636f72651863727970746f2c4163636f756e7449643332000004000401205b75383b2033325d0000040000032000000008000800000503000c08306672616d655f73797374656d2c4163636f756e74496e666f08144e6f6e636501102c4163636f756e74446174610114001401146e6f6e63651001144e6f6e6365000124636f6e73756d657273100120526566436f756e7400012470726f766964657273100120526566436f756e7400012c73756666696369656e7473100120526566436f756e740001106461746114012c4163636f756e74446174610000100000050500140c3c70616c6c65745f62616c616e6365731474797065732c4163636f756e7444617461041c42616c616e63650118001001106672656518011c42616c616e6365000120726573657276656418011c42616c616e636500011866726f7a656e18011c42616c616e6365000114666c6167732001284578747261466c6167730000180c6073756274656e736f725f72756e74696d655f636f6d6d6f6e2063757272656e63792854616f42616c616e6365000004001c010c75363400001c0000050600200c3c70616c6c65745f62616c616e636573147479706573284578747261466c616773000004002401107531323800002400000507002800000504002c040c436f7704045401300004003000000030000005020034082873705f76657273696f6e3852756e74696d6556657273696f6e0000200124737065635f6e616d652c0144436f773c277374617469632c207374723e000124696d706c5f6e616d652c0144436f773c277374617469632c207374723e000144617574686f72696e675f76657273696f6e10010c753332000130737065635f76657273696f6e10010c753332000130696d706c5f76657273696f6e10010c7533320001106170697338011c4170697356656300014c7472616e73616374696f6e5f76657273696f6e10010c75333200013873797374656d5f76657273696f6e0801087538000038040c436f77040454013c0004003c0000003c0000024000400000040844100044000003080000000800480c4c626f756e6465645f636f6c6c656374696f6e73407765616b5f626f756e6465645f766563385765616b426f756e646564566563080454014c0453000004005401185665633c543e00004c0c3c70616c6c65745f62616c616e6365731474797065732c42616c616e63654c6f636b041c42616c616e63650118000c010869644401384c6f636b4964656e746966696572000118616d6f756e7418011c42616c616e636500011c726561736f6e7350011c526561736f6e730000500c3c70616c6c65745f62616c616e6365731474797065731c526561736f6e7300010c0c466565000000104d6973630001000c416c6c00020000540000024c00580c4c626f756e6465645f636f6c6c656374696f6e732c626f756e6465645f76656328426f756e646564566563080454015c0453000004006001185665633c543e00005c0c3c70616c6c65745f62616c616e6365731474797065732c52657365727665446174610844526573657276654964656e74696669657201441c42616c616e63650118000801086964440144526573657276654964656e746966696572000118616d6f756e7418011c42616c616e63650000600000025c00640c4c626f756e6465645f636f6c6c656374696f6e732c626f756e6465645f76656328426f756e64656456656308045401680453000004007c01185665633c543e00006814346672616d655f737570706f72741874726169747318746f6b656e73106d697363204964416d6f756e7408084964016c1c42616c616e636501180008010869646c01084964000118616d6f756e7418011c42616c616e636500006c08586e6f64655f73756274656e736f725f72756e74696d654452756e74696d65486f6c64526561736f6e00010c20507265696d616765040070016c70616c6c65745f707265696d6167653a3a486f6c64526561736f6e000e0020536166654d6f6465040074017070616c6c65745f736166655f6d6f64653a3a486f6c64526561736f6e00140024436f6e747261637473040078017070616c6c65745f636f6e7472616374733a3a486f6c64526561736f6e001d0000700c3c70616c6c65745f707265696d6167651870616c6c657428486f6c64526561736f6e00010420507265696d61676500000000740c4070616c6c65745f736166655f6d6f64651870616c6c657428486f6c64526561736f6e00010434456e7465724f72457874656e6400000000780c4070616c6c65745f636f6e7472616374731870616c6c657428486f6c64526561736f6e00010860436f646555706c6f61644465706f736974526573657276650000005453746f726167654465706f73697452657365727665000100007c0000026800800c4c626f756e6465645f636f6c6c656374696f6e732c626f756e6465645f76656328426f756e64656456656308045401840453000004008c01185665633c543e00008414346672616d655f737570706f72741874726169747318746f6b656e73106d697363204964416d6f756e740808496401881c42616c616e636501180008010869648801084964000118616d6f756e7418011c42616c616e636500008808586e6f64655f73756274656e736f725f72756e74696d654c52756e74696d65467265657a65526561736f6e000100008c0000028400081853797374656d011853797374656d041c4163636f756e7401010402000ce0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008004e8205468652066756c6c206163636f756e7420696e666f726d6174696f6e20666f72206120706172746963756c6172206163636f756e742049442e0000081c56657273696f6e347105386e6f64652d73756274656e736f72386e6f64652d73756274656e736f7201000000db0100000100000064df6acb689907609b0500000037e397fc7c91f5e40200000040fe3ad401f8959a06000000fbc577b9d747efd601000000d2bc9897eed08f1503000000f78b278be53f454c02000000dd718d5cc53262d401000000ab3c0572291feb8b01000000ed99c5acb25eedf503000000bc9d89904f5b923f0100000037c8bb1350a9a2a804000000f3ff14d5ab52705903000000582211f65bb14b8906000000e65b00e46cedd0aa0200000068b66ba122c93fa70200000042e62be4a39e5b6001000000806df4ccaa9ed485010000008375104b299b74c5020000005d1fbfbe852f280701000000c6886e2f8e598b0a0100000043580abff6baab4505000000c0de4984d112f3b401000000cbca25e39f14238702000000a8b093e6508d9e9c010000001c4585bd5c7072020100000001000000010484204765742074686520636861696e277320696e2d636f64652076657273696f6e2e285353353850726566697828082a0014a8205468652064657369676e61746564205353353820707265666978206f66207468697320636861696e2e0039012054686973207265706c6163657320746865202273733538466f726d6174222070726f7065727479206465636c6172656420696e2074686520636861696e20737065632e20526561736f6e20697331012074686174207468652072756e74696d652073686f756c64206b6e6f772061626f7574207468652070726566697820696e206f7264657220746f206d616b6520757365206f662069742061737020616e206964656e746966696572206f662074686520636861696e2e0000002042616c616e636573012042616c616e63657310144c6f636b73010104020048040010b820416e79206c6971756964697479206c6f636b73206f6e20736f6d65206163636f756e742062616c616e6365732e2501204e4f54453a2053686f756c64206f6e6c79206265206163636573736564207768656e2073657474696e672c206368616e67696e6720616e642066726565696e672061206c6f636b2e00ad0120557365206f66206c6f636b73206973206465707265636174656420696e206661766f7572206f6620667265657a65732e20536565206068747470733a2f2f6769746875622e636f6d2f706172697479746563682f7375627374726174652f70756c6c2f31323935312f6020526573657276657301010402005804000ca4204e616d6564207265736572766573206f6e20736f6d65206163636f756e742062616c616e6365732e00b10120557365206f66207265736572766573206973206465707265636174656420696e206661766f7572206f6620686f6c64732e20536565206068747470733a2f2f6769746875622e636f6d2f706172697479746563682f7375627374726174652f70756c6c2f31323935312f6014486f6c64730101040200640400046c20486f6c6473206f6e206163636f756e742062616c616e6365732e1c467265657a65730101040200800400048820467265657a65206c6f636b73206f6e206163636f756e742062616c616e6365732e000000000500040000000000c5010000000000",
|
|
8416
|
+
"extra": {
|
|
8417
|
+
"useLegacyTransferableCalculation": false,
|
|
8418
|
+
"existentialDeposit": "500"
|
|
8419
|
+
}
|
|
8420
|
+
},
|
|
8468
8421
|
{
|
|
8469
8422
|
"id": "f6968d187460262f60f1cf67a3fdc971",
|
|
8470
8423
|
"source": "substrate-assets",
|
|
@@ -8482,75 +8435,197 @@ var initChaindata_default = {
|
|
|
8482
8435
|
"version": "v14",
|
|
8483
8436
|
"data": null,
|
|
8484
8437
|
"extra": { "palletId": "Tokens" }
|
|
8485
|
-
},
|
|
8486
|
-
{
|
|
8487
|
-
"id": "fc37f3bb6c1b05596f4e9f74724ed12f",
|
|
8488
|
-
"source": "substrate-assets",
|
|
8489
|
-
"chainId": "bittensor",
|
|
8490
|
-
"specVersion": 470,
|
|
8491
|
-
"version": "v14",
|
|
8492
|
-
"data": null,
|
|
8493
|
-
"extra": null
|
|
8494
8438
|
}
|
|
8495
8439
|
]
|
|
8496
8440
|
};
|
|
8497
8441
|
//#endregion
|
|
8442
|
+
//#region src/state/validatedCache.ts
|
|
8443
|
+
/**
|
|
8444
|
+
* Validation results by input object, so the expensive validation (thousands of tokens)
|
|
8445
|
+
* runs at most ONCE per object instead of on every emission or resubscription.
|
|
8446
|
+
*
|
|
8447
|
+
* Safe because chaindata objects are immutable by convention in this package, and a valid
|
|
8448
|
+
* output maps to its own result: re-parsing already-parsed data is idempotent (defaults
|
|
8449
|
+
* filled, token key order already applied).
|
|
8450
|
+
*/
|
|
8451
|
+
const results = /* @__PURE__ */ new WeakMap();
|
|
8452
|
+
const validateChaindata = async (data, options) => {
|
|
8453
|
+
if (typeof data !== "object" || data === null) return parseChaindataFileChunked(data, options);
|
|
8454
|
+
const cached = results.get(data);
|
|
8455
|
+
if (cached) return cached;
|
|
8456
|
+
const result = await parseChaindataFileChunked(data, options);
|
|
8457
|
+
results.set(data, result);
|
|
8458
|
+
if (result.success) results.set(result.data, result);
|
|
8459
|
+
return result;
|
|
8460
|
+
};
|
|
8461
|
+
//#endregion
|
|
8462
|
+
//#region src/state/net.ts
|
|
8463
|
+
const getFallbackUrl = (url) => {
|
|
8464
|
+
if (url.startsWith("https://raw.githubusercontent.com/")) {
|
|
8465
|
+
const fallbackUrl = url.replace(/^https:\/\/raw\.githubusercontent\.com\/([^/]+)\/([^/]+)\//i, "https://cdn.jsdelivr.net/gh/$1/$2@");
|
|
8466
|
+
return fallbackUrl !== url ? fallbackUrl : null;
|
|
8467
|
+
}
|
|
8468
|
+
return null;
|
|
8469
|
+
};
|
|
8470
|
+
const fetchJson = async (url, { signal, validate, fallbackUrl } = {}) => {
|
|
8471
|
+
const req = await fetch(url, { signal });
|
|
8472
|
+
if (!req.ok) {
|
|
8473
|
+
if (fallbackUrl) return fetchJson(fallbackUrl, {
|
|
8474
|
+
validate,
|
|
8475
|
+
signal
|
|
8476
|
+
});
|
|
8477
|
+
throw new Error(`Failed to fetch from ${url}: ${req.status} ${req.statusText}`);
|
|
8478
|
+
}
|
|
8479
|
+
const data = await req.json();
|
|
8480
|
+
if (validate) {
|
|
8481
|
+
const start = performance.now();
|
|
8482
|
+
const result = await validate(data, signal);
|
|
8483
|
+
log_default.debug(`[ChaindataProvider] Validating downloaded ${url?.split("/").pop()} took ${performance.now() - start} ms`);
|
|
8484
|
+
if (!result.success) {
|
|
8485
|
+
log_default.error("Failed to parse data from", url, { error: result.error });
|
|
8486
|
+
throw new Error(`Schema validation failed for ${url}`);
|
|
8487
|
+
}
|
|
8488
|
+
return result.data;
|
|
8489
|
+
}
|
|
8490
|
+
return data;
|
|
8491
|
+
};
|
|
8492
|
+
const fetchChaindata = (url = DEFAULT_CHAINDATA_URL, signal) => fetchJson(url, {
|
|
8493
|
+
validate: (data, signal) => validateChaindata(data, { signal }),
|
|
8494
|
+
signal,
|
|
8495
|
+
fallbackUrl: url === DEFAULT_CHAINDATA_URL ? getFallbackUrl(url) : null
|
|
8496
|
+
});
|
|
8497
|
+
//#endregion
|
|
8498
|
+
//#region src/state/remoteChaindata.ts
|
|
8499
|
+
const REFRESH_INTERVAL = 3e5;
|
|
8500
|
+
const MIN_REFRESH_INTERVAL = 6e4;
|
|
8501
|
+
const remoteChaindataByUrl = /* @__PURE__ */ new Map();
|
|
8502
|
+
/**
|
|
8503
|
+
* Downloads the chaindata file at `url` and refreshes it every 5 minutes. Equivalent spellings
|
|
8504
|
+
* of a url share one observable. Throws if `url` is not a valid url.
|
|
8505
|
+
*
|
|
8506
|
+
* Emitted objects are shared and already validated: treat them as immutable, and filter them
|
|
8507
|
+
* by returning new objects.
|
|
8508
|
+
*/
|
|
8509
|
+
const getRemoteChaindata$ = (url) => {
|
|
8510
|
+
const href = parseChaindataUrl(url);
|
|
8511
|
+
const existing = remoteChaindataByUrl.get(href);
|
|
8512
|
+
if (existing) return existing;
|
|
8513
|
+
const remoteChaindata$ = createRemoteChaindata$(href);
|
|
8514
|
+
remoteChaindataByUrl.set(href, remoteChaindata$);
|
|
8515
|
+
return remoteChaindata$;
|
|
8516
|
+
};
|
|
8517
|
+
const parseChaindataUrl = (url) => {
|
|
8518
|
+
try {
|
|
8519
|
+
return new URL(url).href;
|
|
8520
|
+
} catch (cause) {
|
|
8521
|
+
throw new Error(`Invalid chaindata url: "${url}"`, { cause });
|
|
8522
|
+
}
|
|
8523
|
+
};
|
|
8524
|
+
const createRemoteChaindata$ = (url) => {
|
|
8525
|
+
let lastUpdatedAt = 0;
|
|
8526
|
+
let lastData = null;
|
|
8527
|
+
return new Observable((subscriber) => {
|
|
8528
|
+
const controller = new AbortController();
|
|
8529
|
+
subscriber.add(() => controller.abort());
|
|
8530
|
+
let timeout = null;
|
|
8531
|
+
subscriber.add(() => timeout && clearTimeout(timeout));
|
|
8532
|
+
if (lastData && Date.now() < lastUpdatedAt + MIN_REFRESH_INTERVAL) subscriber.next(lastData);
|
|
8533
|
+
else lastData = null;
|
|
8534
|
+
const refresh = async () => {
|
|
8535
|
+
try {
|
|
8536
|
+
const delay = Math.max(0, lastUpdatedAt + MIN_REFRESH_INTERVAL - Date.now());
|
|
8537
|
+
if (delay > 0) await new Promise((resolve) => setTimeout(resolve, delay));
|
|
8538
|
+
if (controller.signal.aborted) return;
|
|
8539
|
+
log_default.debug("[remoteChaindata$] Refreshing chaindata from", url);
|
|
8540
|
+
const data = await fetchChaindata(url, controller.signal);
|
|
8541
|
+
lastUpdatedAt = Date.now();
|
|
8542
|
+
lastData = data;
|
|
8543
|
+
subscriber.next(data);
|
|
8544
|
+
} catch (error) {
|
|
8545
|
+
if (isAbortError(error)) return;
|
|
8546
|
+
log_default.error("Failed to fetch chaindata", error);
|
|
8547
|
+
if (!subscriber.closed) subscriber.error(error);
|
|
8548
|
+
} finally {
|
|
8549
|
+
if (!controller.signal.aborted) timeout = setTimeout(refresh, REFRESH_INTERVAL);
|
|
8550
|
+
}
|
|
8551
|
+
};
|
|
8552
|
+
refresh();
|
|
8553
|
+
}).pipe(shareReplay({
|
|
8554
|
+
bufferSize: 1,
|
|
8555
|
+
refCount: true
|
|
8556
|
+
}));
|
|
8557
|
+
};
|
|
8558
|
+
//#endregion
|
|
8498
8559
|
//#region src/state/defaultChaindata.ts
|
|
8499
8560
|
const EMPTY_DATA = {
|
|
8500
8561
|
networks: [],
|
|
8501
8562
|
tokens: [],
|
|
8502
8563
|
miniMetadatas: []
|
|
8503
8564
|
};
|
|
8504
|
-
const
|
|
8505
|
-
|
|
8506
|
-
|
|
8565
|
+
const RETRY_BASE_DELAY = 3e4;
|
|
8566
|
+
const RETRY_MAX_DELAY = 3e5;
|
|
8567
|
+
const getRetryDelay = (retryCount) => Math.min(RETRY_BASE_DELAY * 2 ** (retryCount - 1), RETRY_MAX_DELAY);
|
|
8568
|
+
const validateProvidedChaindata = (providedChaindata$) => providedChaindata$.pipe(switchMapChunked(async (data, { slicer }) => {
|
|
8569
|
+
const validation = await validateChaindata(data, { slicer });
|
|
8570
|
+
if (!validation.success) {
|
|
8571
|
+
log_default.error("[defaultChaindata$] Invalid chaindata provided", { error: validation.error });
|
|
8572
|
+
return null;
|
|
8573
|
+
}
|
|
8574
|
+
return validation.data;
|
|
8575
|
+
}), filter(isNotNil), tap({ error: (cause) => log_default.error("[defaultChaindata$] Provided chaindata failed", { cause }) }));
|
|
8576
|
+
const getDefaultChaindata$ = (storage$, providedChaindata$) => {
|
|
8507
8577
|
const storageValidated$ = storage$.pipe(switchMapChunked(async (data, { slicer }) => {
|
|
8508
|
-
if (isChaindataValidated(data)) return data;
|
|
8509
|
-
if (data === lastInput) return lastOutput;
|
|
8510
8578
|
const start = performance.now();
|
|
8511
|
-
const validation = await
|
|
8579
|
+
const validation = await validateChaindata(data, { slicer });
|
|
8512
8580
|
log_default.debug("[storageValidated$] Chaindata schema validation: %sms", (performance.now() - start).toFixed(2));
|
|
8513
|
-
if (
|
|
8514
|
-
|
|
8515
|
-
|
|
8516
|
-
return lastOutput;
|
|
8581
|
+
if (validation.success) return validation.data;
|
|
8582
|
+
log_default.warn("[storageValidated$] Chaindata schema validation failed", { error: validation.error });
|
|
8583
|
+
return EMPTY_DATA;
|
|
8517
8584
|
}), shareReplay({
|
|
8518
8585
|
bufferSize: 1,
|
|
8519
8586
|
refCount: true
|
|
8520
8587
|
}));
|
|
8521
8588
|
return new Observable((subscriber) => {
|
|
8522
|
-
const
|
|
8523
|
-
|
|
8524
|
-
|
|
8525
|
-
|
|
8526
|
-
|
|
8527
|
-
|
|
8528
|
-
|
|
8529
|
-
|
|
8530
|
-
log_default.error("[defaultChaindata$] initChaindata failed schema validation", { error: validation.error });
|
|
8531
|
-
return;
|
|
8532
|
-
}
|
|
8533
|
-
storage$.next(markChaindataValidated(validation.data));
|
|
8534
|
-
log_default.info("[defaultChaindata$] Initial chaindata file imported successfully");
|
|
8535
|
-
} catch (cause) {
|
|
8536
|
-
log_default.error("[defaultChaindata$] Failed to import initial chaindata file", { cause });
|
|
8589
|
+
const provisionInitialChaindata = async () => {
|
|
8590
|
+
const storageData = await firstValueFrom(storageValidated$);
|
|
8591
|
+
if (storageData.networks.length || storageData.tokens.length || storageData.miniMetadatas.length) return log_default.info("[defaultChaindata$] DB is not empty, skipping initial data provision", storageData);
|
|
8592
|
+
try {
|
|
8593
|
+
log_default.info("[defaultChaindata$] Importing initial chaindata file");
|
|
8594
|
+
const validation = await validateChaindata(initChaindata_default);
|
|
8595
|
+
if (!validation.success) {
|
|
8596
|
+
log_default.error("[defaultChaindata$] initChaindata failed schema validation", { error: validation.error });
|
|
8537
8597
|
return;
|
|
8538
8598
|
}
|
|
8539
|
-
|
|
8540
|
-
|
|
8541
|
-
|
|
8542
|
-
|
|
8543
|
-
|
|
8544
|
-
if (!!await chaindataEqualWithYield(storageData, githubData)) return log_default.debug(`[defaultChaindata$] No db updates needed: ${performance.now() - now}ms`);
|
|
8545
|
-
log_default.debug(`[defaultChaindata$] Updating chaindata in DB (networks:${githubData.networks.length}, tokens:${githubData.tokens.length}, meta:${githubData.miniMetadatas.length})`);
|
|
8546
|
-
storage$.next(githubData);
|
|
8547
|
-
log_default.info(`[defaultChaindata$] Db synchronized with GitHub :${performance.now() - now}ms`);
|
|
8548
|
-
} catch (cause) {
|
|
8549
|
-
log_default.error("[defaultChaindata$] Failed to sync chaindata", { cause });
|
|
8550
|
-
}
|
|
8599
|
+
storage$.next(validation.data);
|
|
8600
|
+
log_default.info("[defaultChaindata$] Initial chaindata file imported successfully");
|
|
8601
|
+
} catch (cause) {
|
|
8602
|
+
log_default.error("[defaultChaindata$] Failed to import initial chaindata file", { cause });
|
|
8603
|
+
return;
|
|
8551
8604
|
}
|
|
8552
|
-
}
|
|
8553
|
-
|
|
8605
|
+
};
|
|
8606
|
+
const getStorageUpdate = async (sourceData, { slicer }) => {
|
|
8607
|
+
const now = performance.now();
|
|
8608
|
+
try {
|
|
8609
|
+
const storageData = await firstValueFrom(storageValidated$);
|
|
8610
|
+
if (!await chaindataEqualWithYield(storageData, sourceData, { slicer })) return sourceData;
|
|
8611
|
+
log_default.debug(`[defaultChaindata$] No db updates needed: ${performance.now() - now}ms`);
|
|
8612
|
+
return null;
|
|
8613
|
+
} catch (cause) {
|
|
8614
|
+
if (isAbortError(cause)) throw cause;
|
|
8615
|
+
log_default.error("[defaultChaindata$] Failed to sync chaindata", { cause });
|
|
8616
|
+
return null;
|
|
8617
|
+
}
|
|
8618
|
+
};
|
|
8619
|
+
const writeToStorage = (sourceData) => {
|
|
8620
|
+
log_default.debug(`[defaultChaindata$] Updating chaindata in DB (networks:${sourceData.networks.length}, tokens:${sourceData.tokens.length}, meta:${sourceData.miniMetadatas.length})`);
|
|
8621
|
+
storage$.next(sourceData);
|
|
8622
|
+
log_default.info("[defaultChaindata$] Db synchronized with chaindata source");
|
|
8623
|
+
};
|
|
8624
|
+
const sourceToStorageSubscription = (providedChaindata$ ? validateProvidedChaindata(providedChaindata$) : getRemoteChaindata$(DEFAULT_CHAINDATA_URL).pipe(tap({ error: provisionInitialChaindata }))).pipe(retry({
|
|
8625
|
+
delay: (_, retryCount) => timer(getRetryDelay(retryCount)),
|
|
8626
|
+
resetOnSuccess: true
|
|
8627
|
+
}), switchMapChunked(getStorageUpdate), filter(isNotNil)).subscribe(writeToStorage);
|
|
8628
|
+
subscriber.add(sourceToStorageSubscription);
|
|
8554
8629
|
const outputFromStorageSubscription = storageValidated$.subscribe(subscriber);
|
|
8555
8630
|
subscriber.add(outputFromStorageSubscription);
|
|
8556
8631
|
}).pipe(shareReplay({
|
|
@@ -8578,7 +8653,7 @@ var ChaindataProvider = class {
|
|
|
8578
8653
|
#chaindata$;
|
|
8579
8654
|
#dynamicTokens$;
|
|
8580
8655
|
#dynamicTokensWriteQueue = Promise.resolve();
|
|
8581
|
-
constructor({ persistedStorage, customChaindata$, dynamicTokens$ } = {}) {
|
|
8656
|
+
constructor({ persistedStorage, customChaindata$, dynamicTokens$, chaindata$ } = {}) {
|
|
8582
8657
|
tryToDeleteOldChaindataDb();
|
|
8583
8658
|
const mergedStorage = isPromise(persistedStorage) ? persistedStorage.then((storage) => ({
|
|
8584
8659
|
...DEFAULT_STORAGE,
|
|
@@ -8588,7 +8663,8 @@ var ChaindataProvider = class {
|
|
|
8588
8663
|
...persistedStorage
|
|
8589
8664
|
};
|
|
8590
8665
|
this.#storage$ = replaySubjectFrom(mergedStorage);
|
|
8591
|
-
const
|
|
8666
|
+
const providedChaindata$ = chaindata$ && (isObservable(chaindata$) ? chaindata$ : of(chaindata$));
|
|
8667
|
+
const defaultChaindata$ = getDefaultChaindata$(this.#storage$, providedChaindata$);
|
|
8592
8668
|
this.#dynamicTokens$ = replaySubjectFrom(dynamicTokens$ ?? []);
|
|
8593
8669
|
this.#chaindata$ = getCombinedChaindata$(defaultChaindata$, customChaindata$, this.#dynamicTokens$);
|
|
8594
8670
|
}
|
|
@@ -8855,6 +8931,6 @@ const getGithubBittensorHotkeyAssetUrl = (fileName) => {
|
|
|
8855
8931
|
return `${githubChaindataBaseUrl}/assets/bittensor/hotkeys/${fileName}`;
|
|
8856
8932
|
};
|
|
8857
8933
|
//#endregion
|
|
8858
|
-
export { AnyMiniMetadataSchema, ChaindataFileSchema, ChaindataProvider, CustomChaindataSchema, DotNetworkBalancesConfigSchema, DotNetworkSchema, DotNetworkTopologySchema, EthNetworkBalancesConfigSchema, EthNetworkSchema, EthereumAddressSchema, EvmErc20BalancesConfigSchema, EvmErc20TokenSchema, EvmNativeBalancesConfigSchema, EvmNativeTokenSchema, EvmUniswapV2BalancesConfigSchema, EvmUniswapV2TokenSchema, HexStringSchema, MINIMETADATA_VERSION, NetworkBaseSchema, NetworkSchema, SolNativeBalancesConfigSchema, SolNativeTokenSchema, SolNetworkBalancesConfigSchema, SolNetworkSchema, SolSplBalancesConfigSchema, SolSplTokenSchema, SolToken2022BalancesConfigSchema, SolToken2022TokenSchema, SolanaAddressSchema, SubAssetsBalancesConfigSchema, SubAssetsTokenSchema, SubDTaoBalancesConfigSchema, SubDTaoTokenSchema, SubForeignAssetsBalancesConfigSchema, SubForeignAssetsTokenSchema, SubHydrationBalancesConfigSchema, SubHydrationTokenSchema, SubNativeBalancesConfigSchema, SubNativeTokenSchema, SubPsp22BalancesConfigSchema, SubPsp22TokenSchema, SubTokensBalancesConfigSchema, SubTokensTokenSchema, TOKEN_TYPE, TokenBaseSchema, TokenSchema, TokenSchemaBase, TokenTypeSchema, evmErc20TokenId, evmNativeTokenId, evmUniswapV2TokenId, getBlockExplorerLabel, getBlockExplorerUrl, getBlockExplorerUrls, getChaindataDbV3, getCleanNetwork, getCleanToken, getGithubBittensorHotkeyAssetUrl, getGithubTokenLogoUrl, getGithubTokenLogoUrlByCoingeckoId, getNetworkGenesisHash, isAccountPlatformCompatibleWithNetwork, isNativeToken, isNativeTokenType, isNetworkCustom, isNetworkDot, isNetworkEth, isNetworkInPlatforms, isNetworkKnown, isNetworkOfPlatform, isNetworkSol, isTokenCustom, isTokenDot, isTokenEth, isTokenEvmErc20, isTokenEvmNative, isTokenEvmUniswapV2, isTokenIdInTypes, isTokenIdOfType, isTokenInTypes, isTokenKnown, isTokenNeedExistentialDeposit, isTokenOfPlatform, isTokenOfType, isTokenSol, isTokenSolSpl, isTokenSolToken2022, isTokenSubAssets, isTokenSubDTao, isTokenSubForeignAssets, isTokenSubHydration, isTokenSubNative, isTokenSubPsp22, isTokenSubTokens, isTokenTestnet, networkIdFromTokenId, parseEvmErc20TokenId, parseEvmNativeTokenId, parseEvmUniswapV2TokenId, parseSolNativeTokenId, parseSolSplTokenId, parseSolToken2022TokenId, parseSubAssetTokenId, parseSubDTaoTokenId, parseSubForeignAssetTokenId, parseSubHydrationTokenId, parseSubNativeTokenId, parseSubPsp22TokenId, parseSubTokensTokenId, parseTokenId, solNativeTokenId, solSplTokenId, solToken2022TokenId, subAssetTokenId, subDTaoTokenId, subForeignAssetTokenId, subHydrationTokenId, subNativeTokenId, subPsp22TokenId, subTokensTokenId };
|
|
8934
|
+
export { AnyMiniMetadataSchema, ChaindataFileSchema, ChaindataProvider, CustomChaindataSchema, DEFAULT_CHAINDATA_URL, DotNetworkBalancesConfigSchema, DotNetworkSchema, DotNetworkTopologySchema, EthNetworkBalancesConfigSchema, EthNetworkSchema, EthereumAddressSchema, EvmErc20BalancesConfigSchema, EvmErc20TokenSchema, EvmNativeBalancesConfigSchema, EvmNativeTokenSchema, EvmUniswapV2BalancesConfigSchema, EvmUniswapV2TokenSchema, HexStringSchema, MINIMETADATA_VERSION, NetworkBaseSchema, NetworkSchema, SolNativeBalancesConfigSchema, SolNativeTokenSchema, SolNetworkBalancesConfigSchema, SolNetworkSchema, SolSplBalancesConfigSchema, SolSplTokenSchema, SolToken2022BalancesConfigSchema, SolToken2022TokenSchema, SolanaAddressSchema, SubAssetsBalancesConfigSchema, SubAssetsTokenSchema, SubDTaoBalancesConfigSchema, SubDTaoTokenSchema, SubForeignAssetsBalancesConfigSchema, SubForeignAssetsTokenSchema, SubHydrationBalancesConfigSchema, SubHydrationTokenSchema, SubNativeBalancesConfigSchema, SubNativeTokenSchema, SubPsp22BalancesConfigSchema, SubPsp22TokenSchema, SubTokensBalancesConfigSchema, SubTokensTokenSchema, TOKEN_TYPE, TokenBaseSchema, TokenSchema, TokenSchemaBase, TokenTypeSchema, evmErc20TokenId, evmNativeTokenId, evmUniswapV2TokenId, getBlockExplorerLabel, getBlockExplorerUrl, getBlockExplorerUrls, getChaindataDbV3, getCleanNetwork, getCleanToken, getGithubBittensorHotkeyAssetUrl, getGithubTokenLogoUrl, getGithubTokenLogoUrlByCoingeckoId, getNetworkGenesisHash, getRemoteChaindata$, isAccountPlatformCompatibleWithNetwork, isNativeToken, isNativeTokenType, isNetworkCustom, isNetworkDot, isNetworkEth, isNetworkInPlatforms, isNetworkKnown, isNetworkOfPlatform, isNetworkSol, isTokenCustom, isTokenDot, isTokenEth, isTokenEvmErc20, isTokenEvmNative, isTokenEvmUniswapV2, isTokenIdInTypes, isTokenIdOfType, isTokenInTypes, isTokenKnown, isTokenNeedExistentialDeposit, isTokenOfPlatform, isTokenOfType, isTokenSol, isTokenSolSpl, isTokenSolToken2022, isTokenSubAssets, isTokenSubDTao, isTokenSubForeignAssets, isTokenSubHydration, isTokenSubNative, isTokenSubPsp22, isTokenSubTokens, isTokenTestnet, networkIdFromTokenId, parseEvmErc20TokenId, parseEvmNativeTokenId, parseEvmUniswapV2TokenId, parseSolNativeTokenId, parseSolSplTokenId, parseSolToken2022TokenId, parseSubAssetTokenId, parseSubDTaoTokenId, parseSubForeignAssetTokenId, parseSubHydrationTokenId, parseSubNativeTokenId, parseSubPsp22TokenId, parseSubTokensTokenId, parseTokenId, solNativeTokenId, solSplTokenId, solToken2022TokenId, subAssetTokenId, subDTaoTokenId, subForeignAssetTokenId, subHydrationTokenId, subNativeTokenId, subPsp22TokenId, subTokensTokenId };
|
|
8859
8935
|
|
|
8860
8936
|
//# sourceMappingURL=index.mjs.map
|