This commit is contained in:
chaosBreaking
2019-10-03 00:22:23 +08:00
parent ef66042e49
commit 538b73e015
9 changed files with 131 additions and 16 deletions

View File

@@ -27,6 +27,16 @@ module.exports = {
},
async sendVIC2User (toAddress, amount, option = {}) {
const account = ERC20.fromMnemonic(VICSECWORD, VICCONTRACTADDR);
return await account.transfer(toAddress, amount, Object.assign(option, { decimals: 18 }));
return await account.transfer(toAddress, amount, Object.assign(option, { decimals: 18 })).then(res => {
return {
success: true,
res
};
}).catch(err => {
return {
error: err,
res: null
};
});
}
};