MyCrypto/common/actions/wallet.js

45 lines
864 B
JavaScript
Raw Normal View History

2017-06-30 03:03:11 +04:00
// @flow
import type { PrivateKeyUnlockParams } from 'libs/wallet/privkey';
import BaseWallet from 'libs/wallet/base';
export type UnlockPrivateKeyAction = {
2017-07-03 22:21:19 -05:00
type: 'WALLET_UNLOCK_PRIVATE_KEY',
payload: PrivateKeyUnlockParams
2017-06-30 03:03:11 +04:00
};
export type SaveWalletAction = {
2017-07-03 22:21:19 -05:00
type: 'WALLET_SAVE',
payload: BaseWallet
2017-06-30 03:03:11 +04:00
};
2017-07-04 03:59:27 +04:00
export type InitWalletAction = {
2017-07-03 22:21:19 -05:00
type: 'WALLET_INIT'
2017-07-04 03:59:27 +04:00
};
2017-07-03 22:21:19 -05:00
export type WalletAction =
| UnlockPrivateKeyAction
| SaveWalletAction
| InitWalletAction;
2017-06-30 03:03:11 +04:00
2017-07-03 22:21:19 -05:00
export function unlockPrivateKey(
value: PrivateKeyUnlockParams
): UnlockPrivateKeyAction {
return {
type: 'WALLET_UNLOCK_PRIVATE_KEY',
payload: value
};
2017-06-30 03:03:11 +04:00
}
export function saveWallet(value: BaseWallet): SaveWalletAction {
2017-07-03 22:21:19 -05:00
return {
type: 'WALLET_SAVE',
payload: value
};
2017-06-30 03:03:11 +04:00
}
2017-07-04 03:59:27 +04:00
export function initWallet(): InitWalletAction {
2017-07-03 22:21:19 -05:00
return {
type: 'WALLET_INIT'
};
2017-07-04 03:59:27 +04:00
}