From 430e210bf6bb41d50747b7bdd030fbf4da0b35cb Mon Sep 17 00:00:00 2001 From: cebgcontract <99630598+cebgcontract@users.noreply.github.com> Date: Mon, 5 Dec 2022 15:50:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=86=85=E5=A4=96=E9=92=B1?= =?UTF-8?q?=E5=8C=85=E7=9A=84=E5=88=87=E6=8D=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.ts | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) 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;