From fde61fc0b4ee0806894f1791802e8b72413677ff Mon Sep 17 00:00:00 2001 From: zielvna Date: Wed, 18 Sep 2024 14:25:07 +0200 Subject: [PATCH 1/3] bump sdk version --- package-lock.json | 277 ++++++++++++++++++++++++++++++++++++++++++---- package.json | 2 +- 2 files changed, 255 insertions(+), 24 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7956f210..50f6b89e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@emotion/react": "^11.11.4", "@emotion/styled": "^11.11.5", - "@invariant-labs/a0-sdk": "^0.2.20", + "@invariant-labs/a0-sdk": "^0.2.24", "@mui/icons-material": "^5.15.15", "@mui/material": "^5.15.15", "@nightlylabs/wallet-selector-polkadot": "^0.2.5", @@ -2540,20 +2540,23 @@ "license": "BSD-3-Clause" }, "node_modules/@invariant-labs/a0-sdk": { - "version": "0.2.20", - "resolved": "https://registry.npmjs.org/@invariant-labs/a0-sdk/-/a0-sdk-0.2.20.tgz", - "integrity": "sha512-LhvkqW7PXX5X7UiAXGxpN0DrEFgXGN0XElDm8lT/x8p4DWzdqvkdl9e0u0rAq7D0kbjmHx5EpjnGER9rvjHYww==", + "version": "0.2.24", + "resolved": "https://registry.npmjs.org/@invariant-labs/a0-sdk/-/a0-sdk-0.2.24.tgz", + "integrity": "sha512-VpTlKFh5NE/4H6R4FlU0R4LImGCwMvV+EdnrersqT56piH5IhL8i0ZW7kWuCb+k8WgftbUCQlOAxLvrzLmm24Q==", "dependencies": { - "@invariant-labs/a0-sdk-wasm": "^0.1.23", + "@invariant-labs/a0-sdk-wasm": "0.1.26", "@polkadot/api": "^10.12.4", "@polkadot/api-contract": "^10.12.4", "@scio-labs/use-inkathon": "^0.6.3", + "mocha": "^10.7.3", "ts-node": "^10.9.2", "typescript": "^5.3.3" } }, "node_modules/@invariant-labs/a0-sdk-wasm": { - "version": "0.1.23" + "version": "0.1.26", + "resolved": "https://registry.npmjs.org/@invariant-labs/a0-sdk-wasm/-/a0-sdk-wasm-0.1.26.tgz", + "integrity": "sha512-Y2OjXpKzrqpBbkgUyVLQvDoNyOsa5AsadGRUJVOVsesZ8771W3CEURrJTrZyh8HtMZEeVUUtA30dU8+YppsTNw==" }, "node_modules/@isaacs/cliui": { "version": "8.0.2", @@ -9713,6 +9716,14 @@ "license": "MIT", "peer": true }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "engines": { + "node": ">=6" + } + }, "node_modules/ansi-fragments": { "version": "0.2.1", "license": "MIT", @@ -9793,7 +9804,6 @@ }, "node_modules/argparse": { "version": "2.0.1", - "dev": true, "license": "Python-2.0" }, "node_modules/aria-hidden": { @@ -10175,6 +10185,11 @@ "version": "1.2.1", "dev": true }, + "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==" + }, "node_modules/browserify-zlib": { "version": "0.1.4", "dev": true, @@ -10322,7 +10337,6 @@ "node_modules/camelcase": { "version": "6.3.0", "license": "MIT", - "peer": true, "engines": { "node": ">=10" }, @@ -11079,10 +11093,11 @@ "peer": true }, "node_modules/debug": { - "version": "4.3.4", - "license": "MIT", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -12514,6 +12529,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "bin": { + "flat": "cli.js" + } + }, "node_modules/flat-cache": { "version": "3.2.0", "dev": true, @@ -12715,7 +12738,6 @@ "node_modules/get-caller-file": { "version": "2.0.5", "license": "ISC", - "peer": true, "engines": { "node": "6.* || 8.* || >= 10.*" } @@ -13077,6 +13099,14 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "bin": { + "he": "bin/he" + } + }, "node_modules/hermes-estree": { "version": "0.19.1", "license": "MIT", @@ -13544,6 +13574,14 @@ "node": ">=8" } }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "engines": { + "node": ">=8" + } + }, "node_modules/is-plain-object": { "version": "5.0.0", "dev": true, @@ -13934,7 +13972,6 @@ }, "node_modules/js-yaml": { "version": "4.1.0", - "dev": true, "license": "MIT", "dependencies": { "argparse": "^2.0.1" @@ -15094,6 +15131,161 @@ "ufo": "^1.3.2" } }, + "node_modules/mocha": { + "version": "10.7.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.7.3.tgz", + "integrity": "sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A==", + "dependencies": { + "ansi-colors": "^4.1.3", + "browser-stdout": "^1.3.1", + "chokidar": "^3.5.3", + "debug": "^4.3.5", + "diff": "^5.2.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^8.1.0", + "he": "^1.2.0", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^5.1.6", + "ms": "^2.1.3", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^6.5.1", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.9", + "yargs-unparser": "^2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/mocha/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/mocha/node_modules/diff": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/mocha/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/mocha/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "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/mocha/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mocha/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "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==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/mocha/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/mocha/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mocha/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "engines": { + "node": ">=10" + } + }, "node_modules/mock-socket": { "version": "9.3.1", "license": "MIT", @@ -15102,8 +15294,9 @@ } }, "node_modules/ms": { - "version": "2.1.2", - "license": "MIT" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/mz": { "version": "2.7.0", @@ -16183,6 +16376,14 @@ "url": "https://opencollective.com/ramda" } }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, "node_modules/range-parser": { "version": "1.2.1", "license": "MIT", @@ -17079,7 +17280,6 @@ "node_modules/require-directory": { "version": "2.1.1", "license": "MIT", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -17342,11 +17542,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, - "node_modules/send/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==" - }, "node_modules/serialize-error": { "version": "2.1.0", "license": "MIT", @@ -17355,6 +17550,14 @@ "node": ">=0.10.0" } }, + "node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dependencies": { + "randombytes": "^2.1.0" + } + }, "node_modules/serve-static": { "version": "1.16.2", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", @@ -17882,7 +18085,6 @@ }, "node_modules/strip-json-comments": { "version": "3.1.1", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -19195,6 +19397,11 @@ "dev": true, "license": "MIT" }, + "node_modules/workerpool": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", + "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==" + }, "node_modules/wrap-ansi": { "version": "8.1.0", "license": "MIT", @@ -19317,7 +19524,6 @@ "node_modules/y18n": { "version": "5.0.8", "license": "ISC", - "peer": true, "engines": { "node": ">=10" } @@ -19358,6 +19564,31 @@ "node": ">=12" } }, + "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==", + "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/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/yargs/node_modules/emoji-regex": { "version": "8.0.0", "license": "MIT", diff --git a/package.json b/package.json index a70470ac..e4239632 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "dependencies": { "@emotion/react": "^11.11.4", "@emotion/styled": "^11.11.5", - "@invariant-labs/a0-sdk": "^0.2.20", + "@invariant-labs/a0-sdk": "^0.2.24", "@mui/icons-material": "^5.15.15", "@mui/material": "^5.15.15", "@nightlylabs/wallet-selector-polkadot": "^0.2.5", From b6b8d36709f2247997baef024f296794e6eebec7 Mon Sep 17 00:00:00 2001 From: zielvna Date: Wed, 18 Sep 2024 14:27:36 +0200 Subject: [PATCH 2/3] fix build --- src/store/consts/static.ts | 3 ++- src/store/sagas/swap.ts | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/store/consts/static.ts b/src/store/consts/static.ts index 572e4938..742e1b88 100644 --- a/src/store/consts/static.ts +++ b/src/store/consts/static.ts @@ -335,7 +335,8 @@ export const EMPTY_POSITION: Position = { lastBlockNumber: 0n, tokensOwedX: 0n, tokensOwedY: 0n, - createdAt: 0n + createdAt: 0n, + secondsPerLiquidityInside: 0n } export const POSITIONS_PER_QUERY = diff --git a/src/store/sagas/swap.ts b/src/store/sagas/swap.ts index 16aa59ab..86b0cea2 100644 --- a/src/store/sagas/swap.ts +++ b/src/store/sagas/swap.ts @@ -310,10 +310,10 @@ export function* handleGetSimulateResult(action: PayloadAction) { continue } - if (result.maxTicksCrossed) { - errors.push(SwapError.MaxTicksCrossed) - continue - } + // if (result.maxTicksCrossed) { + // errors.push(SwapError.MaxTicksCrossed) + // continue + // } if (result.stateOutdated) { errors.push(SwapError.StateOutdated) From dae9f06e98be80c8edb6060abd6d6014fa02c073 Mon Sep 17 00:00:00 2001 From: zielvna Date: Wed, 18 Sep 2024 17:30:12 +0200 Subject: [PATCH 3/3] update mock eth decimal --- src/store/consts/static.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/store/consts/static.ts b/src/store/consts/static.ts index 8fa70fe5..f0eaffe7 100644 --- a/src/store/consts/static.ts +++ b/src/store/consts/static.ts @@ -68,7 +68,7 @@ export const TESTNET_BTC: Token = { export const TESTNET_ETH: Token = { symbol: 'ETH', address: ETH_ADDRESS[Network.Testnet], - decimals: 12n, + decimals: 18n, name: 'Ether', logoURI: 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/2FPyTwcZLUg1MDrwsyoP4D6s1tM7hAkHYRjkNb5w6Pxk/logo.png', @@ -107,7 +107,7 @@ export const MAINNET_BTC: Token = { export const MAINNET_ETH: Token = { symbol: 'ETH', address: ETH_ADDRESS[Network.Mainnet], - decimals: 12n, + decimals: 18n, name: 'Ether', logoURI: 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/2FPyTwcZLUg1MDrwsyoP4D6s1tM7hAkHYRjkNb5w6Pxk/logo.png',