chore: update bee-js to 0.8.1 version (#78)

* chore: upgrade to bee-js 0.8.1

* refactor: removed toString on number types, Token now accepts numbers

* test: removed fromBZZbaseUnit test, makeBigNumber accepts number now

* chore: fix logic error when displaying Cashout button
This commit is contained in:
Vojtech Simetka
2021-04-23 11:43:48 +02:00
committed by GitHub
parent d77e184d6a
commit a0f1d1c50a
16 changed files with 276 additions and 210 deletions
+4 -6
View File
@@ -10,11 +10,10 @@ import { Snackbar, Container, CircularProgress } from '@material-ui/core'
import { beeDebugApi } from '../services/bee'
import EthereumAddress from './EthereumAddress'
import { fromBZZbaseUnit } from '../utils'
interface Props {
peerId: string
uncashedAmount: number
uncashedAmount: string
}
export default function DepositModal({ peerId, uncashedAmount }: Props): ReactElement {
@@ -76,8 +75,7 @@ export default function DepositModal({ peerId, uncashedAmount }: Props): ReactEl
{loadingCashout && (
<>
<span>
Cashing out <strong>{fromBZZbaseUnit(uncashedAmount).toFixed(7)}</strong> from Peer{' '}
<strong>{peerId}</strong>. Please wait...
Cashing out <strong>{uncashedAmount}</strong> from Peer <strong>{peerId}</strong>. Please wait...
</span>
<Container style={{ textAlign: 'center', padding: '50px' }}>
<CircularProgress />
@@ -86,8 +84,8 @@ export default function DepositModal({ peerId, uncashedAmount }: Props): ReactEl
)}
{!loadingCashout && (
<span>
Are you sure you want to cashout <strong>{fromBZZbaseUnit(uncashedAmount).toFixed(7)} BZZ</strong> from
Peer <strong>{peerId}</strong>?
Are you sure you want to cashout <strong>{uncashedAmount} BZZ</strong> from Peer{' '}
<strong>{peerId}</strong>?
</span>
)}
</DialogContentText>
+1 -1
View File
@@ -48,7 +48,7 @@ export default function WithdrawModal({
if (amountToken === null) return
try {
const { transactionHash } = await action(amountToken.toBigInt)
const { transactionHash } = await action(amountToken.toBigInt as bigint)
setOpen(false)
handleToast(`${successMessage} Transaction ${transactionHash}`)
} catch (e) {