diff options
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) { |