import fs from 'fs' ; var keythereum = require ( "keythereum" ) ; export type DecryptKeyfile = ( keyfilePath : string , password : string ) => { publicKey : string ; privateKey : string ; } ; export function provideDecryptKeyfile ( ) { return function decryptKeyfile ( keyfilePath , password ) { const keyObject = JSON . parse ( fs . readFileSync ( keyfilePath ) . toString ( ) ) ; return { publicKey : `0x${ keyObject . address }` , privateKey : `0x${ keythereum . recover ( password , keyObject ) . toString ( 'hex' ) }` } ; } ; }