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

Function checkAmountOverflow

src/utils/format.ts:77–91  ·  view source on GitHub ↗
(
  inputAmount,
  decimals: bigint = BigInt(18),
)

Source from the content-addressed store, hash-verified

75}
76
77export const checkAmountOverflow = (
78 inputAmount,
79 decimals: bigint = BigInt(18),
80) => {
81 try {
82 if (!inputAmount) {
83 return true;
84 }
85 const clipDecimals = maxDecimals(inputAmount, decimals);
86 parseUnits(clipDecimals, decimals);
87 return true;
88 } catch (e) {
89 return false;
90 }
91};
92
93export const formatUTCDate = (date, needSub?: boolean) => {
94 let finalDate = date;

Callers

nothing calls this directly

Calls 1

maxDecimalsFunction · 0.85

Tested by

no test coverage detected