Merge branch 'master' of github.com:ibiding/explorer into trade

# Conflicts:
#	src/store/chains/index.js
This commit is contained in:
ding 2021-11-20 15:33:49 +08:00
commit 5e8af7f3e5
35 changed files with 116 additions and 6 deletions

View File

@ -10,8 +10,10 @@ on:
jobs: jobs:
deploy: deploy:
name: Ping deploy name: Ping deploy
runs-on: self-hosted runs-on: mainnet
steps: steps:
- name: print
run: echo ${GITHUB_REF#refs/heads/}
- name: Git Checkout Latest - name: Git Checkout Latest
uses: actions/checkout@v2 uses: actions/checkout@v2

27
.github/workflows/testnet-deploy.yaml vendored Normal file
View File

@ -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/

View File

@ -1,5 +1,6 @@
{ {
"chain_name": "akash-network", "chain_name": "akash-network",
"coingecko": "akash-network",
"api": "https://akash.api.ping.pub", "api": "https://akash.api.ping.pub",
"sdk_version": "0.41.3", "sdk_version": "0.41.3",
"addr_prefix": "akash", "addr_prefix": "akash",

View File

@ -1,5 +1,6 @@
{ {
"chain_name": "band-protocol", "chain_name": "band-protocol",
"coingecko": "band-protocol",
"api": "https://laozi1.bandchain.org/api", "api": "https://laozi1.bandchain.org/api",
"addr_prefix": "band", "addr_prefix": "band",
"logo": "https://dl.airtable.com/.attachments/472ae99a508e32b4439b416beddd4eb9/c5166f62/band-symbol-blue-bg.75a3ad91.svg", "logo": "https://dl.airtable.com/.attachments/472ae99a508e32b4439b416beddd4eb9/c5166f62/band-symbol-blue-bg.75a3ad91.svg",

View File

@ -1,5 +1,6 @@
{ {
"chain_name": "bitsong", "chain_name": "bitsong",
"coingecko": "bitsong",
"api": "https://lcd.explorebitsong.com", "api": "https://lcd.explorebitsong.com",
"addr_prefix": "bitsong", "addr_prefix": "bitsong",
"logo": "https://dl.airtable.com/.attachments/8016b71b69fb108f0ff33eb9af1c943f/f5fe4ef4/bitsong.svg", "logo": "https://dl.airtable.com/.attachments/8016b71b69fb108f0ff33eb9af1c943f/f5fe4ef4/bitsong.svg",

View File

@ -1,6 +1,7 @@
{ {
"chain_name": "certik", "chain_name": "certik",
"coingecko": "certik",
"api":"https://azuredragon.noopsbycertik.com", "api":"https://azuredragon.noopsbycertik.com",
"sdk_version": "0.42.9", "sdk_version": "0.42.9",
"addr_prefix": "certik", "addr_prefix": "certik",

View File

@ -1,5 +1,6 @@
{ {
"chain_name": "cosmos", "chain_name": "cosmos",
"coingecko": "cosmos",
"api":"https://cosmos.api.ping.pub", "api":"https://cosmos.api.ping.pub",
"sdk_version": "0.42.6", "sdk_version": "0.42.6",
"addr_prefix": "cosmos", "addr_prefix": "cosmos",

View File

@ -1,6 +1,7 @@
{ {
"chain_name": "crypto-com-chain", "chain_name": "crypto-com-chain",
"coingecko": "crypto-com-chain",
"api": "https://mainnet.crypto.org:1317", "api": "https://mainnet.crypto.org:1317",
"sdk_version": "0.39.2", "sdk_version": "0.39.2",
"addr_prefix": "cro", "addr_prefix": "cro",

View File

@ -1,5 +1,6 @@
{ {
"chain_name": "desmos", "chain_name": "desmos",
"coingecko": "",
"api": "https://api.mainnet.desmos.network", "api": "https://api.mainnet.desmos.network",
"sdk_version": "0.42.0", "sdk_version": "0.42.0",
"addr_prefix": "desmos", "addr_prefix": "desmos",

View File

@ -1,5 +1,6 @@
{ {
"chain_name": "e-money", "chain_name": "e-money",
"coingecko": "e-money",
"api": "https://emoney.validator.network/api", "api": "https://emoney.validator.network/api",
"addr_prefix": "emoney", "addr_prefix": "emoney",
"logo": "https://dl.airtable.com/.attachments/276e4d6de567b073a5e400240d7d83e9/9bb49806/yoR2r25W_400x400.jpg", "logo": "https://dl.airtable.com/.attachments/276e4d6de567b073a5e400240d7d83e9/9bb49806/yoR2r25W_400x400.jpg",

View File

@ -1,5 +1,6 @@
{ {
"chain_name": "injective", "chain_name": "injective",
"coingecko": "injective-protocol",
"api": "https://lcd.injective.network", "api": "https://lcd.injective.network",
"sdk_version": "0.42.4", "sdk_version": "0.42.4",
"addr_prefix": "inj", "addr_prefix": "inj",

View File

@ -1,5 +1,6 @@
{ {
"chain_name": "iris-network", "chain_name": "iris-network",
"coingecko": "iris-network",
"api": "https://iris.api.ping.pub", "api": "https://iris.api.ping.pub",
"sdk_version": "0.42.4", "sdk_version": "0.42.4",
"addr_prefix": "iaa", "addr_prefix": "iaa",

View File

@ -1,5 +1,6 @@
{ {
"chain_name": "juno", "chain_name": "juno",
"coingecko": "juno-network",
"api": "https://juno.api.ping.pub", "api": "https://juno.api.ping.pub",
"sdk_version": "0.42.4", "sdk_version": "0.42.4",
"addr_prefix": "juno", "addr_prefix": "juno",

View File

@ -1,5 +1,6 @@
{ {
"chain_name": "kava", "chain_name": "kava",
"coingecko": "kava",
"api": "https://api.data.kava.io", "api": "https://api.data.kava.io",
"sdk_version": "0.39.2", "sdk_version": "0.39.2",
"addr_prefix": "kava", "addr_prefix": "kava",

View File

@ -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"
}

View File

@ -1,5 +1,6 @@
{ {
"chain_name": "likecoin", "chain_name": "likecoin",
"coingecko": "likecoin",
"api": "https://mainnet-node.like.co", "api": "https://mainnet-node.like.co",
"sdk_version": "0.42.0", "sdk_version": "0.42.0",
"addr_prefix": "cosmos", "addr_prefix": "cosmos",

View File

@ -1,5 +1,6 @@
{ {
"chain_name": "okexchain", "chain_name": "okexchain",
"coingecko": "okexchain",
"api": "https://exchainrpc.okex.org/okexchain/v1", "api": "https://exchainrpc.okex.org/okexchain/v1",
"sdk_version": "0.39.2", "sdk_version": "0.39.2",
"addr_prefix": "ex", "addr_prefix": "ex",

View File

@ -1,5 +1,6 @@
{ {
"chain_name": "osmosis", "chain_name": "osmosis",
"coingecko": "osmosis",
"api": "https://lcd-osmosis.keplr.app", "api": "https://lcd-osmosis.keplr.app",
"sdk_version": "0.42.5", "sdk_version": "0.42.5",
"addr_prefix": "osmo", "addr_prefix": "osmo",

View File

@ -1,5 +1,6 @@
{ {
"chain_name": "persistence", "chain_name": "persistence",
"coingecko": "persistence",
"api": "https://rest.core.persistence.one", "api": "https://rest.core.persistence.one",
"sdk_version": "0.42.4", "sdk_version": "0.42.4",
"addr_prefix": "persistence", "addr_prefix": "persistence",

View File

@ -1,5 +1,6 @@
{ {
"chain_name": "regen", "chain_name": "regen",
"coingecko": "regen",
"api": "https://regen.api.ping.pub", "api": "https://regen.api.ping.pub",
"sdk_version": "0.42.4", "sdk_version": "0.42.4",
"addr_prefix": "regen", "addr_prefix": "regen",

View File

@ -1,5 +1,6 @@
{ {
"chain_name": "secret", "chain_name": "secret",
"coingecko": "secret",
"api": "https://api.scrt.network", "api": "https://api.scrt.network",
"sdk_version": "0.33.8", "sdk_version": "0.33.8",
"addr_prefix": "secret", "addr_prefix": "secret",

View File

@ -1,5 +1,6 @@
{ {
"chain_name": "sentinel", "chain_name": "sentinel",
"coingecko": "sentinel",
"api": "https://lcd.sentinel.co", "api": "https://lcd.sentinel.co",
"sdk_version": "0.42.6", "sdk_version": "0.42.6",
"addr_prefix": "sent", "addr_prefix": "sent",

View File

@ -1,5 +1,6 @@
{ {
"chain_name": "sifchain", "chain_name": "sifchain",
"coingecko": "sifchain",
"api": "https://api.sifchain.finance", "api": "https://api.sifchain.finance",
"sdk_version": "0.42.6", "sdk_version": "0.42.6",
"addr_prefix": "sif", "addr_prefix": "sif",

View File

@ -1,5 +1,6 @@
{ {
"chain_name": "stargaze", "chain_name": "stargaze",
"coingecko": "stargaze-protocol",
"api": "https://rest.stargaze.publicawesome.dev", "api": "https://rest.stargaze.publicawesome.dev",
"sdk_version": "0.44.3", "sdk_version": "0.44.3",
"addr_prefix": "stars", "addr_prefix": "stars",

View File

@ -1,5 +1,6 @@
{ {
"chain_name": "starname", "chain_name": "starname",
"coingecko": "starname",
"api": "https://api.iov-mainnet-ibc.iov.one", "api": "https://api.iov-mainnet-ibc.iov.one",
"sdk_version": "0.42.6", "sdk_version": "0.42.6",
"addr_prefix": "star", "addr_prefix": "star",

View File

@ -1,5 +1,6 @@
{ {
"chain_name": "terra-luna", "chain_name": "terra-luna",
"coingecko": "terra-luna",
"api": "https://fcd.terra.dev", "api": "https://fcd.terra.dev",
"sdk_version": "0.44.2", "sdk_version": "0.44.2",
"addr_prefix": "terra", "addr_prefix": "terra",

View File

@ -1,6 +1,7 @@
{ {
"chain_name": "vidulum", "chain_name": "vidulum",
"api": "https://mainnet-lcd.vidulum.app/", "coingecko": "vidulum",
"api": "https://mainnet-lcd.vidulum.app",
"sdk_version": "0.44.0", "sdk_version": "0.44.0",
"addr_prefix": "vdl", "addr_prefix": "vdl",
"logo": "/logos/VDL.png" "logo": "/logos/VDL.png"

View File

@ -27,6 +27,7 @@
"stargaze": "Stargaze", "stargaze": "Stargaze",
"injective": "Injective Protocal", "injective": "Injective Protocal",
"vidulum": "Vidulum", "vidulum": "Vidulum",
"kichain": "KI Chain",
"staking": "Staking", "staking": "Staking",
"governance": "Governance", "governance": "Governance",

View File

@ -321,6 +321,11 @@ export function formatTokenAmount(tokenAmount, fraction = 2, denom = 'uatom') {
return parseFloat(amount) 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) { export function formatToken(token, IBCDenom = {}, decimals = 2) {
if (token) { if (token) {
return `${formatTokenAmount(token.amount, decimals, token.denom)} ${formatTokenDenom(IBCDenom[token.denom] || token.denom)}` return `${formatTokenAmount(token.amount, decimals, token.denom)} ${formatTokenDenom(IBCDenom[token.denom] || token.denom)}`

View File

@ -355,7 +355,10 @@ export default class ChainFetch {
async getMarketChart(days = 14, coin = null) { async getMarketChart(days = 14, coin = null) {
const conf = this.getSelectedConfig() const conf = this.getSelectedConfig()
const currency = getUserCurrency() 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 // CoinMarketCap

View File

@ -1,4 +1,5 @@
import store from '@/store' import store from '@/store'
import { isTestnet } from '../../libs/data/data'
const modules = [ const modules = [
{ {
@ -71,6 +72,36 @@ function processMenu() {
menu.children = children menu.children = children
chainMenus.push(menu) 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 return chainMenus
} }

View File

@ -1,7 +1,16 @@
/*
* @Description: file
* @Autor: dingyiming
* @Date: 2021-11-20 15:26:27
* @LastEditors: dingyiming
* @LastEditTime: 2021-11-20 15:33:07
*/
import { isTestnet } from '@/libs/data/data'
let chains = {} let chains = {}
let configs = require.context('../../chains/mainnet', false, /\.json$/) 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$/) configs = require.context('../../chains/testnet', false, /\.json$/)
} }

View File

@ -14,7 +14,7 @@
class="mb-1" class="mb-1"
> >
<b-button <b-button
:href="`./uptime/my`" to="./uptime/my"
variant="primary" variant="primary"
> >
Browse favourate only Browse favourate only

View File

@ -51,7 +51,7 @@ export default {
const validators = [] const validators = []
pinned[x].forEach(address => { pinned[x].forEach(address => {
const val = cached.find(v => address === consensusPubkeyToHexAddress(v.consensus_pubkey)) 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 chainVals[x] = validators
}) })