cocos_android/js/main.js
2022-07-20 16:43:02 +08:00

37 lines
739 B
JavaScript

console.log('>>hi tiny wallet3')
function initWallet(password) {
if (!jc.wallet) {
var wallet = new jcwallet.default(password);
}
return jc.wallet.currentAccount().address;
}
function currentAccount() {
return jc.wallet.currentAccount().address;
}
function loginSign(nonce, tips) {
return jc.wallet.loginSign(nonce, tips);
}
function createAccount() {
return jc.wallet.createAccount();
}
function importAccount(privateKey) {
return jc.wallet.importAccount(privateKey);
}
function selectAccount(address) {
return jc.wallet.selectAccount(address);
}
function getBalance(address) {
return jc.wallet.getBalance(address);
}
function sendEth(to, amount) {
jc.wallet.sendEth(to, amount);
}