diff --git a/.env.example b/.env.example new file mode 100644 index 0000000000..4921ff88f8 --- /dev/null +++ b/.env.example @@ -0,0 +1,22 @@ +# rename to .env.local or .env. + +# Refresh interval for the app to query api for new blocks +VITE_REFRESH_INTERVAL=6000 + +# Enable fetching all blocks (this can increase api calls to public nodes resulting in rate limiting) +VITE_FETCH_ALL_BLOCKS=false + +# Limit for recent blocks and associated transactions displayed in the UI +VITE_RECENT_BLOCK_LIMIT=50 + +# URL for CoinGecko API or custom proxy +VITE_COINGECKO_URL=https://api.coingecko.com + +# GITHUB_API_URL default +VITE_GITHUB_API_URL=https://api.github.com/repos/cosmos/chain-registry/contents + +# PINGPUB_API_URL default +VITE_PINGPUB_API_URL=https://registry.ping.pub + +# IBC use PINGPUB_API_URL by Default (false) or GITHUB_API_URL (true) +VITE_IBC_USE_GITHUB_API=false diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 2c027dc87f..706da5d138 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,5 +1,5 @@ # These are supported funding model platforms -# github: liangping +github: ping-pub issuehunt: ping-pub # Replace with a single IssueHunt username diff --git a/.gitignore b/.gitignore index 212ccd26db..e4a00ae8c0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,7 @@ node_modules/ **/.vscode yarn-error.log dist -.idea \ No newline at end of file +.idea + +.env* +!.env.example diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000..0b1b95926f --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +dist/ +.github/ +*.md +auto-imports.d.ts diff --git a/.prettierrc.json b/.prettierrc.json index 0ed67ee771..35ff4599e7 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,9 +1,12 @@ { - "tabWidth": 2, - "singleQuote": true, - "semi": true, - "endOfLine": "auto", + "arrowParens": "always", "bracketSpacing": true, - "TrailingCooma": true, - "arrowParens": "always" + "endOfLine": "auto", + "printWidth": 80, + "semi": true, + "singleAttributePerLine": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "es5", + "useTabs": false } diff --git a/README.md b/README.md index 342d5900e3..051bc973d9 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Your donation will help us make better products. Thanks in advance. ## Hire us -You can hire us by submiting an issue and fund the issue on [IssueHunter](https://issuehunt.io/r/ping-pub/explorer) +You can hire us by submitting an issue and fund the issue on [IssueHunter](https://issuehunt.io/r/ping-pub/explorer) ## Contributors diff --git a/chains/Kiichain b/chains/Kiichain new file mode 100644 index 0000000000..0257d03375 --- /dev/null +++ b/chains/Kiichain @@ -0,0 +1,26 @@ +{ + "chain_name": "kiichain", + "registry_name": "kiichain", + "api": [ + { "provider": "kiichain", "address": "https://api-kiichain.gon.world" }, + { "provider": "gamisama", "address": "https://kiichain-api.gamisama.com" } + ], + "rpc": [ + { "provider": "kiichain", "address": "https://rpc-kiichain.gon.world" }, + { "provider": "gamisama", "address": "https://kiichain-rpc.gamisama.com" } + ], + "sdk_version": "0.47.0", + "coin_type": "118", + "min_tx_fee": "100", + "addr_prefix": "ki", + "logo": "/logos/kiichain.svg", + "assets": [ + { + "base": "uki", + "symbol": "KII", + "exponent": "6", + "coingecko_id": "kiichain", + "logo": "/logos/kiichain.svg" + } + ] +} diff --git a/chains/README.md b/chains/README.md index 7b651cfadd..28c994e22d 100644 --- a/chains/README.md +++ b/chains/README.md @@ -1,10 +1,14 @@ # Directory Layout -** if you want to list your blockhain on ping.pub, please submit your configure on https://github.com/ping-pub/ping.pub.git ** +Note: the host name used in the user's browser (displayed in the address bar) to load the explorer app determines which of the chain configuration directories is used. +If the host name contains the substring "testnet" (for example: "https://mytestnetwork.example.com") then chain configuration files in the `testnet` directory (only) are loaded. Conversely if the host name does not contain that substring then chain configuration files in the `mainnet` directory (only) are loaded. +Remember to bear this behavior in mind when selecting a DNS host name for self hosting the explorer. + +** if you want to list your blockchain on ping.pub, please submit your configuration on https://github.com/ping-pub/ping.pub.git ** - Submit configs for mainnet, go to https://github.com/ping-pub/explorer/tree/master/chains/mainnet -- Submit configs for testnet, go to https://github.com/ping-pub/explorer/tree/master/chains/testnet, thess configs will be enabled when you visit the domain starts withs `testnet.*`, for example `https://testnet.ping.pub` +- Submit configs for testnet, go to https://github.com/ping-pub/explorer/tree/master/chains/testnet, these configs will be enabled when you visit the domain that starts with `testnet.*`, for example `https://testnet.ping.pub` # Sample of Config diff --git a/chains/mainnet/umee-1.json b/chains/mainnet/umee-1.json index 7f51979d38..0003a4ebcb 100644 --- a/chains/mainnet/umee-1.json +++ b/chains/mainnet/umee-1.json @@ -1,17 +1,236 @@ { "chain_name": "umee-1", - "api": [ + "rpc": [ { - "address": "https://umee-api.polkachu.com:443", + "address": "https://rpc-umee.mzonder.com", + "provider": "MZONDER", + "type": "rpc" + }, + { + "address": "https://ux-rpc.chainroot.io", + "provider": "Chainroot", + "type": "rpc" + }, + { + "address": "https://umee-rpc.polkachu.com", "provider": "Polkachu", - "type": "rest" + "type": "rpc" + }, + { + "address": "https://rpc-umee-ia.cosmosia.notional.ventures/", + "provider": "Notional", + "type": "rpc" + }, + { + "address": "https://umee-mainnet-rpc.autostake.com:443", + "provider": "AutoStake 🛡️ Slash Protected", + "type": "rpc" + }, + { + "address": "http://umee.rpc.m.stavr.tech:10457", + "provider": "🔥STAVR🔥", + "type": "rpc" + }, + { + "address": "http://rpc-umee-0.node75.org:26657", + "provider": "Pro-Nodes75", + "type": "rpc" + }, + { + "address": "https://rpc-umee-01.stakeflow.io", + "provider": "Stakeflow", + "type": "rpc" + }, + { + "address": "https://umee-rpc.staketab.org:443", + "provider": "Staketab", + "type": "rpc" + }, + { + "address": "https://umee-rpc.theamsolutions.info", + "provider": "AM Solutions", + "type": "rpc" + }, + { + "address": "https://umee.rpc.kjnodes.com", + "provider": "kjnodes" + }, + { + "address": "https://umee-rpc.w3coins.io", + "provider": "w3coins", + "type": "rpc" + }, + { + "address": "https://rpc-umee.mms.team", + "provider": "MMS", + "type": "rpc" + }, + { + "address": "https://umee-rpc.stake-town.com", + "provider": "StakeTown", + "type": "rpc" + }, + { + "address": "https://umee-rpc.highstakes.ch", + "provider": "High Stakes 🇨🇭", + "type": "rpc" + }, + { + "address": "https://umee.rpc.stakevillage.net:443", + "provider": "Stake Village", + "type": "rpc" + }, + { + "address": "https://umee-rpc.noders.services", + "provider": "[NODERS]TEAM", + "type": "rpc" + }, + { + "address": "https://umee_mainnet_rpc.chain.whenmoonwhenlambo.money", + "provider": "🚀 WHEN MOON 🌕 WHEN LAMBO 🔥", + "type": "rpc" } ], - "rpc": [ + "api": [ + { + "address": "https://api-umee.mzonder.com", + "provider": "MZONDER" + }, + { + "address": "https://ux-api.chainroot.io", + "provider": "Chainroot" + }, + { + "address": "https://api-umee-ia.cosmosia.notional.ventures/", + "provider": "Notional" + }, + { + "address": "https://umee.api.m.stavr.tech", + "provider": "🔥STAVR🔥" + }, + { + "address": "https://umee-mainnet-lcd.autostake.com:443", + "provider": "AutoStake 🛡️ Slash Protected" + }, + { + "address": "https://umee-api.polkachu.com", + "provider": "Polkachu" + }, + { + "address": "https://api-umee-01.stakeflow.io", + "provider": "Stakeflow" + }, + { + "address": "https://umee-rest.staketab.org", + "provider": "Staketab" + }, + { + "address": "https://umee-api.theamsolutions.info", + "provider": "AM Solutions" + }, + { + "address": "https://umee.api.kjnodes.com", + "provider": "kjnodes" + }, + { + "address": "https://umee-api.w3coins.io", + "provider": "w3coins" + }, + { + "address": "https://api-umee.mms.team", + "provider": "MMS" + }, + { + "address": "https://umee-api.stake-town.com", + "provider": "StakeTown" + }, + { + "address": "https://umee-api.highstakes.ch", + "provider": "High Stakes 🇨🇭" + }, + { + "address": "https://umee.api.stakevillage.net", + "provider": "Stake Village" + }, + { + "address": "https://umee-api.noders.services", + "provider": "[NODERS]TEAM" + }, { - "address": "https://umee-rpc.polkachu.com:443", + "address": "https://umee_mainnet_api.chain.whenmoonwhenlambo.money", + "provider": "🚀 WHEN MOON 🌕 WHEN LAMBO 🔥" + } + ], + "grpc": [ + { + "address": "grpc-umee.mzonder.com:443", + "provider": "MZONDER", + "type": "grpc" + }, + { + "address": "grpc-umee-ia.cosmosia.notional.ventures:443", + "provider": "Notional", + "type": "grpc" + }, + { + "address": "umee-grpc.polkachu.com:13690", "provider": "Polkachu", - "type": "rpc" + "type": "grpc" + }, + { + "address": "umee-mainnet-grpc.autostake.com:443", + "provider": "AutoStake 🛡️ Slash Protected", + "type": "grpc" + }, + { + "address": "umee.grpc.m.stavr.tech:9090", + "provider": "🔥STAVR🔥", + "type": "grpc" + }, + { + "address": "grpc-umee-01.stakeflow.io:9990", + "provider": "Stakeflow", + "type": "grpc" + }, + { + "address": "services.staketab.com:9020", + "provider": "Staketab", + "type": "grpc" + }, + { + "address": "umee.grpc.kjnodes.com:16290", + "provider": "kjnodes", + "type": "grpc" + }, + { + "address": "umee-grpc.w3coins.io:13690", + "provider": "w3coins", + "type": "grpc" + }, + { + "address": "grpc-umee.mms.team:443", + "provider": "MMS", + "type": "grpc" + }, + { + "address": "umee-grpc.stake-town.com:443", + "provider": "StakeTown", + "type": "grpc" + }, + { + "address": "umee.grpc.stakevillage.net:11090", + "provider": "Stake Village", + "type": "grpc" + }, + { + "address": "umee-grpc.noders.services:32090", + "provider": "[NODERS]TEAM", + "type": "grpc" + }, + { + "address": "umee-grpc.chainroot.io:443", + "provider": "Chainroot", + "type": "grpc" } ], "sdk_version": "0.47.11", diff --git a/env.d.ts b/env.d.ts index 11f02fe2a0..68dc2b9756 100644 --- a/env.d.ts +++ b/env.d.ts @@ -1 +1,16 @@ /// + +declare module '@personaxyz/ad-sdk'; +interface ImportMetaEnv { + readonly VITE_REFRESH_INTERVAL?: number, + readonly VITE_FETCH_ALL_BLOCKS?: boolean, + readonly VITE_RECENT_BLOCK_LIMIT?: number, + readonly VITE_COINGECKO_URL?: string, + readonly VITE_GITHUB_API_URL?: string, + readonly VITE_PINGPUB_API_URL?: string, + readonly VITE_IBC_USE_GITHUB_API?: string, +} + +interface ImportMeta { + readonly env: ImportMetaEnv; +} diff --git a/index.html b/index.html index 71f12206f3..d183515a61 100644 --- a/index.html +++ b/index.html @@ -1,12 +1,14 @@ - - - + + + Ping Dashboard - Cosmos Blockchain Explorer And Web Wallet - - + @@ -24,13 +26,26 @@ - + + diff --git a/installation.md b/installation.md index a214058a8c..0ffb3c5cf3 100644 --- a/installation.md +++ b/installation.md @@ -79,4 +79,4 @@ server { } } ``` -3. config your blockchain in [./src/chains]() +3. config your blockchain in [./chains/mainnet]() diff --git a/package.json b/package.json index 1f17d4ff6d..6faca93c6e 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "target": "", "scripts": { "dev": "vite", + "format": "prettier --write .", "serve": "vite", "build": "run-p type-check build-only", "preview": "vite preview", @@ -12,15 +13,20 @@ "type-check": "vue-tsc --noEmit" }, "dependencies": { + "@chain-registry/client": "^1.53.184", + "@chain-registry/types": "^0.50.184", "@chenfengyuan/vue-countdown": "2", - "@cosmjs/crypto": "^0.29.5", - "@cosmjs/encoding": "^0.29.5", + "@cosmjs/amino": "^0.32.3", + "@cosmjs/crypto": "^0.32.3", + "@cosmjs/encoding": "^0.32.3", + "@cosmjs/stargate": "^0.32.3", + "@cosmjs/cosmwasm-stargate": "^0.30.0", "@iconify/vue": "^4.1.0", "@intlify/unplugin-vue-i18n": "^0.8.2", "@leapwallet/cosmos-snap-provider": "^0.1.20", - "@leapwallet/name-matcha": "^1.1.0", + "@leapwallet/name-matcha": "^2.0.0", "@osmonauts/lcd": "^0.8.0", - "@ping-pub/chain-registry-client": "^0.0.25", + "@personaxyz/ad-sdk": "0.0.25", "@vitejs/plugin-vue-jsx": "^3.0.0", "@vueuse/core": "^9.12.0", "@vueuse/integrations": "^10.1.2", @@ -28,11 +34,14 @@ "apexcharts": "^3.37.1", "autoprefixer": "^10.4.14", "axios": "^1.3.2", + "bech32": "^1.1.4", "buffer": "^6.0.3", "build": "^0.1.4", "cross-fetch": "^3.1.5", "daisyui": "^3.1.0", "dayjs": "^1.11.7", + "idna-uts46-hx": "^5.0.7", + "js-sha3": "^0.8.0", "lazy-load-vue3": "^1.3.0", "long": "^5.2.1", "md-editor-v3": "^2.8.1", @@ -60,9 +69,12 @@ "@types/semver": "7.5.0", "@vitejs/plugin-vue": "^4.0.0", "@vue/tsconfig": "^0.1.3", + "husky": "^9.1.7", "npm-run-all": "^4.1.5", - "prettier": "^2.7.1", + "prettier": "^3.0.0", + "pretty-quick": "^4.2.2", "sass": "^1.58.0", + "shiki": "^1.0.0-beta.0", "typescript": "~4.9.5", "unplugin-auto-import": "^0.13.0", "unplugin-vue-components": "^0.23.0", @@ -71,5 +83,11 @@ "vite-plugin-pages": "^0.28.0", "vue-json-viewer": "3", "vue-tsc": "^1.0.12" - } + }, + "husky": { + "hooks": { + "pre-commit": "pretty-quick --staged" + } + }, + "packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610" } diff --git a/postcss.config.js b/postcss.config.js index 33ad091d26..12a703d900 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -3,4 +3,4 @@ module.exports = { tailwindcss: {}, autoprefixer: {}, }, -} +}; diff --git a/public/test.html b/public/test.html index 6b46c576e2..6edc088dc8 100644 --- a/public/test.html +++ b/public/test.html @@ -1,17 +1,17 @@ - - Widget Test - - - + + Widget Test + + +
-
- -
-
+
+ +
+
- -
+ +
- - \ No newline at end of file + + diff --git a/src/assets/images/welldone-logo.svg b/src/assets/images/welldone-logo.svg new file mode 100644 index 0000000000..915c31be43 --- /dev/null +++ b/src/assets/images/welldone-logo.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/components/CardParameter.vue b/src/components/CardParameter.vue index d157a5fd7c..dc7e1b58e7 100644 --- a/src/components/CardParameter.vue +++ b/src/components/CardParameter.vue @@ -13,8 +13,8 @@ function calculateValue(value: any) { if (Array.isArray(value)) { return (value[0] && value[0].amount) || '-'; } - if(String(value).search(/^\d+s$/g) > -1) { - return formatSeconds(value) + if (String(value).search(/^\d+s$/g) > -1) { + return formatSeconds(value); } const newValue = Number(value); if (`${newValue}` === 'NaN' || typeof value === 'boolean') { @@ -28,8 +28,8 @@ function calculateValue(value: any) { } function formatTitle(v: string) { - if(!v) return "" - return v.replace(/_/g, " ") + if (!v) return ''; + return v.replace(/_/g, ' '); }