-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust monitoring to the latest tBTC SDK
- Loading branch information
1 parent
dca742f
commit 9424c62
Showing
11 changed files
with
157 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { providers } from "ethers" | ||
|
||
import { context } from "./context" | ||
|
||
const resolve = () => { | ||
const provider = new providers.JsonRpcProvider(context.ethereumUrl) | ||
|
||
const latestBlock = async () => { | ||
const block = await provider.getBlock("latest") | ||
return block.number | ||
} | ||
|
||
const blockTimestamp = async (blockNumber: number): Promise<number> => { | ||
const block = await provider.getBlock(blockNumber) | ||
return block.timestamp | ||
} | ||
|
||
return { latestBlock, blockTimestamp } | ||
} | ||
|
||
export const blocks = resolve() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.