Skip to content

Commit

Permalink
Revert to Kraken API
Browse files Browse the repository at this point in the history
Quick Fix for #49
  • Loading branch information
amiuhle committed Feb 25, 2019
1 parent e0c890a commit 63d1494
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions lib/exchange-rates.js
Expand Up @@ -4,11 +4,11 @@ export const fetchExchangeRate = (fiatCurrency) => {
if (fiatCurrency === null) {
return Promise.resolve(1)
} else {
// return fetch('https://api.kraken.com/0/public/Ticker?pair=xmreur,xmrusd')
// .then(response => response.json())
// .then(json => Number.parseFloat(json.result[`XXMRZ${fiatCurrency}`]['p'][1]))
return fetch(`https://api.coinmarketcap.com/v1/ticker/monero/?convert=${fiatCurrency}`)
return fetch('https://api.kraken.com/0/public/Ticker?pair=xmreur,xmrusd')
.then(response => response.json())
.then(json => Number.parseFloat(json[0][`price_${fiatCurrency.toLowerCase()}`]))
.then(json => Number.parseFloat(json.result[`XXMRZ${fiatCurrency}`]['p'][1]))
// return fetch(`https://api.coinmarketcap.com/v1/ticker/monero/?convert=${fiatCurrency}`)
// .then(response => response.json())
// .then(json => Number.parseFloat(json[0][`price_${fiatCurrency.toLowerCase()}`]))
}
}
2 changes: 1 addition & 1 deletion src/views/settings.js
Expand Up @@ -92,7 +92,7 @@ class Settings extends Component {
<div className='form-field'>
<label htmlFor='fiatCurrency'>Currency</label>
<Field name='fiatCurrency' component='select'>
{CMC_CURRENCIES.map((currency) => <option key={currency}>{currency}</option>)}
{['EUR', 'USD'].map((currency) => <option key={currency}>{currency}</option>)}
</Field>
</div>

Expand Down

0 comments on commit 63d1494

Please sign in to comment.