2017-09-24 19:06:28 -07:00
|
|
|
import {
|
|
|
|
NetworkConfig,
|
|
|
|
NetworkContract,
|
|
|
|
NETWORKS,
|
|
|
|
NodeConfig,
|
2017-11-18 13:33:53 -07:00
|
|
|
CustomNodeConfig
|
2017-09-24 19:06:28 -07: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 13:33:53 -07:00
|
|
|
return state.config.node;
|
2017-09-24 19:06:28 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
export function getNodeLib(state: AppState): INode {
|
2017-11-18 13:33:53 -07:00
|
|
|
return getNodeConfig(state).lib;
|
2017-09-24 19:06:28 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
export function getNetworkConfig(state: AppState): NetworkConfig {
|
2017-11-18 13:33:53 -07:00
|
|
|
return NETWORKS[getNodeConfig(state).network];
|
2017-09-24 19:06:28 -07: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 13:33:53 -07:00
|
|
|
|
|
|
|
export function getCustomNodeConfigs(state: AppState): CustomNodeConfig[] {
|
|
|
|
return state.config.customNodes;
|
|
|
|
}
|