Skip to content

Commit

Permalink
chore(fix): fee format
Browse files Browse the repository at this point in the history
  • Loading branch information
D4mph1r committed Dec 3, 2024
1 parent 4f6282b commit 59ea99b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/components/Details/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,16 @@ export const debounce = (cb: Function, delay: number) => {

export const compose =
(...funcs: Function[]) =>
(comp: React.FC<any>) => {
return funcs.reduceRight((wrapped, func) => func(wrapped), comp);
};
(comp: React.FC<any>) => {
return funcs.reduceRight((wrapped, func) => func(wrapped), comp);
};

export const formatFees = (event: IEvent) => {
debugger;
if (isNaN(+event.txFees)) return 0;

const chain = chains.find(
(c) => c.name.toLowerCase() === event.fromChainName?.toLowerCase()
(c) => c.name.toLowerCase() === event.toChainName?.toLowerCase()
);

if (chain?.dec)
Expand All @@ -226,6 +227,9 @@ export const formatFees = (event: IEvent) => {
if (chain?.notConvert) return +event.txFees;

let res;
// if (event.toChainName === "CASPER") {
// event.txFees = (Number(event.txFees) * 1e9).toString();
// }
try {
res = Number(ethers.utils.formatEther(event.txFees));
} catch (e) {
Expand Down

0 comments on commit 59ea99b

Please sign in to comment.