Skip to content

Instantly share code, notes, and snippets.

@ajb413

ajb413/App.tsx Secret

Created December 12, 2022 17:33
Show Gist options
  • Save ajb413/093480ff584d6ed415a0a729286e68f7 to your computer and use it in GitHub Desktop.
Save ajb413/093480ff584d6ed415a0a729286e68f7 to your computer and use it in GitHub Desktop.
const comet = useMemo(() => new Contract(networkConfig.rootsV3.comet, Comet, signer), [signer]);
useAsyncEffect(async () => {
const decimals = +(await comet.callStatic.decimals()).toString();
const borrowBalance = +(await comet.callStatic.borrowBalanceOf(account)).toString();
setBorrowBalance(borrowBalance / Math.pow(10, decimals));
}, []);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment