Compare commits

...

7 Commits

Author SHA1 Message Date
bee-worker c8efa859df chore(master): release 0.18.1 (#469)
* chore(master): release 0.18.1

* chore: empty commit

Co-authored-by: Adam Uhlíř <adam@uhlir.dev>
2022-07-05 17:13:22 +02:00
Cafe137 afb8c31d9a fix: refresh gift wallet after swap (#465)
* fix: refresh gift wallet after swap

* fix: also refresh wallet after transfer

* chore: revert fund
2022-07-05 16:22:06 +02:00
Adam Uhlíř e5bc658327 chore: lower timeout (#472) 2022-07-05 16:14:21 +02:00
Adam Uhlíř acee8c9802 fix: status checks have timeout (#471) 2022-07-05 15:53:18 +02:00
Adam Uhlíř f297cf803f ci: sentry release version fix (#467) 2022-07-05 15:52:56 +02:00
Cafe137 477c2385b1 fix: refresh balance after dai tx (#470) 2022-07-05 15:24:18 +02:00
Cafe137 56457eb9b9 fix: refresh dai after spending gas (#468) 2022-07-05 14:01:49 +02:00
7 changed files with 30 additions and 17 deletions
+1
View File
@@ -27,3 +27,4 @@ jobs:
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
with: with:
sourcemaps: ./build/static/js sourcemaps: ./build/static/js
version: ${{ github.ref }}
+10
View File
@@ -1,5 +1,15 @@
# Changelog # Changelog
## [0.18.1](https://github.com/ethersphere/bee-dashboard/compare/v0.18.0...v0.18.1) (2022-07-05)
### Bug Fixes
* refresh balance after dai tx ([#470](https://github.com/ethersphere/bee-dashboard/issues/470)) ([477c238](https://github.com/ethersphere/bee-dashboard/commit/477c2385b1d06da499facebf630338eb90ad22e7))
* refresh dai after spending gas ([#468](https://github.com/ethersphere/bee-dashboard/issues/468)) ([56457eb](https://github.com/ethersphere/bee-dashboard/commit/56457eb9b989ed00c3b87555a43da7024654667d))
* refresh gift wallet after swap ([#465](https://github.com/ethersphere/bee-dashboard/issues/465)) ([afb8c31](https://github.com/ethersphere/bee-dashboard/commit/afb8c31d9a022033cee14ff9a951f87cb992636f))
* status checks have timeout ([#471](https://github.com/ethersphere/bee-dashboard/issues/471)) ([acee8c9](https://github.com/ethersphere/bee-dashboard/commit/acee8c9802318deb64d2bd8e701fae15c10d5fcf))
## [0.18.0](https://github.com/ethersphere/bee-dashboard/compare/v0.17.0...v0.18.0) (2022-07-04) ## [0.18.0](https://github.com/ethersphere/bee-dashboard/compare/v0.17.0...v0.18.0) (2022-07-04)
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "@ethersphere/bee-dashboard", "name": "@ethersphere/bee-dashboard",
"version": "0.18.0", "version": "0.18.1",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@ethersphere/bee-dashboard", "name": "@ethersphere/bee-dashboard",
"version": "0.18.0", "version": "0.18.1",
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"dependencies": { "dependencies": {
"@ethersphere/bee-js": "^4.1.1", "@ethersphere/bee-js": "^4.1.1",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@ethersphere/bee-dashboard", "name": "@ethersphere/bee-dashboard",
"version": "0.18.0", "version": "0.18.1",
"description": "An app which helps users to setup their Bee node and do actions like cash out cheques", "description": "An app which helps users to setup their Bee node and do actions like cash out cheques",
"keywords": [ "keywords": [
"bee", "bee",
+1
View File
@@ -107,6 +107,7 @@ export function Swap({ header }: Props): ReactElement {
} catch (error) { } catch (error) {
enqueueSnackbar(`Failed to swap: ${error}`, { variant: 'error' }) enqueueSnackbar(`Failed to swap: ${error}`, { variant: 'error' })
} finally { } finally {
balance?.refresh()
setLoading(false) setLoading(false)
} }
} }
+13 -12
View File
@@ -21,6 +21,7 @@ import { Context as TopUpContext } from './TopUp'
const REFRESH_WHEN_OK = 30_000 const REFRESH_WHEN_OK = 30_000
const REFRESH_WHEN_ERROR = 5_000 const REFRESH_WHEN_ERROR = 5_000
const TIMEOUT = 3_000
export enum CheckState { export enum CheckState {
OK = 'OK', OK = 'OK',
@@ -270,7 +271,7 @@ export function Provider({ children }: Props): ReactElement {
// Wrap the chequebook balance call to return BZZ values as Token object // Wrap the chequebook balance call to return BZZ values as Token object
const chequeBalanceWrapper = async () => { const chequeBalanceWrapper = async () => {
const { totalBalance, availableBalance } = await beeDebugApi.getChequebookBalance() const { totalBalance, availableBalance } = await beeDebugApi.getChequebookBalance({ timeout: TIMEOUT })
return { return {
totalBalance: new Token(totalBalance), totalBalance: new Token(totalBalance),
@@ -280,14 +281,14 @@ export function Provider({ children }: Props): ReactElement {
// Wrap the balances call to return BZZ values as Token object // Wrap the balances call to return BZZ values as Token object
const peerBalanceWrapper = async () => { const peerBalanceWrapper = async () => {
const { balances } = await beeDebugApi.getAllBalances() const { balances } = await beeDebugApi.getAllBalances({ timeout: TIMEOUT })
return balances.map(({ peer, balance }) => ({ peer, balance: new Token(balance) })) return balances.map(({ peer, balance }) => ({ peer, balance: new Token(balance) }))
} }
// Wrap the settlements call to return BZZ values as Token object // Wrap the settlements call to return BZZ values as Token object
const settlementsWrapper = async () => { const settlementsWrapper = async () => {
const { totalReceived, settlements, totalSent } = await beeDebugApi.getAllSettlements() const { totalReceived, settlements, totalSent } = await beeDebugApi.getAllSettlements({ timeout: TIMEOUT })
return { return {
totalReceived: new Token(totalReceived), totalReceived: new Token(totalReceived),
@@ -303,55 +304,55 @@ export function Provider({ children }: Props): ReactElement {
const promises = [ const promises = [
// API health // API health
beeApi beeApi
.isConnected() .isConnected({ timeout: TIMEOUT })
.then(setApiHealth) .then(setApiHealth)
.catch(() => setApiHealth(false)), .catch(() => setApiHealth(false)),
// Debug API health // Debug API health
beeDebugApi beeDebugApi
.getHealth() .getHealth({ timeout: TIMEOUT })
.then(setDebugApiHealth) .then(setDebugApiHealth)
.catch(() => setDebugApiHealth(null)), .catch(() => setDebugApiHealth(null)),
// Node Addresses // Node Addresses
beeDebugApi beeDebugApi
.getNodeAddresses() .getNodeAddresses({ timeout: TIMEOUT })
.then(setNodeAddresses) .then(setNodeAddresses)
.catch(() => setNodeAddresses(null)), .catch(() => setNodeAddresses(null)),
// NodeInfo // NodeInfo
beeDebugApi beeDebugApi
.getNodeInfo() .getNodeInfo({ timeout: TIMEOUT })
.then(setNodeInfo) .then(setNodeInfo)
.catch(() => setNodeInfo(null)), .catch(() => setNodeInfo(null)),
// Network Topology // Network Topology
beeDebugApi beeDebugApi
.getTopology() .getTopology({ timeout: TIMEOUT })
.then(setNodeTopology) .then(setNodeTopology)
.catch(() => setNodeTopology(null)), .catch(() => setNodeTopology(null)),
// Peers // Peers
beeDebugApi beeDebugApi
.getPeers() .getPeers({ timeout: TIMEOUT })
.then(setPeers) .then(setPeers)
.catch(() => setPeers(null)), .catch(() => setPeers(null)),
// Chequebook address // Chequebook address
beeDebugApi beeDebugApi
.getChequebookAddress() .getChequebookAddress({ timeout: TIMEOUT })
.then(setChequebookAddress) .then(setChequebookAddress)
.catch(() => setChequebookAddress(null)), .catch(() => setChequebookAddress(null)),
// Cheques // Cheques
beeDebugApi beeDebugApi
.getLastCheques() .getLastCheques({ timeout: TIMEOUT })
.then(setPeerCheques) .then(setPeerCheques)
.catch(() => setPeerCheques(null)), .catch(() => setPeerCheques(null)),
// Chain state // Chain state
beeDebugApi beeDebugApi
.getChainState() .getChainState({ timeout: TIMEOUT })
.then(setChainState) .then(setChainState)
.catch(() => setChainState(null)), .catch(() => setChainState(null)),
+2 -2
View File
@@ -1,5 +1,4 @@
import { providers, Wallet } from 'ethers' import { providers, Wallet } from 'ethers'
import { sleepMs } from '.'
import { BzzToken } from '../models/BzzToken' import { BzzToken } from '../models/BzzToken'
import { DaiToken } from '../models/DaiToken' import { DaiToken } from '../models/DaiToken'
import { estimateNativeTransferTransactionCost, Rpc } from './rpc' import { estimateNativeTransferTransactionCost, Rpc } from './rpc'
@@ -61,7 +60,7 @@ export class ResolvedWallet {
public async transfer(destination: string, jsonRpcProvider: string): Promise<void> { public async transfer(destination: string, jsonRpcProvider: string): Promise<void> {
if (this.bzz.toDecimal.gt(0.05)) { if (this.bzz.toDecimal.gt(0.05)) {
await Rpc.sendBzzTransaction(this.privateKey, destination, this.bzz.toString, jsonRpcProvider) await Rpc.sendBzzTransaction(this.privateKey, destination, this.bzz.toString, jsonRpcProvider)
await sleepMs(5_000) await this.refresh()
} }
const { gasPrice, totalCost } = await estimateNativeTransferTransactionCost(this.privateKey, jsonRpcProvider) const { gasPrice, totalCost } = await estimateNativeTransferTransactionCost(this.privateKey, jsonRpcProvider)
@@ -74,6 +73,7 @@ export class ResolvedWallet {
jsonRpcProvider, jsonRpcProvider,
gasPrice, gasPrice,
) )
await this.refresh()
} }
} }
} }