Merge pull request #297 from planq-network/cosmos-sdk-v0.46.3

fix: adjust getBankTotal function to support v0.46.3+ with new query
This commit is contained in:
ping 2022-12-19 21:02:24 +08:00 committed by GitHub
commit aeb712a779
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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