diff --git a/src/index.ts b/src/index.ts index 62b954d..584ed97 100644 --- a/src/index.ts +++ b/src/index.ts @@ -90,9 +90,6 @@ export default class JCWallet { this._currentChain = data; this.rpcUrl = data.rpc; console.log(`rpc url: ${this.rpcUrl}`); - if (this.walletType === WalletType.INTERNAL) { - this.prepareInternalWallet(); - } this.init({ chains: [chain], password: this.password }); window.jc = { wallet: this }; } @@ -101,16 +98,8 @@ export default class JCWallet { return this.walletType === WalletType.INTERNAL; } - private prepareInternalWallet() { - let token = loadToken(); - if (!token) { - // check if token expired - } else { - // to goole login - } - } - public async initInternalWallet(channel: number) { + this.walletType = WalletType.INTERNAL; let address: string = await loadInternalWallet(channel); this.nativeAccount = address; console.log("native wallet address: " + address); @@ -150,6 +139,7 @@ export default class JCWallet { * @returns */ public async initThirdPartyWallet() { + this.walletType = WalletType.THIRD_PATH; return new Promise((resolve, reject) => { for (const d of AllChains) { const id = d.id;