mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-02-12 19:17:30 +00:00
* Add a little arrow icon. * Replaced toEther function with toUnit to reduce the number of conversion functions wed need. Add tests for conversion functions. * First pass at a styled confirm transaction modal. * More data about data * Hook up generated transaction with modal * Fix modal position * Add from address. Restyle a bit. * Only show textareas and button if transaction has been generated. * Remove need for param. * Copy. * Use non-relative path. * Initial crack at transaction token support. * Fix flow type * Unit tests for contracts and erc20 * Convert contract class to ethereumjs-abi, caught a bug * Add decodeArgs for contracts, decodeTransfer for erc20 * Show token value in modal * Show value from transaction data in confirmation. * Show address of receiver, not token contract * Flow type * Only accept bigs * Unlog * Use ethereumjs-abis method ID function * Get transaction stuff out of state. Leave todo notes. * Intuit token from transaction to address. * Move generate transaction out of node and into libs/transaction. * timeout -> interval * Promise.reject -> throw * Get default currency from network. * Add more unit tests for decoding. Adopt the $ prefix for decoding calls. * Use signed transaction in confirmation modal.
30 lines
858 B
JavaScript
30 lines
858 B
JavaScript
// @flow
|
|
import type { State } from 'reducers';
|
|
import { BaseNode } from 'libs/nodes';
|
|
import { NODES, NETWORKS } from 'config/data';
|
|
import type { NodeConfig, NetworkConfig, NetworkContract } from 'config/data';
|
|
|
|
export function getNode(state: State): string {
|
|
return state.config.nodeSelection;
|
|
}
|
|
|
|
export function getNodeConfig(state: State): NodeConfig {
|
|
return NODES[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;
|
|
}
|