compatible to v0.46.6

This commit is contained in:
liangping 2022-11-25 17:12:31 +08:00
parent 91c779a7e4
commit 072efbb5a6

View File

@ -145,6 +145,9 @@ export default class ChainFetch {
}
async getBankTotal(denom) {
if (compareVersions(this.config.sdk_version, '0.46.5') > 0) {
return this.get(`/cosmos/bank/v1beta1/supply/by_denom?denom=${denom}`).then(data => commonProcess(data).amount)
}
if (compareVersions(this.config.sdk_version, '0.40') < 0) {
return this.get(`/supply/total/${denom}`).then(data => ({ amount: commonProcess(data), denom }))
}