@defillama/sdk 5.0.250 → 5.0.252
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/index.js +37 -2
- package/build/abi/tron.js +2 -2
- package/build/providers.json +1 -1
- package/build/util/chainUtils/data.json +12 -5
- package/build/util/env.js +1 -1
- package/build/util/indexer.d.ts +1 -0
- package/build/util/logs.js +24 -11
- package/package.json +2 -1
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"celestia": "Celestia",
|
|
109
109
|
"celo": "Celo",
|
|
110
110
|
"chainflip": "Chainflip",
|
|
111
|
-
"chainx": "BEVM",
|
|
111
|
+
"chainx": "BEVM Canary",
|
|
112
112
|
"cheqd": "Cheqd",
|
|
113
113
|
"chia": "Chia",
|
|
114
114
|
"chihuahua": "Chihuahua",
|
|
@@ -175,8 +175,9 @@
|
|
|
175
175
|
"edgex": "edgeX L1",
|
|
176
176
|
"elastos": "Elastos",
|
|
177
177
|
"elrond": "MultiversX",
|
|
178
|
-
"elsm": "Elysium",
|
|
178
|
+
"elsm": "Elysium Blockchain",
|
|
179
179
|
"elys": "Elys",
|
|
180
|
+
"elysium": "Elysium",
|
|
180
181
|
"embr": "Embr",
|
|
181
182
|
"empire": "Empire",
|
|
182
183
|
"energi": "Energi",
|
|
@@ -525,6 +526,7 @@
|
|
|
525
526
|
"solana": "Solana",
|
|
526
527
|
"sommelier": "Sommelier",
|
|
527
528
|
"somnia": "Somnia",
|
|
529
|
+
"somnia_tokyo": "Somnia Tokyo",
|
|
528
530
|
"soneium": "Soneium",
|
|
529
531
|
"songbird": "Songbird",
|
|
530
532
|
"sonic": "Sonic",
|
|
@@ -697,7 +699,8 @@
|
|
|
697
699
|
"B3": "b3",
|
|
698
700
|
"BCHyper": "bcypher",
|
|
699
701
|
"BESC Hyperchain": "besc",
|
|
700
|
-
"BEVM": "
|
|
702
|
+
"BEVM": "bevm",
|
|
703
|
+
"BEVM Canary": "chainx",
|
|
701
704
|
"BOB": "bob",
|
|
702
705
|
"BOT Chain": "bot",
|
|
703
706
|
"BSC": "bsc",
|
|
@@ -829,7 +832,9 @@
|
|
|
829
832
|
"Electroneum": "etn",
|
|
830
833
|
"Elrond": "elrond",
|
|
831
834
|
"Elys": "elys",
|
|
832
|
-
"Elysium": "
|
|
835
|
+
"Elysium": "elysium",
|
|
836
|
+
"Elysium Blockchain": "elsm",
|
|
837
|
+
"Elysium Kinetiq": "elysium",
|
|
833
838
|
"Embr": "embr",
|
|
834
839
|
"Empire": "empire",
|
|
835
840
|
"Endurance": "ace",
|
|
@@ -1198,6 +1203,7 @@
|
|
|
1198
1203
|
"Solana": "solana",
|
|
1199
1204
|
"Sommelier": "sommelier",
|
|
1200
1205
|
"Somnia": "somnia",
|
|
1206
|
+
"Somnia Tokyo": "somnia_tokyo",
|
|
1201
1207
|
"Soneium": "soneium",
|
|
1202
1208
|
"Songbird": "songbird",
|
|
1203
1209
|
"Sonic": "sonic",
|
|
@@ -1342,6 +1348,8 @@
|
|
|
1342
1348
|
"ancient8": "2026-06-19",
|
|
1343
1349
|
"artela": "2026-06-05",
|
|
1344
1350
|
"astrzk": "2026-02-12",
|
|
1351
|
+
"bevm": "2026-01-20",
|
|
1352
|
+
"bevm_canary": "2026-01-20",
|
|
1345
1353
|
"bitrock": "2026-02-12",
|
|
1346
1354
|
"blast": "2026-10-26",
|
|
1347
1355
|
"boba_bnb": "2026-01-20",
|
|
@@ -1398,7 +1406,6 @@
|
|
|
1398
1406
|
"inri": "2026-08-03",
|
|
1399
1407
|
"interlay": "2026-07-22",
|
|
1400
1408
|
"jbc": "2026-09-01",
|
|
1401
|
-
"kadena": "2026-02-12",
|
|
1402
1409
|
"kardia": "2026-01-20",
|
|
1403
1410
|
"kinto": "2026-03-06",
|
|
1404
1411
|
"kintsugi": "2026-07-22",
|
package/build/util/env.js
CHANGED
|
@@ -33,7 +33,7 @@ const defaultEnvValues = {
|
|
|
33
33
|
KATANA_MULTICALL_CHUNK_SIZE: "50",
|
|
34
34
|
ARC_MULTICALL_CHUNK_SIZE: "50", // moved here from adapters/dimension-adapters env defaults
|
|
35
35
|
INTERNAL_SDK_CACHE_FILE: './cache.json',
|
|
36
|
-
TRON_RPC_CONCURRENCY_LIMIT: '
|
|
36
|
+
TRON_RPC_CONCURRENCY_LIMIT: '1',
|
|
37
37
|
LLAMA_INDEXER_ADDRESS_CHUNK_SIZE: '20',
|
|
38
38
|
LLAMA_INDEXER_TIMEOUT_MS: '300000',
|
|
39
39
|
TRON_WALLET_RPC: 'https://api.trongrid.io',
|
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.252",
|
|
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"
|