2018-02-12 20:43:07 +00:00
|
|
|
import { TypeKeys, NodeAction } from 'actions/config';
|
2018-04-06 20:52:48 +00:00
|
|
|
import { shepherdProvider } from 'libs/nodes';
|
|
|
|
import { StaticNodesState } from './types';
|
2018-02-12 20:43:07 +00:00
|
|
|
|
2018-04-06 20:52:48 +00:00
|
|
|
export const INITIAL_STATE: StaticNodesState = {
|
|
|
|
eth_auto: {
|
|
|
|
network: 'ETH',
|
|
|
|
isCustom: false,
|
|
|
|
lib: shepherdProvider,
|
|
|
|
service: 'AUTO',
|
|
|
|
estimateGas: true
|
|
|
|
},
|
2018-02-12 20:43:07 +00:00
|
|
|
eth_mycrypto: {
|
|
|
|
network: 'ETH',
|
|
|
|
isCustom: false,
|
2018-04-06 20:52:48 +00:00
|
|
|
lib: shepherdProvider,
|
2018-02-12 20:43:07 +00:00
|
|
|
service: 'MyCrypto',
|
|
|
|
estimateGas: true
|
|
|
|
},
|
|
|
|
eth_ethscan: {
|
|
|
|
network: 'ETH',
|
|
|
|
isCustom: false,
|
|
|
|
service: 'Etherscan.io',
|
2018-04-06 20:52:48 +00:00
|
|
|
lib: shepherdProvider,
|
2018-02-12 20:43:07 +00:00
|
|
|
estimateGas: false
|
|
|
|
},
|
2018-04-06 20:52:48 +00:00
|
|
|
|
2018-02-12 20:43:07 +00:00
|
|
|
eth_infura: {
|
|
|
|
network: 'ETH',
|
|
|
|
isCustom: false,
|
|
|
|
service: 'infura.io',
|
2018-04-06 20:52:48 +00:00
|
|
|
lib: shepherdProvider,
|
2018-02-12 20:43:07 +00:00
|
|
|
estimateGas: false
|
|
|
|
},
|
2018-02-24 17:56:18 +00:00
|
|
|
eth_blockscale: {
|
|
|
|
network: 'ETH',
|
|
|
|
isCustom: false,
|
2018-04-06 20:52:48 +00:00
|
|
|
lib: shepherdProvider,
|
2018-02-24 17:56:18 +00:00
|
|
|
service: 'Blockscale beta',
|
|
|
|
estimateGas: true
|
|
|
|
},
|
2018-04-06 20:52:48 +00:00
|
|
|
|
|
|
|
rop_auto: {
|
|
|
|
network: 'Ropsten',
|
|
|
|
isCustom: false,
|
|
|
|
service: 'AUTO',
|
|
|
|
lib: shepherdProvider,
|
|
|
|
estimateGas: false
|
|
|
|
},
|
2018-02-12 20:43:07 +00:00
|
|
|
rop_infura: {
|
|
|
|
network: 'Ropsten',
|
|
|
|
isCustom: false,
|
|
|
|
service: 'infura.io',
|
2018-04-06 20:52:48 +00:00
|
|
|
lib: shepherdProvider,
|
|
|
|
estimateGas: false
|
|
|
|
},
|
|
|
|
|
|
|
|
kov_auto: {
|
|
|
|
network: 'Kovan',
|
|
|
|
isCustom: false,
|
|
|
|
service: 'AUTO',
|
|
|
|
lib: shepherdProvider,
|
2018-02-12 20:43:07 +00:00
|
|
|
estimateGas: false
|
|
|
|
},
|
|
|
|
kov_ethscan: {
|
|
|
|
network: 'Kovan',
|
|
|
|
isCustom: false,
|
|
|
|
service: 'Etherscan.io',
|
2018-04-06 20:52:48 +00:00
|
|
|
lib: shepherdProvider,
|
|
|
|
estimateGas: false
|
|
|
|
},
|
|
|
|
|
|
|
|
rin_auto: {
|
|
|
|
network: 'Rinkeby',
|
|
|
|
isCustom: false,
|
|
|
|
service: 'AUTO',
|
|
|
|
lib: shepherdProvider,
|
2018-02-12 20:43:07 +00:00
|
|
|
estimateGas: false
|
|
|
|
},
|
|
|
|
rin_ethscan: {
|
|
|
|
network: 'Rinkeby',
|
|
|
|
isCustom: false,
|
|
|
|
service: 'Etherscan.io',
|
2018-04-06 20:52:48 +00:00
|
|
|
lib: shepherdProvider,
|
2018-02-12 20:43:07 +00:00
|
|
|
estimateGas: false
|
|
|
|
},
|
|
|
|
rin_infura: {
|
|
|
|
network: 'Rinkeby',
|
|
|
|
isCustom: false,
|
|
|
|
service: 'infura.io',
|
2018-04-06 20:52:48 +00:00
|
|
|
lib: shepherdProvider,
|
|
|
|
estimateGas: false
|
|
|
|
},
|
|
|
|
|
|
|
|
etc_auto: {
|
|
|
|
network: 'ETC',
|
|
|
|
isCustom: false,
|
|
|
|
service: 'AUTO',
|
|
|
|
lib: shepherdProvider,
|
2018-02-12 20:43:07 +00:00
|
|
|
estimateGas: false
|
|
|
|
},
|
|
|
|
etc_epool: {
|
|
|
|
network: 'ETC',
|
|
|
|
isCustom: false,
|
|
|
|
service: 'Epool.io',
|
2018-04-06 20:52:48 +00:00
|
|
|
lib: shepherdProvider,
|
2018-02-12 20:43:07 +00:00
|
|
|
estimateGas: false
|
|
|
|
},
|
2018-04-06 20:52:48 +00:00
|
|
|
|
|
|
|
ubq_auto: {
|
|
|
|
network: 'UBQ',
|
|
|
|
isCustom: false,
|
|
|
|
service: 'AUTO',
|
|
|
|
lib: shepherdProvider,
|
|
|
|
estimateGas: true
|
|
|
|
},
|
2018-02-12 20:43:07 +00:00
|
|
|
ubq: {
|
|
|
|
network: 'UBQ',
|
|
|
|
isCustom: false,
|
|
|
|
service: 'ubiqscan.io',
|
2018-04-06 20:52:48 +00:00
|
|
|
lib: shepherdProvider,
|
|
|
|
estimateGas: true
|
|
|
|
},
|
|
|
|
|
|
|
|
exp_auto: {
|
|
|
|
network: 'EXP',
|
|
|
|
isCustom: false,
|
|
|
|
service: 'AUTO',
|
|
|
|
lib: shepherdProvider,
|
2018-02-12 20:43:07 +00:00
|
|
|
estimateGas: true
|
|
|
|
},
|
|
|
|
exp_tech: {
|
|
|
|
network: 'EXP',
|
|
|
|
isCustom: false,
|
|
|
|
service: 'Expanse.tech',
|
2018-04-06 20:52:48 +00:00
|
|
|
lib: shepherdProvider,
|
|
|
|
estimateGas: true
|
|
|
|
},
|
|
|
|
poa_auto: {
|
|
|
|
network: 'POA',
|
|
|
|
isCustom: false,
|
|
|
|
service: 'AUTO',
|
|
|
|
lib: shepherdProvider,
|
2018-02-12 20:43:07 +00:00
|
|
|
estimateGas: true
|
2018-04-06 14:02:02 +00:00
|
|
|
},
|
|
|
|
poa: {
|
|
|
|
network: 'POA',
|
|
|
|
isCustom: false,
|
|
|
|
service: 'poa.network',
|
2018-04-06 20:52:48 +00:00
|
|
|
lib: shepherdProvider,
|
|
|
|
estimateGas: true
|
|
|
|
},
|
|
|
|
tomo_auto: {
|
|
|
|
network: 'TOMO',
|
|
|
|
isCustom: false,
|
|
|
|
service: 'AUTO',
|
|
|
|
lib: shepherdProvider,
|
2018-04-06 14:02:02 +00:00
|
|
|
estimateGas: true
|
|
|
|
},
|
|
|
|
tomo: {
|
|
|
|
network: 'TOMO',
|
|
|
|
isCustom: false,
|
|
|
|
service: 'tomocoin.io',
|
2018-04-06 20:52:48 +00:00
|
|
|
lib: shepherdProvider,
|
|
|
|
estimateGas: true
|
|
|
|
},
|
|
|
|
ella_auto: {
|
|
|
|
network: 'ELLA',
|
|
|
|
isCustom: false,
|
|
|
|
service: 'AUTO',
|
|
|
|
lib: shepherdProvider,
|
2018-04-06 14:02:02 +00:00
|
|
|
estimateGas: true
|
|
|
|
},
|
|
|
|
ella: {
|
|
|
|
network: 'ELLA',
|
|
|
|
isCustom: false,
|
|
|
|
service: 'ellaism.org',
|
2018-04-06 20:52:48 +00:00
|
|
|
lib: shepherdProvider,
|
2018-04-06 14:02:02 +00:00
|
|
|
estimateGas: true
|
2018-02-12 20:43:07 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-04-06 20:52:48 +00:00
|
|
|
const staticNodes = (state: StaticNodesState = INITIAL_STATE, action: NodeAction) => {
|
2018-02-12 20:43:07 +00:00
|
|
|
switch (action.type) {
|
|
|
|
case TypeKeys.CONFIG_NODE_WEB3_SET:
|
|
|
|
return { ...state, [action.payload.id]: action.payload.config };
|
|
|
|
case TypeKeys.CONFIG_NODE_WEB3_UNSET:
|
|
|
|
const stateCopy = { ...state };
|
|
|
|
Reflect.deleteProperty(stateCopy, 'web3');
|
|
|
|
return stateCopy;
|
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
};
|
2018-04-06 20:52:48 +00:00
|
|
|
|
|
|
|
export { StaticNodesState, staticNodes };
|