Comply with current currency API and add additional styling.

feature/default_network_editable
Kevin Serrano 7 years ago
parent 51cebcc173
commit bd8428e9ed
No known key found for this signature in database
GPG Key ID: BF999DEFC7371BA1
  1. 4
      app/scripts/controllers/currency.js
  2. 2
      ui/app/components/fiat-value.js
  3. 2
      ui/app/config.js

@ -8,7 +8,7 @@ class CurrencyController {
constructor (opts = {}) { constructor (opts = {}) {
const initState = extend({ const initState = extend({
currentCurrency: 'ethusd', currentCurrency: 'usd',
conversionRate: 0, conversionRate: 0,
conversionDate: 'N/A', conversionDate: 'N/A',
}, opts.initState) }, opts.initState)
@ -45,7 +45,7 @@ class CurrencyController {
updateConversionRate () { updateConversionRate () {
const currentCurrency = this.getCurrentCurrency() const currentCurrency = this.getCurrentCurrency()
return fetch(`https://api.infura.io/v1/ticker/${currentCurrency}`) return fetch(`https://api.infura.io/v1/ticker/eth${currentCurrency}`)
.then(response => response.json()) .then(response => response.json())
.then((parsedResponse) => { .then((parsedResponse) => {
this.setConversionRate(Number(parsedResponse.bid)) this.setConversionRate(Number(parsedResponse.bid))

@ -28,7 +28,7 @@ FiatValue.prototype.render = function () {
fiatTooltipNumber = 'Unknown' fiatTooltipNumber = 'Unknown'
} }
return fiatDisplay(fiatDisplayNumber, currentCurrency) return fiatDisplay(fiatDisplayNumber, currentCurrency.toUpperCase())
} }
function fiatDisplay (fiatDisplayNumber, fiatSuffix) { function fiatDisplay (fiatDisplayNumber, fiatSuffix) {

@ -170,7 +170,7 @@ function currentConversionInformation (metamaskState, state) {
}, },
defaultValue: currentCurrency, defaultValue: currentCurrency,
}, infuraCurrencies.map((currency) => { }, infuraCurrencies.map((currency) => {
return h('option', {key: currency.symbol, value: currency.symbol}, `${currency.quote.code.toUpperCase()} - ${currency.quote.name}`) return h('option', {key: currency.quote.code, value: currency.quote.code}, `${currency.quote.code.toUpperCase()} - ${currency.quote.name}`)
}) })
), ),
]) ])

Loading…
Cancel
Save