增加全局遍历jc.wallet

This commit is contained in:
cebgcontract 2022-06-16 16:56:23 +08:00
parent 1a193f1f0e
commit 77def1b26d

View File

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