Conversation
size-limit report 📦
|
|
@cursor review |
|
@cursor review |
Velenir
left a comment
There was a problem hiding this comment.
Can't really say if this whole thing works without tests, or testing in UI/WIdget, but looks alright.
Please, if not tests right away, add an example with the happy path and a readme
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Wrong import source for
TypedDataFieldtype- Replaced the
ethersV5TypedDataFieldimport with the SDK’s localTypedDataFieldtype from../common/orders/buildOrderDatainpreSignTWAPDeltaOrder.ts.
- Replaced the
Or push these changes by commenting:
@cursor push 0dadd97d7a
Preview (0dadd97d7a)
diff --git a/src/methods/delta/preSignTWAPDeltaOrder.ts b/src/methods/delta/preSignTWAPDeltaOrder.ts
--- a/src/methods/delta/preSignTWAPDeltaOrder.ts
+++ b/src/methods/delta/preSignTWAPDeltaOrder.ts
@@ -14,7 +14,7 @@
import { findPrimaryType } from '../../helpers/providers/helpers';
import { constructGetDeltaContract } from './getDeltaContract';
import type { TWAPDeltaOrder, TWAPBuyDeltaOrder } from './helpers/types';
-import { TypedDataField } from 'ethersV5';
+import type { TypedDataField } from '../common/orders/buildOrderData';
type HashTWAPDeltaOrderTypedData = (
signableOrderData: SignableTWAPOrderDataThis Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
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, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 95e4c07. Configure here.
| const deltaOrderToPost: DeltaOrderToPost<'TWAPOrder' | 'TWAPBuyOrder'> = { | ||
| ...postData, | ||
| chainId, | ||
| }; |
There was a problem hiding this comment.
API field sent implicitly via spread, not in type
Medium Severity
The onChainOrderType field is intentionally included in PostTWAPDeltaOrderParams and explicitly passed by callers like submitTWAPDeltaOrder, but it only reaches the API request body as an implicit side-effect of the rest spread (...postData). The DeltaOrderToPost type doesn't declare onChainOrderType, so nothing in the type system ensures this critical field survives. A future refactor that constructs the POST body property-by-property instead of using spread would silently drop onChainOrderType, potentially breaking TWAP order creation.
Reviewed by Cursor Bugbot for commit 95e4c07. Configure here.
There was a problem hiding this comment.
We don't know how much can break after this change (most likely nothing), so let's release as is for now and change later



closes FRNT-1290
Note
Medium Risk
Adds new TWAP Delta order flows (typed-data building/signing, API posting, pre-signing, and on-chain cancellation), plus updates shared amount/slippage typings; mistakes could cause incorrect order encoding or transaction calls.
Overview
Adds first-class TWAP Delta order support (sell and buy) across the SDK: new builders produce EIP-712 typed data, new sign/post/pre-sign helpers submit and manage TWAP orders, and
constructAllDeltaOrdersHandlers/public exports now exposesubmitTWAPDeltaOrderand related functions.Extends the Delta token module with
cancelTWAPAndWithdrawandcancelTWAPBuyAndWithdrawcontract calls, including TWAP order sanitization before signing/transacting.Refactors slippage/amount typing by renaming
AmountsWithSlippagetoDeltaAmountsWithSlippage(and variants), exportsDeltaAuctionTransaction, and updates snapshots; bumps package version to9.5.0.Reviewed by Cursor Bugbot for commit dc32f22. Bugbot is set up for automated code reviews on this repo. Configure here.