Files
js/utils/bignumber.ts
T
Jonas Daniels 41c37d34ab various fixes (#710)
* various fixes

* load gradient with priority

* gradient improvements

* bit of opacity fading in

* does not need fading with priority set

* move newsletter section

* revert some dynamic stuff

* add a timeout to privacy notice to prevent flash
2022-12-06 10:00:10 +00:00

17 lines
408 B
TypeScript

import { BigNumber } from "ethers";
export function bigNumberReplacer(_key: string, value: any) {
// if we find a BigNumber then make it into a string (since that is safe)
if (
BigNumber.isBigNumber(value) ||
(typeof value === "object" &&
value !== null &&
value.type === "BigNumber" &&
"hex" in value)
) {
return BigNumber.from(value).toString();
}
return value;
}