mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-28 20:06:32 +00:00
994fa03828
* Rsk network with checksum * Initial change from chainid everywhere to selectors * Fix ternary * Check in address book changes to lower case. Currently a little busted. * Fix validation * Fix tests. * Identicon back to SFC * Remove unnecessary prop * Paper Wallet Refactor (#1950) * Convert print wallet to save png image. Move all styles into CSS. * Fix re-print paper wallet with save modal * Address PR comments
25 lines
710 B
TypeScript
25 lines
710 B
TypeScript
import { IV3Wallet } from 'ethereumjs-wallet';
|
|
import Worker from 'worker-loader!./workers/generateKeystore.worker.ts';
|
|
|
|
interface KeystorePayload {
|
|
filename: string;
|
|
keystore: IV3Wallet;
|
|
privateKey: string;
|
|
}
|
|
|
|
export default function generateKeystore(
|
|
password: string,
|
|
N_FACTOR: number
|
|
): Promise<KeystorePayload> {
|
|
return new Promise(resolve => {
|
|
const worker = new Worker();
|
|
worker.postMessage({ password, N_FACTOR });
|
|
worker.onmessage = (ev: MessageEvent) => {
|
|
const filename: string = ev.data.filename;
|
|
const privateKey: string = ev.data.privateKey;
|
|
const keystore: IV3Wallet = ev.data.keystore;
|
|
resolve({ keystore, filename, privateKey });
|
|
};
|
|
});
|
|
}
|