From 788b589323098d1cba1855e0a65e906ad7cfcaa6 Mon Sep 17 00:00:00 2001 From: zzq0826 <770166635@qq.com> Date: Tue, 22 Jul 2025 16:42:01 +0800 Subject: [PATCH 1/2] Revert "Revert "fix: use Gwei"" This reverts commit 7a42ff59d66596021d215af38e5a4182097e749e. --- 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 2db3de229..0b8072df8 100644 --- a/src/components/Header/GasPriceViewer.tsx +++ b/src/components/Header/GasPriceViewer.tsx @@ -1,5 +1,5 @@ import { useMemo, useState } from "react" -import { formatUnits } from "viem" +import { formatGwei } 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(formatUnits(scrollGasPrice, 6)).toFixed(2) + return Number(formatGwei(scrollGasPrice)).toFixed(3) } return "-" }, [scrollGasPrice]) const displayedEthereumGasPrice = useMemo(() => { if (ethereumGasPrice) { - return Number(formatUnits(ethereumGasPrice, 6)).toFixed(2) + return Number(formatGwei(ethereumGasPrice)).toFixed(3) } return "-" }, [ethereumGasPrice]) @@ -98,7 +98,7 @@ const GasPriceViewer = () => { {displayedScrollGasPrice} - Mwei + Gwei { {displayedScrollGasPrice} - Mwei + Gwei Ethereum {displayedEthereumGasPrice} - Mwei + Gwei