forked from cerc-io/cosmos-explorer
Improve IBC transfer
This commit is contained in:
parent
bca324367e
commit
1574ec063f
@ -345,7 +345,7 @@ export default class ChainFetch {
|
|||||||
if (key) {
|
if (key) {
|
||||||
return this.get('/ibc/core/channel/v1/channels?pagination.key='.concat(key), config).then(data => commonProcess(data))
|
return this.get('/ibc/core/channel/v1/channels?pagination.key='.concat(key), config).then(data => commonProcess(data))
|
||||||
}
|
}
|
||||||
return this.get('/ibc/core/channel/v1/channels', config).then(data => commonProcess(data))
|
return this.get('/ibc/core/channel/v1/channels?pagination.limit=1000', config).then(data => commonProcess(data))
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line camelcase
|
// eslint-disable-next-line camelcase
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
centered
|
centered
|
||||||
size="md"
|
size="md"
|
||||||
title="IBC Transfer Tokens"
|
title="IBC Transfer Tokens"
|
||||||
ok-title="Send"
|
:ok-title="actionName"
|
||||||
hide-header-close
|
hide-header-close
|
||||||
scrollable
|
scrollable
|
||||||
:ok-disabled="!address || channels.length === 0"
|
:ok-disabled="!address || channels.length === 0"
|
||||||
@ -391,6 +391,9 @@ export default {
|
|||||||
placeholder() {
|
placeholder() {
|
||||||
return 'Input a destination address'
|
return 'Input a destination address'
|
||||||
},
|
},
|
||||||
|
actionName() {
|
||||||
|
return this.token.startsWith('ibc') ? 'Withdraw' : 'Deposit'
|
||||||
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
// console.log('address: ', this.address)
|
// console.log('address: ', this.address)
|
||||||
@ -464,21 +467,16 @@ export default {
|
|||||||
this.fee = this.selectedChain?.min_tx_fee || '1000'
|
this.fee = this.selectedChain?.min_tx_fee || '1000'
|
||||||
this.feeDenom = this.selectedChain?.assets[0]?.base || ''
|
this.feeDenom = this.selectedChain?.assets[0]?.base || ''
|
||||||
|
|
||||||
const channels = this.$store.state.chains.ibcChannels[this.selectedChain.chain_name]
|
this.$http.getIBCChannels(this.selectedChain, null).then(ret => {
|
||||||
if (!channels) {
|
const chans = ret.channels.filter(x => x.state === 'STATE_OPEN').map(x => ({ channel_id: x.channel_id, port_id: x.port_id }))
|
||||||
this.$http.getIBCChannels(this.selectedChain, null).then(ret => {
|
this.$set(this, 'channels', chans)
|
||||||
const chans = ret.channels.filter(x => x.state === 'STATE_OPEN').map(x => ({ channel_id: x.channel_id, port_id: x.port_id }))
|
// chans.forEach((x, i) => {
|
||||||
chans.forEach((x, i) => {
|
// this.$http.getIBCChannelClientState(x.channel_id, x.port_id, this.selectedChain).then(cs => {
|
||||||
this.$http.getIBCChannelClientState(x.channel_id, x.port_id, this.selectedChain).then(cs => {
|
// chans[i].chain_id = cs.identified_client_state.client_state.chain_id
|
||||||
chans[i].chain_id = cs.identified_client_state.client_state.chain_id
|
// this.$store.commit('setChannels', { chain: this.selectedChain.chain_name, channels: chans })
|
||||||
this.$store.commit('setChannels', { chain: this.selectedChain.chain_name, channels: chans })
|
// })
|
||||||
this.$set(this, 'channels', chans)
|
// })
|
||||||
})
|
})
|
||||||
})
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.channels = channels
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleOk(bvModalEvt) {
|
handleOk(bvModalEvt) {
|
||||||
|
Loading…
Reference in New Issue
Block a user