Skip to content

Commit

Permalink
fix ts
Browse files Browse the repository at this point in the history
  • Loading branch information
matt5346 committed Jun 3, 2024
1 parent e0e4794 commit 3326cce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion adapters/overnight/src/sdk/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const RPC_URLS = {


export const SNAPSHOTS_BLOCKS = [
0, 4169748
0, 5119650
];

export const CHUNKS_SPLIT = 20;
Expand Down
15 changes: 4 additions & 11 deletions adapters/overnight/src/sdk/subgraphDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,7 @@ export const getUserTVLByBlock = async ({
}

export const getTimestampAtBlock = async (blockNumber: number) => {
const publicClient = createPublicClient({
chain: extractChain({ chains: [linea], id: CHAINS.LINEA }),
transport: http(RPC_URLS[CHAINS.LINEA]),
});

const block = await publicClient.getBlock({
blockNumber: BigInt(blockNumber),
});

return Number(block.timestamp * 1000n);
};
const provider = new ethers.providers.StaticJsonRpcProvider(LINEA_RPC);
const block = await provider.getBlock(blockNumber)
return Number(block.timestamp * 1000);
};

0 comments on commit 3326cce

Please sign in to comment.