update js lib

This commit is contained in:
zhl 2023-05-17 19:14:07 +08:00
parent 25de7fc477
commit 8c6aa18bce
2 changed files with 27 additions and 15 deletions

File diff suppressed because one or more lines are too long

View File

@ -214,7 +214,7 @@ function scanQRCode(funId, title) {
function exportWalletSecKey(funId, pass) {
try {
let key = jsb.walletSecKey(funId);
let key = jc.wallet.exportPrivateKey(pass);
return JSON.stringify({ errcode: 0, data: key });
} catch (err) {
return JSON.stringify({ errcode: 1, errmsg: err.message || err });
@ -493,3 +493,15 @@ function emailLogin(funId, email, password) {
!window.jc || !jc.wallet ? new jcwallet.default({ type: 0 }) : jc.wallet;
promiseCb(funId, wallet.emailLogin(email, password));
}
/**
* token list of current chain
*/
function tokenList(funId) {
try {
let data = jc.wallet.currentChainCfg.tokens;
return JSON.stringify({ errcode: 0, data });
} catch (err) {
return JSON.stringify({ errcode: 1, errmsg: err.message || err });
}
}