From 9b87fda9660fcfed18d3d081e5d53559ac3c849f Mon Sep 17 00:00:00 2001 From: Linkie Link Date: Sun, 5 May 2024 19:46:56 +0200 Subject: [PATCH 1/9] feat: changed the name of MetaMask option --- public/images/wallets/metamask.png | Bin 0 -> 4589 bytes src/constants/wallets.ts | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 public/images/wallets/metamask.png diff --git a/public/images/wallets/metamask.png b/public/images/wallets/metamask.png new file mode 100644 index 0000000000000000000000000000000000000000..2492ddfbd566787c3793701b766ddc04e6e196db GIT binary patch literal 4589 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 Date: Mon, 13 May 2024 03:44:46 +0000 Subject: [PATCH 2/9] Build(deps): bump @keplr-wallet/cosmos from 0.12.84 to 0.12.88 Bumps @keplr-wallet/cosmos from 0.12.84 to 0.12.88. --- updated-dependencies: - dependency-name: "@keplr-wallet/cosmos" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 95 ++++++++++++++++++++++++++++++---------------------- 2 files changed, 56 insertions(+), 41 deletions(-) diff --git a/package.json b/package.json index 5ed83e7f4..0a62fa48a 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.3", "@delphi-labs/shuttle-react": "^3.22.0", - "@keplr-wallet/cosmos": "^0.12.82", + "@keplr-wallet/cosmos": "^0.12.88", "@tailwindcss/container-queries": "^0.1.1", "@tanstack/react-table": "^8.16.0", "@tippyjs/react": "^4.2.6", diff --git a/yarn.lock b/yarn.lock index 7849ec02b..a1cd130cc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2287,37 +2287,37 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" -"@keplr-wallet/common@0.12.84": - version "0.12.84" - resolved "https://registry.yarnpkg.com/@keplr-wallet/common/-/common-0.12.84.tgz#3f1cb3729f764a1eff66406c0226ad010605eae0" - integrity sha512-VV/RnZlpPyx9+CJzy87nPNP74+thvSYSM7olyTWFdakq9o8tXUvvB1KT5e8U7oILKpuERcILoRHzxApzl4SCTA== +"@keplr-wallet/common@0.12.88": + version "0.12.88" + resolved "https://registry.yarnpkg.com/@keplr-wallet/common/-/common-0.12.88.tgz#28fed11918a08a21e110d32415d823b9d06bc817" + integrity sha512-4rrUJnXgOPHAosfKd6k5PNbZEpy5BOdJCl2E2Dkr+mAkxODLBm6t4YngOGoPgR977+EDIOSVUgUJTIyXtVbqhw== dependencies: - "@keplr-wallet/crypto" "0.12.84" - "@keplr-wallet/types" "0.12.84" + "@keplr-wallet/crypto" "0.12.88" + "@keplr-wallet/types" "0.12.88" buffer "^6.0.3" delay "^4.4.0" -"@keplr-wallet/cosmos@^0.12.82": - version "0.12.84" - resolved "https://registry.yarnpkg.com/@keplr-wallet/cosmos/-/cosmos-0.12.84.tgz#844f495ef9115c75a6765ea8623378f2edaf7a35" - integrity sha512-1e+YLDsbWXXJ1MTTmEJkf3z75D43WUPCgkGrdu6YB4wn+oDZYyUZ7/JC49JJzEuUY2ZTFkWPW+hfnxi2Ta2Exw== +"@keplr-wallet/cosmos@^0.12.88": + version "0.12.88" + resolved "https://registry.yarnpkg.com/@keplr-wallet/cosmos/-/cosmos-0.12.88.tgz#beff631804bb31f0ea8257a0ae0e51e501211ebd" + integrity sha512-v/7+xIOGot78qgK1KJXplzC6Nkr/Bix/cdugYPm4gddp6BA1PolH9nCYHkYYrxHuQKeIuJGJq5aCbfTTnpDxRg== dependencies: "@ethersproject/address" "^5.6.0" - "@keplr-wallet/common" "0.12.84" - "@keplr-wallet/crypto" "0.12.84" - "@keplr-wallet/proto-types" "0.12.84" - "@keplr-wallet/simple-fetch" "0.12.84" - "@keplr-wallet/types" "0.12.84" - "@keplr-wallet/unit" "0.12.84" + "@keplr-wallet/common" "0.12.88" + "@keplr-wallet/crypto" "0.12.88" + "@keplr-wallet/proto-types" "0.12.88" + "@keplr-wallet/simple-fetch" "0.12.88" + "@keplr-wallet/types" "0.12.88" + "@keplr-wallet/unit" "0.12.88" bech32 "^1.1.4" buffer "^6.0.3" long "^4.0.0" protobufjs "^6.11.2" -"@keplr-wallet/crypto@0.12.84": - version "0.12.84" - resolved "https://registry.yarnpkg.com/@keplr-wallet/crypto/-/crypto-0.12.84.tgz#1edb5603da684b8e65b57ebf8bbf7c325ec7bec6" - integrity sha512-3mFkAE8/HRr96b5k3wPHyHZB36k+t2QowWZWmv1ll3PUyBbBch3oeYq3137veDlwi8HFazAS5ek0DyWyO9uHBQ== +"@keplr-wallet/crypto@0.12.88": + version "0.12.88" + resolved "https://registry.yarnpkg.com/@keplr-wallet/crypto/-/crypto-0.12.88.tgz#7921cda5acb000a8700a063234e3840da5498a00" + integrity sha512-xiXOCoAIh8c+dT1/cKc1fskOcdAoptIO9yTefc9rQ1/apj89hOygdIP03p3qqWIgjMV4yqtQq86MrETySE2v/Q== dependencies: "@ethersproject/keccak256" "^5.5.0" bip32 "^2.0.6" @@ -2328,32 +2328,32 @@ elliptic "^6.5.3" sha.js "^2.4.11" -"@keplr-wallet/proto-types@0.12.84": - version "0.12.84" - resolved "https://registry.yarnpkg.com/@keplr-wallet/proto-types/-/proto-types-0.12.84.tgz#0098ccbd0dd58799bbf150f692ef25c92e686e9d" - integrity sha512-5sZyrs4mz5UG0OfRX3UrNHyXrwwfPpnM2EWRSx5ff7UJIIcqMLRcXptHNlYI2aHwSFGpmMnz9wDhOYmfIvbPkQ== +"@keplr-wallet/proto-types@0.12.88": + version "0.12.88" + resolved "https://registry.yarnpkg.com/@keplr-wallet/proto-types/-/proto-types-0.12.88.tgz#b04ef7b8954df9eedec8ce61f72de78c91ddcaec" + integrity sha512-ej3vzS//2/TsTSi1vVLhp7o+f1XRjFhMGMKCaEYkOYY7vdpOkAri8T73amm5qjNDcrqYnjRQZKW9TqV8DCVSvQ== dependencies: long "^4.0.0" protobufjs "^6.11.2" -"@keplr-wallet/simple-fetch@0.12.84": - version "0.12.84" - resolved "https://registry.yarnpkg.com/@keplr-wallet/simple-fetch/-/simple-fetch-0.12.84.tgz#9ada7bf3ee5c09e412c0913de1328a3a1fcb0c8c" - integrity sha512-i7G9J0/JoT6O9HytneqjNd08N554xZUClD8WxWTTzND7O9QodJT9fee/YRQv2sjxz4jtY1nERAgCsTj0ADLmUw== +"@keplr-wallet/simple-fetch@0.12.88": + version "0.12.88" + resolved "https://registry.yarnpkg.com/@keplr-wallet/simple-fetch/-/simple-fetch-0.12.88.tgz#3946b7a2d1d10eed1179b113248de1aba1f7ddda" + integrity sha512-cwXX6fHOtVAprzN1b4N2vYtmVjCevoRoNl4s0lOcb9LhcKtbRKcVH/6BBKP6FvEPL7x0mmwQ5z3uQ50wQSOv5w== -"@keplr-wallet/types@0.12.84": - version "0.12.84" - resolved "https://registry.yarnpkg.com/@keplr-wallet/types/-/types-0.12.84.tgz#c55be5e3819980f3f7dd12306109859b8dda8506" - integrity sha512-dH7bc5V5WWR7DWHG8tq3hIFx8LWLQBVwxypVfvjQubW7wEu+Lh4Usp93up8lHRkYSh2TzZ6GEupimkILoSHloQ== +"@keplr-wallet/types@0.12.88": + version "0.12.88" + resolved "https://registry.yarnpkg.com/@keplr-wallet/types/-/types-0.12.88.tgz#a9534483ce1e7e4e854b4569562b55336c780de1" + integrity sha512-OKLQO2DSzoPfxnZ/iy3TdOfjoYARN78eZy2qQEKNNpPaX6PJ14dKYD9+49ducakDrx8h9641jIV7y1NLgjWruw== dependencies: long "^4.0.0" -"@keplr-wallet/unit@0.12.84": - version "0.12.84" - resolved "https://registry.yarnpkg.com/@keplr-wallet/unit/-/unit-0.12.84.tgz#ae958b6ff5bcd2299f45f726d0fcb07f00194ca3" - integrity sha512-JaY4unMK0DuqcrH+pEE5lnHdWGCsdYAvz/qAWkHFk9ijudKNhLHGaKGAyfDYMP/ibJnqFVYBZHvZ13NS1esjRg== +"@keplr-wallet/unit@0.12.88": + version "0.12.88" + resolved "https://registry.yarnpkg.com/@keplr-wallet/unit/-/unit-0.12.88.tgz#b9f1a4b2f1f8bbf9ff64f7ae8d6bc3989cba5bd9" + integrity sha512-fx6OKjomEW3OoNuC99SLF66kmlmi+DBPYlIlUVZJcX84DH6UOWkdhpkpeyJExAum/G+NHpYCBlsPCX+f2+m0Hw== dependencies: - "@keplr-wallet/types" "0.12.84" + "@keplr-wallet/types" "0.12.88" big-integer "^1.6.48" utility-types "^3.10.0" @@ -8086,8 +8086,14 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: - name strip-ansi-cjs +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -8766,7 +8772,16 @@ word-wrap@^1.2.5: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== From a819433984a4862045d3cdd233ffe3887862d686 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 03:44:57 +0000 Subject: [PATCH 3/9] Build(deps-dev): bump @types/react-dom from 18.2.25 to 18.3.0 Bumps [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom) from 18.2.25 to 18.3.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom) --- updated-dependencies: - dependency-name: "@types/react-dom" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 29 ++++++++++++++++++++++------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 5ed83e7f4..d6d5559f9 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "@types/lodash.throttle": "^4.1.9", "@types/node": "^20.12.7", "@types/react": "18.3.1", - "@types/react-dom": "18.2.25", + "@types/react-dom": "18.3.0", "@types/react-helmet": "^6.1.11", "autoprefixer": "^10.4.19", "dotenv": "^16.4.5", diff --git a/yarn.lock b/yarn.lock index 7849ec02b..bd574d0f6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3291,10 +3291,10 @@ resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.12.tgz#12bb1e2be27293c1406acb6af1c3f3a1481d98c6" integrity sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q== -"@types/react-dom@18.2.25": - version "18.2.25" - resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.2.25.tgz#2946a30081f53e7c8d585eb138277245caedc521" - integrity sha512-o/V48vf4MQh7juIKZU2QGDfli6p1+OOi5oXx36Hffpc9adsHeXjVp8rHuPkjd8VT8sOJ2Zp05HR7CdpGTIUFUA== +"@types/react-dom@18.3.0": + version "18.3.0" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.3.0.tgz#0cbc818755d87066ab6ca74fbedb2547d74a82b0" + integrity sha512-EhwApuTmMBmXuFOikhQLIBUn6uFg81SwLMOAUgodJF14SOBOCMdU04gDoYi0WOJJHD144TL32z4yDqCW3dnkQg== dependencies: "@types/react" "*" @@ -8086,8 +8086,14 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: - name strip-ansi-cjs +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -8766,7 +8772,16 @@ word-wrap@^1.2.5: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== From ed321ee160410c1619acff007d423eb6b03ccbd0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 03:45:10 +0000 Subject: [PATCH 4/9] Build(deps): bump react-router-dom from 6.23.0 to 6.23.1 Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.23.0 to 6.23.1. - [Release notes](https://github.com/remix-run/react-router/releases) - [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md) - [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@6.23.1/packages/react-router-dom) --- updated-dependencies: - dependency-name: react-router-dom dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 51 +++++++++++++++++++++++++++++++++------------------ 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 5ed83e7f4..fbd67760e 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "react-draggable": "^4.4.6", "react-helmet-async": "^2.0.4", "react-qr-code": "^2.0.12", - "react-router-dom": "^6.23.0", + "react-router-dom": "^6.23.1", "react-spring": "^9.7.3", "react-toastify": "^10.0.5", "react-use-clipboard": "^1.0.9", diff --git a/yarn.lock b/yarn.lock index 7849ec02b..4d76fe818 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2739,10 +2739,10 @@ "@react-spring/shared" "~9.7.3" "@react-spring/types" "~9.7.3" -"@remix-run/router@1.16.0": - version "1.16.0" - resolved "https://registry.yarnpkg.com/@remix-run/router/-/router-1.16.0.tgz#0e10181e5fec1434eb071a9bc4bdaac843f16dcc" - integrity sha512-Quz1KOffeEf/zwkCBM3kBtH4ZoZ+pT3xIXBG4PPW/XFtDP7EGhtTiC2+gpL9GnR7+Qdet5Oa6cYSvwKYg6kN9Q== +"@remix-run/router@1.16.1": + version "1.16.1" + resolved "https://registry.yarnpkg.com/@remix-run/router/-/router-1.16.1.tgz#73db3c48b975eeb06d0006481bde4f5f2d17d1cd" + integrity sha512-es2g3dq6Nb07iFxGk5GuHN20RwBZOsuDQN7izWIisUcv9r+d2C5jQxqmgkdebXgReWfiyUabcki6Fg77mSNrig== "@rollup/rollup-android-arm-eabi@4.17.2": version "4.17.2" @@ -7388,20 +7388,20 @@ react-qr-code@^2.0.12: prop-types "^15.8.1" qr.js "0.0.0" -react-router-dom@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-6.23.0.tgz#8b80ad92ad28f4dc38972e92d84b4c208150545a" - integrity sha512-Q9YaSYvubwgbal2c9DJKfx6hTNoBp3iJDsl+Duva/DwxoJH+OTXkxGpql4iUK2sla/8z4RpjAm6EWx1qUDuopQ== +react-router-dom@^6.23.1: + version "6.23.1" + resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-6.23.1.tgz#30cbf266669693e9492aa4fc0dde2541ab02322f" + integrity sha512-utP+K+aSTtEdbWpC+4gxhdlPFwuEfDKq8ZrPFU65bbRJY+l706qjR7yaidBpo3MSeA/fzwbXWbKBI6ftOnP3OQ== dependencies: - "@remix-run/router" "1.16.0" - react-router "6.23.0" + "@remix-run/router" "1.16.1" + react-router "6.23.1" -react-router@6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.23.0.tgz#2f2d7492c66a6bdf760be4c6bdf9e1d672fa154b" - integrity sha512-wPMZ8S2TuPadH0sF5irFGjkNLIcRvOSaEe7v+JER8508dyJumm6XZB1u5kztlX0RVq6AzRVndzqcUh6sFIauzA== +react-router@6.23.1: + version "6.23.1" + resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.23.1.tgz#d08cbdbd9d6aedc13eea6e94bc6d9b29cb1c4be9" + integrity sha512-fzcOaRF69uvqbbM7OhvQyBTFDVrrGlsFdS3AL+1KfIBtGETibHzi3FkoTRyiDJnWNc2VxrfvR+657ROHjaNjqQ== dependencies: - "@remix-run/router" "1.16.0" + "@remix-run/router" "1.16.1" react-smooth@^4.0.0: version "4.0.1" @@ -8086,8 +8086,14 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: - name strip-ansi-cjs +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -8766,7 +8772,16 @@ word-wrap@^1.2.5: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== From c9884d1004702a0eba857d50e1ca6a2830ae2c5c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 03:45:29 +0000 Subject: [PATCH 5/9] Build(deps-dev): bump @types/node from 20.12.8 to 20.12.11 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.12.8 to 20.12.11. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 29 ++++++++++++++++++++++------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 5ed83e7f4..7437f86d2 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "@types/debounce-promise": "^3.1.9", "@types/lodash.debounce": "^4.0.9", "@types/lodash.throttle": "^4.1.9", - "@types/node": "^20.12.7", + "@types/node": "^20.12.11", "@types/react": "18.3.1", "@types/react-dom": "18.2.25", "@types/react-helmet": "^6.1.11", diff --git a/yarn.lock b/yarn.lock index 7849ec02b..a526cb65d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3267,10 +3267,10 @@ resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.34.tgz#10964ba0dee6ac4cd462e2795b6bebd407303433" integrity sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g== -"@types/node@*", "@types/node@>=13.7.0", "@types/node@^20.12.7": - version "20.12.8" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.12.8.tgz#35897bf2bfe3469847ab04634636de09552e8256" - integrity sha512-NU0rJLJnshZWdE/097cdCBbyW1h4hEg0xpovcoAQYHl8dnEyp/NAOiE45pvc+Bd1Dt+2r94v2eGFpQJ4R7g+2w== +"@types/node@*", "@types/node@>=13.7.0", "@types/node@^20.12.11": + version "20.12.11" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.12.11.tgz#c4ef00d3507000d17690643278a60dc55a9dc9be" + integrity sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw== dependencies: undici-types "~5.26.4" @@ -8086,8 +8086,14 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: - name strip-ansi-cjs +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -8766,7 +8772,16 @@ word-wrap@^1.2.5: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== From d24dd7ffb7ff253e6026c08a50996d7aff72cc0b Mon Sep 17 00:00:00 2001 From: Linkie Link Date: Mon, 13 May 2024 12:57:21 +0200 Subject: [PATCH 6/9] =?UTF-8?q?fix:=20remove=20=E2=80=9CFund=20this=20Acco?= =?UTF-8?q?unt=E2=80=9D=20button=20from=20HLS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../account/AccountBalancesTable/index.tsx | 52 +++++++++++-------- .../account/AccountSummary/index.tsx | 3 +- 2 files changed, 31 insertions(+), 24 deletions(-) diff --git a/src/components/account/AccountBalancesTable/index.tsx b/src/components/account/AccountBalancesTable/index.tsx index cef0b4a30..d022f3661 100644 --- a/src/components/account/AccountBalancesTable/index.tsx +++ b/src/components/account/AccountBalancesTable/index.tsx @@ -9,13 +9,13 @@ import Card from 'components/common/Card' import Table from 'components/common/Table' import Text from 'components/common/Text' import ConditionalWrapper from 'hocs/ConditionalWrapper' +import useAccountIds from 'hooks/accounts/useAccountIds' import useCurrentAccount from 'hooks/accounts/useCurrentAccount' import useStore from 'store' import { getPage, getRoute } from 'utils/route' interface Props { account: Account - isHls?: boolean lendingData: LendingMarketTableData[] borrowingData: BorrowMarketTableData[] hideCard?: boolean @@ -38,17 +38,19 @@ export default function AccountBalancesTable(props: Props) { const { pathname } = useLocation() const address = useStore((s) => s.address) const updatedAccount = useStore((s) => s.updatedAccount) + const isHls = account.kind === 'high_levered_strategy' const accountBalanceData = useAccountBalanceData({ account, updatedAccount, lendingData, borrowingData, - isHls: props.isHls, + isHls, }) - const columns = useAccountBalancesColumns(account, showLiquidationPrice) + const { data: accountIds } = useAccountIds(address) + const isUsersAccount = accountIds?.includes(account.id) - if (accountBalanceData.length === 0) + if (accountBalanceData.length === 0) { return (
- { - if (currentAccount?.id !== account.id) { - navigate(getRoute(getPage(pathname), searchParams, address, account.id)) - } - useStore.setState({ - focusComponent: { - component: , - onClose: () => { - useStore.setState({ getStartedModal: true }) + {isUsersAccount && !isHls ? ( + { + if (currentAccount?.id !== account.id) { + navigate(getRoute(getPage(pathname), searchParams, address, account.id)) + } + useStore.setState({ + focusComponent: { + component: , + onClose: () => { + useStore.setState({ getStartedModal: true }) + }, }, - }, - }) - }} - /> + }) + }} + /> + ) : ( + + This account has no balances. + + )}
) - + } return ( ) : null, isOpen: accountSummaryTabs[1], From 586f0bb9eb75a5f1806d06d6cf9a833145ffe90c Mon Sep 17 00:00:00 2001 From: Linkie Link Date: Tue, 14 May 2024 10:40:46 +0200 Subject: [PATCH 7/9] feat: added AccountManage component to the Porfolio Detail view --- .../Modals/Account/AccountDeleteModal.tsx | 22 +++++- .../account/AccountBalancesTable/index.tsx | 5 +- src/components/portfolio/Account/Balances.tsx | 8 +- .../portfolio/Account/ManageAccount.tsx | 76 +++++++++++++++++++ .../portfolio/Account/PerpPositions.tsx | 8 +- .../portfolio/Account/Strategies.tsx | 7 +- src/components/portfolio/Account/Summary.tsx | 15 ++-- src/pages/PortfolioAccountPage.tsx | 25 +++--- src/pages/V1Page.tsx | 6 +- 9 files changed, 135 insertions(+), 37 deletions(-) create mode 100644 src/components/portfolio/Account/ManageAccount.tsx diff --git a/src/components/Modals/Account/AccountDeleteModal.tsx b/src/components/Modals/Account/AccountDeleteModal.tsx index 09e5239c1..e4520b747 100644 --- a/src/components/Modals/Account/AccountDeleteModal.tsx +++ b/src/components/Modals/Account/AccountDeleteModal.tsx @@ -1,11 +1,13 @@ import { useCallback, useMemo } from 'react' import { useLocation, useNavigate, useParams, useSearchParams } from 'react-router-dom' +import { useSWRConfig } from 'swr' import AccountDeleteAlertDialog from 'components/Modals/Account/AccountDeleteAlertDialog' import { ArrowRight, ExclamationMarkCircled } from 'components/common/Icons' import Text from 'components/common/Text' import AssetBalanceRow from 'components/common/assets/AssetBalanceRow' import useAllAssets from 'hooks/assets/useAllAssets' +import useChainConfig from 'hooks/chain/useChainConfig' import useStore from 'store' import { BNCoin } from 'types/classes/BNCoin' import { byDenom } from 'utils/array' @@ -26,7 +28,10 @@ export default function AccountDeleteController() { function AccountDeleteModal(props: Props) { const modal = props.modal + const chainConfig = useChainConfig() const deleteAccount = useStore((s) => s.deleteAccount) + const { mutate } = useSWRConfig() + const { address: urlAddress } = useParams() const navigate = useNavigate() const { pathname } = useLocation() const { address } = useParams() @@ -37,10 +42,18 @@ function AccountDeleteModal(props: Props) { useStore.setState({ accountDeleteModal: null }) }, []) - const deleteAccountHandler = useCallback(() => { + const deleteAccountHandler = useCallback(async () => { const options = { accountId: modal.id, lends: modal.lends } - deleteAccount(options) - navigate(getRoute(getPage(pathname), searchParams, address)) + const path = getPage(pathname) + const isDeleted = await deleteAccount(options) + if (isDeleted) { + mutate(`chains/${chainConfig.id}/wallets/${urlAddress}/account-ids`) + if (path.includes('portfolio')) { + navigate(getRoute('portfolio', searchParams, urlAddress)) + } else { + navigate(getRoute(path, searchParams, address)) + } + } closeDeleteAccountModal() }, [ modal.id, @@ -50,6 +63,9 @@ function AccountDeleteModal(props: Props) { pathname, searchParams, address, + urlAddress, + chainConfig.id, + mutate, closeDeleteAccountModal, ]) diff --git a/src/components/account/AccountBalancesTable/index.tsx b/src/components/account/AccountBalancesTable/index.tsx index d022f3661..c7240d6a0 100644 --- a/src/components/account/AccountBalancesTable/index.tsx +++ b/src/components/account/AccountBalancesTable/index.tsx @@ -9,7 +9,6 @@ import Card from 'components/common/Card' import Table from 'components/common/Table' import Text from 'components/common/Text' import ConditionalWrapper from 'hocs/ConditionalWrapper' -import useAccountIds from 'hooks/accounts/useAccountIds' import useCurrentAccount from 'hooks/accounts/useCurrentAccount' import useStore from 'store' import { getPage, getRoute } from 'utils/route' @@ -21,6 +20,7 @@ interface Props { hideCard?: boolean tableBodyClassName?: string showLiquidationPrice?: boolean + isUsersAccount?: boolean } export default function AccountBalancesTable(props: Props) { @@ -32,6 +32,7 @@ export default function AccountBalancesTable(props: Props) { tableBodyClassName, hideCard, showLiquidationPrice, + isUsersAccount, } = props const currentAccount = useCurrentAccount() const navigate = useNavigate() @@ -47,8 +48,6 @@ export default function AccountBalancesTable(props: Props) { isHls, }) const columns = useAccountBalancesColumns(account, showLiquidationPrice) - const { data: accountIds } = useAccountIds(address) - const isUsersAccount = accountIds?.includes(account.id) if (accountBalanceData.length === 0) { return ( diff --git a/src/components/portfolio/Account/Balances.tsx b/src/components/portfolio/Account/Balances.tsx index ad60694c4..906f48889 100644 --- a/src/components/portfolio/Account/Balances.tsx +++ b/src/components/portfolio/Account/Balances.tsx @@ -6,15 +6,14 @@ import Card from 'components/common/Card' import TableSkeleton from 'components/common/Table/TableSkeleton' import Text from 'components/common/Text' import useLendingMarketAssetsTableData from 'components/earn/lend/Table/useLendingMarketAssetsTableData' -import useAccount from 'hooks/accounts/useAccount' interface Props { - accountId: string + isUsersAccount?: boolean + account: Account } function Content(props: Props) { - const { data: account } = useAccount(props.accountId, true) - + const { isUsersAccount, account } = props const data = useBorrowMarketAssetsTableData() const borrowAssets = useMemo(() => data?.allAssets || [], [data]) const { allAssets: lendingAssets } = useLendingMarketAssetsTableData() @@ -29,6 +28,7 @@ function Content(props: Props) { account={account} borrowingData={borrowAssets} lendingData={lendingAssets} + isUsersAccount={isUsersAccount} showLiquidationPrice hideCard /> diff --git a/src/components/portfolio/Account/ManageAccount.tsx b/src/components/portfolio/Account/ManageAccount.tsx new file mode 100644 index 000000000..ee494e783 --- /dev/null +++ b/src/components/portfolio/Account/ManageAccount.tsx @@ -0,0 +1,76 @@ +import { useCallback, useMemo } from 'react' + +import AccountFundFullPage from 'components/account/AccountFund/AccountFundFullPage' +import Button from 'components/common/Button' +import { ArrowDownLine, ArrowUpLine, TrashBin } from 'components/common/Icons' +import useAllAssets from 'hooks/assets/useAllAssets' +import usePrices from 'hooks/prices/usePrices' +import useStore from 'store' +import { calculateAccountBalanceValue } from 'utils/accounts' + +interface Props { + account: Account +} + +export default function ManageAccount(props: Props) { + const { account } = props + const assets = useAllAssets() + const { data: prices } = usePrices() + const isHls = account.kind === 'high_levered_strategy' + const positionBalance = useMemo( + () => (!account ? null : calculateAccountBalanceValue(account, prices, assets)), + [account, assets, prices], + ) + const deleteAccountHandler = useCallback(() => { + if (!account) return + useStore.setState({ accountDeleteModal: account }) + }, [account]) + + return ( +
+ {!isHls && ( + <> +
+ ) +} diff --git a/src/components/portfolio/Account/PerpPositions.tsx b/src/components/portfolio/Account/PerpPositions.tsx index d33c9f895..3df2b3021 100644 --- a/src/components/portfolio/Account/PerpPositions.tsx +++ b/src/components/portfolio/Account/PerpPositions.tsx @@ -4,16 +4,14 @@ import AccountPerpPositionTable from 'components/account/AccountPerpPositionTabl import Card from 'components/common/Card' import TableSkeleton from 'components/common/Table/TableSkeleton' import Text from 'components/common/Text' -import useAccount from 'hooks/accounts/useAccount' interface Props { - accountId: string + account: Account } function Content(props: Props) { - const { data: account } = useAccount(props.accountId, true) - - if (!account || account.perps.length === 0) return null + const { account } = props + if (account.perps.length === 0) return null return ( diff --git a/src/components/portfolio/Account/Strategies.tsx b/src/components/portfolio/Account/Strategies.tsx index 1df5fd9fa..52abe4700 100644 --- a/src/components/portfolio/Account/Strategies.tsx +++ b/src/components/portfolio/Account/Strategies.tsx @@ -4,16 +4,15 @@ import AccountStrategiesTable from 'components/account/AccountStrategiesTable' import Card from 'components/common/Card' import TableSkeleton from 'components/common/Table/TableSkeleton' import Text from 'components/common/Text' -import useAccount from 'hooks/accounts/useAccount' interface Props { - accountId: string + account: Account } function Content(props: Props) { - const { data: account } = useAccount(props.accountId, true) + const { account } = props - if (!account || account?.vaults.length === 0) { + if (account.vaults.length === 0) { return null } diff --git a/src/components/portfolio/Account/Summary.tsx b/src/components/portfolio/Account/Summary.tsx index 032c6b901..515befffe 100644 --- a/src/components/portfolio/Account/Summary.tsx +++ b/src/components/portfolio/Account/Summary.tsx @@ -6,22 +6,21 @@ import { FormattedNumber } from 'components/common/FormattedNumber' import useLendingMarketAssetsTableData from 'components/earn/lend/Table/useLendingMarketAssetsTableData' import Skeleton from 'components/portfolio/SummarySkeleton' import { MAX_AMOUNT_DECIMALS } from 'constants/math' -import useAccount from 'hooks/accounts/useAccount' import useAllAssets from 'hooks/assets/useAllAssets' +import useHealthComputer from 'hooks/health-computer/useHealthComputer' import useHLSStakingAssets from 'hooks/hls/useHLSStakingAssets' import usePrices from 'hooks/prices/usePrices' -import useHealthComputer from 'hooks/health-computer/useHealthComputer' import useVaultAprs from 'hooks/vaults/useVaultAprs' import { getAccountSummaryStats } from 'utils/accounts' import { DEFAULT_PORTFOLIO_STATS } from 'utils/constants' interface Props { - accountId: string + account: Account v1?: boolean } function Content(props: Props) { - const { data: account } = useAccount(props.accountId, true) + const { account } = props const { data: prices } = usePrices() const { data: vaultAprs } = useVaultAprs() const { health, healthFactor } = useHealthComputer(account) @@ -89,8 +88,8 @@ function Content(props: Props) { stats={stats} health={health} healthFactor={healthFactor} - title={props.v1 ? 'V1 Portfolio' : `Credit Account ${props.accountId}`} - accountId={props.accountId} + title={props.v1 ? 'V1 Portfolio' : `Credit Account ${account.id}`} + accountId={account.id} /> ) } @@ -102,8 +101,8 @@ export default function Summary(props: Props) { } > diff --git a/src/pages/PortfolioAccountPage.tsx b/src/pages/PortfolioAccountPage.tsx index 38e05e963..6f0836fa3 100644 --- a/src/pages/PortfolioAccountPage.tsx +++ b/src/pages/PortfolioAccountPage.tsx @@ -3,32 +3,39 @@ import { useNavigate, useParams, useSearchParams } from 'react-router-dom' import ShareBar from 'components/common/ShareBar' import Balances from 'components/portfolio/Account/Balances' import BreadCrumbs from 'components/portfolio/Account/BreadCrumbs' +import ManageAccount from 'components/portfolio/Account/ManageAccount' import PerpPositions from 'components/portfolio/Account/PerpPositions' import Strategies from 'components/portfolio/Account/Strategies' import Summary from 'components/portfolio/Account/Summary' -import useAccountId from 'hooks/accounts/useAccountId' +import useAccount from 'hooks/accounts/useAccount' +import useAccountIds from 'hooks/accounts/useAccountIds' import useChainConfig from 'hooks/chain/useChainConfig' +import useStore from 'store' import { getRoute } from 'utils/route' export default function PortfolioAccountPage() { const chainConfig = useChainConfig() - const selectedAccountId = useAccountId() - const { address, accountId } = useParams() + const { urlAddress, accountId } = useParams() const navigate = useNavigate() const [searchParams] = useSearchParams() + const address = useStore((s) => s.address) + const { data: accountIds } = useAccountIds(address) + const isUsersAccount = accountId && accountIds ? accountIds.includes(accountId) : false + const { data: account } = useAccount(accountId, true) - if (!accountId) { - navigate(getRoute('portfolio', searchParams, address, selectedAccountId)) + if (!accountId || !account) { + navigate(getRoute('portfolio', searchParams, urlAddress)) return null } return (
- - - {chainConfig.farm && } - {chainConfig.perps && } + + {isUsersAccount && } + + {chainConfig.farm && } + {chainConfig.perps && }
) diff --git a/src/pages/V1Page.tsx b/src/pages/V1Page.tsx index 0236c50ac..8f660d96a 100644 --- a/src/pages/V1Page.tsx +++ b/src/pages/V1Page.tsx @@ -2,14 +2,18 @@ import Summary from 'components/portfolio/Account/Summary' import Borrowings from 'components/v1/Borrowings' import Deposits from 'components/v1/Deposits' import V1Intro from 'components/v1/V1Intro' +import useAccount from 'hooks/accounts/useAccount' import useStore from 'store' export default function V1Page() { const address = useStore((s) => s.address) + const { data: account } = useAccount(address) + + if (!account) return null return (
- {address && } + {address && }
From 8b4f3c71922fd6e2e13a9632c7700fc27e502b0f Mon Sep 17 00:00:00 2001 From: Linkie Link Date: Tue, 14 May 2024 11:29:06 +0200 Subject: [PATCH 8/9] tidy: added comment --- src/components/Modals/Account/AccountDeleteModal.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Modals/Account/AccountDeleteModal.tsx b/src/components/Modals/Account/AccountDeleteModal.tsx index e4520b747..98b900492 100644 --- a/src/components/Modals/Account/AccountDeleteModal.tsx +++ b/src/components/Modals/Account/AccountDeleteModal.tsx @@ -49,6 +49,7 @@ function AccountDeleteModal(props: Props) { if (isDeleted) { mutate(`chains/${chainConfig.id}/wallets/${urlAddress}/account-ids`) if (path.includes('portfolio')) { + // If the current page is the portfolio accounts detail page. Reroute the user to the portfolio overview page. navigate(getRoute('portfolio', searchParams, urlAddress)) } else { navigate(getRoute(path, searchParams, address)) From 4af817a0a613f9b86aee942bff867bfbfa29fa9b Mon Sep 17 00:00:00 2001 From: Linkie Link Date: Tue, 14 May 2024 14:55:19 +0200 Subject: [PATCH 9/9] env: upped version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e6cfd5289..2c7f2ae31 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mars-v2-frontend", - "version": "2.3.4", + "version": "2.3.5", "homepage": "./", "private": false, "license": "SEE LICENSE IN LICENSE FILE",