-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(status-page): Tokenomics metrics (#13076)
- Loading branch information
1 parent
2d93c95
commit cbd3e0b
Showing
7 changed files
with
144 additions
and
37 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
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 |
---|---|---|
@@ -1,3 +1,24 @@ | ||
import type { ethers } from "ethers"; | ||
|
||
type Status = string | number | boolean; | ||
|
||
export default Status; | ||
type StatusIndicatorProp = { | ||
statusFunc?: ( | ||
provider: ethers.providers.JsonRpcProvider, | ||
contractAddress: string | ||
) => Promise<Status>; | ||
watchStatusFunc?: ( | ||
provider: ethers.providers.JsonRpcProvider, | ||
contractAddress: string, | ||
onEvent: (value: Status) => void | ||
) => void; | ||
provider: ethers.providers.JsonRpcProvider; | ||
contractAddress: string; | ||
header: string; | ||
intervalInMs: number; | ||
colorFunc: (value: Status) => string; | ||
onClick?: (value: Status) => void; | ||
tooltip: string; | ||
status?: Status; | ||
}; | ||
export { Status, StatusIndicatorProp }; |
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,10 @@ | ||
import { BigNumber, Contract, ethers } from "ethers"; | ||
import TaikoL1 from "../constants/abi/TaikoL1"; | ||
|
||
export const getConfig = async ( | ||
provider: ethers.providers.JsonRpcProvider, | ||
contractAddress: string | ||
) => { | ||
const contract: Contract = new Contract(contractAddress, TaikoL1, provider); | ||
return await contract.getConfig(); | ||
}; |
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,10 @@ | ||
import { BigNumber, Contract, ethers } from "ethers"; | ||
import TaikoL1 from "../constants/abi/TaikoL1"; | ||
|
||
export const getStateVariables = async ( | ||
provider: ethers.providers.JsonRpcProvider, | ||
contractAddress: string | ||
) => { | ||
const contract: Contract = new Contract(contractAddress, TaikoL1, provider); | ||
return await contract.getStateVariables(); | ||
}; |