Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getWalletFromPrivKeyFile(strjson, password) {
let jsonArr;
if (typeof strjson === 'string') {
jsonArr = JSON.parse(strjson);
} else {
jsonArr = strjson;
}
// eslint-disable-next-line new-cap
if (jsonArr.encseed != null)
return new EthereumWallet.fromEthSale(strjson, password);
// eslint-disable-next-line new-cap
else if (jsonArr.Crypto != null || jsonArr.crypto != null)
return new EthereumWallet.fromV3(strjson, password, true);
else if (jsonArr.hash != null)
return this.fromMyEtherWallet(strjson, password);
else if (jsonArr.publisher === 'MyEtherWallet')
return this.fromMyEtherWalletV2(strjson);
throw Error('Error decoding wallet from file');
}
const PresaleWallet = (keystore: string, password: string) =>
signWrapper(fromEthSale(keystore, password));
const PresaleWallet = (keystore, password) => signWrapper(fromEthSale(keystore, password));
export function decryptPresaleToPrivKey (keystore, password)
{
return fromEthSale(keystore, password).getPrivateKey();
}
const PresaleWallet = (keystore: string, password: string) =>
signWrapper(fromEthSale(keystore, password));