mirror of https://github.com/trezor/trezor-wallet
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.3 KiB
57 lines
1.3 KiB
7 years ago
|
/* @flow */
|
||
|
|
||
6 years ago
|
import * as ACCOUNT from 'actions/constants/account';
|
||
6 years ago
|
import type { Action, TrezorDevice } from 'flowtype';
|
||
6 years ago
|
import type { State } from 'reducers/AccountsReducer';
|
||
7 years ago
|
|
||
6 years ago
|
export type AccountAction =
|
||
|
AccountFromStorageAction
|
||
|
| AccountCreateAction
|
||
|
| AccountSetBalanceAction
|
||
|
| AccountSetNonceAction;
|
||
7 years ago
|
|
||
6 years ago
|
export type AccountFromStorageAction = {
|
||
|
type: typeof ACCOUNT.FROM_STORAGE,
|
||
7 years ago
|
payload: State
|
||
|
}
|
||
|
|
||
6 years ago
|
export type AccountCreateAction = {
|
||
|
type: typeof ACCOUNT.CREATE,
|
||
7 years ago
|
device: TrezorDevice,
|
||
|
network: string,
|
||
|
index: number,
|
||
|
path: Array<number>,
|
||
6 years ago
|
address: string
|
||
7 years ago
|
}
|
||
|
|
||
6 years ago
|
export type AccountSetBalanceAction = {
|
||
|
type: typeof ACCOUNT.SET_BALANCE,
|
||
7 years ago
|
address: string,
|
||
|
network: string,
|
||
6 years ago
|
deviceState: string,
|
||
7 years ago
|
balance: string
|
||
|
}
|
||
|
|
||
6 years ago
|
export type AccountSetNonceAction = {
|
||
|
type: typeof ACCOUNT.SET_NONCE,
|
||
7 years ago
|
address: string,
|
||
|
network: string,
|
||
6 years ago
|
deviceState: string,
|
||
7 years ago
|
nonce: number
|
||
|
}
|
||
|
|
||
6 years ago
|
export const setBalance = (address: string, network: string, deviceState: string, balance: string): Action => ({
|
||
|
type: ACCOUNT.SET_BALANCE,
|
||
|
address,
|
||
|
network,
|
||
|
deviceState,
|
||
|
balance,
|
||
|
});
|
||
|
|
||
|
export const setNonce = (address: string, network: string, deviceState: string, nonce: number): Action => ({
|
||
|
type: ACCOUNT.SET_NONCE,
|
||
|
address,
|
||
|
network,
|
||
|
deviceState,
|
||
|
nonce,
|
||
|
});
|