forked from LaconicNetwork/cosmos-explorer
add new Dashboard
This commit is contained in:
@@ -416,6 +416,10 @@ export default class ChainFetch {
|
||||
return this.get('/bank/balances/'.concat(address), config).then(data => commonProcess(data))
|
||||
}
|
||||
|
||||
async getCommunityPool(config = null) {
|
||||
return this.get('/cosmos/distribution/v1beta1/community_pool', config).then(data => commonProcess(data))
|
||||
}
|
||||
|
||||
async getAllIBCDenoms(config = null) {
|
||||
const conf = config || this.getSelectedConfig()
|
||||
const sdkVersion = conf.sdk_version
|
||||
@@ -470,6 +474,14 @@ export default class ChainFetch {
|
||||
return null
|
||||
}
|
||||
|
||||
async getCoinInfo(coin = null) {
|
||||
const conf = this.getSelectedConfig()
|
||||
if (conf.assets[0] && conf.assets[0].coingecko_id) {
|
||||
return ChainFetch.fetch(' https://api.coingecko.com', `/api/v3/coins/${coin || conf.assets[0].coingecko_id}`)
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
// CoinMarketCap
|
||||
static async fetchCoinMarketCap(url) {
|
||||
const host = 'https://price.ping.pub'
|
||||
|
||||
+2
-2
@@ -439,9 +439,9 @@ export function formatNumber(count, withAbbr = false, decimals = 2) {
|
||||
return result
|
||||
}
|
||||
|
||||
export function tokenFormatter(tokens, denoms = {}) {
|
||||
export function tokenFormatter(tokens, denoms = {}, decimal = 2) {
|
||||
if (Array.isArray(tokens)) {
|
||||
return tokens.map(t => formatToken(t, denoms, 2)).join(', ')
|
||||
return tokens.map(t => formatToken(t, denoms, decimal)).join(', ')
|
||||
}
|
||||
return formatToken(tokens, denoms, 2)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user