|
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"; |
3 | 2 | import { ethers } from "ethers"; |
4 | 3 | import { Chain } from "@defillama/sdk/build/general"; |
5 | 4 | import { get } from "lodash"; |
@@ -126,16 +125,17 @@ export const getTxDataFromEVMEventLogs = async ( |
126 | 125 | let logs = [] as any[]; |
127 | 126 | for (let i = 0; i < 5; i++) { |
128 | 127 | 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; |
139 | 139 | //console.log(logs) |
140 | 140 | break; |
141 | 141 | } catch (e) { |
@@ -197,10 +197,7 @@ export const getTxDataFromEVMEventLogs = async ( |
197 | 197 | } |
198 | 198 | Object.entries(argKeys).map(([eventKey, argKey]) => { |
199 | 199 | // @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); |
204 | 201 | if (typeof value !== EventKeyTypes[eventKey] && !Array.isArray(value)) { |
205 | 202 | throw new Error( |
206 | 203 | `Type of ${eventKey} retrieved using ${argKey} is ${typeof value} when it must be ${ |
|
0 commit comments