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 = {
|
|
|
|
type: 'WALLET_UNLOCK_PRIVATE_KEY',
|
|
|
|
payload: PrivateKeyUnlockParams
|
|
|
|
};
|
|
|
|
|
|
|
|
export type SaveWalletAction = {
|
|
|
|
type: 'WALLET_SAVE',
|
|
|
|
payload: BaseWallet
|
|
|
|
};
|
|
|
|
|
2017-07-04 03:59:27 +04:00
|
|
|
export type InitWalletAction = {
|
|
|
|
type: 'WALLET_INIT'
|
|
|
|
};
|
|
|
|
|
|
|
|
export type WalletAction = UnlockPrivateKeyAction | SaveWalletAction | InitWalletAction;
|
2017-06-30 03:03:11 +04:00
|
|
|
|
|
|
|
export function unlockPrivateKey(value: PrivateKeyUnlockParams): UnlockPrivateKeyAction {
|
|
|
|
return {
|
|
|
|
type: 'WALLET_UNLOCK_PRIVATE_KEY',
|
|
|
|
payload: value
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function saveWallet(value: BaseWallet): SaveWalletAction {
|
|
|
|
return {
|
|
|
|
type: 'WALLET_SAVE',
|
|
|
|
payload: value
|
|
|
|
};
|
|
|
|
}
|
2017-07-04 03:59:27 +04:00
|
|
|
|
|
|
|
export function initWallet(): InitWalletAction {
|
|
|
|
return {
|
|
|
|
type: 'WALLET_INIT'
|
|
|
|
};
|
|
|
|
}
|