2017-07-16 16:02:13 -05:00
|
|
|
// @flow
|
|
|
|
import { PrivKeyWallet } from 'libs/wallet';
|
2017-04-18 18:34:42 -05:00
|
|
|
|
2017-07-27 13:05:09 -04:00
|
|
|
/*** Generate Wallet File ***/
|
|
|
|
export type GenerateNewWalletAction = {
|
|
|
|
type: 'GENERATE_WALLET_GENERATE_WALLET',
|
|
|
|
wallet: PrivKeyWallet,
|
|
|
|
password: string
|
2017-06-19 22:15:38 -05:00
|
|
|
};
|
2017-04-18 18:34:42 -05:00
|
|
|
|
2017-07-27 13:05:09 -04:00
|
|
|
export function generateNewWallet(password: string): GenerateNewWalletAction {
|
2017-07-16 16:02:13 -05:00
|
|
|
return {
|
2017-07-27 13:05:09 -04:00
|
|
|
type: 'GENERATE_WALLET_GENERATE_WALLET',
|
2017-07-16 16:02:13 -05:00
|
|
|
wallet: PrivKeyWallet.generate(),
|
|
|
|
password
|
|
|
|
};
|
2017-07-27 13:05:09 -04:00
|
|
|
}
|
2017-04-18 18:34:42 -05:00
|
|
|
|
2017-07-27 13:05:09 -04:00
|
|
|
/*** Confirm Continue To Paper ***/
|
|
|
|
export type ContinueToPaperAction = {
|
|
|
|
type: 'GENERATE_WALLET_CONTINUE_TO_PAPER'
|
2017-06-19 22:15:38 -05:00
|
|
|
};
|
2017-04-18 18:34:42 -05:00
|
|
|
|
2017-07-27 13:05:09 -04:00
|
|
|
export function continueToPaper(): ContinueToPaperAction {
|
|
|
|
return { type: 'GENERATE_WALLET_CONTINUE_TO_PAPER' };
|
|
|
|
}
|
2017-07-16 16:02:13 -05:00
|
|
|
|
2017-07-27 13:05:09 -04:00
|
|
|
/*** Reset Generate Wallet ***/
|
|
|
|
export type ResetGenerateWalletAction = {
|
|
|
|
type: 'GENERATE_WALLET_RESET'
|
2017-07-16 16:02:13 -05:00
|
|
|
};
|
2017-07-27 13:05:09 -04:00
|
|
|
|
|
|
|
export function resetGenerateWallet(): ResetGenerateWalletAction {
|
|
|
|
return { type: 'GENERATE_WALLET_RESET' };
|
|
|
|
}
|
|
|
|
|
|
|
|
/*** Action Union ***/
|
|
|
|
export type GenerateWalletAction = GenerateWalletAction;
|