mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Comply with current currency API and add additional styling.
This commit is contained in:
parent
51cebcc173
commit
bd8428e9ed
@ -8,7 +8,7 @@ class CurrencyController {
|
||||
|
||||
constructor (opts = {}) {
|
||||
const initState = extend({
|
||||
currentCurrency: 'ethusd',
|
||||
currentCurrency: 'usd',
|
||||
conversionRate: 0,
|
||||
conversionDate: 'N/A',
|
||||
}, opts.initState)
|
||||
@ -45,7 +45,7 @@ class CurrencyController {
|
||||
|
||||
updateConversionRate () {
|
||||
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((parsedResponse) => {
|
||||
this.setConversionRate(Number(parsedResponse.bid))
|
||||
|
@ -28,7 +28,7 @@ FiatValue.prototype.render = function () {
|
||||
fiatTooltipNumber = 'Unknown'
|
||||
}
|
||||
|
||||
return fiatDisplay(fiatDisplayNumber, currentCurrency)
|
||||
return fiatDisplay(fiatDisplayNumber, currentCurrency.toUpperCase())
|
||||
}
|
||||
|
||||
function fiatDisplay (fiatDisplayNumber, fiatSuffix) {
|
||||
|
@ -170,7 +170,7 @@ function currentConversionInformation (metamaskState, state) {
|
||||
},
|
||||
defaultValue: currentCurrency,
|
||||
}, 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…
Reference in New Issue
Block a user