Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #814 from hermeznetwork/update-project-dependencies
Browse files Browse the repository at this point in the history
Update project dependencies
  • Loading branch information
amonsosanz authored Feb 11, 2022
2 parents 710d0a3 + 78eac71 commit e019c3d
Show file tree
Hide file tree
Showing 62 changed files with 10,060 additions and 12,110 deletions.
20,464 changes: 9,242 additions & 11,222 deletions package-lock.json

Large diffs are not rendered by default.

83 changes: 41 additions & 42 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,60 +13,59 @@
"start:prod": "serve -s -C -p 80 build"
},
"dependencies": {
"@blackbox-vision/react-qr-reader": "^5.0.0",
"@hermeznetwork/hermezjs": "^2.0.1",
"@typechain/ethers-v5": "^8.0.5",
"@types/history": "^4.7.9",
"@types/platform": "^1.3.4",
"@types/qrcode.react": "^1.0.2",
"@types/react": "^17.0.18",
"@types/react-dom": "^17.0.9",
"@types/react-qr-reader": "^2.1.4",
"@types/react-redux": "^7.1.18",
"@types/react-router": "^5.1.16",
"@types/react-router-dom": "^5.3.1",
"@walletconnect/web3-provider": "^1.4.1",
"axios": "^0.21.1",
"@lagunovsky/redux-react-router": "^2.2.0",
"@typechain/ethers-v5": "^9.0.0",
"@walletconnect/web3-provider": "^1.7.1",
"axios": "^0.25.0",
"clsx": "^1.1.1",
"connected-react-router": "^6.8.0",
"cryptocurrency-icons": "^0.18.0",
"ethers": "^5.1.4",
"ethers": "^5.5.4",
"history": "^5.2.0",
"js-sha3": "^0.8.0",
"normalize.css": "^8.0.1",
"platform": "^1.3.6",
"qrcode.react": "^1.0.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-jss": "^10.3.0",
"react-qr-reader": "^2.2.1",
"react-redux": "^7.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "^4.0.3",
"redux": "^4.0.5",
"redux-devtools-extension": "^2.13.8",
"redux-thunk": "^2.3.0",
"serve": "^11.3.2",
"qrcode.react": "^1.0.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-jss": "^10.9.0",
"react-redux": "^7.2.6",
"react-router": "^6.2.1",
"react-router-dom": "^6.2.1",
"react-scripts": "4.0.3",
"redux-thunk": "^2.4.1",
"serve": "^13.0.2",
"stacktrace-js": "^2.0.2",
"typechain": "^6.0.5",
"typescript": "^4.3.5",
"workbox-cacheable-response": "^6.2.4",
"workbox-core": "^6.2.4",
"workbox-routing": "^6.2.4",
"workbox-strategies": "^6.2.4",
"zod": "^3.8.2"
"typechain": "^7.0.0",
"typescript": "^4.5.5",
"workbox-cacheable-response": "^6.4.2",
"workbox-core": "^6.4.2",
"workbox-routing": "^6.4.2",
"workbox-strategies": "^6.4.2",
"zod": "^3.11.6"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.31.0",
"@typescript-eslint/parser": "^4.31.0",
"@types/platform": "^1.3.4",
"@types/qrcode.react": "^1.0.2",
"@types/react": "^17.0.39",
"@types/react-dom": "^17.0.11",
"@types/react-redux": "^7.1.22",
"@types/react-router": "^5.1.18",
"@types/react-router-dom": "^5.3.3",
"@typescript-eslint/eslint-plugin": "^5.10.2",
"@typescript-eslint/parser": "^5.10.2",
"eslint": "^7.32.0",
"eslint-plugin-react": "^7.25.1",
"eslint-plugin-react-hooks": "^4.2.0",
"husky": "^7.0.2",
"lint-staged": "^11.1.2",
"prettier": "^2.3.2"
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"husky": "^7.0.4",
"lint-staged": "^12.3.3",
"prettier": "^2.5.1",
"redux-devtools-extension": "^2.13.9"
},
"engines": {
"node": ">=14",
"npm": ">=7"
"node": ">=16",
"npm": ">=8"
},
"browserslist": {
"production": [
Expand Down
8 changes: 4 additions & 4 deletions src/adapters/ethereum.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { BigNumber } from "ethers";
import { TransactionResponse, TransactionReceipt } from "@ethersproject/abstract-provider";
import hermezjs from "@hermeznetwork/hermezjs";
import { Providers, Addresses, HermezWallet } from "@hermeznetwork/hermezjs";

import { ETHER_TOKEN_ID, DEPOSIT_TX_TIMEOUT } from "src/constants";
import { Erc20__factory } from "src/types/contracts/erc-20/factories/Erc20__factory";
import { AsyncTask } from "src/utils/types";
import { convertTokenAmountToFiat } from "src/utils/currencies";
// domain
import { EthereumAccount, FiatExchangeRates, HermezWallet, ISOStringDate, Token } from "src/domain";
import { EthereumAccount, FiatExchangeRates, ISOStringDate, Token } from "src/domain";

/**
* Fetches token balances in the user's Ethereum account. Only for those tokens registered in Hermez and Ether.
Expand All @@ -20,8 +20,8 @@ function getEthereumAccounts(
fiatExchangeRates: FiatExchangeRates,
preferredCurrency: string
): Promise<EthereumAccount[]> {
const provider = hermezjs.Providers.getProvider();
const ethereumAddress = hermezjs.Addresses.getEthereumAddress(wallet.hermezEthereumAddress);
const provider = Providers.getProvider();
const ethereumAddress = Addresses.getEthereumAddress(wallet.hermezEthereumAddress);
const balancePromises: Promise<BigNumber>[] = hermezTokens.map((token) => {
if (token.id === ETHER_TOKEN_ID) {
// tokenID 0 is for Ether
Expand Down
15 changes: 8 additions & 7 deletions src/adapters/hermez-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { z } from "zod";
import { CallOverrides, BigNumber } from "ethers";
import {
CoordinatorAPI,
Enums,
HermezCompressedAmount,
HermezWallet,
Signers,
Tx,
TxFees,
TxUtils,
Expand All @@ -25,18 +28,16 @@ import {
HermezAccount,
HermezAccounts,
HermezRawAccount,
HermezWallet,
HistoryTransaction,
HistoryTransactions,
PaginationOrder,
PendingDeposit,
PoolTransaction,
PoolTransactions,
Signers,
Token,
Tokens,
} from "src/domain";
import { TxState } from "@hermeznetwork/hermezjs/src/enums";

const { TxState } = Enums;

////////////////////
// CoordinatorAPI //
Expand Down Expand Up @@ -156,7 +157,7 @@ export function getHistoryTransactions(
batchNum?: number,
accountIndex?: string,
fromItem?: number,
order?: PaginationOrder,
order?: CoordinatorAPI.PaginationOrder,
limit?: number,
axiosConfig?: Record<string, unknown>
): Promise<HistoryTransactions> {
Expand Down Expand Up @@ -280,7 +281,7 @@ export function getTokens(
tokenIds?: number[],
tokenSymbols?: string[],
fromItem?: number,
order?: PaginationOrder,
order?: CoordinatorAPI.PaginationOrder,
limit?: number,
axiosConfig?: Record<string, unknown>
): Promise<Tokens> {
Expand Down Expand Up @@ -322,7 +323,7 @@ export function getTokens(
*/
export function getPoolTransactions(
hermezEthereumAddress: string,
order?: PaginationOrder,
order?: CoordinatorAPI.PaginationOrder,
limit?: number
): Promise<PoolTransactions> {
return CoordinatorAPI.getPoolTransactions(
Expand Down
5 changes: 3 additions & 2 deletions src/adapters/parsers/hermez-api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { z } from "zod";
import { TxState, TxType } from "@hermeznetwork/hermezjs/src/enums";
import { Enums, Tx } from "@hermeznetwork/hermezjs";

// domain
import {
Expand All @@ -20,12 +20,13 @@ import {
PoolTransaction,
RecommendedFee,
TimerWithdraw,
Tx,
Token,
} from "src/domain";
// utils
import { StrictSchema } from "src/utils/type-safety";

const { TxState, TxType } = Enums;

const hermezApiResourceItem = StrictSchema<HermezApiResourceItem>()(
z.object({
itemId: z.number(),
Expand Down
4 changes: 0 additions & 4 deletions src/domain/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,16 @@ export type {
Exits,
FiatExchangeRates,
HermezApiResourceItem,
HermezWallet,
HistoryTransaction,
HistoryTransactions,
ISOStringDate,
L1Info,
L2Info,
MerkleProof,
NextForger,
PaginationOrder,
PoolTransaction,
PoolTransactions,
RecommendedFee,
Signers,
Tx,
Token,
Tokens,
} from "@hermeznetwork/hermezjs";
Expand Down
18 changes: 10 additions & 8 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,30 @@ import ReactDOM from "react-dom";
import { Provider } from "react-redux";
import { ThemeProvider } from "react-jss";
import { createBrowserHistory } from "history";
import { ConnectedRouter } from "connected-react-router";
import { ReduxRouter } from "@lagunovsky/redux-react-router";
import "normalize.css/normalize.css";

import * as serviceWorkerRegistration from "src/serviceWorkerRegistration";
import { configureStore, AppState } from "src/store";
import { configureStore } from "src/store";
import * as storage from "src/utils/storage";
import theme from "src/styles/theme";
import App from "src/views/app.view";

storage.checkVersion();

const history = createBrowserHistory<AppState>();
const history = createBrowserHistory();
const store = configureStore(history);

ReactDOM.render(
<Provider store={store}>
<ConnectedRouter history={history}>
<React.StrictMode>
<Provider store={store}>
<ThemeProvider theme={theme}>
<App />
<ReduxRouter history={history} store={store}>
<App />
</ReduxRouter>
</ThemeProvider>
</ConnectedRouter>
</Provider>,
</Provider>
</React.StrictMode>,
document.getElementById("app-root")
);

Expand Down
6 changes: 4 additions & 2 deletions src/store/account-details/account-details.thunks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios from "axios";
import { push } from "connected-react-router";
import { TxType } from "@hermeznetwork/hermezjs/src/enums";
import { push } from "@lagunovsky/redux-react-router";
import { Enums } from "@hermeznetwork/hermezjs";

import { AppState, AppDispatch, AppThunk } from "src/store";
import * as accountDetailsActions from "src/store/account-details/account-details.actions";
Expand All @@ -19,6 +19,8 @@ import {
// adapters
import * as adapters from "src/adapters";

const { TxType } = Enums;

let refreshCancelTokenSource = axios.CancelToken.source();

/**
Expand Down
3 changes: 1 addition & 2 deletions src/store/global/global.actions.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import { HermezWallet, Signers } from "@hermeznetwork/hermezjs";
import { HeaderState } from "src/store/global/global.reducer";
// domain
import {
CoordinatorState,
Env,
EthereumNetwork,
FiatExchangeRates,
HermezWallet,
ISOStringDate,
Message,
NetworkStatus,
PendingDelayedWithdraw,
PendingDeposit,
PendingWithdraw,
PoolTransaction,
Signers,
TimerWithdraw,
Token,
} from "src/domain";
Expand Down
3 changes: 1 addition & 2 deletions src/store/global/global.reducer.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { HermezWallet, Signers } from "@hermeznetwork/hermezjs";
import { AppAction } from "src/store";
import { GlobalActionTypes, GlobalAction } from "src/store/global/global.actions";
import { AsyncTask } from "src/utils/types";
Expand All @@ -8,15 +9,13 @@ import {
EthereumNetwork,
FiatExchangeRates,
HermezStatus,
HermezWallet,
Message,
NetworkStatus,
PendingDelayedWithdraws,
PendingDeposits,
PendingWithdraw,
PendingWithdraws,
PoolTransaction,
Signers,
TimerWithdraw,
TimerWithdraws,
Token,
Expand Down
Loading

0 comments on commit e019c3d

Please sign in to comment.