diff --git a/.github/workflows/deploy.yaml b/.github/workflows/mainnet-deploy.yaml similarity index 82% rename from .github/workflows/deploy.yaml rename to .github/workflows/mainnet-deploy.yaml index fd8613c8..d1ae0be5 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/mainnet-deploy.yaml @@ -10,8 +10,10 @@ on: jobs: deploy: name: Ping deploy - runs-on: self-hosted + runs-on: mainnet steps: + - name: print + run: echo ${GITHUB_REF#refs/heads/} - name: Git Checkout Latest uses: actions/checkout@v2 diff --git a/.github/workflows/testnet-deploy.yaml b/.github/workflows/testnet-deploy.yaml new file mode 100644 index 00000000..988ab846 --- /dev/null +++ b/.github/workflows/testnet-deploy.yaml @@ -0,0 +1,27 @@ + +name: Ping Deploy + +on: + push: + branches: [ testnet ] + pull_request: + branches: [ testnet ] + +jobs: + deploy: + name: Ping deploy + runs-on: testnet + steps: + - name: print + run: echo ${GITHUB_REF#refs/heads/} + - name: Git Checkout Latest + uses: actions/checkout@v2 + + - name: Install + run: yarn install + + - name: Build + run: yarn run vue-cli-service build + + - name: Deploy + run: cp -rf ./dist/* /var/www/html/ \ No newline at end of file diff --git a/src/chains/mainnet/akash.json b/src/chains/mainnet/akash.json index 72652a60..ce72b085 100644 --- a/src/chains/mainnet/akash.json +++ b/src/chains/mainnet/akash.json @@ -1,5 +1,6 @@ { "chain_name": "akash-network", + "coingecko": "akash-network", "api": "https://akash.api.ping.pub", "sdk_version": "0.41.3", "addr_prefix": "akash", diff --git a/src/chains/mainnet/band.json b/src/chains/mainnet/band.json index e52bd8b9..0f5c9c7e 100644 --- a/src/chains/mainnet/band.json +++ b/src/chains/mainnet/band.json @@ -1,5 +1,6 @@ { "chain_name": "band-protocol", + "coingecko": "band-protocol", "api": "https://laozi1.bandchain.org/api", "addr_prefix": "band", "logo": "https://dl.airtable.com/.attachments/472ae99a508e32b4439b416beddd4eb9/c5166f62/band-symbol-blue-bg.75a3ad91.svg", diff --git a/src/chains/mainnet/bitsong.json b/src/chains/mainnet/bitsong.json index 372a2656..ba785a33 100644 --- a/src/chains/mainnet/bitsong.json +++ b/src/chains/mainnet/bitsong.json @@ -1,5 +1,6 @@ { "chain_name": "bitsong", + "coingecko": "bitsong", "api": "https://lcd.explorebitsong.com", "addr_prefix": "bitsong", "logo": "https://dl.airtable.com/.attachments/8016b71b69fb108f0ff33eb9af1c943f/f5fe4ef4/bitsong.svg", diff --git a/src/chains/mainnet/certik.json b/src/chains/mainnet/certik.json index c2205b6a..d1f349b2 100644 --- a/src/chains/mainnet/certik.json +++ b/src/chains/mainnet/certik.json @@ -1,6 +1,7 @@ { "chain_name": "certik", + "coingecko": "certik", "api":"https://azuredragon.noopsbycertik.com", "sdk_version": "0.42.9", "addr_prefix": "certik", diff --git a/src/chains/mainnet/cosmos.json b/src/chains/mainnet/cosmos.json index 5f25b43a..8ce64577 100644 --- a/src/chains/mainnet/cosmos.json +++ b/src/chains/mainnet/cosmos.json @@ -1,5 +1,6 @@ { "chain_name": "cosmos", + "coingecko": "cosmos", "api":"https://cosmos.api.ping.pub", "sdk_version": "0.42.6", "addr_prefix": "cosmos", diff --git a/src/chains/mainnet/crypto.json b/src/chains/mainnet/crypto.json index d2f0fd76..98e69ac2 100644 --- a/src/chains/mainnet/crypto.json +++ b/src/chains/mainnet/crypto.json @@ -1,6 +1,7 @@ { "chain_name": "crypto-com-chain", + "coingecko": "crypto-com-chain", "api": "https://mainnet.crypto.org:1317", "sdk_version": "0.39.2", "addr_prefix": "cro", diff --git a/src/chains/mainnet/desmos.json b/src/chains/mainnet/desmos.json index 8c38efe9..f8a5fe98 100644 --- a/src/chains/mainnet/desmos.json +++ b/src/chains/mainnet/desmos.json @@ -1,5 +1,6 @@ { "chain_name": "desmos", + "coingecko": "", "api": "https://api.mainnet.desmos.network", "sdk_version": "0.42.0", "addr_prefix": "desmos", diff --git a/src/chains/mainnet/emoney.json b/src/chains/mainnet/emoney.json index dad033e6..9761c65e 100644 --- a/src/chains/mainnet/emoney.json +++ b/src/chains/mainnet/emoney.json @@ -1,5 +1,6 @@ { "chain_name": "e-money", + "coingecko": "e-money", "api": "https://emoney.validator.network/api", "addr_prefix": "emoney", "logo": "https://dl.airtable.com/.attachments/276e4d6de567b073a5e400240d7d83e9/9bb49806/yoR2r25W_400x400.jpg", diff --git a/src/chains/mainnet/injective.json b/src/chains/mainnet/injective.json index e066086f..55849b3a 100644 --- a/src/chains/mainnet/injective.json +++ b/src/chains/mainnet/injective.json @@ -1,5 +1,6 @@ { "chain_name": "injective", + "coingecko": "injective-protocol", "api": "https://lcd.injective.network", "sdk_version": "0.42.4", "addr_prefix": "inj", diff --git a/src/chains/mainnet/iris.json b/src/chains/mainnet/iris.json index f7471262..fe45c2f4 100644 --- a/src/chains/mainnet/iris.json +++ b/src/chains/mainnet/iris.json @@ -1,5 +1,6 @@ { "chain_name": "iris-network", + "coingecko": "iris-network", "api": "https://iris.api.ping.pub", "sdk_version": "0.42.4", "addr_prefix": "iaa", diff --git a/src/chains/mainnet/juno.json b/src/chains/mainnet/juno.json index e599128a..cddd230d 100644 --- a/src/chains/mainnet/juno.json +++ b/src/chains/mainnet/juno.json @@ -1,5 +1,6 @@ { "chain_name": "juno", + "coingecko": "juno-network", "api": "https://juno.api.ping.pub", "sdk_version": "0.42.4", "addr_prefix": "juno", diff --git a/src/chains/mainnet/kava.json b/src/chains/mainnet/kava.json index c75bacf3..5ad69c61 100644 --- a/src/chains/mainnet/kava.json +++ b/src/chains/mainnet/kava.json @@ -1,5 +1,6 @@ { "chain_name": "kava", + "coingecko": "kava", "api": "https://api.data.kava.io", "sdk_version": "0.39.2", "addr_prefix": "kava", diff --git a/src/chains/mainnet/kichain.json b/src/chains/mainnet/kichain.json new file mode 100644 index 00000000..7cbf548f --- /dev/null +++ b/src/chains/mainnet/kichain.json @@ -0,0 +1,8 @@ +{ + "chain_name": "kichain", + "coingecko": "ki", + "api": "https://ki.api.ping.pub", + "sdk_version": "0.42.10", + "addr_prefix": "ki", + "logo": "https://dl.airtable.com/.attachments/b1f670d31bf69d7ca9906df8437d91a7/b2667ad1/ki.png" +} \ No newline at end of file diff --git a/src/chains/mainnet/likecoin.json b/src/chains/mainnet/likecoin.json index 05c48fe4..c6ee0fa0 100644 --- a/src/chains/mainnet/likecoin.json +++ b/src/chains/mainnet/likecoin.json @@ -1,5 +1,6 @@ { "chain_name": "likecoin", + "coingecko": "likecoin", "api": "https://mainnet-node.like.co", "sdk_version": "0.42.0", "addr_prefix": "cosmos", diff --git a/src/chains/mainnet/okexchain.json b/src/chains/mainnet/okexchain.json index 4791fbd2..1b5be0df 100644 --- a/src/chains/mainnet/okexchain.json +++ b/src/chains/mainnet/okexchain.json @@ -1,5 +1,6 @@ { "chain_name": "okexchain", + "coingecko": "okexchain", "api": "https://exchainrpc.okex.org/okexchain/v1", "sdk_version": "0.39.2", "addr_prefix": "ex", diff --git a/src/chains/mainnet/osmosis.json b/src/chains/mainnet/osmosis.json index 5fcc106e..de886553 100644 --- a/src/chains/mainnet/osmosis.json +++ b/src/chains/mainnet/osmosis.json @@ -1,5 +1,6 @@ { "chain_name": "osmosis", + "coingecko": "osmosis", "api": "https://lcd-osmosis.keplr.app", "sdk_version": "0.42.5", "addr_prefix": "osmo", diff --git a/src/chains/mainnet/persistence.json b/src/chains/mainnet/persistence.json index e22139b9..5323430a 100644 --- a/src/chains/mainnet/persistence.json +++ b/src/chains/mainnet/persistence.json @@ -1,5 +1,6 @@ { "chain_name": "persistence", + "coingecko": "persistence", "api": "https://rest.core.persistence.one", "sdk_version": "0.42.4", "addr_prefix": "persistence", diff --git a/src/chains/mainnet/regen.json b/src/chains/mainnet/regen.json index 8799b560..5850a3f9 100644 --- a/src/chains/mainnet/regen.json +++ b/src/chains/mainnet/regen.json @@ -1,5 +1,6 @@ { "chain_name": "regen", + "coingecko": "regen", "api": "https://regen.api.ping.pub", "sdk_version": "0.42.4", "addr_prefix": "regen", diff --git a/src/chains/mainnet/secret.json b/src/chains/mainnet/secret.json index 18865aa6..649c9357 100644 --- a/src/chains/mainnet/secret.json +++ b/src/chains/mainnet/secret.json @@ -1,5 +1,6 @@ { "chain_name": "secret", + "coingecko": "secret", "api": "https://api.scrt.network", "sdk_version": "0.33.8", "addr_prefix": "secret", diff --git a/src/chains/mainnet/sentinel.json b/src/chains/mainnet/sentinel.json index cfbf37e7..30a94875 100644 --- a/src/chains/mainnet/sentinel.json +++ b/src/chains/mainnet/sentinel.json @@ -1,5 +1,6 @@ { "chain_name": "sentinel", + "coingecko": "sentinel", "api": "https://lcd.sentinel.co", "sdk_version": "0.42.6", "addr_prefix": "sent", diff --git a/src/chains/mainnet/sifchain.json b/src/chains/mainnet/sifchain.json index ec26103e..e6385c0e 100644 --- a/src/chains/mainnet/sifchain.json +++ b/src/chains/mainnet/sifchain.json @@ -1,5 +1,6 @@ { "chain_name": "sifchain", + "coingecko": "sifchain", "api": "https://api.sifchain.finance", "sdk_version": "0.42.6", "addr_prefix": "sif", diff --git a/src/chains/mainnet/stargaze.json b/src/chains/mainnet/stargaze.json index b491ade7..a2ab2be5 100644 --- a/src/chains/mainnet/stargaze.json +++ b/src/chains/mainnet/stargaze.json @@ -1,5 +1,6 @@ { "chain_name": "stargaze", + "coingecko": "stargaze-protocol", "api": "https://rest.stargaze.publicawesome.dev", "sdk_version": "0.44.3", "addr_prefix": "stars", diff --git a/src/chains/mainnet/starname.json b/src/chains/mainnet/starname.json index 86509c65..5b33ad85 100644 --- a/src/chains/mainnet/starname.json +++ b/src/chains/mainnet/starname.json @@ -1,5 +1,6 @@ { "chain_name": "starname", + "coingecko": "starname", "api": "https://api.iov-mainnet-ibc.iov.one", "sdk_version": "0.42.6", "addr_prefix": "star", diff --git a/src/chains/mainnet/terra.json b/src/chains/mainnet/terra.json index 2249eae8..6881374e 100644 --- a/src/chains/mainnet/terra.json +++ b/src/chains/mainnet/terra.json @@ -1,5 +1,6 @@ { "chain_name": "terra-luna", + "coingecko": "terra-luna", "api": "https://fcd.terra.dev", "sdk_version": "0.44.2", "addr_prefix": "terra", diff --git a/src/chains/mainnet/vidulum.json b/src/chains/mainnet/vidulum.json index 5f106162..b2fbbd83 100644 --- a/src/chains/mainnet/vidulum.json +++ b/src/chains/mainnet/vidulum.json @@ -1,6 +1,7 @@ { "chain_name": "vidulum", - "api": "https://mainnet-lcd.vidulum.app/", + "coingecko": "vidulum", + "api": "https://mainnet-lcd.vidulum.app", "sdk_version": "0.44.0", "addr_prefix": "vdl", "logo": "/logos/VDL.png" diff --git a/src/chains/mainnet/omniflix.json b/src/chains/testnet/omniflix.json similarity index 100% rename from src/chains/mainnet/omniflix.json rename to src/chains/testnet/omniflix.json diff --git a/src/lang/locales/en.json b/src/lang/locales/en.json index 21fe09fd..83138473 100644 --- a/src/lang/locales/en.json +++ b/src/lang/locales/en.json @@ -27,6 +27,7 @@ "stargaze": "Stargaze", "injective": "Injective Protocal", "vidulum": "Vidulum", + "kichain": "KI Chain", "staking": "Staking", "governance": "Governance", diff --git a/src/libs/data/data.js b/src/libs/data/data.js index 88ce163a..3d91ac45 100644 --- a/src/libs/data/data.js +++ b/src/libs/data/data.js @@ -321,6 +321,11 @@ export function formatTokenAmount(tokenAmount, fraction = 2, denom = 'uatom') { return parseFloat(amount) } +export function isTestnet() { + return (window.location.hostname.startsWith('testnet') + || window.location.search.indexOf('testnet') > -1) +} + export function formatToken(token, IBCDenom = {}, decimals = 2) { if (token) { return `${formatTokenAmount(token.amount, decimals, token.denom)} ${formatTokenDenom(IBCDenom[token.denom] || token.denom)}` diff --git a/src/libs/fetch.js b/src/libs/fetch.js index db8c74f5..244c8c24 100644 --- a/src/libs/fetch.js +++ b/src/libs/fetch.js @@ -355,7 +355,10 @@ export default class ChainFetch { async getMarketChart(days = 14, coin = null) { const conf = this.getSelectedConfig() const currency = getUserCurrency() - return ChainFetch.fetch(' https://api.coingecko.com', `/api/v3/coins/${coin || conf.chain_name}/market_chart?vs_currency=${currency}&days=${days}`) + if (conf.coingecko && conf.coingecko.length > 0) { + return ChainFetch.fetch(' https://api.coingecko.com', `/api/v3/coins/${coin || conf.coingecko}/market_chart?vs_currency=${currency}&days=${days}`) + } + return null } // CoinMarketCap diff --git a/src/navigation/vertical/index.js b/src/navigation/vertical/index.js index ba05cc7e..1bc636cb 100644 --- a/src/navigation/vertical/index.js +++ b/src/navigation/vertical/index.js @@ -1,4 +1,5 @@ import store from '@/store' +import { isTestnet } from '../../libs/data/data' const modules = [ { @@ -71,6 +72,36 @@ function processMenu() { menu.children = children chainMenus.push(menu) }) + chainMenus.push({ header: 'LINKS' }) + if (isTestnet()) { + chainMenus.push({ + title: 'Mainnet Explorer', + href: 'https://ping.pub', + icon: 'ChromeIcon', + }) + } else { + chainMenus.push({ + title: 'Testnet Explorer', + href: 'http://testnet.ping.pub', + icon: 'LifeBuoyIcon', + }) + } + chainMenus.push({ + title: 'Discord', + href: 'https://discord.gg/CmjYVSr6GW', + icon: 'EyeIcon', + }) + chainMenus.push({ + title: 'Twitter', + href: 'https://twitter.com/ping_pub', + icon: 'TwitterIcon', + }) + chainMenus.push({ + title: 'Github', + href: 'https://github.com/ping-pub/explorer', + icon: 'GithubIcon', + }) + return chainMenus } diff --git a/src/store/chains/index.js b/src/store/chains/index.js index 319d60d4..38f82692 100644 --- a/src/store/chains/index.js +++ b/src/store/chains/index.js @@ -1,7 +1,9 @@ +import { isTestnet } from '@/libs/data/data' + let chains = {} let configs = require.context('../../chains/mainnet', false, /\.json$/) -if (window.location.hostname.startsWith('testnet') || window.location.search.indexOf('testnet') > -1) { +if (isTestnet()) { configs = require.context('../../chains/testnet', false, /\.json$/) } diff --git a/src/views/Uptime.vue b/src/views/Uptime.vue index 3a0db17d..9f91bfed 100644 --- a/src/views/Uptime.vue +++ b/src/views/Uptime.vue @@ -14,7 +14,7 @@ class="mb-1" > Browse favourate only diff --git a/src/views/UptimeMyValidators.vue b/src/views/UptimeMyValidators.vue index 69da36f6..e5dc1bb9 100644 --- a/src/views/UptimeMyValidators.vue +++ b/src/views/UptimeMyValidators.vue @@ -51,7 +51,7 @@ export default { const validators = [] pinned[x].forEach(address => { const val = cached.find(v => address === consensusPubkeyToHexAddress(v.consensus_pubkey)) - validators.push({ address, validator: val.description }) + if (val) validators.push({ address, validator: val.description }) }) chainVals[x] = validators })