diff --git a/packages/plugin-chainbase/src/utils.ts b/packages/plugin-chainbase/src/utils.ts deleted file mode 100644 index 77428996fe..0000000000 --- a/packages/plugin-chainbase/src/utils.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { TokenWithBalance } from "./types"; - -export function formatTokenBalance(token: TokenWithBalance) { - const balanceDecimal = BigInt(`0x${token.balance}`); - const amount = token.decimals - ? Number(balanceDecimal) / Math.pow(10, token.decimals) - : Number(balanceDecimal); - - const formattedAmount = - amount >= 1 - ? amount.toFixed(6).replace(/\.?0+$/, "") - : amount.toString(); - - const name = - token.symbol.length > token.name.length ? token.name : token.symbol; - return `${formattedAmount} ${name}`; -}