forked from LaconicNetwork/cosmos-explorer
add onchain asset and band protocal
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"chain_name": "band",
|
||||
"api": "https://api-gm-lb.bandchain.org",
|
||||
"logo": "https://dl.airtable.com/.attachments/472ae99a508e32b4439b416beddd4eb9/c5166f62/band-symbol-blue-bg.75a3ad91.svg"
|
||||
}
|
||||
@@ -20,11 +20,17 @@ Object.keys(update).forEach(key => {
|
||||
fetch(`${chain.api}/node_info`)
|
||||
.then(res => res.json())
|
||||
.then(json => {
|
||||
const sdk = json.application_version.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]
|
||||
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))
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user