获取钱包信息(节点、地址、币种、余额)
const walletData = window.android.getWallet();
let fodData = JSON.parse(walletData);
let node = fodData.node;
let address = fodData.address;
let currency = fodData.currency;
let balance = fodData.balance;
转账交易(成功后会返回交易哈希)
第一步
created() {
window.getBoxTxID = this.getBoxTxID;
}
第二步
async FodNonContractTransfer() {
await window.android.toTransferAccounts(account,money,token,contractAddress);
},
getBoxTxID(txID) {
if(txID) {
console.log('交易hash:' + txID);
}
}
获取对应的代币余额
第一步
created() {
window.setContractMoney = this.setContractMoney;
}
第二步
async getContractWallet() {
await window.android.getContractWallet(contractAddress,nodeCode);
},
setContractMoney(amount) {
console.log('代币余额:' + amount);
}
|