From 5488457ad0a2d675ad44ad06a167d4d6f815038e Mon Sep 17 00:00:00 2001 From: gastlypok Date: Wed, 13 Mar 2024 18:22:01 +0100 Subject: [PATCH 01/35] Test user rights --- components/AmountInCurrency.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/AmountInCurrency.vue b/components/AmountInCurrency.vue index 48f21975..96157464 100644 --- a/components/AmountInCurrency.vue +++ b/components/AmountInCurrency.vue @@ -1,6 +1,6 @@ + + diff --git a/components/TheHeader.vue b/components/TheHeader.vue index 355a3f34..60ea1e57 100644 --- a/components/TheHeader.vue +++ b/components/TheHeader.vue @@ -26,19 +26,9 @@ const showPopup = ref(false) const head = computed(() => appStore.lastHead) const featurePreviewMode = ref(false) -const isWalletAvailable = ref(false) - -const account = ref("") - -const getAccounts = async () => { - const offlineSigner = window.getOfflineSigner("celestia") - const accounts = await offlineSigner.getAccounts() - if (accounts.length) account.value = accounts[0].address -} onMounted(async () => { featurePreviewMode.value = localStorage.featurePreview - isWalletAvailable.value = !!window.keplr }) watch( @@ -86,12 +76,6 @@ const isActive = (link) => { const handleNavigate = (url) => { window.location.replace(url) } - -const handleConnect = async () => { - await window.keplr.enable("celestia") - - getAccounts() -} - + @@ -214,7 +190,6 @@ const handleConnect = async () => { Namespaces - diff --git a/package.json b/package.json index 9c91f0c6..5b8b32be 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "dependencies": { "@amplitude/analytics-browser": "^2.3.3", "@codemirror/lang-json": "^6.0.1", + "@keplr-wallet/cosmos": "^0.12.70", "@pinia/nuxt": "0.4.11", "@vueuse/core": "^10.7.0", "codemirror": "^6.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6c9bb00b..3c9927a9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,9 @@ dependencies: '@codemirror/lang-json': specifier: ^6.0.1 version: 6.0.1 + '@keplr-wallet/cosmos': + specifier: ^0.12.70 + version: 0.12.70 '@pinia/nuxt': specifier: 0.4.11 version: 0.4.11(vue@3.4.13) @@ -845,6 +848,48 @@ packages: requiresBuild: true optional: true + /@ethersproject/address@5.7.0: + resolution: {integrity: sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==} + dependencies: + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.7.0 + '@ethersproject/keccak256': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/rlp': 5.7.0 + dev: false + + /@ethersproject/bignumber@5.7.0: + resolution: {integrity: sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==} + dependencies: + '@ethersproject/bytes': 5.7.0 + '@ethersproject/logger': 5.7.0 + bn.js: 5.2.1 + dev: false + + /@ethersproject/bytes@5.7.0: + resolution: {integrity: sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==} + dependencies: + '@ethersproject/logger': 5.7.0 + dev: false + + /@ethersproject/keccak256@5.7.0: + resolution: {integrity: sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==} + dependencies: + '@ethersproject/bytes': 5.7.0 + js-sha3: 0.8.0 + dev: false + + /@ethersproject/logger@5.7.0: + resolution: {integrity: sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==} + dev: false + + /@ethersproject/rlp@5.7.0: + resolution: {integrity: sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==} + dependencies: + '@ethersproject/bytes': 5.7.0 + '@ethersproject/logger': 5.7.0 + dev: false + /@fastify/busboy@2.1.0: resolution: {integrity: sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==} engines: {node: '>=14'} @@ -929,6 +974,70 @@ packages: '@jridgewell/resolve-uri': 3.1.1 '@jridgewell/sourcemap-codec': 1.4.15 + /@keplr-wallet/common@0.12.70: + resolution: {integrity: sha512-XtVdlYEF5dMjwBugMsuRtq9DnoK9W+VoSYPdWoNcS3lG37m8/rB0Fs+hBW46hJ00Vx/4WqGMepARsvxIubit7w==} + dependencies: + '@keplr-wallet/crypto': 0.12.70 + '@keplr-wallet/types': 0.12.70 + buffer: 6.0.3 + delay: 4.4.1 + mobx: 6.12.0 + dev: false + + /@keplr-wallet/cosmos@0.12.70: + resolution: {integrity: sha512-8UZSP/q8wvUs8sc9ap7JMNKEDMRvtKLJ7De7bp/VCSMlJoYiv94/eF2U7Z+cdw2b/r34qyZ+VHlrzPQf9fSM9A==} + dependencies: + '@ethersproject/address': 5.7.0 + '@keplr-wallet/common': 0.12.70 + '@keplr-wallet/crypto': 0.12.70 + '@keplr-wallet/proto-types': 0.12.70 + '@keplr-wallet/simple-fetch': 0.12.70 + '@keplr-wallet/types': 0.12.70 + '@keplr-wallet/unit': 0.12.70 + bech32: 1.1.4 + buffer: 6.0.3 + long: 4.0.0 + protobufjs: 6.11.4 + dev: false + + /@keplr-wallet/crypto@0.12.70: + resolution: {integrity: sha512-jw8/jqG8rgkDPWdjnrBOmL1+u+Gjy+gs3hFsODZDQAzV2LNskgH0ySbBo0okVEjl735bUCl7ljfuqlmNIfdGwg==} + dependencies: + '@ethersproject/keccak256': 5.7.0 + bip32: 2.0.6 + bip39: 3.1.0 + bs58check: 2.1.2 + buffer: 6.0.3 + crypto-js: 4.2.0 + elliptic: 6.5.4 + sha.js: 2.4.11 + dev: false + + /@keplr-wallet/proto-types@0.12.70: + resolution: {integrity: sha512-RubyJhQ4eB90c4DjFQbEyY6uiWAKofi1rMcCTm2JXwKrIPjozzb2b4AeqkeRl4MxlN27DfQ1X69RugBalgev5A==} + dependencies: + long: 4.0.0 + protobufjs: 6.11.4 + dev: false + + /@keplr-wallet/simple-fetch@0.12.70: + resolution: {integrity: sha512-WYBIWGQgYpJe2sUnXcq2lWpMOS5+e5Q2abMpvaIVgQlwKJC3UVh9srXFYRVKOKfxPc1sc2WZhWztAsEsz33IKg==} + dev: false + + /@keplr-wallet/types@0.12.70: + resolution: {integrity: sha512-oOZEkWVOj/GCrKpcJR8EQKp6SvWHHzuZAwVkRnxJc9UKaaOE6kiOJnu02dl9jLhTziK2/JqUbXOsF/Hopw7xOQ==} + dependencies: + long: 4.0.0 + dev: false + + /@keplr-wallet/unit@0.12.70: + resolution: {integrity: sha512-yIfwa7R+z9hJdggGF0lcJN2JEfEP75XI1m3UCzL92P09r8QR5x0ZBxf3nsyt0BQIHlGEqhYaI5orWsJ1srNEQg==} + dependencies: + '@keplr-wallet/types': 0.12.70 + big-integer: 1.6.51 + utility-types: 3.11.0 + dev: false + /@kwsites/file-exists@1.1.1: resolution: {integrity: sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==} dependencies: @@ -997,6 +1106,11 @@ packages: '@netlify/node-cookies': 0.1.0 urlpattern-polyfill: 8.0.2 + /@noble/hashes@1.3.3: + resolution: {integrity: sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==} + engines: {node: '>= 16'} + dev: false + /@nodelib/fs.scandir@2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -1610,6 +1724,49 @@ packages: /@polka/url@1.0.0-next.24: resolution: {integrity: sha512-2LuNTFBIO0m7kKIQvvPHN6UE63VjpmL9rnEEaOOaiSPbZK+zUOYIzBAWcED+3XYzhYsd/0mD57VdxAEqqV52CQ==} + /@protobufjs/aspromise@1.1.2: + resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==} + dev: false + + /@protobufjs/base64@1.1.2: + resolution: {integrity: sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==} + dev: false + + /@protobufjs/codegen@2.0.4: + resolution: {integrity: sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==} + dev: false + + /@protobufjs/eventemitter@1.1.0: + resolution: {integrity: sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==} + dev: false + + /@protobufjs/fetch@1.1.0: + resolution: {integrity: sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==} + dependencies: + '@protobufjs/aspromise': 1.1.2 + '@protobufjs/inquire': 1.1.0 + dev: false + + /@protobufjs/float@1.0.2: + resolution: {integrity: sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==} + dev: false + + /@protobufjs/inquire@1.1.0: + resolution: {integrity: sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==} + dev: false + + /@protobufjs/path@1.1.2: + resolution: {integrity: sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==} + dev: false + + /@protobufjs/pool@1.1.0: + resolution: {integrity: sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==} + dev: false + + /@protobufjs/utf8@1.1.0: + resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==} + dev: false + /@resvg/resvg-js-android-arm-eabi@2.4.1: resolution: {integrity: sha512-AA6f7hS0FAPpvQMhBCf6f1oD1LdlqNXKCxAAPpKh6tR11kqV0YIB9zOlIYgITM14mq2YooLFl6XIbbvmY+jwUw==} engines: {node: '>= 10'} @@ -2074,6 +2231,14 @@ packages: '@types/node': 20.6.5 dev: true + /@types/long@4.0.2: + resolution: {integrity: sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==} + dev: false + + /@types/node@10.12.18: + resolution: {integrity: sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==} + dev: false + /@types/node@20.6.5: resolution: {integrity: sha512-2qGq5LAOTh9izcc0+F+dToFigBWiK1phKPt7rNhOqJSr35y8rlIBjDwGtFSgAI6MGIhjwOVNSQZVdJsZJ2uR1w==} @@ -2945,11 +3110,25 @@ packages: /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + /base-x@3.0.9: + resolution: {integrity: sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==} + dependencies: + safe-buffer: 5.2.1 + dev: false + /base64-js@0.0.8: resolution: {integrity: sha512-3XSA2cR/h/73EzlXXdU6YNycmYI7+kicTxks4eJg2g39biHR84slg2+des+p7iHYhbRg/udIS4TD53WabcOUkw==} engines: {node: '>= 0.4'} dev: true + /base64-js@1.5.1: + resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + dev: false + + /bech32@1.1.4: + resolution: {integrity: sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==} + dev: false + /big-integer@1.6.51: resolution: {integrity: sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==} engines: {node: '>=0.6'} @@ -2963,9 +3142,36 @@ packages: dependencies: file-uri-to-path: 1.0.0 + /bip32@2.0.6: + resolution: {integrity: sha512-HpV5OMLLGTjSVblmrtYRfFFKuQB+GArM0+XP8HGWfJ5vxYBqo+DesvJwOdC2WJ3bCkZShGf0QIfoIpeomVzVdA==} + engines: {node: '>=6.0.0'} + dependencies: + '@types/node': 10.12.18 + bs58check: 2.1.2 + create-hash: 1.2.0 + create-hmac: 1.1.7 + tiny-secp256k1: 1.1.6 + typeforce: 1.18.0 + wif: 2.0.6 + dev: false + + /bip39@3.1.0: + resolution: {integrity: sha512-c9kiwdk45Do5GL0vJMe7tS95VjCii65mYAH7DfWl3uW8AVzXKQVUm64i3hzVybBDMp9r7j9iNxR85+ul8MdN/A==} + dependencies: + '@noble/hashes': 1.3.3 + dev: false + /birpc@0.2.14: resolution: {integrity: sha512-37FHE8rqsYM5JEKCnXFyHpBCzvgHEExwVVTq+nUmloInU7l8ezD1TpOhKpS8oe1DTYFqEK27rFZVKG43oTqXRA==} + /bn.js@4.12.0: + resolution: {integrity: sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==} + dev: false + + /bn.js@5.2.1: + resolution: {integrity: sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==} + dev: false + /boolbase@1.0.0: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} @@ -2992,6 +3198,10 @@ packages: dependencies: fill-range: 7.0.1 + /brorand@1.1.0: + resolution: {integrity: sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==} + dev: false + /browserslist@4.21.11: resolution: {integrity: sha512-xn1UXOKUz7DjdGlg9RrUr0GGiWzI97UQJnugHtH0OLDfJB7jMgoIkYvRIEO1l9EeEERVqeqLYOcFBW9ldjypbQ==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} @@ -3012,12 +3222,33 @@ packages: node-releases: 2.0.14 update-browserslist-db: 1.0.13(browserslist@4.22.2) + /bs58@4.0.1: + resolution: {integrity: sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==} + dependencies: + base-x: 3.0.9 + dev: false + + /bs58check@2.1.2: + resolution: {integrity: sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==} + dependencies: + bs58: 4.0.1 + create-hash: 1.2.0 + safe-buffer: 5.2.1 + dev: false + /buffer-crc32@0.2.13: resolution: {integrity: sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==} /buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + /buffer@6.0.3: + resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + dev: false + /builtin-modules@3.3.0: resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} engines: {node: '>=6'} @@ -3187,6 +3418,13 @@ packages: resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} engines: {node: '>=8'} + /cipher-base@1.0.4: + resolution: {integrity: sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==} + dependencies: + inherits: 2.0.4 + safe-buffer: 5.2.1 + dev: false + /citty@0.1.4: resolution: {integrity: sha512-Q3bK1huLxzQrvj7hImJ7Z1vKYJRPQCDnd0EjXfHMidcjecGOMuLrmuQmtWmFkuKLcMThlGh1yCKG8IEc6VeNXQ==} dependencies: @@ -3327,6 +3565,27 @@ packages: crc-32: 1.2.2 readable-stream: 3.6.2 + /create-hash@1.2.0: + resolution: {integrity: sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==} + dependencies: + cipher-base: 1.0.4 + inherits: 2.0.4 + md5.js: 1.3.5 + ripemd160: 2.0.2 + sha.js: 2.4.11 + dev: false + + /create-hmac@1.1.7: + resolution: {integrity: sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==} + dependencies: + cipher-base: 1.0.4 + create-hash: 1.2.0 + inherits: 2.0.4 + ripemd160: 2.0.2 + safe-buffer: 5.2.1 + sha.js: 2.4.11 + dev: false + /create-require@1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} @@ -3350,6 +3609,10 @@ packages: shebang-command: 2.0.0 which: 2.0.2 + /crypto-js@4.2.0: + resolution: {integrity: sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==} + dev: false + /css-background-parser@0.1.0: resolution: {integrity: sha512-2EZLisiZQ+7m4wwur/qiYJRniHX4K5Tc9w93MT3AS0WS1u5kaZ4FKXlOTBhOjc+CgEgPiGY+fX1yWD8UwpEqUA==} dev: true @@ -3795,6 +4058,11 @@ packages: robust-predicates: 3.0.2 dev: false + /delay@4.4.1: + resolution: {integrity: sha512-aL3AhqtfhOlT/3ai6sWXeqwnw63ATNpnUiN4HL7x9q+My5QtHlO3OIkasmug9LKzpheLdmUKGRKnYXYAS7FQkQ==} + engines: {node: '>=6'} + dev: false + /delegates@1.0.0: resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} @@ -3889,6 +4157,18 @@ packages: /electron-to-chromium@1.4.615: resolution: {integrity: sha512-/bKPPcgZVUziECqDc+0HkT87+0zhaWSZHNXqF8FLd2lQcptpmUFwoCSWjCdOng9Gdq+afKArPdEg/0ZW461Eng==} + /elliptic@6.5.4: + resolution: {integrity: sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==} + dependencies: + bn.js: 4.12.0 + brorand: 1.1.0 + hash.js: 1.1.7 + hmac-drbg: 1.0.1 + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + minimalistic-crypto-utils: 1.0.1 + dev: false + /emoji-regex@10.2.1: resolution: {integrity: sha512-97g6QgOk8zlDRdgq1WxwgTMgEWGVAQvB5Fdpgc1MkNy56la5SKP9GsMXKDOdqwn90/41a8yPwIGk1Y6WVbeMQA==} dev: true @@ -4454,14 +4734,38 @@ packages: dependencies: function-bind: 1.1.1 + /hash-base@3.1.0: + resolution: {integrity: sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==} + engines: {node: '>=4'} + dependencies: + inherits: 2.0.4 + readable-stream: 3.6.2 + safe-buffer: 5.2.1 + dev: false + /hash-sum@2.0.0: resolution: {integrity: sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg==} + /hash.js@1.1.7: + resolution: {integrity: sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==} + dependencies: + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + dev: false + /hex-rgb@4.3.0: resolution: {integrity: sha512-Ox1pJVrDCyGHMG9CFg1tmrRUMRPRsAWYc/PinY0XzJU4K7y7vjNoLKIQ7BR5UJMCxNN8EM1MNDmHWA/B3aZUuw==} engines: {node: '>=6'} dev: true + /hmac-drbg@1.0.1: + resolution: {integrity: sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==} + dependencies: + hash.js: 1.1.7 + minimalistic-assert: 1.0.1 + minimalistic-crypto-utils: 1.0.1 + dev: false + /hookable@5.5.3: resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} @@ -4556,6 +4860,10 @@ packages: dependencies: safer-buffer: 2.1.2 + /ieee754@1.2.1: + resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + dev: false + /ignore-walk@6.0.3: resolution: {integrity: sha512-C7FfFoTA+bI10qfeydT8aZbvr91vAEU+2W5BZUlzPec47oNb07SsOfwYrtxuvOYdUApPP/Qlh4DtAO51Ekk2QA==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -4769,6 +5077,10 @@ packages: resolution: {integrity: sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==} hasBin: true + /js-sha3@0.8.0: + resolution: {integrity: sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==} + dev: false + /js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -4964,6 +5276,10 @@ packages: /lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + /long@4.0.0: + resolution: {integrity: sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==} + dev: false + /lru-cache@10.0.3: resolution: {integrity: sha512-B7gr+F6MkqB3uzINHXNctGieGsRTMwIBgxkp0yq/5BwcuDzD4A8wQpHQW6vDAm1uKSLQghmRdD9sKqf2vJ1cEg==} engines: {node: 14 || >=16.14} @@ -5061,6 +5377,14 @@ packages: resolution: {integrity: sha512-q9JtQJKjpsVxCRVgQ+WapguSbKC3SQ5HEzFGPAJMStgh3QjCawp00UKv3MTTAArTmGmmPUvllHZoNbZ3gs0I+Q==} dev: true + /md5.js@1.3.5: + resolution: {integrity: sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==} + dependencies: + hash-base: 3.1.0 + inherits: 2.0.4 + safe-buffer: 5.2.1 + dev: false + /mdn-data@2.0.28: resolution: {integrity: sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==} @@ -5116,6 +5440,14 @@ packages: resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} engines: {node: '>=12'} + /minimalistic-assert@1.0.1: + resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} + dev: false + + /minimalistic-crypto-utils@1.0.1: + resolution: {integrity: sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==} + dev: false + /minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: @@ -5207,6 +5539,10 @@ packages: pkg-types: 1.0.3 ufo: 1.3.1 + /mobx@6.12.0: + resolution: {integrity: sha512-Mn6CN6meXEnMa0a5u6a5+RKrqRedHBhZGd15AWLk9O6uFY4KYHzImdt8JI8WODo1bjTSRnwXhJox+FCUZhCKCQ==} + dev: false + /mri@1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} engines: {node: '>=4'} @@ -5228,6 +5564,10 @@ packages: /ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + /nan@2.18.0: + resolution: {integrity: sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w==} + dev: false + /nanoid@3.3.7: resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -6382,6 +6722,26 @@ packages: kleur: 3.0.3 sisteransi: 1.0.5 + /protobufjs@6.11.4: + resolution: {integrity: sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==} + hasBin: true + requiresBuild: true + dependencies: + '@protobufjs/aspromise': 1.1.2 + '@protobufjs/base64': 1.1.2 + '@protobufjs/codegen': 2.0.4 + '@protobufjs/eventemitter': 1.1.0 + '@protobufjs/fetch': 1.1.0 + '@protobufjs/float': 1.0.2 + '@protobufjs/inquire': 1.1.0 + '@protobufjs/path': 1.1.2 + '@protobufjs/pool': 1.1.0 + '@protobufjs/utf8': 1.1.0 + '@types/long': 4.0.2 + '@types/node': 20.6.5 + long: 4.0.0 + dev: false + /protocols@2.0.1: resolution: {integrity: sha512-/XJ368cyBJ7fzLMwLKv1e4vLxOju2MNAIokcr7meSaNcVbWz/CPcW22cP04mwxOErdA5mwjA8Q6w/cdAQxVn7Q==} @@ -6530,6 +6890,13 @@ packages: dependencies: glob: 7.2.3 + /ripemd160@2.0.2: + resolution: {integrity: sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==} + dependencies: + hash-base: 3.1.0 + inherits: 2.0.4 + dev: false + /robust-predicates@3.0.2: resolution: {integrity: sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg==} dev: false @@ -6740,6 +7107,14 @@ packages: /setprototypeof@1.2.0: resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} + /sha.js@2.4.11: + resolution: {integrity: sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==} + hasBin: true + dependencies: + inherits: 2.0.4 + safe-buffer: 5.2.1 + dev: false + /shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} @@ -7140,6 +7515,18 @@ packages: /tiny-invariant@1.3.1: resolution: {integrity: sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==} + /tiny-secp256k1@1.1.6: + resolution: {integrity: sha512-FmqJZGduTyvsr2cF3375fqGHUovSwDi/QytexX1Se4BPuPZpTE5Ftp5fg+EFSuEf3lhZqgCRjEG3ydUQ/aNiwA==} + engines: {node: '>=6.0.0'} + requiresBuild: true + dependencies: + bindings: 1.5.0 + bn.js: 4.12.0 + create-hmac: 1.1.7 + elliptic: 6.5.4 + nan: 2.18.0 + dev: false + /tinyws@0.1.0(ws@8.14.2): resolution: {integrity: sha512-6WQ2FlFM7qm6lAXxeKnzsAEfmnBHz5W5EwonNs52V0++YfK1IoCCAWM429afcChFE9BFrDgOFnq7ligaWMsa/A==} engines: {node: '>=12.4'} @@ -7209,6 +7596,10 @@ packages: resolution: {integrity: sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==} engines: {node: '>=14.16'} + /typeforce@1.18.0: + resolution: {integrity: sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g==} + dev: false + /ufo@1.3.1: resolution: {integrity: sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==} @@ -7549,6 +7940,11 @@ packages: /util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + /utility-types@3.11.0: + resolution: {integrity: sha512-6Z7Ma2aVEWisaL6TvBCy7P8rm2LQoPv6dJ7ecIaIixHcwfbJ0x7mWdbcwlIM5IGQxPZSFYeqRCqlOOeKoJYMkw==} + engines: {node: '>= 4'} + dev: false + /uuid@9.0.1: resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} hasBin: true @@ -7895,6 +8291,12 @@ packages: dependencies: string-width: 4.2.3 + /wif@2.0.6: + resolution: {integrity: sha512-HIanZn1zmduSF+BQhkE+YXIbEiH0xPr1012QbFEGB0xsKqJii0/SqJjyn8dFv6y36kOznMgMB+LGcbZTJ1xACQ==} + dependencies: + bs58check: 2.1.2 + dev: false + /wrap-ansi@6.2.0: resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} engines: {node: '>=8'} diff --git a/services/keplr.js b/services/keplr.js new file mode 100644 index 00000000..f8b654c7 --- /dev/null +++ b/services/keplr.js @@ -0,0 +1,149 @@ +import { TendermintTxTracer } from "@keplr-wallet/cosmos" + +export const suggestChain = () => { + return new Promise(async (resolve, reject) => { + try { + await window.keplr.experimentalSuggestChain({ + chainId: "mocha-4", + chainName: "Mocha Testnet", + rpc: "https://rpc-mocha.pops.one/", + rest: "https://api-mocha.pops.one/", + bip44: { + coinType: 118, + }, + bech32Config: { + bech32PrefixAccAddr: "celestia", + bech32PrefixAccPub: "celestia" + "pub", + bech32PrefixValAddr: "celestia" + "valoper", + bech32PrefixValPub: "celestia" + "valoperpub", + bech32PrefixConsAddr: "celestia" + "valcons", + bech32PrefixConsPub: "celestia" + "valconspub", + }, + currencies: [ + { + coinDenom: "TIA", + coinMinimalDenom: "utia", + coinDecimals: 6, + coinGeckoId: "celestia", + }, + ], + feeCurrencies: [ + { + coinDenom: "TIA", + coinMinimalDenom: "utia", + coinDecimals: 6, + coinGeckoId: "celestia", + gasPriceStep: { + low: 0.01, + average: 0.02, + high: 0.1, + }, + }, + ], + stakeCurrency: { + coinDenom: "TIA", + coinMinimalDenom: "utia", + coinDecimals: 6, + coinGeckoId: "celestia", + }, + }) + + await window.keplr.enable("mocha-4") + + resolve({ success: true }) + } catch (error) { + reject({ success: false, message: error.message }) + } + }) +} + +export const getAccounts = () => { + return new Promise(async (resolve, reject) => { + try { + const offlineSigner = window.getOfflineSigner("mocha-4") + const accounts = await offlineSigner.getAccounts() + resolve(accounts) + } catch (error) { + reject(error.message) + } + }) +} + +export const sendMsgs = async (sender, proto, fee, memo = "") => { + const account = await fetchAccountInfo(sender) + const { pubKey } = await window.keplr.getKey("mocha-4") + + if (account) { + const signDoc = { + bodyBytes: TxBody.encode( + TxBody.fromPartial({ + messages: proto, + memo, + }), + ).finish(), + authInfoBytes: AuthInfo.encode({ + signerInfos: [ + { + publicKey: { + typeUrl: "/cosmos.crypto.secp256k1.PubKey", + value: PubKey.encode({ + key: pubKey, + }).finish(), + }, + modeInfo: { + single: { + mode: SignMode.SIGN_MODE_DIRECT, + }, + multi: undefined, + }, + sequence: account.sequence, + }, + ], + fee: Fee.fromPartial({ + amount: fee.amount.map((coin) => { + return { + denom: coin.denom, + amount: coin.amount.toString(), + } + }), + gasLimit: fee.gas, + }), + }).finish(), + chainId: "mocha-4", + accountNumber: Long.fromString(account.account_number), + } + + const signed = await window.keplr.signDirect("mocha-4", sender, signDoc) + + const signedTx = { + tx: TxRaw.encode({ + bodyBytes: signed.signed.bodyBytes, + authInfoBytes: signed.signed.authInfoBytes, + signatures: [Buffer.from(signed.signature.signature, "base64")], + }).finish(), + signDoc: signed.signed, + } + + const txHash = await broadcastTxSync(window.keplr, "mocha-4", signedTx.tx) + const txTracer = new TendermintTxTracer("https://rpc-mocha.pops.one/", "/websocket") + txTracer.traceTx(txHash).then((tx) => { + alert("Transaction commit successfully") + }) + } +} + +export const fetchAccountInfo = async (address) => { + try { + const uri = `https://api-mocha.pops.one/cosmos/auth/v1beta1/accounts/${address}` + const response = await fetch(uri) + + return response.account + } catch (e) { + console.error("This may be a new account. Please send some tokens to this account first.") + return undefined + } +} + +export const broadcastTxSync = async (tx) => { + return window.keplr.sendTx("mocha-4", tx, "sync") +} From 0adca1a9b4f0c12ffd3d478b5f1eca06c44fde51 Mon Sep 17 00:00:00 2001 From: gastlypok Date: Sun, 24 Mar 2024 13:01:44 +0100 Subject: [PATCH 06/35] Fix diaply zero price diff --- components/Feed.vue | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/components/Feed.vue b/components/Feed.vue index b858b083..e2501e8c 100644 --- a/components/Feed.vue +++ b/components/Feed.vue @@ -32,7 +32,11 @@ onMounted(async () => { const prevDayClosePrice = parseFloat(series.value[1].close) price.diff = (Math.abs(prevDayClosePrice - price.value) / ((prevDayClosePrice + price.value) / 2)) * 100 - price.side = price.value - prevDayClosePrice > 0 ? "rise" : "fall" + let side = 'stay' + if (price.value - prevDayClosePrice !== 0) { + side = price.value - prevDayClosePrice > 0 ? 'rise' : 'fall' + } + price.side = side }) @@ -122,11 +126,11 @@ onMounted(async () => { - + - + - + {{ price.diff.toFixed(2) }}% From 67216d4abd7fcdcf670ce711d39c5af7e2e7adcb Mon Sep 17 00:00:00 2001 From: gastlypok Date: Tue, 26 Mar 2024 14:10:45 +0100 Subject: [PATCH 07/35] Add USD prices for totals and widgets | change default gas price graph --- components/Feed.vue | 14 +++++++--- components/widgets/StakingWidget.vue | 38 +++++++++++++++++++++++----- pages/addresses.vue | 27 +++++++++++++------- pages/gas.vue | 8 +++--- 4 files changed, 63 insertions(+), 24 deletions(-) diff --git a/components/Feed.vue b/components/Feed.vue index e2501e8c..8c73e93d 100644 --- a/components/Feed.vue +++ b/components/Feed.vue @@ -16,6 +16,12 @@ import { useAppStore } from "@/store/app" const appStore = useAppStore() const head = computed(() => appStore.lastHead) +const currentPrice = computed(() => appStore.currentPrice) + +const totalSupply = computed(() => head.value.total_supply / 1_000_000) +const totalSupplyUSD = computed(() => totalSupply.value * currentPrice.value?.close) +const totalFees = computed(() => head.value.total_fee / 1_000_000) +const totalFeesUSD = computed(() => totalFees.value * currentPrice.value?.close) const series = ref([]) const price = reactive({ @@ -69,13 +75,13 @@ onMounted(async () => { Total Supply: - {{ abbreviate(head.total_supply / 1_000_000, 2) }} TIA + {{ abbreviate(totalSupply, 2) }} TIA - +
@@ -105,13 +111,13 @@ onMounted(async () => { Total Fees: - {{ abbreviate(parseInt(head.total_fee / 1_000_000)) }} TIA + {{ abbreviate(parseInt(totalFees)) }} TIA - + diff --git a/components/widgets/StakingWidget.vue b/components/widgets/StakingWidget.vue index b2fbeb01..e9137fcf 100644 --- a/components/widgets/StakingWidget.vue +++ b/components/widgets/StakingWidget.vue @@ -11,7 +11,15 @@ import { fetchValidatorsCount } from "@/services/api/validator"; /** Store */ import { useAppStore } from "@/store/app" const appStore = useAppStore() + +const currentPrice = computed(() => appStore.currentPrice) const lastHead = computed(() => appStore.lastHead) + +const totalSupply = computed(() => lastHead.value.total_supply / 1_000_000) +const totalSupplyUSD = computed(() => totalSupply.value * currentPrice.value?.close) +const totalVotingPower = computed(() => lastHead.value.total_voting_power) +const totalVotingPowerUSD = computed(() => totalVotingPower.value * currentPrice.value?.close) + const bondedShare = computed(() => shareOfTotal(lastHead?.value.total_voting_power * 1_000_000, lastHead?.value.total_supply, 2)) const isRefetching = ref(false) @@ -93,19 +101,35 @@ fillValidatorsGraph() Total Supply - - {{ abbreviate(lastHead.total_supply / 1_000_000, 2) }} TIA - + + + {{ abbreviate(totalSupply, 2) }} TIA + + + + Bonded - - - {{ abbreviate(lastHead.total_voting_power) }} TIA - + + + + {{ abbreviate(totalVotingPower) }} TIA + + + + diff --git a/pages/addresses.vue b/pages/addresses.vue index 6a52aaae..b4acf72e 100644 --- a/pages/addresses.vue +++ b/pages/addresses.vue @@ -197,16 +197,20 @@ const handleLast = async () => { - - {{ comma(address.first_height) }} - + + + {{ comma(address.first_height) }} + + - - {{ comma(address.last_height) }} - + + + {{ comma(address.last_height) }} + + @@ -290,15 +294,20 @@ const handleLast = async () => { & tr td { padding: 0; - padding-right: 24px; - padding-top: 10px; - padding-bottom: 10px; white-space: nowrap; &:first-child { padding-left: 16px; } + + & > a { + display: flex; + + min-height: 44px; + + padding-right: 24px; + } } } } diff --git a/pages/gas.vue b/pages/gas.vue index 443982a3..d29f1a78 100644 --- a/pages/gas.vue +++ b/pages/gas.vue @@ -18,14 +18,14 @@ const route = useRoute() const gasPrice = computed(() => appStore.gas) const visualizations = ref([ - { - title: "Line Chart", - value: "line", - }, { title: "Heatmap", value: "heatmap", }, + { + title: "Line Chart", + value: "line", + }, ]) const selectedVisualization = ref(visualizations.value[0].value) From bbdaaa3ee66735ac099d0b6f8c44f532866178f9 Mon Sep 17 00:00:00 2001 From: gastlypok Date: Tue, 26 Mar 2024 22:56:51 +0100 Subject: [PATCH 08/35] Add prev and next block buttons --- assets/icons.json | 1 + components/modules/block/BlockOverview.vue | 34 ++++++++++++++++++++-- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/assets/icons.json b/assets/icons.json index a144dd7b..6dca3f3e 100644 --- a/assets/icons.json +++ b/assets/icons.json @@ -80,6 +80,7 @@ "arrow-circle-broken-right": "M1.33989 14.7243C1.21271 14.2251 1.14912 13.9755 1.23096 13.7077C1.29628 13.494 1.47698 13.2615 1.66795 13.1454C1.90726 13 2.20332 13 2.79544 13H13.5857L11.2928 15.2929C10.9023 15.6834 10.9023 16.3166 11.2928 16.7071C11.6833 17.0976 12.3165 17.0976 12.707 16.7071L16.707 12.7071C17.0976 12.3166 17.0976 11.6834 16.707 11.2929L12.707 7.29289C12.3165 6.90237 11.6833 6.90237 11.2928 7.29289C10.9023 7.68342 10.9023 8.31658 11.2928 8.70711L13.5857 11H2.79544C2.20332 11 1.90726 11 1.66795 10.8546C1.47698 10.7385 1.29628 10.506 1.23096 10.2923C1.14912 10.0245 1.21271 9.77489 1.33989 9.27574C2.55203 4.51831 6.86511 1 11.9999 1C18.0751 1 22.9999 5.92487 22.9999 12C22.9999 18.0751 18.0751 23 11.9999 23C6.86511 23 2.55203 19.4817 1.33989 14.7243Z", "arrow-circle-right-up": "M 4.222 19.778 C 8.518 24.074 15.482 24.074 19.778 19.778 C 24.074 15.482 24.074 8.518 19.778 4.222 C 15.482 -0.074 8.518 -0.074 4.222 4.222 C -0.074 8.518 -0.074 15.482 4.222 19.778 Z M 8.464 15.536 C 8.276 15.348 8.171 15.094 8.171 14.829 C 8.171 14.563 8.276 14.309 8.464 14.121 L 12.414 10.171 L 9.172 10.171 C 8.62 10.171 8.172 9.723 8.172 9.171 C 8.172 8.619 8.62 8.171 9.172 8.171 L 14.828 8.171 C 15.38 8.171 15.828 8.619 15.828 9.171 L 15.828 14.828 C 15.828 15.38 15.38 15.828 14.828 15.828 C 14.276 15.828 13.828 15.38 13.828 14.828 L 13.828 11.586 L 9.878 15.536 C 9.488 15.926 8.854 15.926 8.464 15.536 Z", "arrow-circle-right-down": "M4.22183 4.22183C-0.0739431 8.51759 -0.0739431 15.4824 4.22183 19.7782C8.51759 24.0739 15.4824 24.0739 19.7782 19.7782C24.0739 15.4824 24.0739 8.51759 19.7782 4.22183C15.4824 -0.0739431 8.51759 -0.0739431 4.22183 4.22183ZM8.46447 8.46447C8.85499 8.07394 9.48816 8.07394 9.87868 8.46447L13.8284 12.4142V9.17157C13.8284 8.61929 14.2761 8.17157 14.8284 8.17157C15.3807 8.17157 15.8284 8.61929 15.8284 9.17157V14.8284C15.8284 15.3807 15.3807 15.8284 14.8284 15.8284H9.17157C8.61929 15.8284 8.17157 15.3807 8.17157 14.8284C8.17157 14.2761 8.61929 13.8284 9.17157 13.8284H12.4142L8.46447 9.87868C8.07394 9.48816 8.07394 8.85499 8.46447 8.46447Z", + "arrow-redo-right": "M18.4,10.6C16.55,9 14.15,8 11.5,8C6.85,8 2.92,11.03 1.54,15.22L3.9,16C4.95,12.81 7.95,10.5 11.5,10.5C13.45,10.5 15.23,11.22 16.62,12.38L13,16H22V7L18.4,10.6Z", "dots": "M5 10C3.89543 10 3 10.8954 3 12C3 13.1046 3.89543 14 5 14C6.10457 14 7 13.1046 7 12C7 10.8954 6.10457 10 5 10ZM10 12C10 10.8954 10.8954 10 12 10C13.1046 10 14 10.8954 14 12C14 13.1046 13.1046 14 12 14C10.8954 14 10 13.1046 10 12ZM17 12C17 10.8954 17.8954 10 19 10C20.1046 10 21 10.8954 21 12C21 13.1046 20.1046 14 19 14C17.8954 14 17 13.1046 17 12Z", "stars": "M15 1C15.4138 1 15.7848 1.25483 15.9333 1.64102L17.112 4.70544C17.4124 5.48648 17.5068 5.71155 17.6359 5.89315C17.7654 6.07536 17.9246 6.23455 18.1069 6.36411C18.2884 6.49323 18.5135 6.58763 19.2946 6.88803L22.359 8.06665C22.7452 8.21519 23 8.58623 23 9C23 9.41377 22.7452 9.78481 22.359 9.93335L19.2946 11.112C18.5135 11.4124 18.2884 11.5068 18.1069 11.6359C17.9246 11.7655 17.7655 11.9246 17.6359 12.1069C17.5068 12.2884 17.4124 12.5135 17.112 13.2946L15.9333 16.359C15.7848 16.7452 15.4138 17 15 17C14.5862 17 14.2152 16.7452 14.0667 16.359L12.888 13.2946C12.5876 12.5135 12.4932 12.2884 12.3641 12.1069C12.2345 11.9246 12.0754 11.7655 11.8931 11.6359C11.7116 11.5068 11.4865 11.4124 10.7054 11.112L7.64102 9.93335C7.25483 9.78481 7 9.41377 7 9C7 8.58623 7.25483 8.21519 7.64102 8.06665L10.7054 6.88803C11.4865 6.58763 11.7116 6.49323 11.8931 6.36411C12.0754 6.23455 12.2345 6.07535 12.3641 5.89315C12.4932 5.71155 12.5876 5.48648 12.888 4.70544L14.0667 1.64102C14.2152 1.25483 14.5862 1 15 1ZM6.5 12C6.87877 12 7.22503 12.214 7.39443 12.5528L8.17889 14.1217C8.46137 14.6867 8.54745 14.8493 8.65204 14.9849C8.75695 15.121 8.87896 15.243 9.01506 15.348C9.15075 15.4525 9.31333 15.5386 9.8783 15.8211L11.4472 16.6056C11.786 16.775 12 17.1212 12 17.5C12 17.8788 11.786 18.225 11.4472 18.3944L9.8783 19.1789C9.31333 19.4614 9.15075 19.5475 9.01506 19.652C8.87896 19.757 8.75695 19.879 8.65204 20.0151C8.54745 20.1507 8.46137 20.3133 8.17889 20.8783L7.39443 22.4472C7.22504 22.786 6.87877 23 6.5 23C6.12123 23 5.77497 22.786 5.60557 22.4472L4.82111 20.8783C4.53863 20.3133 4.45255 20.1507 4.34796 20.0151C4.24305 19.879 4.12104 19.757 3.98494 19.652C3.84925 19.5475 3.68667 19.4614 3.1217 19.1789L1.55279 18.3944C1.214 18.225 1 17.8788 1 17.5C1 17.1212 1.214 16.775 1.55279 16.6056L3.1217 15.8211C3.68667 15.5386 3.84925 15.4525 3.98494 15.348C4.12104 15.243 4.24305 15.121 4.34796 14.9849C4.45255 14.8493 4.53863 14.6867 4.82111 14.1217L5.60557 12.5528C5.77496 12.214 6.12123 12 6.5 12Z", "time": "M 16.764 13.35 C 18.836 15.422 20 18.233 20 21.163 C 20 22.178 19.178 23 18.163 23 L 5.837 23 C 4.823 23 4 22.177 4 21.163 C 4 18.233 5.164 15.422 7.236 13.35 L 8.586 12 L 7.236 10.65 C 5.164 8.578 4 5.767 4 2.837 C 4 1.822 4.822 1 5.837 1 L 18.163 1 C 19.178 1 20 1.822 20 2.837 C 20 5.767 18.836 8.578 16.764 10.65 L 15.414 12 Z M 13 10.999 C 13.176 10.999 13.264 10.999 13.353 10.983 C 13.488 10.958 13.627 10.9 13.74 10.823 C 13.815 10.771 13.877 10.709 14 10.586 L 15.35 9.236 C 16.612 7.974 17.472 6.367 17.823 4.617 C 17.915 4.159 17.961 3.93 17.873 3.673 C 17.787 3.452 17.633 3.265 17.433 3.138 C 17.2 3 16.923 3 16.37 3 L 7.63 3 C 7.078 3 6.801 3 6.567 3.138 C 6.367 3.265 6.213 3.452 6.127 3.673 C 6.039 3.93 6.085 4.159 6.177 4.617 C 6.528 6.367 7.388 7.975 8.65 9.237 L 10 10.585 C 10.122 10.707 10.183 10.768 10.257 10.819 C 10.371 10.898 10.511 10.956 10.647 10.981 C 10.736 10.997 10.823 10.997 10.997 10.997 L 13 10.998 Z", diff --git a/components/modules/block/BlockOverview.vue b/components/modules/block/BlockOverview.vue index 849693b9..2d6559e0 100644 --- a/components/modules/block/BlockOverview.vue +++ b/components/modules/block/BlockOverview.vue @@ -23,10 +23,12 @@ import { comma, formatBytes, reverseMapping, space, shortHex, tia } from "@/serv import { fetchTransactionsByBlock } from "@/services/api/tx" /** Store */ +import { useAppStore } from "@/store/app" import { useModalsStore } from "@/store/modals" import { useCacheStore } from "@/store/cache" import { useBookmarksStore } from "@/store/bookmarks" import { useNotificationsStore } from "@/store/notifications" +const appStore = useAppStore() const modalsStore = useModalsStore() const cacheStore = useCacheStore() const bookmarksStore = useBookmarksStore() @@ -45,6 +47,8 @@ const props = defineProps({ }, }) +const lastBlock = computed(() => appStore.latestBlocks[0]) + const isBookmarkButtonHovered = ref(false) const isBookmarked = ref(false) const bookmarkText = computed(() => { @@ -314,9 +318,33 @@ const handleViewRawTransactions = () => { diff --git a/components/modals/PayForBlobModal.vue b/components/modals/PayForBlobModal.vue new file mode 100644 index 00000000..464b14c1 --- /dev/null +++ b/components/modals/PayForBlobModal.vue @@ -0,0 +1,346 @@ + + + + + diff --git a/components/modals/QRCodeModal.vue b/components/modals/QRCodeModal.vue index 0fd57512..0a7ac48d 100644 --- a/components/modals/QRCodeModal.vue +++ b/components/modals/QRCodeModal.vue @@ -14,8 +14,6 @@ const props = defineProps({ show: Boolean, }) -const qrEl = ref() - watch( () => props.show, () => { @@ -23,17 +21,6 @@ watch( nextTick(() => { const qrCode = generate(cacheStore.qr.data) qrCode.toCanvas(document.getElementById("my-qr-code")) - // qrcode.toDataURL( - // cacheStore.qr.data, - // { - // color: { - // light: "#0000", - // }, - // }, - // (err, url) => { - // qrEl.value.src = url - // }, - // ) }) } }, diff --git a/components/modals/SendModal.vue b/components/modals/SendModal.vue new file mode 100644 index 00000000..5defffe9 --- /dev/null +++ b/components/modals/SendModal.vue @@ -0,0 +1,576 @@ + + + + + +~/services/proto/gen/msg_send diff --git a/components/modules/address/AddressOverview.vue b/components/modules/address/AddressOverview.vue index 948d0383..b65feced 100644 --- a/components/modules/address/AddressOverview.vue +++ b/components/modules/address/AddressOverview.vue @@ -26,7 +26,7 @@ import { fetchBlobsByAddressHash, fetchAddressDelegations, fetchAddressRedelegations, - fetchAddressUndelegations + fetchAddressUndelegations, } from "@/services/api/address" /** Store */ @@ -119,7 +119,7 @@ const handleSelect = (tab) => { if (tabCenter) { let wrapperCenter = tabsEl.value.wrapper.offsetLeft + tabsEl.value.wrapper.offsetWidth / 2 - tabsEl.value.wrapper.scroll({left: tabCenter - wrapperCenter}) + tabsEl.value.wrapper.scroll({ left: tabCenter - wrapperCenter }) } } } @@ -364,7 +364,8 @@ await getTransactions() /** Delegation */ const isActiveDelegator = props.address.balance.delegated > 0 || props.address.balance.unbonding > 0 const collapseBalances = ref(!isActiveDelegator) -const totalBalance = parseInt(props.address.balance.spendable) + parseInt(props.address.balance.delegated) + parseInt(props.address.balance.unbonding) +const totalBalance = + parseInt(props.address.balance.spendable) + parseInt(props.address.balance.delegated) + parseInt(props.address.balance.unbonding) const delegations = ref([]) const redelegations = ref([]) const undelegations = ref([]) @@ -434,19 +435,19 @@ watch( case "messages": getMessages() break - + case "blobs": getBlobs() break - + case "delegations": getDelegations() break - + case "redelegations": getRedelegations() break - + case "undelegations": getUndelegations() break @@ -469,15 +470,15 @@ watch( case "messages": getMessages() break - + case "delegations": getDelegations() break - + case "redelegations": getRedelegations() break - + case "undelegations": getUndelegations() break @@ -527,6 +528,10 @@ const handleBookmark = () => { } } +const handleSend = () => { + modalsStore.open("send") +} + const handleViewRawAddress = () => { cacheStore.current._target = "address" modalsStore.open("rawData") @@ -581,6 +586,13 @@ const handleOpenQRModal = () => { @@ -829,7 +857,7 @@ const handleOpenQRModal = () => { No Messages - No {{ page === 1 ? 'activity' : 'more messages' }} with this address + No {{ page === 1 ? "activity" : "more messages" }} with this address @@ -841,7 +869,7 @@ const handleOpenQRModal = () => { No Blobs - This address did not push any {{ page === 1 ? '' : 'more' }} blobs + This address did not push any {{ page === 1 ? "" : "more" }} blobs @@ -853,7 +881,7 @@ const handleOpenQRModal = () => { No Delegations - This address doesn't have any {{ page === 1 ? '' : 'more' }} delegations + This address doesn't have any {{ page === 1 ? "" : "more" }} delegations @@ -865,7 +893,7 @@ const handleOpenQRModal = () => { No Redelegations - This address doesn't have any {{ page === 1 ? '' : 'more' }} redelegations + This address doesn't have any {{ page === 1 ? "" : "more" }} redelegations @@ -877,7 +905,7 @@ const handleOpenQRModal = () => { No Undelegations - This address doesn't have any {{ page === 1 ? '' : 'more' }} undelegations + This address doesn't have any {{ page === 1 ? "" : "more" }} undelegations @@ -960,7 +988,7 @@ const handleOpenQRModal = () => { .tab { height: 28px; - + white-space: nowrap; cursor: pointer; diff --git a/components/modules/namespace/NamespaceOverview.vue b/components/modules/namespace/NamespaceOverview.vue index 997b8dbf..2fd66b97 100644 --- a/components/modules/namespace/NamespaceOverview.vue +++ b/components/modules/namespace/NamespaceOverview.vue @@ -2,7 +2,7 @@ import { getNamespaceID } from '~/services/utils'; diff --git a/nuxt.config.ts b/nuxt.config.ts index d9e5e396..158e3a30 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -1,3 +1,5 @@ +import { nodePolyfills } from "vite-plugin-node-polyfills" + export default defineNuxtConfig({ modules: ["nuxt-simple-sitemap", "@pinia/nuxt", "nuxt-og-image"], @@ -116,4 +118,8 @@ export default defineNuxtConfig({ devtools: { enabled: true, }, + + vite: { + plugins: [nodePolyfills()], + }, }) diff --git a/package.json b/package.json index 5b8b32be..08f6415c 100644 --- a/package.json +++ b/package.json @@ -24,17 +24,23 @@ "@amplitude/analytics-browser": "^2.3.3", "@codemirror/lang-json": "^6.0.1", "@keplr-wallet/cosmos": "^0.12.70", + "@openzeppelin/merkle-tree": "^1.0.6", "@pinia/nuxt": "0.4.11", "@vueuse/core": "^10.7.0", "codemirror": "^6.0.1", + "crypto-js": "^4.2.0", "d3": "^7.8.5", "d3-hierarchy": "^3.1.2", "focus-trap": "7.5.2", + "js-sha256": "^0.11.0", "lean-qr": "^2.3.2", + "long": "^5.2.3", "luxon": "3.4.3", "nuxt-site-config": "^2.1.2", "pinia": "2.1.6", + "protobufjs": "^7.2.6", "qrcode": "^1.5.3", - "uuid": "9.0.1" + "uuid": "9.0.1", + "vite-plugin-node-polyfills": "^0.21.0" } } diff --git a/pages/address/[hash].vue b/pages/address/[hash].vue index 04e6e8a5..3d4c37a8 100644 --- a/pages/address/[hash].vue +++ b/pages/address/[hash].vue @@ -74,6 +74,10 @@ useHead({ }, ], }) + +onBeforeRouteLeave(() => { + cacheStore.current.address = null +})