From 072efbb5a6eaddf165b8f2361608e6c3ed37d2f5 Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Fri, 25 Nov 2022 17:12:31 +0800 Subject: [PATCH] compatible to v0.46.6 --- src/libs/fetch.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libs/fetch.js b/src/libs/fetch.js index 979b8fe6..4ea24d81 100644 --- a/src/libs/fetch.js +++ b/src/libs/fetch.js @@ -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 })) }