feat: use QuoteResponse V2 in bridge-controller - #9726
Conversation
|
@metamaskbot publish-preview |
|
@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 2d0732a. Configure here.
| QuoteStreamCompleteReason, | ||
| } from './validators/quote-stream-complete.js'; | ||
| export { BatchSellTransactionType } from './validators/batch-sell.js'; | ||
| export { type AmountsAndAssetSchema } from './validators/amount-and-asset.js'; |
There was a problem hiding this comment.
Schema exported as type-only
Medium Severity
AmountsAndAssetSchema is a runtime Superstruct schema, but it is exported with type, so importers only get a type and cannot use the schema for validation at runtime. Sibling schemas like BridgeAssetSchema are exported as values.
Reviewed by Cursor Bugbot for commit 2d0732a. Configure here.


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
Breaking type and behavior changes across quote fetching, fee attachment, selectors, and tx submission paths for unified swap/bridge and batch-sell; consumers must adopt V2 or use coercers.
Overview
BREAKING:
BridgeControllerstate, quote streaming, and publicQuoteResponsetyping now use QuoteResponse V2 (V1 remains asQuoteResponseV1). Incoming SSE/API payloads are coerced withtoQuoteResponseV2; batch gasless calls still post V1 viatoQuoteResponseV1.appendFeesToQuotesnow takes a CAIPchainIdfirst and skips fee enrichment when a fetch has multiple source chains. Selectors, metrics, and batch-sell rollups are updated for the V2 quote shape (quote.src/quote.dest, top-levelchainId,sumAmountsfor totals).bridge-status-controllersubmitTx/submitIntent/submitBatchSellaccept V2 quotes from clients but normalize to V1 before internal submission and history.Reviewed by Cursor Bugbot for commit 2d0732a. Bugbot is set up for automated code reviews on this repo. Configure here.