2018-04-06 20:52:48 +00:00
|
|
|
import { INode } from 'libs/nodes';
|
2018-02-12 20:43:07 +00:00
|
|
|
import { StaticNetworkIds } from './network';
|
|
|
|
import { StaticNodesState, CustomNodesState } from 'reducers/config/nodes';
|
|
|
|
|
|
|
|
interface CustomNodeConfig {
|
|
|
|
id: string;
|
|
|
|
isCustom: true;
|
|
|
|
name: string;
|
2018-04-06 20:52:48 +00:00
|
|
|
lib: INode;
|
2018-02-12 20:43:07 +00:00
|
|
|
service: 'your custom node';
|
|
|
|
url: string;
|
|
|
|
network: string;
|
|
|
|
auth?: {
|
|
|
|
username: string;
|
|
|
|
password: string;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
interface StaticNodeConfig {
|
|
|
|
isCustom: false;
|
|
|
|
network: StaticNetworkIds;
|
2018-04-06 20:52:48 +00:00
|
|
|
lib: INode;
|
2018-02-12 20:43:07 +00:00
|
|
|
service: string;
|
|
|
|
estimateGas?: boolean;
|
|
|
|
hidden?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare enum StaticNodeId {
|
2018-04-06 20:52:48 +00:00
|
|
|
ETH_AUTO = 'eth_auto',
|
2018-02-12 20:43:07 +00:00
|
|
|
ETH_MYCRYPTO = 'eth_mycrypto',
|
|
|
|
ETH_ETHSCAN = 'eth_ethscan',
|
|
|
|
ETH_INFURA = 'eth_infura',
|
2018-02-24 17:56:18 +00:00
|
|
|
ETH_BLOCKSCALE = 'eth_blockscale',
|
2018-04-06 20:52:48 +00:00
|
|
|
ROP_AUTO = 'rop_auto',
|
2018-02-12 20:43:07 +00:00
|
|
|
ROP_INFURA = 'rop_infura',
|
2018-04-06 20:52:48 +00:00
|
|
|
KOV_AUTO = 'kov_auto',
|
2018-02-12 20:43:07 +00:00
|
|
|
KOV_ETHSCAN = 'kov_ethscan',
|
2018-04-06 20:52:48 +00:00
|
|
|
RIN_AUTO = 'rin_auto',
|
2018-02-12 20:43:07 +00:00
|
|
|
RIN_ETHSCAN = 'rin_ethscan',
|
|
|
|
RIN_INFURA = 'rin_infura',
|
2018-04-06 20:52:48 +00:00
|
|
|
ETC_AUTO = 'etc_auto',
|
2018-02-12 20:43:07 +00:00
|
|
|
ETC_EPOOL = 'etc_epool',
|
2018-04-06 20:52:48 +00:00
|
|
|
UBQ_AUTO = 'ubq_auto',
|
2018-02-12 20:43:07 +00:00
|
|
|
UBQ = 'ubq',
|
2018-04-06 20:52:48 +00:00
|
|
|
EXP_AUTO = 'exp_auto',
|
2018-04-06 14:02:02 +00:00
|
|
|
EXP_TECH = 'exp_tech',
|
2018-04-06 20:52:48 +00:00
|
|
|
POA_AUTO = 'poa_auto',
|
2018-04-06 14:02:02 +00:00
|
|
|
POA = 'poa',
|
2018-04-06 20:52:48 +00:00
|
|
|
TOMO_AUTO = 'tomo_auto',
|
2018-04-06 14:02:02 +00:00
|
|
|
TOMO = 'tomo',
|
2018-04-06 20:52:48 +00:00
|
|
|
ELLA_AUTO = 'ella_auto',
|
2018-04-06 14:02:02 +00:00
|
|
|
ELLA = 'ella'
|
2018-02-12 20:43:07 +00:00
|
|
|
}
|
|
|
|
|
2018-04-06 20:52:48 +00:00
|
|
|
type StaticNodeConfigs = { [key in StaticNodeId]: StaticNodeConfig } & { web3?: StaticNodeConfig };
|
2018-02-12 20:43:07 +00:00
|
|
|
|
|
|
|
type NodeConfig = StaticNodesState[StaticNodeId] | CustomNodesState[string];
|