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;
|
2018-05-29 14:51:42 +00:00
|
|
|
isAuto?: undefined;
|
2018-02-12 20:43:07 +00:00
|
|
|
name: string;
|
|
|
|
service: 'your custom node';
|
|
|
|
url: string;
|
|
|
|
network: string;
|
|
|
|
auth?: {
|
|
|
|
username: string;
|
|
|
|
password: string;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
interface StaticNodeConfig {
|
2018-05-29 14:51:42 +00:00
|
|
|
id: string;
|
2018-02-12 20:43:07 +00:00
|
|
|
isCustom: false;
|
2018-05-29 14:51:42 +00:00
|
|
|
isAuto?: boolean;
|
2018-02-12 20:43:07 +00:00
|
|
|
network: StaticNetworkIds;
|
|
|
|
service: string;
|
|
|
|
hidden?: boolean;
|
|
|
|
}
|
|
|
|
|
2018-05-29 14:51:42 +00:00
|
|
|
interface RawNodeConfig {
|
|
|
|
name: string;
|
|
|
|
type: 'rpc' | 'etherscan' | 'infura' | 'web3' | 'myccustom';
|
|
|
|
service: string;
|
|
|
|
url: string;
|
2018-02-12 20:43:07 +00:00
|
|
|
}
|
|
|
|
|
2018-05-29 14:51:42 +00:00
|
|
|
type StaticNodeId = string;
|
|
|
|
|
|
|
|
type StaticNodeConfigs = { [id: string]: StaticNodeConfig } & { web3?: StaticNodeConfig };
|
2018-02-12 20:43:07 +00:00
|
|
|
|
|
|
|
type NodeConfig = StaticNodesState[StaticNodeId] | CustomNodesState[string];
|