update js

This commit is contained in:
cebgcontract 2022-11-29 13:44:49 +08:00
parent 3e92c2f31e
commit c4dc245230
2 changed files with 6 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -5,8 +5,9 @@ console.log(">>begin load wallet main file");
* @param {string} type: wallet type, 0: internal wallet, 1: third party wallet * @param {string} type: wallet type, 0: internal wallet, 1: third party wallet
*/ */
function initWallet(funId, type, chain) { function initWallet(funId, type, chain, channel) {
// chain = chain || 80001 // chain = chain || 80001
channel = channel || 1
type = 0 type = 0
chain = 80001 chain = 80001
try { try {
@ -21,7 +22,7 @@ function initWallet(funId, type, chain) {
} }
type = parseInt(type); type = parseInt(type);
if (type === 1) { if (type === 1) {
console.log("wallet init success, begin connect") ; console.log("wallet init success, begin connect");
wallet wallet
.initThirdPartyWallet() .initThirdPartyWallet()
.then(() => { .then(() => {
@ -34,7 +35,7 @@ function initWallet(funId, type, chain) {
jsb.jcCallback(funId,JSON.stringify({errcode: 1,errmsg: err})); jsb.jcCallback(funId,JSON.stringify({errcode: 1,errmsg: err}));
}); });
} else { } else {
wallet.initInternalWallet() wallet.initInternalWallet(channel)
.then(() => { .then(() => {
console.log("internal init success"); console.log("internal init success");
var address = jc.wallet.nativeAccount; var address = jc.wallet.nativeAccount;