diff --git a/README.md b/README.md index ec4e49b0..0ad94dd1 100644 --- a/README.md +++ b/README.md @@ -112,9 +112,9 @@ syntax: `npm run {script-name} {startTimestamp} {endTimestamp} {bridgeName}` Example: ``` -npm run adapter arbitrum 1704690402 1704949602 -npm run aggregate arbitrum 1704690402 1704949602 -npm run daily-volume arbitrum 1704690402 1704949602 +npm run adapter 1704690402 1704949602 arbitrum +npm run aggregate 1704690402 1704949602 arbitrum +npm run daily-volume 1704690402 1704949602 arbitrum ``` Returns: ``` diff --git a/src/helpers/processTransactions.ts b/src/helpers/processTransactions.ts index e21ab49b..ea78b67d 100644 --- a/src/helpers/processTransactions.ts +++ b/src/helpers/processTransactions.ts @@ -1,4 +1,3 @@ -import { getLogs } from "@defillama/sdk/build/util"; import { ethers } from "ethers"; import { Chain } from "@defillama/sdk/build/general"; import { get } from "lodash"; @@ -6,6 +5,7 @@ import { ContractEventParams, PartialContractEventParams } from "../helpers/brid import { EventData } from "../utils/types"; import { PromisePool } from "@supercharge/promise-pool"; import { getProvider } from "../utils/provider"; +import { getEventLogs } from "@defillama/sdk"; const EventKeyTypes = { blockNumber: "number", @@ -125,18 +125,17 @@ export const getTxDataFromEVMEventLogs = async ( let logs = [] as any[]; for (let i = 0; i < 5; i++) { try { - logs = ( - await getLogs({ - target: target!, - topic: topic, - keys: [], - fromBlock: fromBlock, - toBlock: toBlock, - topics: topics as string[], - chain: overriddenChain, - }) - ).output; - //console.log(logs) + logs = await getEventLogs({ + target: target!, + topic: topic, + keys: [], + fromBlock: fromBlock, + toBlock: toBlock, + topics: topics as string[], + chain: overriddenChain, + noTarget: !target // set noTarget to true, if target is null + }); + if (logs.length === 0) { console.info( `No logs received for ${adapterName} from ${fromBlock} to ${toBlock} with topic ${topic} (${