<div class="divider"></div>
+ <tr v-for="(amountInput, index) in transaction.amounts" :key="index" class="row">
+ <td class="col label">{{index ==0 && $t('transfer.transferAmount') }}</td>
+ <td class="col value">{{amountInput.amount}}<span class="uint uppercase">{{amountInput.alias || amountInput.asset}}</span></td>
+ </tr>
+
<tr class="row">
<td class="col label">{{ $t('transfer.fee') }}</td>
<td class="col value">{{transaction.fee}}<span class="uint">BTM</span></td>
</tr>
+
</tbody>
</table>
</section>
import {apis} from '@/utils/BrowserApis';
import NotificationService from '../../services/NotificationService'
import { mapActions, mapGetters, mapState } from 'vuex'
+import _ from 'lodash';
+import account from "@/models/account";
+import { Number as Num } from "@/utils/Number"
+
+
export default {
data() {
return {
full: false,
- // full2: false,
- // account: {},
transaction: {
input: "",
output: "",
computed: {
...mapGetters([
'currentAccount',
+ 'net',
+ 'netType',
])
},
watch: {
onCancel: this.onCancel
});
- transaction.buildTransaction(this.currentAccount.guid, this.transaction.input, this.transaction.output, this.transaction.fee * 100000000, this.transaction.confirmations).then(async (result) => {
+ transaction.buildTransaction(this.currentAccount.guid, this.transaction.input, this.transaction.output, this.transaction.fee , this.transaction.confirmations).then(async (result) => {
let arrayData
if(this.transaction.args){
body: getLang(error.message)
});
});
- }
+ },
+ queryAsset: function(assetID){
+ return transaction.asset(assetID)
+ }
}, mounted() {
this.prompt = window.data || apis.extension.getBackgroundPage().notification || null;
this.transaction.args = inout.args
}
if(inout.gas !== undefined){
- this.transaction.fee = inout.gas/100000000
+ this.transaction.fee = inout.gas
}
if(inout.confirmations !== undefined){
this.transaction.confirmations = inout.confirmations
}
const array = inout.input.filter(action => action.type ==='spend_wallet')
- this.transaction.amounts = array
+
+ if(array.length>0){
+ account.setupNet(`${this.net}${this.netType}`)
+ const promise =
+ _(array)
+ .groupBy('asset')
+ .map((objs, key) => {
+ return this.queryAsset(key).then(resp =>{
+ return {
+ 'asset': key,
+ 'alias':resp.alias,
+ 'amount':Num.formatNue( _.sumBy(objs, 'amount'), resp.decimals)
+ }
+ })
+ })
+
+ let that = this;
+ Promise.all(promise).then(function(output) {
+ that.transaction.amounts = output
+ })
+
+ }
+
+
}
}
};