William O'Beirne 9b2156ed4f WIP: Generating transaction on Send tab (Pt 1) (#100)
* Generating transaction ,placing into read only textareas.

* Fix async wallet getAddress cases.

* Chain id from network

* remove leftover console log

* Check balance before generating transaction.

* Translate error msgs, check for invalid address.

* Errors for gas limit and gas price issues.
2017-08-11 22:54:10 +01:00

26 lines
741 B
JavaScript

// @flow
import type { State } from 'reducers';
import { BaseNode } from 'libs/nodes';
import { NODES, NETWORKS } from 'config/data';
import type { NetworkConfig, NetworkContract } from 'config/data';
export function getNode(state: State): string {
return state.config.nodeSelection;
}
export function getNodeLib(state: State): BaseNode {
return NODES[state.config.nodeSelection].lib;
}
export function getNetworkConfig(state: State): NetworkConfig {
return NETWORKS[NODES[state.config.nodeSelection].network];
}
export function getNetworkContracts(state: State): ?Array<NetworkContract> {
return getNetworkConfig(state).contracts;
}
export function getGasPriceGwei(state: State): number {
return state.config.gasPriceGwei;
}