Skip to content

Commit

Permalink
get query block katana
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmkeng committed Jun 16, 2023
1 parent bd67398 commit 7d7980c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dexs/katana/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const endpoints = {

const blocksGraph =
"https://thegraph.roninchain.com/subgraphs/name/axieinfinity/ronin-blocks";

const ONE_DAY_IN_SECONDS = 60 * 60 * 24
const blockQuery = gql`
query blocks($timestampFrom: Int!, $timestampTo: Int!) {
blocks(
Expand All @@ -37,8 +37,8 @@ const getCustomBlock = async (timestamp: number) => {
const block = Number(
(
await request(blocksGraph, blockQuery, {
timestampFrom: timestamp - 30,
timestampTo: timestamp + 30,
timestampFrom: timestamp - ONE_DAY_IN_SECONDS,
timestampTo: timestamp + ONE_DAY_IN_SECONDS,
})
).blocks[0].number
);
Expand Down

0 comments on commit 7d7980c

Please sign in to comment.