diff --git a/src/libs/fetch.js b/src/libs/fetch.js index b5b3c196..b64f4a4b 100644 --- a/src/libs/fetch.js +++ b/src/libs/fetch.js @@ -321,7 +321,8 @@ export default class ChainFetch { async getIBCDenomTrace(hash, config = null) { const h = hash.substring(hash.indexOf('/') + 1) - if (compareVersions(this.config.sdk_version, '0.42.6') < 0) { + const sdkVersion = config ? config.sdk_version : this.config.sdk_version + if (compareVersions(sdkVersion, '0.42.4') < 0) { return this.get('/ibc/applications/transfer/v1beta1/denom_traces/'.concat(h), config).then(data => commonProcess(data)) } return this.get('/ibc/apps/transfer/v1/denom_traces/'.concat(h), config).then(data => commonProcess(data)) @@ -350,15 +351,6 @@ export default class ChainFetch { return ChainFetch.fetch(baseurl, '/bank/balances/'.concat(address)).then(data => commonProcess(data)) } - static async getIBCDenomTrace(baseurl, hash) { - const h = hash.substring(hash.indexOf('/')) - return ChainFetch.fetch(baseurl, '/ibc/applications/transfer/v1beta1/denom_traces/'.concat(h)).then(data => commonProcess(data)) - } - - static async getIBCDenomTraceText(baseurl, hash) { - return ChainFetch.getIBCDenomTrace(baseurl, hash).then(res => res.denom_trace.base_denom) - } - async getGravityPools() { return this.get('/cosmos/liquidity/v1beta1/pools').then(data => commonProcess(data)) } diff --git a/src/views/WalletAccountDetail.vue b/src/views/WalletAccountDetail.vue index 6464621c..64d44409 100644 --- a/src/views/WalletAccountDetail.vue +++ b/src/views/WalletAccountDetail.vue @@ -583,7 +583,7 @@ export default { this.assets = bal bal.forEach(x => { if (x.denom.startsWith('ibc/')) { - chainAPI.getIBCDenomTraceText(this.$http.config.api, x.denom).then(denom => { + this.$http.getIBCDenomTrace(x.denom).then(denom => { this.$set(this.denoms, x.denom, denom) const symbol = formatTokenDenom(denom) if (!this.quotes[symbol] && symbol.indexOf('/') === -1) {