@defillama/sdk 5.0.98 → 5.0.99
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 +13 -0
- package/build/generalUtil.js +1 -1
- package/build/providers.json +1116 -1
- package/build/util/indexer.js +1 -1
- package/build/util/logs.d.ts +2 -2
- package/build/util/logs.js +5 -8
- package/package.json +1 -1
package/build/util/indexer.js
CHANGED
|
@@ -164,7 +164,7 @@ async function getLogs({ chain = 'ethereum', topic, topics, fromBlock, toBlock,
|
|
|
164
164
|
if (topic)
|
|
165
165
|
topic = (0, logs_1.toFilterTopic)(topic);
|
|
166
166
|
else if (eventAbi)
|
|
167
|
-
topic = (0, logs_1.toFilterTopic)(
|
|
167
|
+
topic = (0, logs_1.toFilterTopic)(eventAbi);
|
|
168
168
|
let hasMore = true;
|
|
169
169
|
let logs = [];
|
|
170
170
|
const debugTimeKey = `Indexer-getLogs-${chain}-${topic}-${address}_${Math.random()}`;
|
package/build/util/logs.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventLog
|
|
1
|
+
import { EventLog } from "ethers";
|
|
2
2
|
import { Address } from "../types";
|
|
3
3
|
export type GetLogsOptions = {
|
|
4
4
|
target?: Address;
|
|
@@ -24,7 +24,7 @@ export type GetLogsOptions = {
|
|
|
24
24
|
debugMode?: boolean;
|
|
25
25
|
};
|
|
26
26
|
export declare function getLogs(options: GetLogsOptions): Promise<EventLog[] | EventLog[][] | any[]>;
|
|
27
|
-
export declare function toFilterTopic(topic: string
|
|
27
|
+
export declare function toFilterTopic(topic: string): string;
|
|
28
28
|
export type logCache = {
|
|
29
29
|
logs: EventLog[];
|
|
30
30
|
metadata: {
|
package/build/util/logs.js
CHANGED
|
@@ -58,7 +58,7 @@ async function getLogs(options) {
|
|
|
58
58
|
if (topic)
|
|
59
59
|
topic = toFilterTopic(topic);
|
|
60
60
|
else if (eventAbi)
|
|
61
|
-
topic = toFilterTopic(
|
|
61
|
+
topic = toFilterTopic(eventAbi);
|
|
62
62
|
else {
|
|
63
63
|
throw new Error('eventAbi | topic | topics are required');
|
|
64
64
|
}
|
|
@@ -179,15 +179,12 @@ async function getLogs(options) {
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
exports.getLogs = getLogs;
|
|
182
|
-
// we need to form filter topic with indexed keyword, else it messes up generated topic string
|
|
183
182
|
function toFilterTopic(topic) {
|
|
184
|
-
if (typeof topic === 'string') {
|
|
185
|
-
|
|
186
|
-
return topic;
|
|
187
|
-
topic = new ethers_1.Interface([topic]);
|
|
183
|
+
if (typeof topic === 'string' && topic.startsWith('0x')) {
|
|
184
|
+
return topic;
|
|
188
185
|
}
|
|
189
|
-
const fragment = topic
|
|
190
|
-
return (0, ethers_1.id)(
|
|
186
|
+
const fragment = ethers_1.EventFragment.from(topic);
|
|
187
|
+
return (0, ethers_1.id)(fragment.format());
|
|
191
188
|
}
|
|
192
189
|
exports.toFilterTopic = toFilterTopic;
|
|
193
190
|
exports.default = getLogs;
|