diff --git a/.env b/.env index 08e50b212..1b07abd52 100644 --- a/.env +++ b/.env @@ -14,6 +14,8 @@ REACT_APP_COINGECKO_IMMUTABLE_URL="https://tokens.coingecko.com/immutable/all.js REACT_APP_COINGECKO_DOGE_URL="https://tokens.coingecko.com/dogechain/all.json" REACT_APP_COINGECKO_ASTAR_URL="https://tokens.coingecko.com/astar/all.json" REACT_APP_COINGECKO_KAVA_URL="https://tokens.coingecko.com/kava/all.json" +REACT_APP_COINGECKO_ETHEREUM_URL="https://tokens.coingecko.com/ethereum/all.json" + REACT_APP_STAKING_LIST_DEFAULT_URL="https://unpkg.com/quickswap-default-staking-list-address@latest/build/quickswap-default.lpfarms.json" REACT_APP_DUAL_STAKING_LIST_DEFAULT_URL="https://unpkg.com/quickswap-default-staking-list-address@latest/build/quickswap-default.dualfarms.json" REACT_APP_SYRUP_LIST_DEFAULT_URL="https://unpkg.com/quickswap-default-staking-list-address@latest/build/quickswap-default.syrups.json" diff --git a/package-lock.json b/package-lock.json index 67df0e622..5a2e39c16 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,8 +21,9 @@ "@material-ui/icons": "^4.11.2", "@material-ui/lab": "^4.0.0-alpha.60", "@material-ui/styles": "^4.11.5", - "@orbs-network/twap-ui": "^0.10.23", - "@orbs-network/twap-ui-quickswap": "^0.10.23", + "@orbs-network/liquidity-hub-sdk": "^1.0.40", + "@orbs-network/swap-ui": "^0.0.14", + "@orbs-network/twap-sdk": "^2.0.33", "@orderly.network/hooks": "^1.4.3", "@orderly.network/react": "^1.4.3", "@orderly.network/types": "^1.4.3", @@ -45,7 +46,8 @@ "react-tradingview-embed": "^3.0.6", "react-virtuoso": "^4.1.0", "sass": "^1.77.1", - "slick-carousel": "^1.8.1" + "slick-carousel": "^1.8.1", + "web3": "^1.7.1" }, "devDependencies": { "@ethersproject/experimental": "^5.4.0", @@ -5198,26 +5200,6 @@ "node": ">=16.0.0" } }, - "node_modules/@cspotcode/source-map-support": { - "version": "0.8.1", - "license": "MIT", - "optional": true, - "dependencies": { - "@jridgewell/trace-mapping": "0.3.9" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { - "version": "0.3.9", - "license": "MIT", - "optional": true, - "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" - } - }, "node_modules/@csstools/normalize.css": { "version": "12.1.1", "resolved": "https://registry.npmjs.org/@csstools/normalize.css/-/normalize.css-12.1.1.tgz", @@ -5603,224 +5585,6 @@ "ms": "^2.1.1" } }, - "node_modules/@defi.org/chai-bignumber": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@defi.org/chai-bignumber/-/chai-bignumber-3.0.2.tgz", - "integrity": "sha512-zu0LUJUZrSE30isl91K7NoTSxe6EUtFrLiiTtEoUkCrowRjeUw+U3lg4Vs5WNmc2QurZvHrVPbGRF+9S9Tu8Kw==", - "optional": true, - "peerDependencies": { - "bignumber.js": "*" - } - }, - "node_modules/@defi.org/web3-candies": { - "version": "4.20.4", - "resolved": "https://registry.npmjs.org/@defi.org/web3-candies/-/web3-candies-4.20.4.tgz", - "integrity": "sha512-f9lm1pzNQj6zYZg6WdMX6oufzO3jThjjA8odqVDsSY5XF9I3fLh9Ttam3O8Beknr+uhU2bmJt0ZB3YhWzBXkRQ==", - "dependencies": { - "@types/lodash": "4.x", - "@uniswap/permit2-sdk": "1.x", - "bignumber.js": "9.x", - "debug": "4.x", - "ethereum-multicall": "2.x", - "isomorphic-fetch": "3.x", - "lodash": "4.x", - "prettier": "2.x", - "prettier-plugin-solidity": "latest", - "web3": "1.x" - }, - "optionalDependencies": { - "@defi.org/chai-bignumber": "3.x", - "@nomiclabs/hardhat-etherscan": "3.x", - "@nomiclabs/hardhat-web3": "2.x", - "@openzeppelin/contracts": "4.x", - "@typechain/hardhat": "6.x", - "@typechain/web3-v1": "6.x", - "@types/chai": "4.x", - "@types/fs-extra": "11.x", - "@types/mocha": "10.x", - "@types/node": "18.x", - "@types/prompts": "2.x", - "chai": "4.x", - "dotenv": "16.x", - "fs-extra": "11.x", - "hardhat": "2.x", - "hardhat-gas-reporter": "1.x", - "hardhat-spdx-license-identifier": "2.x", - "hardhat-tracer": "1.x", - "mocha": "10.x", - "patch-package": "7.x", - "prompts": "2.x", - "sinon": "^17.0.1", - "solhint": "3.x", - "ts-generator": "0.1.x", - "ts-node": "10.x", - "typechain": "8.x", - "typescript": "4.x" - } - }, - "node_modules/@defi.org/web3-candies/node_modules/@sinonjs/commons": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", - "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", - "optional": true, - "dependencies": { - "type-detect": "4.0.8" - } - }, - "node_modules/@defi.org/web3-candies/node_modules/@sinonjs/fake-timers": { - "version": "11.2.2", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-11.2.2.tgz", - "integrity": "sha512-G2piCSxQ7oWOxwGSAyFHfPIsyeJGXYtc6mFbnFA+kRXkiEnTl8c/8jul2S329iFBnDI9HGoeWWAZvuvOkZccgw==", - "optional": true, - "dependencies": { - "@sinonjs/commons": "^3.0.0" - } - }, - "node_modules/@defi.org/web3-candies/node_modules/@sinonjs/samsam": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-8.0.0.tgz", - "integrity": "sha512-Bp8KUVlLp8ibJZrnvq2foVhP0IVX2CIprMJPK0vqGqgrDa0OHVKeZyBykqskkrdxV6yKBPmGasO8LVjAKR3Gew==", - "optional": true, - "dependencies": { - "@sinonjs/commons": "^2.0.0", - "lodash.get": "^4.4.2", - "type-detect": "^4.0.8" - } - }, - "node_modules/@defi.org/web3-candies/node_modules/@sinonjs/samsam/node_modules/@sinonjs/commons": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-2.0.0.tgz", - "integrity": "sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==", - "optional": true, - "dependencies": { - "type-detect": "4.0.8" - } - }, - "node_modules/@defi.org/web3-candies/node_modules/@solidity-parser/parser": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.16.2.tgz", - "integrity": "sha512-PI9NfoA3P8XK2VBkK5oIfRgKDsicwDZfkVq9ZTBCQYGOP1N2owgY2dyLGyU5/J/hQs8KRk55kdmvTLjy3Mu3vg==", - "dependencies": { - "antlr4ts": "^0.5.0-alpha.4" - } - }, - "node_modules/@defi.org/web3-candies/node_modules/@types/node": { - "version": "18.18.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.9.tgz", - "integrity": "sha512-0f5klcuImLnG4Qreu9hPj/rEfFq6YRc5n2mAjSsH+ec/mJL+3voBH0+8T7o8RpFjH7ovc+TRsL/c7OYIQsPTfQ==", - "optional": true, - "dependencies": { - "undici-types": "~5.26.4" - } - }, - "node_modules/@defi.org/web3-candies/node_modules/diff": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz", - "integrity": "sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==", - "optional": true, - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/@defi.org/web3-candies/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "optional": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@defi.org/web3-candies/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==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@defi.org/web3-candies/node_modules/prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", - "bin": { - "prettier": "bin-prettier.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "node_modules/@defi.org/web3-candies/node_modules/prettier-plugin-solidity": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.2.0.tgz", - "integrity": "sha512-fgxcUZpVAP+LlRfy5JI5oaAkXGkmsje2VJ5krv/YMm+rcTZbIUwFguSw5f+WFuttMjpDm6wB4UL7WVkArEfiVA==", - "dependencies": { - "@solidity-parser/parser": "^0.16.2", - "semver": "^7.5.4", - "solidity-comments-extractor": "^0.0.7" - }, - "engines": { - "node": ">=16" - }, - "peerDependencies": { - "prettier": ">=2.3.0" - } - }, - "node_modules/@defi.org/web3-candies/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==", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@defi.org/web3-candies/node_modules/sinon": { - "version": "17.0.1", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-17.0.1.tgz", - "integrity": "sha512-wmwE19Lie0MLT+ZYNpDymasPHUKTaZHUH/pKEubRXIzySv9Atnlw+BUMGCzWgV7b7wO+Hw6f1TEOr0IUnmU8/g==", - "optional": true, - "dependencies": { - "@sinonjs/commons": "^3.0.0", - "@sinonjs/fake-timers": "^11.2.2", - "@sinonjs/samsam": "^8.0.0", - "diff": "^5.1.0", - "nise": "^5.1.5", - "supports-color": "^7.2.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/sinon" - } - }, - "node_modules/@defi.org/web3-candies/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "optional": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@defi.org/web3-candies/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, "node_modules/@defifofum/multicall": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@defifofum/multicall/-/multicall-1.1.2.tgz", @@ -5829,149 +5593,11 @@ "ethers": "^5.4.4" } }, - "node_modules/@emotion/babel-plugin": { - "version": "11.11.0", - "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.11.0.tgz", - "integrity": "sha512-m4HEDZleaaCH+XgDDsPF15Ht6wTLsgDTeR3WYj9Q/k76JtWhrJjcP4+/XlG8LGT/Rol9qUfOIztXeA84ATpqPQ==", - "dependencies": { - "@babel/helper-module-imports": "^7.16.7", - "@babel/runtime": "^7.18.3", - "@emotion/hash": "^0.9.1", - "@emotion/memoize": "^0.8.1", - "@emotion/serialize": "^1.1.2", - "babel-plugin-macros": "^3.1.0", - "convert-source-map": "^1.5.0", - "escape-string-regexp": "^4.0.0", - "find-root": "^1.1.0", - "source-map": "^0.5.7", - "stylis": "4.2.0" - } - }, - "node_modules/@emotion/babel-plugin/node_modules/@emotion/hash": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.1.tgz", - "integrity": "sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==" - }, - "node_modules/@emotion/cache": { - "version": "11.11.0", - "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.11.0.tgz", - "integrity": "sha512-P34z9ssTCBi3e9EI1ZsWpNHcfY1r09ZO0rZbRO2ob3ZQMnFI35jB536qoXbkdesr5EUhYi22anuEJuyxifaqAQ==", - "dependencies": { - "@emotion/memoize": "^0.8.1", - "@emotion/sheet": "^1.2.2", - "@emotion/utils": "^1.2.1", - "@emotion/weak-memoize": "^0.3.1", - "stylis": "4.2.0" - } - }, "node_modules/@emotion/hash": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.8.0.tgz", "integrity": "sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow==" }, - "node_modules/@emotion/is-prop-valid": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.2.1.tgz", - "integrity": "sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==", - "dependencies": { - "@emotion/memoize": "^0.8.1" - } - }, - "node_modules/@emotion/memoize": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.1.tgz", - "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==" - }, - "node_modules/@emotion/react": { - "version": "11.11.4", - "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.11.4.tgz", - "integrity": "sha512-t8AjMlF0gHpvvxk5mAtCqR4vmxiGHCeJBaQO6gncUSdklELOgtwjerNY2yuJNfwnc6vi16U/+uMF+afIawJ9iw==", - "dependencies": { - "@babel/runtime": "^7.18.3", - "@emotion/babel-plugin": "^11.11.0", - "@emotion/cache": "^11.11.0", - "@emotion/serialize": "^1.1.3", - "@emotion/use-insertion-effect-with-fallbacks": "^1.0.1", - "@emotion/utils": "^1.2.1", - "@emotion/weak-memoize": "^0.3.1", - "hoist-non-react-statics": "^3.3.1" - }, - "peerDependencies": { - "react": ">=16.8.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@emotion/serialize": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.1.4.tgz", - "integrity": "sha512-RIN04MBT8g+FnDwgvIUi8czvr1LU1alUMI05LekWB5DGyTm8cCBMCRpq3GqaiyEDRptEXOyXnvZ58GZYu4kBxQ==", - "dependencies": { - "@emotion/hash": "^0.9.1", - "@emotion/memoize": "^0.8.1", - "@emotion/unitless": "^0.8.1", - "@emotion/utils": "^1.2.1", - "csstype": "^3.0.2" - } - }, - "node_modules/@emotion/serialize/node_modules/@emotion/hash": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.1.tgz", - "integrity": "sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==" - }, - "node_modules/@emotion/sheet": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.2.2.tgz", - "integrity": "sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA==" - }, - "node_modules/@emotion/styled": { - "version": "11.11.0", - "resolved": "https://registry.npmjs.org/@emotion/styled/-/styled-11.11.0.tgz", - "integrity": "sha512-hM5Nnvu9P3midq5aaXj4I+lnSfNi7Pmd4EWk1fOZ3pxookaQTNew6bp4JaCBYM4HVFZF9g7UjJmsUmC2JlxOng==", - "dependencies": { - "@babel/runtime": "^7.18.3", - "@emotion/babel-plugin": "^11.11.0", - "@emotion/is-prop-valid": "^1.2.1", - "@emotion/serialize": "^1.1.2", - "@emotion/use-insertion-effect-with-fallbacks": "^1.0.1", - "@emotion/utils": "^1.2.1" - }, - "peerDependencies": { - "@emotion/react": "^11.0.0-rc.0", - "react": ">=16.8.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@emotion/unitless": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.1.tgz", - "integrity": "sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==" - }, - "node_modules/@emotion/use-insertion-effect-with-fallbacks": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.0.1.tgz", - "integrity": "sha512-jT/qyKZ9rzLErtrjGgdkMBn2OP8wl0G3sQlBb3YPryvKHsjvINUhVaPFfP+fpBcOkmrVOVEEHQFJ7nbj2TH2gw==", - "peerDependencies": { - "react": ">=16.8.0" - } - }, - "node_modules/@emotion/utils": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.2.1.tgz", - "integrity": "sha512-Y2tGf3I+XVnajdItskUCn6LX+VUDmP6lTL4fcqsXAv43dnlbZiuW4MWQW38rW/BVWSE7Q/7+XQocmpnRYILUmg==" - }, - "node_modules/@emotion/weak-memoize": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.3.1.tgz", - "integrity": "sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==" - }, "node_modules/@enzoferey/ethers-error-parser": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/@enzoferey/ethers-error-parser/-/ethers-error-parser-0.2.3.tgz", @@ -6040,11 +5666,12 @@ } }, "node_modules/@ethereumjs/common": { - "version": "2.5.0", - "license": "MIT", + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.5.tgz", + "integrity": "sha512-lRyVQOeCDaIVtgfbowla32pzeDv2Obr8oR8Put5RdUBNRGr1VGPGQNGP6elWIpgK3YdpzqTOh4GyUGOureVeeA==", "dependencies": { "crc-32": "^1.2.0", - "ethereumjs-util": "^7.1.1" + "ethereumjs-util": "^7.1.5" } }, "node_modules/@ethereumjs/common/node_modules/ethereum-cryptography": { @@ -6093,16 +5720,18 @@ } }, "node_modules/@ethereumjs/tx": { - "version": "3.3.2", - "license": "MPL-2.0", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.5.2.tgz", + "integrity": "sha512-gQDNJWKrSDGu2w7w0PzVXVBNMzb7wwdDOmOqczmhNjqFxFuIbhVJDwiGEnxFNC2/b8ifcZzY7MLcluizohRzNw==", "dependencies": { - "@ethereumjs/common": "^2.5.0", - "ethereumjs-util": "^7.1.2" + "@ethereumjs/common": "^2.6.4", + "ethereumjs-util": "^7.1.5" } }, "node_modules/@ethereumjs/tx/node_modules/ethereum-cryptography": { "version": "0.1.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", "dependencies": { "@types/pbkdf2": "^3.0.0", "@types/secp256k1": "^4.0.1", @@ -6123,7 +5752,8 @@ }, "node_modules/@ethereumjs/tx/node_modules/ethereumjs-util": { "version": "7.1.5", - "license": "MPL-2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", "dependencies": { "@types/bn.js": "^5.1.0", "bn.js": "^5.1.2", @@ -6832,15 +6462,6 @@ "@ethersproject/strings": "^5.7.0" } }, - "node_modules/@fastify/busboy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.0.tgz", - "integrity": "sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==", - "optional": true, - "engines": { - "node": ">=14" - } - }, "node_modules/@filebase/client": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/@filebase/client/-/client-0.0.2.tgz", @@ -9849,272 +9470,6 @@ "tslib": "^2.3.1" } }, - "node_modules/@mui/base": { - "version": "5.0.0-beta.24", - "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.24.tgz", - "integrity": "sha512-bKt2pUADHGQtqWDZ8nvL2Lvg2GNJyd/ZUgZAJoYzRgmnxBL9j36MSlS3+exEdYkikcnvVafcBtD904RypFKb0w==", - "dependencies": { - "@babel/runtime": "^7.23.2", - "@floating-ui/react-dom": "^2.0.4", - "@mui/types": "^7.2.9", - "@mui/utils": "^5.14.18", - "@popperjs/core": "^2.11.8", - "clsx": "^2.0.0", - "prop-types": "^15.8.1" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mui" - }, - "peerDependencies": { - "@types/react": "^17.0.0 || ^18.0.0", - "react": "^17.0.0 || ^18.0.0", - "react-dom": "^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@mui/base/node_modules/@floating-ui/react-dom": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.0.4.tgz", - "integrity": "sha512-CF8k2rgKeh/49UrnIBs4BdxPUV6vize/Db1d/YbCLyp9GiVZ0BEwf5AiDSxJRCr6yOkGqTFHtmrULxkEfYZ7dQ==", - "dependencies": { - "@floating-ui/dom": "^1.5.1" - }, - "peerDependencies": { - "react": ">=16.8.0", - "react-dom": ">=16.8.0" - } - }, - "node_modules/@mui/base/node_modules/clsx": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.0.0.tgz", - "integrity": "sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==", - "engines": { - "node": ">=6" - } - }, - "node_modules/@mui/core-downloads-tracker": { - "version": "5.14.18", - "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.14.18.tgz", - "integrity": "sha512-yFpF35fEVDV81nVktu0BE9qn2dD/chs7PsQhlyaV3EnTeZi9RZBuvoEfRym1/jmhJ2tcfeWXiRuHG942mQXJJQ==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mui" - } - }, - "node_modules/@mui/material": { - "version": "5.14.18", - "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.14.18.tgz", - "integrity": "sha512-y3UiR/JqrkF5xZR0sIKj6y7xwuEiweh9peiN3Zfjy1gXWXhz5wjlaLdoxFfKIEBUFfeQALxr/Y8avlHH+B9lpQ==", - "dependencies": { - "@babel/runtime": "^7.23.2", - "@mui/base": "5.0.0-beta.24", - "@mui/core-downloads-tracker": "^5.14.18", - "@mui/system": "^5.14.18", - "@mui/types": "^7.2.9", - "@mui/utils": "^5.14.18", - "@types/react-transition-group": "^4.4.8", - "clsx": "^2.0.0", - "csstype": "^3.1.2", - "prop-types": "^15.8.1", - "react-is": "^18.2.0", - "react-transition-group": "^4.4.5" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mui" - }, - "peerDependencies": { - "@emotion/react": "^11.5.0", - "@emotion/styled": "^11.3.0", - "@types/react": "^17.0.0 || ^18.0.0", - "react": "^17.0.0 || ^18.0.0", - "react-dom": "^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "@emotion/react": { - "optional": true - }, - "@emotion/styled": { - "optional": true - }, - "@types/react": { - "optional": true - } - } - }, - "node_modules/@mui/material/node_modules/clsx": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.0.0.tgz", - "integrity": "sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==", - "engines": { - "node": ">=6" - } - }, - "node_modules/@mui/material/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/@mui/private-theming": { - "version": "5.14.18", - "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.14.18.tgz", - "integrity": "sha512-WSgjqRlzfHU+2Rou3HlR2Gqfr4rZRsvFgataYO3qQ0/m6gShJN+lhVEvwEiJ9QYyVzMDvNpXZAcqp8Y2Vl+PAw==", - "dependencies": { - "@babel/runtime": "^7.23.2", - "@mui/utils": "^5.14.18", - "prop-types": "^15.8.1" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mui" - }, - "peerDependencies": { - "@types/react": "^17.0.0 || ^18.0.0", - "react": "^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@mui/styled-engine": { - "version": "5.14.18", - "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-5.14.18.tgz", - "integrity": "sha512-pW8bpmF9uCB5FV2IPk6mfbQCjPI5vGI09NOLhtGXPeph/4xIfC3JdIX0TILU0WcTs3aFQqo6s2+1SFgIB9rCXA==", - "dependencies": { - "@babel/runtime": "^7.23.2", - "@emotion/cache": "^11.11.0", - "csstype": "^3.1.2", - "prop-types": "^15.8.1" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mui" - }, - "peerDependencies": { - "@emotion/react": "^11.4.1", - "@emotion/styled": "^11.3.0", - "react": "^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "@emotion/react": { - "optional": true - }, - "@emotion/styled": { - "optional": true - } - } - }, - "node_modules/@mui/system": { - "version": "5.14.18", - "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.14.18.tgz", - "integrity": "sha512-hSQQdb3KF72X4EN2hMEiv8EYJZSflfdd1TRaGPoR7CIAG347OxCslpBUwWngYobaxgKvq6xTrlIl+diaactVww==", - "dependencies": { - "@babel/runtime": "^7.23.2", - "@mui/private-theming": "^5.14.18", - "@mui/styled-engine": "^5.14.18", - "@mui/types": "^7.2.9", - "@mui/utils": "^5.14.18", - "clsx": "^2.0.0", - "csstype": "^3.1.2", - "prop-types": "^15.8.1" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mui" - }, - "peerDependencies": { - "@emotion/react": "^11.5.0", - "@emotion/styled": "^11.3.0", - "@types/react": "^17.0.0 || ^18.0.0", - "react": "^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "@emotion/react": { - "optional": true - }, - "@emotion/styled": { - "optional": true - }, - "@types/react": { - "optional": true - } - } - }, - "node_modules/@mui/system/node_modules/clsx": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.0.0.tgz", - "integrity": "sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==", - "engines": { - "node": ">=6" - } - }, - "node_modules/@mui/types": { - "version": "7.2.9", - "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.9.tgz", - "integrity": "sha512-k1lN/PolaRZfNsRdAqXtcR71sTnv3z/VCCGPxU8HfdftDkzi335MdJ6scZxvofMAd/K/9EbzCZTFBmlNpQVdCg==", - "peerDependencies": { - "@types/react": "^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@mui/utils": { - "version": "5.14.18", - "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.14.18.tgz", - "integrity": "sha512-HZDRsJtEZ7WMSnrHV9uwScGze4wM/Y+u6pDVo+grUjt5yXzn+wI8QX/JwTHh9YSw/WpnUL80mJJjgCnWj2VrzQ==", - "dependencies": { - "@babel/runtime": "^7.23.2", - "@types/prop-types": "^15.7.10", - "prop-types": "^15.8.1", - "react-is": "^18.2.0" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mui" - }, - "peerDependencies": { - "@types/react": "^17.0.0 || ^18.0.0", - "react": "^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@mui/utils/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/@multiformats/base-x": { "version": "4.0.1", "license": "MIT" @@ -10168,18 +9523,6 @@ ], "license": "MIT" }, - "node_modules/@noble/secp256k1": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.7.1.tgz", - "integrity": "sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "optional": true - }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "dev": true, @@ -10212,574 +9555,6 @@ "node": ">= 8" } }, - "node_modules/@nomicfoundation/ethereumjs-block": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.2.tgz", - "integrity": "sha512-hSe6CuHI4SsSiWWjHDIzWhSiAVpzMUcDRpWYzN0T9l8/Rz7xNn3elwVOJ/tAyS0LqL6vitUD78Uk7lQDXZun7Q==", - "optional": true, - "dependencies": { - "@nomicfoundation/ethereumjs-common": "4.0.2", - "@nomicfoundation/ethereumjs-rlp": "5.0.2", - "@nomicfoundation/ethereumjs-trie": "6.0.2", - "@nomicfoundation/ethereumjs-tx": "5.0.2", - "@nomicfoundation/ethereumjs-util": "9.0.2", - "ethereum-cryptography": "0.1.3", - "ethers": "^5.7.1" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nomicfoundation/ethereumjs-block/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "optional": true, - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/@nomicfoundation/ethereumjs-blockchain": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-7.0.2.tgz", - "integrity": "sha512-8UUsSXJs+MFfIIAKdh3cG16iNmWzWC/91P40sazNvrqhhdR/RtGDlFk2iFTGbBAZPs2+klZVzhRX8m2wvuvz3w==", - "optional": true, - "dependencies": { - "@nomicfoundation/ethereumjs-block": "5.0.2", - "@nomicfoundation/ethereumjs-common": "4.0.2", - "@nomicfoundation/ethereumjs-ethash": "3.0.2", - "@nomicfoundation/ethereumjs-rlp": "5.0.2", - "@nomicfoundation/ethereumjs-trie": "6.0.2", - "@nomicfoundation/ethereumjs-tx": "5.0.2", - "@nomicfoundation/ethereumjs-util": "9.0.2", - "abstract-level": "^1.0.3", - "debug": "^4.3.3", - "ethereum-cryptography": "0.1.3", - "level": "^8.0.0", - "lru-cache": "^5.1.1", - "memory-level": "^1.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nomicfoundation/ethereumjs-blockchain/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "optional": true, - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/@nomicfoundation/ethereumjs-common": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.2.tgz", - "integrity": "sha512-I2WGP3HMGsOoycSdOTSqIaES0ughQTueOsddJ36aYVpI3SN8YSusgRFLwzDJwRFVIYDKx/iJz0sQ5kBHVgdDwg==", - "optional": true, - "dependencies": { - "@nomicfoundation/ethereumjs-util": "9.0.2", - "crc-32": "^1.2.0" - } - }, - "node_modules/@nomicfoundation/ethereumjs-ethash": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-3.0.2.tgz", - "integrity": "sha512-8PfoOQCcIcO9Pylq0Buijuq/O73tmMVURK0OqdjhwqcGHYC2PwhbajDh7GZ55ekB0Px197ajK3PQhpKoiI/UPg==", - "optional": true, - "dependencies": { - "@nomicfoundation/ethereumjs-block": "5.0.2", - "@nomicfoundation/ethereumjs-rlp": "5.0.2", - "@nomicfoundation/ethereumjs-util": "9.0.2", - "abstract-level": "^1.0.3", - "bigint-crypto-utils": "^3.0.23", - "ethereum-cryptography": "0.1.3" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nomicfoundation/ethereumjs-ethash/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "optional": true, - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/@nomicfoundation/ethereumjs-evm": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-2.0.2.tgz", - "integrity": "sha512-rBLcUaUfANJxyOx9HIdMX6uXGin6lANCulIm/pjMgRqfiCRMZie3WKYxTSd8ZE/d+qT+zTedBF4+VHTdTSePmQ==", - "optional": true, - "dependencies": { - "@ethersproject/providers": "^5.7.1", - "@nomicfoundation/ethereumjs-common": "4.0.2", - "@nomicfoundation/ethereumjs-tx": "5.0.2", - "@nomicfoundation/ethereumjs-util": "9.0.2", - "debug": "^4.3.3", - "ethereum-cryptography": "0.1.3", - "mcl-wasm": "^0.7.1", - "rustbn.js": "~0.2.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nomicfoundation/ethereumjs-evm/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "optional": true, - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/@nomicfoundation/ethereumjs-rlp": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.2.tgz", - "integrity": "sha512-QwmemBc+MMsHJ1P1QvPl8R8p2aPvvVcKBbvHnQOKBpBztEo0omN0eaob6FeZS/e3y9NSe+mfu3nNFBHszqkjTA==", - "optional": true, - "bin": { - "rlp": "bin/rlp" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nomicfoundation/ethereumjs-statemanager": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-2.0.2.tgz", - "integrity": "sha512-dlKy5dIXLuDubx8Z74sipciZnJTRSV/uHG48RSijhgm1V7eXYFC567xgKtsKiVZB1ViTP9iFL4B6Je0xD6X2OA==", - "optional": true, - "dependencies": { - "@nomicfoundation/ethereumjs-common": "4.0.2", - "@nomicfoundation/ethereumjs-rlp": "5.0.2", - "debug": "^4.3.3", - "ethereum-cryptography": "0.1.3", - "ethers": "^5.7.1", - "js-sdsl": "^4.1.4" - } - }, - "node_modules/@nomicfoundation/ethereumjs-statemanager/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "optional": true, - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/@nomicfoundation/ethereumjs-trie": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-6.0.2.tgz", - "integrity": "sha512-yw8vg9hBeLYk4YNg5MrSJ5H55TLOv2FSWUTROtDtTMMmDGROsAu+0tBjiNGTnKRi400M6cEzoFfa89Fc5k8NTQ==", - "optional": true, - "dependencies": { - "@nomicfoundation/ethereumjs-rlp": "5.0.2", - "@nomicfoundation/ethereumjs-util": "9.0.2", - "@types/readable-stream": "^2.3.13", - "ethereum-cryptography": "0.1.3", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nomicfoundation/ethereumjs-trie/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "optional": true, - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/@nomicfoundation/ethereumjs-tx": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.2.tgz", - "integrity": "sha512-T+l4/MmTp7VhJeNloMkM+lPU3YMUaXdcXgTGCf8+ZFvV9NYZTRLFekRwlG6/JMmVfIfbrW+dRRJ9A6H5Q/Z64g==", - "optional": true, - "dependencies": { - "@chainsafe/ssz": "^0.9.2", - "@ethersproject/providers": "^5.7.2", - "@nomicfoundation/ethereumjs-common": "4.0.2", - "@nomicfoundation/ethereumjs-rlp": "5.0.2", - "@nomicfoundation/ethereumjs-util": "9.0.2", - "ethereum-cryptography": "0.1.3" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nomicfoundation/ethereumjs-tx/node_modules/@chainsafe/as-sha256": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@chainsafe/as-sha256/-/as-sha256-0.3.1.tgz", - "integrity": "sha512-hldFFYuf49ed7DAakWVXSJODuq3pzJEguD8tQ7h+sGkM18vja+OFoJI9krnGmgzyuZC2ETX0NOIcCTy31v2Mtg==", - "optional": true - }, - "node_modules/@nomicfoundation/ethereumjs-tx/node_modules/@chainsafe/persistent-merkle-tree": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.4.2.tgz", - "integrity": "sha512-lLO3ihKPngXLTus/L7WHKaw9PnNJWizlOF1H9NNzHP6Xvh82vzg9F2bzkXhYIFshMZ2gTCEz8tq6STe7r5NDfQ==", - "optional": true, - "dependencies": { - "@chainsafe/as-sha256": "^0.3.1" - } - }, - "node_modules/@nomicfoundation/ethereumjs-tx/node_modules/@chainsafe/ssz": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/@chainsafe/ssz/-/ssz-0.9.4.tgz", - "integrity": "sha512-77Qtg2N1ayqs4Bg/wvnWfg5Bta7iy7IRh8XqXh7oNMeP2HBbBwx8m6yTpA8p0EHItWPEBkgZd5S5/LSlp3GXuQ==", - "optional": true, - "dependencies": { - "@chainsafe/as-sha256": "^0.3.1", - "@chainsafe/persistent-merkle-tree": "^0.4.2", - "case": "^1.6.3" - } - }, - "node_modules/@nomicfoundation/ethereumjs-tx/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "optional": true, - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/@nomicfoundation/ethereumjs-util": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.2.tgz", - "integrity": "sha512-4Wu9D3LykbSBWZo8nJCnzVIYGvGCuyiYLIJa9XXNVt1q1jUzHdB+sJvx95VGCpPkCT+IbLecW6yfzy3E1bQrwQ==", - "optional": true, - "dependencies": { - "@chainsafe/ssz": "^0.10.0", - "@nomicfoundation/ethereumjs-rlp": "5.0.2", - "ethereum-cryptography": "0.1.3" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nomicfoundation/ethereumjs-util/node_modules/@chainsafe/as-sha256": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@chainsafe/as-sha256/-/as-sha256-0.3.1.tgz", - "integrity": "sha512-hldFFYuf49ed7DAakWVXSJODuq3pzJEguD8tQ7h+sGkM18vja+OFoJI9krnGmgzyuZC2ETX0NOIcCTy31v2Mtg==", - "optional": true - }, - "node_modules/@nomicfoundation/ethereumjs-util/node_modules/@chainsafe/persistent-merkle-tree": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.5.0.tgz", - "integrity": "sha512-l0V1b5clxA3iwQLXP40zYjyZYospQLZXzBVIhhr9kDg/1qHZfzzHw0jj4VPBijfYCArZDlPkRi1wZaV2POKeuw==", - "optional": true, - "dependencies": { - "@chainsafe/as-sha256": "^0.3.1" - } - }, - "node_modules/@nomicfoundation/ethereumjs-util/node_modules/@chainsafe/ssz": { - "version": "0.10.2", - "resolved": "https://registry.npmjs.org/@chainsafe/ssz/-/ssz-0.10.2.tgz", - "integrity": "sha512-/NL3Lh8K+0q7A3LsiFq09YXS9fPE+ead2rr7vM2QK8PLzrNsw3uqrif9bpRX5UxgeRjM+vYi+boCM3+GM4ovXg==", - "optional": true, - "dependencies": { - "@chainsafe/as-sha256": "^0.3.1", - "@chainsafe/persistent-merkle-tree": "^0.5.0" - } - }, - "node_modules/@nomicfoundation/ethereumjs-util/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "optional": true, - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/@nomicfoundation/ethereumjs-vm": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-7.0.2.tgz", - "integrity": "sha512-Bj3KZT64j54Tcwr7Qm/0jkeZXJMfdcAtRBedou+Hx0dPOSIgqaIr0vvLwP65TpHbak2DmAq+KJbW2KNtIoFwvA==", - "optional": true, - "dependencies": { - "@nomicfoundation/ethereumjs-block": "5.0.2", - "@nomicfoundation/ethereumjs-blockchain": "7.0.2", - "@nomicfoundation/ethereumjs-common": "4.0.2", - "@nomicfoundation/ethereumjs-evm": "2.0.2", - "@nomicfoundation/ethereumjs-rlp": "5.0.2", - "@nomicfoundation/ethereumjs-statemanager": "2.0.2", - "@nomicfoundation/ethereumjs-trie": "6.0.2", - "@nomicfoundation/ethereumjs-tx": "5.0.2", - "@nomicfoundation/ethereumjs-util": "9.0.2", - "debug": "^4.3.3", - "ethereum-cryptography": "0.1.3", - "mcl-wasm": "^0.7.1", - "rustbn.js": "~0.2.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nomicfoundation/ethereumjs-vm/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "optional": true, - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/@nomicfoundation/solidity-analyzer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer/-/solidity-analyzer-0.1.1.tgz", - "integrity": "sha512-1LMtXj1puAxyFusBgUIy5pZk3073cNXYnXUpuNKFghHbIit/xZgbk0AokpUADbNm3gyD6bFWl3LRFh3dhVdREg==", - "optional": true, - "engines": { - "node": ">= 12" - }, - "optionalDependencies": { - "@nomicfoundation/solidity-analyzer-darwin-arm64": "0.1.1", - "@nomicfoundation/solidity-analyzer-darwin-x64": "0.1.1", - "@nomicfoundation/solidity-analyzer-freebsd-x64": "0.1.1", - "@nomicfoundation/solidity-analyzer-linux-arm64-gnu": "0.1.1", - "@nomicfoundation/solidity-analyzer-linux-arm64-musl": "0.1.1", - "@nomicfoundation/solidity-analyzer-linux-x64-gnu": "0.1.1", - "@nomicfoundation/solidity-analyzer-linux-x64-musl": "0.1.1", - "@nomicfoundation/solidity-analyzer-win32-arm64-msvc": "0.1.1", - "@nomicfoundation/solidity-analyzer-win32-ia32-msvc": "0.1.1", - "@nomicfoundation/solidity-analyzer-win32-x64-msvc": "0.1.1" - } - }, - "node_modules/@nomicfoundation/solidity-analyzer-darwin-arm64": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.1.tgz", - "integrity": "sha512-KcTodaQw8ivDZyF+D76FokN/HdpgGpfjc/gFCImdLUyqB6eSWVaZPazMbeAjmfhx3R0zm/NYVzxwAokFKgrc0w==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@nomiclabs/hardhat-etherscan": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-3.1.7.tgz", - "integrity": "sha512-tZ3TvSgpvsQ6B6OGmo1/Au6u8BrAkvs1mIC/eURA3xgIfznUZBhmpne8hv7BXUzw9xNL3fXdpOYgOQlVMTcoHQ==", - "optional": true, - "dependencies": { - "@ethersproject/abi": "^5.1.2", - "@ethersproject/address": "^5.0.2", - "cbor": "^8.1.0", - "chalk": "^2.4.2", - "debug": "^4.1.1", - "fs-extra": "^7.0.1", - "lodash": "^4.17.11", - "semver": "^6.3.0", - "table": "^6.8.0", - "undici": "^5.14.0" - }, - "peerDependencies": { - "hardhat": "^2.0.4" - } - }, - "node_modules/@nomiclabs/hardhat-etherscan/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "optional": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@nomiclabs/hardhat-etherscan/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "optional": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@nomiclabs/hardhat-etherscan/node_modules/fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "optional": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - }, - "engines": { - "node": ">=6 <7 || >=8" - } - }, - "node_modules/@nomiclabs/hardhat-etherscan/node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "optional": true, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/@nomiclabs/hardhat-etherscan/node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "optional": true, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/@nomiclabs/hardhat-web3": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-web3/-/hardhat-web3-2.0.0.tgz", - "integrity": "sha512-zt4xN+D+fKl3wW2YlTX3k9APR3XZgPkxJYf36AcliJn3oujnKEVRZaHu0PhgLjO+gR+F/kiYayo9fgd2L8970Q==", - "optional": true, - "dependencies": { - "@types/bignumber.js": "^5.0.0" - }, - "peerDependencies": { - "hardhat": "^2.0.0", - "web3": "^1.0.0-beta.36" - } - }, "node_modules/@opensea/seaport-js": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/@opensea/seaport-js/-/seaport-js-4.0.3.tgz", @@ -11018,65 +9793,34 @@ "node": ">=10.0.0" } }, - "node_modules/@orbs-network/twap": { - "version": "1.18.2", - "resolved": "https://registry.npmjs.org/@orbs-network/twap/-/twap-1.18.2.tgz", - "integrity": "sha512-TJIIp709+5YteyzWyKYvDQEzIoXLvdL4sWnYVz/H623ur7NGAwqqY97LstArYlkOHfrQTCvs71NWX9mmymSJgA==", - "dependencies": { - "@defi.org/web3-candies": "^4.20.3" - } + "node_modules/@orbs-network/liquidity-hub-sdk": { + "version": "1.0.40", + "resolved": "https://registry.npmjs.org/@orbs-network/liquidity-hub-sdk/-/liquidity-hub-sdk-1.0.40.tgz", + "integrity": "sha512-/5uwdfSzPIb9uN4JxjEUfh+TgTIbZkOTGjR2UjsrZcjcXRBSg9mXB3GuAKD7g/ROIs9vrM1quuv/cdEQnVwrVw==" }, - "node_modules/@orbs-network/twap-ui": { - "version": "0.10.23", - "resolved": "https://registry.npmjs.org/@orbs-network/twap-ui/-/twap-ui-0.10.23.tgz", - "integrity": "sha512-gx/kpl71eTdA0tTzqBFyFSzcvUGV3IeuPJjiFFw+fuesTzdnPvs3Pg4cGMN+wlI4siLi+eSm/vw0n8IapYDPug==", - "dependencies": { - "@defi.org/web3-candies": "^4.20", - "@emotion/react": "11.x", - "@emotion/styled": "11.x", - "@mui/material": "5.x", - "@mui/system": "5.x", - "@orbs-network/twap": "^1.18.x", - "@react-icons/all-files": "^4.1.0", - "@tanstack/react-query": "4.x", - "@types/async-retry": "^1.4.5", - "@types/lodash": "4.x", - "async-retry": "^1.3.3", - "bignumber.js": "9.x", - "emotion-theming": "11.x", - "isomorphic-fetch": "3.x", - "lodash": "4.x", - "moment": "2.x", - "qrcode.react": "^3.1.0", - "react-error-boundary": "^4.0.10", - "react-number-format": "5.x", - "react-text-overflow": "^1.0.2", - "web3": "1.x", - "zustand": "4.x" - }, + "node_modules/@orbs-network/swap-ui": { + "version": "0.0.14", + "resolved": "https://registry.npmjs.org/@orbs-network/swap-ui/-/swap-ui-0.0.14.tgz", + "integrity": "sha512-19Blk3JYsxae6Eu8a/nsLA8EbNSMQSJfsgV7Tg52RPs6IglTjEwfGyjy3HUPzRqEYXiHCQFo8xGNHjSKx3HJ5g==", "peerDependencies": { - "react": "*", - "react-dom": "*" + "react": ">=18.2.0", + "react-dom": ">=18.2.0" } }, - "node_modules/@orbs-network/twap-ui-quickswap": { - "version": "0.10.23", - "resolved": "https://registry.npmjs.org/@orbs-network/twap-ui-quickswap/-/twap-ui-quickswap-0.10.23.tgz", - "integrity": "sha512-n37S1p47s9hComz7pmC2yvgr/rHbg+6jAjyMxz1aDPl0m4x1NZZMknIBlDDP1vjtAHPUDy5KGRUlFLRY0uAg9Q==", + "node_modules/@orbs-network/twap-sdk": { + "version": "2.0.38", + "resolved": "https://registry.npmjs.org/@orbs-network/twap-sdk/-/twap-sdk-2.0.38.tgz", + "integrity": "sha512-U7nBRA7tghIWQPbhdqqPOTm6VyoEVGHmjkZKE1ddYyAvQLSi+V/7Pnn1xi7OP7xYSBCl0YmmA3C/GPYGJGdfVA==", "dependencies": { - "@defi.org/web3-candies": "^4.20", - "@mui/material": "5.x", - "@mui/system": "5.x", - "@orbs-network/twap": "^1.18.x", - "@orbs-network/twap-ui": "^0.10.23", - "lodash": "4.x", - "web3": "1.x" - }, - "peerDependencies": { - "react": "*", - "react-dom": "*" + "@orbs-network/twap": "^2.0.1", + "bignumber.js": "9.x" } }, + "node_modules/@orbs-network/twap-sdk/node_modules/@orbs-network/twap": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/@orbs-network/twap/-/twap-2.2.4.tgz", + "integrity": "sha512-SeEH45f4KXh6hXjbhhE4lPgTzIvMNx9Mun+pdX9plvdKpWAbcg6f1FKfv2MZ1ghtYxHlhuDcthlx159t8ReiOA==" + }, "node_modules/@orderly.network/core": { "version": "1.5.4", "resolved": "https://registry.npmjs.org/@orderly.network/core/-/core-1.5.4.tgz", @@ -11544,15 +10288,6 @@ "node": ">= 8" } }, - "node_modules/@popperjs/core": { - "version": "2.11.8", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", - "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/popperjs" - } - }, "node_modules/@prisma/debug": { "version": "5.14.0", "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.14.0.tgz", @@ -12596,14 +11331,6 @@ "@babel/runtime": "^7.13.10" } }, - "node_modules/@react-icons/all-files": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@react-icons/all-files/-/all-files-4.1.0.tgz", - "integrity": "sha512-hxBI2UOuVaI3O/BhQfhtb4kcGn9ft12RWAFVMUeNjqqhLsHvFtzIkFaptBJpFDANTKoDfdVoHTKZDlwKCACbMQ==", - "peerDependencies": { - "react": "*" - } - }, "node_modules/@reduxjs/toolkit": { "version": "1.9.5", "dev": true, @@ -12976,144 +11703,6 @@ "tsub": "dist/index.js" } }, - "node_modules/@sentry/core": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.30.0.tgz", - "integrity": "sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg==", - "optional": true, - "dependencies": { - "@sentry/hub": "5.30.0", - "@sentry/minimal": "5.30.0", - "@sentry/types": "5.30.0", - "@sentry/utils": "5.30.0", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/core/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "optional": true - }, - "node_modules/@sentry/hub": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.30.0.tgz", - "integrity": "sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ==", - "optional": true, - "dependencies": { - "@sentry/types": "5.30.0", - "@sentry/utils": "5.30.0", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/hub/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "optional": true - }, - "node_modules/@sentry/minimal": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.30.0.tgz", - "integrity": "sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw==", - "optional": true, - "dependencies": { - "@sentry/hub": "5.30.0", - "@sentry/types": "5.30.0", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/minimal/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "optional": true - }, - "node_modules/@sentry/node": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/node/-/node-5.30.0.tgz", - "integrity": "sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg==", - "optional": true, - "dependencies": { - "@sentry/core": "5.30.0", - "@sentry/hub": "5.30.0", - "@sentry/tracing": "5.30.0", - "@sentry/types": "5.30.0", - "@sentry/utils": "5.30.0", - "cookie": "^0.4.1", - "https-proxy-agent": "^5.0.0", - "lru_map": "^0.3.3", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/node/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "optional": true - }, - "node_modules/@sentry/tracing": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-5.30.0.tgz", - "integrity": "sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw==", - "optional": true, - "dependencies": { - "@sentry/hub": "5.30.0", - "@sentry/minimal": "5.30.0", - "@sentry/types": "5.30.0", - "@sentry/utils": "5.30.0", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/tracing/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "optional": true - }, - "node_modules/@sentry/types": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.30.0.tgz", - "integrity": "sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==", - "optional": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/utils": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.30.0.tgz", - "integrity": "sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww==", - "optional": true, - "dependencies": { - "@sentry/types": "5.30.0", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/utils/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "optional": true - }, "node_modules/@sideway/address": { "version": "4.1.4", "dev": true, @@ -13171,12 +11760,6 @@ "type-detect": "4.0.8" } }, - "node_modules/@sinonjs/text-encoding": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.2.tgz", - "integrity": "sha512-sXXKG+uL9IrKqViTtao2Ws6dy0znu9sOaP1di/jKGW1M6VssO8vlpXCQcpZ+jisQ1tTFAC5Jo/EOzFbggBagFQ==", - "optional": true - }, "node_modules/@smithy/abort-controller": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-3.0.0.tgz", @@ -13831,15 +12414,6 @@ "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz", "integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==" }, - "node_modules/@solidity-parser/parser": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.14.5.tgz", - "integrity": "sha512-6dKnHZn7fg/iQATVEzqyUOyEidbn05q7YA2mQ9hC0MMXhhV3/JrsxmFSYZAcr7j1yUP700LLhTruvJ3MiQmjJg==", - "optional": true, - "dependencies": { - "antlr4ts": "^0.5.0-alpha.4" - } - }, "node_modules/@soulsolidity/soul-zap-trpc-client": { "version": "1.0.0-beta.0", "resolved": "https://registry.npmjs.org/@soulsolidity/soul-zap-trpc-client/-/soul-zap-trpc-client-1.0.0-beta.0.tgz", @@ -17258,26 +15832,6 @@ "node": ">=10.13.0" } }, - "node_modules/@tsconfig/node10": { - "version": "1.0.9", - "license": "MIT", - "optional": true - }, - "node_modules/@tsconfig/node12": { - "version": "1.0.11", - "license": "MIT", - "optional": true - }, - "node_modules/@tsconfig/node14": { - "version": "1.0.3", - "license": "MIT", - "optional": true - }, - "node_modules/@tsconfig/node16": { - "version": "1.0.4", - "license": "MIT", - "optional": true - }, "node_modules/@typechain/ethers-v5": { "version": "10.2.1", "resolved": "https://registry.npmjs.org/@typechain/ethers-v5/-/ethers-v5-10.2.1.tgz", @@ -17302,71 +15856,6 @@ "typescript": ">=3.7.0" } }, - "node_modules/@typechain/hardhat": { - "version": "6.1.6", - "resolved": "https://registry.npmjs.org/@typechain/hardhat/-/hardhat-6.1.6.tgz", - "integrity": "sha512-BiVnegSs+ZHVymyidtK472syodx1sXYlYJJixZfRstHVGYTi8V1O7QG4nsjyb0PC/LORcq7sfBUcHto1y6UgJA==", - "optional": true, - "dependencies": { - "fs-extra": "^9.1.0" - }, - "peerDependencies": { - "@ethersproject/abi": "^5.4.7", - "@ethersproject/providers": "^5.4.7", - "@typechain/ethers-v5": "^10.2.1", - "ethers": "^5.4.7", - "hardhat": "^2.9.9", - "typechain": "^8.1.1" - } - }, - "node_modules/@typechain/hardhat/node_modules/fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", - "optional": true, - "dependencies": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@typechain/web3-v1": { - "version": "6.0.7", - "resolved": "https://registry.npmjs.org/@typechain/web3-v1/-/web3-v1-6.0.7.tgz", - "integrity": "sha512-HWkGplyPL3eWiP0sszqKZh6Bjrdm23srtirUdKp/4BEWKp/o6zofLt8lDn468bRQlQdHaobrbfEeT+3gf/r4eg==", - "optional": true, - "dependencies": { - "lodash": "^4.17.15", - "ts-essentials": "^7.0.1" - }, - "peerDependencies": { - "typechain": "^8.3.2", - "web3": "^1", - "web3-core": "^1", - "web3-eth-contract": "^1" - } - }, - "node_modules/@typechain/web3-v1/node_modules/ts-essentials": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-7.0.3.tgz", - "integrity": "sha512-8+gr5+lqO3G84KdiTSMRLtuyJ+nTBVRKuCrK4lidMPdVeEp0uqC875uE5NMcaA7YYMN7XsNiFQuMvasF8HT/xQ==", - "optional": true, - "peerDependencies": { - "typescript": ">=3.7.0" - } - }, - "node_modules/@types/async-retry": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/@types/async-retry/-/async-retry-1.4.8.tgz", - "integrity": "sha512-Qup/B5PWLe86yI5I3av6ePGaeQrIHNKCwbsQotD6aHQ6YkHsMUxVZkZsmx/Ry3VZQ6uysHwTjQ7666+k6UjVJA==", - "dependencies": { - "@types/retry": "*" - } - }, "node_modules/@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", @@ -17408,16 +15897,6 @@ "@babel/types": "^7.20.7" } }, - "node_modules/@types/bignumber.js": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@types/bignumber.js/-/bignumber.js-5.0.0.tgz", - "integrity": "sha512-0DH7aPGCClywOFaxxjE6UwpN2kQYe9LwuDQMv+zYA97j5GkOMo8e66LYT+a8JYU7jfmUFRZLa9KycxHDsKXJCA==", - "deprecated": "This is a stub types definition for bignumber.js (https://github.com/MikeMcl/bignumber.js/). bignumber.js provides its own type definitions, so you don't need @types/bignumber.js installed!", - "optional": true, - "dependencies": { - "bignumber.js": "*" - } - }, "node_modules/@types/bn.js": { "version": "5.1.1", "license": "MIT", @@ -17454,21 +15933,6 @@ "@types/responselike": "^1.0.0" } }, - "node_modules/@types/chai": { - "version": "4.3.10", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.10.tgz", - "integrity": "sha512-of+ICnbqjmFCiixUnqRulbylyXQrPqIGf/B3Jax1wIF3DvSheysQxAWvqHhZiW3IQrycvokcLcFQlveGp+vyNg==", - "optional": true - }, - "node_modules/@types/concat-stream": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/@types/concat-stream/-/concat-stream-1.6.1.tgz", - "integrity": "sha512-eHE4cQPoj6ngxBZMvVf6Hw7Mh4jMW4U9lpGmS5GBPB9RYxlFg+CHaVN7ErNY4W9XfLIEn20b4VDYaIrbq0q4uA==", - "optional": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/connect": { "version": "3.4.35", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", @@ -17772,25 +16236,6 @@ "@types/send": "*" } }, - "node_modules/@types/form-data": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-0.0.33.tgz", - "integrity": "sha512-8BSvG1kGm83cyJITQMZSulnl6QV8jqAGreJsc5tPu1Jq0vTSOiY/k24Wx82JRpWwZSqrala6sd5rWi6aNXvqcw==", - "optional": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/fs-extra": { - "version": "11.0.4", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.4.tgz", - "integrity": "sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==", - "optional": true, - "dependencies": { - "@types/jsonfile": "*", - "@types/node": "*" - } - }, "node_modules/@types/geojson": { "version": "7946.0.10", "dev": true, @@ -17882,15 +16327,6 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, - "node_modules/@types/jsonfile": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/@types/jsonfile/-/jsonfile-6.1.4.tgz", - "integrity": "sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==", - "optional": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/keyv": { "version": "3.1.4", "license": "MIT", @@ -17915,12 +16351,6 @@ "version": "4.0.2", "license": "MIT" }, - "node_modules/@types/lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@types/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==", - "optional": true - }, "node_modules/@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", @@ -17935,21 +16365,6 @@ "version": "1.2.2", "license": "MIT" }, - "node_modules/@types/mkdirp": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@types/mkdirp/-/mkdirp-0.5.2.tgz", - "integrity": "sha512-U5icWpv7YnZYGsN4/cmh3WD2onMY0aJIiTE6+51TwJCttdHvtCYmkBNOobHlXwrJRL0nkH9jH4kD+1FAdMN4Tg==", - "optional": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/mocha": { - "version": "10.0.4", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.4.tgz", - "integrity": "sha512-xKU7bUjiFTIttpWaIZ9qvgg+22O1nmbA+HRxdlR+u6TWsGfmFdXrheJoK4fFxrHNVIOBDvDNKZG+LYBpMHpX3w==", - "optional": true - }, "node_modules/@types/ms": { "version": "0.7.31", "license": "MIT" @@ -17982,6 +16397,7 @@ }, "node_modules/@types/parse-json": { "version": "4.0.0", + "dev": true, "license": "MIT" }, "node_modules/@types/pbkdf2": { @@ -17995,16 +16411,6 @@ "version": "2.7.2", "license": "MIT" }, - "node_modules/@types/prompts": { - "version": "2.4.8", - "resolved": "https://registry.npmjs.org/@types/prompts/-/prompts-2.4.8.tgz", - "integrity": "sha512-fPOEzviubkEVCiLduO45h+zFHB0RZX8tFt3C783sO5cT7fUXf3EEECpD26djtYdh4Isa9Z9tasMQuZnYPtvYzw==", - "optional": true, - "dependencies": { - "@types/node": "*", - "kleur": "^3.0.3" - } - }, "node_modules/@types/prop-types": { "version": "15.7.10", "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.10.tgz", @@ -18017,7 +16423,7 @@ }, "node_modules/@types/qs": { "version": "6.9.7", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/@types/range-parser": { @@ -18090,30 +16496,6 @@ "@types/react": "*" } }, - "node_modules/@types/readable-stream": { - "version": "2.3.15", - "resolved": "https://registry.npmjs.org/@types/readable-stream/-/readable-stream-2.3.15.tgz", - "integrity": "sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ==", - "optional": true, - "dependencies": { - "@types/node": "*", - "safe-buffer": "~5.1.1" - } - }, - "node_modules/@types/readable-stream/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "optional": true - }, - "node_modules/@types/resolve": { - "version": "0.0.8", - "license": "MIT", - "optional": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/responselike": { "version": "1.0.0", "license": "MIT", @@ -18121,11 +16503,6 @@ "@types/node": "*" } }, - "node_modules/@types/retry": { - "version": "0.12.5", - "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.5.tgz", - "integrity": "sha512-3xSjTp3v03X/lSQLkczaN9UIEwJMoMCA1+Nb5HfbJEQWogdeQIyVtTvxPXDQjZ5zws8rFQfVfRdz03ARihPJgw==" - }, "node_modules/@types/secp256k1": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.6.tgz", @@ -18673,15 +17050,6 @@ "node": ">=10" } }, - "node_modules/@uniswap/permit2-sdk": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@uniswap/permit2-sdk/-/permit2-sdk-1.2.0.tgz", - "integrity": "sha512-Ietv3FxN7+RCXcPSED/i/8b0a2GUZrMdyX05k3FsSztvYKyPFAMS/hBXojF0NZqYB1bHecqYc7Ej+7tV/rdYXg==", - "dependencies": { - "ethers": "^5.3.1", - "tiny-invariant": "^1.3.1" - } - }, "node_modules/@uniswap/router-sdk": { "version": "1.9.2", "resolved": "https://registry.npmjs.org/@uniswap/router-sdk/-/router-sdk-1.9.2.tgz", @@ -20071,12 +18439,6 @@ "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", "dev": true }, - "node_modules/@yarnpkg/lockfile": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", - "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", - "optional": true - }, "node_modules/@zxing/text-encoding": { "version": "0.9.0", "license": "(Unlicense OR Apache-2.0)", @@ -20121,25 +18483,8 @@ }, "node_modules/abortcontroller-polyfill": { "version": "1.7.5", - "license": "MIT" - }, - "node_modules/abstract-level": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/abstract-level/-/abstract-level-1.0.3.tgz", - "integrity": "sha512-t6jv+xHy+VYwc4xqZMn2Pa9DjcdzvzZmQGRjTFc8spIbRGHgBrEKbPq+rYXc7CCo0lxgYvSgKVg9qZAhpVQSjA==", - "optional": true, - "dependencies": { - "buffer": "^6.0.3", - "catering": "^2.1.0", - "is-buffer": "^2.0.5", - "level-supports": "^4.0.0", - "level-transcoder": "^1.0.1", - "module-error": "^1.0.1", - "queue-microtask": "^1.2.3" - }, - "engines": { - "node": ">=12" - } + "resolved": "https://registry.npmjs.org/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.5.tgz", + "integrity": "sha512-JMJ5soJWP18htbbxJjG7bG6yuI6pRhgJ0scHHTfkUjf6wjP912xZWvM+A4sJK3gqd9E8fcPbDnOefbA9Th/FIQ==" }, "node_modules/accepts": { "version": "1.3.8", @@ -20233,15 +18578,6 @@ "node": ">=8.9" } }, - "node_modules/adm-zip": { - "version": "0.4.16", - "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.16.tgz", - "integrity": "sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg==", - "optional": true, - "engines": { - "node": ">=0.3.0" - } - }, "node_modules/aes-js": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.1.2.tgz", @@ -20249,7 +18585,7 @@ }, "node_modules/agent-base": { "version": "6.0.2", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "debug": "4" @@ -20260,7 +18596,7 @@ }, "node_modules/aggregate-error": { "version": "3.1.0", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "clean-stack": "^2.0.0", @@ -20386,7 +18722,7 @@ }, "node_modules/ansi-colors": { "version": "4.1.3", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -20444,20 +18780,6 @@ "node": ">=4" } }, - "node_modules/antlr4": { - "version": "4.13.1", - "resolved": "https://registry.npmjs.org/antlr4/-/antlr4-4.13.1.tgz", - "integrity": "sha512-kiXTspaRYvnIArgE97z5YVVf/cDVQABr3abFRR6mE7yesLMkgu4ujuyV/sgxafQ8wgve0DJQUJ38Z8tkgA2izA==", - "optional": true, - "engines": { - "node": ">=16" - } - }, - "node_modules/antlr4ts": { - "version": "0.5.0-alpha.4", - "resolved": "https://registry.npmjs.org/antlr4ts/-/antlr4ts-0.5.0-alpha.4.tgz", - "integrity": "sha512-WPQDt1B74OfPv/IMS2ekXAKkTZIHl88uMetg6q3OTqgFxZ/dxDXI0EWLyZid/1Pe6hTftyg5N7gel5wNAGxXyQ==" - }, "node_modules/any-promise": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", @@ -20592,14 +18914,6 @@ "node": ">=8" } }, - "node_modules/array-uniq": { - "version": "1.0.3", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/array.prototype.findlast": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.3.tgz", @@ -20733,7 +19047,7 @@ }, "node_modules/asap": { "version": "2.0.6", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/asn1": { @@ -20776,21 +19090,6 @@ "node": ">=0.8" } }, - "node_modules/assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", - "optional": true, - "engines": { - "node": "*" - } - }, - "node_modules/ast-parents": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/ast-parents/-/ast-parents-0.0.1.tgz", - "integrity": "sha512-XHusKxKz3zoYk1ic8Un640joHbFMhbqneyoZfoKnEGtf2ey9Uh/IdpcQplODdO/kENaMIWsD0nJm4+wX3UNLHA==", - "optional": true - }, "node_modules/ast-types-flow": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.8.tgz", @@ -20799,7 +19098,7 @@ }, "node_modules/astral-regex": { "version": "2.0.0", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -20812,7 +19111,8 @@ }, "node_modules/async-limiter": { "version": "1.0.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==" }, "node_modules/async-mutex": { "version": "0.2.6", @@ -20835,7 +19135,7 @@ }, "node_modules/at-least-node": { "version": "1.0.0", - "devOptional": true, + "dev": true, "license": "ISC", "engines": { "node": ">= 4.0.0" @@ -21052,6 +19352,7 @@ }, "node_modules/babel-plugin-macros": { "version": "3.1.0", + "dev": true, "license": "MIT", "dependencies": { "@babel/runtime": "^7.12.5", @@ -21257,15 +19558,6 @@ "node": "*" } }, - "node_modules/bigint-crypto-utils": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.3.0.tgz", - "integrity": "sha512-jOTSb+drvEDxEq6OuUybOAv/xxoh3cuYRUIPyu8sSHQNKM303UQ2R1DAo45o1AkcIXw6fzbaFI1+xGGdaXs2lg==", - "optional": true, - "engines": { - "node": ">=14.0.0" - } - }, "node_modules/bignumber.js": { "version": "9.1.2", "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", @@ -21373,8 +19665,9 @@ "license": "MIT" }, "node_modules/body-parser": { - "version": "1.20.2", - "license": "MIT", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "dependencies": { "bytes": "3.1.2", "content-type": "~1.0.5", @@ -21384,7 +19677,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -21396,14 +19689,16 @@ }, "node_modules/body-parser/node_modules/debug": { "version": "2.6.9", - "license": "MIT", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dependencies": { "ms": "2.0.0" } }, "node_modules/body-parser/node_modules/iconv-lite": { "version": "0.4.24", - "license": "MIT", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dependencies": { "safer-buffer": ">= 2.1.2 < 3" }, @@ -21413,13 +19708,15 @@ }, "node_modules/body-parser/node_modules/ms": { "version": "2.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, "node_modules/body-parser/node_modules/qs": { - "version": "6.11.0", - "license": "BSD-3-Clause", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "dependencies": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" }, "engines": { "node": ">=0.6" @@ -21500,18 +19797,6 @@ "resolved": "https://registry.npmjs.org/browser-headers/-/browser-headers-0.4.1.tgz", "integrity": "sha512-CA9hsySZVo9371qEHjHZtYxV2cFtVj5Wj/ZHi8ooEsrtm4vOnl9Y9HmyYWk9q+05d7K3rdoAE0j3MVEFVvtQtg==" }, - "node_modules/browser-level": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browser-level/-/browser-level-1.0.1.tgz", - "integrity": "sha512-XECYKJ+Dbzw0lbydyQuJzwNXtOpbMSq737qxJN11sIRTErOMShvDpbzTlgju7orJKvx4epULolZAuJGLzCmWRQ==", - "optional": true, - "dependencies": { - "abstract-level": "^1.0.2", - "catering": "^2.1.1", - "module-error": "^1.0.2", - "run-parallel-limit": "^1.1.0" - } - }, "node_modules/browser-process-hrtime": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", @@ -21522,12 +19807,6 @@ "version": "1.0.3", "license": "ISC" }, - "node_modules/browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "optional": true - }, "node_modules/browserify-aes": { "version": "1.2.0", "license": "MIT", @@ -21680,7 +19959,7 @@ }, "node_modules/buffer-from": { "version": "1.1.2", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/buffer-reverse": { @@ -21790,6 +20069,7 @@ }, "node_modules/callsites": { "version": "3.1.0", + "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -21885,15 +20165,6 @@ "multiformats": "^9.0.4" } }, - "node_modules/case": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/case/-/case-1.6.3.tgz", - "integrity": "sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ==", - "optional": true, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/case-sensitive-paths-webpack-plugin": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.4.0.tgz", @@ -21907,27 +20178,6 @@ "version": "0.12.0", "license": "Apache-2.0" }, - "node_modules/catering": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/catering/-/catering-2.1.1.tgz", - "integrity": "sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w==", - "optional": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/cbor": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/cbor/-/cbor-8.1.0.tgz", - "integrity": "sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg==", - "optional": true, - "dependencies": { - "nofilter": "^3.1.0" - }, - "engines": { - "node": ">=12.19" - } - }, "node_modules/cborg": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/cborg/-/cborg-1.10.2.tgz", @@ -21958,24 +20208,6 @@ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" }, - "node_modules/chai": { - "version": "4.3.10", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.10.tgz", - "integrity": "sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g==", - "optional": true, - "dependencies": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.3", - "deep-eql": "^4.1.3", - "get-func-name": "^2.0.2", - "loupe": "^2.3.6", - "pathval": "^1.1.1", - "type-detect": "^4.0.8" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -22056,18 +20288,6 @@ "node": "*" } }, - "node_modules/check-error": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", - "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", - "optional": true, - "dependencies": { - "get-func-name": "^2.0.2" - }, - "engines": { - "node": "*" - } - }, "node_modules/check-more-types": { "version": "2.24.0", "dev": true, @@ -22106,6 +20326,11 @@ "fsevents": "~2.3.2" } }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" + }, "node_modules/chrome-trace-event": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", @@ -22174,7 +20399,8 @@ }, "node_modules/class-is": { "version": "1.1.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/class-is/-/class-is-1.1.0.tgz", + "integrity": "sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw==" }, "node_modules/class-variance-authority": { "version": "0.6.1", @@ -22187,23 +20413,6 @@ "url": "https://joebell.co.uk" } }, - "node_modules/classic-level": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/classic-level/-/classic-level-1.3.0.tgz", - "integrity": "sha512-iwFAJQYtqRTRM0F6L8h4JCt00ZSGdOyqh7yVrhhjrOpFhmBjNlRUey64MCiyo6UmQHMJ+No3c81nujPv+n9yrg==", - "hasInstallScript": true, - "optional": true, - "dependencies": { - "abstract-level": "^1.0.2", - "catering": "^2.1.0", - "module-error": "^1.0.1", - "napi-macros": "^2.2.2", - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/clean-css": { "version": "5.3.3", "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.3.tgz", @@ -22227,7 +20436,7 @@ }, "node_modules/clean-stack": { "version": "2.2.0", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -22546,15 +20755,6 @@ "dev": true, "license": "MIT" }, - "node_modules/colors": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", - "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", - "optional": true, - "engines": { - "node": ">=0.1.90" - } - }, "node_modules/combined-stream": { "version": "1.0.8", "license": "MIT", @@ -22565,12 +20765,6 @@ "node": ">= 0.8" } }, - "node_modules/command-exists": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", - "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", - "optional": true - }, "node_modules/command-line-args": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", @@ -22683,57 +20877,6 @@ "version": "0.0.1", "license": "MIT" }, - "node_modules/concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "engines": [ - "node >= 0.8" - ], - "optional": true, - "dependencies": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, - "node_modules/concat-stream/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "optional": true - }, - "node_modules/concat-stream/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "optional": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/concat-stream/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "optional": true - }, - "node_modules/concat-stream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "optional": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/configstore": { "version": "5.0.1", "license": "BSD-2-Clause", @@ -22774,7 +20917,8 @@ }, "node_modules/content-hash": { "version": "2.5.2", - "license": "ISC", + "resolved": "https://registry.npmjs.org/content-hash/-/content-hash-2.5.2.tgz", + "integrity": "sha512-FvIQKy0S1JaWV10sMsA7TRx8bpU+pqPkhbsfvOJAdjRXvYxEckAwQWGwtRjiaJfh+E0DvcWUGqcdjwMGFjsSdw==", "dependencies": { "cids": "^0.7.1", "multicodec": "^0.5.5", @@ -22783,6 +20927,8 @@ }, "node_modules/content-hash/node_modules/buffer": { "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "funding": [ { "type": "github", @@ -22797,7 +20943,6 @@ "url": "https://feross.org/support" } ], - "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -22805,7 +20950,9 @@ }, "node_modules/content-hash/node_modules/cids": { "version": "0.7.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/cids/-/cids-0.7.5.tgz", + "integrity": "sha512-zT7mPeghoWAu+ppn8+BS1tQ5qGmbMfB4AregnQjA/qHY3GC1m1ptI9GkWNlgeu38r7CuRdXB47uY2XgAYt6QVA==", + "deprecated": "This module has been superseded by the multiformats module", "dependencies": { "buffer": "^5.5.0", "class-is": "^1.1.0", @@ -22820,7 +20967,9 @@ }, "node_modules/content-hash/node_modules/cids/node_modules/multicodec": { "version": "1.0.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-1.0.4.tgz", + "integrity": "sha512-NDd7FeS3QamVtbgfvu5h7fd1IlbaC4EQ0/pgU4zqE2vdHCmBGsUa0TiM8/TdSeG6BMPC92OOCf8F1ocE/Wkrrg==", + "deprecated": "This module has been superseded by the multiformats module", "dependencies": { "buffer": "^5.6.0", "varint": "^5.0.0" @@ -22828,7 +20977,9 @@ }, "node_modules/content-hash/node_modules/multibase": { "version": "0.6.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.6.1.tgz", + "integrity": "sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw==", + "deprecated": "This module has been superseded by the multiformats module", "dependencies": { "base-x": "^3.0.8", "buffer": "^5.5.0" @@ -22836,14 +20987,17 @@ }, "node_modules/content-hash/node_modules/multicodec": { "version": "0.5.7", - "license": "MIT", + "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-0.5.7.tgz", + "integrity": "sha512-PscoRxm3f+88fAtELwUnZxGDkduE2HD9Q6GHUOywQLjOGT/HAdhjLDYNZ1e7VR0s0TP0EwZ16LNUTFpoBGivOA==", + "deprecated": "This module has been superseded by the multiformats module", "dependencies": { "varint": "^5.0.0" } }, "node_modules/content-hash/node_modules/multihashes": { "version": "0.4.21", - "license": "MIT", + "resolved": "https://registry.npmjs.org/multihashes/-/multihashes-0.4.21.tgz", + "integrity": "sha512-uVSvmeCWf36pU2nB4/1kzYZjsXD9vofZKpgudqkceYY5g2aZZXJ5r9lxuzoRLl1OAp28XljXsEJ/X/85ZsKmKw==", "dependencies": { "buffer": "^5.5.0", "multibase": "^0.7.0", @@ -22852,7 +21006,9 @@ }, "node_modules/content-hash/node_modules/multihashes/node_modules/multibase": { "version": "0.7.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.7.0.tgz", + "integrity": "sha512-TW8q03O0f6PNFTQDvh3xxH03c8CjGaaYrjkl9UQPG6rz53TQzzxJVCIWVjzcbN/Q5Y53Zd0IBQBMVktVgNx4Fg==", + "deprecated": "This module has been superseded by the multiformats module", "dependencies": { "base-x": "^3.0.8", "buffer": "^5.5.0" @@ -22860,7 +21016,8 @@ }, "node_modules/content-hash/node_modules/varint": { "version": "5.0.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", + "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==" }, "node_modules/content-type": { "version": "1.0.5", @@ -22871,17 +21028,9 @@ }, "node_modules/convert-source-map": { "version": "1.9.0", + "dev": true, "license": "MIT" }, - "node_modules/cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", - "optional": true, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/cookie-es": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/cookie-es/-/cookie-es-1.0.0.tgz", @@ -22944,7 +21093,8 @@ }, "node_modules/cors": { "version": "2.8.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", "dependencies": { "object-assign": "^4", "vary": "^1" @@ -22955,6 +21105,7 @@ }, "node_modules/cosmiconfig": { "version": "7.1.0", + "dev": true, "license": "MIT", "dependencies": { "@types/parse-json": "^4.0.0", @@ -23070,11 +21221,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/create-require": { - "version": "1.1.1", - "license": "MIT", - "optional": true - }, "node_modules/cross-fetch": { "version": "3.1.6", "license": "MIT", @@ -24368,18 +22514,6 @@ } } }, - "node_modules/deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", - "optional": true, - "dependencies": { - "type-detect": "^4.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/deep-extend": { "version": "0.6.0", "license": "MIT", @@ -24639,15 +22773,6 @@ "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==", "dev": true }, - "node_modules/diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", - "optional": true, - "engines": { - "node": ">=0.3.1" - } - }, "node_modules/diff-sequences": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", @@ -25371,11 +23496,6 @@ "node": ">= 4" } }, - "node_modules/emotion-theming": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/emotion-theming/-/emotion-theming-11.0.0.tgz", - "integrity": "sha512-OhYpCGBjaLcD9c4ptwCr9SxHjfRTDqeqdzMobusJ+a/drlfnJ3AT9gmGKIhNHiXtr6626h6fsvLY22Or9CxUqw==" - }, "node_modules/enc-utils": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/enc-utils/-/enc-utils-3.0.0.tgz", @@ -25465,7 +23585,7 @@ }, "node_modules/enquirer": { "version": "2.3.6", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "ansi-colors": "^4.1.1" @@ -25482,15 +23602,6 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, - "node_modules/env-paths": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", - "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", - "optional": true, - "engines": { - "node": ">=6" - } - }, "node_modules/err-code": { "version": "3.0.1", "license": "MIT" @@ -25696,7 +23807,8 @@ }, "node_modules/es6-promise": { "version": "4.2.8", - "license": "MIT" + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" }, "node_modules/es6-symbol": { "version": "3.1.3", @@ -25726,6 +23838,7 @@ }, "node_modules/escape-string-regexp": { "version": "4.0.0", + "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -26564,7 +24677,8 @@ }, "node_modules/eth-ens-namehash": { "version": "2.0.8", - "license": "ISC", + "resolved": "https://registry.npmjs.org/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz", + "integrity": "sha512-VWEI1+KJfz4Km//dadyvBBoBeSQ0MHTXPvr8UIXiLW6IanxvAV+DmlZAijZwAyggqGUfwQBeHf7tc9wzc1piSw==", "dependencies": { "idna-uts46-hx": "^2.3.1", "js-sha3": "^0.5.7" @@ -26572,163 +24686,8 @@ }, "node_modules/eth-ens-namehash/node_modules/js-sha3": { "version": "0.5.7", - "license": "MIT" - }, - "node_modules/eth-gas-reporter": { - "version": "0.2.27", - "resolved": "https://registry.npmjs.org/eth-gas-reporter/-/eth-gas-reporter-0.2.27.tgz", - "integrity": "sha512-femhvoAM7wL0GcI8ozTdxfuBtBFJ9qsyIAsmKVjlWAHUbdnnXHt+lKzz/kmldM5lA9jLuNHGwuIxorNpLbR1Zw==", - "optional": true, - "dependencies": { - "@solidity-parser/parser": "^0.14.0", - "axios": "^1.5.1", - "cli-table3": "^0.5.0", - "colors": "1.4.0", - "ethereum-cryptography": "^1.0.3", - "ethers": "^5.7.2", - "fs-readdir-recursive": "^1.1.0", - "lodash": "^4.17.14", - "markdown-table": "^1.1.3", - "mocha": "^10.2.0", - "req-cwd": "^2.0.0", - "sha1": "^1.1.1", - "sync-request": "^6.0.0" - }, - "peerDependencies": { - "@codechecks/client": "^0.1.0" - }, - "peerDependenciesMeta": { - "@codechecks/client": { - "optional": true - } - } - }, - "node_modules/eth-gas-reporter/node_modules/@noble/hashes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.2.0.tgz", - "integrity": "sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "optional": true - }, - "node_modules/eth-gas-reporter/node_modules/@scure/bip32": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.1.5.tgz", - "integrity": "sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "optional": true, - "dependencies": { - "@noble/hashes": "~1.2.0", - "@noble/secp256k1": "~1.7.0", - "@scure/base": "~1.1.0" - } - }, - "node_modules/eth-gas-reporter/node_modules/@scure/bip39": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.1.1.tgz", - "integrity": "sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "optional": true, - "dependencies": { - "@noble/hashes": "~1.2.0", - "@scure/base": "~1.1.0" - } - }, - "node_modules/eth-gas-reporter/node_modules/ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", - "optional": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/eth-gas-reporter/node_modules/axios": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", - "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", - "optional": true, - "dependencies": { - "follow-redirects": "^1.15.0", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - } - }, - "node_modules/eth-gas-reporter/node_modules/cli-table3": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.5.1.tgz", - "integrity": "sha512-7Qg2Jrep1S/+Q3EceiZtQcDPWxhAvBw+ERf1162v4sikJrvojMHFqXt8QIVha8UlH9rgU0BeWPytZ9/TzYqlUw==", - "optional": true, - "dependencies": { - "object-assign": "^4.1.0", - "string-width": "^2.1.1" - }, - "engines": { - "node": ">=6" - }, - "optionalDependencies": { - "colors": "^1.1.2" - } - }, - "node_modules/eth-gas-reporter/node_modules/ethereum-cryptography": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-1.2.0.tgz", - "integrity": "sha512-6yFQC9b5ug6/17CQpCyE3k9eKBMdhyVjzUy1WkiuY/E4vj/SXDBbCw8QEIaXqf0Mf2SnY6RmpDcwlUmBSS0EJw==", - "optional": true, - "dependencies": { - "@noble/hashes": "1.2.0", - "@noble/secp256k1": "1.7.1", - "@scure/bip32": "1.1.5", - "@scure/bip39": "1.1.1" - } - }, - "node_modules/eth-gas-reporter/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", - "optional": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/eth-gas-reporter/node_modules/string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "optional": true, - "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eth-gas-reporter/node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", - "optional": true, - "dependencies": { - "ansi-regex": "^3.0.0" - }, - "engines": { - "node": ">=4" - } + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", + "integrity": "sha512-GII20kjaPX0zJ8wzkTbNDYMY7msuZcTWk8S5UOh6806Jq/wz1J8/bnr8uGU0DAUmYDjj2Mr4X1cW8v/GLYnR+g==" }, "node_modules/eth-json-rpc-filters": { "version": "6.0.0", @@ -26756,7 +24715,8 @@ }, "node_modules/eth-lib": { "version": "0.1.29", - "license": "MIT", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.1.29.tgz", + "integrity": "sha512-bfttrr3/7gG4E02HoWTDUcDDslN003OlOoBxk9virpAZQ1ja/jDgwkWB8QfJF7ojuEowrqy+lzp9VcJG7/k5bQ==", "dependencies": { "bn.js": "^4.11.6", "elliptic": "^6.4.0", @@ -26768,15 +24728,18 @@ }, "node_modules/eth-lib/node_modules/bn.js": { "version": "4.12.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" }, "node_modules/eth-lib/node_modules/safe-buffer": { "version": "5.1.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "node_modules/eth-lib/node_modules/ws": { "version": "3.3.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", + "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", "dependencies": { "async-limiter": "~1.0.0", "safe-buffer": "~5.1.0", @@ -26823,15 +24786,6 @@ "@scure/bip39": "1.2.0" } }, - "node_modules/ethereum-multicall": { - "version": "2.21.0", - "resolved": "https://registry.npmjs.org/ethereum-multicall/-/ethereum-multicall-2.21.0.tgz", - "integrity": "sha512-J234OuvUheTKvZVhMk41SwyB66m+MU+Xe2FFWOln8xu6TXKzOzsjSFQn/f5OTDGEiRStKMnJpCvQDim+Uk+qBQ==", - "dependencies": { - "@ethersproject/providers": "^5.0.10", - "ethers": "^5.0.15" - } - }, "node_modules/ethereumjs-abi": { "version": "0.6.8", "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz", @@ -27547,7 +25501,7 @@ }, "node_modules/fast-diff": { "version": "1.2.0", - "devOptional": true, + "dev": true, "license": "Apache-2.0" }, "node_modules/fast-fifo": { @@ -27838,11 +25792,6 @@ "node": ">=4.0.0" } }, - "node_modules/find-root": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", - "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==" - }, "node_modules/find-up": { "version": "2.1.0", "license": "MIT", @@ -27853,24 +25802,6 @@ "node": ">=4" } }, - "node_modules/find-yarn-workspace-root": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", - "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==", - "optional": true, - "dependencies": { - "micromatch": "^4.0.2" - } - }, - "node_modules/flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "optional": true, - "bin": { - "flat": "cli.js" - } - }, "node_modules/flat-cache": { "version": "3.0.4", "dev": true, @@ -28063,6 +25994,11 @@ "node": ">= 6" } }, + "node_modules/form-data-encoder": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-1.7.1.tgz", + "integrity": "sha512-EFRDrsMm/kyqbTQocNvRXMLjc7Es2Vk+IQFx/YW7hkUH1eBl4J1fqiP34l74Yt0pFLCNpc06fkbVk00008mzjg==" + }, "node_modules/format-io": { "version": "2.0.0", "license": "MIT", @@ -28080,12 +26016,6 @@ "node": ">= 0.6" } }, - "node_modules/fp-ts": { - "version": "1.19.3", - "resolved": "https://registry.npmjs.org/fp-ts/-/fp-ts-1.19.3.tgz", - "integrity": "sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg==", - "optional": true - }, "node_modules/fraction.js": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", @@ -28136,17 +26066,37 @@ "license": "MIT" }, "node_modules/fs-extra": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.1.tgz", - "integrity": "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==", - "optional": true, + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", + "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "node_modules/fs-extra/node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/fs-extra/node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "engines": { - "node": ">=14.14" + "node": ">= 4.0.0" + } + }, + "node_modules/fs-minipass": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", + "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", + "dependencies": { + "minipass": "^2.6.0" } }, "node_modules/fs-monkey": { @@ -28155,12 +26105,6 @@ "integrity": "sha512-8uMbBjrhzW76TYgEV27Y5E//W2f/lTFmx78P2w19FZSxarhI/798APGQyuGCwmkNxgwGRhrLfvWyLBvNtuOmew==", "dev": true }, - "node_modules/fs-readdir-recursive": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", - "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", - "optional": true - }, "node_modules/fs.realpath": { "version": "1.0.0", "license": "ISC" @@ -28205,7 +26149,7 @@ }, "node_modules/functional-red-black-tree": { "version": "1.0.1", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/functions-have-names": { @@ -28244,15 +26188,6 @@ "node": "6.* || 8.* || >= 10.*" } }, - "node_modules/get-func-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", - "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", - "optional": true, - "engines": { - "node": "*" - } - }, "node_modules/get-intrinsic": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", @@ -28302,15 +26237,6 @@ "node": ">=8.0.0" } }, - "node_modules/get-port": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", - "integrity": "sha512-x5UJKlgeUiNT8nyo/AcnwLnZuZNcSjSw0kogRB+Whd1fjjFq4B1hySFxSFWWSn4mIBzg3sRNUDFYc4g5gjPoLg==", - "optional": true, - "engines": { - "node": ">=4" - } - }, "node_modules/get-port-please": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/get-port-please/-/get-port-please-3.1.2.tgz", @@ -28667,14 +26593,17 @@ }, "node_modules/har-schema": { "version": "2.0.0", - "license": "ISC", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", "engines": { "node": ">=4" } }, "node_modules/har-validator": { "version": "5.1.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "deprecated": "this library is no longer supported", "dependencies": { "ajv": "^6.12.3", "har-schema": "^2.0.0" @@ -28690,114 +26619,6 @@ "node": ">=6" } }, - "node_modules/hardhat": { - "version": "2.19.1", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.19.1.tgz", - "integrity": "sha512-bsWa63g1GB78ZyMN08WLhFElLPA+J+pShuKD1BFO2+88g3l+BL3R07vj9deIi9dMbssxgE714Gof1dBEDGqnCw==", - "optional": true, - "dependencies": { - "@ethersproject/abi": "^5.1.2", - "@metamask/eth-sig-util": "^4.0.0", - "@nomicfoundation/ethereumjs-block": "5.0.2", - "@nomicfoundation/ethereumjs-blockchain": "7.0.2", - "@nomicfoundation/ethereumjs-common": "4.0.2", - "@nomicfoundation/ethereumjs-evm": "2.0.2", - "@nomicfoundation/ethereumjs-rlp": "5.0.2", - "@nomicfoundation/ethereumjs-statemanager": "2.0.2", - "@nomicfoundation/ethereumjs-trie": "6.0.2", - "@nomicfoundation/ethereumjs-tx": "5.0.2", - "@nomicfoundation/ethereumjs-util": "9.0.2", - "@nomicfoundation/ethereumjs-vm": "7.0.2", - "@nomicfoundation/solidity-analyzer": "^0.1.0", - "@sentry/node": "^5.18.1", - "@types/bn.js": "^5.1.0", - "@types/lru-cache": "^5.1.0", - "adm-zip": "^0.4.16", - "aggregate-error": "^3.0.0", - "ansi-escapes": "^4.3.0", - "chalk": "^2.4.2", - "chokidar": "^3.4.0", - "ci-info": "^2.0.0", - "debug": "^4.1.1", - "enquirer": "^2.3.0", - "env-paths": "^2.2.0", - "ethereum-cryptography": "^1.0.3", - "ethereumjs-abi": "^0.6.8", - "find-up": "^2.1.0", - "fp-ts": "1.19.3", - "fs-extra": "^7.0.1", - "glob": "7.2.0", - "immutable": "^4.0.0-rc.12", - "io-ts": "1.10.4", - "keccak": "^3.0.2", - "lodash": "^4.17.11", - "mnemonist": "^0.38.0", - "mocha": "^10.0.0", - "p-map": "^4.0.0", - "raw-body": "^2.4.1", - "resolve": "1.17.0", - "semver": "^6.3.0", - "solc": "0.7.3", - "source-map-support": "^0.5.13", - "stacktrace-parser": "^0.1.10", - "tsort": "0.0.1", - "undici": "^5.14.0", - "uuid": "^8.3.2", - "ws": "^7.4.6" - }, - "bin": { - "hardhat": "internal/cli/bootstrap.js" - }, - "peerDependencies": { - "ts-node": "*", - "typescript": "*" - }, - "peerDependenciesMeta": { - "ts-node": { - "optional": true - }, - "typescript": { - "optional": true - } - } - }, - "node_modules/hardhat-gas-reporter": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/hardhat-gas-reporter/-/hardhat-gas-reporter-1.0.9.tgz", - "integrity": "sha512-INN26G3EW43adGKBNzYWOlI3+rlLnasXTwW79YNnUhXPDa+yHESgt639dJEs37gCjhkbNKcRRJnomXEuMFBXJg==", - "optional": true, - "dependencies": { - "array-uniq": "1.0.3", - "eth-gas-reporter": "^0.2.25", - "sha1": "^1.1.1" - }, - "peerDependencies": { - "hardhat": "^2.0.2" - } - }, - "node_modules/hardhat-spdx-license-identifier": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/hardhat-spdx-license-identifier/-/hardhat-spdx-license-identifier-2.2.0.tgz", - "integrity": "sha512-audxGrmLL/TGr0Ef/p3tEH8frtygCb+9RWbMQtd1w2p5V6HzQsSJUlAJFywZZ/igQ6B1qAKqAbeLePNclEe2Qw==", - "optional": true, - "peerDependencies": { - "hardhat": "^2.0.0" - } - }, - "node_modules/hardhat-tracer": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/hardhat-tracer/-/hardhat-tracer-1.3.0.tgz", - "integrity": "sha512-mUYuRJWlxCwY4R2urCpNM4ecVSq/iMLiVP9YZKlfXyv4R8T+4HAcTfumilUOXHGe6wHI+8Ki2EaTon3KgzATDA==", - "optional": true, - "dependencies": { - "ethers": "^5.6.1" - }, - "peerDependencies": { - "chalk": "4.x", - "ethers": "5.x", - "hardhat": "2.x" - } - }, "node_modules/hardhat-watcher": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/hardhat-watcher/-/hardhat-watcher-2.5.0.tgz", @@ -28809,130 +26630,6 @@ "hardhat": "^2.0.0" } }, - "node_modules/hardhat/node_modules/@noble/hashes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.2.0.tgz", - "integrity": "sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "optional": true - }, - "node_modules/hardhat/node_modules/@scure/bip32": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.1.5.tgz", - "integrity": "sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "optional": true, - "dependencies": { - "@noble/hashes": "~1.2.0", - "@noble/secp256k1": "~1.7.0", - "@scure/base": "~1.1.0" - } - }, - "node_modules/hardhat/node_modules/@scure/bip39": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.1.1.tgz", - "integrity": "sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "optional": true, - "dependencies": { - "@noble/hashes": "~1.2.0", - "@scure/base": "~1.1.0" - } - }, - "node_modules/hardhat/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "optional": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/hardhat/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "optional": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/hardhat/node_modules/ethereum-cryptography": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-1.2.0.tgz", - "integrity": "sha512-6yFQC9b5ug6/17CQpCyE3k9eKBMdhyVjzUy1WkiuY/E4vj/SXDBbCw8QEIaXqf0Mf2SnY6RmpDcwlUmBSS0EJw==", - "optional": true, - "dependencies": { - "@noble/hashes": "1.2.0", - "@noble/secp256k1": "1.7.1", - "@scure/bip32": "1.1.5", - "@scure/bip39": "1.1.1" - } - }, - "node_modules/hardhat/node_modules/fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "optional": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - }, - "engines": { - "node": ">=6 <7 || >=8" - } - }, - "node_modules/hardhat/node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "optional": true, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/hardhat/node_modules/resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", - "optional": true, - "dependencies": { - "path-parse": "^1.0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hardhat/node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "optional": true, - "engines": { - "node": ">= 4.0.0" - } - }, "node_modules/harmony-reflect": { "version": "1.6.2", "dev": true, @@ -29038,7 +26735,7 @@ }, "node_modules/he": { "version": "1.2.0", - "devOptional": true, + "dev": true, "license": "MIT", "bin": { "he": "bin/he" @@ -29291,21 +26988,6 @@ "entities": "^2.0.0" } }, - "node_modules/http-basic": { - "version": "8.1.3", - "resolved": "https://registry.npmjs.org/http-basic/-/http-basic-8.1.3.tgz", - "integrity": "sha512-/EcDMwJZh3mABI2NhGfHOGOeOZITqfkEO4p/xK+l3NpyncIHUQBoMvCSF/b5GqvKtySC2srL/GGG3+EtlqlmCw==", - "optional": true, - "dependencies": { - "caseless": "^0.12.0", - "concat-stream": "^1.6.2", - "http-response-object": "^3.0.1", - "parse-cache-control": "^1.0.1" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/http-cache-semantics": { "version": "4.1.1", "license": "BSD-2-Clause" @@ -29404,21 +27086,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/http-response-object": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/http-response-object/-/http-response-object-3.0.2.tgz", - "integrity": "sha512-bqX0XTF6fnXSQcEJ2Iuyr75yVakyjIDCqroJQ/aHfSdlM743Cwqoi2nDYMzLGWUcuTWGWy8AAvOKXTfiv6q9RA==", - "optional": true, - "dependencies": { - "@types/node": "^10.0.3" - } - }, - "node_modules/http-response-object/node_modules/@types/node": { - "version": "10.17.60", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", - "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==", - "optional": true - }, "node_modules/http-shutdown": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/http-shutdown/-/http-shutdown-1.2.2.tgz", @@ -29465,7 +27132,7 @@ }, "node_modules/https-proxy-agent": { "version": "5.0.1", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "agent-base": "6", @@ -29590,7 +27257,8 @@ }, "node_modules/idna-uts46-hx": { "version": "2.3.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/idna-uts46-hx/-/idna-uts46-hx-2.3.1.tgz", + "integrity": "sha512-PWoF9Keq6laYdIRwwCdhTPl60xRqAloYNMQLiyUnG42VjT53oW07BXIRM+NK7eQjzXjAk2gUvX9caRxlnF9TAA==", "dependencies": { "punycode": "2.1.0" }, @@ -29600,7 +27268,8 @@ }, "node_modules/idna-uts46-hx/node_modules/punycode": { "version": "2.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.0.tgz", + "integrity": "sha512-Yxz2kRwT90aPiWEMHVYnEf4+rhwF1tBmmZ4KepCP+Wkium9JxtWnUm1nqGwpiAHr/tnTSeHqr3wb++jgSkXjhA==", "engines": { "node": ">=6" } @@ -29658,6 +27327,7 @@ }, "node_modules/import-fresh": { "version": "3.3.0", + "dev": true, "license": "MIT", "dependencies": { "parent-module": "^1.0.0", @@ -29841,15 +27511,6 @@ "loose-envify": "^1.0.0" } }, - "node_modules/io-ts": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/io-ts/-/io-ts-1.10.4.tgz", - "integrity": "sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g==", - "optional": true, - "dependencies": { - "fp-ts": "^1.0.0" - } - }, "node_modules/ip-regex": { "version": "4.3.0", "license": "MIT", @@ -30505,29 +28166,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-buffer": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", - "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "optional": true, - "engines": { - "node": ">=4" - } - }, "node_modules/is-callable": { "version": "1.2.7", "license": "MIT", @@ -30979,7 +28617,7 @@ }, "node_modules/is-unicode-supported": { "version": "0.1.0", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -31056,7 +28694,7 @@ }, "node_modules/isarray": { "version": "0.0.1", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/isexe": { @@ -31097,15 +28735,6 @@ "node": ">=0.10.0" } }, - "node_modules/isomorphic-fetch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz", - "integrity": "sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==", - "dependencies": { - "node-fetch": "^2.6.1", - "whatwg-fetch": "^3.4.1" - } - }, "node_modules/isomorphic-unfetch": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/isomorphic-unfetch/-/isomorphic-unfetch-3.1.0.tgz", @@ -33938,16 +31567,6 @@ "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-2.2.1.tgz", "integrity": "sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ==" }, - "node_modules/js-sdsl": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.2.tgz", - "integrity": "sha512-dwXFwByc/ajSV6m5bcKAPwe4yDDF6D614pxmIi5odytzxRlwqF6nwoiCek80Ixc7Cvma5awClxrzFtxCQvcM8w==", - "optional": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/js-sdsl" - } - }, "node_modules/js-sha3": { "version": "0.8.0", "license": "MIT" @@ -34306,12 +31925,6 @@ "node": ">=4.0" } }, - "node_modules/just-extend": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", - "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", - "optional": true - }, "node_modules/jwt-decode": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-3.1.2.tgz", @@ -34358,27 +31971,9 @@ "node": ">=0.10.0" } }, - "node_modules/klaw": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", - "integrity": "sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw==", - "optional": true, - "optionalDependencies": { - "graceful-fs": "^4.1.9" - } - }, - "node_modules/klaw-sync": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", - "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", - "optional": true, - "dependencies": { - "graceful-fs": "^4.1.11" - } - }, "node_modules/kleur": { "version": "3.0.3", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -34439,45 +32034,6 @@ "node": "> 0.8" } }, - "node_modules/level": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/level/-/level-8.0.0.tgz", - "integrity": "sha512-ypf0jjAk2BWI33yzEaaotpq7fkOPALKAgDBxggO6Q9HGX2MRXn0wbP1Jn/tJv1gtL867+YOjOB49WaUF3UoJNQ==", - "optional": true, - "dependencies": { - "browser-level": "^1.0.1", - "classic-level": "^1.2.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/level" - } - }, - "node_modules/level-supports": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-4.0.1.tgz", - "integrity": "sha512-PbXpve8rKeNcZ9C1mUicC9auIYFyGpkV9/i6g76tLgANwWhtG2v7I4xNBUlkn3lE2/dZF3Pi0ygYGtLc4RXXdA==", - "optional": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/level-transcoder": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/level-transcoder/-/level-transcoder-1.0.1.tgz", - "integrity": "sha512-t7bFwFtsQeD8cl8NIoQ2iwxA0CL/9IFw7/9gAjOonH0PWTTiRfY7Hq+Ejbsxh86tXobDQ6IOiddjNYIfOBs06w==", - "optional": true, - "dependencies": { - "buffer": "^6.0.3", - "module-error": "^1.0.1" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", @@ -34966,7 +32522,7 @@ }, "node_modules/lodash.truncate": { "version": "4.4.2", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/lodash.uniq": { @@ -34977,7 +32533,7 @@ }, "node_modules/log-symbols": { "version": "4.1.0", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "chalk": "^4.1.0", @@ -35096,15 +32652,6 @@ "node": ">=0.10.0" } }, - "node_modules/loupe": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", - "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", - "optional": true, - "dependencies": { - "get-func-name": "^2.0.1" - } - }, "node_modules/lower-case": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", @@ -35120,12 +32667,6 @@ "node": ">=8" } }, - "node_modules/lru_map": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz", - "integrity": "sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==", - "optional": true - }, "node_modules/lru-cache": { "version": "5.1.1", "license": "ISC", @@ -35183,11 +32724,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/make-error": { - "version": "1.3.6", - "license": "ISC", - "optional": true - }, "node_modules/makeerror": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", @@ -35210,21 +32746,6 @@ "version": "0.1.0", "dev": true }, - "node_modules/markdown-table": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-1.1.3.tgz", - "integrity": "sha512-1RUZVgQlpJSPWYbFSpmudq5nHY1doEIv89gBtF0s4gW1GF2XorxcA/70M5vq7rLv0a6mhOUccRsqkwhwLCIQ2Q==", - "optional": true - }, - "node_modules/mcl-wasm": { - "version": "0.7.9", - "resolved": "https://registry.npmjs.org/mcl-wasm/-/mcl-wasm-0.7.9.tgz", - "integrity": "sha512-iJIUcQWA88IJB/5L15GnJVnSQJmf/YaxxV6zRavv83HILHaJQb6y0iFyDMdDO0gN8X37tdxmAOrH/P8B6RB8sQ==", - "optional": true, - "engines": { - "node": ">=8.9.0" - } - }, "node_modules/md5.js": { "version": "1.3.5", "license": "MIT", @@ -35263,29 +32784,6 @@ "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz", "integrity": "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==" }, - "node_modules/memory-level": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/memory-level/-/memory-level-1.0.0.tgz", - "integrity": "sha512-UXzwewuWeHBz5krr7EvehKcmLFNoXxGcvuYhC41tRnkrTbJohtS7kVn9akmgirtRygg+f7Yjsfi8Uu5SGSQ4Og==", - "optional": true, - "dependencies": { - "abstract-level": "^1.0.0", - "functional-red-black-tree": "^1.0.1", - "module-error": "^1.0.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/memorystream": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", - "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", - "optional": true, - "engines": { - "node": ">= 0.10.0" - } - }, "node_modules/meow": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/meow/-/meow-9.0.0.tgz", @@ -35711,6 +33209,23 @@ "node": ">=0.10.0" } }, + "node_modules/minipass": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", + "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", + "dependencies": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "node_modules/minizlib": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", + "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", + "dependencies": { + "minipass": "^2.9.0" + } + }, "node_modules/mipd": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/mipd/-/mipd-0.0.7.tgz", @@ -35747,7 +33262,9 @@ }, "node_modules/mkdirp-promise": { "version": "5.0.1", - "license": "ISC", + "resolved": "https://registry.npmjs.org/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz", + "integrity": "sha512-Hepn5kb1lJPtVW84RFT40YG1OddBNTOVUZR2bzQUHc+Z03en8/3uX0+060JDhcEzyO08HmipsN9DcnFMxhIL9w==", + "deprecated": "This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.", "dependencies": { "mkdirp": "*" }, @@ -35766,244 +33283,10 @@ "ufo": "^1.3.2" } }, - "node_modules/mnemonist": { - "version": "0.38.5", - "resolved": "https://registry.npmjs.org/mnemonist/-/mnemonist-0.38.5.tgz", - "integrity": "sha512-bZTFT5rrPKtPJxj8KSV0WkPyNxl72vQepqqVUAW2ARUpUSF2qXMB6jZj7hW5/k7C1rtpzqbD/IIbJwLXUjCHeg==", - "optional": true, - "dependencies": { - "obliterator": "^2.0.0" - } - }, - "node_modules/mocha": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", - "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", - "optional": true, - "dependencies": { - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.5.3", - "debug": "4.3.4", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "7.2.0", - "he": "1.2.0", - "js-yaml": "4.1.0", - "log-symbols": "4.1.0", - "minimatch": "5.0.1", - "ms": "2.1.3", - "nanoid": "3.3.3", - "serialize-javascript": "6.0.0", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "workerpool": "6.2.1", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" - }, - "bin": { - "_mocha": "bin/_mocha", - "mocha": "bin/mocha.js" - }, - "engines": { - "node": ">= 14.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mochajs" - } - }, - "node_modules/mocha/node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "optional": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/mocha/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "optional": true - }, - "node_modules/mocha/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "optional": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/mocha/node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "optional": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mocha/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "optional": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/mocha/node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "optional": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/mocha/node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "optional": true, - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mocha/node_modules/minimatch": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", - "optional": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/mocha/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "optional": true - }, - "node_modules/mocha/node_modules/nanoid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", - "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", - "optional": true, - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/mocha/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "optional": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mocha/node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "optional": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mocha/node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "optional": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/mocha/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "optional": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/mocha/node_modules/yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "optional": true, - "engines": { - "node": ">=10" - } - }, "node_modules/mock-fs": { "version": "4.14.0", - "license": "MIT" - }, - "node_modules/module-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/module-error/-/module-error-1.0.2.tgz", - "integrity": "sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA==", - "optional": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/moment": { - "version": "2.29.4", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", - "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==", - "engines": { - "node": "*" - } + "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.14.0.tgz", + "integrity": "sha512-qYvlv/exQ4+svI3UOvPUpLDF0OMX5euvUH0Ny4N5QyRyhNdgAgUrVH3iUINSzEPLvx0kbo/Bp28GJKIqvE7URw==" }, "node_modules/motion": { "version": "10.16.2", @@ -36208,7 +33491,8 @@ }, "node_modules/nano-json-stream-parser": { "version": "0.1.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz", + "integrity": "sha512-9MqxMH/BSJC7dnLsEMPyfN5Dvoo49IsPFYMcHw3Bcfc2kN0lpHRBSzlMSVx4HGyJ7s9B31CyBTVehWJoQ8Ctew==" }, "node_modules/nanoid": { "version": "3.3.7", @@ -36227,12 +33511,6 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, - "node_modules/napi-macros": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.2.2.tgz", - "integrity": "sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g==", - "optional": true - }, "node_modules/native-abort-controller": { "version": "1.0.4", "license": "MIT", @@ -36285,28 +33563,6 @@ "version": "1.0.5", "license": "MIT" }, - "node_modules/nise": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.5.tgz", - "integrity": "sha512-VJuPIfUFaXNRzETTQEEItTOP8Y171ijr+JLq42wHes3DiryR8vT+1TXQW/Rx8JNUhyYYWyIvjXTU6dOhJcs9Nw==", - "optional": true, - "dependencies": { - "@sinonjs/commons": "^2.0.0", - "@sinonjs/fake-timers": "^10.0.2", - "@sinonjs/text-encoding": "^0.7.1", - "just-extend": "^4.0.2", - "path-to-regexp": "^1.7.0" - } - }, - "node_modules/nise/node_modules/@sinonjs/commons": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-2.0.0.tgz", - "integrity": "sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==", - "optional": true, - "dependencies": { - "type-detect": "4.0.8" - } - }, "node_modules/no-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", @@ -39266,7 +36522,8 @@ }, "node_modules/oauth-sign": { "version": "0.9.0", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", "engines": { "node": "*" } @@ -39474,12 +36731,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/obliterator": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.4.tgz", - "integrity": "sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ==", - "optional": true - }, "node_modules/oboe": { "version": "2.1.5", "license": "BSD", @@ -39628,15 +36879,6 @@ "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", "integrity": "sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A==" }, - "node_modules/os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/ospath": { "version": "1.2.2", "dev": true, @@ -39693,7 +36935,7 @@ }, "node_modules/p-map": { "version": "4.0.0", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "aggregate-error": "^3.0.0" @@ -39906,6 +37148,7 @@ }, "node_modules/parent-module": { "version": "1.0.1", + "dev": true, "license": "MIT", "dependencies": { "callsites": "^3.0.0" @@ -39925,12 +37168,6 @@ "safe-buffer": "^5.1.1" } }, - "node_modules/parse-cache-control": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parse-cache-control/-/parse-cache-control-1.0.1.tgz", - "integrity": "sha512-60zvsJReQPX5/QP0Kzfd/VrpjScIQ7SHBW6bFCYfEP+fp0Eppr1SHhIO5nd1PjZtvclzSzES9D/p5nFJurwfWg==", - "optional": true - }, "node_modules/parse-duration": { "version": "1.0.3", "license": "MIT" @@ -39978,156 +37215,6 @@ "tslib": "^2.0.3" } }, - "node_modules/patch-package": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-7.0.2.tgz", - "integrity": "sha512-PMYfL8LXxGIRmxXLqlEaBxzKPu7/SdP13ld6GSfAUJUZRmBDPp8chZs0dpzaAFn9TSPnFiMwkC6PJt6pBiAl8Q==", - "optional": true, - "dependencies": { - "@yarnpkg/lockfile": "^1.1.0", - "chalk": "^4.1.2", - "ci-info": "^3.7.0", - "cross-spawn": "^7.0.3", - "find-yarn-workspace-root": "^2.0.0", - "fs-extra": "^9.0.0", - "klaw-sync": "^6.0.0", - "minimist": "^1.2.6", - "open": "^7.4.2", - "rimraf": "^2.6.3", - "semver": "^7.5.3", - "slash": "^2.0.0", - "tmp": "^0.0.33", - "yaml": "^2.2.2" - }, - "bin": { - "patch-package": "index.js" - }, - "engines": { - "node": ">=14", - "npm": ">5" - } - }, - "node_modules/patch-package/node_modules/ci-info": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", - "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "optional": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/patch-package/node_modules/fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", - "optional": true, - "dependencies": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/patch-package/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==", - "optional": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/patch-package/node_modules/open": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", - "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", - "optional": true, - "dependencies": { - "is-docker": "^2.0.0", - "is-wsl": "^2.1.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/patch-package/node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "optional": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - } - }, - "node_modules/patch-package/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==", - "optional": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/patch-package/node_modules/slash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", - "optional": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/patch-package/node_modules/tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "optional": true, - "dependencies": { - "os-tmpdir": "~1.0.2" - }, - "engines": { - "node": ">=0.6.0" - } - }, - "node_modules/patch-package/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "optional": true - }, - "node_modules/patch-package/node_modules/yaml": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", - "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", - "optional": true, - "engines": { - "node": ">= 14" - } - }, "node_modules/path": { "version": "0.12.7", "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz", @@ -40164,7 +37251,7 @@ }, "node_modules/path-to-regexp": { "version": "1.8.0", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "isarray": "0.0.1" @@ -40172,6 +37259,7 @@ }, "node_modules/path-type": { "version": "4.0.0", + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -40195,15 +37283,6 @@ "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==" }, - "node_modules/pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", - "optional": true, - "engines": { - "node": "*" - } - }, "node_modules/pause-stream": { "version": "0.0.11", "dev": true, @@ -40545,15 +37624,6 @@ "node": ">=6" } }, - "node_modules/pluralize": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", - "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", - "optional": true, - "engines": { - "node": ">=4" - } - }, "node_modules/pngjs": { "version": "5.0.0", "license": "MIT", @@ -42004,7 +39074,7 @@ }, "node_modules/promise": { "version": "8.3.0", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "asap": "~2.0.6" @@ -42012,7 +39082,7 @@ }, "node_modules/prompts": { "version": "2.4.2", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "kleur": "^3.0.3", @@ -42219,14 +39289,6 @@ "qrcode-terminal": "bin/qrcode-terminal.js" } }, - "node_modules/qrcode.react": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/qrcode.react/-/qrcode.react-3.1.0.tgz", - "integrity": "sha512-oyF+Urr3oAMUG/OiOuONL3HXM+53wvuH3mtIWQrYmsXoAq0DkvZp2RYUWFSMFtbdOpuS++9v+WAkzNVkMlNW6Q==", - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0" - } - }, "node_modules/qrcode/node_modules/ansi-styles": { "version": "4.3.0", "license": "MIT", @@ -42370,7 +39432,7 @@ }, "node_modules/qs": { "version": "6.11.2", - "devOptional": true, + "dev": true, "license": "BSD-3-Clause", "dependencies": { "side-channel": "^1.0.4" @@ -42407,7 +39469,7 @@ }, "node_modules/queue-microtask": { "version": "1.2.3", - "devOptional": true, + "dev": true, "funding": [ { "type": "github", @@ -42485,7 +39547,8 @@ }, "node_modules/raw-body": { "version": "2.5.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", "dependencies": { "bytes": "3.1.2", "http-errors": "2.0.0", @@ -42498,7 +39561,8 @@ }, "node_modules/raw-body/node_modules/iconv-lite": { "version": "0.4.24", - "license": "MIT", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dependencies": { "safer-buffer": ">= 2.1.2 < 3" }, @@ -42746,17 +39810,6 @@ "react": "^18.2.0" } }, - "node_modules/react-error-boundary": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/react-error-boundary/-/react-error-boundary-4.0.11.tgz", - "integrity": "sha512-U13ul67aP5DOSPNSCWQ/eO0AQEYzEFkVljULQIjMV0KlffTAhxuDoBKdO0pb/JZ8mDhMKFZ9NZi0BmLGUiNphw==", - "dependencies": { - "@babel/runtime": "^7.12.5" - }, - "peerDependencies": { - "react": ">=16.13.1" - } - }, "node_modules/react-error-overlay": { "version": "6.0.11", "resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.11.tgz", @@ -42939,18 +39992,6 @@ "node": ">=8" } }, - "node_modules/react-number-format": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/react-number-format/-/react-number-format-5.3.1.tgz", - "integrity": "sha512-qpYcQLauIeEhCZUZY9jXZnnroOtdy3jYaS1zQ3M1Sr6r/KMOBEIGNIb7eKT19g2N1wbYgFgvDzs19hw5TrB8XQ==", - "dependencies": { - "prop-types": "^15.7.2" - }, - "peerDependencies": { - "react": "^0.14 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^0.14 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0" - } - }, "node_modules/react-redux": { "version": "7.2.9", "dev": true, @@ -44582,15 +41623,6 @@ } } }, - "node_modules/react-text-overflow": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/react-text-overflow/-/react-text-overflow-1.0.2.tgz", - "integrity": "sha512-NGCcGupT3yZVpPRcOHghBIFMgctLVGL6z1SXOoEoztMt9DHIHQzAy/gKsxh93jDdfmvP9VzS7ibixyliZexI7g==", - "peerDependencies": { - "react": "^17.0.0 || ^18.0.0", - "react-dom": "^17.0.0 || ^18.0.0" - } - }, "node_modules/react-tradingview-embed": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/react-tradingview-embed/-/react-tradingview-embed-3.0.6.tgz", @@ -44978,42 +42010,11 @@ "strip-ansi": "^6.0.1" } }, - "node_modules/req-cwd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/req-cwd/-/req-cwd-2.0.0.tgz", - "integrity": "sha512-ueoIoLo1OfB6b05COxAA9UpeoscNpYyM+BqYlA7H6LVF4hKGPXQQSSaD2YmvDVJMkk4UDpAHIeU1zG53IqjvlQ==", - "optional": true, - "dependencies": { - "req-from": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/req-from": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/req-from/-/req-from-2.0.0.tgz", - "integrity": "sha512-LzTfEVDVQHBRfjOUMgNBA+V6DWsSnoeKzf42J7l0xa/B4jyPOuuF5MlNSmomLNGemWTnV2TIdjSSLnEn95fOQA==", - "optional": true, - "dependencies": { - "resolve-from": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/req-from/node_modules/resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha512-GnlH6vxLymXJNMBo7XP1fJIzBFbdYt49CuTwmB/6N53t+kMPRMFKz783LlQ4tv28XoQfMWinAJX6WCGf2IlaIw==", - "optional": true, - "engines": { - "node": ">=4" - } - }, "node_modules/request": { "version": "2.88.2", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", "dependencies": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -45050,7 +42051,8 @@ }, "node_modules/request/node_modules/form-data": { "version": "2.3.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -45062,7 +42064,8 @@ }, "node_modules/request/node_modules/http-signature": { "version": "1.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", "dependencies": { "assert-plus": "^1.0.0", "jsprim": "^1.2.2", @@ -45075,7 +42078,8 @@ }, "node_modules/request/node_modules/jsprim": { "version": "1.4.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", + "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", "dependencies": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -45088,14 +42092,17 @@ }, "node_modules/request/node_modules/qs": { "version": "6.5.3", - "license": "BSD-3-Clause", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", + "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", "engines": { "node": ">=0.6" } }, "node_modules/request/node_modules/uuid": { "version": "3.4.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", "bin": { "uuid": "bin/uuid" } @@ -45109,7 +42116,7 @@ }, "node_modules/require-from-string": { "version": "2.0.2", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -45177,6 +42184,7 @@ }, "node_modules/resolve-from": { "version": "4.0.0", + "dev": true, "license": "MIT", "engines": { "node": ">=4" @@ -45571,35 +42579,6 @@ "queue-microtask": "^1.2.2" } }, - "node_modules/run-parallel-limit": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/run-parallel-limit/-/run-parallel-limit-1.1.0.tgz", - "integrity": "sha512-jJA7irRNM91jaKc3Hcl1npHsFLOXOoTkPCUL1JEa1R82O2miplXXRaGdjW/KM/98YQWDhJLiSs793CnXfblJUw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "optional": true, - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/rustbn.js": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", - "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==", - "optional": true - }, "node_modules/rw": { "version": "1.3.3", "dev": true, @@ -46040,7 +43019,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", - "devOptional": true, + "dev": true, "dependencies": { "randombytes": "^2.1.0" } @@ -46138,7 +43117,8 @@ }, "node_modules/servify": { "version": "0.1.12", - "license": "MIT", + "resolved": "https://registry.npmjs.org/servify/-/servify-0.1.12.tgz", + "integrity": "sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw==", "dependencies": { "body-parser": "^1.16.0", "cors": "^2.8.1", @@ -46294,12 +43274,17 @@ } }, "node_modules/side-channel": { - "version": "1.0.4", - "license": "MIT", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -46361,7 +43346,7 @@ }, "node_modules/sisteransi": { "version": "1.0.5", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/slash": { @@ -46485,271 +43470,6 @@ "websocket-driver": "^0.7.4" } }, - "node_modules/solc": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.7.3.tgz", - "integrity": "sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA==", - "optional": true, - "dependencies": { - "command-exists": "^1.2.8", - "commander": "3.0.2", - "follow-redirects": "^1.12.1", - "fs-extra": "^0.30.0", - "js-sha3": "0.8.0", - "memorystream": "^0.3.1", - "require-from-string": "^2.0.0", - "semver": "^5.5.0", - "tmp": "0.0.33" - }, - "bin": { - "solcjs": "solcjs" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/solc/node_modules/commander": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", - "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", - "optional": true - }, - "node_modules/solc/node_modules/fs-extra": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", - "integrity": "sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA==", - "optional": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0", - "path-is-absolute": "^1.0.0", - "rimraf": "^2.2.8" - } - }, - "node_modules/solc/node_modules/jsonfile": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw==", - "optional": true, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/solc/node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "optional": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - } - }, - "node_modules/solc/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "optional": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/solc/node_modules/tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "optional": true, - "dependencies": { - "os-tmpdir": "~1.0.2" - }, - "engines": { - "node": ">=0.6.0" - } - }, - "node_modules/solhint": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/solhint/-/solhint-3.6.2.tgz", - "integrity": "sha512-85EeLbmkcPwD+3JR7aEMKsVC9YrRSxd4qkXuMzrlf7+z2Eqdfm1wHWq1ffTuo5aDhoZxp2I9yF3QkxZOxOL7aQ==", - "optional": true, - "dependencies": { - "@solidity-parser/parser": "^0.16.0", - "ajv": "^6.12.6", - "antlr4": "^4.11.0", - "ast-parents": "^0.0.1", - "chalk": "^4.1.2", - "commander": "^10.0.0", - "cosmiconfig": "^8.0.0", - "fast-diff": "^1.2.0", - "glob": "^8.0.3", - "ignore": "^5.2.4", - "js-yaml": "^4.1.0", - "lodash": "^4.17.21", - "pluralize": "^8.0.0", - "semver": "^7.5.2", - "strip-ansi": "^6.0.1", - "table": "^6.8.1", - "text-table": "^0.2.0" - }, - "bin": { - "solhint": "solhint.js" - }, - "optionalDependencies": { - "prettier": "^2.8.3" - } - }, - "node_modules/solhint/node_modules/@solidity-parser/parser": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.16.2.tgz", - "integrity": "sha512-PI9NfoA3P8XK2VBkK5oIfRgKDsicwDZfkVq9ZTBCQYGOP1N2owgY2dyLGyU5/J/hQs8KRk55kdmvTLjy3Mu3vg==", - "optional": true, - "dependencies": { - "antlr4ts": "^0.5.0-alpha.4" - } - }, - "node_modules/solhint/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "optional": true - }, - "node_modules/solhint/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "optional": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/solhint/node_modules/commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "optional": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/solhint/node_modules/cosmiconfig": { - "version": "8.3.6", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.3.6.tgz", - "integrity": "sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==", - "optional": true, - "dependencies": { - "import-fresh": "^3.3.0", - "js-yaml": "^4.1.0", - "parse-json": "^5.2.0", - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/d-fischer" - }, - "peerDependencies": { - "typescript": ">=4.9.5" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/solhint/node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "optional": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/solhint/node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "optional": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/solhint/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==", - "optional": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/solhint/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "optional": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/solhint/node_modules/prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", - "optional": true, - "bin": { - "prettier": "bin-prettier.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "node_modules/solhint/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==", - "optional": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/solhint/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "optional": true - }, "node_modules/solidity-ast": { "version": "0.4.55", "resolved": "https://registry.npmjs.org/solidity-ast/-/solidity-ast-0.4.55.tgz", @@ -46758,11 +43478,6 @@ "array.prototype.findlast": "^1.2.2" } }, - "node_modules/solidity-comments-extractor": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/solidity-comments-extractor/-/solidity-comments-extractor-0.0.7.tgz", - "integrity": "sha512-wciNMLg/Irp8OKGrh3S2tfvZiZ0NEyILfcRCXCD4mp7SgK/i9gzLfhY2hY7VMCQJ3kH9UB9BzNdibIVMchzyYw==" - }, "node_modules/sonic-boom": { "version": "2.8.0", "license": "MIT", @@ -46776,13 +43491,6 @@ "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", "dev": true }, - "node_modules/source-map": { - "version": "0.5.7", - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/source-map-explorer": { "version": "2.5.3", "dev": true, @@ -46862,7 +43570,7 @@ }, "node_modules/source-map-support": { "version": "0.5.21", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", @@ -46871,7 +43579,7 @@ }, "node_modules/source-map-support/node_modules/source-map": { "version": "0.6.1", - "devOptional": true, + "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" @@ -47018,27 +43726,6 @@ "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==", "dev": true }, - "node_modules/stacktrace-parser": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz", - "integrity": "sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg==", - "optional": true, - "dependencies": { - "type-fest": "^0.7.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/stacktrace-parser/node_modules/type-fest": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz", - "integrity": "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==", - "optional": true, - "engines": { - "node": ">=8" - } - }, "node_modules/standard-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/standard-error/-/standard-error-1.1.0.tgz", @@ -47394,7 +44081,7 @@ }, "node_modules/strip-json-comments": { "version": "3.1.1", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -47439,11 +44126,6 @@ "postcss": "^8.2.15" } }, - "node_modules/stylis": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.2.0.tgz", - "integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==" - }, "node_modules/sucrase": { "version": "3.34.0", "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.34.0.tgz", @@ -47734,7 +44416,8 @@ }, "node_modules/swarm-js": { "version": "0.1.42", - "license": "MIT", + "resolved": "https://registry.npmjs.org/swarm-js/-/swarm-js-0.1.42.tgz", + "integrity": "sha512-BV7c/dVlA3R6ya1lMlSSNPLYrntt0LUq4YMgy3iwpCIc6rZnS5W2wUoctarZ5pXlpKtxDDf9hNziEkcfrxdhqQ==", "dependencies": { "bluebird": "^3.5.0", "buffer": "^5.0.5", @@ -47751,6 +44434,8 @@ }, "node_modules/swarm-js/node_modules/buffer": { "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "funding": [ { "type": "github", @@ -47765,77 +44450,11 @@ "url": "https://feross.org/support" } ], - "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" } }, - "node_modules/swarm-js/node_modules/chownr": { - "version": "1.1.4", - "license": "ISC" - }, - "node_modules/swarm-js/node_modules/fs-extra": { - "version": "4.0.3", - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "node_modules/swarm-js/node_modules/fs-minipass": { - "version": "1.2.7", - "license": "ISC", - "dependencies": { - "minipass": "^2.6.0" - } - }, - "node_modules/swarm-js/node_modules/jsonfile": { - "version": "4.0.0", - "license": "MIT", - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/swarm-js/node_modules/minipass": { - "version": "2.9.0", - "license": "ISC", - "dependencies": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "node_modules/swarm-js/node_modules/minizlib": { - "version": "1.3.3", - "license": "MIT", - "dependencies": { - "minipass": "^2.9.0" - } - }, - "node_modules/swarm-js/node_modules/tar": { - "version": "4.4.19", - "license": "ISC", - "dependencies": { - "chownr": "^1.1.4", - "fs-minipass": "^1.2.7", - "minipass": "^2.9.0", - "minizlib": "^1.3.3", - "mkdirp": "^0.5.5", - "safe-buffer": "^5.2.1", - "yallist": "^3.1.1" - }, - "engines": { - "node": ">=4.5" - } - }, - "node_modules/swarm-js/node_modules/universalify": { - "version": "0.1.2", - "license": "MIT", - "engines": { - "node": ">= 4.0.0" - } - }, "node_modules/swr": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/swr/-/swr-2.2.4.tgz", @@ -47862,29 +44481,6 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, - "node_modules/sync-request": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/sync-request/-/sync-request-6.1.0.tgz", - "integrity": "sha512-8fjNkrNlNCrVc/av+Jn+xxqfCjYaBoHqCsDz6mt030UMxJGr+GSfCV1dQt2gRtlL63+VPidwDVLr7V2OcTSdRw==", - "optional": true, - "dependencies": { - "http-response-object": "^3.0.1", - "sync-rpc": "^1.2.1", - "then-request": "^6.0.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/sync-rpc": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/sync-rpc/-/sync-rpc-1.3.6.tgz", - "integrity": "sha512-J8jTXuZzRlvU7HemDgHi3pGnh/rkoqR/OZSjhTyyZrEkkYQbk7Z33AXp37mkPfPpfdOuj7Ex3H/TJM1z48uPQw==", - "optional": true, - "dependencies": { - "get-port": "^3.1.0" - } - }, "node_modules/system-architecture": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/system-architecture/-/system-architecture-0.1.0.tgz", @@ -47898,7 +44494,7 @@ }, "node_modules/table": { "version": "6.8.1", - "devOptional": true, + "dev": true, "license": "BSD-3-Clause", "dependencies": { "ajv": "^8.0.1", @@ -47943,7 +44539,7 @@ }, "node_modules/table/node_modules/ajv": { "version": "8.12.0", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", @@ -47958,7 +44554,7 @@ }, "node_modules/table/node_modules/ansi-styles": { "version": "4.3.0", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -47972,7 +44568,7 @@ }, "node_modules/table/node_modules/color-convert": { "version": "2.0.1", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -47983,17 +44579,17 @@ }, "node_modules/table/node_modules/color-name": { "version": "1.1.4", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/table/node_modules/json-schema-traverse": { "version": "1.0.0", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/table/node_modules/slice-ansi": { "version": "4.0.0", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", @@ -48133,6 +44729,23 @@ "node": ">=6" } }, + "node_modules/tar": { + "version": "4.4.19", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.19.tgz", + "integrity": "sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA==", + "dependencies": { + "chownr": "^1.1.4", + "fs-minipass": "^1.2.7", + "minipass": "^2.9.0", + "minizlib": "^1.3.3", + "mkdirp": "^0.5.5", + "safe-buffer": "^5.2.1", + "yallist": "^3.1.1" + }, + "engines": { + "node": ">=4.5" + } + }, "node_modules/temp": { "version": "0.9.4", "dev": true, @@ -48291,51 +44904,9 @@ }, "node_modules/text-table": { "version": "0.2.0", - "devOptional": true, + "dev": true, "license": "MIT" }, - "node_modules/then-request": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/then-request/-/then-request-6.0.2.tgz", - "integrity": "sha512-3ZBiG7JvP3wbDzA9iNY5zJQcHL4jn/0BWtXIkagfz7QgOL/LqjCEOBQuJNZfu0XYnv5JhKh+cDxCPM4ILrqruA==", - "optional": true, - "dependencies": { - "@types/concat-stream": "^1.6.0", - "@types/form-data": "0.0.33", - "@types/node": "^8.0.0", - "@types/qs": "^6.2.31", - "caseless": "~0.12.0", - "concat-stream": "^1.6.0", - "form-data": "^2.2.0", - "http-basic": "^8.1.1", - "http-response-object": "^3.0.1", - "promise": "^8.0.0", - "qs": "^6.4.0" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/then-request/node_modules/@types/node": { - "version": "8.10.66", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.66.tgz", - "integrity": "sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw==", - "optional": true - }, - "node_modules/then-request/node_modules/form-data": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", - "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", - "optional": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 0.12" - } - }, "node_modules/thenify": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", @@ -48504,7 +45075,8 @@ }, "node_modules/tough-cookie": { "version": "2.5.0", - "license": "BSD-3-Clause", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", "dependencies": { "psl": "^1.1.28", "punycode": "^2.1.1" @@ -48584,70 +45156,6 @@ "typescript": ">=4.1.0" } }, - "node_modules/ts-generator": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ts-generator/-/ts-generator-0.1.1.tgz", - "integrity": "sha512-N+ahhZxTLYu1HNTQetwWcx3so8hcYbkKBHTr4b4/YgObFTIKkOSSsaa+nal12w8mfrJAyzJfETXawbNjSfP2gQ==", - "optional": true, - "dependencies": { - "@types/mkdirp": "^0.5.2", - "@types/prettier": "^2.1.1", - "@types/resolve": "^0.0.8", - "chalk": "^2.4.1", - "glob": "^7.1.2", - "mkdirp": "^0.5.1", - "prettier": "^2.1.2", - "resolve": "^1.8.1", - "ts-essentials": "^1.0.0" - }, - "bin": { - "ts-generator": "dist/cli/run.js" - } - }, - "node_modules/ts-generator/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "optional": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/ts-generator/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "optional": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/ts-generator/node_modules/prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", - "optional": true, - "bin": { - "prettier": "bin-prettier.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "node_modules/ts-generator/node_modules/ts-essentials": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-1.0.4.tgz", - "integrity": "sha512-q3N1xS4vZpRouhYHDPwO0bDW3EZ6SK9CrrDHxi/D6BPReSjpVgWIOpLS2o0gSBZm+7q/wyKp6RVM1AeeW7uyfQ==", - "optional": true - }, "node_modules/ts-interface-checker": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", @@ -48665,69 +45173,6 @@ "node": ">=8" } }, - "node_modules/ts-node": { - "version": "10.9.1", - "license": "MIT", - "optional": true, - "dependencies": { - "@cspotcode/source-map-support": "^0.8.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.1", - "yn": "3.1.1" - }, - "bin": { - "ts-node": "dist/bin.js", - "ts-node-cwd": "dist/bin-cwd.js", - "ts-node-esm": "dist/bin-esm.js", - "ts-node-script": "dist/bin-script.js", - "ts-node-transpile-only": "dist/bin-transpile.js", - "ts-script": "dist/bin-script-deprecated.js" - }, - "peerDependencies": { - "@swc/core": ">=1.2.50", - "@swc/wasm": ">=1.2.50", - "@types/node": "*", - "typescript": ">=2.7" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "@swc/wasm": { - "optional": true - } - } - }, - "node_modules/ts-node/node_modules/acorn-walk": { - "version": "8.2.0", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/ts-node/node_modules/arg": { - "version": "4.1.3", - "license": "MIT", - "optional": true - }, - "node_modules/ts-node/node_modules/diff": { - "version": "4.0.2", - "license": "BSD-3-Clause", - "optional": true, - "engines": { - "node": ">=0.3.1" - } - }, "node_modules/tsconfig-paths": { "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", @@ -48766,12 +45211,6 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, - "node_modules/tsort": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/tsort/-/tsort-0.0.1.tgz", - "integrity": "sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==", - "optional": true - }, "node_modules/tsutils": { "version": "3.21.0", "dev": true, @@ -49026,11 +45465,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/typedarray": { - "version": "0.0.6", - "license": "MIT", - "optional": true - }, "node_modules/typedarray-to-buffer": { "version": "3.1.5", "license": "MIT", @@ -49095,7 +45529,8 @@ }, "node_modules/ultron": { "version": "1.1.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", + "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==" }, "node_modules/unbox-primitive": { "version": "1.0.2", @@ -49115,24 +45550,6 @@ "resolved": "https://registry.npmjs.org/uncrypto/-/uncrypto-0.1.3.tgz", "integrity": "sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==" }, - "node_modules/undici": { - "version": "5.27.2", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.27.2.tgz", - "integrity": "sha512-iS857PdOEy/y3wlM3yRp+6SNQQ6xU0mmZcwRSriqk+et/cwWAtwmIGf6WkoDN2EK/AMdCO/dfXzIwi+rFMrjjQ==", - "optional": true, - "dependencies": { - "@fastify/busboy": "^2.0.0" - }, - "engines": { - "node": ">=14.0" - } - }, - "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "optional": true - }, "node_modules/unenv": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/unenv/-/unenv-1.9.0.tgz", @@ -49720,11 +46137,6 @@ "dev": true, "license": "MIT" }, - "node_modules/v8-compile-cache-lib": { - "version": "3.0.1", - "license": "MIT", - "optional": true - }, "node_modules/v8-to-istanbul": { "version": "9.2.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz", @@ -50030,26 +46442,28 @@ } }, "node_modules/web3": { - "version": "1.10.0", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.10.4.tgz", + "integrity": "sha512-kgJvQZjkmjOEKimx/tJQsqWfRDPTTcBfYPa9XletxuHLpHcXdx67w8EFn5AW3eVxCutE9dTVHgGa9VYe8vgsEA==", "hasInstallScript": true, - "license": "LGPL-3.0", "dependencies": { - "web3-bzz": "1.10.0", - "web3-core": "1.10.0", - "web3-eth": "1.10.0", - "web3-eth-personal": "1.10.0", - "web3-net": "1.10.0", - "web3-shh": "1.10.0", - "web3-utils": "1.10.0" + "web3-bzz": "1.10.4", + "web3-core": "1.10.4", + "web3-eth": "1.10.4", + "web3-eth-personal": "1.10.4", + "web3-net": "1.10.4", + "web3-shh": "1.10.4", + "web3-utils": "1.10.4" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-bzz": { - "version": "1.10.0", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.10.4.tgz", + "integrity": "sha512-ZZ/X4sJ0Uh2teU9lAGNS8EjveEppoHNQiKlOXAjedsrdWuaMErBPdLQjXfcrYvN6WM6Su9PMsAxf3FXXZ+HwQw==", "hasInstallScript": true, - "license": "LGPL-3.0", "dependencies": { "@types/node": "^12.12.6", "got": "12.1.0", @@ -50061,7 +46475,8 @@ }, "node_modules/web3-bzz/node_modules/@szmarczak/http-timer": { "version": "5.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", + "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", "dependencies": { "defer-to-connect": "^2.0.1" }, @@ -50071,22 +46486,21 @@ }, "node_modules/web3-bzz/node_modules/@types/node": { "version": "12.20.55", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", + "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==" }, "node_modules/web3-bzz/node_modules/cacheable-lookup": { "version": "6.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-6.1.0.tgz", + "integrity": "sha512-KJ/Dmo1lDDhmW2XDPMo+9oiy/CeqosPguPCrgcVzKyZrL6pM1gU2GmPY/xo6OQPTUaA/c0kwHuywB4E6nmT9ww==", "engines": { "node": ">=10.6.0" } }, - "node_modules/web3-bzz/node_modules/form-data-encoder": { - "version": "1.7.1", - "license": "MIT" - }, "node_modules/web3-bzz/node_modules/get-stream": { "version": "6.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "engines": { "node": ">=10" }, @@ -50096,7 +46510,8 @@ }, "node_modules/web3-bzz/node_modules/got": { "version": "12.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/got/-/got-12.1.0.tgz", + "integrity": "sha512-hBv2ty9QN2RdbJJMK3hesmSkFTjVIHyIDDbssCKnSmq62edGgImJWD10Eb1k77TiV1bxloxqcFAVK8+9pkhOig==", "dependencies": { "@sindresorhus/is": "^4.6.0", "@szmarczak/http-timer": "^5.0.1", @@ -50120,8 +46535,9 @@ } }, "node_modules/web3-bzz/node_modules/http2-wrapper": { - "version": "2.2.0", - "license": "MIT", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz", + "integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==", "dependencies": { "quick-lru": "^5.1.1", "resolve-alpn": "^1.2.0" @@ -50132,7 +46548,8 @@ }, "node_modules/web3-bzz/node_modules/lowercase-keys": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", + "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -50142,55 +46559,60 @@ }, "node_modules/web3-bzz/node_modules/p-cancelable": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", + "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", "engines": { "node": ">=12.20" } }, "node_modules/web3-core": { - "version": "1.10.0", - "license": "LGPL-3.0", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.10.4.tgz", + "integrity": "sha512-B6elffYm81MYZDTrat7aEhnhdtVE3lDBUZft16Z8awYMZYJDbnykEbJVS+l3mnA7AQTnSDr/1MjWofGDLBJPww==", "dependencies": { "@types/bn.js": "^5.1.1", "@types/node": "^12.12.6", "bignumber.js": "^9.0.0", - "web3-core-helpers": "1.10.0", - "web3-core-method": "1.10.0", - "web3-core-requestmanager": "1.10.0", - "web3-utils": "1.10.0" + "web3-core-helpers": "1.10.4", + "web3-core-method": "1.10.4", + "web3-core-requestmanager": "1.10.4", + "web3-utils": "1.10.4" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-core-helpers": { - "version": "1.10.0", - "license": "LGPL-3.0", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.10.4.tgz", + "integrity": "sha512-r+L5ylA17JlD1vwS8rjhWr0qg7zVoVMDvWhajWA5r5+USdh91jRUYosp19Kd1m2vE034v7Dfqe1xYRoH2zvG0g==", "dependencies": { - "web3-eth-iban": "1.10.0", - "web3-utils": "1.10.0" + "web3-eth-iban": "1.10.4", + "web3-utils": "1.10.4" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-core-method": { - "version": "1.10.0", - "license": "LGPL-3.0", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.10.4.tgz", + "integrity": "sha512-uZTb7flr+Xl6LaDsyTeE2L1TylokCJwTDrIVfIfnrGmnwLc6bmTWCCrm71sSrQ0hqs6vp/MKbQYIYqUN0J8WyA==", "dependencies": { "@ethersproject/transactions": "^5.6.2", - "web3-core-helpers": "1.10.0", - "web3-core-promievent": "1.10.0", - "web3-core-subscriptions": "1.10.0", - "web3-utils": "1.10.0" + "web3-core-helpers": "1.10.4", + "web3-core-promievent": "1.10.4", + "web3-core-subscriptions": "1.10.4", + "web3-utils": "1.10.4" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-core-promievent": { - "version": "1.10.0", - "license": "LGPL-3.0", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.10.4.tgz", + "integrity": "sha512-2de5WnJQ72YcIhYwV/jHLc4/cWJnznuoGTJGD29ncFQHAfwW/MItHFSVKPPA5v8AhJe+r6y4Y12EKvZKjQVBvQ==", "dependencies": { "eventemitter3": "4.0.4" }, @@ -50200,28 +46622,31 @@ }, "node_modules/web3-core-promievent/node_modules/eventemitter3": { "version": "4.0.4", - "license": "MIT" + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.4.tgz", + "integrity": "sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ==" }, "node_modules/web3-core-requestmanager": { - "version": "1.10.0", - "license": "LGPL-3.0", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.10.4.tgz", + "integrity": "sha512-vqP6pKH8RrhT/2MoaU+DY/OsYK9h7HmEBNCdoMj+4ZwujQtw/Mq2JifjwsJ7gits7Q+HWJwx8q6WmQoVZAWugg==", "dependencies": { "util": "^0.12.5", - "web3-core-helpers": "1.10.0", - "web3-providers-http": "1.10.0", - "web3-providers-ipc": "1.10.0", - "web3-providers-ws": "1.10.0" + "web3-core-helpers": "1.10.4", + "web3-providers-http": "1.10.4", + "web3-providers-ipc": "1.10.4", + "web3-providers-ws": "1.10.4" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-core-subscriptions": { - "version": "1.10.0", - "license": "LGPL-3.0", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.10.4.tgz", + "integrity": "sha512-o0lSQo/N/f7/L76C0HV63+S54loXiE9fUPfHFcTtpJRQNDBVsSDdWRdePbWwR206XlsBqD5VHApck1//jEafTw==", "dependencies": { "eventemitter3": "4.0.4", - "web3-core-helpers": "1.10.0" + "web3-core-helpers": "1.10.4" }, "engines": { "node": ">=8.0.0" @@ -50229,173 +46654,154 @@ }, "node_modules/web3-core-subscriptions/node_modules/eventemitter3": { "version": "4.0.4", - "license": "MIT" + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.4.tgz", + "integrity": "sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ==" }, "node_modules/web3-core/node_modules/@types/node": { "version": "12.20.55", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", + "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==" }, "node_modules/web3-eth": { - "version": "1.10.0", - "license": "LGPL-3.0", - "dependencies": { - "web3-core": "1.10.0", - "web3-core-helpers": "1.10.0", - "web3-core-method": "1.10.0", - "web3-core-subscriptions": "1.10.0", - "web3-eth-abi": "1.10.0", - "web3-eth-accounts": "1.10.0", - "web3-eth-contract": "1.10.0", - "web3-eth-ens": "1.10.0", - "web3-eth-iban": "1.10.0", - "web3-eth-personal": "1.10.0", - "web3-net": "1.10.0", - "web3-utils": "1.10.0" + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.10.4.tgz", + "integrity": "sha512-Sql2kYKmgt+T/cgvg7b9ce24uLS7xbFrxE4kuuor1zSCGrjhTJ5rRNG8gTJUkAJGKJc7KgnWmgW+cOfMBPUDSA==", + "dependencies": { + "web3-core": "1.10.4", + "web3-core-helpers": "1.10.4", + "web3-core-method": "1.10.4", + "web3-core-subscriptions": "1.10.4", + "web3-eth-abi": "1.10.4", + "web3-eth-accounts": "1.10.4", + "web3-eth-contract": "1.10.4", + "web3-eth-ens": "1.10.4", + "web3-eth-iban": "1.10.4", + "web3-eth-personal": "1.10.4", + "web3-net": "1.10.4", + "web3-utils": "1.10.4" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-eth-abi": { - "version": "1.10.0", - "license": "LGPL-3.0", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.10.4.tgz", + "integrity": "sha512-cZ0q65eJIkd/jyOlQPDjr8X4fU6CRL1eWgdLwbWEpo++MPU/2P4PFk5ZLAdye9T5Sdp+MomePPJ/gHjLMj2VfQ==", "dependencies": { "@ethersproject/abi": "^5.6.3", - "web3-utils": "1.10.0" + "web3-utils": "1.10.4" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-eth-accounts": { - "version": "1.10.0", - "license": "LGPL-3.0", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.10.4.tgz", + "integrity": "sha512-ysy5sVTg9snYS7tJjxVoQAH6DTOTkRGR8emEVCWNGLGiB9txj+qDvSeT0izjurS/g7D5xlMAgrEHLK1Vi6I3yg==", "dependencies": { - "@ethereumjs/common": "2.5.0", - "@ethereumjs/tx": "3.3.2", + "@ethereumjs/common": "2.6.5", + "@ethereumjs/tx": "3.5.2", + "@ethereumjs/util": "^8.1.0", "eth-lib": "0.2.8", - "ethereumjs-util": "^7.1.5", "scrypt-js": "^3.0.1", "uuid": "^9.0.0", - "web3-core": "1.10.0", - "web3-core-helpers": "1.10.0", - "web3-core-method": "1.10.0", - "web3-utils": "1.10.0" + "web3-core": "1.10.4", + "web3-core-helpers": "1.10.4", + "web3-core-method": "1.10.4", + "web3-utils": "1.10.4" }, "engines": { "node": ">=8.0.0" } }, + "node_modules/web3-eth-accounts/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, "node_modules/web3-eth-accounts/node_modules/eth-lib": { "version": "0.2.8", - "license": "MIT", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.8.tgz", + "integrity": "sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw==", "dependencies": { "bn.js": "^4.11.6", "elliptic": "^6.4.0", "xhr-request-promise": "^0.1.2" } }, - "node_modules/web3-eth-accounts/node_modules/eth-lib/node_modules/bn.js": { - "version": "4.12.0", - "license": "MIT" - }, - "node_modules/web3-eth-accounts/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "license": "MIT", - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/web3-eth-accounts/node_modules/ethereumjs-util": { - "version": "7.1.5", - "license": "MPL-2.0", - "dependencies": { - "@types/bn.js": "^5.1.0", - "bn.js": "^5.1.2", - "create-hash": "^1.1.2", - "ethereum-cryptography": "^0.1.3", - "rlp": "^2.2.4" - }, - "engines": { - "node": ">=10.0.0" - } - }, "node_modules/web3-eth-accounts/node_modules/uuid": { - "version": "9.0.0", - "license": "MIT", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], "bin": { "uuid": "dist/bin/uuid" } }, "node_modules/web3-eth-contract": { - "version": "1.10.0", - "license": "LGPL-3.0", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.10.4.tgz", + "integrity": "sha512-Q8PfolOJ4eV9TvnTj1TGdZ4RarpSLmHnUnzVxZ/6/NiTfe4maJz99R0ISgwZkntLhLRtw0C7LRJuklzGYCNN3A==", "dependencies": { "@types/bn.js": "^5.1.1", - "web3-core": "1.10.0", - "web3-core-helpers": "1.10.0", - "web3-core-method": "1.10.0", - "web3-core-promievent": "1.10.0", - "web3-core-subscriptions": "1.10.0", - "web3-eth-abi": "1.10.0", - "web3-utils": "1.10.0" + "web3-core": "1.10.4", + "web3-core-helpers": "1.10.4", + "web3-core-method": "1.10.4", + "web3-core-promievent": "1.10.4", + "web3-core-subscriptions": "1.10.4", + "web3-eth-abi": "1.10.4", + "web3-utils": "1.10.4" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-eth-ens": { - "version": "1.10.0", - "license": "LGPL-3.0", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.10.4.tgz", + "integrity": "sha512-LLrvxuFeVooRVZ9e5T6OWKVflHPFgrVjJ/jtisRWcmI7KN/b64+D/wJzXqgmp6CNsMQcE7rpmf4CQmJCrTdsgg==", "dependencies": { "content-hash": "^2.5.2", "eth-ens-namehash": "2.0.8", - "web3-core": "1.10.0", - "web3-core-helpers": "1.10.0", - "web3-core-promievent": "1.10.0", - "web3-eth-abi": "1.10.0", - "web3-eth-contract": "1.10.0", - "web3-utils": "1.10.0" + "web3-core": "1.10.4", + "web3-core-helpers": "1.10.4", + "web3-core-promievent": "1.10.4", + "web3-eth-abi": "1.10.4", + "web3-eth-contract": "1.10.4", + "web3-utils": "1.10.4" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-eth-iban": { - "version": "1.10.0", - "license": "LGPL-3.0", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.10.4.tgz", + "integrity": "sha512-0gE5iNmOkmtBmbKH2aTodeompnNE8jEyvwFJ6s/AF6jkw9ky9Op9cqfzS56AYAbrqEFuClsqB/AoRves7LDELw==", "dependencies": { "bn.js": "^5.2.1", - "web3-utils": "1.10.0" + "web3-utils": "1.10.4" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-eth-personal": { - "version": "1.10.0", - "license": "LGPL-3.0", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.10.4.tgz", + "integrity": "sha512-BRa/hs6jU1hKHz+AC/YkM71RP3f0Yci1dPk4paOic53R4ZZG4MgwKRkJhgt3/GPuPliwS46f/i5A7fEGBT4F9w==", "dependencies": { "@types/node": "^12.12.6", - "web3-core": "1.10.0", - "web3-core-helpers": "1.10.0", - "web3-core-method": "1.10.0", - "web3-net": "1.10.0", - "web3-utils": "1.10.0" + "web3-core": "1.10.4", + "web3-core-helpers": "1.10.4", + "web3-core-method": "1.10.4", + "web3-net": "1.10.4", + "web3-utils": "1.10.4" }, "engines": { "node": ">=8.0.0" @@ -50403,50 +46809,63 @@ }, "node_modules/web3-eth-personal/node_modules/@types/node": { "version": "12.20.55", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", + "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==" }, "node_modules/web3-net": { - "version": "1.10.0", - "license": "LGPL-3.0", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.10.4.tgz", + "integrity": "sha512-mKINnhOOnZ4koA+yV2OT5s5ztVjIx7IY9a03w6s+yao/BUn+Luuty0/keNemZxTr1E8Ehvtn28vbOtW7Ids+Ow==", "dependencies": { - "web3-core": "1.10.0", - "web3-core-method": "1.10.0", - "web3-utils": "1.10.0" + "web3-core": "1.10.4", + "web3-core-method": "1.10.4", + "web3-utils": "1.10.4" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-providers-http": { - "version": "1.10.0", - "license": "LGPL-3.0", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.10.4.tgz", + "integrity": "sha512-m2P5Idc8hdiO0l60O6DSCPw0kw64Zgi0pMjbEFRmxKIck2Py57RQMu4bxvkxJwkF06SlGaEQF8rFZBmuX7aagQ==", "dependencies": { - "abortcontroller-polyfill": "^1.7.3", - "cross-fetch": "^3.1.4", + "abortcontroller-polyfill": "^1.7.5", + "cross-fetch": "^4.0.0", "es6-promise": "^4.2.8", - "web3-core-helpers": "1.10.0" + "web3-core-helpers": "1.10.4" }, "engines": { "node": ">=8.0.0" } }, + "node_modules/web3-providers-http/node_modules/cross-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", + "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", + "dependencies": { + "node-fetch": "^2.6.12" + } + }, "node_modules/web3-providers-ipc": { - "version": "1.10.0", - "license": "LGPL-3.0", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.10.4.tgz", + "integrity": "sha512-YRF/bpQk9z3WwjT+A6FI/GmWRCASgd+gC0si7f9zbBWLXjwzYAKG73bQBaFRAHex1hl4CVcM5WUMaQXf3Opeuw==", "dependencies": { "oboe": "2.1.5", - "web3-core-helpers": "1.10.0" + "web3-core-helpers": "1.10.4" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-providers-ws": { - "version": "1.10.0", - "license": "LGPL-3.0", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.10.4.tgz", + "integrity": "sha512-j3FBMifyuFFmUIPVQR4pj+t5ILhAexAui0opgcpu9R5LxQrLRUZxHSnU+YO25UycSOa/NAX8A+qkqZNpcFAlxA==", "dependencies": { "eventemitter3": "4.0.4", - "web3-core-helpers": "1.10.0", + "web3-core-helpers": "1.10.4", "websocket": "^1.0.32" }, "engines": { @@ -50455,29 +46874,33 @@ }, "node_modules/web3-providers-ws/node_modules/eventemitter3": { "version": "4.0.4", - "license": "MIT" + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.4.tgz", + "integrity": "sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ==" }, "node_modules/web3-shh": { - "version": "1.10.0", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.10.4.tgz", + "integrity": "sha512-cOH6iFFM71lCNwSQrC3niqDXagMqrdfFW85hC9PFUrAr3PUrIem8TNstTc3xna2bwZeWG6OBy99xSIhBvyIACw==", "hasInstallScript": true, - "license": "LGPL-3.0", "dependencies": { - "web3-core": "1.10.0", - "web3-core-method": "1.10.0", - "web3-core-subscriptions": "1.10.0", - "web3-net": "1.10.0" + "web3-core": "1.10.4", + "web3-core-method": "1.10.4", + "web3-core-subscriptions": "1.10.4", + "web3-net": "1.10.4" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-utils": { - "version": "1.10.0", - "license": "LGPL-3.0", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.10.4.tgz", + "integrity": "sha512-tsu8FiKJLk2PzhDl9fXbGUWTkkVXYhtTA+SmEFkKft+9BgwLxfCRpU96sWv7ICC8zixBNd3JURVoiR3dUXgP8A==", "dependencies": { + "@ethereumjs/util": "^8.1.0", "bn.js": "^5.2.1", "ethereum-bloom-filters": "^1.0.6", - "ethereumjs-util": "^7.1.0", + "ethereum-cryptography": "^2.1.2", "ethjs-unit": "0.1.6", "number-to-bn": "1.7.0", "randombytes": "^2.1.0", @@ -50487,39 +46910,62 @@ "node": ">=8.0.0" } }, - "node_modules/web3-utils/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "license": "MIT", + "node_modules/web3-utils/node_modules/@noble/curves": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.2.tgz", + "integrity": "sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==", "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" + "@noble/hashes": "1.4.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" } }, - "node_modules/web3-utils/node_modules/ethereumjs-util": { - "version": "7.1.5", - "license": "MPL-2.0", + "node_modules/web3-utils/node_modules/@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/web3-utils/node_modules/@scure/bip32": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", + "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", "dependencies": { - "@types/bn.js": "^5.1.0", - "bn.js": "^5.1.2", - "create-hash": "^1.1.2", - "ethereum-cryptography": "^0.1.3", - "rlp": "^2.2.4" + "@noble/curves": "~1.4.0", + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" }, - "engines": { - "node": ">=10.0.0" + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/web3-utils/node_modules/@scure/bip39": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", + "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", + "dependencies": { + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/web3-utils/node_modules/ethereum-cryptography": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", + "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", + "dependencies": { + "@noble/curves": "1.4.2", + "@noble/hashes": "1.4.0", + "@scure/bip32": "1.4.0", + "@scure/bip39": "1.3.0" } }, "node_modules/webauthn-p256": { @@ -51479,12 +47925,6 @@ "workbox-core": "6.6.0" } }, - "node_modules/workerpool": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", - "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", - "optional": true - }, "node_modules/wrap-ansi": { "version": "7.0.0", "license": "MIT", @@ -51743,6 +48183,7 @@ }, "node_modules/yaml": { "version": "1.10.2", + "dev": true, "license": "ISC", "engines": { "node": ">= 6" @@ -51771,45 +48212,6 @@ "node": ">=10" } }, - "node_modules/yargs-unparser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", - "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", - "optional": true, - "dependencies": { - "camelcase": "^6.0.0", - "decamelize": "^4.0.0", - "flat": "^5.0.2", - "is-plain-obj": "^2.1.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-unparser/node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "optional": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/yargs-unparser/node_modules/decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", - "optional": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/yauzl": { "version": "2.10.0", "dev": true, @@ -51819,17 +48221,9 @@ "fd-slicer": "~1.1.0" } }, - "node_modules/yn": { - "version": "3.1.1", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=6" - } - }, "node_modules/yocto-queue": { "version": "0.1.0", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">=10" diff --git a/package.json b/package.json index 5e1515155..43edd00c5 100755 --- a/package.json +++ b/package.json @@ -97,8 +97,9 @@ "@material-ui/icons": "^4.11.2", "@material-ui/lab": "^4.0.0-alpha.60", "@material-ui/styles": "^4.11.5", - "@orbs-network/twap-ui": "^0.10.23", - "@orbs-network/twap-ui-quickswap": "^0.10.23", + "@orbs-network/liquidity-hub-sdk": "^1.0.40", + "@orbs-network/swap-ui": "^0.0.14", + "@orbs-network/twap-sdk": "^2.0.33", "@orderly.network/hooks": "^1.4.3", "@orderly.network/react": "^1.4.3", "@orderly.network/types": "^1.4.3", @@ -121,6 +122,7 @@ "react-tradingview-embed": "^3.0.6", "react-virtuoso": "^4.1.0", "sass": "^1.77.1", - "slick-carousel": "^1.8.1" + "slick-carousel": "^1.8.1", + "web3": "^1.7.1" } } diff --git a/public/locales/en.json b/public/locales/en.json index 0e4e638fe..a762d4edb 100755 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -700,6 +700,7 @@ "wrapMATIC": "Wrap {{ symbol }}", "wrappingMATIC": "Wrapping {{ symbol }}", "unwrapMATIC": "Unwrap {{ symbol }}", + "successfullyUnwrappedMATIC": "Successfully unwrapped {{ symbol }}", "unwrappingMATIC": "Unwrapping {{ symbol }}", "fetchingBestRoute": "Fetching Best Route", "contest": "Contest", @@ -720,6 +721,7 @@ "bestTradeBanned": "Best trade is unavailable in your location. Please use v2 or v3.", "priceImpactReached": "Price impact is more than {{maxImpact}}%. Please use v2 or v3.", "priceImpactReachedV2": "Price impact is more than {{maxImpact}}%. Please use best trade or v3.", + "priceImpactReachedLiquidityHubEthereumTrade": "Price impact is more than {{maxImpact}}%. Please use v3.", "disclaimer": "Disclaimer", "disclaimerText1": "Please check the boxes below to confirm your agreement to the QuickSwap Terms and Conditions", "disclaimerText2": "I have read and understood, and do hereby agree to be legally bound as a ‘User’ under, the Terms, including all future amendments thereto. Such agreement is irrevocable and will apply to all of my uses of the Site without me providing confirmation in each specific instance.", @@ -988,5 +990,48 @@ "subNewsletter": "Subscribe to Newsletter", "allRights": "All rights reserved.", "selectDepositType": "Select Deposit Type.", - "theFinalPosition": "The final position may consist with both tokens. Learn more about the strategy here." + "theFinalPosition": "The final position may consist with both tokens. Learn more about the strategy here.", + "hours": "hours", + "orders": "orders", + "dca-market": "DCA Market", + "dca-limit": "DCA Limit", + "allocate": "Allocate", + "numOfTrades": "No. of trades", + "individualTradeSize": "Individual trade size", + "amountOut": "Amount out", + "createdAt": "Created at", + "expiry": "Expiry", + "limitPrice": "Limit Price", + "progress": "Progress", + "excecutionPrice": "Avg. execution price", + "status": "Status", + "amountReceived": "Amount received", + "amountSent": "Amount sent", + "excecutionSummary": "Execution summary", + "orderInfo": "Order info", + "every": "Every", + "expiryTooltip": "This is the date and time marking the end of the period which you have selected for your order to be executed.", + "individualTradeSizeTooltip": "The number of input tokens that will be removed from your balance and swapped for the output token in each individual trade.", + "numOfTradesTooltip": "The total number of individual trades that will be scheduled as part of your order.", + "fillDelayTooltip": "The estimated minimum amount of time that will elapse between each trade in your order.", + "minimumReceivedTooltip": "This is the minimum number of tokens that may be received. NOTE: This minimum only refers to executed trades. Some trades may not be executed if the limit price is higher than the available market prices and your order may only be partially filled.", + "orbs": "Orbs", + "approveToken": "Approve {{ symbol }} spending", + "tradeSizeWarning": "Trade size must be at least ${{ usd }}", + "minExpiryWarning": "Min. expiry is {{ value }} minutes", + "maxExpiryWarning": "Max. expiry is 30 days", + "minFillDelayWarning": "Min. trade interval is {{ value }} minutes", + "maxFillDelayWarning": "Max. trade interval is {{ value }} days", + "open": "open", + "limitPriceWarning": "Limit orders may not execute when the token's price is equal or close to the limit price, due to gas and standard swap fees.", + "marketPriceWarning": "Each individual trade in this order will be filled at the current market price at the time of execution.", + "toBuy": "To Buy", + "confirmOrder": "Confirm Order", + "allocated": "Allocated", + "twapMarketOrder": "TWAP Market Order", + "twapLimitOrder": "TWAP Limit Order", + "limitOrder": "Limit Order", + "created": "Created", + "create": "Create", + "networkFeeHelper": "Network fees are paid for transaction" } diff --git a/src/components/ConfirmSwapModal/ConfirmSwapModal.tsx b/src/components/ConfirmSwapModal/ConfirmSwapModal.tsx index 13daf77a6..755c31e82 100755 --- a/src/components/ConfirmSwapModal/ConfirmSwapModal.tsx +++ b/src/components/ConfirmSwapModal/ConfirmSwapModal.tsx @@ -10,7 +10,6 @@ import { formatTokenAmount } from 'utils'; import 'components/styles/ConfirmSwapModal.scss'; import { useTranslation } from 'react-i18next'; import { OptimalRate } from '@paraswap/sdk'; -import { useLiquidityHubState } from 'state/swap/liquidity-hub/hooks'; /** * Returns true if the trade requires a confirmation of details before we can submit it @@ -100,7 +99,6 @@ const ConfirmSwapModal: React.FC = ({ outputCurrency, ]); - const liquidityHubState = useLiquidityHubState(); // text to show while loading const pendingText = t('swappingFor', { amount1: optimalRate @@ -110,8 +108,7 @@ const ConfirmSwapModal: React.FC = ({ ? trade?.inputAmount?.currency?.symbol : inputCurrency?.symbol, amount2: optimalRate - ? Number(liquidityHubState.outAmount || optimalRate.destAmount) / - 10 ** optimalRate.destDecimals + ? Number(optimalRate.destAmount) / 10 ** optimalRate.destDecimals : formatTokenAmount(trade?.outputAmount), symbol2: trade ? trade?.outputAmount?.currency?.symbol diff --git a/src/components/CurrencyInput/CurrencyInput.tsx b/src/components/CurrencyInput/CurrencyInput.tsx index 1012accc5..5e6bdd36f 100755 --- a/src/components/CurrencyInput/CurrencyInput.tsx +++ b/src/components/CurrencyInput/CurrencyInput.tsx @@ -38,6 +38,7 @@ interface CurrencyInputProps { classNames?: string; balancePrev?: string; balanceAfter?: string; + disabled?: boolean; } const CurrencyInput: React.FC = ({ @@ -58,6 +59,7 @@ const CurrencyInput: React.FC = ({ classNames, balancePrev, balanceAfter, + disabled, }) => { const { t } = useTranslation(); const { account, chainId } = useActiveWeb3React(); @@ -157,7 +159,12 @@ const CurrencyInput: React.FC = ({ sx={{ borderRadius: '10px', padding: '8px 16px' }} className='bg-input1' > - + - - -
-
{item.text}
-
- {item.isNew && } -
+ +
+
{item.text}
+
+ {item.isNew && }
- +
+
- {hasSubMenu ? ( - open ? ( - - ) : ( - - ) + {hasSubMenu ? ( + open ? ( + ) : ( - <> - )} - + + ) + ) : ( + <> + )} {hasSubMenu && ( = ({ const config = getConfig(chainId); const showPerps = config['perps']['available']; + const showPools = config['pools']['available']; + const showHydra = config['hydra']['available']; const showPerpsV2 = config['perpsV2']['available']; @@ -375,9 +377,11 @@ const MobileHeader: React.FC = ({ }} /> - - {t('pool')} - + {showPools && ( + + {t('pool')} + + )} = ({ onClick={() => setOpen(false)} /> ))} - - { - setOpen(false); - }} - > - - - Close - - - + { + setOpen(false); + }} + > + + + Close + + - - + + diff --git a/src/components/Header/StyledMenu.tsx b/src/components/Header/StyledMenu.tsx index b87eb5f2e..8235dc362 100644 --- a/src/components/Header/StyledMenu.tsx +++ b/src/components/Header/StyledMenu.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; -import { styled, alpha } from '@mui/material/styles'; -import Menu, { MenuProps } from '@mui/material/Menu'; +import { MenuProps, styled, Menu } from '@material-ui/core'; export const StyledMenu = styled((props: MenuProps) => ( = ({ /> - +

{t('language')}

diff --git a/src/components/Swap/LiquidityHub.tsx b/src/components/Swap/LiquidityHub.tsx deleted file mode 100644 index f0a4de7d5..000000000 --- a/src/components/Swap/LiquidityHub.tsx +++ /dev/null @@ -1,1263 +0,0 @@ -import React, { useCallback, useMemo } from 'react'; -import Web3 from 'web3'; -import BN from 'bignumber.js'; -import { useExpertModeManager, useLiquidityHubManager } from 'state/user/hooks'; -import { useActiveWeb3React, useIsProMode } from 'hooks'; -import { useLocation } from 'react-router-dom'; -import { styled } from '@material-ui/styles'; -import { Box, Divider } from '@material-ui/core'; -import OrbsLogo from 'assets/images/orbs-logo.svg'; -import { - setWeb3Instance, - maxUint256, - permit2Address, - hasWeb3Instance, - zeroAddress, - web3, -} from '@defi.org/web3-candies'; -import { useTranslation } from 'react-i18next'; -import { - useLiquidityHubActionHandlers, - useLiquidityHubState, -} from 'state/swap/liquidity-hub/hooks'; -import { useTokenContract, useWETHContract } from 'hooks/useContract'; -import { getConfig } from 'config/index'; -import ToggleSwitch from 'components/ToggleSwitch'; -import { useUSDCPriceFromAddress } from 'utils/useUSDCPrice'; -import { ChainId, ETHER, Trade, WETH, Currency } from '@uniswap/sdk'; -import { Contract } from 'ethers'; -import { useSwapActionHandlers } from 'state/swap/hooks'; -import { Field } from 'state/swap/actions'; -import { Currency as CoreCurrency, Percent } from '@uniswap/sdk-core'; -import { ZERO_ADDRESS } from 'constants/v3/misc'; -import { wrappedCurrency } from 'utils/wrappedCurrency'; -import { parseUnits, _TypedDataEncoder } from 'ethers/lib/utils'; -import { getFixedValue } from 'utils'; -const ANALYTICS_VERSION = 0.5; -const WEBSITE = 'https://www.orbs.com'; -const BI_ENDPOINT = `https://bi.orbs.network/putes/liquidity-hub-ui-${ANALYTICS_VERSION}`; -const DEX_PRICE_BETTER_ERROR = 'Dex trade is better than Clob trade'; -const PARTNER = 'QuickSwap'; - -const getApiEndpoint = (chainId: number) => { - if (chainId === ChainId.ZKEVM) { - return 'https://zkevm.hub.orbs.network'; - } - return 'https://polygon.hub.orbs.network'; -}; - -export const useLiquidityHubCallback = ( - allowedSlippage: number, - inTokenAddress?: string, - outTokenAddress?: string, - inTokenCurrency?: Currency, - outTokenCurrency?: Currency, -) => { - const [liquidityHubDisabled] = useLiquidityHubManager(); - const { account, library, chainId } = useActiveWeb3React(); - const liquidityHubState = useLiquidityHubState(); - const { onSetLiquidityHubState } = useLiquidityHubActionHandlers(); - const { lhControl } = useQueryParam(); - const approve = useApprove(); - const wethContract = useWETHContract(); - const inTokenContract = useTokenContract(inTokenAddress); - const isApproved = useApproved(); - const swap = useSwap(); - const sign = useSign(); - const quote = useQuote(allowedSlippage); - const wrap = useWrap(); - const isSupported = useIsLiquidityHubSupported(); - const chainIdToUse = chainId ? chainId : ChainId.MATIC; - const nativeCurrency = ETHER[chainIdToUse]; - - const isNativeIn = nativeCurrency.symbol === inTokenCurrency?.symbol; - const isNativeOut = nativeCurrency.symbol === outTokenCurrency?.symbol; - - const { price: outTokenUSD } = useUSDCPriceFromAddress( - isNativeOut ? WETH[chainId].address : outTokenAddress || '', - ); - - const isProMode = useIsProMode(); - const [expertMode] = useExpertModeManager(); - - return async ( - srcAmount?: string, - minDestAmount?: string, - dexOutAmountWS?: string, - ) => { - liquidityHubAnalytics.clearState(); - const dstTokenUsdValue = new BN(minDestAmount || '0') - .multipliedBy(outTokenUSD || 0) - .dividedBy(new BN(10).pow(new BN(outTokenCurrency?.decimals || 0))) - .toNumber(); - const isForce = lhControl === LiquidityHubControl.FORCE; - - liquidityHubAnalytics.onBestTrade({ - dexAmountOut: minDestAmount, - dstTokenUsdValue, - srcTokenAddress: inTokenAddress, - srcTokenSymbol: inTokenCurrency?.symbol, - dstTokenAddress: outTokenAddress, - dstTokenSymbol: outTokenCurrency?.symbol, - srcAmount, - slippage: allowedSlippage / 100, - walletAddress: account, - chainId: chainIdToUse, - dexOutAmountWS, - }); - - if (isProMode) { - liquidityHubAnalytics.onIsProMode(); - } - if (expertMode) { - liquidityHubAnalytics.onExpertMode(); - } - if (isForce) { - liquidityHubAnalytics.onForceClob(); - } - - try { - if (liquidityHubState.isFailed) { - if (!isForce) { - throw new Error('previous failure'); - } - } - if (lhControl === LiquidityHubControl.SKIP) { - throw new Error('query param'); - } - if (!isSupported) { - throw new Error('clob not supported'); - } - if (liquidityHubDisabled) { - throw new Error('clob disabled'); - } - if (!minDestAmount) { - throw new Error('minDestAmount is not defined'); - } - if (!inTokenAddress) { - throw new Error('inTokenAddress is not defined'); - } - if (!outTokenAddress) { - throw new Error('outTokenAddress is not defined'); - } - if (!library) { - throw new Error('library is not defined'); - } - if (!account) { - throw new Error('account is not defined'); - } - if (!srcAmount) { - throw new Error('srcAmount is not defined'); - } - } catch (error) { - liquidityHubAnalytics.onNotClobTrade(error.message); - return; - } - liquidityHubAnalytics.onWallet(library); - - onSetLiquidityHubState({ - isLoading: true, - }); - - const quoteArgs: QuoteArgs = { - outToken: outTokenAddress, - inAmount: srcAmount, - inToken: isNativeIn ? zeroAddress : inTokenAddress, - minDestAmount, - }; - let wrapped = false; - const nativeInStartFlow = async () => { - await quote(quoteArgs); - wrapped = await wrap(srcAmount); - - const approved = await isApproved(srcAmount, wethContract); - if (!approved) { - liquidityHubAnalytics.onApprovedBeforeTheTrade(false); - await approve(wethContract); - } else { - liquidityHubAnalytics.onApprovedBeforeTheTrade(true); - } - }; - - const regularStartFlow = async () => { - const approved = await isApproved(srcAmount, inTokenContract); - if (!approved) { - liquidityHubAnalytics.onApprovedBeforeTheTrade(false); - await quote(quoteArgs); - await approve(inTokenContract); - } else { - liquidityHubAnalytics.onApprovedBeforeTheTrade(true); - } - }; - - try { - if (isNativeIn) { - await nativeInStartFlow(); - } else { - await regularStartFlow(); - } - - const quoteResult = await quote(quoteArgs); - onSetLiquidityHubState({ - isWon: true, - isLoading: false, - outAmount: quoteResult.outAmount, - }); - const signature = await sign(quoteResult.permitData); - - const response = await swap({ - srcToken: inTokenAddress, - destToken: outTokenAddress, - srcAmount, - minDestAmount, - signature, - quoteResult, - }); - liquidityHubAnalytics.onClobSuccess(response); - return response; - } catch (error) { - liquidityHubAnalytics.onClobFailure(); - onSetLiquidityHubState({ isFailed: true }); - if (wrapped) { - throw new Error( - 'Transaction reverted, Please try again. Note! Your MATIC has been wrapped and are now wMATIC', - ); - } - return undefined; - } finally { - onSetLiquidityHubState({ - isLoading: false, - isWon: false, - outAmount: '', - }); - } - }; -}; - -const useWrap = () => { - const wethContract = useWETHContract(); - const { onSetLiquidityHubState } = useLiquidityHubActionHandlers(); - const { onCurrencySelection } = useSwapActionHandlers(); - const { chainId } = useActiveWeb3React(); - - return async (inAmount: string) => { - const chainIdToUse = chainId ? chainId : ChainId.MATIC; - - const count = counter(); - onSetLiquidityHubState({ waitingForWrap: true }); - liquidityHubAnalytics.onWrapRequest(); - try { - const txReceipt = await wethContract?.deposit({ - value: `0x${new BN(inAmount).toString(16)}`, - }); - onCurrencySelection(Field.INPUT, WETH[chainIdToUse]); - const res = await txReceipt.wait(); - liquidityHubAnalytics.onWrapSuccess(res.transactionHash, count()); - return true; - } catch (error) { - liquidityHubAnalytics.onWrapFailed(error.message, count()); - throw new Error(error.message); - } finally { - onSetLiquidityHubState({ waitingForWrap: false }); - } - }; -}; - -const useApproved = () => { - const { account } = useActiveWeb3React(); - - return async (srcAmount: string, tokenContract: Contract | null) => { - try { - const allowance = await tokenContract?.allowance(account, permit2Address); - return BN(allowance?.toString() || '0').gte(BN(srcAmount)); - } catch (error) { - return false; - } - }; -}; - -const useApprove = () => { - const { onSetLiquidityHubState } = useLiquidityHubActionHandlers(); - - return async (tokenContract?: Contract | null) => { - const count = counter(); - try { - onSetLiquidityHubState({ waitingForApproval: true }); - liquidityHubAnalytics.onApprovalRequest(); - const response = await tokenContract?.approve( - permit2Address, - maxUint256, - { - gasLimit: 100_000, - }, - ); - - const res = await response.wait(); - liquidityHubAnalytics.onApprovalSuccess(count()); - return res; - } catch (error) { - liquidityHubAnalytics.onApprovalFailed(error.message, count()); - throw new Error(error.message); - } finally { - onSetLiquidityHubState({ waitingForApproval: false }); - } - }; -}; - -const useSign = () => { - const { account, library } = useActiveWeb3React(); - const { onSetLiquidityHubState } = useLiquidityHubActionHandlers(); - return async (permitData: any) => { - const count = counter(); - - try { - if (!account || !library) { - throw new Error('No account or library'); - } - onSetLiquidityHubState({ waitingForSignature: true }); - liquidityHubAnalytics.onSignatureRequest(); - if (!hasWeb3Instance()) { - setWeb3Instance(new Web3(library.provider as any)); - } - process.env.DEBUG = 'web3-candies'; - const signature = await signEIP712(account, permitData); - liquidityHubAnalytics.onSignatureSuccess(signature, count()); - return signature; - } catch (error) { - liquidityHubAnalytics.onSignatureFailed(error.message, count()); - throw new Error(error.message); - } finally { - onSetLiquidityHubState({ waitingForSignature: false }); - } - }; -}; - -const useSwap = () => { - const { library, account, chainId } = useActiveWeb3React(); - return async (args: { - srcToken: string; - destToken: string; - srcAmount: string; - minDestAmount: string; - signature: string; - quoteResult: QuoteResponse; - }) => { - const count = counter(); - try { - liquidityHubAnalytics.onSwapRequest(); - const txHashResponse = await fetch( - `${getApiEndpoint(chainId)}/swapx?chainId=${chainId}`, - { - method: 'POST', - body: JSON.stringify({ - inToken: args.srcToken, - outToken: args.destToken, - inAmount: args.srcAmount, - user: account, - signature: args.signature, - ...args.quoteResult, - }), - }, - ); - const swap = await txHashResponse.json(); - if (!swap) { - throw new Error('Missing swap response'); - } - - if (swap.error || (swap.message && !swap.txHash)) { - throw new Error(swap); - } - - if (!swap.txHash) { - throw new Error('Missing txHash'); - } - const tx = await waitForTx(swap.txHash, library); - liquidityHubAnalytics.onSwapSuccess(swap.txHash, count()); - return tx; - } catch (error) { - const message = JSON.stringify(error); - liquidityHubAnalytics.onSwapFailed(message, count()); - throw new Error(message); - } - }; -}; - -const useQuote = (allowedSlippage: number) => { - const { account, chainId } = useActiveWeb3React(); - const { lhControl } = useQueryParam(); - - return async (args: QuoteArgs) => { - let quoteResponse: any; - const count = counter(); - liquidityHubAnalytics.incrementQuoteIndex(); - liquidityHubAnalytics.onQuoteRequest(); - const abortController = new AbortController(); - - try { - const timeout = setTimeout(() => { - abortController.abort(); - }, 8_000); - - const response = await fetch( - `${getApiEndpoint(chainId)}/quote?chainId=${chainId}`, - { - method: 'POST', - body: JSON.stringify({ - inToken: args.inToken, - outToken: args.outToken, - inAmount: args.inAmount, - outAmount: args.minDestAmount, - user: account, - slippage: allowedSlippage / 100, - qs: encodeURIComponent(window.location.hash), - sessionId: liquidityHubAnalytics.data.sessionId, - }), - signal: abortController.signal, - }, - ); - quoteResponse = await response.json(); - clearTimeout(timeout); - if (!quoteResponse) { - throw new Error('Missing result from quote'); - } - if (quoteResponse.error) { - throw new Error(quoteResponse.error); - } - - if (quoteResponse.message) { - throw new Error(quoteResponse.message); - } - const isForce = lhControl === LiquidityHubControl.FORCE; - if ( - !isForce && - BN(quoteResponse.outAmount || '0').isLessThan( - BN(args.minDestAmount || '0'), - ) - ) { - throw new Error(DEX_PRICE_BETTER_ERROR); - } - liquidityHubAnalytics.onQuoteSuccess(quoteResponse, count()); - return quoteResponse as QuoteResponse; - } catch (error) { - liquidityHubAnalytics.onQuoteFailed( - error.message, - count(), - quoteResponse, - ); - - throw new Error(error.message); - } finally { - if (quoteResponse.sessionId) { - liquidityHubAnalytics.setSessionId(quoteResponse.sessionId); - } - } - }; -}; - -//utils - -const useIsLiquidityHubSupported = () => { - const { chainId } = useActiveWeb3React(); - - return useMemo(() => getConfig(chainId)?.swap?.liquidityHub, [chainId]); -}; - -export const useIsLiquidityHubEnabled = () => { - const isSupported = useIsLiquidityHubSupported(); - const [liquidityHubDisabled] = useLiquidityHubManager(); - - return isSupported && !liquidityHubDisabled; -}; - -async function waitForTx(txHash: string, library: any) { - for (let i = 0; i < 30; ++i) { - // due to swap being fetch and not web3 - - await delay(2_000); // to avoid potential rate limiting from public rpc - try { - const tx = await library.getTransaction(txHash); - if (tx && tx instanceof Object && tx.blockNumber) { - return tx; - } - } catch (error) {} - } -} - -function delay(ms: number) { - return new Promise((resolve) => setTimeout(resolve, ms)); -} - -export const useQueryParam = () => { - const location = useLocation(); - - const query = useMemo(() => new URLSearchParams(location.search), [ - location.search, - ]); - - return { - lhControl: query.get('liquidity-hub')?.toLowerCase(), - }; -}; - -enum TradeType { - V2 = 'V2', - V3 = 'V3', - BEST_TRADE = 'BEST_TRADE', - TWAP = 'TWAP', - LIMIT = 'LIMIT', -} - -type InitTradeArgs = { - srcTokenAddress?: string; - dstTokenAddress?: string; - srcTokenSymbol?: string; - dstTokenSymbol?: string; - walletAddress?: string; - slippage?: number; - srcAmount?: string; - dexAmountOut?: string; - dstTokenUsdValue?: number; - chainId: number; - dexOutAmountWS?: string; -}; -const sendBI = async (data: Partial) => { - try { - fetch(BI_ENDPOINT, { - method: 'POST', - body: JSON.stringify(data), - }); - } catch (error) {} -}; - -const initialData: Partial = { - _id: crypto.randomUUID(), - partner: PARTNER, - isClobTrade: false, - quoteIndex: 0, - isForceClob: false, - isDexTrade: false, - version: ANALYTICS_VERSION, -}; - -const counter = () => { - const now = Date.now(); - - return () => { - return Date.now() - now; - }; -}; - -class LiquidityHubAnalytics { - initialTimestamp = Date.now(); - data = initialData; - firstFailureSessionId = ''; - timeout: any = undefined; - - updateChainId(chainId: number) { - this.data.chainId = chainId; - } - - private updateAndSend(values = {} as Partial) { - this.data = { ...this.data, ...values }; - - clearTimeout(this.timeout); - this.timeout = setTimeout(() => { - sendBI(this.data); - }, 1_000); - } - - incrementQuoteIndex() { - this.updateAndSend({ - quoteIndex: !this.data.quoteIndex ? 1 : this.data.quoteIndex + 1, - }); - } - - onQuoteRequest() { - this.updateAndSend({ [`quote-${this.data.quoteIndex}-state`]: 'pending' }); - } - - onQuoteSuccess(quoteResponse: QuoteResponse, time: number) { - this.updateAndSend({ [`quote-${this.data.quoteIndex}-state`]: 'success' }); - this.onQuoteData(quoteResponse, time); - } - - onBestTrade(values: InitTradeArgs) { - this.updateAndSend({ tradeType: TradeType.BEST_TRADE, ...values }); - } - onTwapTrade(values: InitTradeArgs) { - this.updateAndSend({ tradeType: TradeType.TWAP, ...values }); - } - - onLimitTrade(values: InitTradeArgs) { - this.updateAndSend({ tradeType: TradeType.LIMIT, ...values }); - } - - onV2Trade(values: InitTradeArgs) { - this.updateAndSend({ tradeType: TradeType.V2, ...values }); - } - - onV3Trade(values: InitTradeArgs) { - this.updateAndSend({ tradeType: TradeType.V3, ...values }); - } - - onQuoteFailed(error: string, time: number, quoteResponse?: QuoteResponse) { - if (error == DEX_PRICE_BETTER_ERROR) { - this.updateAndSend({ - isNotClobTradeReason: DEX_PRICE_BETTER_ERROR, - [`quote-${this.data.quoteIndex}-state`]: 'success', - }); - } else { - this.updateAndSend({ - [`quote-${this.data.quoteIndex}-error`]: error, - [`quote-${this.data.quoteIndex}-state`]: 'failed', - isNotClobTradeReason: `quote-${this.data.quoteIndex}-failed`, - }); - } - - this.onQuoteData(quoteResponse, time); - } - - onQuoteData(quoteResponse?: QuoteResponse, time?: number) { - const getDiff = () => { - if (!quoteResponse?.outAmount || !this.data.dexAmountOut) { - return ''; - } - return new BN(quoteResponse?.outAmount) - .dividedBy(new BN(this.data.dexAmountOut)) - .minus(1) - .multipliedBy(100) - .toFixed(2); - }; - - this.updateAndSend({ - [`quote-${this.data.quoteIndex}-amount-out`]: quoteResponse?.outAmount, - [`quote-${this.data.quoteIndex}-serialized-order`]: quoteResponse?.serializedOrder, - [`quote-${this.data.quoteIndex}-quote-millis`]: time, - clobDexPriceDiffPercent: getDiff(), - }); - } - - onApprovedBeforeTheTrade(userWasApprovedBeforeTheTrade: boolean) { - this.updateAndSend({ userWasApprovedBeforeTheTrade }); - } - - onApprovalRequest() { - this.updateAndSend({ approvalState: 'pending' }); - } - - onDexSwapRequest() { - this.updateAndSend({ dexSwapState: 'pending', isDexTrade: true }); - } - - onDexSwapSuccess(response: any) { - this.updateAndSend({ - dexSwapState: 'success', - dexSwapTxHash: response.hash, - }); - - this.pollTransaction({ - response, - onSucess: () => { - this.updateAndSend({ onChainDexSwapState: 'success' }); - }, - onFailed: () => { - this.updateAndSend({ onChainDexSwapState: 'failed' }); - }, - }); - } - onDexSwapFailed(dexSwapError: string) { - this.updateAndSend({ dexSwapState: 'failed', dexSwapError }); - } - - onApprovalSuccess(time: number) { - this.updateAndSend({ approvalMillis: time, approvalState: 'success' }); - } - - onApprovalFailed(error: string, time: number) { - this.updateAndSend({ - approvalError: error, - approvalState: 'failed', - approvalMillis: time, - isNotClobTradeReason: 'approval failed', - }); - } - - onSignatureRequest() { - this.updateAndSend({ signatureState: 'pending' }); - } - - onWrapRequest() { - this.updateAndSend({ wrapState: 'pending' }); - } - - onWrapSuccess(txHash: string, time: number) { - this.updateAndSend({ - wrapTxHash: txHash, - wrapMillis: time, - wrapState: 'success', - }); - } - - onWrapFailed(error: string, time: number) { - this.updateAndSend({ - wrapError: error, - wrapState: 'failed', - wrapMillis: time, - isNotClobTradeReason: 'wrap failed', - }); - } - - onSignatureSuccess(signature: string, time: number) { - this.updateAndSend({ - signature, - signatureMillis: time, - signatureState: 'success', - }); - } - - onWallet = (library: any) => { - try { - const walletConnectName = (library as any)?.provider?.session?.peer - .metadata.name; - - if (library.provider.isRabby) { - this.updateAndSend({ walletConnectName, isRabby: true }); - } else if (library.provider.isWalletConnect) { - this.updateAndSend({ walletConnectName, isWalletConnect: true }); - } else if (library.provider.isCoinbaseWallet) { - this.updateAndSend({ walletConnectName, isCoinbaseWallet: true }); - } else if (library.provider.isOkxWallet) { - this.updateAndSend({ walletConnectName, isOkxWallet: true }); - } else if (library.provider.isTrustWallet) { - this.updateAndSend({ walletConnectName, isTrustWallet: true }); - } else if (library.provider.isMetaMask) { - this.updateAndSend({ walletConnectName, isMetaMask: true }); - } - } catch (error) { - console.log('Error on wallet', error); - } - }; - - onSignatureFailed(error: string, time: number) { - this.updateAndSend({ - signatureError: error, - signatureState: 'failed', - signatureMillis: time, - isNotClobTradeReason: 'signature failed', - }); - } - - onSwapRequest() { - this.updateAndSend({ swapState: 'pending' }); - } - - onSwapSuccess(txHash: string, time: number) { - this.updateAndSend({ - txHash, - swapMillis: time, - swapState: 'success', - isClobTrade: true, - onChainClobSwapState: 'pending', - }); - } - - onSwapFailed(error: string, time: number) { - this.updateAndSend({ - swapError: error, - swapState: 'failed', - swapMillis: time, - isNotClobTradeReason: 'swap failed', - }); - } - - setSessionId(id: string) { - this.data.sessionId = id; - } - - onForceClob() { - this.updateAndSend({ isForceClob: true }); - } - - onIsProMode() { - this.updateAndSend({ isProMode: true }); - } - - onExpertMode() { - this.updateAndSend({ expertMode: true }); - } - - clearState() { - this.data = { - ...initialData, - _id: crypto.randomUUID(), - firstFailureSessionId: this.firstFailureSessionId, - }; - } - - async pollTransaction({ - response, - onSucess, - onFailed, - }: { - response: any; - onSucess: () => void; - onFailed: () => void; - }) { - try { - const receipt = await response.wait(); - if (receipt.status === 1) { - onSucess(); - } else { - throw new Error('Transaction failed'); - } - } catch (error) { - onFailed(); - } - } - - async onClobSuccess(response: any) { - this.pollTransaction({ - response, - onSucess: () => { - this.updateAndSend({ onChainClobSwapState: 'success' }); - }, - onFailed: () => { - { - this.updateAndSend({ - onChainClobSwapState: 'failed', - isNotClobTradeReason: 'onchain swap error', - }); - } - }, - }); - } - - onNotClobTrade(message: string) { - this.updateAndSend({ isNotClobTradeReason: message }); - } - - onClobFailure() { - this.firstFailureSessionId = - this.firstFailureSessionId || this.data.sessionId || ''; - } -} - -export const liquidityHubAnalytics = new LiquidityHubAnalytics(); - -export const useConfirmationPendingContent = (pendingText?: string) => { - const { t } = useTranslation(); - const liquidityHubState = useLiquidityHubState(); - return useMemo(() => { - if (liquidityHubState?.waitingForApproval) { - return { - title: t('seekingBestPrice'), - confirm: t('awaitingApproval'), - }; - } - if (liquidityHubState?.waitingForWrap) { - return { - title: t('seekingBestPrice'), - confirm: t('awaitingWrap'), - }; - } - if (liquidityHubState?.isLoading) { - return { - title: t('seekingBestPrice'), - }; - } - if (liquidityHubState?.isWon) { - return { - title: t('optimizedRouteAvailable'), - pending: pendingText, - confirm: - liquidityHubState.waitingForSignature && - t('signToPerformGaslessSwap'), - }; - } - return { - title: t('waitingConfirm'), - pending: pendingText, - confirm: t('confirmTxinWallet'), - }; - }, [ - liquidityHubState?.isLoading, - liquidityHubState?.isWon, - pendingText, - t, - liquidityHubState?.waitingForApproval, - liquidityHubState.waitingForSignature, - liquidityHubState?.waitingForWrap, - ]); -}; - -// components - -export const LiquidityHubTxSettings = () => { - const [ - liquidityHubDisabled, - toggleLiquidityHubDisabled, - ] = useLiquidityHubManager(); - const { t } = useTranslation(); - - const isSupported = useIsLiquidityHubSupported(); - if (!isSupported) return null; - - return ( - <> - - -

{t('disableLiquidityHub')}

-

- - - {t('liquidityHub')} - - , {t('poweredBy').toLowerCase()}{' '} - - Orbs - - , {t('aboutLiquidityHub')}{' '} - - {t('forMoreInfo')} - -

-
- -
- - - ); -}; - -export const LiquidityHubConfirmationModalContent = ({ - txPending, -}: { - txPending?: boolean; -}) => { - const { t } = useTranslation(); - const liquidityHubState = useLiquidityHubState(); - - if (!liquidityHubState?.isWon || txPending) { - return null; - } - return ( - - {t('using')}{' '} - - {t('liquidityHub')} - {' '} - {t('by')}{' '} - - Orbs - - - - ); -}; - -// styles -const StyledLiquidityHubTrade = styled('p')({ - '& a': { - textDecoration: 'none', - display: 'inline-flex', - gap: 5, - fontWeight: 600, - color: 'white', - '&:hover': { - textDecoration: 'underline', - }, - }, - '& span': { - textTransform: 'capitalize', - fontSize: 'inherit', - }, - '& img': { - width: 22, - height: 22, - objectFit: 'contain', - }, -}); - -const StyledLiquidityHubTxSettings = styled(Box)({ - display: 'flex', - flexDirection: 'column', - '& .bottom-text': { - maxWidth: 500, - fontSize: 14, - lineHeight: '23px', - '& img': { - width: 22, - height: 22, - marginRight: 8, - position: 'relative', - top: 6, - }, - '& a': { - textDecoration: 'none', - fontWeight: 600, - color: '#6381e9', - '&:hover': { - textDecoration: 'underline', - }, - }, - '& .more-info': { - color: 'inherit', - fontWeight: 400, - textDecoration: 'underline', - }, - }, -}); - -// types - -type actionState = 'pending' | 'success' | 'failed' | 'null' | ''; - -interface LiquidityHubAnalyticsData { - _id: string; - partner: string; - chainId: number; - isForceClob: boolean; - firstFailureSessionId?: string; - sessionId?: string; - walletAddress: string; - dexAmountOut: string; - isClobTrade: boolean; - srcTokenAddress: string; - srcTokenSymbol: string; - dstTokenAddress: string; - dstTokenSymbol: string; - srcAmount: string; - quoteIndex: number; - slippage: number; - 'quote-1-state': actionState; - 'quote-2-state': string; - clobDexPriceDiffPercent: string; - - approvalState: actionState; - approvalError: string; - approvalMillis: number | null; - - signatureState: actionState; - signatureMillis: number | null; - signature: string; - signatureError: string; - - swapState: actionState; - txHash: string; - swapMillis: number | null; - swapError: string; - - wrapState: actionState; - wrapMillis: number | null; - wrapError: string; - wrapTxHash: string; - - dexSwapState: actionState; - dexSwapError: string; - dexSwapTxHash: string; - - userWasApprovedBeforeTheTrade?: boolean | string; - dstAmountOutUsd: number; - isProMode: boolean; - expertMode: boolean; - tradeType?: TradeType | null; - isNotClobTradeReason: string; - onChainClobSwapState: actionState; - version: number; - isDexTrade: boolean; - onChainDexSwapState: actionState; - dexOutAmountWS?: string; - walletConnectName?: string; - isRabby?: boolean; - isMetaMask?: boolean; - isCoinbaseWallet?: boolean; - isWalletConnect?: boolean; - isTrustWallet?: boolean; - isOkxWallet?: boolean; -} - -interface QuoteResponse { - outAmount: string; - permitData: any; - serializedOrder: string; - callData: string; - rawData: any; -} - -type QuoteArgs = { - minDestAmount: string; - inAmount: string; - inToken: string; - outToken: string; -}; - -enum LiquidityHubControl { - FORCE = '1', - SKIP = '2', -} - -const handleV3Token = (currency: CoreCurrency | undefined, value?: string) => { - if (!currency) { - return { - symbol: '', - address: '', - value: '', - }; - } - - return { - symbol: currency.isNative ? 'MATIC' : currency.wrapped.symbol, - address: currency.isNative ? ZERO_ADDRESS : currency.wrapped.address, - decimals: currency.decimals, - value: parseUnits( - getFixedValue(value || '0', currency.decimals), - currency.decimals, - ).toString(), - }; -}; - -export const useV3TradeTypeAnalyticsCallback = ( - currencies: { - INPUT?: CoreCurrency | undefined; - OUTPUT?: CoreCurrency | undefined; - }, - allowedSlippage: Percent, -) => { - const { account, chainId } = useActiveWeb3React(); - const outTokenUSD = useUSDCPriceFromAddress( - currencies[Field.OUTPUT]?.wrapped.address || '', - ).price; - - const srcTokenCurrency = currencies[Field.INPUT]; - const dstTokenCurrency = currencies[Field.OUTPUT]; - - return useCallback( - (formattedAmounts: { [x: string]: any; [x: number]: any }) => { - try { - const srcToken = handleV3Token( - srcTokenCurrency, - formattedAmounts[Field.INPUT], - ); - - const dstToken = handleV3Token( - dstTokenCurrency, - formattedAmounts[Field.OUTPUT], - ); - liquidityHubAnalytics.onV3Trade({ - srcTokenAddress: srcToken.address, - dstTokenAddress: dstToken.address, - dstTokenSymbol: dstToken.symbol, - srcTokenSymbol: srcToken.symbol, - srcAmount: srcToken.value, - dexAmountOut: dstToken.value, - dstTokenUsdValue: - outTokenUSD * Number(formattedAmounts[Field.OUTPUT]), - walletAddress: account || '', - slippage: Number(allowedSlippage.toFixed()), - chainId, - }); - } catch (error) {} - }, - [ - srcTokenCurrency, - dstTokenCurrency, - outTokenUSD, - account, - allowedSlippage, - chainId, - ], - ); -}; - -export const useV2TradeTypeAnalyticsCallback = ( - currencies: { - INPUT?: Currency | undefined; - OUTPUT?: Currency | undefined; - }, - allowedSlippage: number, -) => { - const { account, chainId } = useActiveWeb3React(); - - const srcTokenCurrency = currencies[Field.INPUT]; - const dstTokenCurrency = currencies[Field.OUTPUT]; - const inToken = wrappedCurrency(srcTokenCurrency, chainId); - const outToken = wrappedCurrency(dstTokenCurrency, chainId); - const outTokenUSD = useUSDCPriceFromAddress(outToken?.address).price; - - return useCallback( - (trade?: Trade) => { - try { - liquidityHubAnalytics.onV2Trade({ - srcTokenAddress: inToken?.address, - dstTokenAddress: outToken?.address, - srcTokenSymbol: inToken?.symbol, - dstTokenSymbol: outToken?.symbol, - srcAmount: trade?.inputAmount.raw.toString(), - dexAmountOut: trade?.outputAmount.raw.toString(), - dstTokenUsdValue: outTokenUSD * Number(trade?.outputAmount.toExact()), - walletAddress: account || '', - slippage: allowedSlippage / 100, - chainId, - }); - } catch (error) {} - }, - [account, inToken, outToken, outTokenUSD, allowedSlippage, chainId], - ); -}; - -async function signEIP712(signer: string, data: any) { - const typedDataMessage = _TypedDataEncoder.getPayload( - data.domain, - data.types, - data.values, - ); - - try { - return await signAsync('eth_signTypedData_v4', signer, typedDataMessage); - } catch (e) { - try { - return await signAsync('eth_signTypedData', signer, typedDataMessage); - } catch (e) { - throw e; - } - } -} - -async function signAsync( - method: 'eth_signTypedData_v4' | 'eth_signTypedData', - signer: string, - payload: any, -) { - const provider: any = (web3().currentProvider as any).send - ? web3().currentProvider - : (web3() as any)._provider; - return await new Promise((resolve, reject) => { - provider.send( - { - id: 1, - method, - params: [ - signer, - typeof payload === 'string' ? payload : JSON.stringify(payload), - ], - from: signer, - }, - (e: any, r: any) => { - if (e || !r?.result) return reject(e); - return resolve(r.result); - }, - ); - }); -} diff --git a/src/components/Swap/Swap.tsx b/src/components/Swap/Swap.tsx index d1d56cd5f..512fe123e 100644 --- a/src/components/Swap/Swap.tsx +++ b/src/components/Swap/Swap.tsx @@ -67,7 +67,6 @@ import { getConfig } from 'config/index'; import { wrappedCurrency } from 'utils/wrappedCurrency'; import { useUSDCPriceFromAddress } from 'utils/useUSDCPrice'; import { V2_ROUTER_ADDRESS } from 'constants/v3/addresses'; -import { useV2TradeTypeAnalyticsCallback } from './LiquidityHub'; import { SLIPPAGE_AUTO } from 'state/user/reducer'; import { useWalletInfo } from '@web3modal/ethers5/react'; import { useAppDispatch } from 'state'; @@ -532,15 +531,9 @@ const Swap: React.FC<{ fromTokenWrapped?.address ?? '', ); - const onV2TradeAnalytics = useV2TradeTypeAnalyticsCallback( - currencies, - allowedSlippage, - ); - const { walletInfo } = useWalletInfo(); const handleSwap = useCallback(() => { - onV2TradeAnalytics(trade); if ( priceImpactWithoutFee && !confirmPriceImpactWithoutFee(priceImpactWithoutFee, t) @@ -636,7 +629,6 @@ const Swap: React.FC<{ }); }); }, [ - onV2TradeAnalytics, trade, priceImpactWithoutFee, t, diff --git a/src/components/Swap/SwapBestTrade.tsx b/src/components/Swap/SwapBestTrade.tsx index fc7273626..b711f894b 100644 --- a/src/components/Swap/SwapBestTrade.tsx +++ b/src/components/Swap/SwapBestTrade.tsx @@ -86,6 +86,19 @@ import SignUp from './SignUp'; import { useWalletInfo } from '@web3modal/ethers5/react'; import { useAppDispatch } from 'state'; import { updateUserBalance } from 'state/balance/actions'; +import { + useIsLiquidityHubTrade, + useLiquidityHubQuote, +} from './orbs/LiquidityHub/hooks'; +import { LiquidityHubSwapConfirmation } from './orbs/LiquidityHub/LiquidityHubSwapConfirmation'; +import { isLowInAmountError } from './orbs/utils'; +import { PoweredByOrbs } from '@orbs-network/swap-ui'; +import { LiquidityHubSwapDetails } from './orbs/LiquidityHub/Components'; + +export const useIsliquidityHubOnly = () => { + const { chainId } = useActiveWeb3React(); + return useMemo(() => [ChainId.ETHEREUM].includes(chainId), [chainId]); +}; const SwapBestTrade: React.FC<{ currencyBgClass?: string; @@ -95,6 +108,8 @@ const SwapBestTrade: React.FC<{ const isProMode = useIsProMode(); const isSupportedNetwork = useIsSupportedNetwork(); const { walletInfo } = useWalletInfo(); + const [liquidityHubDisabled, setLiquidityHubDisabled] = useState(false); + const [showLiquidityHubConfirm, setShowLiquidityHubConfirm] = useState(false); // token warning stuff // const [loadedInputCurrency, loadedOutputCurrency] = [ @@ -136,6 +151,8 @@ const SwapBestTrade: React.FC<{ const { account, chainId, library } = useActiveWeb3React(); const { independentField, typedValue, recipient } = useSwapState(); const chainIdToUse = chainId ? chainId : ChainId.MATIC; + const isLiquidityHubOnly = useIsliquidityHubOnly(); + const { currencyBalances, parsedAmount, @@ -410,6 +427,7 @@ const SwapBestTrade: React.FC<{ ], queryFn: fetchOptimalRate, refetchInterval: 5000, + enabled: !isLiquidityHubOnly, }); const optimalRate = useMemo(() => { @@ -422,7 +440,36 @@ const SwapBestTrade: React.FC<{ return optimalRateData.error; }, [optimalRateData]); - const isValid = !swapInputError && !optimalRateError && !!optimalRate; + const liquidityHubQuoteQuery = useLiquidityHubQuote({ + allowedSlippage, + inAmount: parsedAmount?.raw.toString(), + inCurrency: currencies[Field.INPUT], + outCurrency: currencies[Field.OUTPUT], + dexOutAmount: optimalRate?.destAmount, + disabled: liquidityHubDisabled, + wrapType, + }); + + const { + data: liquidityHubQuote, + isLoading: liquidityHubQuoteLoading, + error: liquidityHubQuoteError, + } = liquidityHubQuoteQuery; + + const tradeSrcAmount = isLiquidityHubOnly + ? liquidityHubQuote?.inAmount + : optimalRate?.srcAmount; + const tradeDestAmount = isLiquidityHubOnly + ? liquidityHubQuote?.outAmount + : optimalRate?.destAmount; + + const loadingTrade = isLiquidityHubOnly + ? liquidityHubQuoteLoading + : loadingOptimalRate; + + const isValid = isLiquidityHubOnly + ? !liquidityHubQuoteError && !!liquidityHubQuote + : !optimalRateError && !!optimalRate; const parsedAmounts = useMemo(() => { const parsedAmountInput = @@ -443,19 +490,19 @@ const SwapBestTrade: React.FC<{ [Field.INPUT]: independentField === Field.INPUT ? parsedAmountInput - : optimalRate && inputCurrencyV3 + : tradeSrcAmount && inputCurrencyV3 ? CurrencyAmount.fromRawAmount( inputCurrencyV3, - JSBI.BigInt(optimalRate.srcAmount), + JSBI.BigInt(tradeSrcAmount), ) : undefined, [Field.OUTPUT]: independentField === Field.OUTPUT ? parsedAmountOutput - : optimalRate && outputCurrencyV3 + : tradeDestAmount && outputCurrencyV3 ? CurrencyAmount.fromRawAmount( outputCurrencyV3, - JSBI.BigInt(optimalRate.destAmount), + JSBI.BigInt(tradeDestAmount), ) : undefined, }; @@ -466,7 +513,8 @@ const SwapBestTrade: React.FC<{ showWrap, showNativeConvert, independentField, - optimalRate, + tradeSrcAmount, + tradeDestAmount, ]); const maxAmountInputV2 = maxAmountSpend( @@ -522,7 +570,7 @@ const SwapBestTrade: React.FC<{ maxAmountInput && parsedAmounts[Field.INPUT]?.equalTo(maxAmountInput), ); - const [approval, approveCallback] = useApproveCallbackFromBestTrade( + const [_approval, approveCallback] = useApproveCallbackFromBestTrade( pct, inputCurrencyV3, optimalRate, @@ -530,12 +578,25 @@ const SwapBestTrade: React.FC<{ atMaxAmountInput, ); + const approval = isLiquidityHubOnly ? ApprovalState.APPROVED : _approval; + const [ nativeConvertApproval, nativeConvertApproveCallback, ] = useApproveCallback(parsedAmount, NATIVE_CONVERTER[chainId]); + const isLiquidityHubTrade = useIsLiquidityHubTrade( + swapType, + liquidityHubDisabled, + allowedSlippage, + liquidityHubQuote, + optimalRate, + showWrap, + isLiquidityHubOnly, + ); + const showApproveFlow = + !isLiquidityHubOnly && !swapInputError && !showWrap && (showNativeConvert @@ -569,7 +630,7 @@ const SwapBestTrade: React.FC<{ const { callback: paraswapCallback, - error: paraswapCallbackError, + error: _paraswapCallbackError, } = useParaswapCallback( allowedSlippage, optimalRate, @@ -577,10 +638,21 @@ const SwapBestTrade: React.FC<{ inputCurrency, outputCurrency, ); + const isLowSrcAmountError = + isLiquidityHubOnly && isLowInAmountError(liquidityHubQuoteError); + + const paraswapCallbackError = isLiquidityHubOnly + ? undefined + : _paraswapCallbackError; + + const noRoute = isLiquidityHubOnly + ? !liquidityHubQuote?.outAmount + : !optimalRate || optimalRate.bestRoute.length < 0; - const noRoute = !optimalRate || optimalRate.bestRoute.length < 0; const swapInputAmountWithSlippage = - optimalRate && inputCurrencyV3 + isLiquidityHubOnly && inputCurrencyV3 && srcAmount + ? CurrencyAmount.fromRawAmount(inputCurrencyV3, srcAmount) + : optimalRate && inputCurrencyV3 ? CurrencyAmount.fromRawAmount( inputCurrencyV3, (optimalRate.side === SwapSide.BUY @@ -628,7 +700,7 @@ const SwapBestTrade: React.FC<{ : wrapType === WrapType.UNWRAPPING ? t('unwrappingMATIC', { symbol: WETH[chainId].symbol }) : ''; - } else if (loadingOptimalRate) { + } else if (loadingTrade) { return t('loading'); } else if ( optimalRateError === 'ESTIMATED_LOSS_GREATER_THAN_MAX_IMPACT' @@ -640,6 +712,8 @@ const SwapBestTrade: React.FC<{ : optimalRateError; } else if (swapInputError) { return swapInputError; + } else if (isLowSrcAmountError) { + return t('swap'); } else if (noRoute && userHasSpecifiedInputOutput) { return t('insufficientLiquidityTrade'); } else if ( @@ -666,7 +740,7 @@ const SwapBestTrade: React.FC<{ formattedAmounts, showNativeConvert, showWrap, - loadingOptimalRate, + loadingTrade, optimalRateError, swapInputError, noRoute, @@ -680,27 +754,29 @@ const SwapBestTrade: React.FC<{ wrapInputError, wrapType, maxImpactAllowed, + isLowSrcAmountError, ]); + const maxImpactReached = isLiquidityHubOnly + ? false + : optimalRate?.maxImpactReached; + const swapButtonDisabled = useMemo(() => { const isSwapError = (inputCurrencyV3 && inputCurrencyV3.isToken && approval === ApprovalState.UNKNOWN) || !isValid || - (optimalRate && optimalRate.maxImpactReached && !isExpertMode) || + (maxImpactReached && !isExpertMode) || !!paraswapCallbackError || - (optimalRate && - !parsedAmounts[Field.INPUT]?.equalTo( - JSBI.BigInt(optimalRate.srcAmount), - )) || - (optimalRate && - !parsedAmounts[Field.OUTPUT]?.equalTo( - JSBI.BigInt(optimalRate.destAmount), - )) || + (tradeSrcAmount && + !parsedAmounts[Field.INPUT]?.equalTo(JSBI.BigInt(tradeSrcAmount))) || + (tradeDestAmount && + !parsedAmounts[Field.OUTPUT]?.equalTo(JSBI.BigInt(tradeDestAmount))) || (swapInputAmountWithSlippage && swapInputBalance && swapInputAmountWithSlippage.greaterThan(swapInputBalance)); + if (account) { if (!isSupportedNetwork) return false; else if (showNativeConvert) { @@ -719,12 +795,15 @@ const SwapBestTrade: React.FC<{ return ( !isValid || approval !== ApprovalState.APPROVED || - (optimalRate && optimalRate.maxImpactReached && !isExpertMode) || + (maxImpactReached && !isExpertMode) || isSwapError ); } else { return isSwapError; } + } + if (isLowSrcAmountError) { + return true; } else { return false; } @@ -732,7 +811,6 @@ const SwapBestTrade: React.FC<{ inputCurrencyV3, approval, isValid, - optimalRate, isExpertMode, paraswapCallbackError, parsedAmounts, @@ -749,6 +827,10 @@ const SwapBestTrade: React.FC<{ convertType, wrapInputError, wrapType, + tradeSrcAmount, + tradeDestAmount, + maxImpactReached, + isLowSrcAmountError, ]); const [ @@ -962,6 +1044,14 @@ const SwapBestTrade: React.FC<{ handleParaswap, ]); + const onSubmitSwap = useCallback(() => { + if (isLiquidityHubTrade) { + setShowLiquidityHubConfirm(true); + } else { + onParaswap(); + } + }, [onParaswap, isLiquidityHubTrade]); + const paraRate = optimalRate ? (Number(optimalRate.destAmount) * 10 ** optimalRate.srcDecimals) / (Number(optimalRate.srcAmount) * 10 ** optimalRate.destDecimals) @@ -1124,6 +1214,23 @@ const SwapBestTrade: React.FC<{ }, [optimalRateNotExisting]); const [currentTime, setCurrentTime] = useState(Math.floor(Date.now() / 1000)); + const onLiquidityHubSwapFailed = useCallback( + () => setLiquidityHubDisabled(true), + [], + ); + const onLiquidityHubSwapSuccess = useCallback(() => { + handleTypeInput(''); + dispatch(updateUserBalance()); + }, [dispatch, handleTypeInput]); + + const onLiquidityHubSwapInProgress = useCallback((value: boolean) => { + setLiquidityHubDisabled(value); + }, []); + + const handleLiquidityHubConfirmDismiss = useCallback(() => { + setShowLiquidityHubConfirm(false); + }, []); + return ( + {showConfirm && ( {!showNativeConvert && !showWrap && isExpertMode && ( @@ -1253,6 +1374,7 @@ const SwapBestTrade: React.FC<{ approvalSubmitted } onClick={async () => { + setLiquidityHubDisabled(true); if (showNativeConvert) { setNativeConvertApproving(true); try { @@ -1294,7 +1416,9 @@ const SwapBestTrade: React.FC<{ : bonusRouteLoading || optimalRateError) || swapButtonDisabled) as boolean } - onClick={account && isSupportedNetwork ? onParaswap : connectWallet} + onClick={ + account && isSupportedNetwork ? onSubmitSwap : connectWallet + } > {swapButtonText} @@ -1346,11 +1470,18 @@ const SwapBestTrade: React.FC<{ )} - + {isLiquidityHubOnly ? ( + + ) : ( + + )} {/* @@ -1379,6 +1510,7 @@ const SwapBestTrade: React.FC<{ console.log('sub'); }} /> + {isLiquidityHubOnly && } ); }; diff --git a/src/components/Swap/orbs/ConfirmationModal.tsx b/src/components/Swap/orbs/ConfirmationModal.tsx new file mode 100644 index 000000000..14d969a7e --- /dev/null +++ b/src/components/Swap/orbs/ConfirmationModal.tsx @@ -0,0 +1,429 @@ +import React, { + createContext, + FC, + ReactNode, + useCallback, + useContext, + useMemo, + useReducer, + useState, +} from 'react'; +import { Box, Button } from '@material-ui/core'; +import { useTranslation } from 'react-i18next'; +import TransactionFailed from 'assets/images/TransactionFailed.png'; +import TransactionSubmitted from 'assets/images/TransactionSubmitted.png'; +import ModalBg from 'assets/images/ModalBG.svg'; +import { Currency, ETHER, WETH } from '@uniswap/sdk'; +import { useActiveWeb3React } from 'hooks'; +import { SwapFlow, SwapStatus, SwapStep } from '@orbs-network/swap-ui'; +import { ReactComponent as CloseIcon } from 'assets/images/CloseIcon.svg'; +import { formatNumber, getEtherscanLink } from 'utils'; +import 'components/styles/orbs/ConfirmationModal.scss'; +import CustomModal from 'components/CustomModal'; +import { useGetLogoCallback } from './hooks'; +import useWrapCallback, { WrapType } from 'hooks/useWrapCallback'; +import { Steps } from './consts'; +import { useAppDispatch } from 'state'; +import { updateUserBalance } from 'state/balance/actions'; + +interface SharedProps { + inCurrency?: Currency; + outCurrency?: Currency; + isOpen: boolean; + onDismiss: () => void; + inAmount?: string; + outAmount?: string; +} + +interface ContextValues extends SharedProps { + currentStep?: number; + steps?: SwapStep[]; + resetStore: () => void; + updateStore: (payload: Partial) => void; + state: ConfirmationState; +} + +export type ConfirmationState = { + swapStatus?: SwapStatus; + currentStep?: Steps; + shouldUnwrap?: boolean; + txHash?: string; + steps?: Steps[]; + error?: string; + stapStatus?: SwapStatus; +}; + +interface ConfirmationModalProps extends SharedProps { + errorContent?: React.ReactNode; + mainContent?: React.ReactNode; + successContent?: React.ReactNode; +} + +type Action = + | { type: 'UPDATE_STATE'; payload: Partial } + | { type: 'RESET' }; + +function reducer( + state: TState, + action: Action, + initialState: TState, +): TState { + switch (action.type) { + case 'UPDATE_STATE': + return { ...state, ...action.payload }; + case 'RESET': + return initialState; + default: + return state; + } +} + +const useConfirmationStore = (initialState: ConfirmationState) => { + const [state, dispatch] = useReducer( + (state: ConfirmationState, action: Action) => + reducer(state, action, initialState), + initialState, + ); + + const updateStore = useCallback( + (payload: Partial) => { + dispatch({ type: 'UPDATE_STATE', payload }); + }, + [dispatch], + ); + + const resetStore = useCallback(() => { + dispatch({ type: 'RESET' }); + }, [dispatch]); + + return { + store: state, + updateStore, + resetStore, + }; +}; + +const Context = createContext({} as ContextValues); + +export const useConfirmationContext = () => { + return useContext(Context); +}; + +const ConfirmationProvider = (props: ContextProps) => { + const dispatch = useAppDispatch(); + const { updateStore, store, resetStore } = useConfirmationStore( + {} as ConfirmationState, + ); + + const onDismiss = useCallback(() => { + setTimeout(() => { + resetStore(); + }, 5_00); + props.onDismiss(); + if (store.stapStatus === SwapStatus.SUCCESS) { + dispatch(updateUserBalance()); + } + }, [props, resetStore, store.stapStatus, dispatch]); + + return ( + + {props.children} + + ); +}; +interface ContextProps extends SharedProps { + children: React.ReactNode; +} + +export const ConfirmationModal = (props: ConfirmationModalProps) => { + return ( + + + + ); +}; + +const Content = ({ + mainContent, + errorContent, + successContent, +}: { + mainContent: React.ReactNode; + errorContent: React.ReactNode; + successContent: React.ReactNode; +}) => { + const { + isOpen, + onDismiss, + inAmount, + outAmount, + inCurrency, + outCurrency, + state: { swapStatus }, + } = useConfirmationContext(); + const getLogo = useGetLogoCallback(); + + const inToken = useMemo(() => { + return { + symbol: inCurrency?.symbol, + logo: getLogo(inCurrency), + }; + }, [inCurrency, getLogo]); + + const outToken = useMemo(() => { + return { + symbol: outCurrency?.symbol, + logo: getLogo(outCurrency), + }; + }, [outCurrency, getLogo]); + + return ( + + Modal Back + + + ); +}; + +function ConfirmationContainer({ + title, + children, + className = '', +}: { + title?: string; + children: ReactNode; + className?: string; +}) { + const { onDismiss } = useConfirmationContext(); + return ( + + +
{title}
+ +
+ + {children} + +
+ ); +} + +export const Error = () => { + const { + onDismiss, + inAmount, + state: { shouldUnwrap, error }, + } = useConfirmationContext(); + const { t } = useTranslation(); + const { chainId } = useActiveWeb3React(); + const nativeSymbol = ETHER[chainId].symbol; + + const { execute, wrapType } = useWrapCallback( + WETH[chainId], + ETHER[chainId], + inAmount, + ); + const [success, setSuccess] = useState(false); + const isLoading = wrapType === WrapType.UNWRAPPING; + const unwrap = useCallback(async () => { + try { + await execute?.(); + setSuccess(true); + } catch (error) { + console.error(error); + } + }, [execute]); + + if (success) { + return ( + + {t('successfullyUnwrappedMATIC', { + symbol: `${formatNumber(inAmount, 3)} ${nativeSymbol}`, + })} +

+ } + /> + ); + } + + if (isLoading) { + return ( + + {t('unwrappingMATIC', { symbol: nativeSymbol })}

} + /> +
+ ); + } + + return ( + + + Transaction Failed + {error &&

Transaction Failed

} +
+ {shouldUnwrap ? ( + + + + + ) : ( + <> + + + )} +
+ ); +}; + +const SwapButton = ({ + text, + onSubmit, +}: { + text?: string; + onSubmit: () => void; +}) => { + return ( + + + + + + ); +}; + +export const Main = ({ + parseSteps, + swapDetails, + SwapButton, + inUsd, + outUsd, + inTitle, + outTitle, + onSubmit: _onSubmit, +}: { + parseSteps: (value?: Steps[]) => SwapStep[] | undefined; + swapDetails: ReactNode; + SwapButton: FC<{ onClick: () => void }>; + inUsd?: string; + outUsd?: string; + inTitle?: string; + outTitle?: string; + onSubmit: (value: any) => void; +}) => { + const { + state: { currentStep, steps, swapStatus }, + updateStore, + } = useConfirmationContext(); + const { t } = useTranslation(); + + const parsedSteps = useMemo(() => parseSteps(steps), [parseSteps, steps]); + + const onSubmit = useCallback(() => { + _onSubmit(updateStore); + }, [_onSubmit, updateStore]); + + return ( + + + {!swapStatus && ( + <> + {swapDetails} + + + + + + + )} + + ); +}; + +export const Success = ({ + txHash, + content, +}: { + txHash?: string; + content: ReactNode; +}) => { + const { t } = useTranslation(); + const { chainId } = useActiveWeb3React(); + const { onDismiss } = useConfirmationContext(); + + return ( + + Transaction Submitted + {content} +
+ {chainId && txHash && ( + + + + )} + +
+
+ ); +}; + +ConfirmationModal.Main = Main; +ConfirmationModal.Error = Error; +ConfirmationModal.Success = Success; diff --git a/src/components/Swap/orbs/LiquidityHub/Components.tsx b/src/components/Swap/orbs/LiquidityHub/Components.tsx new file mode 100644 index 000000000..44963a73a --- /dev/null +++ b/src/components/Swap/orbs/LiquidityHub/Components.tsx @@ -0,0 +1,292 @@ +import React from 'react'; +import { Box, Divider } from '@material-ui/core'; +import { useCallback, useMemo, useState } from 'react'; +import { useTranslation } from 'react-i18next'; +import { ReactComponent as PriceExchangeIcon } from 'assets/images/PriceExchangeIcon.svg'; +import { useUserSlippageTolerance } from 'state/user/hooks'; +import { FormattedPriceImpact } from 'components/ConfirmSwapModal'; +import SettingsModal from 'components/SettingsModal'; +import { SLIPPAGE_AUTO } from 'state/user/reducer'; +import { Quote } from '@orbs-network/liquidity-hub-sdk'; +import { useDerivedSwapInfo } from 'state/swap/hooks'; +import useUSDCPrice from 'utils/useUSDCPrice'; +import BN from 'bignumber.js'; +import { Field } from 'state/swap/actions'; +import { + Currency, + JSBI, + Percent, + TokenAmount, + Token, + CurrencyAmount, +} from '@uniswap/sdk'; +import { fromRawAmount } from '../utils'; +import { ReactComponent as SettingsIcon } from 'assets/images/icons/cog-fill.svg'; +import { InfomationHelper } from 'components/QuestionHelper'; +import { formatNumber } from 'utils'; +import { useLiquidityHubManager } from 'state/user/hooks'; +import OrbsLogo from 'assets/images/orbs-logo.svg'; +import ToggleSwitch from 'components/ToggleSwitch'; +import { _TypedDataEncoder } from 'ethers/lib/utils'; +import { useIsLiquidityHubSupported } from './hooks'; +import { LIQUIDITY_HUB_WEBSITE, ORBS_WEBSITE } from '../consts'; +import { useActiveWeb3React } from 'hooks'; + +const useParseRawAmount = (currency?: Currency, amount?: string) => { + const { chainId } = useActiveWeb3React(); + return useMemo(() => { + if (!currency || !amount) return undefined; + return currency instanceof Token + ? new TokenAmount(currency, JSBI.BigInt(amount)) + : CurrencyAmount.ether(JSBI.BigInt(amount), chainId); + }, [chainId, amount, currency]); +}; + +export const LiquidityHubSettings = () => { + const [ + liquidityHubDisabled, + toggleLiquidityHubDisabled, + ] = useLiquidityHubManager(); + const { t } = useTranslation(); + + const isSupported = useIsLiquidityHubSupported(); + if (!isSupported) return null; + + return ( + <> + + +

{t('disableLiquidityHub')}

+

+ + + {t('liquidityHub')} + + , {t('poweredBy').toLowerCase()}{' '} + + Orbs + + , {t('aboutLiquidityHub')}{' '} + + {t('forMoreInfo')} + +

+
+ +
+ + + ); +}; + +const SwapPrice = ({ quote }: { quote: Quote | null }) => { + const { t } = useTranslation(); + const { parsedAmount, currencies } = useDerivedSwapInfo(); + const inCurrency = currencies.INPUT; + const outCurrency = currencies.OUTPUT; + const parsedOutAmount = useParseRawAmount(outCurrency, quote?.outAmount); + + const [inverted, setInverted] = useState(false); + const price = useMemo(() => { + if (!parsedOutAmount || !parsedAmount) return ''; + + const priceFor1Token = + Number(parsedOutAmount.toExact()) / Number(parsedAmount?.toExact()); + const price = inverted ? 1 / priceFor1Token : priceFor1Token; + + return price; + }, [inverted, parsedAmount?.toExact(), parsedOutAmount?.toExact()]); + + const toggleInverted = useCallback(() => { + setInverted((prev) => !prev); + }, []); + + return ( + + + + 1 {inverted ? outCurrency?.symbol : inCurrency?.symbol} ={' '} + {formatNumber(price, 5)}{' '} + {inverted ? inCurrency?.symbol : outCurrency?.symbol}{' '} + + + + + ); +}; + +export const LiquidityHubSwapDetails = ({ + quote, + allowedSlippage, +}: { + quote?: Quote | null; + allowedSlippage: number; +}) => { + if (!quote) return null; + + return ( + <> + + + + + + + + ); +}; + +const usePriceImpact = (quote: Quote, allowedSlippage: number) => { + const { currencies, parsedAmount } = useDerivedSwapInfo(); + const inAmount = parsedAmount?.toExact() ?? '0'; + const inCurrency = currencies.INPUT; + const outCurrency = currencies.OUTPUT; + const parsedOutAmount = useParseRawAmount( + outCurrency, + quote?.outAmount, + )?.raw.toString(); + const outAmount = useMemo(() => { + if (!parsedOutAmount || !outCurrency || !quote.gasAmountOut) return '0'; + const result = BN(parsedOutAmount) + .plus(quote.gasAmountOut) + .toString(); + return fromRawAmount(outCurrency, result)?.toExact() || '0'; + }, [parsedOutAmount, outCurrency, quote.gasAmountOut]); + + const srcUSD = + Number(useUSDCPrice(inCurrency)?.toSignificant() ?? 0) * Number(inAmount); + const dstUSD = + Number(useUSDCPrice(outCurrency)?.toSignificant() ?? 0) * Number(outAmount); + + return useMemo(() => { + if (!srcUSD || !dstUSD || !inAmount || !outAmount) return new Percent('0'); + const _srcUSD = JSBI.BigInt( + BN(srcUSD) + .multipliedBy(10 ** 10) + .toFixed(0), + ); + const _dstUSD = JSBI.BigInt( + BN(dstUSD) + .multipliedBy(10 ** 10) + .toFixed(0), + ); + const priceChange = JSBI.subtract(_srcUSD, _dstUSD); + return new Percent(priceChange, _srcUSD); + }, [srcUSD, dstUSD, inAmount, outAmount]); +}; + +const PriceImpact = ({ + quote, + allowedSlippage, +}: { + quote: Quote; + allowedSlippage: number; +}) => { + const { t } = useTranslation(); + const priceImpact = usePriceImpact(quote, allowedSlippage); + return ( + + + + {t('priceimpact')} + + + + ); +}; + +const Slippage = () => { + const [open, setOpen] = useState(false); + const { t } = useTranslation(); + const [userSlippage] = useUserSlippageTolerance(); + + return ( + <> + + + + {t('slippage')} + + setOpen(true)} className='swapSlippage'> + {userSlippage === SLIPPAGE_AUTO ? 0.5 : userSlippage}% + + + + + {open && setOpen(false)} />} + + ); +}; + +const NetworkFee = ({ quote }: { quote: Quote }) => { + const { currencies } = useDerivedSwapInfo(); + const outCurrency = currencies.OUTPUT; + const fee = useParseRawAmount(outCurrency, quote?.gasAmountOut)?.toExact(); + const usd = + Number(useUSDCPrice(outCurrency)?.toSignificant() ?? 0) * Number(fee || 0); + + const { t } = useTranslation(); + return ( + + + + {t('Network fee')} + + + {usd ? ${usd.toLocaleString('us')} : -} + + + ); +}; + +const MinReceived = ({ quote }: { quote: Quote }) => { + const { currencies } = useDerivedSwapInfo(); + const outCurrency = currencies[Field.OUTPUT]; + const parsedMinAmountOut = useParseRawAmount( + outCurrency, + quote?.minAmountOut, + ); + + const { t } = useTranslation(); + return ( + + + + {t('minReceived')} + + + + {Number(parsedMinAmountOut?.toExact()).toLocaleString('us')}{' '} + {outCurrency?.symbol} + + + + ); +}; diff --git a/src/components/Swap/orbs/LiquidityHub/LiquidityHubSwapConfirmation.tsx b/src/components/Swap/orbs/LiquidityHub/LiquidityHubSwapConfirmation.tsx new file mode 100644 index 000000000..3eb053346 --- /dev/null +++ b/src/components/Swap/orbs/LiquidityHub/LiquidityHubSwapConfirmation.tsx @@ -0,0 +1,603 @@ +import OrbsLogo from 'assets/images/orbs-logo.svg'; +import { useTranslation } from 'react-i18next'; +import { Box, Button } from '@material-ui/core'; +import { formatCurrencyAmount } from 'utils/v3/formatCurrencyAmount'; +import CheckCircleIcon from '@material-ui/icons/CheckCircle'; +import SwapVerticalCircleIcon from '@material-ui/icons/SwapVerticalCircle'; +import { useGetLogoCallback } from '../hooks'; +import { useMutation } from '@tanstack/react-query'; +import { useCallback } from 'react'; +import { Currency, Token, WETH } from '@uniswap/sdk'; +import { useActiveWeb3React } from 'hooks'; +import { + fromRawAmount, + getAmountMinusSlippage, + isRejectedError, + isTimeoutError, + promiseWithTimeout, +} from '../utils'; +import { OptimalRate, TransactionParams } from '@paraswap/sdk'; +import { useParaswap } from 'hooks/useParaswap'; +import { wrappedCurrency } from 'utils/wrappedCurrency'; +import { useIsNativeCurrencyCallback, useApproval } from '../hooks'; +import { + ORBS_WEBSITE, + SIGNATURE_TIMEOUT, + Steps, + SWAP_COUNTDOWN, +} from '../consts'; +import { LIQUIDITY_HUB_WEBSITE, SwapStatus } from '@orbs-network/swap-ui'; +import { _TypedDataEncoder } from 'ethers/lib/utils'; +import { Quote, permit2Address } from '@orbs-network/liquidity-hub-sdk'; +import { + ConfirmationModal, + useConfirmationContext, + ConfirmationState, +} from '../ConfirmationModal'; +import useUSDCPrice from 'utils/useUSDCPrice'; +import React, { useState } from 'react'; +import { createContext } from 'react'; +import { useLiquidityHubSDK } from './hooks'; +import useWrapCallback from 'hooks/useWrapCallback'; +import { getSigner } from 'utils'; + +export interface LiquidityHubConfirmationProps { + inCurrency?: Currency; + outCurrency?: Currency; + isOpen: boolean; + onDismiss: () => void; + refetchLatestQuote: () => Promise; + quote?: Quote | null; + onSwapFailed: () => void; + onSwapSuccess: () => void; + optimalRate?: OptimalRate; + allowedSlippage?: number; + onLiquidityHubSwapInProgress: (value: boolean) => void; +} +export interface LiquidityHubConfirmationState { + acceptedQuote?: Quote | null; + signature?: string; +} + +// types +interface ContextValues extends LiquidityHubConfirmationProps { + quote?: Quote | null; + signature?: string; + onSignature: (signature: string) => void; + onAcceptQuote: (quote: Quote) => void; +} +const Context = createContext({} as ContextValues); + +interface ContextProps extends LiquidityHubConfirmationProps { + children: React.ReactNode; +} + +// context + +const ContextProvider = ({ children, ...props }: ContextProps) => { + const [acceptedQuote, setAcceptedQuote] = useState( + undefined, + ); + const [signature, setSignature] = useState(undefined); + const quote = acceptedQuote || props.quote; + const onDismiss = useCallback(() => { + setSignature(undefined); + setAcceptedQuote(undefined); + props.onDismiss(); + }, [props, setSignature, setAcceptedQuote]); + + const onSignature = useCallback( + (signature: string) => { + setSignature(signature); + }, + [setSignature], + ); + + const onAcceptQuote = useCallback( + (quote: Quote) => { + setAcceptedQuote(quote); + }, + [setAcceptedQuote], + ); + + return ( + + {children} + + ); +}; + +const useLiquidityHubConfirmationContext = () => React.useContext(Context); + +const useLiquidityHubApproval = () => { + const { inCurrency, quote } = useLiquidityHubConfirmationContext(); + const inAmount = fromRawAmount(inCurrency, quote?.inAmount); + return useApproval( + permit2Address, + inCurrency, + inAmount?.numerator.toString(), + ); +}; + +const useAmounts = () => { + const { + quote, + inCurrency, + outCurrency, + } = useLiquidityHubConfirmationContext(); + const inAmount = fromRawAmount(inCurrency, quote?.inAmount); + const outAmount = fromRawAmount(outCurrency, quote?.outAmount); + const inUsd = + Number(useUSDCPrice(inCurrency)?.toSignificant() ?? 0) * + Number(inAmount?.toExact() || 0); + const outUsd = + Number(useUSDCPrice(outCurrency)?.toSignificant() ?? 0) * + Number(outAmount?.toExact() || 0); + + return { + inAmount, + outAmount, + inUsd, + outUsd, + }; +}; + +const useParseSteps = () => { + const { inCurrency, signature } = useLiquidityHubConfirmationContext(); + const getLogo = useGetLogoCallback(); + + return useCallback( + (steps?: Steps[]) => { + if (!steps) return []; + return steps.map((step) => { + if (step === Steps.WRAP) { + return { + title: `Wrap ${inCurrency?.symbol}`, + icon: , + id: Steps.WRAP, + }; + } + if (step === Steps.APPROVE) { + return { + title: `Approve ${inCurrency?.symbol} spending`, + icon: , + id: Steps.APPROVE, + }; + } + + return { + id: Steps.SWAP, + title: !signature ? 'Confirm swap' : 'Swap pending...', + icon: , + timeout: !signature ? SIGNATURE_TIMEOUT : SWAP_COUNTDOWN, + }; + }); + }, + [inCurrency, signature, getLogo], + ); +}; + +// ui components +const SuccessContent = () => { + const { + state: { txHash }, + } = useConfirmationContext(); + const { t } = useTranslation(); + return ( + + {t('swapSuccess')} + {t(' using')}
+ + {t('liquidityHub')} + {' '} + {t('by')}{' '} + + {t('orbs')} + + +
+ } + /> + ); +}; + +const SwapDetails = () => { + const { t } = useTranslation(); + const { quote, outCurrency } = useLiquidityHubConfirmationContext(); + const minAmountOut = fromRawAmount(outCurrency, quote?.minAmountOut); + + return ( + +

+ {t('outputEstimated1', { + amount: formatCurrencyAmount(minAmountOut, 4), + symbol: minAmountOut?.currency?.symbol, + })} +

+
+ ); +}; + +const SwapButton = ({ onClick }: { onClick: () => void }) => { + const { t } = useTranslation(); + const { isPending } = useLiquidityHubApproval(); + + return ( + + ); +}; + +const MainContent = () => { + const parseSteps = useParseSteps(); + const { mutate: onSubmit } = useLiquidityHubSwapCallback(); + + const { inUsd, outUsd } = useAmounts(); + return ( + } + inUsd={inUsd.toLocaleString('en')} + outUsd={outUsd.toLocaleString('en')} + onSubmit={onSubmit} + SwapButton={SwapButton} + /> + ); +}; + +function Content() { + const { + inCurrency, + outCurrency, + isOpen, + onDismiss, + } = useLiquidityHubConfirmationContext(); + const { inAmount, outAmount } = useAmounts(); + + return ( + } + mainContent={} + errorContent={} + /> + ); +} + +export const LiquidityHubSwapConfirmation = ( + props: LiquidityHubConfirmationProps, +) => { + return ( + + + + ); +}; + +const useGetStepsCallback = () => { + const { inCurrency } = useLiquidityHubConfirmationContext(); + const isNativeIn = useIsNativeCurrencyCallback(); + const { isApproved } = useLiquidityHubApproval(); + + return useCallback(() => { + const steps: Steps[] = []; + + if (isNativeIn(inCurrency)) { + steps.push(Steps.WRAP); + } + if (!isApproved) { + steps.push(Steps.APPROVE); + } + steps.push(Steps.SWAP); + return steps; + }, [inCurrency, isApproved, isNativeIn]); +}; + +const useWrapFlowCallback = () => { + const { inCurrency, quote } = useLiquidityHubConfirmationContext(); + const inAmount = fromRawAmount(inCurrency, quote?.inAmount); + const { chainId } = useActiveWeb3React(); + const liquidityHub = useLiquidityHubSDK(); + const { execute: wrap } = useWrapCallback( + inCurrency, + WETH[chainId], + inAmount?.toExact(), + ); + + return useCallback(async () => { + try { + liquidityHub.analytics.onWrapRequest(); + await wrap?.(); + liquidityHub.analytics.onWrapSuccess(); + } catch (error) { + liquidityHub.analytics.onWrapFailure(error); + throw error; + } + }, [wrap, liquidityHub]); +}; + +const useApproveCallback = () => { + const { approve } = useLiquidityHubApproval(); + const liquidityHub = useLiquidityHubSDK(); + + return useCallback(async () => { + try { + liquidityHub.analytics.onApprovalRequest(); + await approve(); + liquidityHub.analytics.onApprovalSuccess(); + } catch (error) { + liquidityHub.analytics.onApprovalFailed(error); + throw error; + } + }, [approve, liquidityHub]); +}; + +const useSwapCallback = () => { + const liquidityHub = useLiquidityHubSDK(); + return useCallback( + async ({ + acceptedQuote, + signature, + paraswapTxParams, + }: { + acceptedQuote: Quote; + signature: string; + paraswapTxParams?: TransactionParams; + }) => { + const txHash = await liquidityHub.swap(acceptedQuote, signature, { + data: paraswapTxParams?.data || '', + to: paraswapTxParams?.to, + }); + return txHash; + }, + [liquidityHub], + ); +}; + +// submit swap hook +const useLiquidityHubSwapCallback = () => { + const { chainId, account, library } = useActiveWeb3React(); + const { + onSwapSuccess, + onSwapFailed, + onSignature, + onAcceptQuote, + optimalRate, + allowedSlippage, + inCurrency, + outCurrency, + refetchLatestQuote, + onLiquidityHubSwapInProgress, + } = useLiquidityHubConfirmationContext(); + const signCallback = useSignEIP712Callback(); + const getParaswapTxParams = useParaswapTxParamsCallback(); + const getSteps = useGetStepsCallback(); + const swapCallback = useSwapCallback(); + const wrapCallback = useWrapFlowCallback(); + const approvalCallback = useApproveCallback(); + + return useMutation( + async (updateStore: (value: Partial) => void) => { + let shouldUnwrap = false; + + try { + const inToken = wrappedCurrency(inCurrency, chainId); + const outToken = wrappedCurrency(outCurrency, chainId); + onLiquidityHubSwapInProgress(true); + if (!account) { + throw new Error('Account is not defined'); + } + if (!library) { + throw new Error('Library is not defined'); + } + if (!inToken) { + throw new Error('In token is not defined'); + } + if (!outToken) { + throw new Error('Out token is not defined'); + } + const steps = getSteps(); + updateStore({ + swapStatus: SwapStatus.LOADING, + steps, + }); + if (steps.includes(Steps.WRAP)) { + updateStore({ + currentStep: Steps.WRAP, + }); + await wrapCallback(); + shouldUnwrap = true; + } + if (steps.includes(Steps.APPROVE)) { + updateStore({ currentStep: Steps.APPROVE }); + await approvalCallback(); + // refetch approval + } + + const acceptedQuote = await refetchLatestQuote(); + onAcceptQuote(acceptedQuote); + updateStore({ currentStep: Steps.SWAP }); + const signature = await promiseWithTimeout( + signCallback(acceptedQuote.permitData), + SIGNATURE_TIMEOUT, + ); + onSignature(signature); + let paraswapTxParams: TransactionParams | undefined; + if (optimalRate && allowedSlippage) { + try { + paraswapTxParams = await getParaswapTxParams({ + inToken, + optimalRate, + allowedSlippage, + chainId, + account, + }); + } catch (error) {} + } + const txHash = await swapCallback({ + acceptedQuote, + signature, + paraswapTxParams, + }); + + const transaction = await library.getTransaction(txHash); + const receipt = await transaction.wait(); + onSwapSuccess(); + updateStore({ swapStatus: SwapStatus.SUCCESS }); + return receipt; + } catch (error) { + const isRejectedOrTimeout = + isRejectedError(error) || isTimeoutError(error); + + if (!shouldUnwrap && isRejectedOrTimeout) { + updateStore({ swapStatus: undefined }); + } else { + updateStore({ + shouldUnwrap, + swapStatus: SwapStatus.FAILED, + error: (error as any).message, + }); + onSwapFailed(); + } + } finally { + onLiquidityHubSwapInProgress(false); + } + }, + ); +}; + +const useParaswapTxParamsCallback = () => { + const paraswap = useParaswap(); + + return useCallback( + (args: { + inToken: Token; + optimalRate?: OptimalRate; + allowedSlippage?: number; + account: string; + chainId: number; + }) => { + if (!args.optimalRate) { + throw new Error('Optimal rate is not defined'); + } + return paraswap.buildTx({ + srcToken: args.inToken?.address, + destToken: args.optimalRate.destToken, + srcAmount: args.optimalRate.srcAmount, + destAmount: + getAmountMinusSlippage( + args.allowedSlippage ?? 0, + args.optimalRate.destAmount, + ) || '', + priceRoute: args.optimalRate, + userAddress: args.account, + receiver: args.account, + partner: 'quickswapv3', + }); + }, + [paraswap], + ); +}; + +const useSignEIP712Callback = () => { + const { library, account } = useActiveWeb3React(); + const liquidityHub = useLiquidityHubSDK(); + + return useCallback( + async (permitData: any) => { + liquidityHub.analytics.onSignatureRequest(); + if (!library || !account) { + throw new Error('No library or account'); + } + try { + const signature = await signEIP712( + account, + library.provider, + permitData, + ); + if (!signature) { + throw new Error('No signature'); + } + liquidityHub.analytics.onSignatureSuccess(signature); + return signature; + } catch (error) { + liquidityHub.analytics.onSignatureFailed((error as Error).message); + throw error; + } + }, + [account, library, liquidityHub], + ); +}; + +async function signEIP712(signer: string, provider: any, permitData: any) { + const populated = await _TypedDataEncoder.resolveNames( + permitData.domain, + permitData.types, + permitData.values, + async (name: string) => name, + ); + + const message = JSON.stringify( + _TypedDataEncoder.getPayload( + populated.domain, + permitData.types, + populated.value, + ), + ); + + try { + return await signAsync(signer, provider, 'eth_signTypedData_v4', message); + } catch (e) { + if (isRejectedError(e)) { + throw e; + } + try { + return await signAsync(signer, provider, 'eth_signTypedData', message); + } catch (error) { + if ( + typeof error.message === 'string' && + (error.message.match(/not (found|implemented)/i) || + error.message.match(/TrustWalletConnect.WCError error 1/) || + error.message.match(/Missing or invalid/)) + ) { + throw new Error('Wallet does not support EIP-712'); + } else { + throw error; + } + } + } +} + +async function signAsync( + signer: string, + provider: any, + method: 'eth_signTypedData_v4' | 'eth_signTypedData', + message: string, +) { + try { + return await provider?.request({ + method, + params: [signer, message], + }); + } catch (error) { + throw error; + } +} diff --git a/src/components/Swap/orbs/LiquidityHub/hooks.ts b/src/components/Swap/orbs/LiquidityHub/hooks.ts new file mode 100644 index 000000000..8b5d34e5f --- /dev/null +++ b/src/components/Swap/orbs/LiquidityHub/hooks.ts @@ -0,0 +1,189 @@ +import { ChainId, Currency } from '@uniswap/sdk'; +import { useActiveWeb3React } from 'hooks'; +import { useCallback, useMemo } from 'react'; +import { getConfig } from 'config'; +import { wrappedCurrency } from 'utils/wrappedCurrency'; +import { + constructSDK, + Quote, + QUOTE_ERRORS, + zeroAddress, +} from '@orbs-network/liquidity-hub-sdk'; +import { OptimalRate, SwapSide } from '@paraswap/sdk'; +import { useLiquidityHubManager } from 'state/user/hooks'; +import { useIsNativeCurrencyCallback } from '../hooks'; +import { getAmountMinusSlippage } from '../utils'; +import { _TypedDataEncoder } from 'ethers/lib/utils'; +import { WrapType } from 'hooks/useWrapCallback'; +import { useQuery, useQueryClient } from '@tanstack/react-query'; +import BN from 'bignumber.js'; + +export const useLiquidityHubSDK = () => { + const { chainId } = useActiveWeb3React(); + const chainIdToUse = chainId || ChainId.MATIC; + + return useMemo( + () => constructSDK({ chainId: chainIdToUse, partner: 'quickswap' }), + [chainIdToUse], + ); +}; + +export const useIsLiquidityHubTrade = ( + swapSide: SwapSide, + disabled: boolean, + allowedSlippage: number, + quote?: Quote | null, + optimalRate?: OptimalRate, + showWrap?: boolean, + isLiquidityHubOnly?: boolean, +) => { + const [liquidityHubDisabled] = useLiquidityHubManager(); + const isSupported = useIsLiquidityHubSupported(); + + return useMemo(() => { + if (showWrap) return false; + if (isLiquidityHubOnly) return true; + + if ( + swapSide === SwapSide.BUY || + liquidityHubDisabled || + disabled || + !isSupported + ) { + return false; + } + + const dexMinAmountOut = getAmountMinusSlippage( + allowedSlippage, + optimalRate?.destAmount, + ); + return BN(quote?.outAmount || 0).gt(dexMinAmountOut || 0); + }, [ + allowedSlippage, + quote, + optimalRate, + isSupported, + swapSide, + disabled, + liquidityHubDisabled, + isLiquidityHubOnly, + showWrap, + ]); +}; + +export const useIsLiquidityHubSupported = () => { + const { chainId } = useActiveWeb3React(); + const config = getConfig(chainId); + return !!config['swap']['liquidityHub']; +}; + +const isLowSrcAmountError = (error: any) => { + return (error as Error)?.message === QUOTE_ERRORS.ldv; +}; + +export const useLiquidityHubQuote = ({ + allowedSlippage, + inAmount, + inCurrency, + outCurrency, + dexOutAmount, + disabled, + wrapType, +}: { + allowedSlippage?: number; + inAmount?: string; + inCurrency?: Currency; + outCurrency?: Currency; + dexOutAmount?: string; + disabled?: boolean; + wrapType?: WrapType; +}) => { + const { account, chainId } = useActiveWeb3React(); + const isNativeCurrency = useIsNativeCurrencyCallback(); + + const fromToken = wrappedCurrency(inCurrency, chainId)?.address; + const toToken = useMemo(() => { + if (!outCurrency) return; + return isNativeCurrency(outCurrency) + ? zeroAddress + : wrappedCurrency(outCurrency, chainId)?.address; + }, [outCurrency, isNativeCurrency, chainId]); + const queryClient = useQueryClient(); + const isSupported = useIsLiquidityHubSupported(); + const liquidityHub = useLiquidityHubSDK(); + + const dexMinAmountOut = useMemo(() => { + return getAmountMinusSlippage(allowedSlippage || 0, dexOutAmount); + }, [dexOutAmount, allowedSlippage]); + + const queryKey = [ + 'liquidity-hub-quote', + fromToken, + toToken, + inAmount, + allowedSlippage, + chainId, + ]; + + const fecthQuoteCallback = useCallback( + (signal?: AbortSignal) => { + return liquidityHub.getQuote({ + fromToken: fromToken!, + toToken: toToken!, + inAmount: inAmount!, + dexMinAmountOut, + account, + slippage: allowedSlippage! / 100, + signal, + }); + }, + [ + liquidityHub, + fromToken, + toToken, + inAmount, + dexMinAmountOut, + account, + allowedSlippage, + queryKey, + ], + ); + + const query = useQuery({ + queryKey, + queryFn: async ({ signal }) => { + return fecthQuoteCallback(signal); + }, + retry(failureCount, error) { + if (isLowSrcAmountError(error)) return false; + if (failureCount > 3) return false; + return true; + }, + refetchInterval: (data, query) => { + if (isLowSrcAmountError(query.state.fetchFailureReason)) return 0; + return 10_000; + }, + staleTime: Infinity, + enabled: + !!account && + !!inAmount && + !!fromToken && + !!toToken && + wrapType !== WrapType.WRAP && + wrapType !== WrapType.UNWRAP && + !disabled && + allowedSlippage !== undefined && + isSupported, + }); + + return useMemo(() => { + return { + ...query, + ensureQueryData: () => + queryClient.ensureQueryData({ + queryKey, + queryFn: ({ signal }) => fecthQuoteCallback(signal), + }), + }; + }, [query, queryClient, fecthQuoteCallback, queryKey]); +}; diff --git a/src/components/Swap/orbs/Twap/Components/Components.tsx b/src/components/Swap/orbs/Twap/Components/Components.tsx new file mode 100644 index 000000000..7a5f6fc74 --- /dev/null +++ b/src/components/Swap/orbs/Twap/Components/Components.tsx @@ -0,0 +1,623 @@ +import React, { useCallback, useMemo, useState } from 'react'; +import { Box, Menu, MenuItem } from '@material-ui/core'; +import { NumericalInput, QuestionHelper } from 'components'; +import { ReactNode } from 'react'; +import { useTranslation } from 'react-i18next'; +import { useTwapSwapActionHandlers } from 'state/swap/twap/hooks'; +import { fromRawAmount } from '../../utils'; +import { TimeDuration, TimeUnit } from '@orbs-network/twap-sdk'; +import ReportProblemIcon from '@material-ui/icons/ReportProblem'; +import { TWAP_FAQ } from '../../consts'; +import useUSDCPrice from 'utils/useUSDCPrice'; +import { useTwapContext } from '../TwapContext'; +import { Field } from '../../../../../state/swap/actions'; +import { KeyboardArrowDown } from '@material-ui/icons'; +import { useTwapState } from 'state/swap/twap/hooks'; +import { Currency } from '@uniswap/sdk'; +import CurrencySelect from 'components/CurrencySelect'; +import { useActiveWeb3React, useIsProMode } from 'hooks'; +import useSwapRedirects from 'hooks/useSwapRedirect'; +import CloseIcon from '@material-ui/icons/Close'; +import { tryParseAmount } from 'state/swap/hooks'; +import CurrencyLogo from 'components/CurrencyLogo'; +import SwapVertIcon from '@material-ui/icons/SwapVert'; +import { Skeleton } from '@material-ui/lab'; +import { + useDerivedTwapSwapData, + useOptimalRate, + useTradePrice, +} from '../hooks'; + +export const Card = ({ + children, + className = '', + onClick, + styles, +}: { + children: React.ReactNode; + className?: string; + onClick?: () => void; + styles?: React.CSSProperties; +}) => { + return ( + + {children} + + ); +}; + +const CardTitle = ({ + title, + tooltip, +}: { + title: ReactNode; + tooltip?: string; +}) => { + return ( + +

{title}

+ {tooltip && } +
+ ); +}; + +const CardInput = ({ + children, + className = '', +}: { + children: ReactNode; + className?: string; +}) => { + return ( + {children} + ); +}; + +const useInvertedAmount = (amount?: string) => { + const { chainId } = useActiveWeb3React(); + const { currencies } = useTwapContext(); + return useMemo(() => { + if (!amount || !currencies.OUTPUT) return; + const result = ( + 10 ** currencies.OUTPUT.decimals / + Number(amount) + ).toString(); + return tryParseAmount(chainId, result, currencies.OUTPUT); + }, [chainId, currencies.OUTPUT, amount]); +}; + +export const PriceSwitch = () => { + const { onMarketOrder } = useTwapSwapActionHandlers(); + const { isMarketOrder, isLimitPanel } = useTwapContext(); + const { t } = useTranslation(); + + if (isLimitPanel) return null; + return ( + + + + + ); +}; + +export const LimitInputPanel = () => { + const { redirectWithCurrency } = useSwapRedirects(); + const { onInvertLimitPrice } = useTwapSwapActionHandlers(); + const { currencies, isMarketOrder } = useTwapContext(); + const { isTradePriceInverted } = useTwapState(); + const handleCurrencySelect = (currency: Currency) => { + redirectWithCurrency(currency, isTradePriceInverted ? true : false); + }; + + const inCurrency = isTradePriceInverted + ? currencies.OUTPUT + : currencies.INPUT; + const outCurrency = isTradePriceInverted + ? currencies.INPUT + : currencies.OUTPUT; + + if (isMarketOrder) return null; + + return ( + + + + + When 1{' '} + {inCurrency ? ( + + ) : ( + '-' + )}{' '} + {inCurrency?.symbol} is worth + + + + + + + + + + + + + + ); +}; + +const LimitPriceInput = () => { + const isProMode = useIsProMode(); + const { currencies } = useTwapContext(); + const { data, isLoading } = useOptimalRate(); + const state = useTwapState(); + const { onTradePriceInput } = useTwapSwapActionHandlers(); + const marketPrice = data?.rate?.destAmount; + const invertedMarketPrice = useInvertedAmount(marketPrice)?.toExact(); + + const value = useMemo(() => { + if (state.tradePrice !== undefined) { + return state.tradePrice; + } + let result = fromRawAmount(currencies.OUTPUT, marketPrice)?.toExact(); + if (state.isTradePriceInverted) { + result = invertedMarketPrice; + } + return parseFloat(Number(result).toFixed(6)); + }, [ + state.tradePrice, + marketPrice, + currencies.OUTPUT, + state.isTradePriceInverted, + invertedMarketPrice, + ]); + + return ( + + {isLoading && currencies.INPUT && currencies.OUTPUT ? ( + + ) : ( + { + onTradePriceInput(val); + }} + /> + )} + + ); +}; + +const PercentButtons = () => { + const { currencies } = useTwapContext(); + const { isTradePriceInverted } = useTwapState(); + const { onTradePriceInput } = useTwapSwapActionHandlers(); + const marketPrice = useOptimalRate().data?.rate?.destAmount; + const invertedAmount = useInvertedAmount(marketPrice)?.toExact(); + + const onPercentClick = useCallback( + (percentage: number) => { + if (!marketPrice || !currencies.OUTPUT) return; + + const price = isTradePriceInverted + ? invertedAmount + : fromRawAmount(currencies.OUTPUT, marketPrice)?.toExact(); + if (!price) return; + const adjustment = percentage / 100; + + const newLimitPrice = parseFloat( + (Number(price) * (1 + adjustment)).toFixed(5), + ); + onTradePriceInput(newLimitPrice.toString() || ''); + }, + [ + marketPrice, + currencies, + onTradePriceInput, + isTradePriceInverted, + invertedAmount, + ], + ); + + const percent = useMemo(() => { + return [1, 5, 10].map((it) => it * (isTradePriceInverted ? -1 : 1)); + }, [isTradePriceInverted]); + + return ( + + + {percent.map((percent) => { + return ( + onPercentClick(percent)}> + {isTradePriceInverted ? '' : '+'} + {percent}% + + ); + })} + + ); +}; + +const ResetButton = () => { + const { onTradePriceInput } = useTwapSwapActionHandlers(); + const _tradePrice = useTradePrice(); + const { isTradePriceInverted } = useTwapState(); + const destAmount = useOptimalRate().data?.rate?.destAmount; + + const priceDiff = useMemo(() => { + if (!destAmount || !_tradePrice) return 0; + const marketPrice = Number(destAmount); + const tradePrice = Number(_tradePrice); + + if (marketPrice === 0) return 0; + const diff = marketPrice - tradePrice; + let percentageDiff = (diff * 100) / marketPrice; + if (!isTradePriceInverted) { + percentageDiff = -percentageDiff; + } + return parseFloat(percentageDiff.toFixed(2)); + }, [_tradePrice, destAmount, isTradePriceInverted]); + const onClick = () => { + onTradePriceInput(undefined); + }; + + if (priceDiff !== 0) { + return ( + + + {Number(priceDiff) > 0 ? '+' : ''} + {priceDiff || 0}% + + {priceDiff !== 0 && ( + + + + )} + + ); + } + + return ( + onTradePriceInput(undefined)}> + 0% + + ); +}; + +const Chunks = () => { + const { t } = useTranslation(); + const { onChunksInput } = useTwapSwapActionHandlers(); + const { chunks } = useDerivedTwapSwapData(); + + return ( + + + + { + onChunksInput(Number(val)); + }} + /> +

{t('orders')}

+
+
+ ); +}; + +const ChunkSize = () => { + const { currencies } = useTwapContext(); + const inputCurrency = currencies[Field.INPUT]; + const { srcChunkAmount, chunks } = useDerivedTwapSwapData(); + const oneSrcTokenUsd = Number( + useUSDCPrice(inputCurrency)?.toSignificant() ?? 0, + ); + + const srcChukAmountUsd = useMemo(() => { + const srcChunkCurrencyAmount = fromRawAmount(inputCurrency, srcChunkAmount); + return oneSrcTokenUsd * Number(srcChunkCurrencyAmount?.toExact() ?? 0); + }, [oneSrcTokenUsd, srcChunkAmount, inputCurrency]); + + if (chunks === 1) return null; + + const amount = fromRawAmount(inputCurrency, srcChunkAmount); + + return ( + + {Number(amount?.toExact() || '0').toLocaleString('us')}{' '} + {amount?.currency.symbol} per trade{' '} + {`($${Number(srcChukAmountUsd).toLocaleString('us')})`} + + ); +}; + +function DurationSelect() { + const { t } = useTranslation(); + const { onDurationInput } = useTwapSwapActionHandlers(); + const { duration } = useDerivedTwapSwapData(); + + return ( + + + + + {resolutions + .filter((it) => it.unit !== TimeUnit.Minutes) + .map((option, index) => { + const selected = + duration.unit * duration.value === option.unit * 1; + return ( + + onDurationInput({ unit: option.unit, value: 1 }) + } + > + 1 {t(option.label)} + + ); + })} + + + + ); +} + +const FillDelay = () => { + const { fillDelay } = useDerivedTwapSwapData(); + const onChange = useTwapSwapActionHandlers().onFillDelayInput; + return ( + + + + { + onChange({ ...fillDelay, value: Number(val) }); + }} + /> + + + + ); +}; + +const ResolutionSelect = ({ + duration, + onChange, +}: { + duration: TimeDuration; + onChange: (value: TimeDuration) => void; +}) => { + const { t } = useTranslation(); + const [anchorEl, setAnchorEl] = useState(null); + const open = Boolean(anchorEl); + + const onOpen = useCallback( + (event: React.MouseEvent) => { + setAnchorEl(event.currentTarget); + }, + [setAnchorEl], + ); + + const handleClose = useCallback(() => { + setAnchorEl(null); + }, [setAnchorEl]); + + const handleMenuItemClick = useCallback( + (unit: TimeUnit) => { + onChange({ ...duration, unit }); + handleClose(); + }, + [duration, onChange, handleClose], + ); + + const selected = useMemo( + () => resolutions.find((option) => option.unit === duration.unit), + [duration], + ); + + return ( + + + + {resolutions.map((option) => { + const selected = duration.unit === option.unit; + + return ( + handleMenuItemClick(option.unit)} + > + {t(option.label)} + {selected && } + + ); + })} + + + ); +}; + +export const TwapInputs = () => { + const { isLimitPanel } = useTwapContext(); + + if (isLimitPanel) { + return ( + + + + ); + } + + return ( + + + + + + + + ); +}; + +export const MarketPriceWarning = () => { + const { t } = useTranslation(); + return ; +}; + +const LimitPriceWarning = () => { + const { t } = useTranslation(); + return ; +}; + +export const TradePriceWarning = () => { + const { isMarketOrder } = useTwapContext(); + return isMarketOrder ? : ; +}; + +function PriceWarning({ message }: { message: string }) { + const { t } = useTranslation(); + + return ( + + + + +

+ {message}{' '} + + {t('learnMore')} + +

+
+
+ ); +} + +export function SelectorButton({ + selected, + onClick, + children, +}: { + selected?: boolean; + onClick?: () => void; + children: ReactNode; +}) { + return ( + + ); +} + +export const MarketPriceOutputInput = ({ + handleCurrencySelect, + title, +}: { + handleCurrencySelect: (currency: Currency) => void; + title: string; +}) => { + const { currencies } = useTwapContext(); + return ( + +

+ {title} +

+ +
+ ); +}; + +const resolutions: { unit: TimeUnit; label: string }[] = [ + { + label: 'minute', + unit: TimeUnit.Minutes, + }, + { + label: 'day', + unit: TimeUnit.Days, + }, + { + label: 'week', + unit: TimeUnit.Weeks, + }, + { + label: 'month', + unit: TimeUnit.Months, + }, +]; diff --git a/src/components/Swap/orbs/Twap/Components/OrderDetails.tsx b/src/components/Swap/orbs/Twap/Components/OrderDetails.tsx new file mode 100644 index 000000000..ec05c3d99 --- /dev/null +++ b/src/components/Swap/orbs/Twap/Components/OrderDetails.tsx @@ -0,0 +1,213 @@ +import React, { ReactNode, useMemo } from 'react'; +import { Box } from '@material-ui/core'; +import { Currency } from '@uniswap/sdk'; +import QuestionHelper from 'components/QuestionHelper'; +import { useActiveWeb3React } from 'hooks'; +import { useTranslation } from 'react-i18next'; +import { formatDateFromTimeStamp, formatNumber, getEtherscanLink } from 'utils'; +import { formatCurrencyAmount } from 'utils/v3/formatCurrencyAmount'; +import { fromRawAmount, makeElipsisAddress } from '../../utils'; +import { useFillDelayAsText } from '../hooks'; + +const ELIPSIS_PADDING = 5; + +const FillDelay = ({ + fillDelay, + totalChunks, +}: { + fillDelay?: number; + totalChunks?: number; +}) => { + const { t } = useTranslation(); + const text = useFillDelayAsText(fillDelay); + if (totalChunks === 1) return null; + + return ( + + ); +}; + +const Recipient = () => { + const { account, chainId } = useActiveWeb3React(); + const { t } = useTranslation(); + if (!account) return null; + + return ( + + {makeElipsisAddress(account, ELIPSIS_PADDING)} + + } + /> + ); +}; + +const Chunks = ({ totalChunks }: { totalChunks?: number }) => { + const { t } = useTranslation(); + if (totalChunks === 1) return null; + + return ( + + ); +}; + +const ChunkSize = ({ + srcChunk, + inCurrency, +}: { + srcChunk?: string; + inCurrency?: Currency; +}) => { + const { t } = useTranslation(); + + const amount = useMemo(() => { + return fromRawAmount(inCurrency, srcChunk); + }, [srcChunk, inCurrency]); + + return ( + + ); +}; + +const SrcAmount = ({ + srcAmount, + currency, +}: { + srcAmount?: string; + currency?: Currency; +}) => { + const { t } = useTranslation(); + const amount = fromRawAmount(currency, srcAmount); + return ( + + ); +}; + +const MinReceived = ({ + isMarketOrder, + dstMinAmount, + currency, +}: { + isMarketOrder?: boolean; + dstMinAmount?: string; + currency?: Currency; +}) => { + const { t } = useTranslation(); + const amount = fromRawAmount(currency, dstMinAmount); + if (isMarketOrder) return null; + + return ( + + ); +}; + +const Deadline = ({ deadline }: { deadline?: number }) => { + const { t } = useTranslation(); + + if (!deadline) return null; + + return ( + + ); +}; + +const Price = ({ + price, + isMarketOrder, + inCurrency, + outCurrency, + usd, +}: { + price?: string; + isMarketOrder?: boolean; + inCurrency?: Currency; + outCurrency?: Currency; + usd?: number; +}) => { + const { t } = useTranslation(); + + return ( + + 1 {inCurrency?.symbol} = {formatNumber(price, 3)}{' '} + {outCurrency?.symbol}{' '} + {usd && {`($${usd?.toLocaleString('en')})`}} + + ) + } + /> + ); +}; + +const OrderDetails = ({ children }: { children: ReactNode }) => { + return {children}; +}; + +export const TwapOrderDetailsRow = ({ + label, + value, + tooltip, +}: { + label: string; + value?: ReactNode; + tooltip?: string; +}) => { + return ( + + +

{label}

+ {tooltip && } +
+

{value || '-'}

+
+ ); +}; + +OrderDetails.Price = Price; +OrderDetails.Deadline = Deadline; +OrderDetails.SrcAmount = SrcAmount; +OrderDetails.MinReceived = MinReceived; +OrderDetails.ChunkSize = ChunkSize; +OrderDetails.Chunks = Chunks; +OrderDetails.Recipient = Recipient; +OrderDetails.FillDelay = FillDelay; +OrderDetails.DetailsRow = TwapOrderDetailsRow; + +export { OrderDetails }; diff --git a/src/components/Swap/orbs/Twap/Twap.tsx b/src/components/Swap/orbs/Twap/Twap.tsx new file mode 100644 index 000000000..346f43f40 --- /dev/null +++ b/src/components/Swap/orbs/Twap/Twap.tsx @@ -0,0 +1,669 @@ +import React, { useState, useMemo, useCallback, useEffect } from 'react'; +import { + JSBI, + Token, + currencyEquals, + ETHER, + Fraction, + ChainId, + WETH, +} from '@uniswap/sdk'; +import { Currency, CurrencyAmount, NativeCurrency } from '@uniswap/sdk-core'; +import { Box, Button } from '@material-ui/core'; +import { + useExpertModeManager, + useUserSlippageTolerance, +} from 'state/user/hooks'; +import arrowDown from 'assets/images/icons/arrow-down.png'; +import { Field } from 'state/swap/actions'; +import { useHistory } from 'react-router-dom'; +import { CurrencyInput } from 'components'; +import { useActiveWeb3React, useConnectWallet, useIsProMode } from 'hooks'; +import useWrapCallback, { WrapType } from 'hooks/useWrapCallback'; +import { + useIsSupportedNetwork, + maxAmountSpend, + basisPointsToPercent, + halfAmountSpend, +} from 'utils'; +import 'components/styles/Swap.scss'; +import { useTranslation } from 'react-i18next'; +import { SwapSide } from '@paraswap/sdk'; +import { useAllTokens, useCurrency } from 'hooks/Tokens'; +import TokenWarningModal from 'components/v3/TokenWarningModal'; +import useParsedQueryString from 'hooks/useParsedQueryString'; +import useSwapRedirects from 'hooks/useSwapRedirect'; +import { ONE } from 'v3lib/utils'; +import useNativeConvertCallback, { + ConvertType, +} from 'hooks/useNativeConvertCallback'; +import { + useDefaultsFromURLSearch, + useTwapState, + useTwapSwapActionHandlers, +} from 'state/swap/twap/hooks'; +import { TwapContextProvider, useTwapContext } from './TwapContext'; +import { TwapSwapConfirmation } from './TwapSwapConfirmation'; +import { + Card, + LimitInputPanel, + PriceSwitch, + TradePriceWarning, + TwapInputs, +} from './Components/Components'; +import { TwapOrders } from './TwapOrders/TwapOrders'; +import 'components/styles/Swap.scss'; +import 'components/styles/orbs/Twap.scss'; +import { + useDerivedTwapSwapData, + useInputError, + useInputTitle, + useOptimalRate, + useTwapApprovalCallback, +} from './hooks'; +import { PoweredByOrbs } from '@orbs-network/swap-ui'; + +const Content: React.FC<{ + currencyBgClass?: string; +}> = ({ currencyBgClass }) => { + const history = useHistory(); + const isProMode = useIsProMode(); + const isSupportedNetwork = useIsSupportedNetwork(); + useDefaultsFromURLSearch(); + + const [dismissTokenWarning, setDismissTokenWarning] = useState( + false, + ); + const handleConfirmTokenWarning = useCallback(() => { + setDismissTokenWarning(true); + }, []); + + // reset if they close warning without tokens in params + const handleDismissTokenWarning = useCallback(() => { + setDismissTokenWarning(true); + history.push('/swap'); + }, [history]); + + // dismiss warning if all imported tokens are in active lists + const defaultTokens = useAllTokens(); + const [showConfirm, setShowConfirm] = useState(false); + const { isPending: allowancePending } = useTwapApprovalCallback(); + + const { t } = useTranslation(); + const { account, chainId } = useActiveWeb3React(); + const { typedValue } = useTwapState(); + const chainIdToUse = chainId ? chainId : ChainId.MATIC; + const independentField = Field.INPUT; + const { + parsedAmount, + currencies, + currencyBalances, + maxImpactAllowed, + isMarketOrder, + } = useTwapContext(); + const derivedSwapValues = useDerivedTwapSwapData(); + const swapInputError = useInputError(); + const tradeDestAmount = derivedSwapValues.destTokenAmount; + + const { data, isLoading: loadingOptimalRate } = useOptimalRate(); + + const optimalRate = data?.rate; + const optimalRateError = data?.error; + + const [isExpertMode] = useExpertModeManager(); + const { + wrapType, + execute: onWrap, + inputError: wrapInputError, + } = useWrapCallback( + currencies[Field.INPUT], + currencies[Field.OUTPUT], + typedValue, + ); + + const [swapType, setSwapType] = useState(SwapSide.SELL); + + const showWrap: boolean = wrapType !== WrapType.NOT_APPLICABLE; + + const { + onCurrencySelection, + onUserInput, + onResetTradePrice, + } = useTwapSwapActionHandlers(); + const [allowedSlippage] = useUserSlippageTolerance(); + + const pct = basisPointsToPercent(allowedSlippage); + + const dependentField = Field.OUTPUT; + const inputCurrency = currencies[Field.INPUT]; + const outputCurrency = currencies[Field.OUTPUT]; + + const inputCurrencyV3 = useMemo(() => { + if (!inputCurrency || !chainId) return; + if (currencyEquals(inputCurrency, ETHER[chainId])) { + return { + ...ETHER[chainId], + isNative: true, + isToken: false, + } as NativeCurrency; + } + return { ...inputCurrency, isNative: false, isToken: true } as Currency; + }, [chainId, inputCurrency]); + + const outputCurrencyV3 = useMemo(() => { + if (!outputCurrency || !chainId) return; + if (currencyEquals(outputCurrency, ETHER[chainId])) + return { + ...ETHER[chainId], + isNative: true, + isToken: false, + } as NativeCurrency; + return { ...outputCurrency, isNative: false, isToken: true } as Currency; + }, [chainId, outputCurrency]); + + const { + convertType, + execute: onConvert, + inputError: convertInputError, + } = useNativeConvertCallback( + inputCurrencyV3?.isToken ? inputCurrencyV3 : undefined, + outputCurrencyV3?.isToken ? outputCurrencyV3 : undefined, + typedValue, + ); + + const showNativeConvert = convertType !== ConvertType.NOT_APPLICABLE; + const { connectWallet } = useConnectWallet(isSupportedNetwork); + + const parsedQs = useParsedQueryString(); + const { redirectWithCurrency, redirectWithSwitch } = useSwapRedirects(); + const parsedCurrency0Id = (parsedQs.currency0 ?? + parsedQs.inputCurrency) as string; + const parsedCurrency1Id = (parsedQs.currency1 ?? + parsedQs.outputCurrency) as string; + + const handleCurrencySelect = useCallback( + (inputCurrency: any) => { + const isSwichRedirect = currencyEquals(inputCurrency, ETHER[chainIdToUse]) + ? parsedCurrency1Id === 'ETH' + : parsedCurrency1Id && + inputCurrency && + inputCurrency.address && + inputCurrency.address.toLowerCase() === + parsedCurrency1Id.toLowerCase(); + if (isSwichRedirect) { + redirectWithSwitch(); + setSwapType(swapType === SwapSide.BUY ? SwapSide.SELL : SwapSide.BUY); + } else { + if (!Boolean(inputCurrency.address in defaultTokens)) { + setDismissTokenWarning(false); + } + redirectWithCurrency(inputCurrency, true); + } + }, + [ + chainIdToUse, + defaultTokens, + parsedCurrency1Id, + redirectWithCurrency, + redirectWithSwitch, + swapType, + ], + ); + + const handleOtherCurrencySelect = useCallback( + (outputCurrency: any) => { + const isSwichRedirect = currencyEquals( + outputCurrency, + ETHER[chainIdToUse], + ) + ? parsedCurrency0Id === 'ETH' + : parsedCurrency0Id && + outputCurrency && + outputCurrency.address && + outputCurrency.address.toLowerCase() === + parsedCurrency0Id.toLowerCase(); + if (isSwichRedirect) { + redirectWithSwitch(); + setSwapType(swapType === SwapSide.BUY ? SwapSide.SELL : SwapSide.BUY); + } else { + if (!Boolean(outputCurrency.address in defaultTokens)) { + setDismissTokenWarning(false); + } + redirectWithCurrency(outputCurrency, false); + } + }, + [ + chainIdToUse, + parsedCurrency0Id, + redirectWithSwitch, + swapType, + redirectWithCurrency, + defaultTokens, + ], + ); + + const parsedCurrency0 = useCurrency(parsedCurrency0Id); + const parsedCurrency1 = useCurrency(parsedCurrency1Id); + const parsedCurrency0Fetched = !!parsedCurrency0; + const parsedCurrency1Fetched = !!parsedCurrency1; + + useEffect(() => { + onResetTradePrice(); + if (parsedCurrency0 === undefined && !parsedCurrency1Id) { + redirectWithCurrency(ETHER[chainIdToUse], true); + } else { + if (parsedCurrency0) { + onCurrencySelection(Field.INPUT, parsedCurrency0); + } + if (parsedCurrency1) { + onCurrencySelection(Field.OUTPUT, parsedCurrency1); + } + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [ + parsedCurrency0Id, + parsedCurrency1Id, + parsedCurrency0Fetched, + parsedCurrency1Fetched, + onResetTradePrice, + ]); + + const selectedTokens: Token[] = useMemo( + () => + [parsedCurrency0, parsedCurrency1]?.filter( + (c): c is Token => c instanceof Token, + ) ?? [], + [parsedCurrency0, parsedCurrency1], + ); + const selectedTokensNotInDefault = + selectedTokens && + selectedTokens.filter((token: Token) => { + return !Boolean(token.address in defaultTokens); + }); + + const parsedAmounts = useMemo(() => { + const parsedAmountInput = + inputCurrencyV3 && parsedAmount + ? CurrencyAmount.fromRawAmount(inputCurrencyV3, parsedAmount.raw) + : undefined; + const parsedAmountOutput = + outputCurrencyV3 && parsedAmount + ? CurrencyAmount.fromRawAmount(outputCurrencyV3, parsedAmount.raw) + : undefined; + + return showWrap || showNativeConvert + ? { + [Field.INPUT]: parsedAmountInput, + [Field.OUTPUT]: parsedAmountOutput, + } + : { + [Field.INPUT]: parsedAmountInput, + [Field.OUTPUT]: + tradeDestAmount && outputCurrencyV3 + ? CurrencyAmount.fromRawAmount( + outputCurrencyV3, + JSBI.BigInt(tradeDestAmount), + ) + : undefined, + }; + }, [ + inputCurrencyV3, + parsedAmount, + outputCurrencyV3, + showWrap, + showNativeConvert, + tradeDestAmount, + ]); + + const maxAmountInputV2 = maxAmountSpend(chainIdToUse, currencyBalances.INPUT); + const halfAmountInputV2 = halfAmountSpend( + chainIdToUse, + currencyBalances.INPUT, + ); + const formattedAmounts = useMemo(() => { + return { + [independentField]: typedValue, + [dependentField]: + showWrap || showNativeConvert + ? parsedAmounts[independentField]?.toExact() ?? '' + : parsedAmounts[dependentField]?.toExact() ?? '', + }; + }, [ + independentField, + typedValue, + dependentField, + showWrap, + showNativeConvert, + parsedAmounts, + ]); + + const maxAmountInput = + maxAmountInputV2 && inputCurrencyV3 + ? CurrencyAmount.fromRawAmount(inputCurrencyV3, maxAmountInputV2.raw) + : undefined; + + const halfAmountInput = + halfAmountInputV2 && inputCurrencyV3 + ? CurrencyAmount.fromRawAmount(inputCurrencyV3, halfAmountInputV2.raw) + : undefined; + + const handleMaxInput = useCallback(() => { + maxAmountInput && onUserInput(Field.INPUT, maxAmountInput.toExact()); + setSwapType(SwapSide.SELL); + }, [maxAmountInput, onUserInput]); + + const handleHalfInput = useCallback(() => { + if (!halfAmountInput) { + return; + } + + onUserInput(Field.INPUT, halfAmountInput.toExact()); + setSwapType(SwapSide.SELL); + }, [halfAmountInput, onUserInput]); + + const atMaxAmountInput = Boolean( + maxAmountInput && parsedAmounts[Field.INPUT]?.equalTo(maxAmountInput), + ); + + const userHasSpecifiedInputOutput = Boolean( + currencies[Field.INPUT] && + currencies[Field.OUTPUT] && + parsedAmounts[independentField]?.greaterThan(JSBI.BigInt(0)), + ); + + const noRoute = !optimalRate || optimalRate.bestRoute.length < 0; + const tradeDecimals = currencies.INPUT?.decimals; + const srcAmount = + parsedAmount && tradeDecimals + ? parsedAmount.multiply(JSBI.BigInt(10 ** tradeDecimals)).toFixed(0) + : undefined; + + const swapInputAmountWithSlippage = + inputCurrencyV3 && srcAmount + ? CurrencyAmount.fromRawAmount(inputCurrencyV3, srcAmount) + : optimalRate && inputCurrencyV3 + ? CurrencyAmount.fromRawAmount( + inputCurrencyV3, + (optimalRate.side === SwapSide.BUY + ? new Fraction(ONE).add(pct) + : new Fraction(ONE) + ).multiply(optimalRate.srcAmount).quotient, + ) + : undefined; + + const swapInputBalanceCurrency = currencyBalances.INPUT; + + const swapInputBalance = + swapInputBalanceCurrency && inputCurrencyV3 + ? CurrencyAmount.fromRawAmount( + inputCurrencyV3, + swapInputBalanceCurrency.raw.toString(), + ) + : undefined; + + const swapButtonText = useMemo(() => { + if (account) { + if (!isSupportedNetwork) return t('switchNetwork'); + if (!currencies[Field.INPUT] || !currencies[Field.OUTPUT]) { + return t('selectToken'); + } else if ( + formattedAmounts[Field.INPUT] === '' && + formattedAmounts[Field.OUTPUT] === '' + ) { + return t('enterAmount'); + } else if (showNativeConvert) { + if (convertInputError) return convertInputError; + return convertType === ConvertType.CONVERT + ? t('convert') + : convertType === ConvertType.CONVERTING + ? t('converting', { symbol: ETHER[chainId].symbol }) + : ''; + } else if (showWrap) { + if (wrapInputError) return wrapInputError; + return wrapType === WrapType.WRAP + ? t('wrapMATIC', { symbol: ETHER[chainId].symbol }) + : wrapType === WrapType.UNWRAP + ? t('unwrapMATIC', { symbol: WETH[chainId].symbol }) + : wrapType === WrapType.WRAPPING + ? t('wrappingMATIC', { symbol: ETHER[chainId].symbol }) + : wrapType === WrapType.UNWRAPPING + ? t('unwrappingMATIC', { symbol: WETH[chainId].symbol }) + : ''; + } else if (loadingOptimalRate) { + return t('loading'); + } else if ( + optimalRateError === 'ESTIMATED_LOSS_GREATER_THAN_MAX_IMPACT' + ) { + return t('priceImpactReached', { maxImpact: maxImpactAllowed }); + } else if (optimalRateError) { + return optimalRateError.includes(' { + if (allowancePending || swapInputError) { + return true; + } + const isSwapError = + (maxImpactReached && !isExpertMode) || + (tradeDestAmount && + !parsedAmounts[Field.OUTPUT]?.equalTo(JSBI.BigInt(tradeDestAmount))) || + (swapInputAmountWithSlippage && + swapInputBalance && + swapInputAmountWithSlippage.greaterThan(swapInputBalance)); + + if (account) { + if (!isSupportedNetwork) return false; + else if (showNativeConvert) { + return ( + Boolean(convertInputError) || convertType === ConvertType.CONVERTING + ); + } else if (showWrap) { + return ( + Boolean(wrapInputError) || + wrapType === WrapType.WRAPPING || + wrapType === WrapType.UNWRAPPING + ); + } else if (noRoute && userHasSpecifiedInputOutput) { + return true; + } else { + return isSwapError; + } + } else { + return false; + } + }, [ + isExpertMode, + parsedAmounts, + swapInputAmountWithSlippage, + swapInputBalance, + account, + isSupportedNetwork, + showNativeConvert, + showWrap, + noRoute, + userHasSpecifiedInputOutput, + convertInputError, + convertType, + wrapInputError, + wrapType, + tradeDestAmount, + maxImpactReached, + swapInputError, + allowancePending, + ]); + + const handleTypeInput = useCallback( + (value: string) => { + onUserInput(Field.INPUT, value); + setSwapType(SwapSide.SELL); + }, + [onUserInput], + ); + const handleTypeOutput = useCallback( + (value: string) => { + onUserInput(Field.OUTPUT, value); + setSwapType(SwapSide.BUY); + }, + [onUserInput], + ); + + const onSubmitSwap = useCallback(() => { + if (wrapType === WrapType.WRAP || wrapType === WrapType.UNWRAP) { + onWrap?.(); + } else { + setShowConfirm(true); + } + }, [onWrap, wrapType]); + + const { inInputTitle, outInputTitle } = useInputTitle(); + return ( + + 0 && !dismissTokenWarning} + tokens={selectedTokensNotInDefault} + onConfirm={handleConfirmTokenWarning} + onDismiss={handleDismissTokenWarning} + /> + + setShowConfirm(false)} + /> + + + + + { + setSwapType( + swapType === SwapSide.BUY ? SwapSide.SELL : SwapSide.BUY, + ); + redirectWithSwitch(); + }} + sx={{ + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + width: '24px', + height: '24px', + borderRadius: '4px', + border: '2px solid #191b2e', + bgcolor: '#232734', + }} + > + arrow down + + + + + + + + + + + + + + + + ); +}; + +const SwapTwap: React.FC<{ + currencyBgClass?: string; +}> = ({ currencyBgClass }) => { + return ( + + + + ); +}; + +export default SwapTwap; diff --git a/src/components/Swap/orbs/Twap/TwapContext.tsx b/src/components/Swap/orbs/Twap/TwapContext.tsx new file mode 100644 index 000000000..80cbfe026 --- /dev/null +++ b/src/components/Swap/orbs/Twap/TwapContext.tsx @@ -0,0 +1,151 @@ +import React, { createContext, useEffect, useMemo, useState } from 'react'; +import { + Configs, + constructSDK, + TimeUnit, + TwapSDK, +} from '@orbs-network/twap-sdk'; +import { useActiveWeb3React } from 'hooks'; +import { useTwapState, useTwapSwapActionHandlers } from 'state/swap/twap/hooks'; +import { Field } from '../../../../state/swap/actions'; +import { useCurrency } from 'hooks/Tokens'; +import { tryParseAmount } from 'state/swap/hooks'; +import { ChainId, Currency, CurrencyAmount } from '@uniswap/sdk'; +import { GlobalValue } from 'constants/index'; +import { useExpertModeManager } from 'state/user/hooks'; +import { useCurrencyBalances } from 'state/wallet/hooks'; +import useParsedQueryString from 'hooks/useParsedQueryString'; + +interface ContextValues { + currentTime: number; + maxImpactAllowed: number; + parsedAmount?: CurrencyAmount; + isLimitPanel: boolean; + twapSDK: TwapSDK; + isMarketOrder: boolean; + currencies: { + [Field.INPUT]?: Currency; + [Field.OUTPUT]?: Currency; + }; + currencyBalances: { + [Field.INPUT]?: CurrencyAmount; + [Field.OUTPUT]?: CurrencyAmount; + }; +} + +const Context = createContext({} as ContextValues); + +const useTwapSDK = () => { + const { chainId } = useActiveWeb3React(); + const config = useMemo(() => { + switch (chainId) { + default: + return Configs.QuickSwap; + } + }, [chainId]); + + return useMemo(() => constructSDK({ config }), [config]); +}; + +const useIsLimitPanel = () => { + const parsedQs = useParsedQueryString(); + const swapType = parsedQs.swapIndex; + + return Number(swapType) === 3; +}; + +export const TwapContextProvider = ({ + children, +}: { + children: React.ReactNode; +}) => { + const [currentTime, setCurrentTime] = useState(Date.now()); + const state = useTwapState(); + const isLimitPanel = useIsLimitPanel(); + + const { onDurationInput } = useTwapSwapActionHandlers(); + const isMarketOrder = isLimitPanel ? false : !!state.isMarketOrder; + useEffect(() => { + if (isLimitPanel) { + onDurationInput({ unit: TimeUnit.Days, value: 7 }); + } else { + onDurationInput(undefined); + } + }, [isLimitPanel, onDurationInput]); + + useEffect(() => { + setInterval(() => { + setCurrentTime(Date.now()); + }, 60_000); + }, []); + + return ( + + {children} + + ); +}; + +export const useTwapContext = () => { + return React.useContext(Context); +}; + +const useCurrencies = () => { + const { + [Field.INPUT]: { currencyId: inputCurrencyId }, + [Field.OUTPUT]: { currencyId: outputCurrencyId }, + } = useTwapState(); + + return { + [Field.INPUT]: useCurrency(inputCurrencyId) ?? undefined, + [Field.OUTPUT]: useCurrency(outputCurrencyId) ?? undefined, + }; +}; + +const useMaxImpactAllowed = () => { + const [isExpertMode] = useExpertModeManager(); + + return isExpertMode + ? 100 + : Number( + GlobalValue.percents.BLOCKED_PRICE_IMPACT_NON_EXPERT.multiply( + '100', + ).toFixed(4), + ); +}; + +const useBalances = () => { + const { account } = useActiveWeb3React(); + const currencies = useCurrencies(); + + const relevantTokenBalances = useCurrencyBalances(account ?? undefined, [ + currencies[Field.INPUT] ?? undefined, + currencies[Field.OUTPUT] ?? undefined, + ]); + + return { + [Field.INPUT]: relevantTokenBalances[0], + [Field.OUTPUT]: relevantTokenBalances[1], + }; +}; + +const useParsedSrcAmount = () => { + const { chainId } = useActiveWeb3React(); + const typedValue = useTwapState().typedValue; + const inputCurrency = useCurrencies()[Field.INPUT]; + const chainIdToUse = chainId ? chainId : ChainId.MATIC; + return useMemo(() => { + return tryParseAmount(chainIdToUse, typedValue, inputCurrency); + }, [chainIdToUse, inputCurrency, typedValue]); +}; diff --git a/src/components/Swap/orbs/Twap/TwapOrders/TwapOrders.tsx b/src/components/Swap/orbs/Twap/TwapOrders/TwapOrders.tsx new file mode 100644 index 000000000..8ae2711c7 --- /dev/null +++ b/src/components/Swap/orbs/Twap/TwapOrders/TwapOrders.tsx @@ -0,0 +1,100 @@ +import { TwapOrdersList } from './TwapOrdersList'; +import { TwapSelectedOrder } from './TwapSelectedOrder'; +import { Box } from '@material-ui/core'; +import React, { useCallback, useState } from 'react'; +import { useGrouppedTwapOrders } from '../hooks'; +import ArrowForwardIcon from '@material-ui/icons/ArrowForward'; +import { Card } from '../Components/Components'; +import { useTwapState } from 'state/swap/twap/hooks'; +import { useTranslation } from 'react-i18next'; +import { useActiveWeb3React } from 'hooks'; +import SpinnerImage from 'assets/images/spinner.svg'; +import CustomModal from 'components/CustomModal'; + +export const ShowOrdersButton = ({ onOpen }: { onOpen: () => void }) => { + const { account } = useActiveWeb3React(); + const grouped = useGrouppedTwapOrders(); + const { updatingOrders } = useTwapState(); + const { t } = useTranslation(); + + const isLoading = updatingOrders || !grouped; + + const onClick = useCallback(() => { + if (isLoading) return; + onOpen(); + }, [isLoading, onOpen]); + + if (!account) return null; + + return ( + + {isLoading ? ( + + {t('loading')} {t('orders')}... + + ) : ( + + {grouped?.open?.length || 0} {t('open')} {t('orders')} + + )}{' '} + {isLoading ? ( + + Spinner + + ) : ( + + )} + + ); +}; + +export function TwapOrders() { + const [isOpen, setIsOpen] = useState(false); + const [selectedOrderId, setSelectedOrderId] = useState( + undefined, + ); + + const onOpen = useCallback(() => { + setIsOpen(true); + setSelectedOrderId(undefined); + }, []); + + const onClose = useCallback(() => { + setIsOpen(false); + }, []); + + const onOrderSelect = useCallback((orderId: number) => { + setSelectedOrderId(orderId); + }, []); + + const onResetSelectedOrder = useCallback(() => { + setSelectedOrderId(undefined); + }, []); + + return ( + <> + + + + + + + + ); +} diff --git a/src/components/Swap/orbs/Twap/TwapOrders/TwapOrdersList.tsx b/src/components/Swap/orbs/Twap/TwapOrders/TwapOrdersList.tsx new file mode 100644 index 000000000..f40fd16ff --- /dev/null +++ b/src/components/Swap/orbs/Twap/TwapOrders/TwapOrdersList.tsx @@ -0,0 +1,233 @@ +import { + Box, + Button, + LinearProgress, + Menu, + MenuItem, + Typography, +} from '@material-ui/core'; +import { Close, KeyboardArrowDown } from '@material-ui/icons'; +import { Order, OrderStatus } from '@orbs-network/twap-sdk'; +import CurrencyLogo from 'components/CurrencyLogo'; +import React, { useCallback, useState } from 'react'; +import { useTranslation } from 'react-i18next'; +import { Virtuoso } from 'react-virtuoso'; +import { formatDateFromTimeStamp } from 'utils'; +import { + useGrouppedTwapOrders, + useOrderTitle, + useTwapOrderCurrency, +} from '../hooks'; +import ArrowForwardIcon from '@material-ui/icons/ArrowForward'; +import { Card } from '../Components/Components'; +import { Currency } from '@uniswap/sdk'; +import { Skeleton } from '@material-ui/lab'; + +export const TwapOrdersList = ({ + onClose, + onOrderSelect, + hide, +}: { + onClose: () => void; + onOrderSelect: (id: number) => void; + hide: boolean; +}) => { + const groupedOrders = useGrouppedTwapOrders(); + const [selectedStatus, setSelectedStatus] = useState(OrderStatus.All); + const Row = useCallback( + ({ data, index, style }: { data: Order[]; index: number; style?: any }) => { + const order = data[index]; + + return ( +
+ onOrderSelect(order.id)} + /> +
+ ); + }, + [onOrderSelect], + ); + + if (hide) return null; + + const orders = groupedOrders?.[selectedStatus] || []; + + return ( + + + + + + {orders.length === 0 ? ( + + ) : ( + Row({ data: orders, index })} + /> + )} + + ); +}; + +const EmptyList = ({ selectedStatus }: { selectedStatus: OrderStatus }) => { + const { t } = useTranslation(); + + return ( + + {' '} + {selectedStatus === OrderStatus.All + ? `No ${t('orders')}` + : `No ${t(selectedStatus)} orders`} + + ); +}; + +const OrderMenu = ({ + selectedStatus, + onSelect, +}: { + selectedStatus: OrderStatus; + onSelect: (status: OrderStatus) => void; +}) => { + const { t } = useTranslation(); + const [anchorEl, setAnchorEl] = useState(null); + const open = Boolean(anchorEl); + + const onOpen = useCallback( + (event: React.MouseEvent) => { + setAnchorEl(event.currentTarget); + }, + [setAnchorEl], + ); + + const handleClose = useCallback(() => { + setAnchorEl(null); + }, [setAnchorEl]); + + const handleMenuItemClick = useCallback( + (value: OrderStatus) => { + handleClose(); + onSelect(value); + }, + [handleClose, onSelect], + ); + + return ( + <> + + + {Object.values(OrderStatus).map((status, index) => { + const selected = selectedStatus === status; + return ( + handleMenuItemClick(status)} + > + {t(status)} + {selected && } + + ); + })} + + + ); +}; + +export function TwapOrdersListItem({ + order, + onSelect, +}: { + order: Order; + onSelect: () => void; +}) { + const inCurrency = useTwapOrderCurrency(order.srcTokenAddress); + const outCurrency = useTwapOrderCurrency(order.dstTokenAddress); + + const _onSelect = () => { + if (!inCurrency || !outCurrency) return; + onSelect(); + }; + + return ( + + +
+ + + + + ); +} + +const Header = ({ order }: { order: Order }) => { + const title = useOrderTitle(order); + return ( + + + # {order.id} {title}{' '} + + {order.status} + + ); +}; + +const Progress = ({ order }: { order: Order }) => { + return ( + + + {parseFloat(Number(order.progress).toFixed(2))}% + + ); +}; + +const Currencies = ({ + inCurrency, + outCurrency, +}: { + inCurrency?: Currency; + outCurrency?: Currency; +}) => { + return ( + + + {!inCurrency ? ( + + ) : ( + + )} + {inCurrency && {inCurrency?.symbol}} + + + + {!outCurrency ? ( + + ) : ( + + )} + {outCurrency && {outCurrency?.symbol}} + + + ); +}; diff --git a/src/components/Swap/orbs/Twap/TwapOrders/TwapSelectedOrder.tsx b/src/components/Swap/orbs/Twap/TwapOrders/TwapSelectedOrder.tsx new file mode 100644 index 000000000..6bdb50886 --- /dev/null +++ b/src/components/Swap/orbs/Twap/TwapOrders/TwapSelectedOrder.tsx @@ -0,0 +1,416 @@ +import { + Accordion, + AccordionDetails, + AccordionSummary, + Box, + Typography, +} from '@material-ui/core'; +import { Close } from '@material-ui/icons'; +import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; +import CurrencyLogo from 'components/CurrencyLogo'; +import { useActiveWeb3React } from 'hooks'; +import React, { createContext, ReactNode, useMemo, useState } from 'react'; +import { useTranslation } from 'react-i18next'; +import { formatDateFromTimeStamp, formatNumber, getEtherscanLink } from 'utils'; +import { formatCurrencyAmount } from 'utils/v3/formatCurrencyAmount'; +import { fromRawAmount, makeElipsisAddress } from '../../utils'; +import { + useOrderTitle, + useTwapOrderCurrency, + useTwapOrdersQuery, +} from '../hooks'; +import { OrderDetails } from '../Components/OrderDetails'; +import { Order } from '@orbs-network/twap-sdk'; + +interface ContextType { + selectedOrder: Order; +} +const Context = createContext({} as ContextType); + +const useSelectedOrderContext = () => { + return React.useContext(Context); +}; + +const ContextProvider = ({ + children, + selectedOrderId, +}: { + children: ReactNode; + selectedOrderId?: number; +}) => { + const { data: orders } = useTwapOrdersQuery(); + const selectedOrder = useMemo( + () => orders?.find((order: Order) => order.id === selectedOrderId), + [orders, selectedOrderId], + ); + + if (!selectedOrder) return null; + + return ( + {children} + ); +}; + +const ELIPSIS_PADDING = 5; + +export function TwapSelectedOrder({ + selectedOrderId, + onClose, +}: { + selectedOrderId?: number; + onClose: () => void; +}) { + return ( + + +
+ + + + + + + ); +} + +const Accordions = () => { + const { t } = useTranslation(); + const [expanded, setExpanded] = useState(1); + + const onExpand = (value: number) => { + setExpanded(value === expanded ? undefined : value); + }; + + return ( + + onExpand(1)} + > + + + + + + + onExpand(2)} + > + + + + + + + + + + + + + ); +}; + +const Header = ({ onClose }: { onClose: () => void }) => { + const { t } = useTranslation(); + const { selectedOrder } = useSelectedOrderContext(); + const title = useOrderTitle(selectedOrder); + + return ( + + + # {selectedOrder.id} {title} + + + + ); +}; + +const Currencies = () => { + const { selectedOrder } = useSelectedOrderContext(); + const { t } = useTranslation(); + + return ( + + + + + ); +}; + +const CurrenciesCurrency = ({ + label, + address, +}: { + label: string; + address: string; +}) => { + const currency = useTwapOrderCurrency(address); + + return ( + + + + {label} + + + {currency?.symbol} + + + + + ); +}; + +const FillDelay = () => { + const { selectedOrder } = useSelectedOrderContext(); + if (selectedOrder.totalChunks === 1) return null; + + return ( + + ); +}; + +const TxHash = () => { + const { selectedOrder } = useSelectedOrderContext(); + const { chainId } = useActiveWeb3React(); + const { t } = useTranslation(); + if (!selectedOrder.txHash) return null; + + return ( + + {makeElipsisAddress(selectedOrder?.txHash, ELIPSIS_PADDING)} + + } + /> + ); +}; + +const Chunks = () => { + const { selectedOrder } = useSelectedOrderContext(); + if (selectedOrder.totalChunks === 1) return null; + + return ; +}; + +const ChunkSize = () => { + const { selectedOrder } = useSelectedOrderContext(); + const inCurrency = useOrderCurrencies().inCurrency; + + if (selectedOrder.totalChunks === 1) return null; + + return ( + + ); +}; + +const SrcAmount = () => { + const { selectedOrder } = useSelectedOrderContext(); + const currency = useOrderCurrencies().inCurrency; + + return ( + + ); +}; + +const MinReceived = () => { + const { selectedOrder } = useSelectedOrderContext(); + const { t } = useTranslation(); + const currency = useOrderCurrencies().outCurrency; + + if (selectedOrder.isMarketOrder) return null; + + return ( + + ); +}; + +const useOrderCurrencies = () => { + const { selectedOrder } = useSelectedOrderContext(); + + const inCurrency = useTwapOrderCurrency(selectedOrder?.srcTokenAddress); + const outCurrency = useTwapOrderCurrency(selectedOrder?.dstTokenAddress); + return { inCurrency, outCurrency }; +}; + +const CreatedAt = () => { + const { selectedOrder } = useSelectedOrderContext(); + const { t } = useTranslation(); + + return ( + + ); +}; + +const Expiration = () => { + const { selectedOrder } = useSelectedOrderContext(); + + return ; +}; + +const LimitPrice = () => { + const { selectedOrder } = useSelectedOrderContext(); + const { inCurrency, outCurrency } = useOrderCurrencies(); + + const price = useMemo(() => { + if (!inCurrency || !outCurrency) return; + return selectedOrder.getLimitPrice( + inCurrency?.decimals, + outCurrency?.decimals, + ); + }, [selectedOrder, inCurrency?.decimals, outCurrency?.decimals]); + if (!price) return null; + + return ( + + ); +}; + +const InfoAccordion = ({ + title, + children, + expanded, + onExpand, +}: { + title: string; + children: ReactNode; + expanded: boolean; + onExpand: () => void; +}) => { + return ( + + } onClick={onExpand}> + {title} + + {children} + + ); +}; + +const Progress = () => { + const { selectedOrder } = useSelectedOrderContext(); + const { t } = useTranslation(); + if (selectedOrder.totalChunks === 1) return null; + + return ( + + ); +}; + +const ExcecutionPrice = () => { + const { selectedOrder } = useSelectedOrderContext(); + const { inCurrency, outCurrency } = useOrderCurrencies(); + const { t } = useTranslation(); + + const excecutionPrice = useMemo(() => { + if (!inCurrency || !outCurrency) return undefined; + return selectedOrder.getExcecutionPrice( + inCurrency?.decimals, + outCurrency?.decimals, + ); + }, [selectedOrder, inCurrency, outCurrency]); + + return ( + + ); +}; + +const Status = () => { + const { selectedOrder } = useSelectedOrderContext(); + const { t } = useTranslation(); + + return ( + + ); +}; + +const AmountReceived = () => { + const { selectedOrder } = useSelectedOrderContext(); + const { t } = useTranslation(); + + const currency = useOrderCurrencies().outCurrency; + + return ( + + ); +}; + +const AmountSent = () => { + const { selectedOrder } = useSelectedOrderContext(); + const { t } = useTranslation(); + + const currency = useOrderCurrencies().inCurrency; + + return ( + + ); +}; diff --git a/src/components/Swap/orbs/Twap/TwapSwapConfirmation.tsx b/src/components/Swap/orbs/Twap/TwapSwapConfirmation.tsx new file mode 100644 index 000000000..9f9babca7 --- /dev/null +++ b/src/components/Swap/orbs/Twap/TwapSwapConfirmation.tsx @@ -0,0 +1,478 @@ +import React, { useCallback, useMemo } from 'react'; +import OrbsLogo from 'assets/images/orbs-logo.svg'; +import { useTranslation } from 'react-i18next'; +import { Box, Button } from '@material-ui/core'; +import CheckCircleIcon from '@material-ui/icons/CheckCircle'; +import SwapVerticalCircleIcon from '@material-ui/icons/SwapVerticalCircle'; +import { + useDerivedTwapSwapData, + useFillDelayAsText, + useInputTitle, + useTradePrice, +} from './hooks'; +import { useGetLogoCallback } from 'components/Swap/orbs/hooks'; +import { fromRawAmount } from 'components/Swap/orbs/utils'; +import { ORBS_WEBSITE, Steps, TWAP_WEBSITE } from '../consts'; +import { SwapStep } from '@orbs-network/swap-ui'; +import useUSDCPrice from 'utils/useUSDCPrice'; +import { ConfirmationModal } from '../ConfirmationModal'; +import { OrderDetails } from './Components/OrderDetails'; +import { MarketPriceWarning } from './Components/Components'; +import { useMutation } from '@tanstack/react-query'; +import { useAppDispatch } from 'state'; +import { updateUserBalance } from 'state/balance/actions'; +import { + PrepareOrderArgsResult, + TwapAbi, + zeroAddress, +} from '@orbs-network/twap-sdk'; +import { useTwapApprovalCallback, useTwapOrdersQuery } from './hooks'; +import { wrappedCurrency } from 'utils/wrappedCurrency'; +import { useActiveWeb3React } from 'hooks'; +import { useContract } from 'hooks/useContract'; +import { calculateGasMargin } from 'utils'; +import { WETH } from '@uniswap/sdk'; +import { useIsNativeCurrencyCallback } from '../hooks'; +import { useTwapContext } from './TwapContext'; +import { SwapStatus } from '@orbs-network/swap-ui'; +import { isRejectedError } from '../utils'; +import { BigNumber } from 'ethers'; +import { useTwapSwapActionHandlers } from 'state/swap/twap/hooks'; +import { Field } from '../../../../state/swap/actions'; +import { ConfirmationState } from '../ConfirmationModal'; +import useWrapCallback from 'hooks/useWrapCallback'; + +export const useParseSteps = () => { + const { currencies } = useTwapContext(); + const { t } = useTranslation(); + const getLogo = useGetLogoCallback(); + const inCurrency = currencies.INPUT; + const orderType = useOrderType(); + + return useCallback( + (steps?: Steps[]) => { + if (!steps) return []; + const result: SwapStep[] = []; + if (steps.includes(Steps.WRAP)) { + result.push({ + title: t('wrapMATIC', { symbol: inCurrency?.symbol }), + icon: , + id: Steps.WRAP, + }); + } + if (steps.includes(Steps.APPROVE)) { + result.push({ + title: t('approveToken', { symbol: inCurrency?.symbol }), + icon: , + id: Steps.APPROVE, + }); + } + + result.push({ + title: `${t('create')} ${orderType}`, + + icon: , + id: Steps.SWAP, + }); + return result; + }, + [inCurrency, getLogo, t, orderType], + ); +}; + +const useOrderType = () => { + const { isLimitPanel, isMarketOrder } = useTwapContext(); + const { t } = useTranslation(); + + return useMemo(() => { + if (isLimitPanel) { + return `${t('limitOrder')} `; + } + if (isMarketOrder) { + return `${t('twapMarketOrder')}`; + } + return `${t('twapLimitOrder')}`; + }, [isLimitPanel, isMarketOrder, t]); +}; +const SuccessContent = ({ txHash }: { txHash?: string }) => { + const { isLimitPanel } = useTwapContext(); + const { t } = useTranslation(); + + const orderType = useOrderType(); + + return ( + + {`${orderType} ${t('created')}`} + {t(' using')}{' '} + + {isLimitPanel ? 'dLimit' : 'dTWAP'} + {' '} + {t('by')}{' '} + + {t('orbs')} + + +

+ } + /> + ); +}; + +const FillDelayAndChunks = () => { + const derivedSwapValues = useDerivedTwapSwapData(); + const { chunks, fillDelay } = derivedSwapValues; + const fillDelayAsText = useFillDelayAsText(fillDelay.unit * fillDelay.value); + if (chunks === 1) return null; + + return ( +

{`Every ${fillDelayAsText} over ${chunks} trades`}

+ ); +}; + +const SwapDetails = () => { + const derivedSwapValues = useDerivedTwapSwapData(); + const { + deadline, + srcChunkAmount, + chunks, + fillDelay, + destTokenMinAmount, + } = derivedSwapValues; + const { currencies, isMarketOrder } = useTwapContext(); + + return ( + <> + + + + {isMarketOrder && } + + {chunks > 1 && ( + + )} + + + + + + + ); +}; + +const Price = () => { + const { currencies, isMarketOrder } = useTwapContext(); + const tradePrice = useTradePrice(); + const parsedTradePrice = fromRawAmount(currencies.OUTPUT, tradePrice); + const usd = + Number(useUSDCPrice(currencies.OUTPUT)?.toSignificant() ?? 0) * + Number(parsedTradePrice?.toExact() || 0); + + return ( + + + + ); +}; + +const SwapButton = ({ onClick }: { onClick: () => void }) => { + const { t } = useTranslation(); + const { currencies } = useTwapContext(); + const usd = useUSDCPrice(currencies.INPUT)?.toSignificant(); + const isLoading = !usd; + + return ( + + ); +}; + +const MainContent = () => { + const { inInputTitle, outInputTitle } = useInputTitle(); + const { t } = useTranslation(); + const { isMarketOrder, parsedAmount, currencies } = useTwapContext(); + const derivedSwapValues = useDerivedTwapSwapData(); + const parseSteps = useParseSteps(); + const { mutateAsync: onSubmit } = useSubmitOrderCallback(); + + const parsedTradeDestAmount = fromRawAmount( + currencies.OUTPUT, + derivedSwapValues.destTokenAmount, + ); + const inUsd = + Number(useUSDCPrice(currencies.INPUT)?.toSignificant() ?? 0) * + Number(parsedAmount?.toExact() || 0); + const outUsd = + Number(useUSDCPrice(currencies.OUTPUT)?.toSignificant() ?? 0) * + Number(parsedTradeDestAmount?.toExact() || 0); + + return ( + } + SwapButton={SwapButton} + inTitle={inInputTitle} + outTitle={outInputTitle} + inUsd={inUsd.toLocaleString('en')} + outUsd={isMarketOrder ? '' : outUsd.toLocaleString('en')} + onSubmit={onSubmit} + /> + ); +}; + +const ErrorContent = () => { + return ; +}; + +export function Content({ + isOpen, + onDismiss, +}: { + isOpen: boolean; + onDismiss: () => void; +}) { + const { isMarketOrder, parsedAmount, currencies } = useTwapContext(); + const derivedSwapValues = useDerivedTwapSwapData(); + const tradeDestAmount = derivedSwapValues?.destTokenAmount; + + return ( + } + mainContent={} + errorContent={} + /> + ); +} + +export const TwapSwapConfirmation = ({ + isOpen, + onDismiss, +}: { + isOpen: boolean; + onDismiss: () => void; +}) => { + return ; +}; + +const useGetStepsCallback = () => { + const isNativeIn = useIsNativeCurrencyCallback(); + const { isApproved } = useTwapApprovalCallback(); + const { currencies } = useTwapContext(); + return useCallback(() => { + const steps: Steps[] = []; + + if (isNativeIn(currencies[Field.INPUT])) { + steps.push(Steps.WRAP); + } + if (!isApproved) { + steps.push(Steps.APPROVE); + } + steps.push(Steps.SWAP); + return steps; + }, [currencies, isApproved, isNativeIn]); +}; + +const useWrap = () => { + const { currencies, parsedAmount, twapSDK } = useTwapContext(); + const { chainId } = useActiveWeb3React(); + const { execute: wrap } = useWrapCallback( + currencies[Field.INPUT], + WETH[chainId], + parsedAmount?.toExact(), + ); + + return useMutation({ + mutationFn: async () => { + twapSDK.analytics.onWrapRequest(); + await wrap?.(); + twapSDK.analytics.onWrapSuccess(); + }, + onError: (error) => { + twapSDK.analytics.onWrapError(error); + throw error; + }, + }); +}; + +const useApproval = () => { + const { approve } = useTwapApprovalCallback(); + const { twapSDK } = useTwapContext(); + return useMutation({ + mutationFn: async () => { + twapSDK.analytics.onApproveRequest(); + await approve(); + twapSDK.analytics.onApproveSuccess(); + }, + onError: (error) => { + twapSDK.analytics.onApproveError(error); + throw error; + }, + }); +}; + +const useCreateOrder = () => { + const { twapSDK } = useTwapContext(); + const { account } = useActiveWeb3React(); + const tokenContract = useContract(twapSDK.config.twapAddress, TwapAbi); + + return useMutation({ + mutationFn: async (orderArgs: PrepareOrderArgsResult) => { + if (!tokenContract) { + throw new Error('Missing tokenContract'); + } + twapSDK.analytics.onCreateOrderRequest(orderArgs, account); + const gasEstimate = await tokenContract.estimateGas.ask(orderArgs); + const txResponse = await tokenContract.functions.ask(orderArgs, { + gasLimit: calculateGasMargin(gasEstimate), + }); + + const txReceipt = await txResponse.wait(); + let orderId: number | undefined = undefined; + try { + orderId = BigNumber.from(txReceipt.events[0].args[0]).toNumber(); + twapSDK.analytics.onCreateOrderSuccess( + txReceipt.transactionHash, + orderId, + ); + } catch (error) { + console.log({ error }); + } + return { + txReceipt, + orderId, + }; + }, + onError: (error) => { + twapSDK.analytics.onCreateOrderError(error); + throw error; + }, + }); +}; + +const useOnCreateOrderSuccess = () => { + const { fetchUpdatedOrders } = useTwapOrdersQuery(); + const { onUpdatingOrders, onUserInput } = useTwapSwapActionHandlers(); + + return useCallback( + async (id?: number) => { + onUserInput(Field.INPUT, ''); + onUpdatingOrders(true); + await fetchUpdatedOrders(id); + onUpdatingOrders(false); + }, + [fetchUpdatedOrders, onUpdatingOrders, onUserInput], + ); +}; + +const useGetOrderArgs = () => { + const { twapSDK } = useTwapContext(); + const { parsedAmount, currencies } = useTwapContext(); + const derivedSwapValues = useDerivedTwapSwapData(); + const { chainId } = useActiveWeb3React(); + const isNative = useIsNativeCurrencyCallback(); + + return useCallback(() => { + const srcToken = wrappedCurrency(currencies[Field.INPUT], chainId); + const destToken = wrappedCurrency(currencies[Field.OUTPUT], chainId); + if (!srcToken || !destToken) { + throw new Error('Missing token'); + } + return twapSDK.prepareOrderArgs({ + fillDelay: derivedSwapValues.fillDelay, + deadline: derivedSwapValues.deadline, + srcAmount: parsedAmount?.raw.toString() ?? '0', + destTokenMinAmount: derivedSwapValues.destTokenMinAmount, + srcChunkAmount: derivedSwapValues.srcChunkAmount, + srcTokenAddress: srcToken.address, + destTokenAddress: isNative(currencies[Field.OUTPUT]) + ? zeroAddress + : destToken.address, + }); + }, [currencies, parsedAmount, derivedSwapValues, chainId, twapSDK, isNative]); +}; + +const useSubmitOrderCallback = () => { + const { twapSDK } = useTwapContext(); + const { account } = useActiveWeb3React(); + const dispatch = useAppDispatch(); + const getSteps = useGetStepsCallback(); + const { mutateAsync: approve } = useApproval(); + const { mutateAsync: wrap } = useWrap(); + const { mutateAsync: createOrder } = useCreateOrder(); + const getOrderArgs = useGetOrderArgs(); + const onSuccess = useOnCreateOrderSuccess(); + + return useMutation( + async (updateStore: (value: ConfirmationState) => void) => { + let shouldUnwrap = false; + + try { + const orderArgs = getOrderArgs(); + const steps = getSteps(); + twapSDK.analytics.onCreateOrderRequest(orderArgs, account); + updateStore({ steps, swapStatus: SwapStatus.LOADING }); + + if (steps.includes(Steps.WRAP)) { + updateStore({ currentStep: Steps.WRAP }); + await wrap(); + shouldUnwrap = true; + updateStore({ shouldUnwrap: true }); + } + + if (steps.includes(Steps.APPROVE)) { + updateStore({ currentStep: Steps.APPROVE }); + await approve(); + } + updateStore({ currentStep: Steps.SWAP }); + + const { txReceipt, orderId } = await createOrder(orderArgs); + onSuccess(orderId); + updateStore({ + swapStatus: SwapStatus.SUCCESS, + }); + dispatch(updateUserBalance()); + return txReceipt; + } catch (error) { + if (isRejectedError(error) && !shouldUnwrap) { + updateStore({ + swapStatus: undefined, + }); + } else { + updateStore({ + shouldUnwrap: shouldUnwrap, + swapStatus: SwapStatus.FAILED, + error: (error as Error).message, + }); + } + } + }, + ); +}; diff --git a/src/components/Swap/orbs/Twap/hooks.ts b/src/components/Swap/orbs/Twap/hooks.ts new file mode 100644 index 000000000..280dca80b --- /dev/null +++ b/src/components/Swap/orbs/Twap/hooks.ts @@ -0,0 +1,389 @@ +import { useQuery, useQueryClient } from '@tanstack/react-query'; +import { + MIN_FILL_DELAY_MINUTES, + MAX_FILL_DELAY_DAYS, + MIN_DURATION_MINUTES, + groupOrdersByStatus, + zeroAddress, + Order, + OrderType, +} from '@orbs-network/twap-sdk'; +import { ChainId, Currency, currencyEquals, ETHER } from '@uniswap/sdk'; +import { useActiveWeb3React } from 'hooks'; +import { useCallback, useMemo } from 'react'; +import { useTwapContext } from './TwapContext'; +import { V3Currency } from 'v3lib/entities/v3Currency'; +import { useApproval } from '../hooks'; +import { useCurrency } from 'hooks/Tokens'; +import { useTranslation } from 'react-i18next'; +import useParsedQueryString from 'hooks/useParsedQueryString'; +import { Field } from '../../../../state/swap/actions'; +import useUSDCPrice from 'utils/useUSDCPrice'; +import { useTwapState } from 'state/swap/twap/hooks'; +import { SwapSide } from '@paraswap/sdk'; +import { paraswapTaxBuy, paraswapTaxSell } from 'constants/index'; +import { getBestTradeCurrencyAddress, useParaswap } from 'hooks/useParaswap'; +import { tryParseAmount } from 'state/swap/hooks'; + +export const useInputError = () => { + const { account } = useActiveWeb3React(); + const { currencyBalances, parsedAmount, currencies } = useTwapContext(); + const parsedQuery = useParsedQueryString(); + const swapType = parsedQuery?.swapIndex; + const durationWarning = useDurationWarning(); + const tradeSizeWarning = useTradeSizeWarning(); + const fillDelayWarning = useFillDelayWarning(); + + return useMemo(() => { + if (!account) { + return 'Connect Wallet'; + } + if (!parsedAmount) { + return 'Enter an amount'; + } + + if (!currencies[Field.INPUT] || !currencies[Field.OUTPUT]) { + return 'Select a token'; + } + + const amountIn = parsedAmount; + + if ( + swapType !== '0' && + currencyBalances[Field.INPUT] && + amountIn && + currencyBalances[Field.INPUT].lessThan(amountIn) + ) { + return 'Insufficient ' + amountIn.currency.symbol + ' balance'; + } + if (durationWarning) { + return durationWarning; + } + if (tradeSizeWarning) { + return tradeSizeWarning; + } + if (fillDelayWarning) { + return fillDelayWarning; + } + }, [ + currencyBalances, + account, + parsedAmount, + currencies, + swapType, + currencyBalances[Field.INPUT], + durationWarning, + tradeSizeWarning, + fillDelayWarning, + ]); +}; + +export const useDurationWarning = () => { + const { t } = useTranslation(); + const { warnings } = useDerivedTwapSwapData(); + return useMemo(() => { + if (warnings.minDuration) { + return t('minExpiryWarning', { value: MIN_DURATION_MINUTES }); + } + if (warnings.maxDuration) { + return t('maxExpiryWarning'); + } + }, [warnings.maxDuration, warnings.minDuration, t]); +}; + +export const useTradeSizeWarning = () => { + const { t } = useTranslation(); + + const { twapSDK } = useTwapContext(); + const { warnings } = useDerivedTwapSwapData(); + + return useMemo(() => { + if (warnings.tradeSize) { + return t('tradeSizeWarning', { usd: twapSDK.config.minChunkSizeUsd }); + } + }, [warnings.tradeSize, t, twapSDK.config.minChunkSizeUsd]); +}; + +export const useFillDelayWarning = () => { + const { t } = useTranslation(); + const { warnings } = useDerivedTwapSwapData(); + + return useMemo(() => { + if (warnings.minFillDelay) { + return t('minFillDelayWarning', { value: MIN_FILL_DELAY_MINUTES }); + } + if (warnings.maxFillDelay) { + return t('maxFillDelayWarning', { value: MAX_FILL_DELAY_DAYS }); + } + }, [warnings.minFillDelay, warnings.maxFillDelay, t]); +}; + +export const isNativeCurrency = (currency?: Currency, chainId?: ChainId) => { + if (!currency || !chainId) return false; + const nativeCurrency = ETHER[chainId]; + return ( + currencyEquals(currency, nativeCurrency) || + (currency as V3Currency).isNative + ); +}; + +export const useOrderTitle = (order?: Order) => { + const { t } = useTranslation(); + + return useMemo(() => { + if (!order) return ''; + switch (order.orderType) { + case OrderType.LIMIT: + return t('limitOrder'); + case OrderType.TWAP_MARKET: + return t('twapMarketOrder'); + case OrderType.TWAP_LIMIT: + return t('twapLimitOrder'); + + default: + return t('twap'); + } + }, [order, t]); +}; + +export const useTwapApprovalCallback = () => { + const { parsedAmount, currencies, twapSDK } = useTwapContext(); + + return useApproval( + twapSDK.config.twapAddress, + currencies[Field.INPUT], + parsedAmount?.raw.toString(), + ); +}; + +export const useTwapOrdersQuery = () => { + const { account } = useActiveWeb3React(); + const { twapSDK } = useTwapContext(); + const queryClient = useQueryClient(); + const queryKey = useMemo( + () => ['useTwapOrders', account, twapSDK.config.chainId], + [account, twapSDK.config.chainId], + ); + const query = useQuery( + queryKey, + async ({ signal }) => { + return twapSDK.getOrders(account!, signal); + }, + { + enabled: !!account, + }, + ); + const fetchUpdatedOrders = useCallback( + async (id?: number) => { + if (!id) { + query.refetch(); + } else { + try { + const orders = await twapSDK.waitForOrdersUpdate(id, account!); + if (orders) { + queryClient.setQueryData(queryKey, orders); + return orders; + } + } catch (error) { + console.error(error); + return query.data; + } + } + }, + [account, query, queryClient, queryKey, twapSDK], + ); + + return useMemo(() => { + return { + ...query, + fetchUpdatedOrders, + }; + }, [query, fetchUpdatedOrders]); +}; + +export const useGrouppedTwapOrders = () => { + const orders = useTwapOrdersQuery(); + + return useMemo(() => { + if (!orders.data) return; + return groupOrdersByStatus(orders.data); + }, [orders.data]); +}; + +export const useTwapOrderCurrency = (address?: string) => { + const _address = address?.toLowerCase() === zeroAddress ? 'ETH' : address; + const currency = useCurrency(_address); + return currency || undefined; +}; + +export const useFillDelayAsText = (fillDelay?: number) => { + const { t } = useTranslation(); + return useMemo(() => { + if (!fillDelay) return; + + const days = Math.floor(fillDelay / (1000 * 60 * 60 * 24)); + const hours = Math.floor( + (fillDelay % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60), + ); + const minutes = Math.floor((fillDelay % (1000 * 60 * 60)) / (1000 * 60)); + const seconds = Math.floor((fillDelay % (1000 * 60)) / 1000); + + const arr: string[] = []; + + if (days) { + arr.push(`${days} ${t('days')} `); + } + if (hours) { + arr.push(`${hours} ${t('hours')} `); + } + if (minutes) { + arr.push(`${minutes} ${t('minutes')}`); + } + if (seconds) { + arr.push(`${seconds} ${t('seconds')}`); + } + + return arr.join(' '); + }, [fillDelay, t]); +}; + +export const useOptimalRate = () => { + const paraswap = useParaswap(); + const { currencies, maxImpactAllowed } = useTwapContext(); + const { chainId, account } = useActiveWeb3React(); + const chainIdToUse = chainId || ChainId.MATIC; + const inputCurrency = currencies[Field.INPUT]; + const outputCurrency = currencies[Field.OUTPUT]; + + // we always use 1 as the amount for the market price + const srcAmount = tryParseAmount( + chainIdToUse, + '1', + inputCurrency, + )?.raw.toString(); + + const srcToken = inputCurrency + ? getBestTradeCurrencyAddress(inputCurrency, chainIdToUse) + : undefined; + const destToken = outputCurrency + ? getBestTradeCurrencyAddress(outputCurrency, chainIdToUse) + : undefined; + + return useQuery({ + queryKey: [ + 'fetchTwapOptimalRate', + srcToken, + destToken, + srcAmount, + account, + chainId, + maxImpactAllowed, + ], + queryFn: async () => { + if (!srcToken || !destToken || !srcAmount || !account) + return { error: undefined, rate: undefined }; + try { + const rate = await paraswap.getRate({ + srcToken, + destToken, + srcDecimals: inputCurrency?.decimals, + destDecimals: outputCurrency?.decimals, + amount: srcAmount, + side: SwapSide.SELL, + options: { + includeDEXS: 'quickswap,quickswapv3,quickswapv3.1,quickperps', + maxImpact: maxImpactAllowed, + partner: 'quickswapv3', + //@ts-ignore + srcTokenTransferFee: paraswapTaxSell[srcToken.toLowerCase()], + destTokenTransferFee: paraswapTaxBuy[destToken.toLowerCase()], + }, + }); + + return { error: undefined, rate }; + } catch (err) { + return { error: err.message, rate: undefined }; + } + }, + refetchInterval: 5000, + enabled: !!srcToken && !!destToken && !!account, + }); +}; + +export const useTradePrice = () => { + const { isMarketOrder, currencies } = useTwapContext(); + const state = useTwapState(); + const { chainId } = useActiveWeb3React(); + const { data } = useOptimalRate(); + const marketPrice = data?.rate?.destAmount; + + return useMemo(() => { + if (isMarketOrder) return marketPrice; + let result = marketPrice; + if (state.tradePrice !== undefined) { + result = tryParseAmount( + chainId, + state.isTradePriceInverted + ? (1 / Number(state.tradePrice)).toString() + : state.tradePrice, + currencies[Field.OUTPUT], + )?.raw.toString(); + } + return result; + }, [ + state.tradePrice, + chainId, + marketPrice, + state.isTradePriceInverted, + isMarketOrder, + currencies, + ]); +}; + +export const useDerivedTwapSwapData = () => { + const { + isMarketOrder, + isLimitPanel, + parsedAmount, + currencies, + twapSDK, + currentTime, + } = useTwapContext(); + const price = useTradePrice(); + const state = useTwapState(); + const oneSrcTokenUsd = Number( + useUSDCPrice(currencies[Field.INPUT])?.toSignificant() ?? 0, + ); + + const values = twapSDK.derivedSwapValues({ + srcAmount: parsedAmount?.raw.toString(), + price, + customDuration: state.duration, + customChunks: state.chunks, + customFillDelay: state.fillDelay, + isLimitPanel, + oneSrcTokenUsd, + srcDecimals: currencies[Field.INPUT]?.decimals, + destDecimals: currencies[Field.OUTPUT]?.decimals, + isMarketOrder, + }); + const deadline = useMemo(() => { + return twapSDK.orderDeadline(currentTime, values.duration); + }, [currentTime, values.duration, twapSDK]); + + return useMemo(() => { + return { + ...values, + deadline, + }; + }, [values, deadline]); +}; + +export const useInputTitle = () => { + const { isLimitPanel } = useTwapContext(); + const { t } = useTranslation(); + return { + inInputTitle: isLimitPanel ? t('sell') : `${t('allocate')}`, + outInputTitle: isLimitPanel ? t('buy') : `${t('toBuy')}`, + }; +}; diff --git a/src/components/Swap/orbs/consts.ts b/src/components/Swap/orbs/consts.ts new file mode 100644 index 000000000..dbbde9684 --- /dev/null +++ b/src/components/Swap/orbs/consts.ts @@ -0,0 +1,13 @@ +export const SIGNATURE_TIMEOUT = 40_000; +export const SWAP_COUNTDOWN = 59_000; +export const ORBS_WEBSITE = 'https://www.orbs.com'; +export const LIQUIDITY_HUB_WEBSITE = 'https://www.orbs.com/liquidity-hub'; +export const TWAP_WEBSITE = 'https://www.orbs.com/dtwap'; +export const LIMIT_WEBSITE = 'https://www.orbs.com/dlimit'; +export const TWAP_FAQ = 'https://www.orbs.com/dtwap-and-dlimit-faq/'; + +export enum Steps { + WRAP = 1, + APPROVE = 2, + SWAP = 3, +} diff --git a/src/components/Swap/orbs/hooks.ts b/src/components/Swap/orbs/hooks.ts new file mode 100644 index 000000000..b8b7a697e --- /dev/null +++ b/src/components/Swap/orbs/hooks.ts @@ -0,0 +1,81 @@ +import { Currency, currencyEquals, ETHER, WETH } from '@uniswap/sdk'; +import { useActiveWeb3React } from 'hooks'; +import { ApprovalState, useApproveCallback } from 'hooks/useApproveCallback'; +import { useCallback, useMemo } from 'react'; +import { tryParseAmount } from 'state/swap/hooks'; +import { getTokenLogoURL } from 'utils/getTokenLogoURL'; +import { wrappedCurrency } from 'utils/wrappedCurrency'; +import { V3Currency } from 'v3lib/entities/v3Currency'; + +export const useLogo = (currency?: Currency) => { + const getLogo = useGetLogoCallback(); + return useMemo(() => { + return !currency ? undefined : getLogo(currency); + }, [currency, getLogo]); +}; + +export const useGetLogoCallback = () => { + const { chainId } = useActiveWeb3React(); + const isNativeCurrency = useIsNativeCurrencyCallback(); + return useCallback( + (currency?: Currency | null) => { + if (!currency) return undefined; + if (isNativeCurrency(currency)) { + return '/' + currency?.symbol + '.png'; + } + const token = wrappedCurrency(currency, chainId); + if ((token as any).tokenInfo.logoURI) { + return (token as any).tokenInfo.logoURI; + } + const address = token?.address; + if (!address) return undefined; + try { + return getTokenLogoURL(address, []).find((it) => it !== 'error') as any; + } catch (error) {} + }, + [chainId, isNativeCurrency], + ); +}; + +export const useIsNativeCurrencyCallback = () => { + const { chainId } = useActiveWeb3React(); + return useCallback( + (currency?: Currency) => { + if (!chainId || !currency) return false; + const nativeCurrency = ETHER[chainId]; + return ( + currencyEquals(currency, nativeCurrency) || + (currency as V3Currency).isNative + ); + }, + [chainId], + ); +}; + +export const useApproval = ( + spender?: string, + inCurrency?: Currency, + amount?: string, +) => { + const { chainId } = useActiveWeb3React(); + const isNative = useIsNativeCurrencyCallback(); + + const approvalAmount = useMemo(() => { + return tryParseAmount( + chainId, + amount, + isNative(inCurrency) ? WETH[chainId] : inCurrency, + ); + }, [chainId, amount, inCurrency, isNative]); + + const [approvalState, approve] = useApproveCallback(approvalAmount, spender); + + return { + approve, + approvalState, + isApproved: approvalState === ApprovalState.APPROVED, + isPending: + approvalState === ApprovalState.PENDING || + approvalState === ApprovalState.UNKNOWN, + }; +}; diff --git a/src/components/Swap/orbs/utils.ts b/src/components/Swap/orbs/utils.ts new file mode 100644 index 000000000..43b6b188d --- /dev/null +++ b/src/components/Swap/orbs/utils.ts @@ -0,0 +1,72 @@ +import { Currency, JSBI } from '@uniswap/sdk'; +import { + CurrencyAmount as CurrencyAmountV3, + Currency as CurrencyV3, +} from '@uniswap/sdk-core'; +import { Quote, QUOTE_ERRORS } from '@orbs-network/liquidity-hub-sdk'; +import { OptimalRate } from '@paraswap/sdk'; +import BN from 'bignumber.js'; +import { BigNumber } from 'ethers'; + +export const getAmountMinusSlippage = ( + allowedSlippage: number, + outAmount?: string, +) => { + if (!outAmount) return undefined; + + return BigNumber.from(outAmount) + .mul(BigNumber.from(10000 - Number(allowedSlippage.toFixed(0)))) + .div(BigNumber.from(10000)) + .toString(); +}; + +export async function promiseWithTimeout( + promise: Promise, + timeout: number, +): Promise { + let timer: any; + + const timeoutPromise = new Promise((_, reject) => { + timer = setTimeout(() => { + reject(new Error('timeout')); + }, timeout); + }); + + try { + const result = await Promise.race([promise, timeoutPromise]); + clearTimeout(timer); + return result; + } catch (error) { + clearTimeout(timer); + throw error; + } +} + +export const fromRawAmount = (currency?: Currency, amount?: string) => { + if (!currency || !amount) return undefined; + return CurrencyAmountV3.fromRawAmount( + currency as CurrencyV3, + JSBI.BigInt(amount), + ); +}; + +export const isRejectedError = (error: any) => { + const message = error.message?.toLowerCase(); + return message?.includes('rejected') || message?.includes('denied'); +}; + +export const isTimeoutError = (error: any) => { + const message = error.message?.toLowerCase(); + return message?.includes('timeout'); +}; + +export const makeElipsisAddress = (address?: string, padding = 6): string => { + if (!address) return ''; + return `${address.substring(0, padding)}...${address.substring( + address.length - padding, + )}`; +}; + +export const isLowInAmountError = (error: any) => { + return (error as Error)?.message === QUOTE_ERRORS.ldv; +}; diff --git a/src/components/TransactionConfirmationModal/TransactionConfirmationModal.tsx b/src/components/TransactionConfirmationModal/TransactionConfirmationModal.tsx index 8204c55a9..0e43277d7 100755 --- a/src/components/TransactionConfirmationModal/TransactionConfirmationModal.tsx +++ b/src/components/TransactionConfirmationModal/TransactionConfirmationModal.tsx @@ -12,11 +12,6 @@ import SpinnerImage from '../../assets/images/spinner.svg'; import 'components/styles/TransactionConfirmationModal.scss'; import { useTranslation } from 'react-i18next'; import { CheckCircleOutline } from '@material-ui/icons'; -import { - LiquidityHubConfirmationModalContent, - useConfirmationPendingContent, -} from 'components/Swap/LiquidityHub'; -import { useLiquidityHubState } from 'state/swap/liquidity-hub/hooks'; interface ConfirmationPendingContentProps { onDismiss: () => void; @@ -27,8 +22,7 @@ export const ConfirmationPendingContent: React.FC { - const confirmationPendingContent = useConfirmationPendingContent(pendingText); - + const { t } = useTranslation(); return ( @@ -38,11 +32,9 @@ export const ConfirmationPendingContent: React.FC Spinner -
{confirmationPendingContent.title}
- {confirmationPendingContent.pending && ( -

{confirmationPendingContent.pending}

- )} -

{confirmationPendingContent.confirm || ''}

+
{t('waitingConfirm')}
+ {pendingText &&

{pendingText}

} +

{t('confirmTxinWallet')}

); @@ -77,7 +69,6 @@ export const TransactionSubmittedContent: React.FC {!txPending && } {modalContent} -

diff --git a/src/components/styles/orbs/ConfirmationModal.scss b/src/components/styles/orbs/ConfirmationModal.scss new file mode 100644 index 000000000..8659256fa --- /dev/null +++ b/src/components/styles/orbs/ConfirmationModal.scss @@ -0,0 +1,56 @@ +@use 'styles/variables' as *; + + +.orbsErrorContent { + width: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + &Text{ + margin-top: 20px; + font-size: 18px; + margin-bottom: 20px; + } + .txSubmitButton { + width: 100%; + } + &Buttons { + margin-top: 30px; + width: 100%; + display: flex; + gap: 20px; + width: 100%; + } +} + + +.orbsTxModalContent { + margin-top: 20px; + padding: 16px 0; + padding-bottom: 0px; + color: $textPrimary; + text-align: center; + & .orbs_StepsStepLogo { + border: 7px solid #1b1e29; + + } +} + +.orbsModalWrapper { + max-width: 500px; +} + +.orbsSuccessContentButtons { + display: flex; + justify-content: space-between; + gap: 20px; + width: 100%; + .txSubmitButton { + width: 100%; + } + &Link { + width: 100%; + text-decoration: none; + } +} diff --git a/src/components/styles/orbs/Twap.scss b/src/components/styles/orbs/Twap.scss new file mode 100644 index 000000000..5306d99e4 --- /dev/null +++ b/src/components/styles/orbs/Twap.scss @@ -0,0 +1,592 @@ +@use 'styles/variables' as *; +@use 'styles/breakpoints' as *; + +.TwapOrdersModalWrapper { + max-width: 600px; +} + +.TwapLimitPanelInput { + width: 100%; + input { + height: 100%; + width: unset; + flex: 1; + padding-left: 8px; + } +} + +.TwapSwitch { + width: 100%; + padding: 5px; + border-radius: 10px; + background: #1f263d; + display: flex; + margin-bottom: 2px; + margin-left: auto; + gap: 5px; + &Button { + color: white; + min-width: 80px; + text-align: center; + font-size: 14px; + border-radius: 8px; + padding: 10px 4px; + height: 100%; + width: 50%; + transition: 0.2s all; + &Selected { + background: #141827; + } + &:hover { + background: #141827; + } + } +} +.TwapLimitPanelHeader { + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 10px; + &Label { + display: flex; + align-items: center; + justify-content: flex-start; + color: white; + font-size: 14px; + .currencyLogo { + margin-left: 5px; + margin-right: 5px; + } + } + &Invert { + padding: 6px; + border-radius: 50%; + display: flex; + justify-content: center; + align-items: center; + transition: 0.2s all; + svg { + width: 23px; + height: 23px; + } + &:hover { + background: rgba(255, 255, 255, 0.08); + } + } +} +.TwapLimitPanel { + margin-bottom: 2px; + position: relative; + &Input { + flex: 1; + } + &Header { + position: relative; + &Invert { + position: absolute; + top: -10px; + right: -5px; + } + } + &Percent { + margin-top: 20px; + display: flex; + justify-content: flex-end; + gap: 6px; + .TwapSelectorButton { + padding: 2px 10px; + } + } +} +.TwapLimitPanelPercentReset { + display: flex; + gap: 2px; + + .TwapSelectorButton { + &:first-child { + border-top-right-radius: 0px; + border-bottom-right-radius: 0px; + } + &:last-child { + border-top-left-radius: 0px; + border-bottom-left-radius: 0px; + padding: 2px 5px; + } + .MuiSvgIcon-root { + width: 16px; + height: 16px; + } + } +} + +.TwapCardInput { + border-radius: 10px; + padding: 8px 16px; + flex: 1; + display: flex; + justify-content: space-between; + align-items: center; +} + +.TwapCard { + border-radius: 16px; + flex: 1; + display: flex; + padding: 16px; + flex-direction: column; + gap: 16px; + &Title { + p { + font-size: 13px; + margin-right: 7px; + color: #fff; + } + small { + font-size: 12px; + color: $textHint; + } + } +} + +.TwapFillDelaySelect { + border-top-right-radius: 0px; + border-bottom-right-radius: 0px; +} + +.TwapChunkSelect { + border-top-left-radius: 0px; + border-bottom-left-radius: 0px; + .TwapInputContent { + display: flex; + align-items: center; + justify-content: space-between; + width: 100%; + } + &Text { + color: $textHint; + font-size: 15px; + } +} + +.TwapChunkSize { + font-size: 13px; + margin-top: 5px; + color: white; + small { + font-size: 12px; + color: $textHint; + } +} +.TwapPriceWarning { + margin-top: 10px; + &Content { + display: flex; + align-items: flex-start; + gap: 7px; + p { + font-size: 14px; + flex: 1; + } + svg { + width: 17px; + height: 17px; + position: relative; + top: 3px; + } + } + a { + text-decoration: underline; + } +} + +.TwapShowOrdersButton { + display: flex; + justify-content: space-between; + align-items: center; + flex-direction: row; + cursor: pointer; + height: 50px; + margin-top: 10px; + span { + font-size: 14px; + margin-bottom: 0px; + } +} + +.TwapResolutionButton { + text-transform: capitalize; + color: white; + display: flex; + gap: 0px; + align-items: center; + p { + font-size: 13px; + } +} + +.TwapInputs { + display: flex; + flex-direction: column; + gap: 5px; + margin-top: 2px; +} + +.TwapChunkSelectText { + color: white; + font-size: 13px; +} + +.TwapSelectorButton { + font-size: 14px; + border: 1px solid rgba(255, 255, 255, 0.08); + border-radius: 10px; + padding: 4px 10px; + &Selected { + border: 1px solid transparent; + background-image: linear-gradient(to bottom, #141827, #141827); + mix-blend-mode: screen; + background-blend-mode: screen; + } + &:hover { + border: 1px solid transparent; + background-image: linear-gradient(to bottom, #141827, #141827); + mix-blend-mode: screen; + background-blend-mode: screen; + } +} + +.orbs_PoweredBy { + margin-top: 20px; + span { + font-size: 15px; + } +} +.TwapDurationSelect { + display: flex; + justify-content: space-between; + align-items: center; + &Content { + display: flex; + width: 100%; + justify-content: space-between; + align-items: center; + } + + .TwapSelectorButton { + span { + text-transform: capitalize; + } + } + .TwapCardTitle { + margin-bottom: 0px; + } + + &Buttons { + justify-content: flex-end; + flex: 1; + + display: flex; + gap: 5px; + } +} +.TwapConfirmationPrice { + display: flex; + flex-direction: column; + gap: 5px; + &Warning { + font-size: 14px; + line-height: 18px; + color: $textHint; + text-align: left; + svg { + margin-right: 5px; + width: 15px; + height: 15px; + } + } + a { + text-decoration: underline; + } +} +.TwapOrderDetails { + display: flex; + flex-direction: column; + gap: 8px; + width: 100%; + margin-top: 20px; + margin-bottom: 10px; + padding-top: 20px; + border-top: 1px solid rgba(130, 177, 255, 0.12); + .TwapPriceWarning { + padding: 10px; + gap: 5px; + margin-bottom: 6px; + p { + text-align: left; + font-size: 13px; + } + svg { + display: none; + } + } +} +.orbs_MainTokenLeft { + gap: 4px; +} + +.TwapFillDelayAndChunks { + font-size: 13px; + text-align: left; + color: $textHint; + width: 100%; + margin-top: 7px; +} + +.TwapInputMarketOrder { + .inputWrapper { + display: none; + } + .currencyButton { + width: 100%; + } + .bg-input1 { + background: transparent; + padding: 0px; + } +} +.TwapOrderDetailsRow { + display: flex; + justify-content: space-between; + align-items: center; + &Left { + display: flex; + gap: 5px; + } + &Value { + font-size: 13px; + } + &Label { + font-size: 13px; + font-weight: 600; + color: $textSecondary; + color: white; + } + small { + color: $textHint; + font-size: 13px; + } +} + +.TwapOrderMenu { + &Item { + text-transform: capitalize; + } + &Button { + width: fit-content; + display: flex; + padding: 8px 20px; + margin: 0; + background: #1f263d; + border-radius: 10px; + color: white; + text-transform: capitalize; + + p { + font-size: 14px; + } + } +} + +.TwapOrderTitle { + font-size: 14px; + small { + font-size: 13px; + color: white; + opacity: 0.8; + } +} +.TwapSelectedOrderAccordions { + display: flex; + flex-direction: column; + gap: 20px; +} + +.TwapSelectedOrderAccordion { + border-radius: 12px !important; + &.Mui-expanded { + margin: 0 !important; + } + + .MuiAccordionDetails-root { + display: flex; + flex-direction: column; + gap: 8px; + } + + .MuiAccordionSummary-expandIcon { + color: $textSecondary; + } + .MuiAccordionSummary-root.Mui-expanded { + min-height: 48px; + } + .MuiAccordionSummary-content.Mui-expanded { + margin: 0px 0; + min-height: auto; + } +} + +.TwapSelectedOrder { + padding: 24px 24px 0; + padding-bottom: 30px; + max-height: 80vh; + height: auto; + width: 100%; + border-radius: 20px; + display: flex; + flex-direction: column; + background: $bgColor; + backdrop-filter: blur(9.9px); + border: 1px solid $grey2; + overflow-y: auto; +} + +.TwapSelectedOrderBody { + flex: 1; + overflow-y: auto; + display: flex; + flex-direction: column; + -webkit-overflow-scrolling: touch; /* For smooth scrolling on touch devices */ + scrollbar-width: none; /* For Firefox */ + -ms-overflow-style: none; /* For Internet Explorer and Edge */ + &::-webkit-scrollbar { + display: none; /* For Chrome, Safari, and Edge */ + } +} + +.TwapSelectedOrderCurrencies { + display: flex; + flex-direction: column; + gap: 20px; + margin-bottom: 30px; + & .TwapSelectedOrderCurrency { + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; + &Left { + display: flex; + flex-direction: column; + gap: 5px; + } + &Symbol { + font-weight: 600; + font-size: 18px; + } + &Label { + font-size: 15px; + } + } +} + +.TwapOrdersList { + padding: 24px 24px 0; + padding-bottom: 20px; + height: 80vh; + border-radius: 20px; + display: flex; + flex-direction: column; + background: $bgColor; + backdrop-filter: blur(9.9px); + border: 1px solid $grey2; + overflow: hidden; + &Empty { + text-align: center; + width: 100%; + margin-top: 40px; + font-size: 18px; + } + + @include media('screen', ' { - liquidityHubAnalytics.onDexSwapRequest(); const estimatedCalls: EstimatedSwapCall[] = await Promise.all( swapCalls.map((call) => { const { @@ -278,7 +276,6 @@ export function useSwapCallback( : { from: account }), }) .then((response: TransactionResponse) => { - liquidityHubAnalytics.onDexSwapSuccess(response.hash); const inputSymbol = trade.inputAmount.currency.symbol; const outputSymbol = trade.outputAmount.currency.symbol; const inputAmount = formatTokenAmount(trade.inputAmount); @@ -307,7 +304,6 @@ export function useSwapCallback( return { response, summary: withVersion }; }) .catch((error: any) => { - liquidityHubAnalytics.onDexSwapFailed(error.message); // if the user rejected the tx, pass this along if (error?.code === 'ACTION_REJECTED') { throw new Error('Transaction rejected.'); diff --git a/src/hooks/v3/useSwapCallback.ts b/src/hooks/v3/useSwapCallback.ts index b7ec13ada..76b301f3f 100644 --- a/src/hooks/v3/useSwapCallback.ts +++ b/src/hooks/v3/useSwapCallback.ts @@ -15,7 +15,6 @@ import { SwapRouter } from 'lib/src/swapRouter'; import useTransactionDeadline from 'hooks/useTransactionDeadline'; import { getTradeVersion } from 'utils/v3/getTradeVersion'; import { useTransactionAdder } from 'state/transactions/hooks'; -import { liquidityHubAnalytics } from 'components/Swap/LiquidityHub'; import { TransactionType } from 'models/enums'; enum SwapCallbackState { @@ -266,7 +265,6 @@ export function useSwapCallback( response: TransactionResponse; summary: string; }> { - liquidityHubAnalytics.onDexSwapRequest(); const estimatedCalls: SwapCallEstimate[] = await Promise.all( swapCalls.map((call) => { const { address, calldata, value } = call; @@ -356,7 +354,6 @@ export function useSwapCallback( ...(value && !isZero(value) ? { value } : {}), }) .then((response) => { - liquidityHubAnalytics.onDexSwapSuccess(response.hash); const inputSymbol = trade.inputAmount.currency.symbol; const outputSymbol = trade.outputAmount.currency.symbol; const inputAmount = trade.inputAmount.toSignificant(4); @@ -387,7 +384,6 @@ export function useSwapCallback( return { response, summary: withVersion }; }) .catch((error) => { - liquidityHubAnalytics.onDexSwapFailed(error.message); // if the user rejected the tx, pass this along if (error?.code === 'ACTION_REJECTED') { throw new Error('Transaction rejected.'); diff --git a/src/layouts/PageLayout.tsx b/src/layouts/PageLayout.tsx index f23756b6b..89eb3ac14 100755 --- a/src/layouts/PageLayout.tsx +++ b/src/layouts/PageLayout.tsx @@ -127,8 +127,8 @@ const PageLayout: React.FC = ({ children, name }) => { const displayNewsletter = false; return ( - - {openPassModal && } + + {/* {openPassModal && } */} {showBetaBanner && } {displayNewsletter && }
{data.map((row) => ( - + {row.date} {row.price.toFixed(3)} @@ -112,7 +112,7 @@ export const HistoricalTable: React.FC<{ > {row.change.toFixed(2)}% - + ))} @@ -121,3 +121,9 @@ export const HistoricalTable: React.FC<{ ); }; + +const StyledTableRow = styled(TableRow)({ + '&:last-child td, &:last-child th': { + border: 0, + }, +}); diff --git a/src/pages/PerpsPage/Pairs.tsx b/src/pages/PerpsPage/Pairs.tsx index 052d2c32e..c297d95ee 100644 --- a/src/pages/PerpsPage/Pairs.tsx +++ b/src/pages/PerpsPage/Pairs.tsx @@ -4,13 +4,12 @@ import { OrderSide, OrderStatus, OrderType } from '@orderly.network/types'; import { FC } from 'react'; import { AppBar, - Toolbar, - Typography, + Box, MenuItem, Select, - SelectChangeEvent, - Box, -} from '@mui/material'; + Toolbar, + Typography, +} from '@material-ui/core'; interface Ticker { symbol: string; @@ -60,7 +59,7 @@ export const Pairs: FC = () => { tickers[0].symbol, ); - const handleChange = (event: SelectChangeEvent) => { + const handleChange = (event: any) => { setSelectedSymbol(event.target.value as string); }; @@ -75,7 +74,7 @@ export const Pairs: FC = () => {