2017-09-25 02:06:28 +00:00
|
|
|
import {
|
|
|
|
NetworkConfig,
|
|
|
|
NetworkContract,
|
|
|
|
NETWORKS,
|
|
|
|
NodeConfig,
|
2017-11-18 20:33:53 +00:00
|
|
|
CustomNodeConfig
|
2017-09-25 02:06:28 +00:00
|
|
|
} from 'config/data';
|
|
|
|
import { INode } from 'libs/nodes/INode';
|
|
|
|
import { AppState } from 'reducers';
|
|
|
|
|
|
|
|
export function getNode(state: AppState): string {
|
|
|
|
return state.config.nodeSelection;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function getNodeConfig(state: AppState): NodeConfig {
|
2017-11-18 20:33:53 +00:00
|
|
|
return state.config.node;
|
2017-09-25 02:06:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export function getNodeLib(state: AppState): INode {
|
2017-11-18 20:33:53 +00:00
|
|
|
return getNodeConfig(state).lib;
|
2017-09-25 02:06:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export function getNetworkConfig(state: AppState): NetworkConfig {
|
2017-11-18 20:33:53 +00:00
|
|
|
return NETWORKS[getNodeConfig(state).network];
|
2017-09-25 02:06:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export function getNetworkContracts(state: AppState): NetworkContract[] | null {
|
|
|
|
return getNetworkConfig(state).contracts;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function getGasPriceGwei(state: AppState): number {
|
|
|
|
return state.config.gasPriceGwei;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function getLanguageSelection(state: AppState): string {
|
|
|
|
return state.config.languageSelection;
|
|
|
|
}
|
2017-11-18 20:33:53 +00:00
|
|
|
|
|
|
|
export function getCustomNodeConfigs(state: AppState): CustomNodeConfig[] {
|
|
|
|
return state.config.customNodes;
|
|
|
|
}
|
2017-11-29 00:17:26 +00:00
|
|
|
|
|
|
|
export function getOffline(state: AppState): boolean {
|
|
|
|
return state.config.offline;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function getForceOffline(state: AppState): boolean {
|
|
|
|
return state.config.forceOffline;
|
|
|
|
}
|