Add base fee to the chart
This commit is contained in:
parent
e7bbf5dce5
commit
b5e16dd410
|
@ -28,6 +28,17 @@ export const options: ChartOptions = {
|
|||
callback: (v) => `${v} Gwei`,
|
||||
},
|
||||
},
|
||||
yBaseFee: {
|
||||
position: "right",
|
||||
beginAtZero: true,
|
||||
title: {
|
||||
display: true,
|
||||
text: "Base fee",
|
||||
},
|
||||
grid: {
|
||||
drawOnChartArea: false
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -44,5 +55,12 @@ export const toChartData = (blocks: ExtendedBlock[]): ChartData => ({
|
|||
borderColor: "#F97316",
|
||||
tension: 0.2,
|
||||
},
|
||||
{
|
||||
label: "Base fee (Gwei)",
|
||||
data: blocks.map(b => b.baseFeePerGas!.toNumber()).reverse(),
|
||||
yAxisID: "yBaseFee",
|
||||
borderColor: "#FCA5A5",
|
||||
tension: 0.2
|
||||
}
|
||||
],
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue