})
}
- advancedTransfer(account, input, output, gas) {
+ advancedTransfer(account, input, output, gas, args) {
return _send(MsgTypes.ADVTRANSFER, {
account,
input,
output,
- gas
+ gas,
+ args
})
}
return bytom.transaction.list(guid, address, start, limit);
};
+transaction.convertArgument = function(argArray) {
+ let fn = function asyncConvert(object){
+ const type = object.type
+ const value = object.value
+ return bytom.transaction.convertArgument(type, value)
+ .then(resp => resp.value);
+ };
+
+ let actionFunction = argArray.map(fn)
+ console.log(actionFunction)
+ return Promise.all(actionFunction);
+};
+
transaction.blockCount = function() {
return bytom.query.getblockcount();
};
const inout = JSON.parse(this.$route.query.object)
transaction.buildTransaction(this.account.guid, inout.input, inout.output, inout.gas).then(ret => {
- const arrayData = ret.result.data.signing_instructions[0].data
- return transaction.advancedTransfer(this.account.guid, ret.result.data, passwd, arrayData)
- .then((resp) => {
- loader.hide();
- LocalStream.send({method:'advanced-transfer',action:'success', message:resp});
- this.$dialog.show({
- body: this.$t("transfer.success")
- });
- this.$router.push('/');
- })
+ return transaction.convertArgument(inout.args)
+ .then((arrayData) =>{
+ return transaction.advancedTransfer(this.account.guid, ret.result.data, passwd, arrayData)
+ .then((resp) => {
+ loader.hide();
+ LocalStream.send({method:'advanced-transfer',action:'success', message:resp});
+ this.$dialog.show({
+ body: this.$t("transfer.success")
+ });
+ this.$router.push('/');
+ })
+ .catch(error => {
+ throw error
+ });
+ })
.catch(error => {
throw error
});