Skip to content

Commit e7c8c21

Browse files
committed
Revert "use indexer (#449)"
This reverts commit 268ae37.
1 parent 268ae37 commit e7c8c21

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

src/helpers/processTransactions.ts

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { getLogs } from "@defillama/sdk/build/util/logs";
2-
import { isIndexerEnabled } from "@defillama/sdk/build/util/indexer";
1+
import { getLogs } from "@defillama/sdk/build/util";
32
import { ethers } from "ethers";
43
import { Chain } from "@defillama/sdk/build/general";
54
import { get } from "lodash";
@@ -126,16 +125,17 @@ export const getTxDataFromEVMEventLogs = async (
126125
let logs = [] as any[];
127126
for (let i = 0; i < 5; i++) {
128127
try {
129-
const startTime = Date.now();
130-
logs = await getLogs({
131-
target: target ?? undefined,
132-
topic: topic,
133-
fromBlock: fromBlock,
134-
toBlock: toBlock,
135-
topics: topics as string[],
136-
chain: overriddenChain,
137-
noTarget: !target,
138-
});
128+
logs = (
129+
await getLogs({
130+
target: target!,
131+
topic: topic,
132+
keys: [],
133+
fromBlock: fromBlock,
134+
toBlock: toBlock,
135+
topics: topics as string[],
136+
chain: overriddenChain,
137+
})
138+
).output;
139139
//console.log(logs)
140140
break;
141141
} catch (e) {
@@ -197,10 +197,7 @@ export const getTxDataFromEVMEventLogs = async (
197197
}
198198
Object.entries(argKeys).map(([eventKey, argKey]) => {
199199
// @ts-ignore
200-
let value = argGetters?.[eventKey]?.(args) || get(args, argKey);
201-
if (eventKey === "amount" && (typeof value === "string" || typeof value === "bigint")) {
202-
value = ethers.BigNumber.from(value);
203-
}
200+
const value = argGetters?.[eventKey]?.(args) || get(args, argKey);
204201
if (typeof value !== EventKeyTypes[eventKey] && !Array.isArray(value)) {
205202
throw new Error(
206203
`Type of ${eventKey} retrieved using ${argKey} is ${typeof value} when it must be ${

0 commit comments

Comments
 (0)