From 77def1b26dfdf9f87ef519eb4d3420269c36c3c9 Mon Sep 17 00:00:00 2001 From: cebgcontract <99630598+cebgcontract@users.noreply.github.com> Date: Thu, 16 Jun 2022 16:56:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=A8=E5=B1=80=E9=81=8D?= =?UTF-8?q?=E5=8E=86jc.wallet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/comp/wallet/scripts/JCWallet.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/assets/comp/wallet/scripts/JCWallet.ts b/assets/comp/wallet/scripts/JCWallet.ts index 0a69bb9..741c87d 100644 --- a/assets/comp/wallet/scripts/JCWallet.ts +++ b/assets/comp/wallet/scripts/JCWallet.ts @@ -5,7 +5,6 @@ import { ZError } from "./common/ZError"; import { AllChains } from "./data/allchain"; import { createWalletEvents, WALLET_CHAIN_CHANGE } from "./common/WalletEvent"; - export interface IChainData { name: string, type: string, @@ -14,10 +13,10 @@ export interface IChainData { symbol: string, explorerurl: string } -interface Window { - JCWallet: JCWallet +declare namespace jc { + export let wallet: JCWallet } -declare let window: Window + @singleton export default class JCWallet { web3: Web3 = null @@ -37,7 +36,7 @@ export default class JCWallet { this.wallet.add(key); this.web3.eth.accounts.wallet.save(this.password); } - window.JCWallet = this + jc.wallet = this } public init({chains}: {chains: number[]}) {