amountHint:'跨链交易预计24小时内完成',
toVapor:'转入\nVapor链',
toBytom:'转出至\nBytom链',
- asset:'选择资产'
+ asset:'选择资产',
+ direction:'跨链方向'
},
listVote:{
title:'节点投票',
bpPubkey:'节点公钥',
vote:'投票',
votes:'票数',
+ voteVotes:'投票票数',
voteAccount:'投票账户',
vetoAccount:'取消投票账户'
},
amountHint:'Cross Chain Transaction will be completed in 24 hrs.',
toVapor:'Transfer to \n Vapor Chain',
toBytom:'Transfer to \n Bytom Chain',
- asset:'Select Asset'
+ asset:'Select Asset',
+ direction:'Cross Direction'
},
listVote:{
title:'Block Producer Voting',
bpPubkey:'BP Public Key',
vote:'Vote',
votes:'Votes',
+ voteVotes:'Votes',
voteAccount:'Vote Account',
vetoAccount:'Veto Account'
},
import Bytom from 'bytom-js-sdk'
var networks = {
- testnetvapor: 'http://52.82.55.145:3000/api/v1/vapor/',
- testnet: 'http://52.82.55.145:3000/api/v1/btm/',
- solonet: 'http://app.bycoin.io:3060/api/v1/btm/',
+ solonetvapor: 'http://52.82.55.145:3000/api/v1/vapor/',
+ solonet: 'http://52.82.55.145:3000/api/v1/btm/',
+ testnetvapor: 'http://app.bycoin.io:3020/api/v1/vapor/',
+ testnet: 'http://app.bycoin.io:3020/api/v1/btm/',
mainnet: 'https://api.bycoin.im:8000/api/v1/btm/',
mainnetvapor: 'https://api.bycoin.im:8000/api/v1/vapor/'
}
<script>
import address from "@/utils/address";
+import query from "@/models/query";
import transaction from "@/models/transaction";
import { BTM } from "@/utils/constants";
import { mapActions, mapGetters, mapState } from 'vuex'
computed: {
...mapState([
'bytom',
- 'currentAsset'
+ 'currentAsset',
+ 'listVote'
]),
...mapGetters([
'currentAccount',
.filter(b => b.asset === assetID);
const filterInput = _.find(transaction.inputs, function(o) { return o.type =='veto'; })
+ const filterOutput = _.find(transaction.outputs, function(o) { return o.type =='vote'; })
if(filterInput){
transaction.type = 'veto'
const inAmount = _.sumBy((transaction.inputs.filter(i => i.type ==='veto')), 'amount')
const outAmount = _.sumBy((transaction.outputs.filter(i => i.type ==='vote')), 'amount')
+ transaction.pubkey = filterInput.vote
transaction.vAmount = Num.formatNue(inAmount-outAmount,8)
- }else if(_.find(transaction.outputs, function(o) { return o.type =='vote'; })){
+ }else if(filterOutput){
const outAmount = _.sumBy((transaction.outputs.filter(i => i.type ==='vote')), 'amount')
+ transaction.pubkey = filterOutput.vote
transaction.vAmount = Num.formatNue(outAmount,8)
transaction.type = 'vote'
}else if(_.find(transaction.outputs, function(o) { return o.type =='crosschain_output'; })){
transaction.type = 'crossChain'
+ transaction.cDirection ='Vapor -> Bytom'
}else if(_.find(transaction.inputs, function(o) { return o.type =='crosschain_input'; })){
transaction.type = 'crossChain'
+ transaction.cDirection ='Bytom -> Vapor'
}
if(balanceObject.length ===1 ){
},
...mapActions([
Actions.UPDATE_STORED_BYTOM,
+ Actions.SET_LIST_VOTE
])
},
mounted() {
this.refreshTransactions( this.start, this.limit).then(transactions => {
this.transactions = transactions
});
+ if(this.listVote.length == 0){
+ query.chainStatus().then(resp => {
+ if(resp){
+ const votes = resp.consensus_nodes.map( (item, index) => {
+ item.rank = index+1;
+ return item
+ });
+ this[Actions.SET_LIST_VOTE](votes)
+ }
+ })
+ }
},
};
</script>
},
netTypeToggle: function (event) {
const newNetType = event.target.value ==='bytom'? '' :event.target.value;
+
+ console.log(newNetType)
+ console.log(this.netType)
if( newNetType !== this.netType){
const bytom = this.bytom.clone();
const balanceObject = balances.filter(b => b.asset === BTM)[0]
balance = balanceObject.balance
- let vote, lock
+ let vote = 0, lock = 0
const votes = this.currentAccount.votes
<p>{{transaction.fee}}</p>
</td>
</tr>
+ <tr v-if="transaction.type =='vote'">
+ <td colspan="2"><div class="divider"></div></td>
+ </tr>
+ <tr v-if="transaction.type =='vote'">
+ <td class="label">
+ {{ $t('listVote.bpName') }}
+ </td>
+ <td class="value">
+ <p>{{transaction.vName}}</p>
+ </td>
+ </tr>
+ <tr v-if="transaction.type =='vote'">
+ <td class="label">
+ {{ $t('listVote.voteVotes') }}
+ </td>
+ <td class="value">
+ <p>{{transaction.vAmount}}</p>
+ </td>
+ </tr>
+ <tr v-if="transaction.type =='crossChain'">
+ <td colspan="2"><div class="divider"></div></td>
+ </tr>
+ <tr v-if="transaction.type =='crossChain'">
+ <td class="label">
+ {{ $t('crossChain.direction') }}
+ </td>
+ <td class="value">
+ <p>{{transaction.cDirection}}</p>
+ </td>
+ </tr>
<tr>
<td colspan="2"><div class="divider"></div></td>
</tr>
}
},
...mapState([
- 'currentAsset'
+ 'currentAsset',
+ 'listVote'
]),
...mapGetters([
'currentAccount',
mounted() {
let params = this.$route.params;
- this.transaction = params.transaction;
+ let transaction = params.transaction;
if(this.netType === 'vapor'){
this.selfAddress = this.currentAccount.vpAddress;
}else{
this.selfAddress = this.currentAccount.address;
}
console.log(params.transaction)
+ if(transaction.type =='vote' || transaction.type =='veto'){
+ const node =_.find(this.listVote, {pub_key: transaction.pubkey})
+ transaction.vName = node.name
+ }
+ this.transaction = transaction
}
};
</script>
const balanceObject = balances.filter(b => b.asset === BTM)[0]
balance = balanceObject.balance
- let vote, lock
+ let vote = 0, lock = 0
const votes = this.currentAccount.votes
if(votes && votes.length >0 ){
vote = _.sumBy(votes,'total')