diff --git a/.circleci/config.yml b/.circleci/config.yml index a9218ff6d5b..e3993b8a0d6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -175,7 +175,7 @@ jobs: "https://circleci.com/api/v2/pipeline/$pipeline_id/workflow" \ --header "Circle-Token: $CIRCLE_DAILY_DEPLOY_API_TOKEN" | jq -r '.items[] | select(.name=="release") | .id') - # Fetch the "deploy-prod-foundation-nodes-trigger" job + # Fetch the "deploy-foundation-nodes-trigger" job job_id=$(curl --request GET \ "https://circleci.com/api/v2/workflow/$workflow_id/job" \ --header "Circle-Token: $CIRCLE_DAILY_DEPLOY_API_TOKEN" | jq -r '.items[] | select(.name=="deploy-foundation-nodes-trigger" and .status=="on_hold") | .id') diff --git a/.circleci/src/jobs/commit-audius-docker-compose-and-notify.yml b/.circleci/src/jobs/commit-audius-docker-compose-and-notify.yml index c63e6d41358..3b18fc5bb0a 100644 --- a/.circleci/src/jobs/commit-audius-docker-compose-and-notify.yml +++ b/.circleci/src/jobs/commit-audius-docker-compose-and-notify.yml @@ -97,7 +97,7 @@ steps: OLD_VERSION=$(echo ${NEW_VERSION} | awk -F. '{$NF = $NF - 1;} 1' | sed 's/ /./g') # Generate diff for audius-protocol repo commits from last release to HEAD (we're on the new release branch thanks to the checkout step) - GIT_DIFF=$(git log --pretty=format:'%an - %s []' --abbrev-commit origin/release-v$OLD_VERSION..HEAD -- mediorum packages/discovery-provider packages/identity-service comms monitoring/healthz | sed 's/"/\\"/g' | tr -d '\r' | sed ':a;N;$!ba;s/\n/=DELIM@/g') + GIT_DIFF=$(git log --pretty=format:'%an - %s []' --abbrev-commit origin/release-v$OLD_VERSION..HEAD -- mediorum packages/discovery-provider packages/identity-service comms monitoring/healthz protocol-dashboard | sed 's/"/\\"/g' | tr -d '\r' | sed ':a;N;$!ba;s/\n/=DELIM@/g') json_content="{ \"blocks\": [" json_content+="{ \"type\": \"header\", \"text\": { \"type\": \"plain_text\", \"text\": \"New Protocol Release (v$NEW_VERSION)\n\" } }," audius_protocol_commit_blocks=$(generate_json_content "$GIT_DIFF") diff --git a/protocol-dashboard/.npmrc b/protocol-dashboard/.npmrc new file mode 100644 index 00000000000..d3a0072e60f --- /dev/null +++ b/protocol-dashboard/.npmrc @@ -0,0 +1,3 @@ +# TODO: Remove legacy-peer-deps when all peerDependency conflicts +# have been resolved in the dependency tree +legacy-peer-deps=true \ No newline at end of file diff --git a/protocol-dashboard/package-lock.json b/protocol-dashboard/package-lock.json index 739a0275999..7c8a059cf25 100644 --- a/protocol-dashboard/package-lock.json +++ b/protocol-dashboard/package-lock.json @@ -11,32 +11,32 @@ "@apollo/client": "3.3.7", "@audius/sdk": "3.0.11-beta.9", "@audius/stems": "0.3.10", - "@reduxjs/toolkit": "1.4.0", + "@reduxjs/toolkit": "1.9.7", "@self.id/3box-legacy": "0.3.0", "@self.id/core": "0.4.1", + "@tanstack/react-query": "5.0.5", + "@tanstack/react-query-devtools": "5.1.0", "chart.js": "2.9.3", "clsx": "1.1.1", - "connected-react-router": "6.8.0", "dayjs": "1.8.36", "graphql": "15.5.0", - "history": "4.7.2", "identicon.js": "2.3.3", "lodash": "4.17.20", "numeral": "2.0.6", - "react": "17.0.2", + "react": "18.2.0", "react-chartjs-2": "2.10.0", "react-country-flag": "3.0.2", "react-custom-scrollbars": "4.2.1", - "react-dom": "17.0.2", + "react-dom": "18.2.0", "react-helmet": "6.1.0", "react-lottie": "1.2.3", "react-markdown": "5.0.3", - "react-redux": "7.2.1", - "react-router-dom": "5.2.0", + "react-redux": "8.1.3", + "react-router-dom": "6.17.0", "react-spinners": "0.5.12", "react-spring": "8.0.25", "react-virtualized": "9.22.2", - "redux-thunk": "2.3.0", + "redux-thunk": "2.4.2", "remark-gfm": "1.0.0", "semver": "6.3.0", "simplebar-react": "3.0.0-beta.5", @@ -46,20 +46,20 @@ "devDependencies": { "@openzeppelin/test-helpers": "0.5.6", "@pinata/sdk": "1.1.13", + "@tanstack/eslint-plugin-query": "5.0.5", "@types/3box": "1.22.0", "@types/bn.js": "5.1.2", "@types/classnames": "2.2.10", - "@types/history": "5.0.0", "@types/jest": "24.9.1", "@types/lodash": "4.14.160", "@types/node": "12.0.10", "@types/numeral": "0.0.28", - "@types/react": "17.0.2", - "@types/react-dom": "16.8.4", + "@types/react": "18.2.0", + "@types/react-dom": "18.2.14", "@types/react-helmet": "5.0.16", "@types/react-lottie": "1.2.5", - "@types/react-redux": "7.1.9", - "@types/react-router-dom": "5.1.5", + "@types/react-redux": "7.1.28", + "@types/react-router-dom": "5.3.3", "@types/react-tooltip": "3.11.0", "@types/react-virtualized": "9.21.10", "@types/semver": "6.2.1", @@ -78,7 +78,7 @@ "path-browserify": "1.0.1", "postcss": "8.4.14", "prettier": "1.19.1", - "redux-devtools-extension": "2.13.8", + "redux-devtools-extension": "2.13.9", "setimmediate": "1.0.5", "stream-browserify": "3.0.0", "stream-http": "3.2.0", @@ -88,11 +88,11 @@ "typescript": "5.2.2", "url": "0.11.0", "util": "0.12.4", - "vite-plugin-node-polyfills": "^0.15.0", - "vite-plugin-svgr": "^4.1.0", - "vite-plugin-top-level-await": "^1.3.1", - "vite-plugin-wasm": "^3.2.2", - "vite-tsconfig-paths": "^4.2.1" + "vite-plugin-node-polyfills": "0.15.0", + "vite-plugin-svgr": "4.1.0", + "vite-plugin-top-level-await": "1.3.1", + "vite-plugin-wasm": "3.2.2", + "vite-tsconfig-paths": "4.2.1" } }, "node_modules/@ampproject/remapping": { @@ -775,12 +775,12 @@ } }, "node_modules/@ceramicnetwork/3id-did-resolver": { - "version": "2.29.0", - "resolved": "https://registry.npmjs.org/@ceramicnetwork/3id-did-resolver/-/3id-did-resolver-2.29.0.tgz", - "integrity": "sha512-SLTQWgaLeFebURvomer2rC9IAbk1MFn6QZ7WEkWj7hJkg0ql5sy5fZ4LWXjCXYIepQ+4fUvoQoaY0fol201Ndg==", + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/@ceramicnetwork/3id-did-resolver/-/3id-did-resolver-2.30.0.tgz", + "integrity": "sha512-F/zBgFTR5dXiFZqzt6RGsKF4csI4PukIVcOrPER5atUpnKlN9OEsMxn7xpH7bnkU/YuakLf0Nh+Q3bpPxW+q0w==", "dependencies": { - "@ceramicnetwork/common": "^2.36.0", - "@ceramicnetwork/stream-tile": "^2.32.0", + "@ceramicnetwork/common": "^2.37.0", + "@ceramicnetwork/stream-tile": "^2.33.0", "@ceramicnetwork/streamid": "^2.17.0", "cross-fetch": "^3.1.4", "least-recent": "^1.0.3", @@ -798,9 +798,9 @@ } }, "node_modules/@ceramicnetwork/codecs": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@ceramicnetwork/codecs/-/codecs-1.11.0.tgz", - "integrity": "sha512-UEK8qveRk5f+ubAamdJ+fInmIGVKKMTXD8D4SUYa8zHXkKk4zGnYw+XwThAdh7+aClCWGN83SECR9TnaMZhIGw==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/@ceramicnetwork/codecs/-/codecs-1.12.0.tgz", + "integrity": "sha512-LpQzhfPRsMAyNOltMXsk5AuBh+g6VixlkH9JfLaRYnjJuVPiMPl/t/ezL+25jPWndW69qPvmCPEedePq9WTFkA==", "dependencies": { "@ceramicnetwork/streamid": "^2.17.0", "cartonne": "^2.1.1", @@ -820,11 +820,11 @@ } }, "node_modules/@ceramicnetwork/common": { - "version": "2.36.0", - "resolved": "https://registry.npmjs.org/@ceramicnetwork/common/-/common-2.36.0.tgz", - "integrity": "sha512-cZu3953wsTd/xKUDosC1l2tXpWKLkYA+PkkueRCXIrLRvNQrMCde8yx6xnnNcFihU3hpzux/iqkHHEihATeN1Q==", + "version": "2.37.0", + "resolved": "https://registry.npmjs.org/@ceramicnetwork/common/-/common-2.37.0.tgz", + "integrity": "sha512-8v6mIu6xq6j/E0pK5EW/LPpZTqfUlk7iu97rZPrPdjxtNiOFxW1YX5jjDe9SYTjGZNOi/89MRzCLA1tzab8a9Q==", "dependencies": { - "@ceramicnetwork/codecs": "^1.11.0", + "@ceramicnetwork/codecs": "^1.12.0", "@ceramicnetwork/streamid": "^2.17.0", "@didtools/cacao": "^2.1.0", "@didtools/pkh-ethereum": "^0.1.0", @@ -854,15 +854,15 @@ } }, "node_modules/@ceramicnetwork/http-client": { - "version": "2.33.0", - "resolved": "https://registry.npmjs.org/@ceramicnetwork/http-client/-/http-client-2.33.0.tgz", - "integrity": "sha512-rZ2NlA1NoSSyA44ZK5W7KhvdNX6i3hFPu1z4NyRA5Zvl4jwEogGboaWZF2hWDDXxfkrRZX7+J/JvzxBKp360QQ==", - "dependencies": { - "@ceramicnetwork/common": "^2.36.0", - "@ceramicnetwork/stream-caip10-link": "^2.31.0", - "@ceramicnetwork/stream-model": "^1.18.0", - "@ceramicnetwork/stream-model-instance": "^1.18.0", - "@ceramicnetwork/stream-tile": "^2.32.0", + "version": "2.34.0", + "resolved": "https://registry.npmjs.org/@ceramicnetwork/http-client/-/http-client-2.34.0.tgz", + "integrity": "sha512-nKw33TDCz2A5b2oeeug12Vpzf1sAhhNx1jsJMk/E3ABQtPVLL60s3tel6BTAHOGp6v9QiPMFKhqpbWnU4I4w9Q==", + "dependencies": { + "@ceramicnetwork/common": "^2.37.0", + "@ceramicnetwork/stream-caip10-link": "^2.32.0", + "@ceramicnetwork/stream-model": "^1.19.0", + "@ceramicnetwork/stream-model-instance": "^1.19.0", + "@ceramicnetwork/stream-tile": "^2.33.0", "@ceramicnetwork/streamid": "^2.17.0", "@scarf/scarf": "^1.1.1", "query-string": "^7.1.0", @@ -870,11 +870,11 @@ } }, "node_modules/@ceramicnetwork/stream-caip10-link": { - "version": "2.31.0", - "resolved": "https://registry.npmjs.org/@ceramicnetwork/stream-caip10-link/-/stream-caip10-link-2.31.0.tgz", - "integrity": "sha512-yuj+tRd7REniekUxiNqFiyOsk+wf1Y8O08mM3hyDnVeOTax8C3ReO8ODYpRRIPESlRTb5SZn2sZp9THCAmJ2Ow==", + "version": "2.32.0", + "resolved": "https://registry.npmjs.org/@ceramicnetwork/stream-caip10-link/-/stream-caip10-link-2.32.0.tgz", + "integrity": "sha512-lZmFOjYIZR91YDWDf5cucd9SDWU74UXrUBETXYq1qgfKO75tVz+rUC0gpH8gX7zFWpQOljELNNWZlurq/6jR7w==", "dependencies": { - "@ceramicnetwork/common": "^2.36.0", + "@ceramicnetwork/common": "^2.37.0", "@ceramicnetwork/streamid": "^2.17.0", "caip": "~1.1.0", "did-resolver": "^4.0.1", @@ -887,12 +887,12 @@ "integrity": "sha512-S6fWHvCXkZg2IhS4RcVHxwuyVejPR7c+a4Go0xbQ9ps5kILa8viiYQgrM4gfTyeTjJ0ekgJH9gk/BawTpmkbZA==" }, "node_modules/@ceramicnetwork/stream-model": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/@ceramicnetwork/stream-model/-/stream-model-1.18.0.tgz", - "integrity": "sha512-FmQ/gMeSLm0ow6c0sQwVtPoVCvMDKUXvjLAItoh4qbIVTo6TlEpSOalq7d3QdjttzZ3xxi3fiOBlmmQmpkku6g==", + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/@ceramicnetwork/stream-model/-/stream-model-1.19.0.tgz", + "integrity": "sha512-jhJp99JAiXsE3LyEWxjUlzuxxynuStonfuNFpXqPdxm/eOr94elKTG5/UO7y+/k6FupOECcQG78P4iY+BmH7PQ==", "dependencies": { - "@ceramicnetwork/codecs": "^1.11.0", - "@ceramicnetwork/common": "^2.36.0", + "@ceramicnetwork/codecs": "^1.12.0", + "@ceramicnetwork/common": "^2.37.0", "@ceramicnetwork/streamid": "^2.17.0", "@ipld/dag-cbor": "^7.0.0", "@stablelib/random": "^1.0.1", @@ -906,11 +906,11 @@ } }, "node_modules/@ceramicnetwork/stream-model-instance": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/@ceramicnetwork/stream-model-instance/-/stream-model-instance-1.18.0.tgz", - "integrity": "sha512-DikAfS1oZQbnco3wROdr+Wmln1qwh3MWOJt00dSaDhfUNw3dmcUdriZnjsUDs6B0pC+6d213ZfP+DZqJWHwRqw==", + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/@ceramicnetwork/stream-model-instance/-/stream-model-instance-1.19.0.tgz", + "integrity": "sha512-GzUtIOkAw5y2Z76GiQZP7IYIux72xg9Adn43HKkETDwLM46VoJroiUB/4E03B1mYf3/OmLq0PMRQVE5SfXDZBQ==", "dependencies": { - "@ceramicnetwork/common": "^2.36.0", + "@ceramicnetwork/common": "^2.37.0", "@ceramicnetwork/streamid": "^2.17.0", "@ipld/dag-cbor": "^7.0.0", "@stablelib/random": "^1.0.1", @@ -949,11 +949,11 @@ } }, "node_modules/@ceramicnetwork/stream-tile": { - "version": "2.32.0", - "resolved": "https://registry.npmjs.org/@ceramicnetwork/stream-tile/-/stream-tile-2.32.0.tgz", - "integrity": "sha512-3CpqkDOY00PGNWWGIBvT/+iv6TUyb8EUv4Nrn0r8lHj6UoM+lCZb78LLLpjw6FQnm5kL6/TkzfJJT6jKqB7LjQ==", + "version": "2.33.0", + "resolved": "https://registry.npmjs.org/@ceramicnetwork/stream-tile/-/stream-tile-2.33.0.tgz", + "integrity": "sha512-gGe6YgAnX9EGoUYDgaTZP4QxxXd+JLLmk36RLDwh6QVHm2z+jDWuKhM1XqX45tG1wFv55ULjDLz3p1iIFPt9Jg==", "dependencies": { - "@ceramicnetwork/common": "^2.36.0", + "@ceramicnetwork/common": "^2.37.0", "@ceramicnetwork/streamid": "^2.17.0", "@ipld/dag-cbor": "^7.0.0", "@stablelib/random": "^1.0.1", @@ -1079,9 +1079,9 @@ } }, "node_modules/@didtools/cacao/node_modules/cborg": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/cborg/-/cborg-4.0.3.tgz", - "integrity": "sha512-poLvpK30KT5KI8gzDx3J/IuVCbsLqMT2fEbOrOuX0H7Hyj8yg5LezeWhRh9aLa5Z6MfPC5sriW3HVJF328M8LQ==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/cborg/-/cborg-4.0.4.tgz", + "integrity": "sha512-nu+JXYskYqWN/tFWQVjL2ZYlUwK+dapqkTpruAtJkwmDv7XaTgg8PStUbO+sXfhqSWaeQ9LPSPCTrO2WZ2Bxfg==", "bin": { "cborg": "lib/bin.js" } @@ -1622,6 +1622,21 @@ "node": ">=12" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, "node_modules/@ethereumjs/common": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.5.0.tgz", @@ -2540,9 +2555,9 @@ } }, "node_modules/@ledgerhq/cryptoassets": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/@ledgerhq/cryptoassets/-/cryptoassets-11.0.0.tgz", - "integrity": "sha512-r21sWwHbPqj58dU3qIYApdKHTiet2rlCJV/hGYSYQf8AiYJx/s9IURDaeQBkq1pd4Oo9e59svuD1UYip2Nw4jA==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/@ledgerhq/cryptoassets/-/cryptoassets-11.0.1.tgz", + "integrity": "sha512-VhSA1ydoTnNjoC5c+S/a+YURJV+UNvuLVkRrKpP87zaQ2a+odPkP3EVDrU+G1Dvt/LipA24ZgcpoxXTbO6fQ9Q==", "dev": true, "dependencies": { "invariant": "2" @@ -2600,15 +2615,15 @@ } }, "node_modules/@ledgerhq/domain-service": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/@ledgerhq/domain-service/-/domain-service-1.1.12.tgz", - "integrity": "sha512-k41XiV+hDPxw9JWqybfses+Z1HAiuflv5x7AbtS+hBE6h6BYRlqEbPbDdOfMvLFeAxOFltHTwLimFsepFdvuYw==", + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/@ledgerhq/domain-service/-/domain-service-1.1.13.tgz", + "integrity": "sha512-8XQl4glEfNyX4BkNhuwe69mzn1VIasWFoKlgXIXf6gc8Rw1Qzcn0LE+/3DBxZ3pC3IWiBnm7MmXMrIaSLjnPNQ==", "dev": true, "dependencies": { - "@ledgerhq/cryptoassets": "^11.0.0", + "@ledgerhq/cryptoassets": "^11.0.1", "@ledgerhq/errors": "^6.14.0", "@ledgerhq/logs": "^6.10.1", - "@ledgerhq/types-live": "^6.41.0", + "@ledgerhq/types-live": "^6.41.1", "axios": "^1.3.4", "eip55": "^2.1.1", "react": "^17.0.2", @@ -2660,6 +2675,43 @@ "node": ">= 6" } }, + "node_modules/@ledgerhq/domain-service/node_modules/react": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz", + "integrity": "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==", + "dev": true, + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@ledgerhq/domain-service/node_modules/react-dom": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz", + "integrity": "sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==", + "dev": true, + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1", + "scheduler": "^0.20.2" + }, + "peerDependencies": { + "react": "17.0.2" + } + }, + "node_modules/@ledgerhq/domain-service/node_modules/scheduler": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.2.tgz", + "integrity": "sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==", + "dev": true, + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + }, "node_modules/@ledgerhq/errors": { "version": "6.14.0", "resolved": "https://registry.npmjs.org/@ledgerhq/errors/-/errors-6.14.0.tgz", @@ -2667,12 +2719,12 @@ "dev": true }, "node_modules/@ledgerhq/evm-tools": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@ledgerhq/evm-tools/-/evm-tools-1.0.8.tgz", - "integrity": "sha512-gObo+42aFYYjj631Z6oxB+1lKz8XMDad20K2HpSly99bYN1D/0vDMl+LqX7LpeXh/dJsrUy0xE+xa5uwPPjP+A==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@ledgerhq/evm-tools/-/evm-tools-1.0.9.tgz", + "integrity": "sha512-yfNFGRDH+D59tZcR/iGBaW5RxKoPglRAolSUVJT+c+YN5DXRdS8yz+WrlhLrusoR4JHpfA3trBfw5KUrBrHY7g==", "dev": true, "dependencies": { - "@ledgerhq/cryptoassets": "^11.0.0", + "@ledgerhq/cryptoassets": "^11.0.1", "@ledgerhq/live-env": "^0.6.0", "@ledgerhq/live-network": "^1.1.7", "crypto-js": "4.1.1", @@ -2866,21 +2918,21 @@ } }, "node_modules/@ledgerhq/hw-app-eth": { - "version": "6.34.7", - "resolved": "https://registry.npmjs.org/@ledgerhq/hw-app-eth/-/hw-app-eth-6.34.7.tgz", - "integrity": "sha512-a3DdgNRNa/2u97CJxvjZybtOdSp2GxRFF80H0jUweeXsqgGW5WKM+17Ay3NysjXzaKolnvAgTonSNdTS6h0pzw==", + "version": "6.34.8", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-app-eth/-/hw-app-eth-6.34.8.tgz", + "integrity": "sha512-sFYRGO7kgiTlgCRPdHJsF69s75TQz3Idi2YGn7eWhM/yxSJiAE1Kt/OLOW2ej68U/mfxI5pDIK8f8AZuK+8RFg==", "dev": true, "dependencies": { "@ethersproject/abi": "^5.5.0", "@ethersproject/rlp": "^5.5.0", - "@ledgerhq/cryptoassets": "^11.0.0", - "@ledgerhq/domain-service": "^1.1.12", + "@ledgerhq/cryptoassets": "^11.0.1", + "@ledgerhq/domain-service": "^1.1.13", "@ledgerhq/errors": "^6.14.0", - "@ledgerhq/evm-tools": "^1.0.8", + "@ledgerhq/evm-tools": "^1.0.9", "@ledgerhq/hw-transport": "^6.28.8", "@ledgerhq/hw-transport-mocker": "^6.27.19", "@ledgerhq/logs": "^6.10.1", - "@ledgerhq/types-live": "^6.41.0", + "@ledgerhq/types-live": "^6.41.1", "axios": "^1.3.4", "bignumber.js": "^9.1.2" } @@ -3025,9 +3077,9 @@ } }, "node_modules/@ledgerhq/live-network/node_modules/@types/node": { - "version": "20.8.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.6.tgz", - "integrity": "sha512-eWO4K2Ji70QzKUqRy6oyJWUeB7+g2cRagT3T/nxYibYcT4y2BDL8lqolRXjTHmkZCdJfIPaY73KbJAZmcryxTQ==", + "version": "20.8.8", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.8.tgz", + "integrity": "sha512-YRsdVxq6OaLfmR9Hy816IMp33xOBjfyOgUd77ehqg96CFywxAPbDbXvAsuN2KVg2HOT8Eh6uAfU+l4WffwPVrQ==", "dev": true, "dependencies": { "undici-types": "~5.25.1" @@ -3078,9 +3130,9 @@ "dev": true }, "node_modules/@ledgerhq/types-live": { - "version": "6.41.0", - "resolved": "https://registry.npmjs.org/@ledgerhq/types-live/-/types-live-6.41.0.tgz", - "integrity": "sha512-qiTpQkaQD4YQxFS6tpBVlMkkWLrCc/PIz9foSBcS0SiJMn3apYm2JchC4tdiOuhUwL0IPRMqS0yNOGmMm6Vs8g==", + "version": "6.41.1", + "resolved": "https://registry.npmjs.org/@ledgerhq/types-live/-/types-live-6.41.1.tgz", + "integrity": "sha512-M9NcGlpyW7383HZ+Wcl+vVj07fKlBLQT29wrrPTW9raj2iq0fzyAaxSQPs0VKX6LghLQSmXG2EdcvQ9v5FakgA==", "dev": true, "dependencies": { "bignumber.js": "^9.1.2", @@ -3109,9 +3161,9 @@ } }, "node_modules/@noble/ciphers": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-0.3.0.tgz", - "integrity": "sha512-ldbrnOjmNRwFdXcTM6uXDcxpMIFrbzAWNnpBPp4oTJTFF0XByGD6vf45WrehZGXRQTRVV+Zm8YP+EgEf+e4cWA==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-0.4.0.tgz", + "integrity": "sha512-xaUaUUDWbHIFSxaQ/pIe+33VG2mfJp6N/KxKLmZr5biWdNznCAmfu24QRhX10BbVAuqOahAoyp0S4M9md6GPDw==", "funding": { "url": "https://paulmillr.com/funding/" } @@ -3356,9 +3408,9 @@ "dev": true }, "node_modules/@oclif/screen": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/@oclif/screen/-/screen-3.0.7.tgz", - "integrity": "sha512-jQBPHcMh5rcIPKdqA6xlzioLOmkaVnjg2MVyjMzBKV8hDhLWNSiZqx7NAWXpP70v2LFvGdVoV8BSbK9iID3eHg==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@oclif/screen/-/screen-3.0.8.tgz", + "integrity": "sha512-yx6KAqlt3TAHBduS2fMQtJDL2ufIHnDRArrJEOoTTuizxqmjLT+psGYOHpmMl3gvQpFJ11Hs76guUUktzAF9Bg==", "dev": true, "engines": { "node": ">=12.0.0" @@ -3552,14 +3604,34 @@ "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" }, "node_modules/@reduxjs/toolkit": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-1.4.0.tgz", - "integrity": "sha512-hkxQwVx4BNVRsYdxjNF6cAseRmtrkpSlcgJRr3kLUcHPIAMZAmMJkXmHh/eUEGTMqPzsYpJLM7NN2w9fxQDuGw==", + "version": "1.9.7", + "resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-1.9.7.tgz", + "integrity": "sha512-t7v8ZPxhhKgOKtU+uyJT13lu4vL7az5aFi4IdoDs/eS548edn2M8Ik9h8fxgvMjGoAUVFSt6ZC1P5cWmQ014QQ==", "dependencies": { - "immer": "^7.0.3", - "redux": "^4.0.0", - "redux-thunk": "^2.3.0", - "reselect": "^4.0.0" + "immer": "^9.0.21", + "redux": "^4.2.1", + "redux-thunk": "^2.4.2", + "reselect": "^4.1.8" + }, + "peerDependencies": { + "react": "^16.9.0 || ^17.0.0 || ^18", + "react-redux": "^7.2.1 || ^8.0.2" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-redux": { + "optional": true + } + } + }, + "node_modules/@remix-run/router": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.10.0.tgz", + "integrity": "sha512-Lm+fYpMfZoEucJ7cMxgt4dYt8jLfbpwRCzAjm9UgSLOkmlqo9gupxt6YX3DY0Fk155NT9l17d/ydi+964uS9Lw==", + "engines": { + "node": ">=14.0.0" } }, "node_modules/@rollup/plugin-inject": { @@ -3941,9 +4013,9 @@ } }, "node_modules/@stacks/common/node_modules/@types/node": { - "version": "18.18.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.5.tgz", - "integrity": "sha512-4slmbtwV59ZxitY4ixUZdy1uRLf9eSIvBWPQxNjhHYWEtn0FryfKpyS2cvADYXTayWdKEIsJengncrVvkI4I6A==" + "version": "18.18.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.6.tgz", + "integrity": "sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==" }, "node_modules/@stacks/encryption": { "version": "6.9.0", @@ -3984,9 +4056,9 @@ ] }, "node_modules/@stacks/encryption/node_modules/@types/node": { - "version": "18.18.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.5.tgz", - "integrity": "sha512-4slmbtwV59ZxitY4ixUZdy1uRLf9eSIvBWPQxNjhHYWEtn0FryfKpyS2cvADYXTayWdKEIsJengncrVvkI4I6A==" + "version": "18.18.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.6.tgz", + "integrity": "sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==" }, "node_modules/@stacks/encryption/node_modules/base-x": { "version": "4.0.0", @@ -4315,9 +4387,9 @@ } }, "node_modules/@swc/core": { - "version": "1.3.93", - "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.3.93.tgz", - "integrity": "sha512-690GRr1wUGmGYZHk7fUduX/JUwViMF2o74mnZYIWEcJaCcd9MQfkhsxPBtjeg6tF+h266/Cf3RPYhsFBzzxXcA==", + "version": "1.3.94", + "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.3.94.tgz", + "integrity": "sha512-jTHn8UJOGgERKZLy8euEixVAzC/w/rUSuMlM3e7hxgap/TC595hSkuQwtkpL238dsuEPveD44GMy2A5UBtSvjg==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -4332,16 +4404,16 @@ "url": "https://opencollective.com/swc" }, "optionalDependencies": { - "@swc/core-darwin-arm64": "1.3.93", - "@swc/core-darwin-x64": "1.3.93", - "@swc/core-linux-arm-gnueabihf": "1.3.93", - "@swc/core-linux-arm64-gnu": "1.3.93", - "@swc/core-linux-arm64-musl": "1.3.93", - "@swc/core-linux-x64-gnu": "1.3.93", - "@swc/core-linux-x64-musl": "1.3.93", - "@swc/core-win32-arm64-msvc": "1.3.93", - "@swc/core-win32-ia32-msvc": "1.3.93", - "@swc/core-win32-x64-msvc": "1.3.93" + "@swc/core-darwin-arm64": "1.3.94", + "@swc/core-darwin-x64": "1.3.94", + "@swc/core-linux-arm-gnueabihf": "1.3.94", + "@swc/core-linux-arm64-gnu": "1.3.94", + "@swc/core-linux-arm64-musl": "1.3.94", + "@swc/core-linux-x64-gnu": "1.3.94", + "@swc/core-linux-x64-musl": "1.3.94", + "@swc/core-win32-arm64-msvc": "1.3.94", + "@swc/core-win32-ia32-msvc": "1.3.94", + "@swc/core-win32-x64-msvc": "1.3.94" }, "peerDependencies": { "@swc/helpers": "^0.5.0" @@ -4353,9 +4425,9 @@ } }, "node_modules/@swc/core-darwin-arm64": { - "version": "1.3.93", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.93.tgz", - "integrity": "sha512-gEKgk7FVIgltnIfDO6GntyuQBBlAYg5imHpRgLxB1zSI27ijVVkksc6QwISzFZAhKYaBWIsFSVeL9AYSziAF7A==", + "version": "1.3.94", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.94.tgz", + "integrity": "sha512-KNuE6opIy/wAXiGUWLhGWhCG3wA/AdjG6eYkv6dstrAURLaQMAoD8vDfVm8pxS8FA8Kx+0Z4QiDNPqk5aKIsqg==", "cpu": [ "arm64" ], @@ -4369,9 +4441,9 @@ } }, "node_modules/@swc/core-darwin-x64": { - "version": "1.3.93", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.3.93.tgz", - "integrity": "sha512-ZQPxm/fXdDQtn3yrYSL/gFfA8OfZ5jTi33yFQq6vcg/Y8talpZ+MgdSlYM0FkLrZdMTYYTNFiuBQuuvkA+av+Q==", + "version": "1.3.94", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.3.94.tgz", + "integrity": "sha512-HypemhyehQrLqXwfJv5ronD4BMAXdgMCP4Ei7rt3B6Ftmt9axwGvdwGiXxsYR9h1ncyxoVxN+coGxbNIhKhahw==", "cpu": [ "x64" ], @@ -4385,9 +4457,9 @@ } }, "node_modules/@swc/core-linux-arm-gnueabihf": { - "version": "1.3.93", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.93.tgz", - "integrity": "sha512-OYFMMI2yV+aNe3wMgYhODxHdqUB/jrK0SEMHHS44GZpk8MuBXEF+Mcz4qjkY5Q1EH7KVQqXb/gVWwdgTHpjM2A==", + "version": "1.3.94", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.94.tgz", + "integrity": "sha512-KzKN54c7Y6X1db+bBVSXG4+bXmAPvXtDWk+TgwNJH4yYliOrnP/RKkHA5QZ9VFSnqJF06/sAO4kYBiL/aVQDBQ==", "cpu": [ "arm" ], @@ -4401,9 +4473,9 @@ } }, "node_modules/@swc/core-linux-arm64-gnu": { - "version": "1.3.93", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.93.tgz", - "integrity": "sha512-BT4dT78odKnJMNiq5HdjBsv29CiIdcCcImAPxeFqAeFw1LL6gh9nzI8E96oWc+0lVT5lfhoesCk4Qm7J6bty8w==", + "version": "1.3.94", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.94.tgz", + "integrity": "sha512-iAcR8Ho0Uck/SLSrgYfXkpcGOXuN5waMZO7GlL/52QODr7GJtOfZ0H1MCZLbIFkPJp/iXoJpYgym4d/qSd477Q==", "cpu": [ "arm64" ], @@ -4417,9 +4489,9 @@ } }, "node_modules/@swc/core-linux-arm64-musl": { - "version": "1.3.93", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.93.tgz", - "integrity": "sha512-yH5fWEl1bktouC0mhh0Chuxp7HEO4uCtS/ly1Vmf18gs6wZ8DOOkgAEVv2dNKIryy+Na++ljx4Ym7C8tSJTrLw==", + "version": "1.3.94", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.94.tgz", + "integrity": "sha512-VCHL1Mb9ENHx+sAeubSSg481MUeP9/PYzPPy9tfswunj/w35M+vEWflwK2dzQL9kUTFD3zcFTpAgsKnj6aX24w==", "cpu": [ "arm64" ], @@ -4433,9 +4505,9 @@ } }, "node_modules/@swc/core-linux-x64-gnu": { - "version": "1.3.93", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.93.tgz", - "integrity": "sha512-OFUdx64qvrGJhXKEyxosHxgoUVgba2ztYh7BnMiU5hP8lbI8G13W40J0SN3CmFQwPP30+3oEbW7LWzhKEaYjlg==", + "version": "1.3.94", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.94.tgz", + "integrity": "sha512-gjq7U6clhJi0Oel2a4gwR4MbSu+THQ2hmBNVCOSA3JjPZWZTkJXaJDpnh/r7PJxKBwUDlo0VPlwiwjepAQR2Rw==", "cpu": [ "x64" ], @@ -4449,9 +4521,9 @@ } }, "node_modules/@swc/core-linux-x64-musl": { - "version": "1.3.93", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.93.tgz", - "integrity": "sha512-4B8lSRwEq1XYm6xhxHhvHmKAS7pUp1Q7E33NQ2TlmFhfKvCOh86qvThcjAOo57x8DRwmpvEVrqvpXtYagMN6Ig==", + "version": "1.3.94", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.94.tgz", + "integrity": "sha512-rSylruWyeol2ujZDHmwiovupMR5ukMXivlA7DDxmQ1dFUV9HuiPknQrU5rEbI3V2V3V5RkpbEKjnADen7AeMPQ==", "cpu": [ "x64" ], @@ -4465,9 +4537,9 @@ } }, "node_modules/@swc/core-win32-arm64-msvc": { - "version": "1.3.93", - "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.93.tgz", - "integrity": "sha512-BHShlxtkven8ZjjvZ5QR6sC5fZCJ9bMujEkiha6W4cBUTY7ce7qGFyHmQd+iPC85d9kD/0cCiX/Xez8u0BhO7w==", + "version": "1.3.94", + "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.94.tgz", + "integrity": "sha512-OenDUr5MQkz506ebVQq6ezoZ3GZ26nchgf5mPnwab4gx2TEiyR9zn7MdX5LWskTmOK3+FszPbGK0B5oLK6Y5yw==", "cpu": [ "arm64" ], @@ -4481,9 +4553,9 @@ } }, "node_modules/@swc/core-win32-ia32-msvc": { - "version": "1.3.93", - "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.93.tgz", - "integrity": "sha512-nEwNWnz4JzYAK6asVvb92yeylfxMYih7eMQOnT7ZVlZN5ba9WF29xJ6kcQKs9HRH6MvWhz9+wRgv3FcjlU6HYA==", + "version": "1.3.94", + "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.94.tgz", + "integrity": "sha512-mi6NcmtJKnaiHAxLtVz+WzunscsEwPdA0j15DuiYVx06Xo+MdRLJj4eVBgVLwGD1AI3IqKs4MVVx2cD7n0h5mg==", "cpu": [ "ia32" ], @@ -4497,9 +4569,9 @@ } }, "node_modules/@swc/core-win32-x64-msvc": { - "version": "1.3.93", - "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.93.tgz", - "integrity": "sha512-jibQ0zUr4kwJaQVwgmH+svS04bYTPnPw/ZkNInzxS+wFAtzINBYcU8s2PMWbDb2NGYiRSEeoSGyAvS9H+24JFA==", + "version": "1.3.94", + "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.94.tgz", + "integrity": "sha512-Ba0ZLcGMnqPWWF9Xa+rWhhnkpvE7XoQegMP/VCF2JIHb2ieGBC8jChO6nKRFKZjib/3wghGzxakyDQx3LDhDug==", "cpu": [ "x64" ], @@ -4535,6 +4607,82 @@ "node": ">=14.16" } }, + "node_modules/@tanstack/eslint-plugin-query": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@tanstack/eslint-plugin-query/-/eslint-plugin-query-5.0.5.tgz", + "integrity": "sha512-kYbh5Cboz1BzN6LeUWnI1B0BCikXMYQjxaEO7cV+0rycllU0qZqSEkd2LdgWIZhuLTc4WBt0li1s+O6RhM5Cog==", + "dev": true, + "dependencies": { + "@typescript-eslint/utils": "^5.54.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "eslint": "^8.0.0" + } + }, + "node_modules/@tanstack/query-core": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.0.5.tgz", + "integrity": "sha512-MThCETMkHDHTnFZHp71L+SqTtD5d6XHftFCVR1xRJdWM3qGrlQ2VCXaj0SKVcyJej2e1Opa2c7iknu1llxCDNQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "node_modules/@tanstack/query-devtools": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@tanstack/query-devtools/-/query-devtools-5.1.0.tgz", + "integrity": "sha512-EZhYS6clf4yyzFwE3b+7P2J46zgiweIwatc80MhfuzScz/Z4m1kPsKvNK0j54v4y1WvG4pN14qfOXjp4ac7f/Q==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "node_modules/@tanstack/react-query": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.0.5.tgz", + "integrity": "sha512-ZG0Q4HZ0iuI8mWiZ2/MdVYPHbrmAVhMn7+gLOkxJh6zLIgCL4luSZlohzN5Xt4MjxfxxWioO1nemwpudaTsmQg==", + "dependencies": { + "@tanstack/query-core": "5.0.5" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "react": "^18.0.0", + "react-dom": "^18.0.0", + "react-native": "*" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + }, + "react-native": { + "optional": true + } + } + }, + "node_modules/@tanstack/react-query-devtools": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@tanstack/react-query-devtools/-/react-query-devtools-5.1.0.tgz", + "integrity": "sha512-Ms/GMccsrTBZQ+0v2pyIlaU0NlZXjhutPyhiQCviBqBbvYwsp/N/mT66YFaphzK/bhXzx5+NHbq8GI6V7KMY1Q==", + "dependencies": { + "@tanstack/query-devtools": "5.1.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "@tanstack/react-query": "^5.0.5", + "react": "^18.0.0", + "react-dom": "^18.0.0" + } + }, "node_modules/@terra-dev/browser-check": { "version": "2.5.3", "resolved": "https://registry.npmjs.org/@terra-dev/browser-check/-/browser-check-2.5.3.tgz", @@ -6432,63 +6580,58 @@ "dev": true }, "node_modules/@types/cli-progress": { - "version": "3.11.3", - "resolved": "https://registry.npmjs.org/@types/cli-progress/-/cli-progress-3.11.3.tgz", - "integrity": "sha512-/+C9xAdVtc+g5yHHkGBThgAA8rYpi5B+2ve3wLtybYj0JHEBs57ivR4x/zGfSsplRnV+psE91Nfin1soNKqz5Q==", + "version": "3.11.4", + "resolved": "https://registry.npmjs.org/@types/cli-progress/-/cli-progress-3.11.4.tgz", + "integrity": "sha512-yufTxeeNCZuEIxx2uebK8lpSAsJM4lvzakm/VxzYhDtqhXCzwH9jpn7nPCxzrROuEbLATqhFq4MIPoG0tlrsvw==", "dev": true, "dependencies": { "@types/node": "*" } }, "node_modules/@types/connect": { - "version": "3.4.36", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.36.tgz", - "integrity": "sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w==", + "version": "3.4.37", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.37.tgz", + "integrity": "sha512-zBUSRqkfZ59OcwXon4HVxhx5oWCJmc0OtBTK05M+p0dYjgN6iTwIL2T/WbsQZrEsdnwaF9cWQ+azOnpPvIqY3Q==", "dependencies": { "@types/node": "*" } }, "node_modules/@types/estree": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.2.tgz", - "integrity": "sha512-VeiPZ9MMwXjO32/Xu7+OwflfmeoRwkE/qzndw42gGtgJwZopBnzy2gD//NN1+go1mADzkDcqf/KnFRSjTJ8xJA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.3.tgz", + "integrity": "sha512-CS2rOaoQ/eAgAfcTfq6amKG7bsN+EMcgGY4FAFQdvSj2y1ixvOZTUA9mOtCai7E1SYu283XNw7urKK30nP3wkQ==", "dev": true }, "node_modules/@types/history": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@types/history/-/history-5.0.0.tgz", - "integrity": "sha512-hy8b7Y1J8OGe6LbAjj3xniQrj3v6lsivCcrmf4TzSgPzLkhIeKgc5IZnT7ReIqmEuodjfO8EYAuoFvIrHi/+jQ==", - "deprecated": "This is a stub types definition. history provides its own type definitions, so you do not need this installed.", - "dev": true, - "dependencies": { - "history": "*" - } + "version": "4.7.11", + "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", + "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==", + "dev": true }, "node_modules/@types/hoist-non-react-statics": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.3.tgz", - "integrity": "sha512-Wny3a2UXn5FEA1l7gc6BbpoV5mD1XijZqgkp4TRgDCDL5r3B5ieOFGUX5h3n78Tr1MEG7BfvoM8qeztdvNU0fw==", - "dev": true, + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.4.tgz", + "integrity": "sha512-ZchYkbieA+7tnxwX/SCBySx9WwvWR8TaP5tb2jRAzwvLb/rWchGw3v0w3pqUbUvj0GCwW2Xz/AVPSk6kUGctXQ==", "dependencies": { "@types/react": "*", "hoist-non-react-statics": "^3.3.0" } }, "node_modules/@types/http-cache-semantics": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.2.tgz", - "integrity": "sha512-FD+nQWA2zJjh4L9+pFXqWOi0Hs1ryBCfI+985NjluQ1p8EYtoLvjLOKidXBtZ4/IcxDX4o8/E8qDS3540tNliw==" + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.3.tgz", + "integrity": "sha512-V46MYLFp08Wf2mmaBhvgjStM3tPa+2GAdy/iqoX+noX1//zje2x4XmrIU0cAwyClATsTmahbtoQ2EwP7I5WSiA==" }, "node_modules/@types/istanbul-lib-coverage": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", - "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", + "integrity": "sha512-zONci81DZYCZjiLe0r6equvZut0b+dBRPBN5kBDjsONnutYNtJMoWQ9uR2RkL1gLG9NMTzvf+29e5RFfPbeKhQ==", "dev": true }, "node_modules/@types/istanbul-lib-report": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", - "integrity": "sha512-gPQuzaPR5h/djlAv2apEG1HVOyj1IUs7GpfMZixU0/0KXT3pm64ylHuMUI1/Akh+sq/iikxg6Z2j+fcMDXaaTQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.2.tgz", + "integrity": "sha512-8toY6FgdltSdONav1XtUHl4LN1yTmLza+EuDazb/fEmRNCwjyqNVIQWs2IfC74IqjHkREs/nQ2FWq5kZU9IC0w==", "dev": true, "dependencies": { "@types/istanbul-lib-coverage": "*" @@ -6513,6 +6656,12 @@ "jest-diff": "^24.3.0" } }, + "node_modules/@types/json-schema": { + "version": "7.0.14", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.14.tgz", + "integrity": "sha512-U3PUjAudAdJBeC2pgN8uTIKgxrb4nlDF3SF0++EldXQvQBGkpFZMSnwQiIoDU77tv45VgNkl/L4ouD+rEomujw==", + "dev": true + }, "node_modules/@types/keyv": { "version": "3.1.4", "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", @@ -6527,9 +6676,9 @@ "integrity": "sha512-aP03BShJoO+WVndoVj/WNcB/YBPt+CIU1mvaao2GRAHy2yg4pT/XS4XnVHEQBjPJGycWf/9seKEO9vopTJGkvA==" }, "node_modules/@types/lodash-es": { - "version": "4.17.9", - "resolved": "https://registry.npmjs.org/@types/lodash-es/-/lodash-es-4.17.9.tgz", - "integrity": "sha512-ZTcmhiI3NNU7dEvWLZJkzG6ao49zOIjEgIE0RgV7wbPxU0f2xT3VSAHw2gmst8swH6V0YkLRGp4qPlX/6I90MQ==", + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/@types/lodash-es/-/lodash-es-4.17.10.tgz", + "integrity": "sha512-YJP+w/2khSBwbUSFdGsSqmDvmnN3cCKoPOL7Zjle6s30ZtemkkqhjVfFqGwPN7ASil5VyjE2GtyU/yqYY6mC0A==", "dependencies": { "@types/lodash": "*" } @@ -6540,9 +6689,9 @@ "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" }, "node_modules/@types/mdast": { - "version": "3.0.13", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.13.tgz", - "integrity": "sha512-HjiGiWedR0DVFkeNljpa6Lv4/IZU1+30VY5d747K7lBudFc3R0Ibr6yJ9lN3BE28VnZyDfLF/VB1Ql1ZIbKrmg==", + "version": "3.0.14", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.14.tgz", + "integrity": "sha512-gVZ04PGgw1qLZKsnWnyFv4ORnaJ+DXLdHTVSFbU8yX6xZ34Bjg4Q32yPkmveUP1yItXReKfB0Aknlh/3zxTKAw==", "dependencies": { "@types/unist": "^2" } @@ -6559,38 +6708,37 @@ "dev": true }, "node_modules/@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==" + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.1.tgz", + "integrity": "sha512-3YmXzzPAdOTVljVMkTMBdBEvlOLg2cDQaDhnnhT3nT9uDbnJzjWhKlzb+desT12Y7tGqaN6d+AbozcKzyL36Ng==" }, "node_modules/@types/pbkdf2": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", - "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.1.tgz", + "integrity": "sha512-4HCoGwR3221nOc7G0Z/6KgTNGgaaFGkbGrtUJsB+zlKX2LBVjFHHIUkieMBgHHXgBH5Gq6dZHJKdBYdtlhBQvw==", "dependencies": { "@types/node": "*" } }, "node_modules/@types/prop-types": { - "version": "15.7.8", - "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.8.tgz", - "integrity": "sha512-kMpQpfZKSCBqltAJwskgePRaYRFukDkm1oItcAbC3gNELR20XIBcN9VRgg4+m8DKsTfkWeA4m4Imp4DDuWy7FQ==", - "dev": true + "version": "15.7.9", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.9.tgz", + "integrity": "sha512-n1yyPsugYNSmHgxDFjicaI2+gCNjsBck8UX9kuofAKlc0h1bL+20oSF72KeNaW2DUlesbEVCFgyV2dPGTiY42g==" }, "node_modules/@types/react": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.2.tgz", - "integrity": "sha512-Xt40xQsrkdvjn1EyWe1Bc0dJLcil/9x2vAuW7ya+PuQip4UYUaXyhzWmAbwRsdMgwOFHpfp7/FFZebDU6Y8VHA==", - "dev": true, + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.0.tgz", + "integrity": "sha512-0FLj93y5USLHdnhIhABk83rm8XEGA7kH3cr+YUlvxoUGp1xNt/DINUMvqPxLyOQMzLmZe8i4RTHbvb8MC7NmrA==", "dependencies": { "@types/prop-types": "*", + "@types/scheduler": "*", "csstype": "^3.0.2" } }, "node_modules/@types/react-dom": { - "version": "16.8.4", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.8.4.tgz", - "integrity": "sha512-eIRpEW73DCzPIMaNBDP5pPIpK1KXyZwNgfxiVagb5iGiz6da+9A5hslSX6GAQKdO7SayVCS/Fr2kjqprgAvkfA==", + "version": "18.2.14", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.14.tgz", + "integrity": "sha512-V835xgdSVmyQmI1KLV2BEIUgqEuinxp9O4G6g3FqO/SqLac049E53aysv0oEFD2kHfejeKU+ZqL2bcFWj9gLAQ==", "dev": true, "dependencies": { "@types/react": "*" @@ -6615,9 +6763,9 @@ } }, "node_modules/@types/react-redux": { - "version": "7.1.9", - "resolved": "https://registry.npmjs.org/@types/react-redux/-/react-redux-7.1.9.tgz", - "integrity": "sha512-mpC0jqxhP4mhmOl3P4ipRsgTgbNofMRXJb08Ms6gekViLj61v1hOZEKWDCyWsdONr6EjEA6ZHXC446wdywDe0w==", + "version": "7.1.28", + "resolved": "https://registry.npmjs.org/@types/react-redux/-/react-redux-7.1.28.tgz", + "integrity": "sha512-EQr7cChVzVUuqbA+J8ArWK1H0hLAHKOs21SIMrskKZ3nHNeE+LFYA+IsoZGhVOT8Ktjn3M20v4rnZKN3fLbypw==", "dev": true, "dependencies": { "@types/hoist-non-react-statics": "^3.3.0", @@ -6637,22 +6785,16 @@ } }, "node_modules/@types/react-router-dom": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.1.5.tgz", - "integrity": "sha512-ArBM4B1g3BWLGbaGvwBGO75GNFbLDUthrDojV2vHLih/Tq8M+tgvY1DSwkuNrPSwdp/GUL93WSEpTZs8nVyJLw==", + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz", + "integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==", "dev": true, "dependencies": { - "@types/history": "*", + "@types/history": "^4.7.11", "@types/react": "*", "@types/react-router": "*" } }, - "node_modules/@types/react-router/node_modules/@types/history": { - "version": "4.7.11", - "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", - "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==", - "dev": true - }, "node_modules/@types/react-tooltip": { "version": "3.11.0", "resolved": "https://registry.npmjs.org/@types/react-tooltip/-/react-tooltip-3.11.0.tgz", @@ -6673,17 +6815,22 @@ } }, "node_modules/@types/responselike": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.1.tgz", - "integrity": "sha512-TiGnitEDxj2X0j+98Eqk5lv/Cij8oHd32bU4D/Yw6AOq7vvTk0gSD2GPj0G/HkvhMoVsdlhYF4yqqlyPBTM6Sg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha512-/4YQT5Kp6HxUDb4yhRkm0bJ7TbjvTddqX7PZ5hz6qV3pxSo72f/6YPRo+Mu2DU307tm9IioO69l7uAwn5XNcFA==", "dependencies": { "@types/node": "*" } }, + "node_modules/@types/scheduler": { + "version": "0.16.5", + "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.5.tgz", + "integrity": "sha512-s/FPdYRmZR8SjLWGMCuax7r3qCWQw9QKHzXVukAuuIJkXkDRwp+Pu5LMIVFi0Fxbav35WURicYr8u1QsoybnQw==" + }, "node_modules/@types/secp256k1": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.4.tgz", - "integrity": "sha512-oN0PFsYxDZnX/qSJ5S5OwaEDTYfekhvaM5vqui2bu1AA39pKofmgL104Q29KiOXizXS2yLjSzc5YdTyMKdcy4A==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.5.tgz", + "integrity": "sha512-aIonTBMErtE3T9MxDvTZRzcrT/mCqpEZBw3CCY/i+oG9n57N/+7obBkhFgavUAIrX21bU0LHg1XRgtaLdelBhA==", "dependencies": { "@types/node": "*" } @@ -6695,14 +6842,14 @@ "dev": true }, "node_modules/@types/ungap__global-this": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@types/ungap__global-this/-/ungap__global-this-0.3.1.tgz", - "integrity": "sha512-+/DsiV4CxXl6ZWefwHZDXSe1Slitz21tom38qPCaG0DYCS1NnDPIQDTKcmQ/tvK/edJUKkmuIDBJbmKDiB0r/g==" + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@types/ungap__global-this/-/ungap__global-this-0.3.2.tgz", + "integrity": "sha512-xiJbYgAr3UvV+Hd/ENVf/EOSI1K2+yY0Ata9lkFg3o4ndJjNVVx+BJyHjLJ/AZitx92/GL5VXiptvEw+0IpV7g==" }, "node_modules/@types/unist": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz", - "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==" + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", + "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" }, "node_modules/@types/url-join": { "version": "4.0.0", @@ -6710,10 +6857,15 @@ "integrity": "sha512-awrJu8yML4E/xTwr2EMatC+HBnHGoDxc2+ImA9QyeUELI1S7dOCIZcyjki1rkwoA8P2D2NVgLAJLjnclkdLtAw==", "dev": true }, + "node_modules/@types/use-sync-external-store": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.3.tgz", + "integrity": "sha512-EwmlvuaxPNej9+T4v5AuBPJa2x2UOJVdjCtDHgcDqitUeOtjnJKJ+apYjVcAoBEMjKW1VVFGZLUb5+qqa09XFA==" + }, "node_modules/@types/w3c-web-usb": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/w3c-web-usb/-/w3c-web-usb-1.0.8.tgz", - "integrity": "sha512-ouEoUTyB27wFXUUyl0uKIE6VkeCczDtazWTiZGD1M4onceJnp8KnHDf7CzLbpwzek2ZFWXTC5KrNDRc9q/Jf6Q==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/w3c-web-usb/-/w3c-web-usb-1.0.9.tgz", + "integrity": "sha512-6EIpb9g9k/SGu59mQ6RW3tedmabtE+N3iGRa98+1CCFuhGt565wLEYKXoEVKTuNrCr2SrgfvBMN5db6hggkzKQ==", "dev": true }, "node_modules/@types/ws": { @@ -6734,15 +6886,175 @@ } }, "node_modules/@types/yargs-parser": { - "version": "21.0.1", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.1.tgz", - "integrity": "sha512-axdPBuLuEJt0c4yI5OZssC19K2Mq1uKdrfZBzuxLvaztgqUtFYZUNw7lETExPYJR9jdEoIg4mb7RQKRQzOkeGQ==", + "version": "21.0.2", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.2.tgz", + "integrity": "sha512-5qcvofLPbfjmBfKaLfj/+f+Sbd6pN4zl7w7VSVI5uz7m9QZTuB2aZAa2uo1wHFBNN2x6g/SoTkXmd8mQnQF2Cw==", "dev": true }, "node_modules/@types/zen-observable": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/@types/zen-observable/-/zen-observable-0.8.4.tgz", - "integrity": "sha512-XWquk4B9Y9bP++I9FsKBVDR+cM1duIqTksuD4l+XUDcqKdngHrtLBe6A5DQX5sdJPWDhLFM9xHZBCiWcecZ0Jg==" + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/@types/zen-observable/-/zen-observable-0.8.5.tgz", + "integrity": "sha512-jH5FqZ1bMAO3L4ltXxw68vg+W0diVsSM3tnpFycZDTLE2luquFi015vhkr9hAjlHpxQbkaSk2yBfPICyb4rpXQ==" + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", + "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", + "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", + "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", + "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@types/json-schema": "^7.0.9", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/typescript-estree": "5.62.0", + "eslint-scope": "^5.1.1", + "semver": "^7.3.7" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/@types/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-MMzuxN3GdFwskAnb6fz0orFvhfqi752yjaXylr0Rp4oDg5H0Zn1IuyRhDVvYOwAXoJirx2xuS16I3WjxnAIHiQ==", + "dev": true + }, + "node_modules/@typescript-eslint/utils/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", + "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.62.0", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } }, "node_modules/@ungap/global-this": { "version": "0.4.4", @@ -8215,12 +8527,13 @@ "integrity": "sha512-yOO3Fu4ygyKYAdznuoaqschMKIZzcdgyMpBNtrIfrUhnOeaOWG+dh0c13wcOS6B/46IGGbncoyzJlio79jU7rw==" }, "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", + "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.1", + "set-function-length": "^1.1.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -8256,9 +8569,9 @@ "integrity": "sha512-ceOhN1DL7Y4O6M0j9ICgmTYziV89WMd96SvSl0REd8PMgrY0B/WBOPoed5S1KUmJqXgUXh8gzSe6E3ae27upsQ==" }, "node_modules/caniuse-lite": { - "version": "1.0.30001549", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001549.tgz", - "integrity": "sha512-qRp48dPYSCYaP+KurZLhDYdVE+yEyht/3NlmcJgVQ2VMGt6JL36ndQ/7rgspdZsJuxDPFIo/OzBT2+GmIJ53BA==", + "version": "1.0.30001553", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001553.tgz", + "integrity": "sha512-N0ttd6TrFfuqKNi+pMgWJTb9qrdJu4JSpgPFLe/lrD19ugC6fZgF0pUewRowDwzdDnb9V41mFcdlYgl/PyKf4A==", "dev": true, "funding": [ { @@ -8327,9 +8640,9 @@ } }, "node_modules/cartonne/node_modules/cborg": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/cborg/-/cborg-4.0.3.tgz", - "integrity": "sha512-poLvpK30KT5KI8gzDx3J/IuVCbsLqMT2fEbOrOuX0H7Hyj8yg5LezeWhRh9aLa5Z6MfPC5sriW3HVJF328M8LQ==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/cborg/-/cborg-4.0.4.tgz", + "integrity": "sha512-nu+JXYskYqWN/tFWQVjL2ZYlUwK+dapqkTpruAtJkwmDv7XaTgg8PStUbO+sXfhqSWaeQ9LPSPCTrO2WZ2Bxfg==", "bin": { "cborg": "lib/bin.js" } @@ -8718,23 +9031,6 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, - "node_modules/connected-react-router": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/connected-react-router/-/connected-react-router-6.8.0.tgz", - "integrity": "sha512-E64/6krdJM3Ag3MMmh2nKPtMbH15s3JQDuaYJvOVXzu6MbHbDyIvuwLOyhQIuP4Om9zqEfZYiVyflROibSsONg==", - "dependencies": { - "prop-types": "^15.7.2" - }, - "peerDependencies": { - "history": "^4.7.2", - "immutable": "^3.8.1 || ^4.0.0-rc.1", - "react": "^16.4.0", - "react-redux": "^6.0.0 || ^7.1.0", - "react-router": "^4.3.1 || ^5.0.0", - "redux": "^3.6.0 || ^4.0.0", - "seamless-immutable": "^7.1.3" - } - }, "node_modules/console-browserify": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", @@ -9115,9 +9411,9 @@ } }, "node_modules/dag-jose/node_modules/cborg": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/cborg/-/cborg-4.0.3.tgz", - "integrity": "sha512-poLvpK30KT5KI8gzDx3J/IuVCbsLqMT2fEbOrOuX0H7Hyj8yg5LezeWhRh9aLa5Z6MfPC5sriW3HVJF328M8LQ==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/cborg/-/cborg-4.0.4.tgz", + "integrity": "sha512-nu+JXYskYqWN/tFWQVjL2ZYlUwK+dapqkTpruAtJkwmDv7XaTgg8PStUbO+sXfhqSWaeQ9LPSPCTrO2WZ2Bxfg==", "bin": { "cborg": "lib/bin.js" } @@ -9261,12 +9557,6 @@ "node": ">=4" } }, - "node_modules/decompress-tar/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true - }, "node_modules/decompress-tar/node_modules/readable-stream": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", @@ -9518,11 +9808,11 @@ } }, "node_modules/did-jwt": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/did-jwt/-/did-jwt-7.4.2.tgz", - "integrity": "sha512-bdMVrUKD8wBiYihrxm5Bso33vYuw5DHxxN6y+IFSpHQpYQF16nuW6T8+FCrVkS5gDYE6jFZmnkqjJwycT4K7AA==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/did-jwt/-/did-jwt-7.4.3.tgz", + "integrity": "sha512-fm89zeD7XreXvyD7W8h/+RHT541M9pPt5uqANBDpznhdOazdxSY6AMnCRLLeWBPaUqRtdYgP7nCvU/lB4oWnwg==", "dependencies": { - "@noble/ciphers": "^0.3.0", + "@noble/ciphers": "^0.4.0", "@noble/curves": "^1.0.0", "@noble/hashes": "^1.3.0", "@scure/base": "^1.1.3", @@ -9822,9 +10112,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.557", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.557.tgz", - "integrity": "sha512-6x0zsxyMXpnMJnHrondrD3SuAeKcwij9S+83j2qHAQPXbGTDDfgImzzwgGlzrIcXbHQ42tkG4qA6U860cImNhw==", + "version": "1.4.565", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.565.tgz", + "integrity": "sha512-XbMoT6yIvg2xzcbs5hCADi0dXBh4//En3oFXmtPX+jiyyiCTiM9DGFT2SLottjpEs9Z8Mh8SqahbR96MaHfuSg==", "dev": true }, "node_modules/elliptic": { @@ -10052,6 +10342,31 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/esm": { "version": "3.2.25", "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", @@ -10073,6 +10388,36 @@ "node": ">=4" } }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, "node_modules/estree-walker": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", @@ -11159,11 +11504,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, - "node_modules/express/node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" - }, "node_modules/express/node_modules/raw-body": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", @@ -11466,6 +11806,18 @@ "node": ">=12" } }, + "node_modules/fix-hmr/node_modules/react": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz", + "integrity": "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==", + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/flat": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", @@ -11646,14 +11998,14 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", - "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", + "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", + "function-bind": "^1.1.2", "has-proto": "^1.0.1", - "has-symbols": "^1.0.3" + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -11898,14 +12250,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/has": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", - "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -11916,11 +12260,11 @@ } }, "node_modules/has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", + "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", "dependencies": { - "get-intrinsic": "^1.1.1" + "get-intrinsic": "^1.2.2" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -12010,16 +12354,15 @@ "resolved": "https://registry.npmjs.org/hashids/-/hashids-2.2.10.tgz", "integrity": "sha512-nXnYums7F8B5Y+GSThutLPlKMaamW1yjWNZVt0WModiJfdjaDZHnhYTWblS+h1OoBx3yjwiBwxldPP3nIbFSSA==" }, - "node_modules/history": { - "version": "4.7.2", - "resolved": "https://registry.npmjs.org/history/-/history-4.7.2.tgz", - "integrity": "sha512-1zkBRWW6XweO0NBcjiphtVJVsIQ+SXF29z9DVkceeaSLVMFXHool+fdCZD4spDCfZJCILPILc3bm7Bc+HRi0nA==", + "node_modules/hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", "dependencies": { - "invariant": "^2.2.1", - "loose-envify": "^1.2.0", - "resolve-pathname": "^2.2.0", - "value-equal": "^0.4.0", - "warning": "^3.0.0" + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" } }, "node_modules/hmac-drbg": { @@ -12240,9 +12583,9 @@ } }, "node_modules/immer": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/immer/-/immer-7.0.15.tgz", - "integrity": "sha512-yM7jo9+hvYgvdCQdqvhCNRRio0SCXc8xDPzA25SvKWa7b1WVPjLwQs1VYU5JPXjcJPTqAa5NP5dqpORGYBQ2AA==", + "version": "9.0.21", + "resolved": "https://registry.npmjs.org/immer/-/immer-9.0.21.tgz", + "integrity": "sha512-bc4NBHqOqSfRW7POMkHd51LvClaeMXpm8dx0e8oE2GORbq5aRK7Bxl4FyzVLdGtLmvLKL7BTDBG5ACQm4HWjTA==", "funding": { "type": "opencollective", "url": "https://opencollective.com/immer" @@ -12354,6 +12697,7 @@ "version": "2.2.4", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, "dependencies": { "loose-envify": "^1.0.0" } @@ -12517,11 +12861,11 @@ } }, "node_modules/is-core-module": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", - "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", "dependencies": { - "has": "^1.0.3" + "hasown": "^2.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -12746,9 +13090,10 @@ } }, "node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true }, "node_modules/isexe": { "version": "2.0.0", @@ -13927,20 +14272,6 @@ "dom-walk": "^0.1.0" } }, - "node_modules/mini-create-react-context": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/mini-create-react-context/-/mini-create-react-context-0.4.1.tgz", - "integrity": "sha512-YWCYEmd5CQeHGSAKrYvXgmzzkrvssZcuuQDDeqkT+PziKGMgE+0MCCtcKbROzocGBG1meBLl2FotlRwf4gAzbQ==", - "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", - "dependencies": { - "@babel/runtime": "^7.12.1", - "tiny-warning": "^1.0.3" - }, - "peerDependencies": { - "prop-types": "^15.0.0", - "react": "^0.14.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" - } - }, "node_modules/minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -14698,9 +15029,9 @@ } }, "node_modules/object-inspect": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.0.tgz", - "integrity": "sha512-HQ4J+ic8hKrgIt3mqk6cVOVrW2ozL4KdvHlqpBv9vDYWx9ysAgENAdvy4FoGF+KFdhR7nQTNm5J0ctAeOwn+3g==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -15071,12 +15402,9 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "node_modules/path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "dependencies": { - "isarray": "0.0.1" - } + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" }, "node_modules/path-type": { "version": "4.0.0", @@ -15471,9 +15799,9 @@ } }, "node_modules/protobufjs/node_modules/@types/node": { - "version": "20.8.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.6.tgz", - "integrity": "sha512-eWO4K2Ji70QzKUqRy6oyJWUeB7+g2cRagT3T/nxYibYcT4y2BDL8lqolRXjTHmkZCdJfIPaY73KbJAZmcryxTQ==", + "version": "20.8.8", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.8.tgz", + "integrity": "sha512-YRsdVxq6OaLfmR9Hy816IMp33xOBjfyOgUd77ehqg96CFywxAPbDbXvAsuN2KVg2HOT8Eh6uAfU+l4WffwPVrQ==", "dependencies": { "undici-types": "~5.25.1" } @@ -15745,12 +16073,11 @@ } }, "node_modules/react": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz", - "integrity": "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==", + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", "dependencies": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1" + "loose-envify": "^1.1.0" }, "engines": { "node": ">=0.10.0" @@ -15796,16 +16123,15 @@ } }, "node_modules/react-dom": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz", - "integrity": "sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==", + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", + "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", "dependencies": { "loose-envify": "^1.1.0", - "object-assign": "^4.1.1", - "scheduler": "^0.20.2" + "scheduler": "^0.23.0" }, "peerDependencies": { - "react": "17.0.2" + "react": "^18.2.0" } }, "node_modules/react-fast-compare": { @@ -15878,112 +16204,78 @@ } }, "node_modules/react-redux": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.2.1.tgz", - "integrity": "sha512-T+VfD/bvgGTUA74iW9d2i5THrDQWbweXP0AVNI8tNd1Rk5ch1rnMiJkDD67ejw7YBKM4+REvcvqRuWJb7BLuEg==", + "version": "8.1.3", + "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.1.3.tgz", + "integrity": "sha512-n0ZrutD7DaX/j9VscF+uTALI3oUPa/pO4Z3soOBIjuRn/FzVu6aehhysxZCLi6y7duMf52WNZGMl7CtuK5EnRw==", "dependencies": { - "@babel/runtime": "^7.5.5", - "hoist-non-react-statics": "^3.3.0", - "loose-envify": "^1.4.0", - "prop-types": "^15.7.2", - "react-is": "^16.9.0" + "@babel/runtime": "^7.12.1", + "@types/hoist-non-react-statics": "^3.3.1", + "@types/use-sync-external-store": "^0.0.3", + "hoist-non-react-statics": "^3.3.2", + "react-is": "^18.0.0", + "use-sync-external-store": "^1.0.0" }, "peerDependencies": { - "react": "^16.8.3", - "redux": "^2.0.0 || ^3.0.0 || ^4.0.0-0" + "@types/react": "^16.8 || ^17.0 || ^18.0", + "@types/react-dom": "^16.8 || ^17.0 || ^18.0", + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0", + "react-native": ">=0.59", + "redux": "^4 || ^5.0.0-beta.0" }, "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + }, "react-dom": { "optional": true }, "react-native": { "optional": true + }, + "redux": { + "optional": true } } }, + "node_modules/react-redux/node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" + }, "node_modules/react-router": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.0.tgz", - "integrity": "sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==", - "dependencies": { - "@babel/runtime": "^7.1.2", - "history": "^4.9.0", - "hoist-non-react-statics": "^3.1.0", - "loose-envify": "^1.3.1", - "mini-create-react-context": "^0.4.0", - "path-to-regexp": "^1.7.0", - "prop-types": "^15.6.2", - "react-is": "^16.6.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "version": "6.17.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.17.0.tgz", + "integrity": "sha512-YJR3OTJzi3zhqeJYADHANCGPUu9J+6fT5GLv82UWRGSxu6oJYCKVmxUcaBQuGm9udpWmPsvpme/CdHumqgsoaA==", + "dependencies": { + "@remix-run/router": "1.10.0" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" + "react": ">=16.8" } }, "node_modules/react-router-dom": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.2.0.tgz", - "integrity": "sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==", + "version": "6.17.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.17.0.tgz", + "integrity": "sha512-qWHkkbXQX+6li0COUUPKAUkxjNNqPJuiBd27dVwQGDNsuFBdMbrS6UZ0CLYc4CsbdLYTckn4oB4tGDuPZpPhaQ==", "dependencies": { - "@babel/runtime": "^7.1.2", - "history": "^4.9.0", - "loose-envify": "^1.3.1", - "prop-types": "^15.6.2", - "react-router": "5.2.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" + "@remix-run/router": "1.10.0", + "react-router": "6.17.0" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { - "react": ">=15" - } - }, - "node_modules/react-router-dom/node_modules/history": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", - "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", - "dependencies": { - "@babel/runtime": "^7.1.2", - "loose-envify": "^1.2.0", - "resolve-pathname": "^3.0.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0", - "value-equal": "^1.0.1" + "react": ">=16.8", + "react-dom": ">=16.8" } }, - "node_modules/react-router-dom/node_modules/resolve-pathname": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", - "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" - }, - "node_modules/react-router-dom/node_modules/value-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", - "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" - }, - "node_modules/react-router/node_modules/history": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", - "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", - "dependencies": { - "@babel/runtime": "^7.1.2", - "loose-envify": "^1.2.0", - "resolve-pathname": "^3.0.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0", - "value-equal": "^1.0.1" - } - }, - "node_modules/react-router/node_modules/resolve-pathname": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", - "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" - }, - "node_modules/react-router/node_modules/value-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", - "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" - }, "node_modules/react-side-effect": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/react-side-effect/-/react-side-effect-2.1.2.tgz", @@ -16124,9 +16416,9 @@ } }, "node_modules/redux-devtools-extension": { - "version": "2.13.8", - "resolved": "https://registry.npmjs.org/redux-devtools-extension/-/redux-devtools-extension-2.13.8.tgz", - "integrity": "sha512-8qlpooP2QqPtZHQZRhx3x3OP5skEV1py/zUdMY28WNAocbafxdG2tRD1MWE7sp8obGMNYuLWanhhQ7EQvT1FBg==", + "version": "2.13.9", + "resolved": "https://registry.npmjs.org/redux-devtools-extension/-/redux-devtools-extension-2.13.9.tgz", + "integrity": "sha512-cNJ8Q/EtjhQaZ71c8I9+BPySIBVEKssbPpskBfsXqb8HJ002A3KRVHfeRzwRo6mGPqsm7XuHTqNSNeS1Khig0A==", "deprecated": "Package moved to @redux-devtools/extension.", "dev": true, "peerDependencies": { @@ -16134,9 +16426,12 @@ } }, "node_modules/redux-thunk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-2.3.0.tgz", - "integrity": "sha512-km6dclyFnmcvxhAcrQV2AkZmPQjzPDjgVlQtR0EQjxZPyJ0BnMf3in1ryuR8A2qU0HldVRfxYXbFSKlI3N7Slw==" + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-2.4.2.tgz", + "integrity": "sha512-+P3TjtnP0k/FEjcBL5FZpoovtvrTNT/UXd4/sluaSyrURlSlhLSzEdfsTBW7WsKB6yPvgd7q/iZPICFjW4o57Q==", + "peerDependencies": { + "redux": "^4" + } }, "node_modules/regenerator-runtime": { "version": "0.13.11", @@ -16314,11 +16609,6 @@ "node": ">=4" } }, - "node_modules/resolve-pathname": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-2.2.0.tgz", - "integrity": "sha512-bAFz9ld18RzJfddgrO2e/0S2O81710++chRMUxHjXOYKF6jTAMrUNZrEZ1PvV0zlhfjidm08iRPdTLPno1FuRg==" - }, "node_modules/responselike": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", @@ -16443,9 +16733,9 @@ } }, "node_modules/rpc-websockets": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.6.0.tgz", - "integrity": "sha512-Jgcs8q6t8Go98dEulww1x7RysgTkzpCMelVxZW4hvuyFtOGpeUz9prpr2KjUa/usqxgFCd9Tu3+yhHEP9GVmiQ==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.6.1.tgz", + "integrity": "sha512-MmRGaJJvxTHSRxYPjJJqcj2zWnCetw7YbYbKlD0Yc7qVw6PsZhRJg1MI3mpWlpBs+4zO+urlNfLl9zLsdOD/gA==", "dependencies": { "@babel/runtime": "^7.17.2", "eventemitter3": "^4.0.7", @@ -16569,12 +16859,11 @@ } }, "node_modules/scheduler": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.2.tgz", - "integrity": "sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", + "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", "dependencies": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1" + "loose-envify": "^1.1.0" } }, "node_modules/scrypt-js": { @@ -16693,6 +16982,20 @@ "node": ">=6" } }, + "node_modules/set-function-length": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", + "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==", + "dependencies": { + "define-data-property": "^1.1.1", + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", @@ -16836,9 +17139,9 @@ } }, "node_modules/simplebar-react/node_modules/core-js": { - "version": "3.33.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.33.0.tgz", - "integrity": "sha512-HoZr92+ZjFEKar5HS6MC776gYslNOKHt75mEBKWKnPeFDpZ6nH5OeF3S6HFT1mUAUZKrzkez05VboaX8myjSuw==", + "version": "3.33.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.33.1.tgz", + "integrity": "sha512-qVSq3s+d4+GsqN0teRCJtM6tdEEXyWxjzbhVrCHmBS5ZTM0FS2MOS0D13dUXAWDUN6a+lHI/N1hF9Ytz6iLl9Q==", "hasInstallScript": true, "funding": { "type": "opencollective", @@ -16983,9 +17286,9 @@ "dev": true }, "node_modules/sshpk": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", - "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", + "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", "dependencies": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -17572,11 +17875,6 @@ "node": ">=0.6.0" } }, - "node_modules/tiny-invariant": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.1.tgz", - "integrity": "sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==" - }, "node_modules/tiny-secp256k1": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/tiny-secp256k1/-/tiny-secp256k1-1.1.6.tgz", @@ -17598,11 +17896,6 @@ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" }, - "node_modules/tiny-warning": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", - "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" - }, "node_modules/tls": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/tls/-/tls-0.0.1.tgz", @@ -17910,6 +18203,21 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" }, + "node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, "node_modules/tty-browserify": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", @@ -18300,6 +18608,14 @@ "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==", "dev": true }, + "node_modules/use-sync-external-store": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", + "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/utf-8-validate": { "version": "5.0.10", "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", @@ -18366,11 +18682,6 @@ "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true }, - "node_modules/value-equal": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-0.4.0.tgz", - "integrity": "sha512-x+cYdNnaA3CxvMaTX0INdTCN8m8aF2uY9BvEqmxuYp8bL09cs/kWVQPVGcA35fMktdOsP69IgU7wFj/61dJHEw==" - }, "node_modules/varint": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz", @@ -18624,14 +18935,6 @@ "node": ">=14" } }, - "node_modules/warning": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/warning/-/warning-3.0.0.tgz", - "integrity": "sha512-jMBt6pUrKn5I+OGgtQ4YZLdhIeJmObddh6CsibPxyQ5yPZm1XExSyzC1LCNX7BzhxWgiHmizBWJTHJIjMjTQYQ==", - "dependencies": { - "loose-envify": "^1.0.0" - } - }, "node_modules/web3": { "version": "1.8.2", "resolved": "https://registry.npmjs.org/web3/-/web3-1.8.2.tgz", @@ -19393,9 +19696,9 @@ } }, "node_modules/web3-utils": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.10.2.tgz", - "integrity": "sha512-TdApdzdse5YR+5GCX/b/vQnhhbj1KSAtfrDtRW7YS0kcWp1gkJsN62gw6GzCaNTeXookB7UrLtmDUuMv65qgow==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.10.3.tgz", + "integrity": "sha512-OqcUrEE16fDBbGoQtZXWdavsPzbGIDc5v3VrRTZ0XrIpefC/viZ1ZU9bGEemazyS0catk/3rkOOxpzTfY+XsyQ==", "dependencies": { "@ethereumjs/util": "^8.1.0", "bn.js": "^5.2.1", @@ -19574,12 +19877,12 @@ } }, "node_modules/which-typed-array": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", - "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.13.tgz", + "integrity": "sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==", "dependencies": { "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", + "call-bind": "^1.0.4", "for-each": "^0.3.3", "gopd": "^1.0.1", "has-tostringtag": "^1.0.0" diff --git a/protocol-dashboard/package.json b/protocol-dashboard/package.json index a641131e6d3..175fc72ea82 100644 --- a/protocol-dashboard/package.json +++ b/protocol-dashboard/package.json @@ -8,32 +8,32 @@ "@apollo/client": "3.3.7", "@audius/sdk": "3.0.11-beta.9", "@audius/stems": "0.3.10", - "@reduxjs/toolkit": "1.4.0", + "@reduxjs/toolkit": "1.9.7", "@self.id/3box-legacy": "0.3.0", "@self.id/core": "0.4.1", + "@tanstack/react-query": "5.0.5", + "@tanstack/react-query-devtools": "5.1.0", "chart.js": "2.9.3", "clsx": "1.1.1", - "connected-react-router": "6.8.0", "dayjs": "1.8.36", "graphql": "15.5.0", - "history": "4.7.2", "identicon.js": "2.3.3", "lodash": "4.17.20", "numeral": "2.0.6", - "react": "17.0.2", + "react": "18.2.0", "react-chartjs-2": "2.10.0", "react-country-flag": "3.0.2", "react-custom-scrollbars": "4.2.1", - "react-dom": "17.0.2", + "react-dom": "18.2.0", "react-helmet": "6.1.0", "react-lottie": "1.2.3", "react-markdown": "5.0.3", - "react-redux": "7.2.1", - "react-router-dom": "5.2.0", + "react-redux": "8.1.3", + "react-router-dom": "6.17.0", "react-spinners": "0.5.12", "react-spring": "8.0.25", "react-virtualized": "9.22.2", - "redux-thunk": "2.3.0", + "redux-thunk": "2.4.2", "remark-gfm": "1.0.0", "semver": "6.3.0", "simplebar-react": "3.0.0-beta.5", @@ -41,7 +41,6 @@ "vite": "4.4.9" }, "scripts": { - "publish-scripts": "./scripts/publishScripts.sh", "configure-local-env": "node ./scripts/configureEnv.cjs dev", "configure-stage-env": "node ./scripts/configureEnv.cjs stage", "configure-prod-env": "node ./scripts/configureEnv.cjs prod", @@ -83,20 +82,20 @@ "devDependencies": { "@openzeppelin/test-helpers": "0.5.6", "@pinata/sdk": "1.1.13", + "@tanstack/eslint-plugin-query": "5.0.5", "@types/3box": "1.22.0", "@types/bn.js": "5.1.2", "@types/classnames": "2.2.10", - "@types/history": "5.0.0", "@types/jest": "24.9.1", "@types/lodash": "4.14.160", "@types/node": "12.0.10", "@types/numeral": "0.0.28", - "@types/react": "17.0.2", - "@types/react-dom": "16.8.4", + "@types/react": "18.2.0", + "@types/react-dom": "18.2.14", "@types/react-helmet": "5.0.16", "@types/react-lottie": "1.2.5", - "@types/react-redux": "7.1.9", - "@types/react-router-dom": "5.1.5", + "@types/react-redux": "7.1.28", + "@types/react-router-dom": "5.3.3", "@types/react-tooltip": "3.11.0", "@types/react-virtualized": "9.21.10", "@types/semver": "6.2.1", @@ -115,7 +114,7 @@ "path-browserify": "1.0.1", "postcss": "8.4.14", "prettier": "1.19.1", - "redux-devtools-extension": "2.13.8", + "redux-devtools-extension": "2.13.9", "setimmediate": "1.0.5", "stream-browserify": "3.0.0", "stream-http": "3.2.0", @@ -125,11 +124,11 @@ "typescript": "5.2.2", "url": "0.11.0", "util": "0.12.4", - "vite-plugin-node-polyfills": "^0.15.0", - "vite-plugin-svgr": "^4.1.0", - "vite-plugin-top-level-await": "^1.3.1", - "vite-plugin-wasm": "^3.2.2", - "vite-tsconfig-paths": "^4.2.1" + "vite-plugin-node-polyfills": "0.15.0", + "vite-plugin-svgr": "4.1.0", + "vite-plugin-top-level-await": "1.3.1", + "vite-plugin-wasm": "3.2.2", + "vite-tsconfig-paths": "4.2.1" }, "resolutions": { "bn.js": "5.1.2" diff --git a/protocol-dashboard/scripts/publishScripts.sh b/protocol-dashboard/scripts/publishScripts.sh deleted file mode 100644 index f477150e0c9..00000000000 --- a/protocol-dashboard/scripts/publishScripts.sh +++ /dev/null @@ -1,15 +0,0 @@ -#! /bin/bash -# Exposes scripts to client browser and web workers by publishing them to the public folder. - -PUBLISH_DESTINATION="./public/scripts" - -declare -a modules=( - "./node_modules/web3/dist/web3.min.js" -) - -mkdir -p "$PUBLISH_DESTINATION" -for script in "${modules[@]}" -do - echo "published $script" - cp "$script" "$PUBLISH_DESTINATION" -done diff --git a/protocol-dashboard/scripts/updateBuild.cjs b/protocol-dashboard/scripts/updateBuild.cjs index d38e7535191..74b12d38e19 100644 --- a/protocol-dashboard/scripts/updateBuild.cjs +++ b/protocol-dashboard/scripts/updateBuild.cjs @@ -74,8 +74,8 @@ const run = async () => { try { await updateGABuild() const cid = await pinGABuild() - await pinFromFs(cid) - fs.writeFileSync(`./build_cid.txt`, cid) + const { IpfsHash } = await pinFromFs(cid) + fs.writeFileSync(`./build_cid.txt`, IpfsHash) process.exit() } catch (err) { console.log(err) diff --git a/protocol-dashboard/src/App.tsx b/protocol-dashboard/src/App.tsx index a98b54a9a3e..3741b303b20 100644 --- a/protocol-dashboard/src/App.tsx +++ b/protocol-dashboard/src/App.tsx @@ -1,9 +1,9 @@ import { ApolloProvider } from '@apollo/client' +import { QueryClient, QueryClientProvider } from '@tanstack/react-query' +import { ReactQueryDevtools } from '@tanstack/react-query-devtools' import { useEffect, useState } from 'react' import { Provider, useSelector } from 'react-redux' -import { ConnectedRouter } from 'connected-react-router' -import { Switch, Route } from 'react-router' -import { createHashHistory } from 'history' +import { Routes, Route, HashRouter } from 'react-router-dom' import Header from 'components/Header' import Home from 'containers/Home' @@ -28,19 +28,24 @@ import Proposal from 'containers/Proposal' import { createStyles } from 'utils/mobile' import { getDidGraphError } from 'store/api/hooks' import UnregisteredNode from 'containers/UnregisteredNode' +import { RouteHistoryProvider } from './providers/RouteHistoryContext' + const styles = createStyles({ desktopStyles, mobileStyles }) -const history = createHashHistory() -const store = createStore(history) +const store = createStore() +const queryClient = new QueryClient() const Root = () => ( - + + + + ) const App = () => { // If the client fails, set it to the backup client - const [appolloClient, setApolloClient] = useState(client) + const [apolloClient, setApolloClient] = useState(client) const didClientError = useSelector(getDidGraphError) useEffect(() => { if (didClientError) { @@ -51,83 +56,67 @@ const App = () => { } }, [didClientError]) return ( - - - + + +
- - - + + } /> + } /> } /> } /> } /> } /> - } /> + } /> } /> - } /> + } /> } /> - + } /> } /> - - + } /> + } /> } /> - - + } /> +
-
-
-
+ + + ) } diff --git a/protocol-dashboard/src/components/AppBar/AppBar.tsx b/protocol-dashboard/src/components/AppBar/AppBar.tsx index 45f1c23cd9d..1deac598efd 100644 --- a/protocol-dashboard/src/components/AppBar/AppBar.tsx +++ b/protocol-dashboard/src/components/AppBar/AppBar.tsx @@ -1,4 +1,5 @@ import React, { useState, useCallback } from 'react' +import BN from 'bn.js' import Button from 'components/Button' import { Position } from 'components/Tooltip' import ConnectMetaMaskModal from 'components/ConnectMetaMaskModal' @@ -20,7 +21,6 @@ import DisplayAudio from 'components/DisplayAudio' import UserImage from 'components/UserImage' import useOpenLink from 'hooks/useOpenLink' import getActiveStake from 'utils/activeStake' -import { Utils } from '@audius/sdk/dist/legacy.js' const styles = createStyles({ desktopStyles, mobileStyles }) @@ -75,7 +75,7 @@ const Misconfigured = ({ const UserAccountSnippet = ({ wallet }: UserAccountSnippetProps) => { const { user } = useUser({ wallet }) - const activeStake = user ? getActiveStake(user) : Utils.toBN('0') + const activeStake = user ? getActiveStake(user) : new BN('0') const pushRoute = usePushRoute() const onClickUser = useCallback(() => { diff --git a/protocol-dashboard/src/components/ConfirmTransactionModal/ConfirmTransactionModal.tsx b/protocol-dashboard/src/components/ConfirmTransactionModal/ConfirmTransactionModal.tsx index b301146d5a7..1446fe696a2 100644 --- a/protocol-dashboard/src/components/ConfirmTransactionModal/ConfirmTransactionModal.tsx +++ b/protocol-dashboard/src/components/ConfirmTransactionModal/ConfirmTransactionModal.tsx @@ -155,15 +155,16 @@ export const Delegating: React.FC = props => { type StandaloneBoxProps = { className?: string + children: ReactNode } -export const StandaloneBox: React.FC = props => { +export const StandaloneBox = ({ className, children }: StandaloneBoxProps) => { return ( - {props.children} + {children} ) } @@ -174,7 +175,7 @@ type ToOperatorProps = { name: string wallet: Address } -export const ToOperator: React.FC = props => { +export const ToOperator = (props: ToOperatorProps) => { return ( = props => { ) } -type BoxProps = { className?: string } -export const Box: React.FC = props => { +type BoxProps = { + className?: string + children: ReactNode +} +export const Box = ({ className, children }: BoxProps) => { return ( -
- {props.children} +
+ {children}
) } diff --git a/protocol-dashboard/src/components/DelegateStakeModal/DelegateStakeModal.tsx b/protocol-dashboard/src/components/DelegateStakeModal/DelegateStakeModal.tsx index afbedbc9f1c..e0714ebc5e7 100644 --- a/protocol-dashboard/src/components/DelegateStakeModal/DelegateStakeModal.tsx +++ b/protocol-dashboard/src/components/DelegateStakeModal/DelegateStakeModal.tsx @@ -1,6 +1,6 @@ import React, { useState, useCallback, useEffect } from 'react' +import BN from 'bn.js' import clsx from 'clsx' -import { Utils } from '@audius/sdk/dist/legacy.js' import { ButtonType } from '@audius/stems' import { useDelegateStake } from 'store/actions/delegateStake' @@ -42,13 +42,13 @@ const DelegateStakeModal: React.FC = ({ onClose }: DelegateStakeModalProps) => { const { min, max, user } = useUserDelegation(serviceOperatorWallet) - const [stakingBN, setStakingBN] = useState(Utils.toBN('0')) + const [stakingBN, setStakingBN] = useState(new BN('0')) const [stakingAmount, setStakingAmount] = useState('') useEffect(() => { if (!isOpen) { setStakingAmount('') - setStakingBN(Utils.toBN('0')) + setStakingBN(new BN('0')) } }, [isOpen, setStakingAmount, setStakingBN]) diff --git a/protocol-dashboard/src/components/ManageService/ManageService.tsx b/protocol-dashboard/src/components/ManageService/ManageService.tsx index b4ebcd21c14..44719ff99bb 100644 --- a/protocol-dashboard/src/components/ManageService/ManageService.tsx +++ b/protocol-dashboard/src/components/ManageService/ManageService.tsx @@ -1,5 +1,4 @@ import React, { useCallback } from 'react' -import { Utils } from '@audius/sdk/dist/legacy.js' import BN from 'bn.js' import clsx from 'clsx' import styles from './ManageService.module.css' @@ -273,10 +272,9 @@ const ManageService: React.FC = ( const pendingClaim = usePendingClaim(accountUser?.wallet) const deployerStake = - (accountUser as Operator)?.serviceProvider?.deployerStake ?? Utils.toBN('0') + (accountUser as Operator)?.serviceProvider?.deployerStake ?? new BN('0') const maxAccountStake = - (accountUser as Operator)?.serviceProvider?.maxAccountStake ?? - Utils.toBN('0') + (accountUser as Operator)?.serviceProvider?.maxAccountStake ?? new BN('0') if (deployerStake.isZero() || deployerStake.gte(maxAccountStake)) increaseStakeDisabled = true diff --git a/protocol-dashboard/src/components/MobileNav/MobileNav.tsx b/protocol-dashboard/src/components/MobileNav/MobileNav.tsx index 3e0ae5a8605..0e1ec597fd0 100644 --- a/protocol-dashboard/src/components/MobileNav/MobileNav.tsx +++ b/protocol-dashboard/src/components/MobileNav/MobileNav.tsx @@ -1,12 +1,9 @@ -import React, { useCallback } from 'react' -import { Dispatch } from 'redux' -import { connect } from 'react-redux' -import { push as pushRoute } from 'connected-react-router' -import { matchPath } from 'react-router-dom' +import { useCallback } from 'react' +import { useMatch } from 'react-router-dom' import clsx from 'clsx' import Logo from 'assets/img/audiusLogoHorizontal.svg?react' +import { useNavigate, useLocation } from 'react-router-dom' -import { AppState } from 'store/types' import styles from './MobileNav.module.css' import * as routes from 'utils/routes' import { Button, ButtonType, IconRemove } from '@audius/stems' @@ -41,7 +38,7 @@ const MobileNavButton = (props: MobileNavButtonProps) => { matchParams: { path }, onClose } = props - const isActiveRoute = !!matchPath(window.location.pathname, props.matchParams) + const isActiveRoute = !!useMatch(props.matchParams) const onButtonClick = useCallback(() => { onClose() pushRoute(path) @@ -71,59 +68,43 @@ const LaunchTheAppButton = (props: LaunchTheAppButtonProps) => { ) } -type OwnProps = { +type MobileNavProps = { isOpen: boolean onClose: () => void } -type MobileNavProps = OwnProps & - ReturnType & - ReturnType +const MobileNav = ({ isOpen, onClose }: MobileNavProps) => { + const location = useLocation() + const navigate = useNavigate() -const MobileNav = ({ - pathname, - pushRoute, - isOpen, - onClose -}: MobileNavProps) => ( -
-
- -
-
-
- -
{messages.name}
+ return ( +
+
+
- {navRoutes.map(route => ( -
- +
+
+ +
{messages.name}
- ))} - + {navRoutes.map(route => ( +
+ navigate(path)} + /> +
+ ))} + +
-
-) - -const mapStateToProps = (state: AppState) => { - return { - pathname: state.router.location.pathname - } -} - -function mapDispatchToProps(dispatch: Dispatch) { - return { - pushRoute: (path: string) => dispatch(pushRoute(path)) - } + ) } -export default connect(mapStateToProps, mapDispatchToProps)(MobileNav) +export default MobileNav diff --git a/protocol-dashboard/src/components/Modal/Modal.tsx b/protocol-dashboard/src/components/Modal/Modal.tsx index 410ac156976..96210877f5b 100644 --- a/protocol-dashboard/src/components/Modal/Modal.tsx +++ b/protocol-dashboard/src/components/Modal/Modal.tsx @@ -15,9 +15,10 @@ interface ModalProps { allowScroll?: boolean isCloseable?: boolean dismissOnClickOutside?: boolean + children: ReactNode } -const Modal: React.FC = ({ +const Modal = ({ className, wrapperClassName, headerClassName, @@ -29,7 +30,7 @@ const Modal: React.FC = ({ onClose, allowScroll, children -}) => { +}: ModalProps) => { return ( { const location = useLocation() const isActiveRoute = props.matchParams.some( - matchParam => !!matchPath(location.pathname, matchParam) + matchParam => !!matchPath(matchParam, location.pathname) ) const onButtonClick = useCallback(() => pushRoute(baseRoute), [ baseRoute, @@ -71,36 +66,22 @@ const NavButton = (props: NavButtonProps) => { ) } -type OwnProps = {} - -type NavProps = OwnProps & - ReturnType & - ReturnType - -const Nav = (props: NavProps) => ( -
- {navRoutes.map(route => ( -
- -
- ))} -
-) - -const mapStateToProps = (state: AppState) => { - return { - pathname: state.router.location.pathname - } -} - -function mapDispatchToProps(dispatch: Dispatch) { - return { - pushRoute: (path: string) => dispatch(pushRoute(path)) - } +const Nav = () => { + const navigate = useNavigate() + const location = useLocation() + return ( +
+ {navRoutes.map(route => ( +
+ navigate(path)} + /> +
+ ))} +
+ ) } -export default connect(mapStateToProps, mapDispatchToProps)(Nav) +export default Nav diff --git a/protocol-dashboard/src/components/Page/Page.tsx b/protocol-dashboard/src/components/Page/Page.tsx index e92bb31191d..0cadd438264 100644 --- a/protocol-dashboard/src/components/Page/Page.tsx +++ b/protocol-dashboard/src/components/Page/Page.tsx @@ -2,13 +2,15 @@ import React, { useCallback, useEffect } from 'react' import clsx from 'clsx' import { Spring } from 'react-spring/renderprops' import { IconArrowWhite } from '@audius/stems' -import { usePushRoute, useBackRoute } from 'utils/effects' -import { useLastPage } from 'store/pageHistory/hooks' +import { usePushRoute } from 'utils/effects' import desktopStyles from './Page.module.css' import mobileStyles from './PageMobile.module.css' import { createStyles } from 'utils/mobile' import { useIsMobile } from 'utils/hooks' +import { usePreviousRoute } from '../../providers/RouteHistoryContext' +import { useNavigate } from 'react-router-dom' +import { getPageTitle } from 'utils/routes' const styles = createStyles({ desktopStyles, mobileStyles }) @@ -16,6 +18,7 @@ const FADE_DURATION = 200 // (ms) interface PageProps { className?: string + children: React.ReactNode title: string previousPage?: string previousPageRoute?: string @@ -24,7 +27,7 @@ interface PageProps { hidePreviousPage?: boolean } -const Page: React.FC = ({ +const Page = ({ className, children, title, @@ -33,10 +36,11 @@ const Page: React.FC = ({ defaultPreviousPageRoute, previousPage, previousPageRoute -}) => { +}: PageProps) => { const pushRoute = usePushRoute() - const prevPage = useLastPage() - const goBackRoute = useBackRoute() + const prevRoute = usePreviousRoute() + const prevTitle = getPageTitle(prevRoute) + const navigate = useNavigate() const isMobile = useIsMobile() useEffect(() => { @@ -49,21 +53,21 @@ const Page: React.FC = ({ const onClickPreviousPage = useCallback(() => { if (previousPage && previousPageRoute) { pushRoute(previousPageRoute) - } else if (prevPage) { - goBackRoute() + } else if (prevRoute) { + navigate(-1) } else if (defaultPreviousPageRoute) { pushRoute(defaultPreviousPageRoute) } }, [ previousPageRoute, pushRoute, - goBackRoute, - prevPage, + prevRoute, + navigate, defaultPreviousPageRoute, previousPage ]) - const previousText = previousPage || prevPage || defaultPreviousPage + let previousText = previousPage || prevTitle || defaultPreviousPage return ( void + children?: React.ReactNode } -const Paper: React.FC = ({ - className, - children, - onClick = () => {} -}) => { +const Paper = ({ className, children, onClick = () => {} }: PaperProps) => { return (
= ({ ) const { status: userStatus, user: accountUser } = useAccountUser() - const activeStake = accountUser - ? getActiveStake(accountUser) - : Utils.toBN('0') + const activeStake = accountUser ? getActiveStake(accountUser) : new BN('0') const isUserStaker = userStatus === Status.Success && !activeStake.isZero() return ( @@ -237,7 +235,7 @@ const ProposalHero: React.FC = ({ } }, [status, newVote, setCurrentVote, setReset]) - const amountAbstained = useAmountAbstained(proposal) || Utils.toBN('0') + const amountAbstained = useAmountAbstained(proposal) || new BN('0') const inProgressProposalSubstate = useGetInProgressProposalSubstate(proposal) const proposalMilestoneBlocks = useProposalMilestoneBlocks(proposal) @@ -260,7 +258,7 @@ const ProposalHero: React.FC = ({ const totalMagnitudeVoted = proposal ? proposal?.voteMagnitudeYes.add(proposal?.voteMagnitudeNo) - : Utils.toBN('0') + : new BN('0') const hasMetQuorum = proposal ? totalMagnitudeVoted.gte(proposal.quorum) : false diff --git a/protocol-dashboard/src/components/Proposals/Proposals.tsx b/protocol-dashboard/src/components/Proposals/Proposals.tsx index 6f7e259a929..7faf5ad230d 100644 --- a/protocol-dashboard/src/components/Proposals/Proposals.tsx +++ b/protocol-dashboard/src/components/Proposals/Proposals.tsx @@ -1,6 +1,6 @@ import React, { useState, useCallback } from 'react' import clsx from 'clsx' -import { Utils } from '@audius/sdk/dist/legacy.js' +import BN from 'bn.js' import { useProposals } from 'store/cache/proposals/hooks' import Paper from 'components/Paper' @@ -52,9 +52,7 @@ export const NoProposals = ({ text }: { text: string }) => { const Proposals: React.FC = () => { const { activeProposals, resolvedProposals } = useProposals() const { status: userStatus, user: accountUser } = useAccountUser() - const activeStake = accountUser - ? getActiveStake(accountUser) - : Utils.toBN('0') + const activeStake = accountUser ? getActiveStake(accountUser) : new BN('0') const isUserStaker = userStatus === Status.Success && !activeStake.isZero() return ( diff --git a/protocol-dashboard/src/components/RegisterServiceModal/RegisterServiceModal.tsx b/protocol-dashboard/src/components/RegisterServiceModal/RegisterServiceModal.tsx index 4ad755f5fde..101e76750ca 100644 --- a/protocol-dashboard/src/components/RegisterServiceModal/RegisterServiceModal.tsx +++ b/protocol-dashboard/src/components/RegisterServiceModal/RegisterServiceModal.tsx @@ -1,7 +1,6 @@ import React, { useState, useCallback, useEffect, useRef, useMemo } from 'react' import clsx from 'clsx' import BN from 'bn.js' -import { Utils } from '@audius/sdk/dist/legacy.js' import { TabSlider, ButtonType } from '@audius/stems' import { useRegisterService } from 'store/actions/registerService' @@ -125,7 +124,7 @@ const RegisterServiceModal: React.FC = ({ if (isOpen && selectedServiceInfo && calculatedMinStakeRef.current) { setStakingBN(calculatedMinStakeRef.current) const amount = AudiusClient.getAud( - Utils.toBN(calculatedMinStakeRef.current as any) + new BN(calculatedMinStakeRef.current as any) ) setStakingAmount(amount.toString()) } diff --git a/protocol-dashboard/src/components/Timeline/Timeline.tsx b/protocol-dashboard/src/components/Timeline/Timeline.tsx index 73876323bea..d6d9eff7d29 100644 --- a/protocol-dashboard/src/components/Timeline/Timeline.tsx +++ b/protocol-dashboard/src/components/Timeline/Timeline.tsx @@ -1,11 +1,6 @@ -import React, { useEffect } from 'react' -import { Dispatch } from 'redux' -import { connect } from 'react-redux' -import { push as pushRoute } from 'connected-react-router' +import { useEffect } from 'react' import clsx from 'clsx' -import { AppState } from 'store/types' - import styles from './Timeline.module.css' import Paper from 'components/Paper' import TimelineEvent from './TimelineEvent' @@ -23,22 +18,14 @@ const messages = { const MAX_LEN = 4 -type OwnProps = { +type TimelineProps = { className?: string limit?: number wallet: Address timelineType: TimelineType } -type TimelineProps = OwnProps & - ReturnType & - ReturnType - -const Timeline: React.FC = ({ - className, - wallet, - timelineType -}: TimelineProps) => { +const Timeline = ({ className, wallet, timelineType }: TimelineProps) => { const { timeline } = useTimeline(wallet, timelineType) const { isOpen, onClick, onClose } = useModalControls() useEffect(() => { @@ -76,14 +63,4 @@ const Timeline: React.FC = ({ ) } -const mapStateToProps = (state: AppState) => { - return {} -} - -function mapDispatchToProps(dispatch: Dispatch) { - return { - pushRoute: (path: string) => dispatch(pushRoute(path)) - } -} - -export default connect(mapStateToProps, mapDispatchToProps)(Timeline) +export default Timeline diff --git a/protocol-dashboard/src/components/UpdateStakeModal/UpdateStakeModal.tsx b/protocol-dashboard/src/components/UpdateStakeModal/UpdateStakeModal.tsx index 234c02a5671..37b3044938d 100644 --- a/protocol-dashboard/src/components/UpdateStakeModal/UpdateStakeModal.tsx +++ b/protocol-dashboard/src/components/UpdateStakeModal/UpdateStakeModal.tsx @@ -1,5 +1,5 @@ import React, { useState, useCallback, useEffect } from 'react' -import { Utils } from '@audius/sdk/dist/legacy.js' +import BN from 'bn.js' import clsx from 'clsx' import { ButtonType } from '@audius/stems' @@ -53,7 +53,7 @@ const IncreaseStakeModal: React.FC = ({ onClose() } - const [stakingBN, setStakingBN] = useState(Utils.toBN('0')) + const [stakingBN, setStakingBN] = useState(new BN('0')) const [stakingAmount, setStakingAmount] = useState('0') const [hasRun, setHasRun] = useState(false) @@ -146,9 +146,9 @@ const IncreaseStakeModal: React.FC = ({ ) const deployerStake = - (accountUser as Operator)?.serviceProvider?.deployerStake ?? Utils.toBN('0') + (accountUser as Operator)?.serviceProvider?.deployerStake ?? new BN('0') const totalStakedFor = - (accountUser as Operator)?.totalStakedFor ?? Utils.toBN('0') + (accountUser as Operator)?.totalStakedFor ?? new BN('0') const stakeChange = stakingBN.sub(deployerStake) const min = isIncrease diff --git a/protocol-dashboard/src/containers/Home/Home.tsx b/protocol-dashboard/src/containers/Home/Home.tsx index 947d9eb819a..21e96f7106b 100644 --- a/protocol-dashboard/src/containers/Home/Home.tsx +++ b/protocol-dashboard/src/containers/Home/Home.tsx @@ -35,8 +35,7 @@ const messages = { wtf3: `Backed by an all-star team of investors, Audius was founded in 2018 and serves millions of users every month, making it the largest non-financial crypto application ever built.` } -interface HomeProps {} -const Home: React.FC = (props: HomeProps) => { +const Home = () => { const { isLoggedIn } = useAccount() const { recentProposals } = useProposals() const pushRoute = usePushRoute() diff --git a/protocol-dashboard/src/containers/Node/Node.tsx b/protocol-dashboard/src/containers/Node/Node.tsx index f2207c0ef36..3985c574af7 100644 --- a/protocol-dashboard/src/containers/Node/Node.tsx +++ b/protocol-dashboard/src/containers/Node/Node.tsx @@ -1,4 +1,4 @@ -import { matchPath, useLocation, useParams } from 'react-router-dom' +import { useMatch, useParams } from 'react-router-dom' import NodeOverview from 'components/NodeOverview' import { useDiscoveryProvider } from 'store/cache/discoveryProvider/hooks' import { useContentNode } from 'store/cache/contentNode/hooks' @@ -81,12 +81,8 @@ const DiscoveryProvider = ({ spID, accountWallet }: DiscoveryProviderProps) => { const Node = () => { const { spID: spIDParam } = useParams<{ spID: string }>() const spID = parseInt(spIDParam, 10) - const location = useLocation() const { wallet: accountWallet } = useAccount() - - const isDiscovery = !!matchPath(location.pathname, { - path: SERVICES_DISCOVERY_PROVIDER_NODE - }) + const isDiscovery = !!useMatch(SERVICES_DISCOVERY_PROVIDER_NODE) return ( { // const isOwner = accountWallet === discoveryProvider!.owner - return <>Health UI and Registration UI Coming Soon + // const { status, data, error } = useQuery({ + // queryKey: ['health', { endpoint }], + // queryFn: async () => { + // const response = await fetch(`${endpoint}/health_check`) + // if (!response.ok) { + // throw new Error( + // `Failed fetching health check from ${endpoint}: ${response.status} ${response.statusText}` + // ) + // } + // return response.json() + // } + // }) + + // if (status === 'pending') { + // return Loading... + // } + + // if (status === 'error') { + // return Error: {error.message} + // } + + return ( + <> + Health UI and Registration UI Coming Soon + {/* {JSON.stringify(data)} */} + + ) } type UnregisteredDiscoveryProviderProps = { @@ -47,10 +74,7 @@ const UnregisteredNode = () => { const query = new URLSearchParams(location.search) const endpoint = query.get('endpoint') const { wallet: accountWallet } = useAccount() - - const isDiscovery = !!matchPath(location.pathname, { - path: SERVICES_UNREGISTERED_DISCOVERY_NODE - }) + const isDiscovery = !!useMatch(SERVICES_UNREGISTERED_DISCOVERY_NODE) return ( { // we have type errors everywhere :( const showServiceProviderSkeletonTiles = useMemo(() => { if (isServiceProvider) return true - return !matchPath(pathname, { path: SERVICES_ACCOUNT_USER }) + return !matchPath(pathname, SERVICES_ACCOUNT_USER) }, [isServiceProvider, pathname]) const hasDiscoveryProviders = @@ -87,7 +87,7 @@ const UserPage = () => { // Check if on user or operator page useEffect(() => { if (status !== Status.Success) return - const isUserPath = !!matchPath(pathname, { path: SERVICES_ACCOUNT_USER }) + const isUserPath = !!matchPath(pathname, SERVICES_ACCOUNT_USER) if (isServiceProvider && isUserPath) replaceRoute(operatorPage(wallet)) else if (!isServiceProvider && !isUserPath) replaceRoute(accountPage(wallet)) @@ -95,7 +95,7 @@ const UserPage = () => { const numDiscoveryNodes = (user as Operator)?.discoveryProviders?.length ?? 0 const numContentNodes = (user as Operator)?.contentNodes?.length ?? 0 - const activeStake = user ? getActiveStake(user) : Utils.toBN('0') + const activeStake = user ? getActiveStake(user) : new BN('0') const inboundDelegation = useActiveInboundDelegation({ wallet }) const title = isOwner ? messages.owner @@ -134,10 +134,10 @@ const UserPage = () => { (user as Operator | undefined)?.serviceProvider?.deployerCut ?? 0 } - delegated={inboundDelegation.amount ?? Utils.toBN('0')} + delegated={inboundDelegation.amount ?? new BN('0')} minDelegation={ (user as Operator | undefined)?.minDelegationAmount ?? - Utils.toBN('0') + new BN('0') } delegators={ (user as Operator | undefined)?.delegators?.length ?? 0 diff --git a/protocol-dashboard/src/index.tsx b/protocol-dashboard/src/index.tsx index 4edf3fc0c15..88d3171e498 100644 --- a/protocol-dashboard/src/index.tsx +++ b/protocol-dashboard/src/index.tsx @@ -1,5 +1,4 @@ -import React from 'react' -import ReactDOM from 'react-dom' +import { createRoot } from 'react-dom/client' import App from './App' @@ -9,4 +8,5 @@ import '@audius/stems/dist/avenir.css' import '@audius/stems/dist/stems.css' import './index.css' -ReactDOM.render(, document.getElementById('root')) +const rootElement = document.getElementById('root') +createRoot(rootElement).render() diff --git a/protocol-dashboard/src/providers/RouteHistoryContext.tsx b/protocol-dashboard/src/providers/RouteHistoryContext.tsx new file mode 100644 index 00000000000..a37d6ce43b3 --- /dev/null +++ b/protocol-dashboard/src/providers/RouteHistoryContext.tsx @@ -0,0 +1,56 @@ +import React, { createContext, useContext, useState, useEffect } from 'react' +import { useLocation } from 'react-router-dom' + +type RouteHistoryContextType = { + historyStack: string[] + setHistoryStack: React.Dispatch> +} + +const RouteHistoryContext = createContext( + undefined +) + +export const RouteHistoryProvider = ({ children }) => { + const [historyStack, setHistoryStack] = useState([]) + const location = useLocation() + + useEffect(() => { + // Prevent duplicates of the same path in the history stack + if ( + historyStack.length === 0 || + historyStack[historyStack.length - 1] !== location.pathname + ) { + setHistoryStack(prev => [...prev, location.pathname]) + } + }, [location.pathname, historyStack]) + + const contextValue = { historyStack, setHistoryStack } + + return ( + + {children} + + ) +} + +export const useRouteHistory = () => { + const context = useContext(RouteHistoryContext) + + if (!context) { + throw new Error( + 'useRouteHistory must be used within a RouteHistoryProvider' + ) + } + + const getPreviousRoute = (): string | null => { + const length = context.historyStack.length + return length >= 2 ? context.historyStack[length - 2] : null + } + + return { getPreviousRoute, historyStack: context.historyStack } +} + +export const usePreviousRoute = () => { + const { getPreviousRoute } = useRouteHistory() + return getPreviousRoute() +} diff --git a/protocol-dashboard/src/services/Audius/governance/governance.ts b/protocol-dashboard/src/services/Audius/governance/governance.ts index 511861336a2..6627d4e3802 100644 --- a/protocol-dashboard/src/services/Audius/governance/governance.ts +++ b/protocol-dashboard/src/services/Audius/governance/governance.ts @@ -241,7 +241,7 @@ export default class Governance { }) { // Current callValue is always 0. Changing this is unsupported. const proposal = { - targetContractRegistryKey: window.Utils.utf8ToHex( + targetContractRegistryKey: this.aud.libs.ethWeb3Manager.web3.utils.utf8ToHex( args.targetContractName ), functionSignature: args.functionSignature, diff --git a/protocol-dashboard/src/services/Audius/helpers.ts b/protocol-dashboard/src/services/Audius/helpers.ts index 939db3da839..b64447c2e0e 100644 --- a/protocol-dashboard/src/services/Audius/helpers.ts +++ b/protocol-dashboard/src/services/Audius/helpers.ts @@ -1,4 +1,3 @@ -import { Utils } from '@audius/sdk/dist/legacy.js' import { formatNumber, formatAudString } from 'utils/format' import AudiusClient from './AudiusClient' import { Permission, BigNumber, Proposal } from 'types' @@ -82,10 +81,9 @@ export async function getBlockNearTimestamp( return targetBlock } -export function toChecksumAddress(this: AudiusClient, wallet: string) { - // NOTE: This is kinda a hack - // but b/c we load in web3 before the js bundle it will work - const web3 = window.Web3 +export async function toChecksumAddress(this: AudiusClient, wallet: string) { + await this.awaitSetup() + const web3 = this.libs.ethWeb3Manager.web3 return web3.utils.toChecksumAddress(wallet) } @@ -97,13 +95,13 @@ export function getBNPercentage( ): number { const divisor = Math.pow(10, decimals + 1) if (n2.toString() === '0') return 0 - let num = n1.mul(Utils.toBN(divisor.toString())).div(n2) - if (num.gte(Utils.toBN(divisor.toString()))) return 1 + let num = n1.mul(new BN(divisor.toString())).div(n2) + if (num.gte(new BN(divisor.toString()))) return 1 return num.toNumber() / divisor } export function displayShortAud(amount: BigNumber) { - return formatNumber(amount.div(Utils.toBN('1000000000000000000') as BN)) + return formatNumber(amount.div(new BN('1000000000000000000') as BN)) } export function displayAud(amount: BigNumber) { @@ -111,8 +109,8 @@ export function displayAud(amount: BigNumber) { } export function getAud(amount: BigNumber) { - const aud = amount.div(Utils.toBN('1000000000000000000')) - const wei = amount.sub(aud.mul(Utils.toBN('1000000000000000000'))) + const aud = amount.div(new BN('1000000000000000000')) + const wei = amount.sub(aud.mul(new BN('1000000000000000000'))) if (wei.isZero()) { return aud.toString() } @@ -125,7 +123,7 @@ export function trimRightZeros(number: string) { } export function getWei(amount: BigNumber) { - return amount.mul(Utils.toBN('1000000000000000000')) + return amount.mul(new BN('1000000000000000000')) } type NodeMetadata = { diff --git a/protocol-dashboard/src/services/Audius/setup.ts b/protocol-dashboard/src/services/Audius/setup.ts index d3ac0a2d94f..c1d80bd8f6f 100644 --- a/protocol-dashboard/src/services/Audius/setup.ts +++ b/protocol-dashboard/src/services/Audius/setup.ts @@ -1,11 +1,10 @@ import { AudiusClient } from './AudiusClient' -import { libs as AudiusLibs, Utils } from '@audius/sdk/dist/legacy.js' +import { libs as AudiusLibs, Utils } from '@audius/sdk/dist/web-libs.js' declare global { interface Window { AudiusClient: any Audius: any - Utils: any Web3: any web3: any ethereum: any @@ -16,7 +15,6 @@ declare global { } const Web3 = window.Web3 -window.Utils = Utils const identityServiceEndpoint = import.meta.env.VITE_IDENTITY_SERVICE_ENDPOINT const registryAddress = import.meta.env.VITE_REGISTRY_ADDRESS diff --git a/protocol-dashboard/src/store/account/hooks.ts b/protocol-dashboard/src/store/account/hooks.ts index ff29dc7ce06..9110d3b9e3b 100644 --- a/protocol-dashboard/src/store/account/hooks.ts +++ b/protocol-dashboard/src/store/account/hooks.ts @@ -1,6 +1,6 @@ import { useState } from 'react' import { useSelector, useDispatch } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { Action } from 'redux' import { @@ -19,6 +19,7 @@ import { } from './slice' import { useEffect } from 'react' import { getUser, fetchUser } from 'store/cache/user/hooks' +import { AnyAction } from '@reduxjs/toolkit' // -------------------------------- Selectors -------------------------------- export const getIsLoggedIn = (state: AppState) => state.account.loggedIn @@ -131,7 +132,7 @@ export const useAccount = () => { const wallet = useSelector(getAccountWallet) const status = useSelector(getAccountStatus) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (!status) { dispatch(fetchAccount()) @@ -146,7 +147,7 @@ export const useAccountUser = () => { const wallet = useSelector(getAccountWallet) const [status, setStatus] = useState() const user = useSelector(getUser(wallet!)) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (isLoggedIn && !status && wallet) { dispatch(fetchUser(wallet, setStatus)) @@ -161,7 +162,7 @@ export const useAccountUser = () => { export const usePendingTransactions = () => { const wallet = useSelector(getAccountWallet) const pendingTransactions = useSelector(getPendingTransactions) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (wallet && pendingTransactions.status === undefined) { dispatch(fetchPendingTransactions(wallet)) diff --git a/protocol-dashboard/src/store/actions/cancelTransaction.ts b/protocol-dashboard/src/store/actions/cancelTransaction.ts index 82e081009e9..dd881342e80 100644 --- a/protocol-dashboard/src/store/actions/cancelTransaction.ts +++ b/protocol-dashboard/src/store/actions/cancelTransaction.ts @@ -1,12 +1,13 @@ import { useState, useCallback } from 'react' import { useDispatch } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { Action } from 'redux' import { PendingTransactionName, Status, Address } from 'types' import Audius from 'services/Audius' import { AppState } from 'store/types' import { fetchPendingTransactions } from 'store/account/hooks' +import { AnyAction } from '@reduxjs/toolkit' function cancelDecreaseStake( setStatus: (status: Status) => void, @@ -100,7 +101,7 @@ function cancelRemoveDelegator( export const useCancelTransaction = (name: PendingTransactionName) => { const [status, setStatus] = useState() const [error, setError] = useState('') - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() const cancelTransaction = useCallback( (wallet?: Address) => { diff --git a/protocol-dashboard/src/store/actions/createProposal.ts b/protocol-dashboard/src/store/actions/createProposal.ts index cf62a4cc1f1..783b8cda76a 100644 --- a/protocol-dashboard/src/store/actions/createProposal.ts +++ b/protocol-dashboard/src/store/actions/createProposal.ts @@ -1,12 +1,13 @@ import { useState, useCallback, useEffect } from 'react' import { useDispatch } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { Action } from 'redux' import { Status } from 'types' import Audius from 'services/Audius' import { AppState } from 'store/types' import { fetchActiveProposals } from 'store/cache/proposals/hooks' +import { AnyAction } from '@reduxjs/toolkit' function createAudiusProposal( targetContractName: string, @@ -43,7 +44,7 @@ function createAudiusProposal( export const useCreateProposal = (shouldReset?: boolean) => { const [status, setStatus] = useState() const [error, setError] = useState('') - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (shouldReset) { diff --git a/protocol-dashboard/src/store/actions/delegateStake.ts b/protocol-dashboard/src/store/actions/delegateStake.ts index dfb871a9a3c..fd565582284 100644 --- a/protocol-dashboard/src/store/actions/delegateStake.ts +++ b/protocol-dashboard/src/store/actions/delegateStake.ts @@ -1,6 +1,6 @@ import { useState, useCallback, useEffect } from 'react' import { useDispatch } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { Action } from 'redux' import { Status, BigNumber, Address } from 'types' @@ -8,6 +8,7 @@ import Audius from 'services/Audius' import { AppState } from 'store/types' import { fetchUser } from 'store/cache/user/hooks' import { getAccountWallet } from 'store/account/hooks' +import { AnyAction } from '@reduxjs/toolkit' export function delegateAudiusStake( serviceOperatorWallet: Address, @@ -36,7 +37,7 @@ export function delegateAudiusStake( export const useDelegateStake = (shouldReset?: boolean) => { const [status, setStatus] = useState() const [error, setError] = useState('') - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (shouldReset) { setStatus(undefined) diff --git a/protocol-dashboard/src/store/actions/deregisterService.ts b/protocol-dashboard/src/store/actions/deregisterService.ts index b9c10c2df54..286c993da12 100644 --- a/protocol-dashboard/src/store/actions/deregisterService.ts +++ b/protocol-dashboard/src/store/actions/deregisterService.ts @@ -1,6 +1,6 @@ import { useState, useCallback, useEffect } from 'react' import { useDispatch } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { Action } from 'redux' import { Status, ServiceType } from 'types' @@ -8,6 +8,7 @@ import Audius from 'services/Audius' import { AppState } from 'store/types' import { getDiscoveryProvider } from 'store/cache/discoveryProvider/hooks' import { getContentNode } from 'store/cache/contentNode/hooks' +import { AnyAction } from '@reduxjs/toolkit' function deregisterAudiusService( serviceType: ServiceType, @@ -38,7 +39,7 @@ function deregisterAudiusService( export const useDeregisterService = (shouldReset?: boolean) => { const [status, setStatus] = useState() const [error, setError] = useState('') - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (shouldReset) { setStatus(undefined) diff --git a/protocol-dashboard/src/store/actions/executeProposal.ts b/protocol-dashboard/src/store/actions/executeProposal.ts index 08b378d3edf..b05ea764c45 100644 --- a/protocol-dashboard/src/store/actions/executeProposal.ts +++ b/protocol-dashboard/src/store/actions/executeProposal.ts @@ -1,12 +1,13 @@ import { useState, useCallback, useEffect } from 'react' import { useDispatch } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { Action } from 'redux' import { Status } from 'types' import Audius from 'services/Audius' import { AppState } from 'store/types' import { fetchProposal } from 'store/cache/proposals/hooks' +import { AnyAction } from '@reduxjs/toolkit' function executeAudiusProposal( proposalId: number, @@ -32,7 +33,7 @@ function executeAudiusProposal( export const useExecuteProposal = (shouldReset?: boolean) => { const [status, setStatus] = useState() const [error, setError] = useState('') - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (shouldReset) { diff --git a/protocol-dashboard/src/store/actions/makeClaim.ts b/protocol-dashboard/src/store/actions/makeClaim.ts index e931cdbfe99..a070e877f1d 100644 --- a/protocol-dashboard/src/store/actions/makeClaim.ts +++ b/protocol-dashboard/src/store/actions/makeClaim.ts @@ -1,12 +1,13 @@ import { useState, useCallback, useEffect } from 'react' import { useDispatch } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { Action } from 'redux' import { fetchPendingClaim } from 'store/cache/claims/hooks' import { Status, Address } from 'types' import Audius from 'services/Audius' import { AppState } from 'store/types' import { fetchUser } from 'store/cache/user/hooks' +import { AnyAction } from '@reduxjs/toolkit' function claimAudiusRewards( wallet: Address, @@ -30,7 +31,7 @@ function claimAudiusRewards( export const useMakeClaim = (shouldReset?: boolean) => { const [status, setStatus] = useState() const [error, setError] = useState('') - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (shouldReset) { setStatus(undefined) diff --git a/protocol-dashboard/src/store/actions/modifyService.ts b/protocol-dashboard/src/store/actions/modifyService.ts index a7bba79ad42..975928ade4b 100644 --- a/protocol-dashboard/src/store/actions/modifyService.ts +++ b/protocol-dashboard/src/store/actions/modifyService.ts @@ -1,6 +1,6 @@ import { useState, useCallback, useEffect } from 'react' import { useDispatch } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { Action } from 'redux' import { Status, ServiceType, Address } from 'types' @@ -8,6 +8,7 @@ import Audius from 'services/Audius' import { AppState } from 'store/types' import { getDiscoveryProvider } from 'store/cache/discoveryProvider/hooks' import { getContentNode } from 'store/cache/contentNode/hooks' +import { AnyAction } from '@reduxjs/toolkit' function modifyAudiusService( serviceType: ServiceType, @@ -56,7 +57,7 @@ function modifyAudiusService( export const useModifyService = (shouldReset?: boolean) => { const [status, setStatus] = useState() const [error, setError] = useState('') - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (shouldReset) { setStatus(undefined) diff --git a/protocol-dashboard/src/store/actions/registerService.ts b/protocol-dashboard/src/store/actions/registerService.ts index 957ff9aa511..da52251f000 100644 --- a/protocol-dashboard/src/store/actions/registerService.ts +++ b/protocol-dashboard/src/store/actions/registerService.ts @@ -1,6 +1,6 @@ import { useState, useCallback, useEffect } from 'react' import { useDispatch } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { Action } from 'redux' import { Status, ServiceType, BigNumber, Address } from 'types' @@ -10,6 +10,7 @@ import { getAccountWallet } from 'store/account/hooks' import { fetchUser } from 'store/cache/user/hooks' import { getDiscoveryProvider } from 'store/cache/discoveryProvider/hooks' import { getContentNode } from 'store/cache/contentNode/hooks' +import { AnyAction } from '@reduxjs/toolkit' function registerAudiusService( serviceType: ServiceType, @@ -90,7 +91,7 @@ function registerAudiusService( export const useRegisterService = (shouldReset?: boolean) => { const [status, setStatus] = useState() const [error, setError] = useState('') - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (shouldReset) { setStatus(undefined) diff --git a/protocol-dashboard/src/store/actions/removeDelegator.ts b/protocol-dashboard/src/store/actions/removeDelegator.ts index ee59dd8171e..d3ad9b71e1f 100644 --- a/protocol-dashboard/src/store/actions/removeDelegator.ts +++ b/protocol-dashboard/src/store/actions/removeDelegator.ts @@ -1,12 +1,13 @@ import { useState, useCallback, useEffect } from 'react' import { useDispatch } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { Action } from 'redux' import { getAccountWallet, fetchPendingTransactions } from 'store/account/hooks' import { Status, Address } from 'types' import Audius from 'services/Audius' import { AppState } from 'store/types' +import { AnyAction } from '@reduxjs/toolkit' function removeAudiusDelegator( serviceProvider: Address, @@ -36,7 +37,7 @@ function removeAudiusDelegator( export const useRemoveDelegator = (shouldReset: boolean) => { const [status, setStatus] = useState() const [error, setError] = useState('') - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (shouldReset) { setStatus(undefined) diff --git a/protocol-dashboard/src/store/actions/submitTransaction.ts b/protocol-dashboard/src/store/actions/submitTransaction.ts index 29da0f9045e..e845a792ff2 100644 --- a/protocol-dashboard/src/store/actions/submitTransaction.ts +++ b/protocol-dashboard/src/store/actions/submitTransaction.ts @@ -1,6 +1,6 @@ import { useState, useCallback } from 'react' import { useDispatch } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { Action } from 'redux' import { PendingTransactionName, Status, Address } from 'types' @@ -8,6 +8,7 @@ import Audius from 'services/Audius' import { AppState } from 'store/types' import { fetchPendingTransactions, getAccountWallet } from 'store/account/hooks' import { fetchUser } from 'store/cache/user/hooks' +import { AnyAction } from '@reduxjs/toolkit' function decreaseStake( setStatus: (status: Status) => void, @@ -111,7 +112,7 @@ function removeDelegator( export const useSubmitTransaction = (name: PendingTransactionName) => { const [status, setStatus] = useState() const [error, setError] = useState('') - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() const submitTransaction = useCallback( (wallet?: Address) => { diff --git a/protocol-dashboard/src/store/actions/submitVote.ts b/protocol-dashboard/src/store/actions/submitVote.ts index ead4cacf4cd..7fadbe0c989 100644 --- a/protocol-dashboard/src/store/actions/submitVote.ts +++ b/protocol-dashboard/src/store/actions/submitVote.ts @@ -1,6 +1,6 @@ import { useState, useCallback, useEffect } from 'react' import { useDispatch } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { Action } from 'redux' import { Status, Vote } from 'types' @@ -8,6 +8,7 @@ import Audius from 'services/Audius' import { AppState } from 'store/types' import { fetchVotes } from 'store/cache/votes/hooks' import { fetchProposal } from 'store/cache/proposals/hooks' +import { AnyAction } from '@reduxjs/toolkit' function submitAudiusVote( proposalId: number, @@ -40,7 +41,7 @@ function submitAudiusVote( export const useSubmitVote = (shouldReset?: boolean) => { const [status, setStatus] = useState() const [error, setError] = useState('') - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (shouldReset) { diff --git a/protocol-dashboard/src/store/actions/undelegateStake.ts b/protocol-dashboard/src/store/actions/undelegateStake.ts index 48640293bc8..c2f0037eb8a 100644 --- a/protocol-dashboard/src/store/actions/undelegateStake.ts +++ b/protocol-dashboard/src/store/actions/undelegateStake.ts @@ -1,6 +1,7 @@ import { useState, useCallback, useEffect } from 'react' import { useDispatch } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' +import { AnyAction } from '@reduxjs/toolkit' import { Action } from 'redux' import BN from 'bn.js' @@ -36,7 +37,7 @@ export function undelegateAudiusStake( export const useUndelegateStake = (shouldReset?: boolean) => { const [status, setStatus] = useState() const [error, setError] = useState('') - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (shouldReset) { setStatus(undefined) diff --git a/protocol-dashboard/src/store/actions/updateDelegation.ts b/protocol-dashboard/src/store/actions/updateDelegation.ts index 88ba512f402..976ddd367a7 100644 --- a/protocol-dashboard/src/store/actions/updateDelegation.ts +++ b/protocol-dashboard/src/store/actions/updateDelegation.ts @@ -1,5 +1,9 @@ import { useState, useCallback, useEffect } from 'react' import { useDispatch } from 'react-redux' +import { ThunkDispatch } from 'redux-thunk' +import AppState from 'store/types' +import Audius from 'services/Audius' +import { AnyAction } from '@reduxjs/toolkit' import { Address, Status, BigNumber } from 'types' import { undelegateAudiusStake } from 'store/actions/undelegateStake' @@ -11,7 +15,7 @@ export const useUpdateDelegation = ( ) => { const [status, setStatus] = useState() const [error, setError] = useState('') - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (shouldReset) { setStatus(undefined) diff --git a/protocol-dashboard/src/store/actions/updateMinimumDelegationAmount.ts b/protocol-dashboard/src/store/actions/updateMinimumDelegationAmount.ts index 1ca855410e9..619381a7b1d 100644 --- a/protocol-dashboard/src/store/actions/updateMinimumDelegationAmount.ts +++ b/protocol-dashboard/src/store/actions/updateMinimumDelegationAmount.ts @@ -1,7 +1,7 @@ import BN from 'bn.js' import { useState, useCallback, useEffect } from 'react' import { useDispatch } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { Action } from 'redux' import { getAccountWallet } from 'store/account/hooks' import { fetchUser } from 'store/cache/user/hooks' @@ -9,6 +9,7 @@ import { fetchUser } from 'store/cache/user/hooks' import { Status } from 'types' import Audius from 'services/Audius' import { AppState } from 'store/types' +import { AnyAction } from '@reduxjs/toolkit' function updateMinimumDelegationAmount( amount: BN, @@ -43,7 +44,7 @@ function updateMinimumDelegationAmount( export const useUpdateMinimumDelegationAmount = (shouldReset?: boolean) => { const [status, setStatus] = useState() const [error, setError] = useState('') - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (shouldReset) { setStatus(undefined) diff --git a/protocol-dashboard/src/store/actions/updateOperatorCut.ts b/protocol-dashboard/src/store/actions/updateOperatorCut.ts index d0639d6ab4f..7655da881a6 100644 --- a/protocol-dashboard/src/store/actions/updateOperatorCut.ts +++ b/protocol-dashboard/src/store/actions/updateOperatorCut.ts @@ -39,7 +39,7 @@ function updateAudiusOperatorCut( export const useUpdateOperatorCut = (shouldReset?: boolean) => { const [status, setStatus] = useState() const [error, setError] = useState('') - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (shouldReset) { setStatus(undefined) diff --git a/protocol-dashboard/src/store/actions/updateStake.ts b/protocol-dashboard/src/store/actions/updateStake.ts index cad4a2504ae..7e4efa3cac1 100644 --- a/protocol-dashboard/src/store/actions/updateStake.ts +++ b/protocol-dashboard/src/store/actions/updateStake.ts @@ -1,6 +1,6 @@ import { useState, useCallback, useEffect } from 'react' import { useDispatch } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { Action } from 'redux' import { Status, BigNumber } from 'types' @@ -8,6 +8,7 @@ import Audius from 'services/Audius' import { AppState } from 'store/types' import { fetchPendingTransactions, getAccountWallet } from 'store/account/hooks' import { fetchUser } from 'store/cache/user/hooks' +import { AnyAction } from '@reduxjs/toolkit' function increaseAudiusStake( stakingAmount: BigNumber, @@ -58,7 +59,7 @@ function decreaseAudiusStake( export const useUpdateStake = (isIncrease: boolean, shouldReset?: boolean) => { const [status, setStatus] = useState() const [error, setError] = useState('') - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (shouldReset) { setStatus(undefined) diff --git a/protocol-dashboard/src/store/actions/userDelegation.ts b/protocol-dashboard/src/store/actions/userDelegation.ts index 162519a057d..20e30d6dd1b 100644 --- a/protocol-dashboard/src/store/actions/userDelegation.ts +++ b/protocol-dashboard/src/store/actions/userDelegation.ts @@ -1,13 +1,13 @@ import { useState, useEffect } from 'react' -import { Utils } from '@audius/sdk/dist/legacy.js' +import BN from 'bn.js' import { useUser } from 'store/cache/user/hooks' import { Address, BigNumber, Status, Operator } from 'types' export const useUserDelegation = (wallet: Address) => { const [status, setStatus] = useState() const [error, setError] = useState('') - const [min, setMin] = useState(Utils.toBN('0')) - const [max, setMax] = useState(Utils.toBN('0')) + const [min, setMin] = useState(new BN('0')) + const [max, setMax] = useState(new BN('0')) const { status: userStatus, user } = useUser({ wallet }) diff --git a/protocol-dashboard/src/store/api/hooks.ts b/protocol-dashboard/src/store/api/hooks.ts index 93b7c15f5ed..fe653a95083 100644 --- a/protocol-dashboard/src/store/api/hooks.ts +++ b/protocol-dashboard/src/store/api/hooks.ts @@ -2,6 +2,9 @@ import { useSelector, useDispatch } from 'react-redux' import { useQuery } from '@apollo/client' import { setDidError } from './slice' import { AppState } from 'store/types' +import { ThunkDispatch } from 'redux-thunk' +import Audius from 'services/Audius' +import { AnyAction } from '@reduxjs/toolkit' // -------------------------------- Selectors -------------------------------- export const getGraphAPI = (state: AppState) => state.api @@ -11,7 +14,7 @@ export const getDidGraphError = (state: AppState) => state.api.didError export const useGraphQuery: typeof useQuery = (...args) => { const result = useQuery(...args) const didError = useSelector(getDidGraphError) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() if (!result.loading && !didError && result.error) { dispatch(setDidError()) diff --git a/protocol-dashboard/src/store/cache/analytics/hooks.ts b/protocol-dashboard/src/store/cache/analytics/hooks.ts index 58de1417ef4..2abfea97029 100644 --- a/protocol-dashboard/src/store/cache/analytics/hooks.ts +++ b/protocol-dashboard/src/store/cache/analytics/hooks.ts @@ -1,5 +1,5 @@ import { useSelector, useDispatch } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { Action } from 'redux' import dayjs from 'dayjs' import duration from 'dayjs/plugin/duration' @@ -23,6 +23,7 @@ import { useAverageBlockTime, useEthBlockNumber } from '../protocol/hooks' import { weiAudToAud } from 'utils/numeric' import { ELECTRONIC_SUB_GENRES } from './genres' import { fetchWithLibs } from 'utils/fetch' +import { AnyAction } from '@reduxjs/toolkit' dayjs.extend(duration) const MONTH_IN_MS = dayjs.duration({ months: 1 }).asMilliseconds() @@ -386,7 +387,7 @@ export const useApiCalls = (bucket: Bucket) => { const apiCalls = useSelector(state => getApiCalls(state as AppState, { bucket }) ) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (doOnce !== bucket && (apiCalls === null || apiCalls === undefined)) { setDoOnce(bucket) @@ -410,7 +411,7 @@ export const useTotalStaked = (bucket: Bucket) => { ) const averageBlockTime = useAverageBlockTime() const currentBlockNumber = useEthBlockNumber() - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if ( doOnce !== bucket && @@ -442,7 +443,7 @@ export const useTotalStaked = (bucket: Bucket) => { export const usePlays = (bucket: Bucket) => { const [doOnce, setDoOnce] = useState(null) const plays = useSelector(state => getPlays(state as AppState, { bucket })) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (doOnce !== bucket && (plays === null || plays === undefined)) { setDoOnce(bucket) @@ -464,7 +465,7 @@ export const useTrailingApiCalls = (bucket: Bucket) => { const apiCalls = useSelector(state => getTrailingApiCalls(state as AppState, { bucket }) ) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (doOnce !== bucket && (apiCalls === null || apiCalls === undefined)) { setDoOnce(bucket) @@ -486,7 +487,7 @@ export const useTrailingTopGenres = (bucket: Bucket) => { const topGenres = useSelector(state => getTrailingTopGenres(state as AppState, { bucket }) ) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (doOnce !== bucket && (topGenres === null || topGenres === undefined)) { setDoOnce(bucket) @@ -540,7 +541,7 @@ export const useTopApps = ( ) => { const [hasFetched, setHasFetched] = useState(false) let topApps = useSelector(state => getTopApps(state as AppState, { bucket })) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if ( !hasFetched && diff --git a/protocol-dashboard/src/store/cache/claims/hooks.ts b/protocol-dashboard/src/store/cache/claims/hooks.ts index b6bd2668830..19988ad16ee 100644 --- a/protocol-dashboard/src/store/cache/claims/hooks.ts +++ b/protocol-dashboard/src/store/cache/claims/hooks.ts @@ -1,5 +1,5 @@ import { useSelector, useDispatch } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { Action } from 'redux' import { Address, Status } from 'types' @@ -12,6 +12,7 @@ import { setClaim, setClaimMetadata as setMetadata } from 'store/cache/claims/slice' +import { AnyAction } from '@reduxjs/toolkit' // -------------------------------- Selectors -------------------------------- export const getPendingClaim = (wallet: Address) => (state: AppState) => @@ -80,7 +81,7 @@ export function setClaimMetadata(): ThunkAction< export const usePendingClaim = (wallet: Address) => { const pendingClaim = useSelector(getPendingClaim(wallet)) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (wallet && !pendingClaim) { dispatch(fetchPendingClaim(wallet)) @@ -92,7 +93,7 @@ export const usePendingClaim = (wallet: Address) => { export const useFundsPerRound = () => { const fundsPerRound = useSelector(getFundsPerRound()) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (!fundsPerRound) { dispatch(setClaimMetadata()) @@ -104,7 +105,7 @@ export const useFundsPerRound = () => { export const useLastFundedBlock = () => { const lastFundedBlock = useSelector(getLastFundedBlock()) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (!lastFundedBlock) { dispatch(setClaimMetadata()) diff --git a/protocol-dashboard/src/store/cache/contentNode/hooks.ts b/protocol-dashboard/src/store/cache/contentNode/hooks.ts index bd362cfc487..37197a91747 100644 --- a/protocol-dashboard/src/store/cache/contentNode/hooks.ts +++ b/protocol-dashboard/src/store/cache/contentNode/hooks.ts @@ -1,6 +1,6 @@ import { useMemo, useState } from 'react' import { useSelector, useDispatch } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { Action } from 'redux' import semver from 'semver' @@ -16,6 +16,7 @@ import Audius from 'services/Audius' import { AppState } from 'store/types' import { setLoading, setNodes, setTotal } from './slice' import { useEffect } from 'react' +import { AnyAction } from '@reduxjs/toolkit' type UseContentNodesProps = { owner?: Address @@ -161,7 +162,7 @@ export const useContentNodes = ({ limit ]) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (!status) { dispatch(fetchContentNodes({ owner, sortBy, limit })) @@ -176,7 +177,7 @@ export const useContentNode = ({ spID }: UseContentNodeProps) => { const [status, setStatus] = useState(Status.Loading) const totalNodes = useSelector(getTotal) const node = useSelector(getNode(spID)) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (!node && typeof totalNodes !== 'number') { diff --git a/protocol-dashboard/src/store/cache/discoveryProvider/hooks.ts b/protocol-dashboard/src/store/cache/discoveryProvider/hooks.ts index 99da4a2fc3c..91d8af37bb8 100644 --- a/protocol-dashboard/src/store/cache/discoveryProvider/hooks.ts +++ b/protocol-dashboard/src/store/cache/discoveryProvider/hooks.ts @@ -1,6 +1,6 @@ import { useMemo, useState } from 'react' import { useSelector, useDispatch } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { Action } from 'redux' import semver from 'semver' @@ -16,6 +16,7 @@ import Audius from 'services/Audius' import { AppState } from 'store/types' import { setLoading, setNodes, setTotal } from './slice' import { useEffect } from 'react' +import { AnyAction } from '@reduxjs/toolkit' type UseDiscoveryProvidersProps = { owner?: Address @@ -178,7 +179,7 @@ export const useDiscoveryProviders = ({ limit ]) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (!status) { dispatch(fetchDiscoveryProviders()) @@ -193,7 +194,7 @@ export const useDiscoveryProvider = ({ spID }: UseDiscoveryProviderProps) => { const [status, setStatus] = useState(Status.Loading) const totalDpNodes = useSelector(getTotal) const dp = useSelector(getNode(spID)) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (!dp && typeof totalDpNodes !== 'number') { diff --git a/protocol-dashboard/src/store/cache/music/hooks.ts b/protocol-dashboard/src/store/cache/music/hooks.ts index d7c613c2879..d2c4673910b 100644 --- a/protocol-dashboard/src/store/cache/music/hooks.ts +++ b/protocol-dashboard/src/store/cache/music/hooks.ts @@ -1,6 +1,6 @@ import Audius from 'services/Audius' import { useSelector, useDispatch } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { Action } from 'redux' import AppState from 'store/types' import { Playlist, Track } from 'types' @@ -13,6 +13,7 @@ import { setTopTracks } from './slice' import { fetchWithLibs } from 'utils/fetch' +import { AnyAction } from '@reduxjs/toolkit' const AUDIUS_URL = import.meta.env.VITE_AUDIUS_URL @@ -114,7 +115,7 @@ export function fetchTopAlbums(): ThunkAction< export const useTopTracks = () => { const [doOnce, setDoOnce] = useState(false) const topTracks = useSelector(getTopTracks) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (!doOnce && !topTracks) { @@ -135,7 +136,7 @@ export const useTopTracks = () => { export const useTopPlaylists = () => { const [doOnce, setDoOnce] = useState(false) const topPlaylists = useSelector(getTopPlaylists) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (!doOnce && !topPlaylists) { @@ -156,7 +157,7 @@ export const useTopPlaylists = () => { export const useTopAlbums = () => { const [doOnce, setDoOnce] = useState(false) const topAlbums = useSelector(getTopAlbums) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (!doOnce && !topAlbums) { diff --git a/protocol-dashboard/src/store/cache/proposals/hooks.ts b/protocol-dashboard/src/store/cache/proposals/hooks.ts index 47ca4ff21f1..76ba162182c 100644 --- a/protocol-dashboard/src/store/cache/proposals/hooks.ts +++ b/protocol-dashboard/src/store/cache/proposals/hooks.ts @@ -1,5 +1,5 @@ import { useSelector, useDispatch } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { Action } from 'redux' import Audius from 'services/Audius' @@ -19,6 +19,7 @@ import { useTimeRemaining, useEthBlockNumber } from 'store/cache/protocol/hooks' +import { AnyAction } from '@reduxjs/toolkit' // -------------------------------- Selectors -------------------------------- export const getActiveProposals = (state: AppState) => @@ -179,7 +180,7 @@ export const useProposals = () => { const allProposals = useSelector(getAllProposals) const resolvedProposals = useSelector(getResolvedProposals) const recentProposals = useSelector(getRecentProposals) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (activeProposals === null) { @@ -202,7 +203,7 @@ export const useProposal = (proposalId: number) => { const proposal = useSelector(state => getProposal(state as AppState, { proposalId }) ) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (proposal === null || proposal === undefined) { dispatch(fetchProposal(proposalId)) @@ -214,7 +215,7 @@ export const useProposal = (proposalId: number) => { export const useVotingPeriod = () => { const votingPeriod = useSelector(getVotingPeriod) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (!votingPeriod) { dispatch(fetchVotingPeriod()) @@ -226,7 +227,7 @@ export const useVotingPeriod = () => { export const useExecutionDelay = () => { const executionDelay = useSelector(getExecutionDelay) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (!executionDelay) { dispatch(fetchExecutionDelay()) diff --git a/protocol-dashboard/src/store/cache/protocol/hooks.ts b/protocol-dashboard/src/store/cache/protocol/hooks.ts index 0dff08ac991..f3fa8f907db 100644 --- a/protocol-dashboard/src/store/cache/protocol/hooks.ts +++ b/protocol-dashboard/src/store/cache/protocol/hooks.ts @@ -1,5 +1,5 @@ import { useSelector, useDispatch } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { Action } from 'redux' import Audius from 'services/Audius' @@ -14,6 +14,7 @@ import { import { useEffect, useState, useRef } from 'react' import { ServiceType, Block } from 'types' import AudiusClient from 'services/Audius' +import { AnyAction } from '@reduxjs/toolkit' // -------------------------------- Selectors -------------------------------- export const getTotalStaked = (state: AppState) => @@ -115,7 +116,7 @@ export function fetchAverageBlockTime(): ThunkAction< export const useTotalStaked = () => { const totalStaked = useSelector(getTotalStaked) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (totalStaked === undefined) dispatch(fetchTotalStaked()) }, [dispatch, totalStaked]) @@ -125,7 +126,7 @@ export const useTotalStaked = () => { export const useServiceInfo = () => { const services = useSelector(getServiceInfo) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if ( services.discoveryProvider === undefined || @@ -140,7 +141,7 @@ export const useServiceInfo = () => { export const useProtocolDelegator = () => { const delegatorInfo = useSelector(getDelegatorInfo) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if ( delegatorInfo.maxDelegators === undefined || @@ -164,7 +165,7 @@ export const useDispatchBasedOnBlockNumber = ( ) => { const didMount = useRef(false) const ethBlockNumber = useEthBlockNumber() - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (didMount.current && ethBlockNumber && ethBlockNumber % mod === 0) { actions.forEach(action => { @@ -236,7 +237,7 @@ export const useTimeRemaining = (block: number, period: number | null) => { } export const useInit = () => { - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { dispatch(fetchServiceStakeValues()) dispatch(fetchProtocolDelegation()) diff --git a/protocol-dashboard/src/store/cache/rewards/hooks.ts b/protocol-dashboard/src/store/cache/rewards/hooks.ts index 7d53a088f01..7de202e3735 100644 --- a/protocol-dashboard/src/store/cache/rewards/hooks.ts +++ b/protocol-dashboard/src/store/cache/rewards/hooks.ts @@ -1,5 +1,5 @@ import { useSelector, useDispatch } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { Action } from 'redux' import BN from 'bn.js' @@ -17,6 +17,7 @@ import { useEthBlockNumber } from 'store/cache/protocol/hooks' import { useUsers } from 'store/cache/user/hooks' import { fetchWeeklyRewards, setWeeklyRewards } from 'store/cache/rewards/slice' import { getRewardForClaimBlock } from './helpers' +import { AnyAction } from '@reduxjs/toolkit' // -------------------------------- Selectors -------------------------------- export const getUserRewards = (wallet: Address) => (state: AppState) => @@ -78,7 +79,7 @@ export const useUserWeeklyRewards = ({ wallet }: { wallet: Address }) => { const { status: usersStatus, users } = useUsers() const { status: claimStatus, hasClaim } = usePendingClaim(wallet) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { const hasInfo = [ fundsStatus, diff --git a/protocol-dashboard/src/store/cache/timeline/hooks.ts b/protocol-dashboard/src/store/cache/timeline/hooks.ts index b3925beb19b..c4c38da9614 100644 --- a/protocol-dashboard/src/store/cache/timeline/hooks.ts +++ b/protocol-dashboard/src/store/cache/timeline/hooks.ts @@ -1,5 +1,5 @@ import { useSelector, useDispatch } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { Action } from 'redux' import Audius from 'services/Audius' @@ -10,6 +10,7 @@ import { Address } from 'types' import { useDispatchBasedOnBlockNumber } from '../protocol/hooks' import { useUsers } from 'store/cache/user/hooks' import { TimelineEvent } from 'models/TimelineEvents' +import { AnyAction } from '@reduxjs/toolkit' const getFirstEvent = (...events: TimelineEvent[]) => { let min = Number.MAX_SAFE_INTEGER @@ -141,7 +142,7 @@ export const useTimeline = (wallet: Address, timelineType: TimelineType) => { getTimeline(state as AppState, { wallet }) ) // const ethBlockNumber = useEthBlockNumber() - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() // Temporary fix // The users from the timeline events need to be fetched, but the fetchUsers method diff --git a/protocol-dashboard/src/store/cache/user/graph/formatter.ts b/protocol-dashboard/src/store/cache/user/graph/formatter.ts index 266d17e9bc0..767e11d268a 100644 --- a/protocol-dashboard/src/store/cache/user/graph/formatter.ts +++ b/protocol-dashboard/src/store/cache/user/graph/formatter.ts @@ -7,25 +7,39 @@ export const formatUser = async ( aud: Audius, user: FullUser ): Promise => { - const userWallet = aud.toChecksumAddress(user.id) + const userWallet = await aud.toChecksumAddress(user.id) + + const delegates = user.delegateTo + ? await Promise.all( + user.delegateTo.map(async delegate => { + return { + wallet: await aud.toChecksumAddress(delegate.toUser.id), + amount: new BN(delegate.amount), + activeAmount: new BN(delegate.claimableAmount) + } + }) + ) + : [] + + const voteHistory = await Promise.all( + user.votes.map(async vote => { + return { + proposalId: parseInt(vote.proposal.id), + voter: await aud.toChecksumAddress(user.id), + voterStake: new BN(vote.magnitude), + blockNumber: parseInt(vote.updatedBlockNumber), + vote: vote.vote + } + }) + ) + let formattedUser: User = { wallet: userWallet, audToken: new BN(user.balance), totalDelegatorStake: new BN(user.delegationSentAmount), - delegates: - user.delegateTo?.map((delegate, i) => ({ - wallet: aud.toChecksumAddress(delegate.toUser.id), - amount: new BN(delegate.amount), - activeAmount: new BN(delegate.claimableAmount) - })) ?? [], + delegates: delegates, events: [], - voteHistory: user.votes.map(vote => ({ - proposalId: parseInt(vote.proposal.id), - voter: aud.toChecksumAddress(user.id), - voterStake: new BN(vote.magnitude), - blockNumber: parseInt(vote.updatedBlockNumber), - vote: vote.vote - })), + voteHistory: voteHistory, pendingUndelegateRequest: user.pendingUndelegateStake ? { amount: new BN(user.pendingUndelegateStake.amount), @@ -73,15 +87,22 @@ export const formatUser = async ( } } + const delegators = user.delegateFrom + ? await Promise.all( + user.delegateFrom.map(async delegate => { + return { + wallet: await aud.toChecksumAddress(delegate.fromUser.id), + amount: new BN(delegate.amount), + activeAmount: new BN(delegate.claimableAmount) + } + }) + ) + : [] + return { ...formattedUser, serviceProvider, - delegators: - user.delegateFrom?.map((delegate, i) => ({ - wallet: aud.toChecksumAddress(delegate.fromUser.id), - amount: new BN(delegate.amount), - activeAmount: new BN(delegate.claimableAmount) - })) ?? [], + delegators: delegators, totalStakedFor: new BN(user.stakeAmount).add( new BN(user.delegationReceivedAmount) ), diff --git a/protocol-dashboard/src/store/cache/user/graph/hooks.ts b/protocol-dashboard/src/store/cache/user/graph/hooks.ts index ad3f15a4a3a..f8ed7068a3e 100644 --- a/protocol-dashboard/src/store/cache/user/graph/hooks.ts +++ b/protocol-dashboard/src/store/cache/user/graph/hooks.ts @@ -1,5 +1,5 @@ import { useDispatch, useSelector } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { Action } from 'redux' import { Status, User, Operator } from 'types' import Audius from 'services/Audius' @@ -10,6 +10,7 @@ import { FullUser, UsersData, UsersVars, UserData, UserVars } from './types' import { getGraphAPI, useGraphQuery as useQuery } from 'store/api/hooks' import { formatUser } from './formatter' import { GET_USERS, GET_USER } from './queries' +import { AnyAction } from '@reduxjs/toolkit' // Async function to get function populateUsers( @@ -55,7 +56,7 @@ export const useUsers = (status: Status | undefined) => { } } ) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (status !== Status.Loading && status !== Status.Success && gqlData) { dispatch(populateUsers(gqlData.users)) @@ -90,7 +91,7 @@ export const useUser = ( useEffect(() => { setDidFetch(false) }, [wallet, setDidFetch]) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (!didFetch && !hasUser && gqlData) { setDidFetch(true) diff --git a/protocol-dashboard/src/store/cache/user/hooks.ts b/protocol-dashboard/src/store/cache/user/hooks.ts index b3b2ec76560..62b633933b5 100644 --- a/protocol-dashboard/src/store/cache/user/hooks.ts +++ b/protocol-dashboard/src/store/cache/user/hooks.ts @@ -1,8 +1,7 @@ import { useState } from 'react' import { useSelector, useDispatch } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { Action } from 'redux' -import { Utils } from '@audius/sdk/dist/legacy.js' import BN from 'bn.js' import { Address, @@ -34,6 +33,7 @@ import { useUsers as useGraphUsers } from './graph/hooks' import { getUserProfile } from 'services/SelfId' +import { AnyAction } from '@reduxjs/toolkit' type UseUsersProp = { sortBy?: SortUser @@ -330,7 +330,7 @@ export const useUsers = ({ limit, sortBy, filter }: UseUsersProp = {}) => { const { error } = useGraphUsers(status) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (error && !status) { dispatch(fetchUsers()) @@ -360,7 +360,7 @@ export const useUser = ({ wallet }: UseUserProps): UseUserResponse => { const { error } = useGraphUser(wallet, setStatus, !!user) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (error && !user && status !== Status.Failure) { dispatch(fetchUser(wallet, setStatus)) @@ -401,11 +401,11 @@ type UseTotalDelegatesProps = { wallet: Address } export const useTotalDelegates = ({ wallet }: UseTotalDelegatesProps) => { const { status, user } = useUser({ wallet }) if (status !== Status.Success || !user) { - return { status, totalDelegates: Utils.toBN('0') } + return { status, totalDelegates: new BN('0') } } let totalDelegates = user.delegates.reduce( (total, delegate) => total.add(delegate.amount), - Utils.toBN('0') + new BN('0') ) return { status, totalDelegates } } @@ -414,15 +414,15 @@ export const useTotalDelegates = ({ wallet }: UseTotalDelegatesProps) => { export const useActiveInboundDelegation = ({ wallet }: { wallet: Address }) => { const { status, user } = useUser({ wallet }) if (status !== Status.Success || !user) { - return { status, amount: Utils.toBN('0') } + return { status, amount: new BN('0') } } let totalDelegated = (user as Operator).delegators - if (!totalDelegated) return { status, amount: Utils.toBN('0') } + if (!totalDelegated) return { status, amount: new BN('0') } const totalInboundDelegation = (user as Operator).delegators.reduce( (total, delegator) => total.add(delegator.activeAmount), - Utils.toBN('0') + new BN('0') ) return { status, amount: totalInboundDelegation } } @@ -434,13 +434,13 @@ type UseUserDelegates = { wallet: Address } export const useUserDelegates = ({ wallet }: UseUserDelegates) => { const { status, user } = useAccountUser() if (status !== Status.Success || !user) { - return { status: status || Status.Loading, delegates: Utils.toBN('0') } + return { status: status || Status.Loading, delegates: new BN('0') } } let userDelegates = user.delegates.find(d => d.wallet === wallet) if (userDelegates) { return { status: Status.Success, delegates: userDelegates.amount } } - return { status: Status.Success, delegates: Utils.toBN('0') } + return { status: Status.Success, delegates: new BN('0') } } const inFlight = new Set
([]) @@ -448,7 +448,7 @@ type UseUserProfile = { wallet: Address } export const useUserProfile = ({ wallet }: UseUserProfile) => { const { user } = useUser({ wallet }) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (user && !inFlight.has(wallet)) { inFlight.add(wallet) diff --git a/protocol-dashboard/src/store/cache/votes/hooks.ts b/protocol-dashboard/src/store/cache/votes/hooks.ts index f1244e36805..5c844d82775 100644 --- a/protocol-dashboard/src/store/cache/votes/hooks.ts +++ b/protocol-dashboard/src/store/cache/votes/hooks.ts @@ -1,5 +1,5 @@ import { useSelector, useDispatch } from 'react-redux' -import { ThunkAction } from 'redux-thunk' +import { ThunkAction, ThunkDispatch } from 'redux-thunk' import { Action } from 'redux' import Audius from 'services/Audius' @@ -8,6 +8,7 @@ import { useEffect } from 'react' import { setVotes, setUserVote } from './slice' import { Vote, VoteEvent } from 'types' import { useDispatchBasedOnBlockNumber } from '../protocol/hooks' +import { AnyAction } from '@reduxjs/toolkit' // -------------------------------- Selectors -------------------------------- @@ -79,7 +80,7 @@ export const useVotes = (proposalId: number) => { const votesAgainst = useSelector(state => getVotesAgainst(state as AppState, { proposalId }) ) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (votes === null || votes === undefined) { dispatch(fetchVotes(proposalId)) @@ -95,7 +96,7 @@ export const useUserVote = (proposalId: number) => { const userVote = useSelector(state => getUserVote(state as AppState, { proposalId }) ) - const dispatch = useDispatch() + const dispatch: ThunkDispatch = useDispatch() useEffect(() => { if (userVote === null || userVote === undefined) { diff --git a/protocol-dashboard/src/store/index.ts b/protocol-dashboard/src/store/index.ts index 83a1cbf8877..a60e6584e1e 100644 --- a/protocol-dashboard/src/store/index.ts +++ b/protocol-dashboard/src/store/index.ts @@ -3,17 +3,9 @@ import { InMemoryCache, NormalizedCacheObject } from '@apollo/client' -import { - combineReducers, - createStore as createReduxStore, - applyMiddleware -} from 'redux' -import { connectRouter } from 'connected-react-router' -import { composeWithDevTools } from 'redux-devtools-extension' -import { routerMiddleware } from 'connected-react-router' -import { History } from 'history' +import { configureStore } from '@reduxjs/toolkit' +import { combineReducers } from 'redux' import Audius from 'services/Audius' -import thunk from 'redux-thunk' import discoveryProvider from './cache/discoveryProvider/slice' import contentNode from './cache/contentNode/slice' import protocol from './cache/protocol/slice' @@ -26,7 +18,6 @@ import claims from './cache/claims/slice' import analytics from './cache/analytics/slice' import music from './cache/music/slice' import account from './account/slice' -import pageHistory from './pageHistory/slice' import api from './api/slice' declare global { @@ -70,36 +61,32 @@ aud.setup() window.client = client -const getReducer = (history: History) => { - return combineReducers({ - router: connectRouter(history), - pageHistory, - account, - api, - cache: combineReducers({ - discoveryProvider, - contentNode, - protocol, - user, - proposals, - votes, - timeline, - claims, - analytics, - music, - rewards - }) +export const createStore = () => { + const store = configureStore({ + reducer: combineReducers({ + account, + api, + cache: combineReducers({ + discoveryProvider, + contentNode, + protocol, + user, + proposals, + votes, + timeline, + claims, + analytics, + music, + rewards + }) + }), + middleware: getDefaultMiddleware => + getDefaultMiddleware({ + thunk: { + extraArgument: aud + } + }) }) -} - -const getMiddlewares = (history: History) => - applyMiddleware(routerMiddleware(history), thunk.withExtraArgument(aud)) - -export const createStore = (history: History) => { - const composeEnhancers = composeWithDevTools({ trace: true, traceLimit: 25 }) - const storeReducer = getReducer(history) - const middlewares = getMiddlewares(history) - let store = createReduxStore(storeReducer, composeEnhancers(middlewares)) window.store = store return store } diff --git a/protocol-dashboard/src/store/pageHistory/hooks.ts b/protocol-dashboard/src/store/pageHistory/hooks.ts deleted file mode 100644 index 73ac07a0f7d..00000000000 --- a/protocol-dashboard/src/store/pageHistory/hooks.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { useSelector } from 'react-redux' -import { AppState } from 'store/types' - -// -------------------------------- Selectors -------------------------------- -export const getPageTitle = (state: AppState) => state.pageHistory.pageTitles - -// -------------------------------- Hooks -------------------------------- -export const useLastPage = () => { - const pageTitles = useSelector(getPageTitle) - if (pageTitles.length > 1) return pageTitles[pageTitles.length - 2] - return null -} diff --git a/protocol-dashboard/src/store/pageHistory/slice.ts b/protocol-dashboard/src/store/pageHistory/slice.ts deleted file mode 100644 index 9e198029ddb..00000000000 --- a/protocol-dashboard/src/store/pageHistory/slice.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { LOCATION_CHANGE } from 'connected-react-router' -import { getPageTitleFromRoute } from 'utils/routes' - -export type State = { - pageTitles: Array -} - -const initState = { - pageTitles: [] -} - -export const reducer = (state: State = initState, action: any) => { - if (action.type === LOCATION_CHANGE) { - const title = getPageTitleFromRoute(action.payload.location.pathname) - if (title && action.payload.action === 'POP') { - const len = state.pageTitles.length - if (len === 0) { - state.pageTitles = [...state.pageTitles, title] - } else { - state.pageTitles = state.pageTitles.filter((_, idx) => idx !== len - 1) - } - } else if (title && action.payload.action === 'PUSH') { - state.pageTitles = [...state.pageTitles, title] - } else if (title && action.payload.action === 'REPLACE') { - state.pageTitles = [...state.pageTitles] - state.pageTitles[state.pageTitles.length - 1] = title - } - } - return state -} - -export default reducer diff --git a/protocol-dashboard/src/store/types.ts b/protocol-dashboard/src/store/types.ts index b394fe7bdd5..7a1a16f5e38 100644 --- a/protocol-dashboard/src/store/types.ts +++ b/protocol-dashboard/src/store/types.ts @@ -1,4 +1,3 @@ -import { RouterState } from 'connected-react-router' import { State as DiscoveryProviderState } from 'store/cache/discoveryProvider/slice' import { State as ContentNodeState } from 'store/cache/contentNode/slice' import { State as ProtocolState } from 'store/cache/protocol/slice' @@ -7,7 +6,6 @@ import { State as AccountState } from 'store/account/slice' import { State as ProposalsState } from 'store/cache/proposals/slice' import { State as VotesState } from 'store/cache/votes/slice' import { State as TimelineState } from 'store/cache/timeline/slice' -import { State as PageHistoryState } from 'store/pageHistory/slice' import { State as ClaimsState } from 'store/cache/claims/slice' import { State as AnalyticsState } from 'store/cache/analytics/slice' import { State as MusicState } from 'store/cache/music/slice' @@ -15,8 +13,6 @@ import { State as RewardsState } from 'store/cache/rewards/slice' import { State as APIState } from 'store/api/slice' export type AppState = { - router: RouterState - pageHistory: PageHistoryState account: AccountState api: APIState cache: { diff --git a/protocol-dashboard/src/utils/activeStake.ts b/protocol-dashboard/src/utils/activeStake.ts index 7515eb1246d..3ba2eeb8a66 100644 --- a/protocol-dashboard/src/utils/activeStake.ts +++ b/protocol-dashboard/src/utils/activeStake.ts @@ -1,4 +1,3 @@ -import { Utils } from '@audius/sdk/dist/legacy.js' import { Operator, User } from 'types' import BN from 'bn.js' @@ -13,8 +12,8 @@ import BN from 'bn.js' */ export const getActiveStake = (user: User | Operator) => { - let activeDeployerStake: BN = Utils.toBN('0') - let activeDelegatorStake: BN = Utils.toBN('0') + let activeDeployerStake: BN = new BN('0') + let activeDelegatorStake: BN = new BN('0') if ('serviceProvider' in user) { const { deployerStake } = user.serviceProvider const { @@ -39,7 +38,7 @@ export const getActiveStake = (user: User | Operator) => { } export const getTotalActiveDelegatedStake = (user: User | Operator) => { - let total: BN = Utils.toBN('0') + let total: BN = new BN('0') if ('delegators' in user) { for (const delegator of user.delegators) { total = total.add(delegator.activeAmount) diff --git a/protocol-dashboard/src/utils/effects.ts b/protocol-dashboard/src/utils/effects.ts index c944fd85607..5959c85af01 100644 --- a/protocol-dashboard/src/utils/effects.ts +++ b/protocol-dashboard/src/utils/effects.ts @@ -1,18 +1,14 @@ -import { useDispatch } from 'react-redux' -import { push as pushRoute, goBack, replace } from 'connected-react-router' +import { useNavigate } from 'react-router-dom' import { useCallback } from 'react' export const usePushRoute = () => { - const dispatch = useDispatch() - return useCallback((route: string) => dispatch(pushRoute(route)), [dispatch]) -} - -export const useBackRoute = () => { - const dispatch = useDispatch() - return useCallback(() => dispatch(goBack()), [dispatch]) + const navigate = useNavigate() + return useCallback((route: string) => navigate(route), [navigate]) } export const useReplaceRoute = () => { - const dispatch = useDispatch() - return useCallback((route: string) => dispatch(replace(route)), [dispatch]) + const navigate = useNavigate() + return useCallback((route: string) => navigate(route, { replace: true }), [ + navigate + ]) } diff --git a/protocol-dashboard/src/utils/format.ts b/protocol-dashboard/src/utils/format.ts index d849176c24a..c658aa40a75 100644 --- a/protocol-dashboard/src/utils/format.ts +++ b/protocol-dashboard/src/utils/format.ts @@ -1,7 +1,6 @@ import numeral from 'numeral' import dayjs from 'dayjs' import duration from 'dayjs/plugin/duration' -import { Utils } from '@audius/sdk/dist/legacy.js' import { Address } from 'types' import AudiusClient from 'services/Audius' import { TICKER } from './consts' @@ -63,20 +62,20 @@ export const formatShortWallet = (wallet: Address) => { * @param {BN} amount */ export const formatAud = (amount: BN | null) => { - if (!Utils.isBN(amount as any)) return '' - let aud = (amount as BN).div(Utils.toBN('1000000000000000000')).toString() + if (!BN.isBN(amount as any)) return '' + let aud = (amount as BN).div(new BN('1000000000000000000')).toString() aud = numeral(aud).format('0,0') return aud } export const formatWeiNumber = (amount: BN | null) => { - if (!Utils.isBN(amount as any)) return '' + if (!BN.isBN(amount as any)) return '' let aud = formatNumberCommas(AudiusClient.getAud(amount as BN)) return aud } export const formatWei = (amount: BN | null) => { - if (!Utils.isBN(amount as any)) return '' + if (!BN.isBN(amount as any)) return '' let aud = formatNumberCommas(AudiusClient.getAud(amount as BN)) return `${aud} ${TICKER}` } @@ -99,7 +98,7 @@ export const leftPadZero = (number: number, desiredLength: number) => { export const formatShortAud = (amount: BN | null) => { if (!amount) return '' - let aud = amount.div(Utils.toBN('1000000000000000000')).toNumber() + let aud = amount.div(new BN('1000000000000000000')).toNumber() if (aud >= 1000) { const countStr = aud.toString() if (countStr.length % 3 === 0) { diff --git a/protocol-dashboard/src/utils/numeric.ts b/protocol-dashboard/src/utils/numeric.ts index 71aba9c4a41..a64d4fc9092 100644 --- a/protocol-dashboard/src/utils/numeric.ts +++ b/protocol-dashboard/src/utils/numeric.ts @@ -1,5 +1,4 @@ import BN from 'bn.js' -import { Utils } from '@audius/sdk/dist/legacy.js' import AudiusClient from 'services/Audius' export const WEI = new BN('1000000000000000000') @@ -24,11 +23,9 @@ export const convertFloatToWei = (number: string) => { const nums = number.split('.') if (nums.length !== 2) return null if (!checkOnlyNumeric(nums[0]) || !checkOnlyNumeric(nums[1])) return null - let aud = Utils.toBN(nums[0]).mul(Utils.toBN('1000000000000000000')) + let aud = new BN(nums[0]).mul(new BN('1000000000000000000')) const weiMultiplier = 18 - nums[1].length - let wei = Utils.toBN(nums[1]).mul( - Utils.toBN('1'.padEnd(weiMultiplier + 1, '0')) - ) + let wei = new BN(nums[1]).mul(new BN('1'.padEnd(weiMultiplier + 1, '0'))) return aud.add(wei) } @@ -38,7 +35,7 @@ export const checkWeiNumber = (number: string) => { export const parseWeiNumber = (number: string) => { if (checkOnlyNumeric(number)) { - return AudiusClient.getWei(Utils.toBN(number)) + return AudiusClient.getWei(new BN(number)) } else if (checkOnlyWeiFloat(number)) { return convertFloatToWei(number) } diff --git a/protocol-dashboard/src/utils/routes.ts b/protocol-dashboard/src/utils/routes.ts index d7d212dda3f..06c507fffcb 100644 --- a/protocol-dashboard/src/utils/routes.ts +++ b/protocol-dashboard/src/utils/routes.ts @@ -1,4 +1,4 @@ -import { matchPath } from 'react-router-dom' +import { useLocation } from 'react-router-dom' /** * All Routes for the Audius Protocol Dashboard @@ -86,64 +86,31 @@ export const proposalPage = (proposalId: number) => { return `${GOVERNANCE}/proposal/${proposalId}` } -const routes = [ - { matchParams: { path: HOME, exact: true }, title: HOME_TITLE }, - { matchParams: { path: ANALYTICS, exact: true }, title: ANALYTICS_TITLE }, - { - matchParams: { path: SERVICES_DISCOVERY_PROVIDER, exact: true }, - title: SERVICES_DISCOVERY_PROVIDER_TITLE - }, - { matchParams: { path: SERVICES, exact: true }, title: 'SERVICES' }, - { matchParams: { path: GOVERNANCE, exact: true }, title: GOVERNANCE_TITLE }, - { - matchParams: { path: GOVERNANCE_PROPOSAL, exact: true }, - title: GOVERNANCE_TITLE - }, - { - matchParams: { path: SERVICES_USERS, exact: true }, - title: SERVICES_USERS_TITLE - }, - { - matchParams: { path: SERVICES_ACCOUNT_USER, exact: true }, - title: SERVICES_ACCOUNT_USER_TITLE - }, - { - matchParams: { path: SERVICES_ACCOUNT_OPERATOR, exact: true }, - title: SERVICES_ACCOUNT_OPERATOR_TITLE - }, - { - matchParams: { path: SERVICES_SERVICE_PROVIDERS, exact: true }, - title: SERVICES_SERVICE_PROVIDERS_TITLE - }, - { - matchParams: { path: SERVICES_CONTENT_NODE, exact: true }, - title: SERVICES_CONTENT_NODE_TITLE - }, - { - matchParams: { path: SERVICES_CONTENT, exact: true }, - title: SERVICES_CONTENT_TITLE - }, - { - matchParams: { path: SERVICES_DISCOVERY_PROVIDER_NODE, exact: true }, - title: SERVICES_DISCOVERY_PROVIDER_NODE_TITLE - }, - { matchParams: { path: SERVICES, exact: true }, title: SERVICES_TITLE }, - { - matchParams: { path: API, exact: true }, - title: API_TITLE - }, - { - matchParams: { path: API_LEADERBOARD, exact: true }, - title: API_LEADERBOARD_TITLE - } -] - -export const getPageTitleFromRoute = (route: string) => { - const path = routes.find(rt => !!matchPath(route, rt.matchParams)) - if (path) { - return path.title - } - // If no routes matched, the 404 page was reached. +const routeTitles = { + [HOME]: HOME_TITLE, + [ANALYTICS]: ANALYTICS_TITLE, + [SERVICES_DISCOVERY_PROVIDER]: SERVICES_DISCOVERY_PROVIDER_TITLE, + [SERVICES]: SERVICES_TITLE, + [GOVERNANCE]: GOVERNANCE_TITLE, + [GOVERNANCE_PROPOSAL]: GOVERNANCE_TITLE, + [SERVICES_USERS]: SERVICES_USERS_TITLE, + [SERVICES_ACCOUNT_USER]: SERVICES_ACCOUNT_USER_TITLE, + [SERVICES_ACCOUNT_OPERATOR]: SERVICES_ACCOUNT_OPERATOR_TITLE, + [SERVICES_SERVICE_PROVIDERS]: SERVICES_SERVICE_PROVIDERS_TITLE, + [SERVICES_CONTENT_NODE]: SERVICES_CONTENT_NODE_TITLE, + [SERVICES_CONTENT]: SERVICES_CONTENT_TITLE, + [SERVICES_DISCOVERY_PROVIDER_NODE]: SERVICES_DISCOVERY_PROVIDER_NODE_TITLE, + [API]: API_TITLE, + [API_LEADERBOARD]: API_LEADERBOARD_TITLE +} + +export const getPageTitle = (route: string) => { + return routeTitles[route] // If no routes matched, the 404 page was reached +} + +export const usePageTitle = () => { + const location = useLocation() + return getPageTitle(location.pathname) } export const isCryptoPage = (route: string) => {