From 7a42ff59d66596021d215af38e5a4182097e749e Mon Sep 17 00:00:00 2001
From: zzq0826 <770166635@qq.com>
Date: Mon, 21 Jul 2025 13:20:11 +0800
Subject: [PATCH] Revert "fix: use Gwei"
This reverts commit cc6983a1c9f84dbd1894ffd592abde276510f11b.
---
src/components/Header/GasPriceViewer.tsx | 12 ++++++------
src/components/Header/MobileGasPriceViewer.tsx | 12 ++++++------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/components/Header/GasPriceViewer.tsx b/src/components/Header/GasPriceViewer.tsx
index 0b8072df8..2db3de229 100644
--- a/src/components/Header/GasPriceViewer.tsx
+++ b/src/components/Header/GasPriceViewer.tsx
@@ -1,5 +1,5 @@
import { useMemo, useState } from "react"
-import { formatGwei } from "viem"
+import { formatUnits } from "viem"
import { useGasPrice } from "wagmi"
import { Box, Button, Fade, Paper, Popper, Stack, Typography } from "@mui/material"
@@ -25,14 +25,14 @@ const GasPriceViewer = () => {
const displayedScrollGasPrice = useMemo(() => {
if (scrollGasPrice) {
- return Number(formatGwei(scrollGasPrice)).toFixed(3)
+ return Number(formatUnits(scrollGasPrice, 6)).toFixed(2)
}
return "-"
}, [scrollGasPrice])
const displayedEthereumGasPrice = useMemo(() => {
if (ethereumGasPrice) {
- return Number(formatGwei(ethereumGasPrice)).toFixed(3)
+ return Number(formatUnits(ethereumGasPrice, 6)).toFixed(2)
}
return "-"
}, [ethereumGasPrice])
@@ -98,7 +98,7 @@ const GasPriceViewer = () => {
{displayedScrollGasPrice}
- Gwei
+ Mwei
{
{displayedScrollGasPrice}
- Gwei
+ Mwei
Ethereum
{displayedEthereumGasPrice}
- Gwei
+ Mwei