import { Address , normalizeAddressWith0x , privateKeyToAddress } from '@celo/utils/lib/address' ; import { Wallet , WalletBase } from '@celo/wallet-base' ; import { LocalSigner } from './local-signer' ; export class LocalWallet extends WalletBase < LocalSigner > implements Wallet { param privateKey addAccount ( privateKey ) { privateKey = normalizeAddressWith0x ( privateKey ) ; const accountAddress = normalizeAddressWith0x ( privateKeyToAddress ( privateKey ) ) ; if ( this . hasAccount ( accountAddress ) ) { return ; } this . addSigner ( accountAddress , new LocalSigner ( privateKey ) ) ; } param address removeAccount ( address ) { this . removeSigner ( address ) ; } }