This commit is contained in:
liangping 2022-05-17 08:11:47 +08:00
commit fc39b57115
2 changed files with 23 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{ {
"chain_name": "echelon", "chain_name": "echelon",
"coingecko": "", "coingecko": "echelon",
"api": "https://api.ech.network", "api": "https://api.ech.network",
"rpc": ["https://tendermint.ech.network"], "rpc": ["https://tendermint.ech.network"],
"snapshot_provider": "", "snapshot_provider": "",
@ -13,7 +13,7 @@
"base": "aechelon", "base": "aechelon",
"symbol": "ECH", "symbol": "ECH",
"exponent": "18", "exponent": "18",
"coingecko_id": "", "coingecko_id": "echelon",
"logo": "/logos/echelon.gif" "logo": "/logos/echelon.gif"
}] }]
} }

View File

@ -135,6 +135,9 @@ export default class ChainFetch {
if (this.config.chain_name === 'evmos') { if (this.config.chain_name === 'evmos') {
return this.get('/evmos/inflation/v1/inflation_rate').then(data => Number(data.inflation_rate / 100 || 0)) return this.get('/evmos/inflation/v1/inflation_rate').then(data => Number(data.inflation_rate / 100 || 0))
} }
if (this.config.chain_name === 'echelon') {
return this.get('/echelon/inflation/v1/inflation_rate').then(data => Number(data.inflation_rate / 100 || 0))
}
if (this.isModuleLoaded('minting')) { if (this.isModuleLoaded('minting')) {
return this.get('/minting/inflation').then(data => Number(commonProcess(data))) return this.get('/minting/inflation').then(data => Number(commonProcess(data)))
} }
@ -206,6 +209,24 @@ export default class ChainFetch {
}) })
return result return result
} }
if (this.config.chain_name === 'echelon') {
const result = await this.get('/echelon/inflation/v1/params').then(data => data.params)
await this.get('/echelon/inflation/v1/period').then(data => {
Object.entries(data).forEach(x => {
const k = x[0]
const v = x[1]
result[k] = v
})
})
await this.get('/echelon/inflation/v1/total_supply').then(data => {
Object.entries(data).forEach(x => {
const k = x[0]
const v = x[1]
result[k] = v
})
})
return result
}
if (this.isModuleLoaded('minting')) { if (this.isModuleLoaded('minting')) {
return this.get('/minting/parameters').then(data => commonProcess(data)) return this.get('/minting/parameters').then(data => commonProcess(data))
} }