|
|
@ -1,7 +1,6 @@ |
|
|
|
const Migrator = require('pojo-migrator') |
|
|
|
const Migrator = require('pojo-migrator') |
|
|
|
const MetamaskConfig = require('../config.js') |
|
|
|
const MetamaskConfig = require('../config.js') |
|
|
|
const migrations = require('./migrations') |
|
|
|
const migrations = require('./migrations') |
|
|
|
const rp = require('request-promise') |
|
|
|
|
|
|
|
const ethUtil = require('ethereumjs-util') |
|
|
|
const ethUtil = require('ethereumjs-util') |
|
|
|
const normalize = require('./sig-util').normalize |
|
|
|
const normalize = require('./sig-util').normalize |
|
|
|
|
|
|
|
|
|
|
@ -301,9 +300,9 @@ ConfigManager.prototype.getCurrentFiat = function () { |
|
|
|
|
|
|
|
|
|
|
|
ConfigManager.prototype.updateConversionRate = function () { |
|
|
|
ConfigManager.prototype.updateConversionRate = function () { |
|
|
|
var data = this.getData() |
|
|
|
var data = this.getData() |
|
|
|
return rp(`https://www.cryptonator.com/api/ticker/eth-${data.fiatCurrency}`) |
|
|
|
return fetch(`https://www.cryptonator.com/api/ticker/eth-${data.fiatCurrency}`) |
|
|
|
.then((response) => { |
|
|
|
.then(response => response.json()) |
|
|
|
const parsedResponse = JSON.parse(response) |
|
|
|
.then((parsedResponse) => { |
|
|
|
this.setConversionPrice(parsedResponse.ticker.price) |
|
|
|
this.setConversionPrice(parsedResponse.ticker.price) |
|
|
|
this.setConversionDate(parsedResponse.timestamp) |
|
|
|
this.setConversionDate(parsedResponse.timestamp) |
|
|
|
}).catch((err) => { |
|
|
|
}).catch((err) => { |
|
|
|