Add New Networks w/ Refactor (MUSIC, ETSC, EGEM, CLO) (#1862)

* Add EGEM, ETSC, and MUSIC networks. Remove unused gasEstimate property.

* Add CLO
This commit is contained in:
William O'Beirne 2018-05-30 19:57:12 -04:00 committed by Daniel Ternyak
parent 724f1161ea
commit c29d13eac8
5 changed files with 183 additions and 34 deletions

View File

@ -53,6 +53,26 @@ export const ELLA_DEFAULT: DPath = {
value: "m/44'/163'/0'/0"
};
export const MUSIC_DEFAULT: DPath = {
label: 'Default (MUSIC)',
value: "m/44'/60'/0'/0"
};
export const ETSC_DEFAULT: DPath = {
label: 'Default (ETSC)',
value: "m/44'/1128'/0'/0"
};
export const EGEM_DEFAULT: DPath = {
label: 'Default (EGEM)',
value: "m/44'/1987'/0'/0"
};
export const CLO_DEFAULT: DPath = {
label: 'Default (CLO)',
value: "m/44'/820'/0'/0"
};
export const ETH_SINGULAR: DPath = {
label: 'SingularDTV',
value: "m/0'/0'/0'"
@ -69,7 +89,11 @@ export const DPaths: DPath[] = [
UBQ_DEFAULT,
POA_DEFAULT,
TOMO_DEFAULT,
ELLA_DEFAULT
ELLA_DEFAULT,
MUSIC_DEFAULT,
ETSC_DEFAULT,
EGEM_DEFAULT,
CLO_DEFAULT
];
// PATHS TO BE INCLUDED REGARDLESS OF WALLET FORMAT

View File

@ -11,29 +11,25 @@ export const NODE_CONFIGS: { [key in StaticNetworkIds]: RawNodeConfig[] } = {
name: makeNodeName('ETH', 'mycrypto'),
type: 'rpc',
service: 'MyCrypto',
url: 'https://api.mycryptoapi.com/eth',
estimateGas: true
url: 'https://api.mycryptoapi.com/eth'
},
{
name: makeNodeName('ETH', 'ethscan'),
type: 'etherscan',
service: 'Etherscan',
url: 'https://api.etherscan.io/api',
estimateGas: false
url: 'https://api.etherscan.io/api'
},
{
name: makeNodeName('ETH', 'infura'),
type: 'infura',
service: 'Infura',
url: 'https://mainnet.infura.io/mycrypto',
estimateGas: false
url: 'https://mainnet.infura.io/mycrypto'
},
{
name: makeNodeName('ETH', 'blockscale'),
type: 'rpc',
service: 'Blockscale',
url: 'https://api.dev.blockscale.net/dev/parity',
estimateGas: true
url: 'https://api.dev.blockscale.net/dev/parity'
}
],
@ -42,8 +38,7 @@ export const NODE_CONFIGS: { [key in StaticNetworkIds]: RawNodeConfig[] } = {
name: makeNodeName('Ropsten', 'infura'),
type: 'infura',
service: 'Infura',
url: 'https://ropsten.infura.io/mycrypto',
estimateGas: false
url: 'https://ropsten.infura.io/mycrypto'
}
],
@ -52,8 +47,7 @@ export const NODE_CONFIGS: { [key in StaticNetworkIds]: RawNodeConfig[] } = {
name: makeNodeName('Kovan', 'ethscan'),
type: 'etherscan',
service: 'Etherscan',
url: 'https://kovan.etherscan.io/api',
estimateGas: false
url: 'https://kovan.etherscan.io/api'
}
],
@ -62,15 +56,13 @@ export const NODE_CONFIGS: { [key in StaticNetworkIds]: RawNodeConfig[] } = {
name: makeNodeName('Rinkeby', 'infura'),
type: 'infura',
service: 'Infura',
url: 'https://rinkeby.infura.io/mycrypto',
estimateGas: false
url: 'https://rinkeby.infura.io/mycrypto'
},
{
name: makeNodeName('Rinkeby', 'ethscan'),
type: 'etherscan',
service: 'Etherscan',
url: 'https://rinkeby.etherscan.io/api',
estimateGas: false
url: 'https://rinkeby.etherscan.io/api'
}
],
@ -79,15 +71,13 @@ export const NODE_CONFIGS: { [key in StaticNetworkIds]: RawNodeConfig[] } = {
name: makeNodeName('ETC', 'epool'),
type: 'rpc',
service: 'Epool.io',
url: 'https://mew.epool.io',
estimateGas: false
url: 'https://mew.epool.io'
},
{
name: makeNodeName('ETC', 'commonwealth'),
type: 'rpc',
service: 'Ethereum Commonwealth',
url: 'https://etc-geth.0xinfra.com/',
estimateGas: false
url: 'https://etc-geth.0xinfra.com/'
}
],
@ -96,8 +86,7 @@ export const NODE_CONFIGS: { [key in StaticNetworkIds]: RawNodeConfig[] } = {
name: makeNodeName('UBQ', 'ubiqscan'),
type: 'rpc',
service: 'ubiqscan.io',
url: 'https://pyrus2.ubiqscan.io',
estimateGas: true
url: 'https://pyrus2.ubiqscan.io'
}
],
@ -106,8 +95,7 @@ export const NODE_CONFIGS: { [key in StaticNetworkIds]: RawNodeConfig[] } = {
name: makeNodeName('EXP', 'tech'),
type: 'rpc',
service: 'expanse.tech',
url: 'https://node.expanse.tech/',
estimateGas: true
url: 'https://node.expanse.tech/'
}
],
POA: [
@ -115,8 +103,7 @@ export const NODE_CONFIGS: { [key in StaticNetworkIds]: RawNodeConfig[] } = {
name: makeNodeName('POA', 'core'),
type: 'rpc',
service: 'poa.network',
url: 'https://core.poa.network',
estimateGas: true
url: 'https://core.poa.network'
}
],
@ -125,8 +112,7 @@ export const NODE_CONFIGS: { [key in StaticNetworkIds]: RawNodeConfig[] } = {
name: makeNodeName('TOMO', 'tomocoin'),
type: 'rpc',
service: 'tomocoin.io',
url: 'https://core.tomocoin.io',
estimateGas: true
url: 'https://core.tomocoin.io'
}
],
@ -135,8 +121,43 @@ export const NODE_CONFIGS: { [key in StaticNetworkIds]: RawNodeConfig[] } = {
name: makeNodeName('ELLA', 'ellaism'),
type: 'rpc',
service: 'ellaism.org',
url: 'https://jsonrpc.ellaism.org',
estimateGas: true
url: 'https://jsonrpc.ellaism.org'
}
],
MUSIC: [
{
name: makeNodeName('MUSIC', 'music'),
type: 'rpc',
service: 'musicoin.tw',
url: 'https://mewapi.musicoin.tw'
}
],
ETSC: [
{
name: makeNodeName('ETSC', 'etsc'),
type: 'rpc',
service: 'ethereumsocial.kr',
url: 'https://node.ethereumsocial.kr'
}
],
EGEM: [
{
name: makeNodeName('EGEM', 'egem'),
type: 'rpc',
service: 'egem.io',
url: 'https://jsonrpc.egem.io/custom'
}
],
CLO: [
{
name: makeNodeName('CLO', 'clo'),
type: 'rpc',
service: '0xinfra.com',
url: 'https://clo-geth.0xinfra.com/'
}
]
};

View File

@ -16,7 +16,11 @@ import {
EXP_DEFAULT,
POA_DEFAULT,
TOMO_DEFAULT,
UBQ_DEFAULT
UBQ_DEFAULT,
MUSIC_DEFAULT,
ETSC_DEFAULT,
EGEM_DEFAULT,
CLO_DEFAULT
} from 'config/dpaths';
import { ConfigAction } from 'actions/config';
import { makeExplorer } from 'utils/helpers';
@ -263,6 +267,103 @@ export const INITIAL_STATE: State = {
max: 60,
initial: 20
}
},
MUSIC: {
id: 'MUSIC',
name: 'Musicoin',
unit: 'MUSIC',
chainId: 7762959,
isCustom: false,
color: '#ffbb00',
blockExplorer: makeExplorer({
name: 'Musicoin Explorer',
origin: 'https://explorer.musicoin.org',
addressPath: 'account'
}),
tokens: [],
contracts: [],
dPathFormats: {
[SecureWalletName.TREZOR]: MUSIC_DEFAULT,
[InsecureWalletName.MNEMONIC_PHRASE]: MUSIC_DEFAULT
},
gasPriceSettings: {
min: 1,
max: 60,
initial: 20
}
},
ETSC: {
id: 'ETSC',
name: 'Ethereum Social',
unit: 'ETSC',
chainId: 28,
isCustom: false,
color: '#4295d1',
blockExplorer: makeExplorer({
name: 'Ethereum Social Explorer',
origin: 'https://explorer.ethereumsocial.kr'
}),
tokens: [],
contracts: [],
dPathFormats: {
[SecureWalletName.TREZOR]: ETSC_DEFAULT,
[InsecureWalletName.MNEMONIC_PHRASE]: ETSC_DEFAULT
},
gasPriceSettings: {
min: 1,
max: 60,
initial: 20
}
},
EGEM: {
id: 'EGEM',
name: 'EtherGem',
unit: 'EGT',
chainId: 1987,
isCustom: false,
color: '#D0F7FF',
blockExplorer: makeExplorer({
name: 'EtherGem Explorer',
origin: 'https://explorer.egem.io'
}),
tokens: [],
contracts: [],
dPathFormats: {
[SecureWalletName.TREZOR]: EGEM_DEFAULT,
[InsecureWalletName.MNEMONIC_PHRASE]: EGEM_DEFAULT
},
gasPriceSettings: {
min: 1,
max: 60,
initial: 20
}
},
CLO: {
id: 'CLO',
name: 'Callisto',
unit: 'CLO',
chainId: 820,
isCustom: false,
color: '#00b04a',
blockExplorer: makeExplorer({
name: 'Callisto Explorer',
origin: 'https://explorer.callisto.network'
}),
tokens: [],
contracts: [],
dPathFormats: {
[SecureWalletName.TREZOR]: CLO_DEFAULT,
[InsecureWalletName.MNEMONIC_PHRASE]: CLO_DEFAULT
},
gasPriceSettings: {
min: 1,
max: 60,
initial: 20
}
}
};

View File

@ -10,7 +10,11 @@ type StaticNetworkIds =
| 'EXP'
| 'POA'
| 'TOMO'
| 'ELLA';
| 'ELLA'
| 'MUSIC'
| 'ETSC'
| 'EGEM'
| 'CLO';
export interface BlockExplorerConfig {
name: string;

View File

@ -29,7 +29,6 @@ interface RawNodeConfig {
type: 'rpc' | 'etherscan' | 'infura' | 'web3' | 'myccustom';
service: string;
url: string;
estimateGas: boolean;
}
type StaticNodeId = string;