Commit 143ed38e authored by isstuev's avatar isstuev

support custom wei

parent b296f527
import getValueWithUnit from 'lib/getValueWithUnit'; import getValueWithUnit from 'lib/getValueWithUnit';
import { currencyUnits } from 'lib/units';
export const getBaseFeeValue = (baseFee: string | null) => { export const getBaseFeeValue = (baseFee: string | null) => {
if (!baseFee) { if (!baseFee) {
...@@ -6,7 +7,7 @@ export const getBaseFeeValue = (baseFee: string | null) => { ...@@ -6,7 +7,7 @@ export const getBaseFeeValue = (baseFee: string | null) => {
} }
const valGwei = getValueWithUnit(baseFee, 'gwei'); const valGwei = getValueWithUnit(baseFee, 'gwei');
if (valGwei.isGreaterThanOrEqualTo(0.0001)) { 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 }`;
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment