This commit is contained in:
liangping 2021-11-17 15:28:09 +08:00
parent 9752ff1d04
commit 0ccfd3b79f
29 changed files with 12 additions and 29 deletions

View File

@ -0,0 +1,8 @@
{
"chain_name": "iris-network",
"api": "http://35.234.10.84:1317",
"sdk_version": "0.42.4",
"addr_prefix": "iaa",
"excludes": "mint",
"logo": "https://dl.airtable.com/.attachments/2d6d51b1b262db00ecc51616ffc3bdf5/90ff00d0/IRISnet.svg"
}

View File

@ -1,6 +1,9 @@
let chains = {} let chains = {}
const configs = require.context('.', false, /\.json$/) let configs = require.context('../../chains/mainnet', false, /\.json$/)
if (window.location.hostname.startsWith('testnet') || window.location.search.indexOf('testnet')) {
configs = require.context('../../chains/testnet', false, /\.json$/)
}
const update = {} const update = {}
configs.keys().forEach(k => { configs.keys().forEach(k => {
@ -8,38 +11,10 @@ configs.keys().forEach(k => {
update[c.chain_name] = c update[c.chain_name] = c
}) })
// const localChains = localStorage.getItem('chains')
// if (localChains) {
// chains = JSON.parse(localChains)
// } else {
chains = update chains = update
localStorage.setItem('chains', JSON.stringify(update)) localStorage.setItem('chains', JSON.stringify(update))
const selected = chains.cosmos const selected = chains.cosmos
// }
// Object.keys(update).forEach(key => {
// const chain = update[key]
// if (!chain.sdk_version) {
// fetch(`${chain.api}/node_info`)
// .then(res => res.json())
// .then(json => {
// const { build_deps } = json.application_version
// // eslint-disable-next-line camelcase
// if (build_deps) {
// const sdk = build_deps.find(e => e.startsWith('github.com/cosmos/cosmos-sdk'))
// const re = /(\d+(\.\d+)*)/i
// const version = sdk.match(re)
// // eslint-disable-next-line prefer-destructuring
// chain.sdk_version = version[0]
// } else {
// chain.sdk_version = json.node_info.version
// }
// localStorage.setItem('chains', JSON.stringify(update))
// })
// }
// })
export default { export default {
namespaced: true, namespaced: true,
state: { state: {