MCPcopy Create free account
hub / github.com/LevelUpWeb3/app / BNToAmount

Function BNToAmount

src/utils/format.ts:66–75  ·  view source on GitHub ↗
(
  value: bigint,
  decimals: bigint = BigInt(18),
)

Source from the content-addressed store, hash-verified

64}
65
66export function BNToAmount(
67 value: bigint,
68 decimals: bigint = BigInt(18),
69): string {
70 try {
71 return formatUnits(value.toString(), decimals);
72 } catch (e) {
73 return "0";
74 }
75}
76
77export const checkAmountOverflow = (
78 inputAmount,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected