feat: use QuoteResponse V2 in bridge-controller - #9726
Conversation
|
@metamaskbot publish-preview |
This reverts commit aa5c5d2.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ 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 a5a6e0d. Configure here.
|
@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. |
| // Client can render special UI or skip the quote card row for quotes with missing fee data | ||
| console.error( | ||
| `Failed to compute non-EVM fees for quote ${quote.requestId}:`, | ||
| `Failed to compute non-EVM fees for quote in ${chainId}:`, |
There was a problem hiding this comment.
Does this change limit our ability to look these errors up in some way?
There was a problem hiding this comment.
We used to log the requestId, which is not a valid lookup key. But this is a good call, I'll log the quoteId instead since we can actually use it

Explanation
Store and consume QuoteResponse v2 in the bridge-controller. Implements v1<>v2 coercers and metadata merge logic for client and controller compatibility during migration. See changelogs for more details
Draft client PRs
References
Checklist
Note
High Risk
Large breaking API and quote-shape change across swap/bridge/batch-sell paths; incorrect coercion or fee/sorting regressions would affect quote display, fees, and transaction submission.
Overview
BREAKING:
QuoteResponsein@metamask/bridge-controllernow means V2; V1 remains asQuoteResponseV1. Controllerquotesstate, SSE quote streaming, and batch-sell paths coerce incoming payloads withtoQuoteResponseV2and validate against the V2 shape (quote.src/quote.dest, fee arrays, etc.).Quote sorting and batch-sell aggregates move to V2 fields—e.g. default ordering uses
priceData.priceImpactandquote.dest.amount, andselectBatchSellQuotessums destination amounts viasumAmountsinstead of legacy metadata keys.appendFeesToQuotesnow requires a CAIPchainIdand skips fee enrichment when multiple source chains appear in one batch.fetchBatchSellTradesstill posts V1 bodies (toQuoteResponseV1) for backend compatibility while accepting V2 quotes from callers. Metrics helpers read gas/return/symbols from the nested V2 quote structure.@metamask/bridge-status-controller:submitTx,submitIntent, andsubmitBatchSellaccept V2 quotes from clients but normalize to V1 + metadata before existing submission/history logic runs.Reviewed by Cursor Bugbot for commit cf1a542. Bugbot is set up for automated code reviews on this repo. Configure here.