Feat/drop legacy LOrders#243
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes the legacy Limit Orders surface from the SDK and replaces it with a first-class otcOrders API, updating SDK constructors/exports, swap transaction typing/sanitization, and examples/tests accordingly. It also stops exporting NFT order APIs from the main entrypoint (while leaving some internal NFT code paths in place).
Changes:
- Replace
limitOrders(and exportednftOrders) withotcOrdersacrossconstructFullSDK/constructSimpleSDKand top-level exports. - Update swap transaction types and order sanitization to target OTC orders only (removing NFT/Limit-order branches from
BuildTxInput). - Migrate examples/tests/snapshots to the new OTC naming and submission flow.
Reviewed changes
Copilot reviewed 32 out of 33 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/viem.test.ts | Updates viem integration test to use otcOrders build/sign methods. |
| tests/snapshots/viem.test.ts.snap | Renames snapshot label to OTC order wording. |
| src/sdk/simple.ts | Rewires simple SDK surface from limitOrders/nftOrders to otcOrders. |
| src/sdk/partial.ts | Updates partial SDK type inference to merge OTC order handler types instead of limit/nft. |
| src/sdk/full.ts | Replaces limitOrders/nftOrders in full SDK with otcOrders. |
| src/methods/swap/transaction.ts | Removes NFT/limit-order tx input variants and sanitizes orders via OTC helpers. |
| src/methods/otcOrders/transaction.ts | Renames limit-order tx helpers/types to OTC equivalents and updates rate/tx builders. |
| src/methods/otcOrders/signOrder.ts | Renames signing constructor/types to signOTCOrder. |
| src/methods/otcOrders/postOrder.ts | Adds OTC order POST support (P2P-only posting). |
| src/methods/otcOrders/index.ts | Adds OTC orders “bundled handlers” surface including submitOTCOrder. |
| src/methods/otcOrders/helpers/types.ts | Renames API/types from limit-order naming to OTC naming. |
| src/methods/otcOrders/helpers/misc.ts | Adds OTC order URL/type helpers and order-data sanitization utilities. |
| src/methods/otcOrders/helpers/buildOrderData.ts | Updates OTC order build-data comments/semantics. |
| src/methods/otcOrders/getOrdersContract.ts | Adds OTC order contract getters (AugustusRFQ + TokenTransferProxy). |
| src/methods/otcOrders/getOrders.ts | Implements OTC orders API getters using P2P base URL and updated param types. |
| src/methods/otcOrders/fillOrderDirectly.ts | Renames direct-fill surface for OTC orders (still RFQ-based). |
| src/methods/otcOrders/cancelOrder.ts | Renames cancel functions/types from limit-order naming to OTC naming. |
| src/methods/otcOrders/buildOrder.ts | Renames build functions/types from limit-order naming to OTC naming. |
| src/methods/otcOrders/approveForOrder.ts | Renames approve helpers for OTC orders and simplifies exports. |
| src/methods/nftOrders/helpers/types.ts | Removes unused transaction type alias import/export remnants. |
| src/methods/nftOrders/getOrdersContract.ts | Updates comment to reference OTC orders instead of limit orders. |
| src/methods/nftOrders/cancelOrder.ts | Delegates NFT cancel calls to OTC cancel implementation. |
| src/methods/limitOrders/postOrder.ts | Deletes legacy limit-order posting implementation. |
| src/methods/limitOrders/index.ts | Deletes legacy limit-orders module entrypoint/handlers. |
| src/methods/limitOrders/getOrdersContract.ts | Deletes legacy limit-orders contract getters. |
| src/methods/common/orders/types.ts | Removes OrderTransaction and leaves shared OrderType. |
| src/methods/common/orders/misc.ts | Switches shared order helpers to OTC types for fillability checks. |
| src/index.ts | Updates public exports/types to expose OTC orders and remove limit/nft order exports. |
| src/examples/viem.ts | Migrates viem example to OTC submit/build types and flow. |
| src/examples/otcOrders_postOrder.ts | Migrates posting example from limit orders to OTC orders. |
| src/examples/otcOrders_partial.ts | Migrates partial OTC example from limit orders to OTC orders. |
| src/examples/otcOrders_all.ts | Migrates “all handlers” example from limit orders to OTC orders. |
| CLAUDE.md | Updates repo module overview to reflect otcOrders instead of deprecated limitOrders. |
Comments suppressed due to low confidence (9)
src/methods/otcOrders/fillOrderDirectly.ts:17
FillOTCOrderFunctionsreferences a misspelled callback type name (FillOTCOrcer). This typo will leak into the generated public .d.ts API and makes the surface harder to discover/search.
src/methods/otcOrders/fillOrderDirectly.ts:46- The exported callback type is misspelled as
FillOTCOrcer(likely meant to beFillOTCOrder). Since this type is used byFillOTCOrderFunctions, the typo becomes part of the public type surface.
src/methods/otcOrders/fillOrderDirectly.ts:214 - After renaming the callback type to
FillOTCOrder, this usage should be updated accordingly to keep the type names consistent.
src/methods/otcOrders/buildOrder.ts:23 - Typo in the JSDoc: "excuted" → "executed".
src/methods/otcOrders/getOrders.ts:18 OTCOrderTypeis imported but never used, which will typically fail linting in this repo (and adds noise for readers).
src/methods/otcOrders/getOrders.ts:80- Use single quotes for string literals to match the repo Prettier config (
singleQuote: truein .prettierrc).
src/methods/otcOrders/helpers/types.ts:23 - Typo in comment: "PARTIALLY_FILLLED" → "PARTIALLY_FILLED".
src/methods/otcOrders/approveForOrder.ts:26 - Typo in comment: "TokenTransaferProxy" → "TokenTransferProxy".
src/methods/otcOrders/approveForOrder.ts:11 - The JSDoc for
approveTakerTokenForOTCOrdersays it approves AugustusRFQ for direct order filling, but the implementation delegates toconstructApproveToken(swap spender / TokenTransferProxy). The comment should reflect the actual spender/use-case (swap-based OTC order tx building).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| LimitOrdersApiResponse, | ||
| LimitOrderType, | ||
| OTCOrderFromApi, | ||
| OTCOrdersApiResponse, |
There was a problem hiding this comment.
Would be good to match OTCOrdersApiResponse with PaginatedResponse<DeltaAuction>, for consistency
There was a problem hiding this comment.
Can't
OTCOrdersApiResponse has offset as the driving force of pagination, whereas your Paginated has page
Mapping offset to page would be very artificial and ultimately a lie
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a194e51. Configure here.
size-limit report 📦
|

closes FRNT-1344
Note
High Risk
Major breaking change for integrators still on
limitOrders/nftOrdersexports and open limit-order flows; on-chain fill/cancel paths are renamed but still touch AugustusRFQ.Overview
This is a breaking public API cleanup: legacy limit orders are removed and the surviving EIP-712 RFQ flow is exposed as
otcOrderswith renamed constructors and methods (buildOTCOrder,submitOTCOrder,getOTCOrders,buildOTCOrderTx, etc.).constructFullSDK/constructSimpleSDKnow exposesdk.otcOrdersinstead ofsdk.limitOrders(and no longer wiresdk.nftOrders). Top-level exports drop limit-order and NFT-order symbols;src/methods/limitOrders/is deleted and logic lives undersrc/methods/otcOrders/. Swap transaction types rename limit-order fill inputs toBuildOTCOrderTxInput/BuildSwapAndOTCOrderTxInput.OTC behavior is narrowed to P2P-style orders:
takeris required on build/submit, listing always hits the P2P API path (notype: 'LIMIT'ongetOTCOrders), andsubmitLimitOrder/postLimitOrder/ open limit listing are gone. Approvals simplify to maker/taker RFQ approvals (no separate AugustusSwapper taker path for “limit” fills). Examples and viem tests are updated;@types/nodeis added to devDependencies.Reviewed by Cursor Bugbot for commit 6625df1. Bugbot is set up for automated code reviews on this repo. Configure here.