mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-12 12:04:21 +00:00
9b2156ed4f
* 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.
26 lines
741 B
JavaScript
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;
|
|
}
|