Skip to content

Commit 014c124

Browse files
committed
replace getLogs method with newer version in sdk
update sdk version to 5.0.154 fix wrong order of args in README.md file example
1 parent 52632d2 commit 014c124

File tree

4 files changed

+20
-21
lines changed

4 files changed

+20
-21
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ syntax: `npm run {script-name} {startTimestamp} {endTimestamp} {bridgeName}`
112112
113113
Example:
114114
```
115-
npm run adapter arbitrum 1704690402 1704949602
116-
npm run aggregate arbitrum 1704690402 1704949602
117-
npm run daily-volume arbitrum 1704690402 1704949602
115+
npm run adapter 1704690402 1704949602 arbitrum
116+
npm run aggregate 1704690402 1704949602 arbitrum
117+
npm run daily-volume 1704690402 1704949602 arbitrum
118118
```
119119
Returns:
120120
```

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"@aws-sdk/client-s3": "^3.749.0",
3838
"@aws-sdk/client-sts": "^3.749.0",
3939
"@aws-sdk/credential-providers": "^3.749.0",
40-
"@defillama/sdk": "^5.0.137",
40+
"@defillama/sdk": "^5.0.154",
4141
"@fastify/cors": "^9.0.1",
4242
"@graphql-typed-document-node/core": "^3.2.0",
4343
"@solana/web3.js": "^1.87.3",

src/helpers/processTransactions.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { getLogs } from "@defillama/sdk/build/util";
21
import { ethers } from "ethers";
32
import { Chain } from "@defillama/sdk/build/general";
43
import { get } from "lodash";
54
import { ContractEventParams, PartialContractEventParams } from "../helpers/bridgeAdapter.type";
65
import { EventData } from "../utils/types";
76
import { PromisePool } from "@supercharge/promise-pool";
87
import { getProvider } from "../utils/provider";
8+
import { getEventLogs } from "@defillama/sdk";
99

1010
const EventKeyTypes = {
1111
blockNumber: "number",
@@ -125,18 +125,17 @@ export const getTxDataFromEVMEventLogs = async (
125125
let logs = [] as any[];
126126
for (let i = 0; i < 5; i++) {
127127
try {
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-
//console.log(logs)
128+
logs = await getEventLogs({
129+
target: target!,
130+
topic: topic,
131+
keys: [],
132+
fromBlock: fromBlock,
133+
toBlock: toBlock,
134+
topics: topics as string[],
135+
chain: overriddenChain,
136+
noTarget: !target // set noTarget to true, if target is null
137+
});
138+
140139
if (logs.length === 0) {
141140
console.info(
142141
`No logs received for ${adapterName} from ${fromBlock} to ${toBlock} with topic ${topic} (${

0 commit comments

Comments
 (0)