diff --git a/.github/workflows/mainnet-deploy.yaml b/.github/workflows/mainnet-deploy.yaml
index 5f93121a..95271eee 100644
--- a/.github/workflows/mainnet-deploy.yaml
+++ b/.github/workflows/mainnet-deploy.yaml
@@ -15,7 +15,7 @@ jobs:
- name: print
run: echo ${GITHUB_REF#refs/heads/}
- name: Git Checkout Latest
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
- name: Install
run: yarn install
diff --git a/src/chains/mainnet/jackal.json b/src/chains/mainnet/jackal.json
index 78675627..f1b7fbcc 100644
--- a/src/chains/mainnet/jackal.json
+++ b/src/chains/mainnet/jackal.json
@@ -1,18 +1,18 @@
{
"chain_name": "jackal",
"coingecko": "",
- "api": "https://api.jackalprotocol.com",
- "rpc": "https://rpc.jackalprotocol.com",
+ "api": ["https://api.jackalprotocol.com", "https://jackal-api.polkachu.com","https://api.jackal.nodestake.top"],
+ "rpc": ["https://rpc.jackalprotocol.com", "https://jackal-rpc.polkachu.com","https://rpc.jackal.nodestake.top"],
"snapshot_provider": "",
"coin_type": "118",
"sdk_version": "0.45.9",
- "addr_prefix": "jkl",
+ "addr_prefix": "jkl",
"logo": "/logos/jackal.png",
"assets": [{
"base": "ujkl",
"symbol": "JKL",
"exponent": "6",
- "coingecko_id": "jackal",
+ "coingecko_id": "jackal",
"logo": "/logos/jackal.png"
}]
}
diff --git a/src/libs/fetch.js b/src/libs/fetch.js
index 45825b28..5a51a28b 100644
--- a/src/libs/fetch.js
+++ b/src/libs/fetch.js
@@ -185,7 +185,19 @@ export default class ChainFetch {
async getValidatorList(config = null) {
return this.get('/cosmos/staking/v1beta1/validators?pagination.limit=200&status=BOND_STATUS_BONDED', config).then(data => {
const vals = commonProcess(data.validators).map(i => new Validator().init(i))
- localStorage.setItem(`validators-${this.config.chain_name}`, JSON.stringify(vals))
+ try {
+ localStorage.setItem(`validators-${this.config.chain_name}`, JSON.stringify(vals))
+ } catch (err) {
+ // clear cache
+ for (let i = 0; i < localStorage.length; i += 1) {
+ const key = localStorage.key(i)
+ if (key.startsWith('validators')) {
+ localStorage.removeItem(key)
+ }
+ }
+ // set again
+ localStorage.setItem(`validators-${this.config.chain_name}`, JSON.stringify(vals))
+ }
return vals
})
}
diff --git a/src/store/chains/index.js b/src/store/chains/index.js
index 8d766933..eafaee1e 100644
--- a/src/store/chains/index.js
+++ b/src/store/chains/index.js
@@ -10,7 +10,7 @@ import { sha256 } from '@cosmjs/crypto'
import { toHex } from '@cosmjs/encoding'
let chains = {}
-
+const coingecko = {}
let configs = require.context('../../chains/mainnet', false, /\.json$/)
if (isTestnet()) {
configs = require.context('../../chains/testnet', false, /\.json$/)
@@ -21,6 +21,9 @@ configs.keys().forEach(k => {
const c = configs(k)
c.chain_name = String(c.chain_name).toLowerCase()
update[c.chain_name] = c
+ c.assets.forEach(x => {
+ if (x.coingecko_id && x.coingecko_id !== '') coingecko[x.coingecko_id] = String(x.symbol).toUpperCase()
+ })
})
chains = update
@@ -83,9 +86,21 @@ export default {
},
actions: {
async getQuotes(context) {
- fetch('https://price.ping.pub/quotes').then(data => data.json()).then(data => {
- context.commit('setQuotes', data)
- })
+ // fetch('https://price.ping.pub/quotes').then(data => data.json()).then(data => {
+ // context.commit('setQuotes', data)
+ // })
+ const keys = Object.keys(coingecko)
+ if (keys.length > 0) {
+ const currencies = 'usd,cny,eur,jpy,krw,sgd,hkd'
+ fetch(`https://api.coingecko.com/api/v3/simple/price?vs_currencies=${currencies}&ids=${keys.join(',')}`).then(data => data.json()).then(data => {
+ // use symbol as key instead of coingecko id
+ const quotes = {}
+ Object.keys(data).forEach(k => {
+ quotes[coingecko[k]] = data[k]
+ })
+ context.commit('setQuotes', quotes)
+ })
+ }
},
async getAllIBCDenoms(context, _this) {
diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue
index 92ec46f1..621522d4 100644
--- a/src/views/Dashboard.vue
+++ b/src/views/Dashboard.vue
@@ -319,7 +319,7 @@