diff options
author | Chen Wei <wei.chen@cobinhood.com> | 2019-09-22 18:01:02 +0800 |
---|---|---|
committer | Chen Wei <wei.chen@cobinhood.com> | 2019-09-22 18:01:02 +0800 |
commit | 80dae5532d85a0d113b969389d83a5be8d31c2dd (patch) | |
tree | f7a7f399c4ef2fde1ff1964dfd2ce652e2edb5f9 /app | |
parent | b30a3f35b1518ef243c09d4ec11f8c069f15dc0d (diff) | |
download | tangerine-wallet-browser-80dae5532d85a0d113b969389d83a5be8d31c2dd.tar tangerine-wallet-browser-80dae5532d85a0d113b969389d83a5be8d31c2dd.tar.gz tangerine-wallet-browser-80dae5532d85a0d113b969389d83a5be8d31c2dd.tar.bz2 tangerine-wallet-browser-80dae5532d85a0d113b969389d83a5be8d31c2dd.tar.lz tangerine-wallet-browser-80dae5532d85a0d113b969389d83a5be8d31c2dd.tar.xz tangerine-wallet-browser-80dae5532d85a0d113b969389d83a5be8d31c2dd.tar.zst tangerine-wallet-browser-80dae5532d85a0d113b969389d83a5be8d31c2dd.zip |
add mainnet
Diffstat (limited to 'app')
-rw-r--r-- | app/_locales/en/messages.json | 3 | ||||
-rw-r--r-- | app/_locales/zh_CN/messages.json | 3 | ||||
-rw-r--r-- | app/_locales/zh_TW/messages.json | 3 | ||||
-rw-r--r-- | app/scripts/controllers/network/enums.js | 10 | ||||
-rw-r--r-- | app/scripts/controllers/network/network.js | 13 |
5 files changed, 30 insertions, 2 deletions
diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index de5c6ca1c..90de7c93f 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -1,4 +1,7 @@ { + "tangerine_mainnet": { + "message": "Tangerine Network" + }, "tangerine_testnet": { "message": "Tangerine Testnet" }, diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json index 2266f6bba..9c0a5b922 100644 --- a/app/_locales/zh_CN/messages.json +++ b/app/_locales/zh_CN/messages.json @@ -1,4 +1,7 @@ { + "tangerine_mainnet": { + "message": "Tangerine Network" + }, "tangerine_testnet": { "message": "Tangerine Testnet" }, diff --git a/app/_locales/zh_TW/messages.json b/app/_locales/zh_TW/messages.json index 7e540fcae..7ff8aaffd 100644 --- a/app/_locales/zh_TW/messages.json +++ b/app/_locales/zh_TW/messages.json @@ -1,4 +1,7 @@ { + "tangerine_mainnet": { + "message": "Tangerine Network" + }, "tangerine_testnet": { "message": "Tangerine Testnet" }, diff --git a/app/scripts/controllers/network/enums.js b/app/scripts/controllers/network/enums.js index 0ebea4509..37aad9383 100644 --- a/app/scripts/controllers/network/enums.js +++ b/app/scripts/controllers/network/enums.js @@ -6,6 +6,7 @@ const LOCALHOST = 'localhost' const GOERLI = 'goerli' const TANGERINE_TESTNET = 'tangerine_testnet' +const TANGERINE_MAINNET = 'tangerine_mainnet'; const MAINNET_CODE = 1 const ROPSTEN_CODE = 3 @@ -13,6 +14,7 @@ const RINKEYBY_CODE = 4 const KOVAN_CODE = 42 const GOERLI_CODE = 5 +const TANGERINE_MAINNET_CODE = 411 const TANGERINE_TESTNET_CODE = 374 const ROPSTEN_DISPLAY_NAME = 'Ropsten' @@ -24,6 +26,9 @@ const GOERLI_DISPLAY_NAME = 'Goerli' const TANGERINE_TESTNET_DISPLAYNAME = 'Tangerine Testnet Displayname' const TANGERINE_TESTNET_RPC = 'https://testnet-rpc.tangerine-network.io' +const TANGERINE_MAINNET_DISPLAYNAME = 'Tangerine Mainnet Displayname' +const TANGERINE_MAINNET_RPC = 'https://mainnet-rpc.tangerine-network.io' + module.exports = { ROPSTEN, RINKEBY, @@ -42,6 +47,11 @@ module.exports = { MAINNET_DISPLAY_NAME, GOERLI_DISPLAY_NAME, // Tangerine Network + TANGERINE_MAINNET, + TANGERINE_MAINNET_CODE, + TANGERINE_MAINNET_DISPLAYNAME, + TANGERINE_MAINNET_RPC, + TANGERINE_TESTNET, TANGERINE_TESTNET_CODE, TANGERINE_TESTNET_DISPLAYNAME, diff --git a/app/scripts/controllers/network/network.js b/app/scripts/controllers/network/network.js index 01a283347..89814c29b 100644 --- a/app/scripts/controllers/network/network.js +++ b/app/scripts/controllers/network/network.js @@ -23,9 +23,16 @@ const { GOERLI, TANGERINE_TESTNET, TANGERINE_TESTNET_RPC, + TANGERINE_MAINNET, + TANGERINE_MAINNET_RPC, } = require('./enums') const INFURA_PROVIDER_TYPES = [ROPSTEN, RINKEBY, KOVAN, MAINNET, GOERLI] -const TANGERINE_PROVIDER_TYPES = [TANGERINE_TESTNET] +const TANGERINE_PROVIDER_TYPES = [TANGERINE_TESTNET, TANGERINE_MAINNET] + +const TANGERINE_RPC_MAPPING = { + [TANGERINE_TESTNET]: TANGERINE_TESTNET_RPC, + [TANGERINE_MAINNET]: TANGERINE_MAINNET_RPC +}; const env = process.env.METAMASK_ENV const METAMASK_DEBUG = process.env.METAMASK_DEBUG @@ -213,7 +220,9 @@ module.exports = class NetworkController extends EventEmitter { _configureTangerineProvider ({ type }) { log.info('NetworkController - configureTangerineProvider', type) - const networkClient = createJsonRpcClient({ rpcUrl: TANGERINE_TESTNET_RPC }) + const networkClient = createJsonRpcClient({ + rpcUrl: TANGERINE_RPC_MAPPING[type], + }) this._setNetworkClient(networkClient) } |