2017-12-13 11:01:37 +00:00
|
|
|
/* @flow */
|
|
|
|
import { combineReducers } from 'redux';
|
2018-12-18 13:33:01 +00:00
|
|
|
import { connectRouter } from 'connected-react-router';
|
2019-01-02 15:42:07 +00:00
|
|
|
import type { State } from 'connected-react-router';
|
2019-04-10 15:50:07 +00:00
|
|
|
import type { Action } from 'flowtype';
|
2017-12-13 11:01:37 +00:00
|
|
|
|
2018-08-14 14:06:34 +00:00
|
|
|
import log from 'reducers/LogReducer';
|
|
|
|
import localStorage from 'reducers/LocalStorageReducer';
|
|
|
|
import connect from 'reducers/TrezorConnectReducer';
|
|
|
|
import notifications from 'reducers/NotificationReducer';
|
|
|
|
import modal from 'reducers/ModalReducer';
|
|
|
|
import web3 from 'reducers/Web3Reducer';
|
|
|
|
import accounts from 'reducers/AccountsReducer';
|
2019-04-10 17:54:07 +00:00
|
|
|
import importAccount from 'reducers/ImportAccountReducer';
|
2018-08-14 14:06:34 +00:00
|
|
|
import selectedAccount from 'reducers/SelectedAccountReducer';
|
2018-11-29 20:04:29 +00:00
|
|
|
import sendFormEthereum from 'reducers/SendFormEthereumReducer';
|
|
|
|
import sendFormRipple from 'reducers/SendFormRippleReducer';
|
2018-08-14 14:06:34 +00:00
|
|
|
import receive from 'reducers/ReceiveReducer';
|
|
|
|
import summary from 'reducers/SummaryReducer';
|
|
|
|
import tokens from 'reducers/TokensReducer';
|
|
|
|
import discovery from 'reducers/DiscoveryReducer';
|
|
|
|
import pending from 'reducers/PendingTxReducer';
|
|
|
|
import fiat from 'reducers/FiatRateReducer';
|
|
|
|
import wallet from 'reducers/WalletReducer';
|
|
|
|
import devices from 'reducers/DevicesReducer';
|
2018-09-12 09:49:49 +00:00
|
|
|
import blockchain from 'reducers/BlockchainReducer';
|
2018-12-04 16:48:05 +00:00
|
|
|
import signVerify from 'reducers/SignVerifyReducer';
|
2017-12-13 11:01:37 +00:00
|
|
|
|
2019-01-02 15:42:07 +00:00
|
|
|
const reducers = {
|
2018-03-08 16:10:53 +00:00
|
|
|
log,
|
2018-02-20 09:30:36 +00:00
|
|
|
localStorage,
|
2017-12-13 11:01:37 +00:00
|
|
|
connect,
|
2018-02-20 09:30:36 +00:00
|
|
|
notifications,
|
2017-12-13 11:01:37 +00:00
|
|
|
modal,
|
|
|
|
web3,
|
2019-04-10 17:54:07 +00:00
|
|
|
importAccount,
|
2018-02-20 09:30:36 +00:00
|
|
|
accounts,
|
2018-05-18 17:26:46 +00:00
|
|
|
selectedAccount,
|
2018-11-29 20:04:29 +00:00
|
|
|
sendFormEthereum,
|
|
|
|
sendFormRipple,
|
2018-02-20 09:30:36 +00:00
|
|
|
receive,
|
|
|
|
summary,
|
|
|
|
tokens,
|
2018-03-08 16:10:53 +00:00
|
|
|
discovery,
|
|
|
|
pending,
|
2018-04-11 10:06:46 +00:00
|
|
|
fiat,
|
2018-05-23 08:52:25 +00:00
|
|
|
wallet,
|
2018-07-30 10:52:13 +00:00
|
|
|
devices,
|
2018-09-23 06:36:01 +00:00
|
|
|
blockchain,
|
2018-12-04 16:48:05 +00:00
|
|
|
signVerify,
|
2019-03-04 12:33:02 +00:00
|
|
|
router: () =>
|
|
|
|
({
|
|
|
|
location: {
|
|
|
|
pathname: '',
|
|
|
|
hash: '',
|
|
|
|
search: '',
|
|
|
|
state: {},
|
|
|
|
},
|
|
|
|
}: State),
|
2019-01-02 15:42:07 +00:00
|
|
|
};
|
2018-04-16 21:19:50 +00:00
|
|
|
|
|
|
|
export type Reducers = typeof reducers;
|
|
|
|
type $ExtractFunctionReturn = <V>(v: (...args: any) => V) => V;
|
|
|
|
export type ReducersState = $ObjMap<Reducers, $ExtractFunctionReturn>;
|
2019-01-02 15:42:07 +00:00
|
|
|
|
2019-04-10 15:50:07 +00:00
|
|
|
export default (history: Object) =>
|
|
|
|
combineReducers<Reducers, Action>({
|
2019-03-04 12:33:02 +00:00
|
|
|
...reducers,
|
|
|
|
router: connectRouter(history),
|
|
|
|
});
|