diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index d411ba37a5..42c48a233b 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -485,6 +485,21 @@ importers: '@stitches/react': specifier: 1.3.1-1 version: 1.3.1-1(react@18.2.0) + '@walletconnect/encoding': + specifier: ~1.0.2 + version: 1.0.2 + '@walletconnect/modal': + specifier: ~2.6.1 + version: 2.6.1(react@18.2.0) + '@walletconnect/sign-client': + specifier: ~2.8.1 + version: 2.8.6 + '@walletconnect/types': + specifier: ~2.8.1 + version: 2.8.6 + '@walletconnect/utils': + specifier: ~2.9.2 + version: 2.9.2 ace-builds: specifier: ~1.22.1 version: 1.22.1 @@ -4740,7 +4755,7 @@ packages: graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: graphql: 16.6.0 - tslib: 2.4.1 + tslib: 2.6.1 dev: true /@graphql-tools/prisma-loader@7.2.72(@types/node@16.18.39)(graphql@16.6.0): @@ -4783,7 +4798,7 @@ packages: '@ardatan/relay-compiler': 12.0.0(graphql@16.6.0) '@graphql-tools/utils': 9.2.1(graphql@16.6.0) graphql: 16.6.0 - tslib: 2.4.1 + tslib: 2.6.1 transitivePeerDependencies: - encoding - supports-color @@ -5680,6 +5695,16 @@ packages: resolution: {integrity: sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==} dev: false + /@lit-labs/ssr-dom-shim@1.1.1: + resolution: {integrity: sha512-kXOeFbfCm4fFf2A3WwVEeQj55tMZa8c8/f9AKHMobQMkzNUfUj+antR3fRPaZJawsa1aZiP/Da3ndpZrwEe4rQ==} + dev: false + + /@lit/reactive-element@1.6.3: + resolution: {integrity: sha512-QuTgnG52Poic7uM1AN5yJ09QMe0O28e10XzSvWDz02TJiiKee4stsiownEIadWm8nYzyDAyT+gKzUoZmiWQtsQ==} + dependencies: + '@lit-labs/ssr-dom-shim': 1.1.1 + dev: false + /@mailchimp/mailchimp_marketing@3.0.80: resolution: {integrity: sha512-Cgz0xPb+1DUjmrl5whAsmqfAChBko+Wf4/PLQE4RvwfPlcq2agfHr1QFiXEhZ8e+GQwQ3hZQn9iLGXwIXwxUCg==} engines: {node: '>=10.0.0'} @@ -5794,6 +5819,67 @@ packages: /@microsoft/tsdoc@0.14.2: resolution: {integrity: sha512-9b8mPpKrfeGRuhFH5iO1iwCLeIIsV6+H1sRfxbkoGXIyQE2BTsPd9zqSqQJ+pv5sJ/hT5M1zvOFL02MnEezFug==} + /@motionone/animation@10.15.1: + resolution: {integrity: sha512-mZcJxLjHor+bhcPuIFErMDNyrdb2vJur8lSfMCsuCB4UyV8ILZLvK+t+pg56erv8ud9xQGK/1OGPt10agPrCyQ==} + dependencies: + '@motionone/easing': 10.15.1 + '@motionone/types': 10.15.1 + '@motionone/utils': 10.15.1 + tslib: 2.6.1 + dev: false + + /@motionone/dom@10.16.2: + resolution: {integrity: sha512-bnuHdNbge1FutZXv+k7xub9oPWcF0hsu8y1HTH/qg6av58YI0VufZ3ngfC7p2xhMJMnoh0LXFma2EGTgPeCkeg==} + dependencies: + '@motionone/animation': 10.15.1 + '@motionone/generators': 10.15.1 + '@motionone/types': 10.15.1 + '@motionone/utils': 10.15.1 + hey-listen: 1.0.8 + tslib: 2.6.1 + dev: false + + /@motionone/easing@10.15.1: + resolution: {integrity: sha512-6hIHBSV+ZVehf9dcKZLT7p5PEKHGhDwky2k8RKkmOvUoYP3S+dXsKupyZpqx5apjd9f+php4vXk4LuS+ADsrWw==} + dependencies: + '@motionone/utils': 10.15.1 + tslib: 2.6.1 + dev: false + + /@motionone/generators@10.15.1: + resolution: {integrity: sha512-67HLsvHJbw6cIbLA/o+gsm7h+6D4Sn7AUrB/GPxvujse1cGZ38F5H7DzoH7PhX+sjvtDnt2IhFYF2Zp1QTMKWQ==} + dependencies: + '@motionone/types': 10.15.1 + '@motionone/utils': 10.15.1 + tslib: 2.6.1 + dev: false + + /@motionone/svelte@10.16.2: + resolution: {integrity: sha512-38xsroKrfK+aHYhuQlE6eFcGy0EwrB43Q7RGjF73j/kRUTcLNu/LAaKiLLsN5lyqVzCgTBVt4TMT/ShWbTbc5Q==} + dependencies: + '@motionone/dom': 10.16.2 + tslib: 2.6.1 + dev: false + + /@motionone/types@10.15.1: + resolution: {integrity: sha512-iIUd/EgUsRZGrvW0jqdst8st7zKTzS9EsKkP+6c6n4MPZoQHwiHuVtTQLD6Kp0bsBLhNzKIBlHXponn/SDT4hA==} + dev: false + + /@motionone/utils@10.15.1: + resolution: {integrity: sha512-p0YncgU+iklvYr/Dq4NobTRdAPv9PveRDUXabPEeOjBLSO/1FNB2phNTZxOxpi1/GZwYpAoECEa0Wam+nsmhSw==} + dependencies: + '@motionone/types': 10.15.1 + hey-listen: 1.0.8 + tslib: 2.6.1 + dev: false + + /@motionone/vue@10.16.2: + resolution: {integrity: sha512-7/dEK/nWQXOkJ70bqb2KyNfSWbNvWqKKq1C8juj+0Mg/AorgD8O5wE3naddK0G+aXuNMqRuc4jlsYHHWHtIzVw==} + dependencies: + '@motionone/dom': 10.16.2 + tslib: 2.6.1 + dev: false + /@ndelangen/get-tarball@3.0.9: resolution: {integrity: sha512-9JKTEik4vq+yGosHYhZ1tiH/3WpUS0Nh0kej4Agndhox8pAdWhEx5knFVRcb/ya9knCRCs1rPxNrSXTDdfVqpA==} dependencies: @@ -10048,6 +10134,14 @@ packages: - utf-8-validate dev: false + /@walletconnect/encoding@1.0.2: + resolution: {integrity: sha512-CrwSBrjqJ7rpGQcTL3kU+Ief+Bcuu9PH6JLOb+wM6NITX1GTxR/MfNwnQfhLKK6xpRAyj2/nM04OOH6wS8Imag==} + dependencies: + is-typedarray: 1.0.0 + tslib: 1.14.1 + typedarray-to-buffer: 3.1.5 + dev: false + /@walletconnect/environment@1.0.1: resolution: {integrity: sha512-T426LLZtHj8e8rYnKfzsw1aG6+M0BT1ZxayMdv/p8yM0MU+eJDISqNY3/bccxRr4LrF9csq02Rhqt08Ibl0VRg==} dependencies: @@ -10127,6 +10221,34 @@ packages: tslib: 1.14.1 dev: false + /@walletconnect/modal-core@2.6.1(react@18.2.0): + resolution: {integrity: sha512-f2hYlJ5pwzGvjyaZ6BoGR5uiMgXzWXt6w6ktt1N8lmY6PiYp8whZgqx2hTxVWwVlsGnaIfh6UHp1hGnANx0eTQ==} + dependencies: + valtio: 1.11.0(react@18.2.0) + transitivePeerDependencies: + - react + dev: false + + /@walletconnect/modal-ui@2.6.1(react@18.2.0): + resolution: {integrity: sha512-RFUOwDAMijSK8B7W3+KoLKaa1l+KEUG0LCrtHqaB0H0cLnhEGdLR+kdTdygw+W8+yYZbkM5tXBm7MlFbcuyitA==} + dependencies: + '@walletconnect/modal-core': 2.6.1(react@18.2.0) + lit: 2.7.6 + motion: 10.16.2 + qrcode: 1.5.3 + transitivePeerDependencies: + - react + dev: false + + /@walletconnect/modal@2.6.1(react@18.2.0): + resolution: {integrity: sha512-G84tSzdPKAFk1zimgV7JzIUFT5olZUVtI3GcOk77OeLYjlMfnDT23RVRHm5EyCrjkptnvpD0wQScXePOFd2Xcw==} + dependencies: + '@walletconnect/modal-core': 2.6.1(react@18.2.0) + '@walletconnect/modal-ui': 2.6.1(react@18.2.0) + transitivePeerDependencies: + - react + dev: false + /@walletconnect/relay-api@1.0.9: resolution: {integrity: sha512-Q3+rylJOqRkO1D9Su0DPE3mmznbAalYapJ9qmzDgK28mYF9alcP3UwG/og5V7l7CFOqzCLi7B8BvcBUrpDj0Rg==} dependencies: @@ -10190,6 +10312,20 @@ packages: - lokijs dev: false + /@walletconnect/types@2.9.2: + resolution: {integrity: sha512-7Rdn30amnJEEal4hk83cdwHUuxI1SWQ+K7fFFHBMqkuHLGi3tpMY6kpyfDxnUScYEZXqgRps4Jo5qQgnRqVM7A==} + dependencies: + '@walletconnect/events': 1.0.1 + '@walletconnect/heartbeat': 1.2.1 + '@walletconnect/jsonrpc-types': 1.0.3 + '@walletconnect/keyvaluestorage': 1.0.2 + '@walletconnect/logger': 2.0.1 + events: 3.3.0 + transitivePeerDependencies: + - '@react-native-async-storage/async-storage' + - lokijs + dev: false + /@walletconnect/utils@2.8.6: resolution: {integrity: sha512-wcy6e5+COYo7tfNnW8YqidnATdJDIW6vDiWWE7A1F78Sl/VflkaevB9cIgyn8eLdxC1SxXgGoeC2oLP90nnHJg==} dependencies: @@ -10212,6 +10348,28 @@ packages: - lokijs dev: false + /@walletconnect/utils@2.9.2: + resolution: {integrity: sha512-D44hwXET/8JhhIjqljY6qxSu7xXnlPrf63UN/Qfl98vDjWlYVcDl2+JIQRxD9GPastw0S8XZXdRq59XDXLuZBg==} + dependencies: + '@stablelib/chacha20poly1305': 1.0.1 + '@stablelib/hkdf': 1.0.1 + '@stablelib/random': 1.0.2 + '@stablelib/sha256': 1.0.1 + '@stablelib/x25519': 1.0.3 + '@walletconnect/relay-api': 1.0.9 + '@walletconnect/safe-json': 1.0.2 + '@walletconnect/time': 1.0.2 + '@walletconnect/types': 2.9.2 + '@walletconnect/window-getters': 1.0.1 + '@walletconnect/window-metadata': 1.0.1 + detect-browser: 5.3.0 + query-string: 7.1.3 + uint8arrays: 3.1.1 + transitivePeerDependencies: + - '@react-native-async-storage/async-storage' + - lokijs + dev: false + /@walletconnect/window-getters@1.0.1: resolution: {integrity: sha512-vHp+HqzGxORPAN8gY03qnbTMnhqIwjeRJNOMOAzePRg4xVEEE2WvYsI9G2NMjOknA8hnuYbU3/hwLcKbjhc8+Q==} dependencies: @@ -11798,7 +11956,7 @@ packages: resolution: {integrity: sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==} dependencies: no-case: 3.0.4 - tslib: 2.4.1 + tslib: 2.6.1 upper-case-first: 2.0.2 dev: true @@ -11918,7 +12076,7 @@ packages: path-case: 3.0.4 sentence-case: 3.0.4 snake-case: 3.0.4 - tslib: 2.4.1 + tslib: 2.6.1 dev: true /char-regex@1.0.2: @@ -12150,7 +12308,6 @@ packages: string-width: 4.2.3 strip-ansi: 6.0.1 wrap-ansi: 6.2.0 - dev: true /cliui@7.0.4: resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} @@ -12397,7 +12554,7 @@ packages: resolution: {integrity: sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==} dependencies: no-case: 3.0.4 - tslib: 2.4.1 + tslib: 2.6.1 upper-case: 2.0.2 dev: true @@ -13261,6 +13418,10 @@ packages: resolution: {integrity: sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==} engines: {node: '>=0.3.1'} + /dijkstrajs@1.0.3: + resolution: {integrity: sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==} + dev: false + /dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} @@ -13523,6 +13684,10 @@ packages: resolution: {integrity: sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==} engines: {node: '>= 4'} + /encode-utf8@1.0.3: + resolution: {integrity: sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==} + dev: false + /encodeurl@1.0.2: resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} engines: {node: '>= 0.8'} @@ -15840,9 +16005,13 @@ packages: resolution: {integrity: sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==} dependencies: capital-case: 1.0.4 - tslib: 2.4.1 + tslib: 2.6.1 dev: true + /hey-listen@1.0.8: + resolution: {integrity: sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q==} + dev: false + /hoist-non-react-statics@3.3.2: resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==} dependencies: @@ -18436,6 +18605,28 @@ packages: wrap-ansi: 7.0.0 dev: true + /lit-element@3.3.3: + resolution: {integrity: sha512-XbeRxmTHubXENkV4h8RIPyr8lXc+Ff28rkcQzw3G6up2xg5E8Zu1IgOWIwBLEQsu3cOVFqdYwiVi0hv0SlpqUA==} + dependencies: + '@lit-labs/ssr-dom-shim': 1.1.1 + '@lit/reactive-element': 1.6.3 + lit-html: 2.8.0 + dev: false + + /lit-html@2.8.0: + resolution: {integrity: sha512-o9t+MQM3P4y7M7yNzqAyjp7z+mQGa4NS4CxiyLqFPyFWyc4O+nodLrkrxSaCTrla6M5YOLaT3RpbbqjszB5g3Q==} + dependencies: + '@types/trusted-types': 2.0.3 + dev: false + + /lit@2.7.6: + resolution: {integrity: sha512-1amFHA7t4VaaDe+vdQejSVBklwtH9svGoG6/dZi9JhxtJBBlqY5D1RV7iLUYY0trCqQc4NfhYYZilZiVHt7Hxg==} + dependencies: + '@lit/reactive-element': 1.6.3 + lit-element: 3.3.3 + lit-html: 2.8.0 + dev: false + /load-json-file@4.0.0: resolution: {integrity: sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==} engines: {node: '>=4'} @@ -18599,7 +18790,7 @@ packages: /lower-case-first@2.0.2: resolution: {integrity: sha512-EVm/rR94FJTZi3zefZ82fLWab+GX14LJN4HrWBcuo6Evmsl9hEfnqxgcHCKb9q+mNf6EVdsjx/qucYFIIB84pg==} dependencies: - tslib: 2.4.1 + tslib: 2.6.1 dev: true /lower-case@2.0.2: @@ -19613,6 +19804,17 @@ packages: resolution: {integrity: sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q==} dev: false + /motion@10.16.2: + resolution: {integrity: sha512-p+PurYqfUdcJZvtnmAqu5fJgV2kR0uLFQuBKtLeFVTrYEVllI99tiOTSefVNYuip9ELTEkepIIDftNdze76NAQ==} + dependencies: + '@motionone/animation': 10.15.1 + '@motionone/dom': 10.16.2 + '@motionone/svelte': 10.16.2 + '@motionone/types': 10.15.1 + '@motionone/utils': 10.15.1 + '@motionone/vue': 10.16.2 + dev: false + /mri@1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} engines: {node: '>=4'} @@ -20465,7 +20667,7 @@ packages: resolution: {integrity: sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg==} dependencies: dot-case: 3.0.4 - tslib: 2.4.1 + tslib: 2.6.1 dev: true /path-exists@3.0.0: @@ -20798,6 +21000,11 @@ packages: engines: {node: '>=4'} dev: false + /pngjs@5.0.0: + resolution: {integrity: sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==} + engines: {node: '>=10.13.0'} + dev: false + /polished@4.2.2: resolution: {integrity: sha512-Sz2Lkdxz6F2Pgnpi9U5Ng/WdWAUZxmHrNPoVlm3aAemxoy2Qy7LGjQg4uf8qKelDAUW94F4np3iH2YPf2qefcQ==} engines: {node: '>=10'} @@ -21836,6 +22043,10 @@ packages: forwarded: 0.2.0 ipaddr.js: 1.9.1 + /proxy-compare@2.5.1: + resolution: {integrity: sha512-oyfc0Tx87Cpwva5ZXezSp5V9vht1c7dZBhvuV/y3ctkgMVUmiAGDVeeB0dKhGSyT0v1ZTEQYpe/RXlBVBNuCLA==} + dev: false + /proxy-from-env@1.0.0: resolution: {integrity: sha512-F2JHgJQ1iqwnHDcQjVBsq3n/uoaFL+iPW/eAeL7kVxy/2RrWaN4WroKjjvbsoRtv0ftelNyC01bjRhn/bhcf4A==} dev: true @@ -21920,6 +22131,17 @@ packages: engines: {node: '>=0.6.0', teleport: '>=0.2.0'} dev: false + /qrcode@1.5.3: + resolution: {integrity: sha512-puyri6ApkEHYiVl4CFzo1tDkAZ+ATcnbJrJ6RiBM1Fhctdn/ix9MTE3hRph33omisEbC/2fcfemsseiKgBPKZg==} + engines: {node: '>=10.13.0'} + hasBin: true + dependencies: + dijkstrajs: 1.0.3 + encode-utf8: 1.0.3 + pngjs: 5.0.0 + yargs: 15.4.1 + dev: false + /qs@6.10.4: resolution: {integrity: sha512-OQiU+C+Ds5qiH91qh/mg0w+8nwQuLjM4F4M/PbmhDOoYehPh+Fb0bDjtR1sOvy7YKxvj28Y/M0PhP5uVX0kB+g==} engines: {node: '>=0.6'} @@ -22797,7 +23019,6 @@ packages: /require-main-filename@2.0.0: resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} - dev: true /require-relative@0.8.7: resolution: {integrity: sha512-AKGr4qvHiryxRb19m3PsLRGuKVAbJLUD7E6eOaHkfKhwc+vSgVOCY5xNvm9EkolBKTOf0GrQAZKLimOCz81Khg==} @@ -23211,7 +23432,7 @@ packages: resolution: {integrity: sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==} dependencies: no-case: 3.0.4 - tslib: 2.4.1 + tslib: 2.6.1 upper-case-first: 2.0.2 dev: true @@ -23296,7 +23517,6 @@ packages: /set-blocking@2.0.0: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - dev: true /setimmediate@1.0.5: resolution: {integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==} @@ -23650,7 +23870,7 @@ packages: /sponge-case@1.0.1: resolution: {integrity: sha512-dblb9Et4DAtiZ5YSUZHLl4XhH4uK80GhAZrVXdN4O2P4gQ40Wa5UIOPUHlA/nFd2PLblBZWUioLMMAVrgpoYcA==} dependencies: - tslib: 2.4.1 + tslib: 2.6.1 dev: true /sprintf-js@1.0.3: @@ -24204,7 +24424,7 @@ packages: /swap-case@2.0.2: resolution: {integrity: sha512-kc6S2YS/2yXbtkSMunBtKdah4VFETZ8Oh6ONSmSd9bRxhqTrtARUCBUiWXH3xVPpvR7tz2CSnkuXVE42EcGnMw==} dependencies: - tslib: 2.4.1 + tslib: 2.6.1 dev: true /swc-loader@0.2.3(@swc/core@1.3.71)(webpack@5.88.2): @@ -24508,7 +24728,7 @@ packages: /title-case@3.0.3: resolution: {integrity: sha512-e1zGYRvbffpcHIrnuqT0Dh+gEJtDaxDSoG4JAIpq4oDFyooziLBIiYQv0GBT4FUAnUop5uZ1hiIAj7oAF6sOCA==} dependencies: - tslib: 2.4.1 + tslib: 2.6.1 dev: true /titleize@3.0.0: @@ -25235,13 +25455,13 @@ packages: /upper-case-first@2.0.2: resolution: {integrity: sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==} dependencies: - tslib: 2.4.1 + tslib: 2.6.1 dev: true /upper-case@2.0.2: resolution: {integrity: sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==} dependencies: - tslib: 2.4.1 + tslib: 2.6.1 dev: true /uri-js@4.4.1: @@ -25281,6 +25501,14 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: true + /use-sync-external-store@1.2.0(react@18.2.0): + resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + dependencies: + react: 18.2.0 + dev: false + /utf-8-validate@5.0.10: resolution: {integrity: sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==} engines: {node: '>=6.14.2'} @@ -25377,6 +25605,20 @@ packages: resolution: {integrity: sha512-B+dGG8U3fdtM0/aNK4/X8CXq/EcxU2WPrPEkJGslb47qyHsxmbggTWK0yEA4qnYVNF+nxNlN88o14hIcPmSIEA==} engines: {node: '>= 0.10'} + /valtio@1.11.0(react@18.2.0): + resolution: {integrity: sha512-65Yd0yU5qs86b5lN1eu/nzcTgQ9/6YnD6iO+DDaDbQLn1Zv2w12Gwk43WkPlUBxk5wL/6cD5YMFf7kj6HZ1Kpg==} + engines: {node: '>=12.20.0'} + peerDependencies: + react: '>=16.8' + peerDependenciesMeta: + react: + optional: true + dependencies: + proxy-compare: 2.5.1 + react: 18.2.0 + use-sync-external-store: 1.2.0(react@18.2.0) + dev: false + /value-or-promise@1.0.11: resolution: {integrity: sha512-41BrgH+dIbCFXClcSapVs5M6GkENd3gQOJpEfPDNa71LsUGMXDL0jMWpI/Rh7WhX+Aalfz2TTS3Zt5pUsbnhLg==} engines: {node: '>=12'} @@ -25977,7 +26219,6 @@ packages: /which-module@2.0.1: resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} - dev: true /which-typed-array@1.1.11: resolution: {integrity: sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==} @@ -26313,7 +26554,6 @@ packages: /y18n@4.0.3: resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} - dev: true /y18n@5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} @@ -26352,7 +26592,6 @@ packages: dependencies: camelcase: 5.3.1 decamelize: 1.2.0 - dev: true /yargs-parser@20.2.9: resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} @@ -26377,7 +26616,6 @@ packages: which-module: 2.0.1 y18n: 4.0.3 yargs-parser: 18.1.3 - dev: true /yargs@16.2.0: resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} diff --git a/common/config/rush/repo-state.json b/common/config/rush/repo-state.json index b45c8ca486..6f3c880e3f 100644 --- a/common/config/rush/repo-state.json +++ b/common/config/rush/repo-state.json @@ -1,5 +1,5 @@ // DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. { - "pnpmShrinkwrapHash": "0ce1b55854da10cb6fa1b558bd64743d6c481cdc", + "pnpmShrinkwrapHash": "48c1105dd2167eda84f82ddfcb54cf79f62d3577", "preferredVersionsHash": "bf21a9e8fbc5a3846fb05b4fa0859e0917b2202f" } diff --git a/packages/apps/tools/.env.example b/packages/apps/tools/.env.example index 5b98b106e0..f48fff8c17 100644 --- a/packages/apps/tools/.env.example +++ b/packages/apps/tools/.env.example @@ -19,3 +19,7 @@ FAUCET_PRIVATE_KEY= # Default Sender, omit to use default value: not-real DEFAULT_SENDER= + +# wallet connect project info +WALLET_CONNECT_PROJECT_ID= +WALLET_CONNECT_RELAY_URL= diff --git a/packages/apps/tools/locales/en/common.json b/packages/apps/tools/locales/en/common.json index 903bae2874..a067ab4d49 100644 --- a/packages/apps/tools/locales/en/common.json +++ b/packages/apps/tools/locales/en/common.json @@ -2,6 +2,7 @@ "Kadena": "Kadena", "Back": "Back", "Connect your wallet": "Connect your wallet", + "Disconnect your wallet": "Disconnect your wallet", "Kadena Transfer": "Kadena Transfer", "Generate KeyPair (save to file)": "Generate KeyPair (save to file)", "Kadena Testnet Faucet": "Kadena Testnet Faucet", diff --git a/packages/apps/tools/next.config.js b/packages/apps/tools/next.config.js index 4124bc8361..207e26181d 100644 --- a/packages/apps/tools/next.config.js +++ b/packages/apps/tools/next.config.js @@ -19,6 +19,8 @@ const config = { GAS_LIMIT: process.env.GAS_LIMIT, FAUCET_PUBLIC_KEY: process.env.FAUCET_PUBLIC_KEY, FAUCET_PRIVATE_KEY: process.env.FAUCET_PRIVATE_KEY, + WALLET_CONNECT_PROJECT_ID: process.env.WALLET_CONNECT_PROJECT_ID, + WALLET_CONNECT_RELAY_URL: process.env.WALLET_CONNECT_RELAY_URL, }, webpack: (config, { isServer }) => { config.module.rules.push({ diff --git a/packages/apps/tools/package.json b/packages/apps/tools/package.json index 0250cb00fe..aa335e957a 100644 --- a/packages/apps/tools/package.json +++ b/packages/apps/tools/package.json @@ -40,7 +40,12 @@ "react-dom": "^18.2.0", "react-hook-form": "~7.45.0", "react-scripts": "5.0.1", - "zod": "~3.18.0" + "zod": "~3.18.0", + "@walletconnect/encoding": "~1.0.2", + "@walletconnect/modal": "~2.6.1", + "@walletconnect/sign-client": "~2.8.1", + "@walletconnect/types": "~2.8.1", + "@walletconnect/utils": "~2.9.2" }, "devDependencies": { "@jest/reporters": "~29.5.0", diff --git a/packages/apps/tools/src/components/Common/Layout/index.spec.tsx b/packages/apps/tools/src/components/Common/Layout/index.spec.tsx index 8b156983ba..3b98b7ea70 100644 --- a/packages/apps/tools/src/components/Common/Layout/index.spec.tsx +++ b/packages/apps/tools/src/components/Common/Layout/index.spec.tsx @@ -1,3 +1,7 @@ +jest.mock('@/components/Common/WalletConnectButton', () => + jest.fn(() => ), +); + import Layout from './index'; import { render } from '@testing-library/react'; diff --git a/packages/apps/tools/src/components/Common/Layout/index.tsx b/packages/apps/tools/src/components/Common/Layout/index.tsx index d1befb51bf..ae37304f8a 100644 --- a/packages/apps/tools/src/components/Common/Layout/index.tsx +++ b/packages/apps/tools/src/components/Common/Layout/index.tsx @@ -1,7 +1,7 @@ import { FooterWrapper, Header, Sidebar } from './partials'; import { footerStyle, gridItemMainStyle, headerStyle } from './styles.css'; -import { WalletConnectButton } from '@/components/Global'; +import WalletConnectButton from '@/components/Common/WalletConnectButton'; import routes from '@/constants/routes'; import { useLayoutContext } from '@/context'; import classNames from 'classnames'; diff --git a/packages/apps/tools/src/components/Common/WalletConnectButton/index.tsx b/packages/apps/tools/src/components/Common/WalletConnectButton/index.tsx new file mode 100644 index 0000000000..3258102f60 --- /dev/null +++ b/packages/apps/tools/src/components/Common/WalletConnectButton/index.tsx @@ -0,0 +1,40 @@ +import { Button } from '@kadena/react-ui'; + +import { useWalletConnectClient } from '@/context/connect-wallet-context'; +import useTranslation from 'next-translate/useTranslation'; +import React, { FC } from 'react'; + +const WalletConnectButton: FC = () => { + const { connect, isInitializing, disconnect, session } = + useWalletConnectClient(); + const { t } = useTranslation(); + + const handleClick = async (): Promise => { + if (session) { + await disconnect(); + return; + } + + await connect(); + }; + + const buttonTitle = session + ? t('Disconnect your wallet') + : t('Connect your wallet'); + + return ( + + ); +}; + +export default WalletConnectButton; diff --git a/packages/apps/tools/src/components/Global/WalletConnectButton/index.tsx b/packages/apps/tools/src/components/Global/WalletConnectButton/index.tsx deleted file mode 100644 index 6bc8951298..0000000000 --- a/packages/apps/tools/src/components/Global/WalletConnectButton/index.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { Button } from '@kadena/react-ui'; - -import useTranslation from 'next-translate/useTranslation'; -import React, { FC } from 'react'; - -export const WalletConnectButton: FC = () => { - const { t } = useTranslation(); - return ( - - ); -}; diff --git a/packages/apps/tools/src/components/Global/index.ts b/packages/apps/tools/src/components/Global/index.ts index cfe623bbe4..b553aedae5 100644 --- a/packages/apps/tools/src/components/Global/index.ts +++ b/packages/apps/tools/src/components/Global/index.ts @@ -3,7 +3,6 @@ export { Option } from '@/components/Global/Select/Option'; export { SidebarMenu } from '@/components/Global/SidebarMenu'; export { Container } from '@/components/Global/Container'; export { GridCol, GridRow } from '@/components/Global/Grid'; -export { WalletConnectButton } from '@/components/Global/WalletConnectButton'; export { ChainSelect, type OnChainSelectChange, diff --git a/packages/apps/tools/src/context/connect-wallet-context.tsx b/packages/apps/tools/src/context/connect-wallet-context.tsx new file mode 100644 index 0000000000..8b66a31834 --- /dev/null +++ b/packages/apps/tools/src/context/connect-wallet-context.tsx @@ -0,0 +1,244 @@ +import { env } from '@/utils/env'; +import { WalletConnectModal } from '@walletconnect/modal'; +import Client from '@walletconnect/sign-client'; +import { PairingTypes, SessionTypes } from '@walletconnect/types'; +import { getSdkError } from '@walletconnect/utils'; +import React, { + createContext, + FC, + ReactNode, + useCallback, + useContext, + useEffect, + useMemo, + useState, +} from 'react'; + +/** + * Types + */ +interface IWalletConnectClientContext { + client: Client | undefined; + session: SessionTypes.Struct | undefined; + connect: (pairing?: { topic: string }) => Promise; + disconnect: () => Promise; + isInitializing: boolean; + pairings: PairingTypes.Struct[]; + accounts: string[] | undefined; +} + +/** + * Context + */ +export const WalletConnectClientContext = + createContext({} as IWalletConnectClientContext); + +/** + * walletConnectModal Config + */ +// eslint-disable-next-line @kadena-dev/typedef-var +const walletConnectModal = new WalletConnectModal({ + projectId: env('WALLET_CONNECT_PROJECT_ID', ''), + themeMode: 'light', +}); + +interface IWalletConnectClientContextProviderProps { + children: ReactNode; +} +/** + * Provider + */ +export const WalletConnectClientContextProvider: FC< + IWalletConnectClientContextProviderProps +> = ({ children }) => { + const [client, setClient] = useState(); + const [pairings, setPairings] = useState([]); + const [session, setSession] = useState(); + const [accounts, setAccounts] = useState(); + + const [isInitializing, setIsInitializing] = useState(false); + + const reset = (): void => { + setSession(undefined as unknown as SessionTypes.Struct); + setAccounts(undefined as unknown as string[]); + }; + + const onSessionConnected = useCallback( + async (clientSession: SessionTypes.Struct) => { + setSession(clientSession); + setAccounts(clientSession?.namespaces?.kadena?.accounts); + }, + [], + ); + + const connect = useCallback( + async (pairing?: { topic: string }) => { + if (typeof client === 'undefined') { + throw new Error('WalletConnect is not initialized'); + } + + try { + const { uri, approval } = await client.connect({ + pairingTopic: pairing?.topic ?? '', + + requiredNamespaces: { + kadena: { + methods: [ + 'kadena_getAccounts_v1', + 'kadena_sign_v1', + 'kadena_quicksign_v1', + ], + chains: [ + 'kadena:mainnet01', + 'kadena:testnet04', + 'kadena:development', + ], + events: [], + }, + }, + }); + + // Open QRCode modal if a URI was returned (i.e. we're not connecting an existing pairing). + if (uri) { + await walletConnectModal.openModal({ uri }); + } + + const session = await approval(); + await onSessionConnected(session); + // Update known pairings after session is connected. + setPairings(client.pairing.getAll({ active: true })); + } catch (e) { + console.error(e); + // ignore rejection + } finally { + // close modal in case it was open + walletConnectModal.closeModal(); + } + }, + [client, onSessionConnected], + ); + + const disconnect = useCallback(async () => { + if (typeof client === 'undefined') { + throw new Error('WalletConnect is not initialized'); + } + if (typeof session === 'undefined') { + throw new Error('Session is not connected'); + } + + try { + await client.disconnect({ + topic: session.topic, + reason: getSdkError('USER_DISCONNECTED'), + }); + } catch (error) { + console.error('SignClient.disconnect failed:', error); + } finally { + // Reset app state after disconnect. + reset(); + } + }, [client, session]); + + const subscribeToEvents = useCallback( + async (signClient: Client) => { + if (typeof signClient === 'undefined') { + throw new Error('WalletConnect is not initialized'); + } + + signClient.on('session_update', ({ topic, params }) => { + const { namespaces } = params; + const clientSession = signClient.session.get(topic); + const updatedSession = { ...clientSession, namespaces }; + onSessionConnected(updatedSession) + .then(console.log) + .catch(console.error); + }); + + signClient.on('session_delete', () => { + reset(); + }); + }, + [onSessionConnected], + ); + + const checkPersistedState = useCallback( + async (signClient: Client) => { + if (typeof signClient === 'undefined') { + throw new Error('WalletConnect is not initialized'); + } + // populates existing pairings to state + setPairings(signClient.pairing.getAll({ active: true })); + + if (typeof session !== 'undefined') return; + // populates (the last) existing session to state + if (signClient.session.length) { + const lastKeyIndex = signClient.session.keys.length - 1; + const clientSession = signClient.session.get( + signClient.session.keys[lastKeyIndex], + ); + await onSessionConnected(clientSession); + return clientSession; + } + }, + [session, onSessionConnected], + ); + + const createClient = useCallback(async () => { + try { + setIsInitializing(true); + + const _client = await Client.init({ + relayUrl: env('WALLET_CONNECT_RELAY_URL', ''), + projectId: env('WALLET_CONNECT_PROJECT_ID', ''), + }); + + setClient(_client); + await subscribeToEvents(_client); + await checkPersistedState(_client); + // eslint-disable-next-line no-useless-catch + } catch (err) { + throw err; + } finally { + setIsInitializing(false); + } + }, [checkPersistedState, subscribeToEvents]); + + useEffect(() => { + if (!client) { + createClient().then(console.log).catch(console.error); + } + }, [client, createClient]); + + const value = useMemo( + () => ({ + pairings, + isInitializing, + accounts, + client, + session, + connect, + disconnect, + }), + [pairings, isInitializing, accounts, client, session, connect, disconnect], + ); + + return ( + + {children} + + ); +}; + +export const useWalletConnectClient = (): IWalletConnectClientContext => { + const context = useContext(WalletConnectClientContext); + if (!context) { + throw new Error( + 'useWalletConnectClient must be used within a WalletConnectClientContextProvider', + ); + } + return context; +}; diff --git a/packages/apps/tools/src/pages/_app.tsx b/packages/apps/tools/src/pages/_app.tsx index aaa38c37c0..42da35ca4e 100644 --- a/packages/apps/tools/src/pages/_app.tsx +++ b/packages/apps/tools/src/pages/_app.tsx @@ -5,6 +5,7 @@ import { darkThemeClass } from '@kadena/react-ui/theme'; import { Layout } from '@/components/Common'; import { AppContextProvider, LayoutContextProvider } from '@/context'; +import { WalletConnectClientContextProvider } from '@/context/connect-wallet-context'; import type { AppProps } from 'next/app'; import { ThemeProvider } from 'next-themes'; import React, { FC } from 'react'; @@ -18,15 +19,17 @@ const App: FC = ({ Component, pageProps }: AppProps) => ( dark: darkThemeClass, }} > - - - - - - - - - + + + + + + + + + + + ); diff --git a/packages/apps/tools/src/services/faucet/index.ts b/packages/apps/tools/src/services/faucet/index.ts index 294d527647..69c907e6b9 100644 --- a/packages/apps/tools/src/services/faucet/index.ts +++ b/packages/apps/tools/src/services/faucet/index.ts @@ -39,8 +39,10 @@ export const fundExistingAccount = async ( new PactNumber(amount).toPactDecimal(), ), ) - .addSigner(FAUCET_PUBLIC_KEY, (withCap) => [withCap('coin.GAS')]) - .addSigner(keyPair.publicKey, (withCap) => [ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + .addSigner(FAUCET_PUBLIC_KEY, (withCap: any) => [withCap('coin.GAS')]) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + .addSigner(keyPair.publicKey, (withCap: any) => [ withCap( 'coin.TRANSFER', SENDER_ACCOUNT, diff --git a/packages/apps/tools/src/utils/env.ts b/packages/apps/tools/src/utils/env.ts index b7aa204fee..dbd6e448ae 100644 --- a/packages/apps/tools/src/utils/env.ts +++ b/packages/apps/tools/src/utils/env.ts @@ -9,6 +9,8 @@ export interface IEnvInterface { FAUCET_PRIVATE_KEY?: string; GAS_PRICE?: number; DEFAULT_SENDER?: string; + WALLET_CONNECT_PROJECT_ID?: string; + WALLET_CONNECT_RELAY_URL?: string; } type RequiredEnv = Required; @@ -24,6 +26,8 @@ export const dotenv: IEnvInterface = { FAUCET_PRIVATE_KEY: process.env.FAUCET_PRIVATE_KEY, GAS_PRICE: Number(process.env.GAS_PRICE), DEFAULT_SENDER: process.env.DEFAULT_SENDER, + WALLET_CONNECT_PROJECT_ID: process.env.WALLET_CONNECT_PROJECT_ID, + WALLET_CONNECT_RELAY_URL: process.env.WALLET_CONNECT_RELAY_URL, }; export const env = (