Merge pull request #4062 from MetaMask/i4056-LatestPriceApi

Use the metamask balanc3 dev price api
feature/default_network_editable
Dan Finlay 7 years ago committed by GitHub
commit c9d3b158b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/scripts/controllers/token-rates.js

@ -39,7 +39,7 @@ class TokenRatesController {
*/ */
async fetchExchangeRate (address) { async fetchExchangeRate (address) {
try { try {
const response = await fetch(`https://exchanges.balanc3.net/prices?from=${address}&to=ETH&autoConversion=false&summaryOnly=true`) const response = await fetch(`https://metamask.dev.balanc3.net/prices?from=${address}&to=ETH&autoConversion=false&summaryOnly=true`)
const json = await response.json() const json = await response.json()
return json && json.length ? json[0].averagePrice : 0 return json && json.length ? json[0].averagePrice : 0
} catch (error) { } } catch (error) { }

Loading…
Cancel
Save