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[]}) {