From 16b9d2042fac3d89dcf5935bdfd07d0b296fcb7d Mon Sep 17 00:00:00 2001 From: aerth Date: Mon, 20 Aug 2018 17:25:15 -0700 Subject: [PATCH] add network: aquachain --- common/config/dpaths.ts | 8 +++++- .../config/__snapshots__/sagas.spec.ts.snap | 2 +- .../config/networks/static/reducer.ts | 27 ++++++++++++++++++- common/libs/nodes/configs.ts | 15 +++++++++++ shared/types/network.d.ts | 3 ++- 5 files changed, 51 insertions(+), 4 deletions(-) diff --git a/common/config/dpaths.ts b/common/config/dpaths.ts index 544b0c4a..bc9c7e12 100644 --- a/common/config/dpaths.ts +++ b/common/config/dpaths.ts @@ -113,6 +113,11 @@ export const ESN_DEFAULT: DPath = { value: "m/44'/31102'/0'/0" }; +export const AQUA_DEFAULT: DPath = { + label: 'Default (AQUA)', + value: "m/44'/60'/0'/0" +}; + export const DPaths: DPath[] = [ ETH_DEFAULT, ETH_TREZOR, @@ -135,7 +140,8 @@ export const DPaths: DPath[] = [ RSK_TESTNET, GO_DEFAULT, EOSC_DEFAULT, - ESN_DEFAULT + ESN_DEFAULT, + AQUA_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 5c78d960..310bb58e 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 [ - "ESN", + "AQUA", ], "selector": [Function], }, diff --git a/common/features/config/networks/static/reducer.ts b/common/features/config/networks/static/reducer.ts index 9b1293d8..46f21e43 100644 --- a/common/features/config/networks/static/reducer.ts +++ b/common/features/config/networks/static/reducer.ts @@ -27,7 +27,8 @@ import { RSK_TESTNET, GO_DEFAULT, EOSC_DEFAULT, - ESN_DEFAULT + ESN_DEFAULT, + AQUA_DEFAULT } from 'config/dpaths'; import { makeExplorer } from 'utils/helpers'; import { StaticNetworksState } from './types'; @@ -541,6 +542,30 @@ export const STATIC_NETWORKS_INITIAL_STATE: StaticNetworksState = { max: 60, initial: 20 } + }, + AQUA: { + id: 'AQUA', + name: 'Aquachain', + unit: 'AQUA', + chainId: 61717561, + isCustom: false, + color: '#00ffff', + blockExplorer: makeExplorer({ + name: 'AQUA Explorer', + origin: 'https://aquachain.github.io/explorer/#' + }), + tokens: [], + contracts: [], + dPathFormats: { + [SecureWalletName.TREZOR]: AQUA_DEFAULT, + [SecureWalletName.LEDGER_NANO_S]: AQUA_DEFAULT, + [InsecureWalletName.MNEMONIC_PHRASE]: AQUA_DEFAULT + }, + gasPriceSettings: { + min: 0.1, + max: 10, + initial: 0.1 + } } }; diff --git a/common/libs/nodes/configs.ts b/common/libs/nodes/configs.ts index 534efc54..b1a0f205 100644 --- a/common/libs/nodes/configs.ts +++ b/common/libs/nodes/configs.ts @@ -226,6 +226,21 @@ export const NODE_CONFIGS: { [key in StaticNetworkIds]: RawNodeConfig[] } = { service: 'ethersocial.org', url: 'https://api.esn.gonspool.com' } + ], + + AQUA: [ + { + name: makeNodeName('AQUA', 'aquachain'), + type: 'rpc', + service: 'aquacha.in', + url: 'https://tx.aquacha.in/api' + }, + { + name: makeNodeName('AQUA', 'uncan.onical'), + type: 'rpc', + service: 'uncan.onical.org', + url: 'https://c.onical.org' + } ] }; diff --git a/shared/types/network.d.ts b/shared/types/network.d.ts index 5102cc54..ec43ede6 100644 --- a/shared/types/network.d.ts +++ b/shared/types/network.d.ts @@ -20,7 +20,8 @@ type StaticNetworkIds = | 'GO' | 'GO_TESTNET' | 'EOSC' - | 'ESN'; + | 'ESN' + | 'AQUA'; export interface BlockExplorerConfig { name: string;