-
Notifications
You must be signed in to change notification settings - Fork 5.4k
feat: price API v3 upgrade #37741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: price API v3 upgrade #37741
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Builds ready [1b01012]
UI Startup Metrics (1234 ± 96 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
1b01012 to
2bc2dc4
Compare
Builds ready [2bc2dc4]
UI Startup Metrics (1217 ± 81 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [bfcc40a]
UI Startup Metrics (1242 ± 98 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [14efbd0]
UI Startup Metrics (1235 ± 90 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
df6d02e to
d784cd9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There changes should not affect anything. This hook is used purely to start polling, the return result is not used and therefore it is not needed.
Builds ready [85dbc1a]
UI Startup Metrics (1251 ± 111 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
| + '0x82750': null, //'eip155:534352/slip44:60', // Scroll Mainnet - Native symbol: ETH | ||
| + '0x4e454152': null, //'eip155:60/slip44:60', // Aurora Mainnet (Ethereum L2 on NEAR) - Native symbol: ETH | ||
| + '0x63564c40': null, //'eip155:1666600000/slip44:1023', // Harmony Mainnet Shard 0 - Native symbol: ONE | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting them to null falls back to v2. When the API is fixed we can remove this part of the patch.
| return []; | ||
| } | ||
| - const url = new URL(`${BASE_URL_V2}/chains/${chainId}/spot-prices`); | ||
| + const url = new URL(`${BASE_URL_V2}/chains/${parseInt(chainId, 16)}/spot-prices`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works both with decimal and hexadecimal, but all the e2e tests are mocked using decimal, so this is easier than changing all of them.
When we remove the fallback to v2 they'll have to be changed anyway.
Builds ready [49381b2]
UI Startup Metrics (1327 ± 144 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [0c67149]
UI Startup Metrics (1327 ± 117 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
72dc005
Builds ready [72dc005]
UI Startup Metrics (1299 ± 122 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [11888a4]
UI Startup Metrics (1267 ± 111 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [bd06391]
UI Startup Metrics (1227 ± 108 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
Upgrade assets-controllers to start using Price API v3 spot-prices endpoint.
Changelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-1575
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Upgrades @metamask/assets-controllers to v91 with spot-prices v3 tweaks (decimal chainId, added MON currency), normalizes account casing in balance updates, simplifies token rates messaging/polling, adds a selector variant for Tron resources, and updates LavaMoat policies.
@metamask/assets-controllerstov91.0.0(patched); update related locks and@metamask/controller-utils/@metamask/polling-controllerversions.montoSUPPORTED_CURRENCIES./spot-pricesURL (parseInt(chainId, 16)).SPOT_PRICES_SUPPORT_INFOmappings (many set tonull).TokenBalancesController, lower-caseaccountkeys when reading/writingtokenBalances.TokensController:getStateandNetworkController:getStateand corresponding state-change events.useTokenRatesPollingto only manage polling (no returned state).getAssetsBySelectedAccountGroupnow directly proxies toselectAssetsBySelectedAccountGroup.getAssetsBySelectedAccountGroupWithTronResources(passes{ filterTronStakedTokens: false }); update tests accordingly.@metamask/assets-controllers>@metamask/polling-controllerand add a new policy block.Written by Cursor Bugbot for commit bd06391. This will update automatically on new commits. Configure here.