MyCrypto/common/actions/generateWallet.js

39 lines
955 B
JavaScript
Raw Normal View History

// @flow
import { PrivKeyWallet } from 'libs/wallet';
2017-04-18 23:34:42 +00:00
/*** Generate Wallet File ***/
export type GenerateNewWalletAction = {
type: 'GENERATE_WALLET_GENERATE_WALLET',
wallet: PrivKeyWallet,
password: string
};
2017-04-18 23:34:42 +00:00
export function generateNewWallet(password: string): GenerateNewWalletAction {
return {
type: 'GENERATE_WALLET_GENERATE_WALLET',
wallet: PrivKeyWallet.generate(),
password
};
}
2017-04-18 23:34:42 +00:00
/*** Confirm Continue To Paper ***/
export type ContinueToPaperAction = {
type: 'GENERATE_WALLET_CONTINUE_TO_PAPER'
};
2017-04-18 23:34:42 +00:00
export function continueToPaper(): ContinueToPaperAction {
return { type: 'GENERATE_WALLET_CONTINUE_TO_PAPER' };
}
/*** Reset Generate Wallet ***/
export type ResetGenerateWalletAction = {
type: 'GENERATE_WALLET_RESET'
};
export function resetGenerateWallet(): ResetGenerateWalletAction {
return { type: 'GENERATE_WALLET_RESET' };
}
/*** Action Union ***/
export type GenerateWalletAction = GenerateWalletAction;