Skip to content

Commit

Permalink
Add energy web networks (#3172)
Browse files Browse the repository at this point in the history
  • Loading branch information
manihagh authored May 4, 2020
1 parent 755b7bd commit 8d75217
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 3 deletions.
14 changes: 13 additions & 1 deletion common/config/dpaths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,16 @@ export const ERE_DEFAULT: DPath = {
value: "m/44'/466'/0'/0"
};

export const VOLTA_DEFAULT: DPath = {
label: 'Default (VOLTA)',
value: "m/44'/73799'/0'/0"
};

export const EWC_DEFAULT: DPath = {
label: 'Default (EWC)',
value: "m/44'/246'/0'/0"
};

export const DPaths: DPath[] = [
ETH_DEFAULT,
ETH_TREZOR,
Expand Down Expand Up @@ -218,7 +228,9 @@ export const DPaths: DPath[] = [
ASK_DEFAULT,
ASK_TREZOR,
AUX_DEFAULT,
ERE_DEFAULT
ERE_DEFAULT,
VOLTA_DEFAULT,
EWC_DEFAULT
];

// PATHS TO BE INCLUDED REGARDLESS OF WALLET FORMAT
Expand Down
58 changes: 57 additions & 1 deletion common/features/config/networks/static/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ import {
UBQ_DEFAULT,
WEB_DEFAULT,
AUX_DEFAULT,
ERE_DEFAULT
ERE_DEFAULT,
VOLTA_DEFAULT,
EWC_DEFAULT
} from 'config/dpaths';
import { makeExplorer } from 'utils/helpers';
import * as types from './types';
Expand Down Expand Up @@ -921,6 +923,60 @@ export const STATIC_NETWORKS_INITIAL_STATE: types.ConfigStaticNetworksState = {
max: 60,
initial: 1
}
},
VOLTA: {
id: 'VOLTA',
name: 'Volta',
unit: 'VT',
chainId: 73799,
isCustom: false,
color: '#6d2eae',
isTestnet: false,
blockExplorer: makeExplorer({
name: 'Enenrgy Web VOLTA Explorer',
origin: 'https://volta-explorer.energyweb.org',
addressPath: 'address',
blockPath: 'blocks'
}),
tokens: [],
contracts: [],
dPathFormats: {
[SecureWalletName.TREZOR]: VOLTA_DEFAULT,
[SecureWalletName.LEDGER_NANO_S]: VOLTA_DEFAULT,
[InsecureWalletName.MNEMONIC_PHRASE]: VOLTA_DEFAULT
},
gasPriceSettings: {
min: 1,
max: 10,
initial: 1
},
shouldEstimateGasPrice: false
},
EnergyWebChain: {
id: 'EnergyWebChain',
name: 'EWC',
unit: 'EWT',
chainId: 246,
isCustom: false,
color: '#6d2eae',
blockExplorer: makeExplorer({
name: 'Enenrgy Web Chain Explorer',
origin: 'https://explorer.energyweb.org',
addressPath: 'address',
blockPath: 'blocks'
}),
tokens: [],
contracts: [],
dPathFormats: {
[SecureWalletName.TREZOR]: EWC_DEFAULT,
[SecureWalletName.LEDGER_NANO_S]: EWC_DEFAULT,
[InsecureWalletName.MNEMONIC_PHRASE]: EWC_DEFAULT
},
gasPriceSettings: {
min: 0.01,
max: 10,
initial: 0.01
}
}
};

Expand Down
18 changes: 18 additions & 0 deletions common/libs/nodes/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,24 @@ export const NODE_CONFIGS: { [key in StaticNetworkIds]: RawNodeConfig[] } = {
service: 'ethercore.io',
url: 'https://rpc.ethercore.io'
}
],

VOLTA: [
{
name: makeNodeName('VOLTA', 'volta-rpc.energyweb.org'),
type: 'rpc',
service: 'energyweb.org',
url: 'https://volta-rpc.energyweb.org/'
}
],

EnergyWebChain: [
{
name: makeNodeName('EnergyWebChain', 'rpc.energyweb.org'),
type: 'rpc',
service: 'energyweb.org',
url: 'https://rpc.energyweb.org/'
}
]
};

Expand Down
4 changes: 3 additions & 1 deletion shared/types/network.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ type StaticNetworkIds =
| 'WEB'
| 'AUX'
| 'ERE'
| 'ASK';
| 'ASK'
| 'VOLTA'
| 'EnergyWebChain';

export interface BlockExplorerConfig {
name: string;
Expand Down

0 comments on commit 8d75217

Please sign in to comment.