@defillama/sdk 2.3.108 → 2.3.109
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/multicall.js +1 -0
- package/build/util/index.js +2 -2
- package/package.json +1 -1
package/build/abi/multicall.js
CHANGED
package/build/util/index.js
CHANGED
|
@@ -130,7 +130,7 @@ function lookupBlock(timestamp, extraParams) {
|
|
|
130
130
|
return [4 /*yield*/, getBlock(provider, "latest", extraParams.chain)];
|
|
131
131
|
case 1:
|
|
132
132
|
lastBlock = _f.sent();
|
|
133
|
-
if ((lastBlock.timestamp - timestamp) < -30 * 60) {
|
|
133
|
+
if (extraParams.chain !== 'bsc' && (lastBlock.timestamp - timestamp) < -30 * 60) {
|
|
134
134
|
throw new Error("Last block of chain \"" + extraParams.chain + "\" is further than 30 minutes into the past. Provider is \"" + ((_b = (_a = provider) === null || _a === void 0 ? void 0 : _a.connection) === null || _b === void 0 ? void 0 : _b.url) + "\"");
|
|
135
135
|
}
|
|
136
136
|
if (Math.abs(lastBlock.timestamp - timestamp) < 60) {
|
|
@@ -160,7 +160,7 @@ function lookupBlock(timestamp, extraParams) {
|
|
|
160
160
|
if (high - low > 4) return [3 /*break*/, 2];
|
|
161
161
|
_f.label = 5;
|
|
162
162
|
case 5:
|
|
163
|
-
if (Math.abs(block.timestamp - timestamp) > 3600) {
|
|
163
|
+
if (extraParams.chain !== 'bsc' && Math.abs(block.timestamp - timestamp) > 3600) {
|
|
164
164
|
throw new Error("Block selected is more than 1 hour away from the requested timestamp");
|
|
165
165
|
}
|
|
166
166
|
return [2 /*return*/, {
|