-
Notifications
You must be signed in to change notification settings - Fork 5.2k
feat(pages/resources): add pectra countdown and blobscan api #15324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
TylerAPfledderer
wants to merge
12
commits into
ethereum:dev
Choose a base branch
from
TylerAPfledderer:feat/dashboard-pectra-countdown
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+202
−14
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
8e35750
feat(pages/resources): get blobscan api data
TylerAPfledderer 25597af
feat(pages/resources): add pectra schedule
TylerAPfledderer b9158d7
refactor(page/resources): show average blob fee in usd
TylerAPfledderer a504bc1
fix(useResources): to avg blob fee conversion from wei
TylerAPfledderer 55a27de
Merge remote-tracking branch 'upstream/dev' into feat/dashboard-pectr…
TylerAPfledderer d31aa0e
add mock data for blobscanOverallStats
pettinarip 040d7bb
refactor(useResources): simplify formatSmallUSD
TylerAPfledderer eba75bf
refactor(useResources): add countdown for scaling upgrade
TylerAPfledderer 9771acf
refactor(useResources): set link for Pectra page
TylerAPfledderer 472b762
Merge remote-tracking branch 'upstream/dev' into feat/dashboard-pectr…
TylerAPfledderer 15408bb
Merge remote-tracking branch 'upstream/dev' into feat/dashboard-pectr…
TylerAPfledderer bf9423a
refactor(useResources): update label for latest scaling upgrade
TylerAPfledderer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,18 @@ | ||
{ | ||
"avgBlobAsCalldataFee": 18402670294113620, | ||
"avgBlobFee": 1337454615991715, | ||
"avgBlobGasPrice": 4657716809.805255, | ||
"avgMaxBlobGasFee": 19666167416.48503, | ||
"totalBlobGasUsed": "875492278272", | ||
"totalBlobAsCalldataGasUsed": "12165759474144", | ||
"totalBlobFee": "4174952855822794358784", | ||
"totalBlobAsCalldataFee": "57445149899315095107588", | ||
"totalBlobs": 6679476, | ||
"totalBlobSize": "875492278272", | ||
"totalBlocks": 1664933, | ||
"totalTransactions": 3121566, | ||
"totalUniqueBlobs": 6575105, | ||
"totalUniqueReceivers": 5361, | ||
"totalUniqueSenders": 5941, | ||
"updatedAt": "2025-03-25T11:45:00.590Z" | ||
} |
This file contains hidden or 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,57 @@ | ||
type BlobscanOverallStats = { | ||
avgBlobAsCalldataFee: number | ||
avgBlobFee: number | ||
avgBlobGasPrice: number | ||
avgMaxBlobGasFee: number | ||
totalBlobGasUsed: string | ||
totalBlobAsCalldataGasUsed: string | ||
totalBlobFee: string | ||
totalBlobAsCalldataFee: string | ||
totalBlobs: number | ||
totalBlobSize: string | ||
totalBlocks: number | ||
totalTransactions: number | ||
totalUniqueBlobs: number | ||
totalUniqueReceivers: number | ||
totalUniqueSenders: number | ||
updatedAt: string | ||
} | ||
|
||
type BlobscanOverallStatsErr = { | ||
message: string | ||
code: string | ||
issues: [message: string] | ||
} | ||
|
||
/** | ||
* Fetch the overall stats from Blobscan | ||
* | ||
* @see https://api.blobscan.com/#/stats/stats-getOverallStats | ||
* | ||
*/ | ||
export const fetchBlobscanStats = async () => { | ||
const data = await fetch("https://api.blobscan.com/stats/overall").then( | ||
(res) => responseHandler(res) | ||
) | ||
|
||
return data | ||
} | ||
|
||
type BlobscanResponse = | ||
| (Omit<Response, "json"> & { | ||
json: () => BlobscanOverallStats | PromiseLike<BlobscanOverallStats> | ||
}) | ||
| (Omit<Response, "json"> & { | ||
json: () => BlobscanOverallStatsErr | PromiseLike<BlobscanOverallStatsErr> | ||
}) | ||
|
||
const responseHandler = async (response: Response) => { | ||
const res = await (response as BlobscanResponse).json() | ||
|
||
if ("message" in res) { | ||
throw Error(`Code ${res.code}: Failed to fetch Blobscan Overall Stats`, { | ||
cause: res.message, | ||
}) | ||
} | ||
return res | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplify the price formatting for
formatSmallUSD()
, so that two decimal places are always shown, no matter the number of significant figures. (i.e.$xx.xx
versus$x.xx
)