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.
43 lines
1017 B
43 lines
1017 B
6 years ago
|
/* @flow */
|
||
6 years ago
|
|
||
6 years ago
|
|
||
|
import EthereumjsUtil from 'ethereumjs-util';
|
||
6 years ago
|
import * as SUMMARY from 'actions/constants/summary';
|
||
|
import * as TOKEN from 'actions/constants/token';
|
||
|
import { resolveAfter } from 'utils/promiseUtils';
|
||
|
import { initialState } from 'reducers/SummaryReducer';
|
||
6 years ago
|
|
||
6 years ago
|
import type {
|
||
|
ThunkAction, AsyncAction, Action, GetState, Dispatch,
|
||
6 years ago
|
} from 'flowtype';
|
||
6 years ago
|
import type { State } from 'reducers/SummaryReducer';
|
||
|
import type { Token } from 'reducers/TokensReducer';
|
||
6 years ago
|
|
||
|
export type SummaryAction = {
|
||
|
type: typeof SUMMARY.INIT,
|
||
|
state: State
|
||
|
} | {
|
||
|
type: typeof SUMMARY.DISPOSE,
|
||
|
} | {
|
||
|
type: typeof SUMMARY.DETAILS_TOGGLE
|
||
|
}
|
||
6 years ago
|
|
||
6 years ago
|
export const init = (): ThunkAction => (dispatch: Dispatch, getState: GetState): void => {
|
||
|
const state: State = {
|
||
|
...initialState,
|
||
|
};
|
||
6 years ago
|
|
||
6 years ago
|
dispatch({
|
||
|
type: SUMMARY.INIT,
|
||
|
state,
|
||
|
});
|
||
|
};
|
||
6 years ago
|
|
||
6 years ago
|
export const dispose = (): Action => ({
|
||
|
type: SUMMARY.DISPOSE,
|
||
|
});
|
||
6 years ago
|
|
||
6 years ago
|
export const onDetailsToggle = (): Action => ({
|
||
|
type: SUMMARY.DETAILS_TOGGLE,
|
||
|
});
|