diff options
Revert "Revert "Etherscan provider""
Diffstat (limited to 'app/scripts/lib/config-manager.js')
-rw-r--r-- | app/scripts/lib/config-manager.js | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index 682b34637..121ede838 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -47,15 +47,6 @@ ConfigManager.prototype.setConfig = function(config) { this.setData(data) } -ConfigManager.prototype.setRpcTarget = function(rpcUrl) { - var config = this.getConfig() - config.provider = { - type: 'rpc', - rpcTarget: rpcUrl, - } - this.setConfig(config) -} - ConfigManager.prototype.getConfig = function() { var data = this.migrator.getData() if ('config' in data) { @@ -70,6 +61,28 @@ ConfigManager.prototype.getConfig = function() { } } +ConfigManager.prototype.setRpcTarget = function(rpcUrl) { + var config = this.getConfig() + config.provider = { + type: 'rpc', + rpcTarget: rpcUrl, + } + this.setConfig(config) +} + +ConfigManager.prototype.useEtherscanProvider = function() { + var config = this.getConfig() + config.provider = { + type: 'etherscan', + } + this.setConfig(config) +} + +ConfigManager.prototype.getProvider = function() { + var config = this.getConfig() + return config.provider +} + ConfigManager.prototype.setData = function(data) { this.migrator.saveData(data) } |