Skip to content

feat: fetch gasless transactions for BatchSell quotes#8805

Open
micaelae wants to merge 3 commits into
mainfrom
swaps4444-batch-trades
Open

feat: fetch gasless transactions for BatchSell quotes#8805
micaelae wants to merge 3 commits into
mainfrom
swaps4444-batch-trades

Conversation

@micaelae
Copy link
Copy Markdown
Member

@micaelae micaelae commented May 14, 2026

Explanation

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

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:fetchBatchSellTrades action that calls the bridge API obtainGaslessBatch endpoint, storing the resulting transaction batch + fee data in new state fields (batchSellTrades, batchSellTradesLoadingStatus) with abort-on-refresh/reset behavior.

Introduces selectBatchSellTrades (and fee conversion via calcBatchFees) to surface the batch transactions and a converted totalNetworkFee, and removes totalNetworkFee from selectBatchSellQuotes (breaking consumer change).

Extends types/validators to model and validate the gasless batch response (including transaction type and hex gas fee limits), updates RequestStatus enum 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.

@micaelae micaelae force-pushed the swaps4444-batch-trades branch from 812aa2e to c01f799 Compare May 14, 2026 00:46
@micaelae micaelae marked this pull request as ready for review May 14, 2026 01:04
@micaelae micaelae requested a review from a team as a code owner May 14, 2026 01:04
@micaelae micaelae temporarily deployed to default-branch May 14, 2026 01:05 — with GitHub Actions Inactive
@micaelae micaelae requested a review from a team as a code owner May 14, 2026 01:06
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit bb9931b. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant