Skip to content

Commit

Permalink
feat: removed @ethersproject/units dependency and updated connect but…
Browse files Browse the repository at this point in the history
…ton component
  • Loading branch information
limcheekin committed Sep 22, 2021
1 parent a609a79 commit 593d348
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions client/components/ConnectButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Button, Box, Text, SimpleGrid } from "@chakra-ui/react";
import { formatEther } from "@ethersproject/units";
import Identicon from "./Identicon";
import { handleInjectedProvider, handleWalletConnect } from "../lib";
import { useContext, useState } from 'react';
Expand All @@ -25,7 +24,7 @@ export default function ConnectButton({ handleOpenModal }: Props) {
await handleInjectedProvider(dispatch)
const balance = await web3.eth.getBalance(account)
console.log('balance', balance)
setEtherBalance(parseFloat(formatEther(balance)))
setEtherBalance(parseInt(balance)/1e18)
} catch (error) {
console.error(error)
} finally {
Expand Down
1 change: 0 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"@chakra-ui/react": "^1.6.7",
"@emotion/react": "^11.4.1",
"@emotion/styled": "^11.3.0",
"@ethersproject/units": "^5.4.0",
"@metamask/detect-provider": "^1.2.0",
"@metamask/jazzicon": "^2.0.0",
"@walletconnect/web3-provider": "^1.6.5",
Expand Down

0 comments on commit 593d348

Please sign in to comment.