mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-18 15:11:47 +00:00
1aad9d1c21
* Convert Swap to consistent style * Generate wallet reducer cleanup. * Confirm empty action in swap reducer * Union types. Fix gen wallet collision * Fix not using all actions in reducer. Added reducer state for is fetching from bity. Added todo to make that a loader. * Readme instructions. * Remove common action constants. * Bring all actions and reducers inline with readme instructions. * Readme fixes * address comments
39 lines
955 B
JavaScript
39 lines
955 B
JavaScript
// @flow
|
|
import { PrivKeyWallet } from 'libs/wallet';
|
|
|
|
/*** Generate Wallet File ***/
|
|
export type GenerateNewWalletAction = {
|
|
type: 'GENERATE_WALLET_GENERATE_WALLET',
|
|
wallet: PrivKeyWallet,
|
|
password: string
|
|
};
|
|
|
|
export function generateNewWallet(password: string): GenerateNewWalletAction {
|
|
return {
|
|
type: 'GENERATE_WALLET_GENERATE_WALLET',
|
|
wallet: PrivKeyWallet.generate(),
|
|
password
|
|
};
|
|
}
|
|
|
|
/*** Confirm Continue To Paper ***/
|
|
export type ContinueToPaperAction = {
|
|
type: 'GENERATE_WALLET_CONTINUE_TO_PAPER'
|
|
};
|
|
|
|
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;
|