feat: fetch gasless transactions for BatchSell quotes#8805
Conversation
812aa2e to
c01f799
Compare
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 bb9931b. Configure here.
| ) { | ||
| // Exit the function early to prevent other state updates | ||
| return; | ||
| } |
There was a problem hiding this comment.
Aborted fetch unconditionally clears valid batch trade data
Low Severity
In fetchBatchSellTrades, the catch block unconditionally resets batchSellTrades to null before checking if the error is an abort. If two calls overlap and the newer one resolves before the older one's abort-triggered catch runs, the catch will overwrite the valid batchSellTrades result with null, leaving the state showing batchSellTradesLoadingStatus: FETCHED with batchSellTrades: null.
Reviewed by Cursor Bugbot for commit bb9931b. Configure here.


Explanation
References
Checklist
Note
Medium Risk
Adds a new network call and state lifecycle for fetching gasless BatchSell transaction batches/fees, plus a breaking selector output change that clients must adapt to. Risk is mainly around request cancellation/ordering and fee display correctness based on the new API response validation.
Overview
Adds a new
BridgeController:fetchBatchSellTradesaction that calls the bridge APIobtainGaslessBatchendpoint, storing the resulting transaction batch + fee data in new state fields (batchSellTrades,batchSellTradesLoadingStatus) with abort-on-refresh/reset behavior.Introduces
selectBatchSellTrades(and fee conversion viacalcBatchFees) to surface the batch transactions and a convertedtotalNetworkFee, and removestotalNetworkFeefromselectBatchSellQuotes(breaking consumer change).Extends types/validators to model and validate the gasless batch response (including transaction
typeand hex gas fee limits), updatesRequestStatusenum values, and expands unit/snapshot tests to cover fetch, abort, and error/reset cases.Reviewed by Cursor Bugbot for commit bb9931b. Bugbot is set up for automated code reviews on this repo. Configure here.