@defillama/sdk 5.0.222 → 5.0.224
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/Balances.js +3 -3
- package/build/providers.json +1 -1
- package/build/util/blocks.js +6 -6
- package/build/util/chainUtils/data.json +21 -1
- package/build/util/logs.js +23 -6
- package/package.json +1 -1
package/build/util/blocks.js
CHANGED
|
@@ -157,6 +157,10 @@ async function lookupBlock(timestamp, extraParams) {
|
|
|
157
157
|
const limiter = getChainLimiter(chain);
|
|
158
158
|
return limiter(() => _lookupBlock(timestamp, extraParams));
|
|
159
159
|
}
|
|
160
|
+
const earliestAvailableBlockRange = {
|
|
161
|
+
nibiru: 4 * 1e5, // nibiru hold only the last 400k block data
|
|
162
|
+
evmos: 2 * 1e5,
|
|
163
|
+
};
|
|
160
164
|
async function _lookupBlock(timestamp, extraParams) {
|
|
161
165
|
var _a, _b;
|
|
162
166
|
const { allowedTimeRange = 5 * 60, acceptableBlockImprecision = 10 } = extraParams !== null && extraParams !== void 0 ? extraParams : {};
|
|
@@ -188,13 +192,9 @@ async function _lookupBlock(timestamp, extraParams) {
|
|
|
188
192
|
let imprecision;
|
|
189
193
|
try {
|
|
190
194
|
let firstBlock, lastBlock;
|
|
191
|
-
if ([
|
|
195
|
+
if (!!earliestAvailableBlockRange[chain]) {
|
|
192
196
|
lastBlock = await (0, exports.getLatestBlock)(chain);
|
|
193
|
-
let firstBlockNum = lastBlock.number;
|
|
194
|
-
switch (chain) {
|
|
195
|
-
case 'nibiru': firstBlockNum -= 4 * 1e5; // nibiru hold only the last 400k block data
|
|
196
|
-
case 'evmos': firstBlockNum -= 2 * 1e5; // evmos hold only the last 200k block data
|
|
197
|
-
}
|
|
197
|
+
let firstBlockNum = lastBlock.number - earliestAvailableBlockRange[chain];
|
|
198
198
|
firstBlock = await fetchBlockFromProvider(firstBlockNum, chain);
|
|
199
199
|
}
|
|
200
200
|
else {
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"ancient8": "Ancient8",
|
|
28
28
|
"anubi": "Anubis",
|
|
29
29
|
"ao": "AO",
|
|
30
|
+
"ap3x": "Apex Fusion",
|
|
30
31
|
"apechain": "ApeChain",
|
|
31
32
|
"appchain": "Appchain",
|
|
32
33
|
"aptos": "Aptos",
|
|
@@ -75,6 +76,7 @@
|
|
|
75
76
|
"boba_bnb": "Boba_Bnb",
|
|
76
77
|
"bone": "Bone",
|
|
77
78
|
"bostrom": "Bostrom",
|
|
79
|
+
"bot": "BOT Chain",
|
|
78
80
|
"bouncebit": "BounceBit",
|
|
79
81
|
"bsc": "BSC",
|
|
80
82
|
"bsquared": "BSquared",
|
|
@@ -105,6 +107,7 @@
|
|
|
105
107
|
"civitia": "Civitia",
|
|
106
108
|
"clv": "CLV",
|
|
107
109
|
"cmp": "CMP",
|
|
110
|
+
"codex": "Codex",
|
|
108
111
|
"comdex": "Comdex",
|
|
109
112
|
"concordium": "Concordium",
|
|
110
113
|
"conflux": "Conflux",
|
|
@@ -183,6 +186,7 @@
|
|
|
183
186
|
"everscale": "Everscale",
|
|
184
187
|
"evmos": "Evmos",
|
|
185
188
|
"fantom": "Fantom",
|
|
189
|
+
"fetchhub": "Fetch Hub",
|
|
186
190
|
"fhe": "Mind Network",
|
|
187
191
|
"filecoin": "Filecoin",
|
|
188
192
|
"findora": "Findora",
|
|
@@ -256,6 +260,7 @@
|
|
|
256
260
|
"iota": "IOTA",
|
|
257
261
|
"iotaevm": "IOTA EVM",
|
|
258
262
|
"iotex": "IoTeX",
|
|
263
|
+
"irys_mainnet_beta": "Irys",
|
|
259
264
|
"islm": "HAQQ",
|
|
260
265
|
"jbc": "JBC",
|
|
261
266
|
"joc": "JOC",
|
|
@@ -276,9 +281,11 @@
|
|
|
276
281
|
"kekchain": "Kekchain",
|
|
277
282
|
"kinto": "Kinto",
|
|
278
283
|
"kintsugi": "Kintsugi",
|
|
284
|
+
"kiteai": "KiteAI",
|
|
279
285
|
"klaytn": "Kaia",
|
|
280
286
|
"kopi": "Kopi",
|
|
281
287
|
"kroma": "Kroma",
|
|
288
|
+
"krown": "Krown Network",
|
|
282
289
|
"kujira": "Kujira",
|
|
283
290
|
"kusama": "Kusama",
|
|
284
291
|
"lac": "LaChain Network",
|
|
@@ -434,6 +441,7 @@
|
|
|
434
441
|
"reya": "ReyaChain",
|
|
435
442
|
"ripple": "XRPL",
|
|
436
443
|
"rise": "RISE",
|
|
444
|
+
"rls": "Rayls",
|
|
437
445
|
"robinhood": "Robinhood Chain",
|
|
438
446
|
"robonomics": "Robonomics",
|
|
439
447
|
"rollux": "Rollux",
|
|
@@ -487,6 +495,7 @@
|
|
|
487
495
|
"starknet": "Starknet",
|
|
488
496
|
"stellar": "Stellar",
|
|
489
497
|
"step": "Step",
|
|
498
|
+
"strat": "Strat",
|
|
490
499
|
"stratis": "Stratis",
|
|
491
500
|
"strato": "Strato",
|
|
492
501
|
"stride": "Stride",
|
|
@@ -533,6 +542,7 @@
|
|
|
533
542
|
"velas": "Velas",
|
|
534
543
|
"venom": "Venom",
|
|
535
544
|
"verus": "Verus",
|
|
545
|
+
"vfl": "zkVerify",
|
|
536
546
|
"vinu": "VinuChain",
|
|
537
547
|
"virbicoin": "VirBiCoin",
|
|
538
548
|
"vision": "Vision",
|
|
@@ -603,6 +613,7 @@
|
|
|
603
613
|
"Ancient8": "ancient8",
|
|
604
614
|
"Anubis": "anubi",
|
|
605
615
|
"ApeChain": "apechain",
|
|
616
|
+
"Apex Fusion": "ap3x",
|
|
606
617
|
"Appchain": "appchain",
|
|
607
618
|
"Aptos": "aptos",
|
|
608
619
|
"Arbitrum": "arbitrum",
|
|
@@ -625,6 +636,7 @@
|
|
|
625
636
|
"BESC Hyperchain": "besc",
|
|
626
637
|
"BEVM": "chainx",
|
|
627
638
|
"BOB": "bob",
|
|
639
|
+
"BOT Chain": "bot",
|
|
628
640
|
"BSC": "bsc",
|
|
629
641
|
"BSV Blockchain": "bsv",
|
|
630
642
|
"BSquared": "bsquared",
|
|
@@ -685,6 +697,7 @@
|
|
|
685
697
|
"Chromia": "chromia",
|
|
686
698
|
"Citrea": "citrea",
|
|
687
699
|
"Civitia": "civitia",
|
|
700
|
+
"Codex": "codex",
|
|
688
701
|
"Comdex": "comdex",
|
|
689
702
|
"Concordium": "concordium",
|
|
690
703
|
"Conflux": "conflux",
|
|
@@ -764,6 +777,7 @@
|
|
|
764
777
|
"Evmos": "evmos",
|
|
765
778
|
"FSC": "fsc",
|
|
766
779
|
"Fantom": "fantom",
|
|
780
|
+
"Fetch Hub": "fetchhub",
|
|
767
781
|
"Filecoin": "filecoin",
|
|
768
782
|
"Findora": "findora",
|
|
769
783
|
"Firechain": "firechain",
|
|
@@ -839,6 +853,7 @@
|
|
|
839
853
|
"Interlay": "interlay",
|
|
840
854
|
"Intuition": "intuition",
|
|
841
855
|
"IoTeX": "iotex",
|
|
856
|
+
"Irys": "irys_mainnet_beta",
|
|
842
857
|
"JBC": "jbc",
|
|
843
858
|
"JOC": "joc",
|
|
844
859
|
"Joltify": "joltify",
|
|
@@ -860,9 +875,11 @@
|
|
|
860
875
|
"Kekchain": "kekchain",
|
|
861
876
|
"Kinto": "kinto",
|
|
862
877
|
"Kintsugi": "kintsugi",
|
|
878
|
+
"KiteAI": "kiteai",
|
|
863
879
|
"Klaytn": "klaytn",
|
|
864
880
|
"Kopi": "kopi",
|
|
865
881
|
"Kroma": "kroma",
|
|
882
|
+
"Krown Network": "krown",
|
|
866
883
|
"Kucoin": "kcc",
|
|
867
884
|
"Kujira": "kujira",
|
|
868
885
|
"Kusama": "kusama",
|
|
@@ -1031,6 +1048,7 @@
|
|
|
1031
1048
|
"Rangers": "rpg",
|
|
1032
1049
|
"Rari": "rari",
|
|
1033
1050
|
"Ravencoin": "rvn",
|
|
1051
|
+
"Rayls": "rls",
|
|
1034
1052
|
"Redbelly": "rbn",
|
|
1035
1053
|
"Redstone": "redstone",
|
|
1036
1054
|
"Reef": "reef",
|
|
@@ -1089,6 +1107,7 @@
|
|
|
1089
1107
|
"Stellar": "stellar",
|
|
1090
1108
|
"Step": "step",
|
|
1091
1109
|
"Story": "sty",
|
|
1110
|
+
"Strat": "strat",
|
|
1092
1111
|
"Stratis": "stratis",
|
|
1093
1112
|
"Strato": "strato",
|
|
1094
1113
|
"Stride": "stride",
|
|
@@ -1200,7 +1219,8 @@
|
|
|
1200
1219
|
"zkLink": "zklink",
|
|
1201
1220
|
"zkLink Nova": "zklink",
|
|
1202
1221
|
"zkSync": "zksync",
|
|
1203
|
-
"zkSync Era": "era"
|
|
1222
|
+
"zkSync Era": "era",
|
|
1223
|
+
"zkVerify": "vfl"
|
|
1204
1224
|
},
|
|
1205
1225
|
"deadChains": {
|
|
1206
1226
|
"airdao": "2026-01-20",
|
package/build/util/logs.js
CHANGED
|
@@ -32,9 +32,6 @@ async function getLogs(options) {
|
|
|
32
32
|
const response = await (0, indexer_1.getLogs)({
|
|
33
33
|
...options,
|
|
34
34
|
all: true, // internal service – always fetch full set
|
|
35
|
-
parseLog: options.parseLog,
|
|
36
|
-
eventAbi: options.eventAbi,
|
|
37
|
-
onlyArgs: options.onlyArgs,
|
|
38
35
|
});
|
|
39
36
|
return response;
|
|
40
37
|
}
|
|
@@ -258,8 +255,12 @@ function toFilterTopic(topic) {
|
|
|
258
255
|
exports.default = getLogs;
|
|
259
256
|
async function getLogParams(options, isIndexerCall = false) {
|
|
260
257
|
let { target, chain = "ethereum", fromBlock, toBlock, fromTimestamp, toTimestamp, eventAbi, topic, topics, extraTopics, entireLog = false, onlyArgs = false, targets = [], noTarget = false, parseLog = false, allowParseFailure = false, processor, flatten = false, } = options;
|
|
261
|
-
|
|
258
|
+
let parseLogWasImplicit = false;
|
|
259
|
+
let parseFailureWarned = false;
|
|
260
|
+
if (eventAbi && !Object.prototype.hasOwnProperty.call(options, "parseLog")) {
|
|
262
261
|
parseLog = true;
|
|
262
|
+
parseLogWasImplicit = true;
|
|
263
|
+
}
|
|
263
264
|
// keep raw log if entireLog=true
|
|
264
265
|
if (entireLog)
|
|
265
266
|
onlyArgs = false;
|
|
@@ -354,9 +355,25 @@ async function getLogParams(options, isIndexerCall = false) {
|
|
|
354
355
|
log.args = undefined;
|
|
355
356
|
}
|
|
356
357
|
else {
|
|
357
|
-
|
|
358
|
-
|
|
358
|
+
const parseFailureTolerated = allowParseFailure || (entireLog && parseLogWasImplicit);
|
|
359
|
+
try {
|
|
360
|
+
parsed = iface.parseLog(log);
|
|
361
|
+
}
|
|
362
|
+
catch (e) {
|
|
363
|
+
if (!parseFailureTolerated)
|
|
364
|
+
throw e;
|
|
365
|
+
parsed = null;
|
|
366
|
+
}
|
|
367
|
+
if (!parsed && !parseFailureTolerated)
|
|
359
368
|
throw new Error(`Failed to parse log: ${JSON.stringify(log.transactionHash)}`);
|
|
369
|
+
// tolerated failures must stay visible: a targeted call where logs silently fail
|
|
370
|
+
// to decode is usually a bug in the caller eventAbi (warn once per call)
|
|
371
|
+
if (!parsed && !allowParseFailure && !parseFailureWarned) {
|
|
372
|
+
parseFailureWarned = true;
|
|
373
|
+
console.warn(`[sdk.getLogs] some logs did not decode against the provided eventAbi and were returned without .args ` +
|
|
374
|
+
`(chain=${chain}, topic0=${topic}, firstTx=${log.transactionHash}). ` +
|
|
375
|
+
`Pass parseLog: true to make this an error, or allowParseFailure: true to silence this warning.`);
|
|
376
|
+
}
|
|
360
377
|
// Enrich args with named properties to match Viem output structure
|
|
361
378
|
if ((parsed === null || parsed === void 0 ? void 0 : parsed.args) && event && iface) {
|
|
362
379
|
log.args = (0, logs_decode_shared_1.enrichEthersArgsWithNamedProperties)(parsed.args, event, iface);
|