参考文章链接:
How To Building an Ethereum Gas Tracker
基于React语言,改造了Java版本实现的数据层。支持以太坊上及其他生态链(需要支持了EIP-1559提案的链才可以),且优化了原有数据获取方式及拓展了avgGasFee,fastGasFee,slowGasFee等数据
以14549820区块数据为例说明数据
可获取当前区块 指定区块数据之间的 BaseFeePerGas 及通道拥堵率Gas Used Ratio
这里是展示部分数据,文章限制了字数,可以展示当前区块-指定任意区块数的数据进行Gas数据预测 数据示例:
{
"avgFill": "51.43%",
"avgGasFee": 30,
"fastGasFee": 56,
"slowGasFee": 20,
"gasList": [
{
"reward": [
1,
2,
2
],
"blockNumber": 14549820,
"baseFeePerGas": 33.88785024,
"gasUsedRatio": "41.03%"
},
{
"reward": [
1,
2,
2
],
"blockNumber": 14549821,
"baseFeePerGas": 33.12765708,
"gasUsedRatio": "24.88%"
},
{
"reward": [
1,
2,
2
],
"blockNumber": 14549822,
"baseFeePerGas": 31.04728853,
"gasUsedRatio": "97%"
},
{
"reward": [
1,
2,
2
],
"blockNumber": 14549823,
"baseFeePerGas": 34.69554105,
"gasUsedRatio": "29.93%"
},
{
"reward": [
2,
2,
3
],
"blockNumber": 14549824,
"baseFeePerGas": 32.95443298,
"gasUsedRatio": "89.8%"
},
{
"reward": [
2,
2,
2
],
"blockNumber": 14550819,
"baseFeePerGas": 27.23249669,
"gasUsedRatio": "99.99%"
}
]
}
需要代码的可私信
|