mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-11 19:44:21 +00:00
parent
51db31b9fa
commit
5b07395ee4
@ -26,6 +26,11 @@ export const fetchRates = (symbols: string[] = []): Promise<CCResponse> =>
|
|||||||
fetch(CCRates(symbols))
|
fetch(CCRates(symbols))
|
||||||
.then(response => handleJSONResponse(response, ERROR_MESSAGE))
|
.then(response => handleJSONResponse(response, ERROR_MESSAGE))
|
||||||
.then(rates => {
|
.then(rates => {
|
||||||
|
// API errors come as 200s, so check the json for error
|
||||||
|
if (rates.Response && rates.Response === 'Error') {
|
||||||
|
throw new Error('Failed to fetch rates');
|
||||||
|
}
|
||||||
|
|
||||||
// All currencies are in ETH right now. We'll do token -> eth -> value to
|
// All currencies are in ETH right now. We'll do token -> eth -> value to
|
||||||
// do it all in one request
|
// do it all in one request
|
||||||
// to their respective rates via ETH.
|
// to their respective rates via ETH.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user