2017-07-04 01:25:01 +00:00
|
|
|
// @flow
|
|
|
|
import type { State } from 'reducers';
|
|
|
|
import { BaseNode } from 'libs/nodes';
|
2017-07-13 21:02:39 +00:00
|
|
|
import { NODES, NETWORKS } from 'config/data';
|
2017-08-23 06:57:18 +00:00
|
|
|
import type { NodeConfig, NetworkConfig, NetworkContract } from 'config/data';
|
2017-07-28 00:31:59 +00:00
|
|
|
|
|
|
|
export function getNode(state: State): string {
|
|
|
|
return state.config.nodeSelection;
|
|
|
|
}
|
2017-07-04 01:25:01 +00:00
|
|
|
|
2017-08-23 06:57:18 +00:00
|
|
|
export function getNodeConfig(state: State): NodeConfig {
|
|
|
|
return NODES[state.config.nodeSelection];
|
|
|
|
}
|
|
|
|
|
2017-07-04 01:25:01 +00:00
|
|
|
export function getNodeLib(state: State): BaseNode {
|
2017-07-04 03:21:19 +00:00
|
|
|
return NODES[state.config.nodeSelection].lib;
|
2017-07-04 01:25:01 +00:00
|
|
|
}
|
2017-07-13 21:02:39 +00:00
|
|
|
|
|
|
|
export function getNetworkConfig(state: State): NetworkConfig {
|
|
|
|
return NETWORKS[NODES[state.config.nodeSelection].network];
|
|
|
|
}
|
2017-07-28 00:31:59 +00:00
|
|
|
|
|
|
|
export function getNetworkContracts(state: State): ?Array<NetworkContract> {
|
|
|
|
return getNetworkConfig(state).contracts;
|
|
|
|
}
|
2017-08-11 21:54:10 +00:00
|
|
|
|
|
|
|
export function getGasPriceGwei(state: State): number {
|
|
|
|
return state.config.gasPriceGwei;
|
|
|
|
}
|
2017-08-28 18:05:38 +00:00
|
|
|
|
|
|
|
export function getLanguageSelection(state: State): string {
|
|
|
|
return state.config.languageSelection;
|
|
|
|
}
|