Skip to content

Commit

Permalink
Update sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
vrtnd committed Aug 9, 2024
1 parent cad4557 commit 2161557
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"ts-loader": "^9.3.1"
},
"dependencies": {
"@defillama/sdk": "^5.0.76",
"@defillama/sdk": "^5.0.77",
"@graphql-typed-document-node/core": "^3.2.0",
"@solana/web3.js": "^1.87.3",
"async-retry": "^1.3.1",
Expand Down
8 changes: 6 additions & 2 deletions src/utils/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,12 @@ export const runAdapterHistorical = async (
const { blockNumber } = log;
txBlocks.push(blockNumber);
});
const minBlock = Math.min(...txBlocks) ?? 0;
const maxBlock = Math.max(...txBlocks) ?? 0;
let minBlock = 0;
let maxBlock = 0;
if (txBlocks.length > 0) {
minBlock = Math.min(...txBlocks) ?? 0;
maxBlock = Math.max(...txBlocks) ?? 0;
}
const blockRange = maxBlock - minBlock || 1;
let blockTimestamps = {} as { [bucket: number]: number };
let block = {} as { timestamp: number; number: number };
Expand Down

0 comments on commit 2161557

Please sign in to comment.