Get token prices from our API instead of CoinGecko#3600
Conversation
1969e05 to
1302cc3
Compare
|
Putting into draft again because I'm going to make sure to incorporate changes in MetaMask/metamask-mobile#7957. |
6e9c8d1 to
0a9c0a7
Compare
CoinGecko is planning on retiring their `/simple/token_price` endpoint soon. This endpoint is critical for us, as we use to fetch prices for tokens. This commit removes all code related to CoinGecko in TokenRatesController so that it hits an internal API instead. This is set up in such a way that we can upgrade to newer versions of the API (or even other services) in the future without breaking backward compatibility. However, at the moment it does introduce breaking changes to TokenRatesController.
0a9c0a7 to
c61add8
Compare
| // Base | ||
| '0x2105', | ||
| // Shiden | ||
| // NOTE: This is the wrong chain ID, this should be 0x150 |
There was a problem hiding this comment.
I'm asking Tomas about this: MetaMask/metamask-mobile#7957 (comment)
| * The list of currencies that can be supplied as the `vsCurrency` parameter to | ||
| * the `/spot-prices` endpoint, in lowercase form. | ||
| */ | ||
| export const SUPPORTED_CURRENCIES = [ |
There was a problem hiding this comment.
This list comes from MetaMask/metamask-mobile#7957.
| * the `/spot-prices` endpoint, but in hexadecimal form (for consistency with | ||
| * how we represent chain IDs in other places). | ||
| */ | ||
| export const SUPPORTED_CHAIN_IDS = [ |
There was a problem hiding this comment.
This list comes from MetaMask/metamask-mobile#7957.
mikesposito
left a comment
There was a problem hiding this comment.
Looks good! Probably just some changes to do on inline docs
|
I am thinking about how/if this relates to this issue. Do we handle the case where a list of tokens overflows the service rate limit? And in case not, what would be the best way to do that after these changes? |
I think in a future PR, we can wrap the call to |
PR #3600 included a non-breaking change to `controller-utils` that was required by the `assets-controllers` changes.
Explanation
CoinGecko is planning on retiring their
/simple/token_priceendpoint soon. This endpoint is critical for us, as we use to fetch prices for tokens. This commit removes all code related to CoinGecko in TokenRatesController so that it hits an internal API instead.This is set up in such a way that we can upgrade to newer versions of the API (or even other services) in the future without breaking backward compatibility. However, at the moment it does introduce breaking changes to TokenRatesController.
References
Fixes #3574.
Changelog
(Updated in PR)
Checklist