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 = {}) {
|
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…
x
Reference in New Issue
Block a user