import React from 'react' import { formatEther } from '@ethersproject/units' import { useEtherBalance, useEthers } from '@usedapp/core' import { Container, ContentBlock, ContentRow, MainContent, Section, SectionRow } from '../components/base/base' import { Label } from '../typography/Label' import { TextInline } from '../typography/Text' import { Title } from '../typography/Title' import { AccountButton } from '../components/account/AccountButton' const STAKING_CONTRACT = '0x00000000219ab540356cBB839Cbe05303d7705Fa' export function Balance() { const { account, chainId } = useEthers() const userBalance = useEtherBalance(account, { chainId }) const stakingBalance = useEtherBalance(STAKING_CONTRACT, { chainId }) return (
Balance {stakingBalance && ( {formatEther(stakingBalance)}{' '} )} {account && ( {account} )} {userBalance && ( {' '} {formatEther(userBalance)} )}
) }