import { LocalWallet } from '@celo/wallet-local' ; import { KeystoreBase } from './keystore-base' ; /**
 * Convenience wrapper of the LocalWallet to connect to a keystore
 */ export class KeystoreWalletWrapper { private _keystore : KeystoreBase ; private _localWallet : LocalWallet ; constructor ( keystore ) { this . _keystore = keystore ; this . _localWallet = new LocalWallet ( ) ; } async importPrivateKey ( privateKey , passphrase ) { await this . _keystore . importPrivateKey ( privateKey , passphrase ) ; this . _localWallet . addAccount ( privateKey ) ; } getLocalWallet ( ) { return this . _localWallet ; } getKeystore ( ) { return this . _keystore ; } async unlockAccount ( address , passphrase ) { this . _localWallet . addAccount ( await this . _keystore . getPrivateKey ( address , passphrase ) ) ; } async lockAccount ( address ) { this . _localWallet . removeAccount ( address ) ; } }