@defillama/sdk 5.0.2 → 5.0.3
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/general.js +2 -1
- package/build/util/index.js +2 -0
- package/package.json +1 -1
package/build/general.js
CHANGED
|
@@ -69,7 +69,8 @@ function createProvider(name, rpcString, chainId) {
|
|
|
69
69
|
* any other value is in ms. (default: ``250``)
|
|
70
70
|
*/
|
|
71
71
|
var batchMaxSize = 10 * (1024 * 1024); // 10Mb
|
|
72
|
-
|
|
72
|
+
// some rpcs throw error if batchMaxCount is set higher than 100
|
|
73
|
+
var jsonRpcApiProviderOptions = { staticNetwork: true, batchStallTime: 42, batchMaxSize: batchMaxSize, batchMaxCount: 99, cacheTimeout: 5 * 1000 };
|
|
73
74
|
if (url.startsWith('wss://')) {
|
|
74
75
|
delete jsonRpcApiProviderOptions.batchMaxCount;
|
|
75
76
|
return new ethers_1.ethers.WebSocketProvider(url, networkish, jsonRpcApiProviderOptions);
|
package/build/util/index.js
CHANGED
|
@@ -129,6 +129,8 @@ function getLogs(params) {
|
|
|
129
129
|
output: logs.map(function (log) { return log.topics; })
|
|
130
130
|
}];
|
|
131
131
|
}
|
|
132
|
+
// ethers v5 logs had this but not ethers v6, so adding field to keep it compatible
|
|
133
|
+
logs.forEach(function (log) { var _a; return log.logIndex = (_a = log.logIndex) !== null && _a !== void 0 ? _a : log.index; });
|
|
132
134
|
return [2 /*return*/, {
|
|
133
135
|
output: logs
|
|
134
136
|
}];
|