From ef3425340c0b1be2518f4bcf35570fbd17be583a Mon Sep 17 00:00:00 2001 From: Michael Ira Krufky Date: Mon, 15 Oct 2018 08:25:14 -0400 Subject: [PATCH] Add MIX Blockchain --- common/config/dpaths.ts | 8 +++++- .../config/__snapshots__/sagas.spec.ts.snap | 2 +- .../config/networks/static/reducer.ts | 26 ++++++++++++++++++- common/libs/nodes/configs.ts | 9 +++++++ shared/types/network.d.ts | 3 ++- 5 files changed, 44 insertions(+), 4 deletions(-) diff --git a/common/config/dpaths.ts b/common/config/dpaths.ts index 22b05217789..5bcd2592fd9 100644 --- a/common/config/dpaths.ts +++ b/common/config/dpaths.ts @@ -138,6 +138,11 @@ export const ETHO_DEFAULT: DPath = { value: "m/44'/1313114'/0'/0" }; +export const MIX_DEFAULT: DPath = { + label: 'Default (MIX)', + value: "m/44'/76'/0'/0" +}; + export const DPaths: DPath[] = [ ETH_DEFAULT, ETH_TREZOR, @@ -165,7 +170,8 @@ export const DPaths: DPath[] = [ AKA_DEFAULT, PIRL_DEFAULT, ATH_DEFAULT, - ETHO_DEFAULT + ETHO_DEFAULT, + MIX_DEFAULT ]; // PATHS TO BE INCLUDED REGARDLESS OF WALLET FORMAT diff --git a/common/features/config/__snapshots__/sagas.spec.ts.snap b/common/features/config/__snapshots__/sagas.spec.ts.snap index fec335adcca..66a6598c624 100644 --- a/common/features/config/__snapshots__/sagas.spec.ts.snap +++ b/common/features/config/__snapshots__/sagas.spec.ts.snap @@ -5,7 +5,7 @@ Object { "@@redux-saga/IO": true, "SELECT": Object { "args": Array [ - "ETHO", + "MIX", ], "selector": [Function], }, diff --git a/common/features/config/networks/static/reducer.ts b/common/features/config/networks/static/reducer.ts index 25edef46075..f38aa0f0026 100644 --- a/common/features/config/networks/static/reducer.ts +++ b/common/features/config/networks/static/reducer.ts @@ -32,7 +32,8 @@ import { AKA_DEFAULT, PIRL_DEFAULT, ATH_DEFAULT, - ETHO_DEFAULT + ETHO_DEFAULT, + MIX_DEFAULT } from 'config/dpaths'; import { makeExplorer } from 'utils/helpers'; import { TAB } from 'components/Header/components/constants'; @@ -674,6 +675,29 @@ export const STATIC_NETWORKS_INITIAL_STATE: types.ConfigStaticNetworksState = { max: 60, initial: 20 } + }, + MIX: { + id: 'MIX', + name: 'Mix', + unit: 'MIX', + chainId: 76, + isCustom: false, + color: '#e59b2b', + blockExplorer: makeExplorer({ + name: 'MIX Blockchain Explorer', + origin: 'https://blocks.mix-blockchain.org' + }), + tokens: [], + contracts: [], + dPathFormats: { + [SecureWalletName.LEDGER_NANO_S]: MIX_DEFAULT, + [InsecureWalletName.MNEMONIC_PHRASE]: MIX_DEFAULT + }, + gasPriceSettings: { + min: 1, + max: 60, + initial: 20 + } } }; diff --git a/common/libs/nodes/configs.ts b/common/libs/nodes/configs.ts index 234cf627a58..ed3674abbce 100644 --- a/common/libs/nodes/configs.ts +++ b/common/libs/nodes/configs.ts @@ -283,6 +283,15 @@ export const NODE_CONFIGS: { [key in StaticNetworkIds]: RawNodeConfig[] } = { service: 'ether1.org', url: 'https://rpc.ether1.org' } + ], + + MIX: [ + { + name: makeNodeName('MIX', 'mix-blockchain.org'), + type: 'rpc', + service: 'rpc2.mix-blockchain.org', + url: 'https://rpc2.mix-blockchain.org:8647' + } ] }; diff --git a/shared/types/network.d.ts b/shared/types/network.d.ts index 04b7c2841f0..d3436bbce21 100644 --- a/shared/types/network.d.ts +++ b/shared/types/network.d.ts @@ -25,7 +25,8 @@ type StaticNetworkIds = | 'AKA' | 'PIRL' | 'ATH' - | 'ETHO'; + | 'ETHO' + | 'MIX'; export interface BlockExplorerConfig { name: string;