chore: return partial swap QuoteMetadata - #9507
Conversation
Pull request was converted to draft
0c70e76 to
d6c8c40
Compare
|
@metamaskbot publish-preview |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7158a56. Configure here.
7158a56 to
0ad24e9
Compare

Explanation
This extracts legacy QuoteMetadata code into its own directory to prepare for deprecation. See changelog/cursor comment for more details
Extension PR: MetaMask/metamask-extension#44630
Mobile PR: MetaMask/metamask-mobile#33559
References
Checklist
Note
High Risk
Breaking public API and fee/display semantics in a core swap-bridge package; extension and mobile must adopt the new
QuoteMetadatashape and gas field usage.Overview
Refactors legacy quote metadata out of the monolithic
utils/quote.tsintoutils/quote-metadata/(calcQuoteMetadata,mergeQuoteMetadata, types). Selectors now compute metadata viacalcQuoteMetadataand attach it withmergeQuoteMetadatainstead of inlining the old calculator block.Breaking
QuoteMetadatachanges: fields areDeepPartial/optional; missing fiat values areundefinedinstead ofnull/0.gasFee.effective,gasFee.max, andtotalMaxNetworkFeeare removed—callers should usegasFee.totalandtotalNetworkFee.priceImpactandrelayerFeeare newly computed and exposed. Quote validation moves tovalidators/quote-request.ts; perps sorting moves toutils/sort-quotes.ts. Publicindex.tsre-exports the new module; metricsusd_quoted_gasnow readsgasFee.total.Fee math tweaks include case-insensitive fee asset matching for
calcSentAmount, relayer fee handling when trade value is zero/negative, and simplified EVM gas display (total-only). Tests, mocks, and changelog document the consumer migration (extension/mobile PRs).Reviewed by Cursor Bugbot for commit 4348c39. Bugbot is set up for automated code reviews on this repo. Configure here.