@defillama/sdk 5.0.249 → 5.0.251
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/build/abi/multicall3.js +2 -0
- package/build/providers.json +1 -1
- package/build/util/chainUtils/data.json +17 -4
- package/build/util/indexer.d.ts +1 -0
- package/build/util/logs.js +24 -11
- package/package.json +2 -1
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"astar": "Astar",
|
|
47
47
|
"aster": "Aster",
|
|
48
48
|
"astrzk": "Astar zkEVM",
|
|
49
|
+
"ault": "Ault",
|
|
49
50
|
"aura": "Aura Network",
|
|
50
51
|
"aurora": "Aurora",
|
|
51
52
|
"avax": "Avalanche",
|
|
@@ -107,7 +108,7 @@
|
|
|
107
108
|
"celestia": "Celestia",
|
|
108
109
|
"celo": "Celo",
|
|
109
110
|
"chainflip": "Chainflip",
|
|
110
|
-
"chainx": "BEVM",
|
|
111
|
+
"chainx": "BEVM Canary",
|
|
111
112
|
"cheqd": "Cheqd",
|
|
112
113
|
"chia": "Chia",
|
|
113
114
|
"chihuahua": "Chihuahua",
|
|
@@ -174,8 +175,9 @@
|
|
|
174
175
|
"edgex": "edgeX L1",
|
|
175
176
|
"elastos": "Elastos",
|
|
176
177
|
"elrond": "MultiversX",
|
|
177
|
-
"elsm": "Elysium",
|
|
178
|
+
"elsm": "Elysium Blockchain",
|
|
178
179
|
"elys": "Elys",
|
|
180
|
+
"elysium": "Elysium",
|
|
179
181
|
"embr": "Embr",
|
|
180
182
|
"empire": "Empire",
|
|
181
183
|
"energi": "Energi",
|
|
@@ -283,6 +285,7 @@
|
|
|
283
285
|
"inri": "INRI",
|
|
284
286
|
"interlay": "Interlay",
|
|
285
287
|
"intuition": "Intuition",
|
|
288
|
+
"iopn": "IOPn",
|
|
286
289
|
"iota": "IOTA",
|
|
287
290
|
"iotaevm": "IOTA EVM",
|
|
288
291
|
"iotex": "IoTeX",
|
|
@@ -333,6 +336,7 @@
|
|
|
333
336
|
"lukso": "LUKSO",
|
|
334
337
|
"lumia": "Lumia",
|
|
335
338
|
"lung": "Lung",
|
|
339
|
+
"luxa": "Luxa",
|
|
336
340
|
"lyra": "Derive Chain",
|
|
337
341
|
"m": "MemeCore",
|
|
338
342
|
"manta": "Manta",
|
|
@@ -616,6 +620,7 @@
|
|
|
616
620
|
"xion": "XION",
|
|
617
621
|
"xlayer": "X Layer",
|
|
618
622
|
"xo": "XO",
|
|
623
|
+
"xom": "Omnicoin",
|
|
619
624
|
"xone": "Xone Chain",
|
|
620
625
|
"xp": "Xphere",
|
|
621
626
|
"xpla": "XPLA",
|
|
@@ -684,6 +689,7 @@
|
|
|
684
689
|
"Astar": "astar",
|
|
685
690
|
"Astar zkEVM": "astrzk",
|
|
686
691
|
"Aster": "aster",
|
|
692
|
+
"Ault": "ault",
|
|
687
693
|
"Aura Network": "aura",
|
|
688
694
|
"Aurora": "aurora",
|
|
689
695
|
"Avalanche": "avax",
|
|
@@ -692,7 +698,8 @@
|
|
|
692
698
|
"B3": "b3",
|
|
693
699
|
"BCHyper": "bcypher",
|
|
694
700
|
"BESC Hyperchain": "besc",
|
|
695
|
-
"BEVM": "
|
|
701
|
+
"BEVM": "bevm",
|
|
702
|
+
"BEVM Canary": "chainx",
|
|
696
703
|
"BOB": "bob",
|
|
697
704
|
"BOT Chain": "bot",
|
|
698
705
|
"BSC": "bsc",
|
|
@@ -824,7 +831,9 @@
|
|
|
824
831
|
"Electroneum": "etn",
|
|
825
832
|
"Elrond": "elrond",
|
|
826
833
|
"Elys": "elys",
|
|
827
|
-
"Elysium": "
|
|
834
|
+
"Elysium": "elysium",
|
|
835
|
+
"Elysium Blockchain": "elsm",
|
|
836
|
+
"Elysium Kinetiq": "elysium",
|
|
828
837
|
"Embr": "embr",
|
|
829
838
|
"Empire": "empire",
|
|
830
839
|
"Endurance": "ace",
|
|
@@ -917,6 +926,7 @@
|
|
|
917
926
|
"ICP": "icp",
|
|
918
927
|
"IDEX": "idex",
|
|
919
928
|
"INRI": "inri",
|
|
929
|
+
"IOPn": "iopn",
|
|
920
930
|
"IOTA": "iota",
|
|
921
931
|
"IOTA EVM": "iotaevm",
|
|
922
932
|
"IRISnet": "iris",
|
|
@@ -980,6 +990,7 @@
|
|
|
980
990
|
"Loop": "loop",
|
|
981
991
|
"Lumia": "lumia",
|
|
982
992
|
"Lung": "lung",
|
|
993
|
+
"Luxa": "luxa",
|
|
983
994
|
"Lyra Chain": "lyra",
|
|
984
995
|
"MANTRA": "mantra",
|
|
985
996
|
"MAP Protocol": "map",
|
|
@@ -1070,6 +1081,7 @@
|
|
|
1070
1081
|
"Off Chain": "off_chain",
|
|
1071
1082
|
"Omax": "omax",
|
|
1072
1083
|
"OmniFlix": "omniflix",
|
|
1084
|
+
"Omnicoin": "xom",
|
|
1073
1085
|
"Ontology": "ontology",
|
|
1074
1086
|
"OntologyEVM": "ontology_evm",
|
|
1075
1087
|
"Onus": "onus",
|
|
@@ -1334,6 +1346,7 @@
|
|
|
1334
1346
|
"ancient8": "2026-06-19",
|
|
1335
1347
|
"artela": "2026-06-05",
|
|
1336
1348
|
"astrzk": "2026-02-12",
|
|
1349
|
+
"bevm_canary": "2026-01-20",
|
|
1337
1350
|
"bitrock": "2026-02-12",
|
|
1338
1351
|
"blast": "2026-10-26",
|
|
1339
1352
|
"boba_bnb": "2026-01-20",
|
package/build/util/indexer.d.ts
CHANGED
package/build/util/logs.js
CHANGED
|
@@ -39,7 +39,8 @@ async function getLogs(options) {
|
|
|
39
39
|
// If the caller demands indexer only but it is disabled, fail fast
|
|
40
40
|
if (onlyIndexer && !(0, indexer_1.isIndexerEnabled)(chain))
|
|
41
41
|
throw new Error("onlyIndexer is true, but indexer is not enabled");
|
|
42
|
-
|
|
42
|
+
const indexerFillsCache = cacheInCloud && !skipIndexer && (0, indexer_1.isIndexerEnabled)(chain);
|
|
43
|
+
if (!skipIndexer && (0, indexer_1.isIndexerEnabled)(chain) && !indexerFillsCache) {
|
|
43
44
|
try {
|
|
44
45
|
const response = await (0, indexer_1.getLogs)({
|
|
45
46
|
...options,
|
|
@@ -74,7 +75,7 @@ async function getLogs(options) {
|
|
|
74
75
|
}
|
|
75
76
|
/* ------------------------ Multi-target parallel ------------------------- */
|
|
76
77
|
if (targets === null || targets === void 0 ? void 0 : targets.length) {
|
|
77
|
-
const baseOpts = { ...options, fromBlock, toBlock, skipIndexer:
|
|
78
|
+
const baseOpts = { ...options, fromBlock, toBlock, skipIndexer: !indexerFillsCache };
|
|
78
79
|
delete baseOpts.targets;
|
|
79
80
|
const jobs = targets.map((address, idx) => ({ idx, address }));
|
|
80
81
|
const proc = async (job) => {
|
|
@@ -157,15 +158,7 @@ async function getLogs(options) {
|
|
|
157
158
|
toBlock = getBufferedToBlock(toBlock, head);
|
|
158
159
|
if (debugMode)
|
|
159
160
|
console.time(dbgKey);
|
|
160
|
-
const
|
|
161
|
-
chain,
|
|
162
|
-
target: target,
|
|
163
|
-
topic: topic,
|
|
164
|
-
keys,
|
|
165
|
-
topics,
|
|
166
|
-
fromBlock,
|
|
167
|
-
toBlock,
|
|
168
|
-
});
|
|
161
|
+
const newLogs = await fetchLogs(fromBlock, toBlock);
|
|
169
162
|
if (debugMode) {
|
|
170
163
|
console.timeEnd(dbgKey);
|
|
171
164
|
(0, debugLog_1.debugLog)("Logs pulled", chain, target, newLogs.length);
|
|
@@ -202,6 +195,26 @@ async function getLogs(options) {
|
|
|
202
195
|
await (0, cache_1.writeCache)(getFile(), { caches: storeCaches, version: currentVersion }, { skipR2CacheWrite: !cacheInCloud, skipCompression: !cacheInCloud });
|
|
203
196
|
}
|
|
204
197
|
}
|
|
198
|
+
async function fetchLogs(fromBlock, toBlock) {
|
|
199
|
+
if (indexerFillsCache) {
|
|
200
|
+
try {
|
|
201
|
+
return await (0, indexer_1.getLogs)({
|
|
202
|
+
...options, chain, target, topics, fromBlock, toBlock,
|
|
203
|
+
targets: undefined, fromTimestamp: undefined, toTimestamp: undefined,
|
|
204
|
+
all: true, flatten: true, processor: undefined, collect: undefined, offset: 0, limit: undefined,
|
|
205
|
+
eventAbi: undefined, entireLog: true, parseLog: false, onlyArgs: false,
|
|
206
|
+
cacheInCloud: false, skipCache: true,
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
catch (e) {
|
|
210
|
+
(0, debugLog_1.debugLog)("Error in indexer getLogs", e.message);
|
|
211
|
+
if (onlyIndexer)
|
|
212
|
+
throw e;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
const { output } = await (0, _1.getLogs)({ chain, target: target, topic: topic, keys, topics, fromBlock, toBlock });
|
|
216
|
+
return output;
|
|
217
|
+
}
|
|
205
218
|
function dedupLogs(...arr) {
|
|
206
219
|
const seen = new Set();
|
|
207
220
|
return arr.flat().filter((i) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defillama/sdk",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.251",
|
|
4
4
|
"description": "SDK for calculating TVL",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"test-indexer-unit": "jest --runInBand --runTestsByPath src/util/indexer.test.ts src/util/indexer.partialSync.test.ts src/util/indexerSql.test.ts",
|
|
16
16
|
"update-providers": "ts-node src/util/updateProviderList.ts",
|
|
17
17
|
"update-chain-labels": "ts-node src/util/updateChainLabels.ts",
|
|
18
|
+
"update-repos": "bash ./scripts/updateRepos.sh",
|
|
18
19
|
"remove-rpcs": "ts-node src/util/removeRedundantRPCs.ts",
|
|
19
20
|
"verify-package": "node scripts/verifyPackage.js",
|
|
20
21
|
"prepublishOnly": "npm run build && npm run verify-package"
|