Commit 1bb6d53
authored
chore: update price api support (#7543)
## Explanation
<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:
* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?
* Are there any changes whose purpose might not obvious to those
unfamiliar with the domain?
* If your primary goal was to update one package but you found you had
to update another one along the way, why did you do so?
* If you had to upgrade a dependency, why did you do so?
-->
Updates list of supported networks with latest info from their API. Also
ensures they are ordered so that it's easy to identify them.
## References
<!--
Are there any issues that this pull request is tied to?
Are there other links that reviewers should consult to understand these
changes better?
Are there client or consumer pull requests to adopt any breaking
changes?
For example:
* Fixes #12345
* Related to #67890
-->
## Checklist
- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs),
highlighting breaking changes as necessary
- [ ] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Expands spot-prices supported chains/mappings and drops the v2
fallback so token prices are fetched via v3 only, with test and type
updates.
>
> - **Token Prices Service
(`packages/assets-controllers/src/token-prices-service/codefi-v2.ts`)**
> - Expanded `SPOT_PRICES_SUPPORT_INFO` with many new/updated chain
CAIP-19 mappings and native asset entries.
> - Removed v2 fallback: deleted `BASE_URL_V2` and
`#fetchTokenPricesV2`; `fetchTokenPrices` now queries only
`v3/spot-prices`.
> - Improved typings: explicit return types for `onBreak`, `onDegraded`.
> - **Tests (`codefi-v2.test.ts`)**
> - Removed v2 endpoint test; updated helpers to return precise types.
> - Kept and adjusted v3 spot-prices tests and
circuit-breaker/degraded-path tests.
> - **Changelog**
> - Added entry noting updated spot-prices supported chains/assets.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
aa068b1. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent dcccc3f commit 1bb6d53
File tree
4 files changed
+64
-245
lines changed- packages/assets-controllers
- src/token-prices-service
4 files changed
+64
-245
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
561 | 561 | | |
562 | 562 | | |
563 | 563 | | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | 564 | | |
575 | 565 | | |
576 | 566 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
Lines changed: 17 additions & 125 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
127 | 129 | | |
128 | 130 | | |
129 | 131 | | |
| |||
237 | 239 | | |
238 | 240 | | |
239 | 241 | | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | 242 | | |
359 | 243 | | |
360 | 244 | | |
| |||
1296 | 1180 | | |
1297 | 1181 | | |
1298 | 1182 | | |
1299 | | - | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
1300 | 1186 | | |
1301 | 1187 | | |
1302 | 1188 | | |
| |||
1791 | 1677 | | |
1792 | 1678 | | |
1793 | 1679 | | |
1794 | | - | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
1795 | 1683 | | |
1796 | 1684 | | |
1797 | 1685 | | |
| |||
1898 | 1786 | | |
1899 | 1787 | | |
1900 | 1788 | | |
1901 | | - | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
1902 | 1792 | | |
1903 | | - | |
| 1793 | + | |
1904 | 1794 | | |
1905 | 1795 | | |
1906 | 1796 | | |
| |||
1938 | 1828 | | |
1939 | 1829 | | |
1940 | 1830 | | |
1941 | | - | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
1942 | 1834 | | |
1943 | | - | |
| 1835 | + | |
1944 | 1836 | | |
1945 | 1837 | | |
1946 | 1838 | | |
| |||
0 commit comments