chore: deps and react-script update (#383)

* chore: deps and react-script update

* ci: bump node version to 18

* ci: depscheck

* docs: mention minimal npm required version

* chore: feedback

Co-authored-by: Vojtech Simetka <vojtech@simetka.cz>

Co-authored-by: Vojtech Simetka <vojtech@simetka.cz>
This commit is contained in:
Adam Uhlíř
2022-06-15 12:20:36 +02:00
committed by GitHub
parent 57dca48f3e
commit 2edf99c323
12 changed files with 9247 additions and 25878 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ import { BigNumber } from 'bignumber.js'
import { Token } from './Token'
export class BzzToken extends Token {
constructor(amount: BigNumber | string | BigInt) {
constructor(amount: BigNumber | string | bigint) {
super(amount, 16)
}
}
+1 -1
View File
@@ -2,7 +2,7 @@ import { BigNumber } from 'bignumber.js'
import { Token } from './Token'
export class DaiToken extends Token {
constructor(amount: BigNumber | string | BigInt) {
constructor(amount: BigNumber | string | bigint) {
super(amount, 18)
}
}
+3 -3
View File
@@ -10,7 +10,7 @@ export class Token {
private amount: BigNumber // Represented in the base units, so it is always an integer value
private readonly decimals: digits
constructor(amount: BigNumber | string | BigInt, decimals: digits = BZZ_DECIMALS) {
constructor(amount: BigNumber | string | bigint, decimals: digits = BZZ_DECIMALS) {
const a = makeBigNumber(amount)
if (!isInteger(a) || !POSSIBLE_DECIMALS.includes(decimals)) {
@@ -31,7 +31,7 @@ export class Token {
*
* @returns new Token
*/
static fromDecimal(amount: BigNumber | string | BigInt, decimals: digits = BZZ_DECIMALS): Token | never {
static fromDecimal(amount: BigNumber | string | bigint, decimals: digits = BZZ_DECIMALS): Token | never {
const a = makeBigNumber(amount)
// No need to do any validation here, it is done when the new token is created
@@ -40,7 +40,7 @@ export class Token {
return new Token(t, decimals)
}
get toBigInt(): BigInt {
get toBigInt(): bigint {
return BigInt(this.amount.toFixed(0))
}
+2 -2
View File
@@ -11,7 +11,7 @@ import {
} from '@ethersphere/bee-js'
import { createContext, ReactChild, ReactElement, useContext, useEffect, useState } from 'react'
import semver from 'semver'
import { engines } from '../../package.json'
import PackageJson from '../../package.json'
import { useLatestBeeRelease } from '../hooks/apiHooks'
import { Token } from '../models/Token'
import type { Balance, ChequebookBalance, Settlements } from '../types'
@@ -130,7 +130,7 @@ function getStatus(
status.version.isEnabled = true
status.version.checkState =
debugApiHealth &&
semver.satisfies(debugApiHealth.version, engines.bee, {
semver.satisfies(debugApiHealth.version, PackageJson.engines.bee, {
includePrerelease: true,
})
? CheckState.OK
+1 -1
View File
@@ -24,7 +24,7 @@ export function isInteger(value: unknown): value is BigNumber | bigint {
*
* @returns BigNumber - but it may still be NaN or Infinite
*/
export function makeBigNumber(value: BigNumber | BigInt | number | string): BigNumber | never {
export function makeBigNumber(value: BigNumber | bigint | number | string): BigNumber | never {
if (BigNumber.isBigNumber(value)) return value
if (typeof value === 'string') return new BigNumber(value)