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.
48 lines
820 B
48 lines
820 B
/* @flow */
|
|
'use strict';
|
|
|
|
import * as ACCOUNT from '../actions/constants/account';
|
|
|
|
import type {
|
|
Action,
|
|
Account,
|
|
Coin,
|
|
Token,
|
|
PendingTx,
|
|
Discovery,
|
|
Web3Instance
|
|
} from '~/flowtype';
|
|
|
|
export type State = {
|
|
location?: string;
|
|
|
|
account: ?Account;
|
|
network: ?Coin;
|
|
tokens: Array<Token>,
|
|
pending: Array<PendingTx>,
|
|
web3: ?Web3Instance,
|
|
discovery: ?Discovery
|
|
};
|
|
|
|
export const initialState: State = {
|
|
location: '/',
|
|
account: null,
|
|
network: null,
|
|
tokens: [],
|
|
pending: [],
|
|
web3: null,
|
|
discovery: null
|
|
};
|
|
|
|
export default (state: State = initialState, action: Action): State => {
|
|
|
|
switch (action.type) {
|
|
|
|
case ACCOUNT.UPDATE_SELECTED_ACCOUNT :
|
|
return action.payload;
|
|
|
|
default:
|
|
return state;
|
|
}
|
|
|
|
} |