diff options
author | frankiebee <frankie.diamond@gmail.com> | 2017-05-23 07:48:10 +0800 |
---|---|---|
committer | frankiebee <frankie.diamond@gmail.com> | 2017-05-23 07:48:10 +0800 |
commit | 13a41f3129299844c908965a25996ec5cd190eb1 (patch) | |
tree | a2b0241aa0db2732cb1afe680831768731e9d49a /app/scripts/lib/config-manager.js | |
parent | f87ea49b5ac2d66d8f281f08f42e8cfd2d701ba7 (diff) | |
parent | c7fd9f424087b20bfc356d360d2a2246ca0e5ad7 (diff) | |
download | tangerine-wallet-browser-13a41f3129299844c908965a25996ec5cd190eb1.tar tangerine-wallet-browser-13a41f3129299844c908965a25996ec5cd190eb1.tar.gz tangerine-wallet-browser-13a41f3129299844c908965a25996ec5cd190eb1.tar.bz2 tangerine-wallet-browser-13a41f3129299844c908965a25996ec5cd190eb1.tar.lz tangerine-wallet-browser-13a41f3129299844c908965a25996ec5cd190eb1.tar.xz tangerine-wallet-browser-13a41f3129299844c908965a25996ec5cd190eb1.tar.zst tangerine-wallet-browser-13a41f3129299844c908965a25996ec5cd190eb1.zip |
Merge branch 'master' into networkController
Diffstat (limited to 'app/scripts/lib/config-manager.js')
-rw-r--r-- | app/scripts/lib/config-manager.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index 1098cc474..6ca9bd9ea 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -1,6 +1,14 @@ const ethUtil = require('ethereumjs-util') const normalize = require('eth-sig-util').normalize +<<<<<<< HEAD +======= +const MAINNET_RPC = MetamaskConfig.network.mainnet +const ROPSTEN_RPC = MetamaskConfig.network.ropsten +const KOVAN_RPC = MetamaskConfig.network.kovan +const RINKEBY_RPC = MetamaskConfig.network.rinkeby + +>>>>>>> master /* The config-manager is a convenience object * wrapping a pojo-migrator. * @@ -101,6 +109,32 @@ ConfigManager.prototype.getSeedWords = function () { return data.seedWords } +ConfigManager.prototype.getCurrentRpcAddress = function () { + var provider = this.getProvider() + if (!provider) return null + switch (provider.type) { + + case 'mainnet': + return MAINNET_RPC + + case 'ropsten': + return ROPSTEN_RPC + + case 'kovan': + return KOVAN_RPC + + case 'rinkeby': + return RINKEBY_RPC + + default: + return provider && provider.rpcTarget ? provider.rpcTarget : RINKEBY_RPC + } +} + +// +// Tx +// + ConfigManager.prototype.getTxList = function () { var data = this.getData() if (data.transactions !== undefined) { |