mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
support custom wei
This commit is contained in:
+3
-2
@@ -1,4 +1,5 @@
|
||||
import getValueWithUnit from 'lib/getValueWithUnit';
|
||||
import { currencyUnits } from 'lib/units';
|
||||
|
||||
export const getBaseFeeValue = (baseFee: string | null) => {
|
||||
if (!baseFee) {
|
||||
@@ -6,7 +7,7 @@ export const getBaseFeeValue = (baseFee: string | null) => {
|
||||
}
|
||||
const valGwei = getValueWithUnit(baseFee, 'gwei');
|
||||
if (valGwei.isGreaterThanOrEqualTo(0.0001)) {
|
||||
return valGwei.toFormat(4) + ' Gwei';
|
||||
return `${ valGwei.toFormat(4) } ${ currencyUnits.gwei }`;
|
||||
}
|
||||
return getValueWithUnit(baseFee, 'wei').toFormat() + ' wei';
|
||||
return `${ getValueWithUnit(baseFee, 'wei').toFormat() } ${ currencyUnits.wei }`;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user