forked from LaconicNetwork/cosmos-explorer
完成重构
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"chain_name": "akash",
|
||||
"chain_id": "akashnet-1",
|
||||
"api": "http://lcd.akash.forbole.com",
|
||||
"api": "https://lcd-akash.keplr.app",
|
||||
"logo": "https://look.ping.pub/static/chains/cosmoshub.svg"
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"chain_name": "cosmos",
|
||||
"api":"https://api.cosmos.network",
|
||||
"api":"https://lcd-cosmoshub.keplr.app",
|
||||
"logo": "https://look.ping.pub/static/chains/cosmoshub.svg"
|
||||
}
|
||||
@@ -1,26 +1,23 @@
|
||||
const chains = {}
|
||||
const configs = require.context('.', false, /\.json$/)
|
||||
|
||||
let selectedChain = {}
|
||||
configs.keys().forEach(k => {
|
||||
const c = configs(k)
|
||||
if (c.chain_name === 'cosmos') {
|
||||
selectedChain = c
|
||||
}
|
||||
chains[c.chain_name] = c
|
||||
})
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
selectedChain,
|
||||
chains,
|
||||
},
|
||||
getters: {
|
||||
getchains: state => state.chains,
|
||||
currentChain: state => chain => state.chains[chain],
|
||||
},
|
||||
mutations: {
|
||||
setup_sdk_version(state, info) {
|
||||
state.chains.chains[info.chain_name].sdk_version = info.version
|
||||
},
|
||||
|
||||
},
|
||||
actions: {},
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"chain_name": "kava",
|
||||
"chain_id": "kava-7",
|
||||
"api": "https://kava4.data.kava.io",
|
||||
"logo": "https://look.ping.pub/static/chains/cosmoshub.svg"
|
||||
}
|
||||
@@ -17,5 +17,6 @@ export default new Vuex.Store({
|
||||
verticalMenu,
|
||||
chains,
|
||||
},
|
||||
mutations: chains.mutations,
|
||||
strict: process.env.DEV,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user