Skip to content

Chore/Order.refunds field#244

Merged
Velenir merged 12 commits into
feat/delta-v2from
chore/order_refund_field
Jun 16, 2026
Merged

Chore/Order.refunds field#244
Velenir merged 12 commits into
feat/delta-v2from
chore/order_refund_field

Conversation

@Velenir

@Velenir Velenir commented Jun 15, 2026

Copy link
Copy Markdown
Member
  • Adding REFUNDING DeltaOrderStatus, Order.refunds field
  • changing /delta/v2 ti /v2/delta for consitency with /v2/quote

Note

High Risk
Renaming every Delta API base path is a breaking runtime change for any SDK version paired with the old route layout, and requiring refunds on DeltaAuction is a breaking TypeScript contract for mocks and parsers.

Overview
Breaking: All Delta HTTP clients now call /v2/delta/... instead of /delta/v2/... (orders build/post/cancel, prices, bridge routes, agents, token support), aligned with /v2/quote. Integrators must point at backends that expose the new paths.

Order API shape: DeltaAuction gains a required refunds array (BridgeRefundMetadata: tx, chainId, token, amount), exported from the package. REFUNDING is added to DeltaOrderStatus and treated as a terminal failure in OrderHelpers.checks.isFailedAuction.

Docs (CLAUDE.md) and Delta tests are updated for the new URLs. Unrelated test fixes: delta quote snapshots use the live API spender address; OTC viem signing uses a concrete taker address. OTC approveForOrder drops an unused import.

Reviewed by Cursor Bugbot for commit 81790c4. Bugbot is set up for automated code reviews on this repo. Configure here.

closes FRNT-1348

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

size-limit report 📦

Path Size
dist/sdk.cjs.production.min.js 16.66 KB (0%)
dist/sdk.esm.js 16.87 KB (0%)

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0044ff2. Configure here.

Comment thread src/methods/delta/types.ts

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Delta v2 SDK surface to match a new base routing convention (/v2/delta/... instead of /delta/v2/...) and extends the Delta order model to include refund tracking and a new in-progress refund status.

Changes:

  • Renames all Delta HTTP client endpoints from /delta/v2/... to /v2/delta/... across methods and tests.
  • Extends Delta order typings with Order.refunds (as BridgeRefundMetadata[]) and adds REFUNDING to DeltaOrderStatus.
  • Updates/refreshes unit tests and snapshots (viem signing snapshot + quote inline snapshots) to reflect new behavior/output.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/viem.test.ts Updates OTC signing test to use a concrete taker address and refreshes signature snapshot.
tests/quote.test.ts Replaces generic inline snapshots with explicit snapshots for Delta quote pricing.
tests/delta.test.ts Updates expected Delta endpoint paths to /v2/delta/... in fetch/build/submit/cancel tests.
tests/snapshots/viem.test.ts.snap Refreshes snapshot data impacted by the taker address/signature change.
src/methods/delta/types.ts Adds REFUNDING, introduces BridgeRefundMetadata, and adds refunds to DeltaAuction shape.
src/methods/delta/postTWAPDeltaOrder.ts Updates POST orders base URL to /v2/delta/orders.
src/methods/delta/postExternalDeltaOrder.ts Updates POST orders base URL to /v2/delta/orders.
src/methods/delta/postDeltaOrder.ts Updates POST orders base URL to /v2/delta/orders.
src/methods/delta/isTokenSupportedInDelta.ts Updates token support URL to /v2/delta/prices/is-token-supported.
src/methods/delta/getDeltaPrice.ts Updates prices URL to /v2/delta/prices.
src/methods/delta/getDeltaOrders.ts Updates orders base URL to /v2/delta/orders.
src/methods/delta/getBridgeRoutes.ts Updates bridge routes URL to /v2/delta/prices.
src/methods/delta/getAgentsList.ts Updates agents list URL to /v2/delta/agents/list/:chainId.
src/methods/delta/cancelDeltaOrder.ts Updates cancel URL to /v2/delta/orders/cancel.
src/methods/delta/buildTWAPDeltaOrder.ts Updates build URL to /v2/delta/orders/build.
src/methods/delta/buildExternalDeltaOrder.ts Updates build URL to /v2/delta/orders/build.
src/methods/delta/buildDeltaOrder.ts Updates build URL to /v2/delta/orders/build.
src/index.ts Exports BridgeRefundMetadata from the public SDK surface.
CLAUDE.md Updates narrative docs for new Delta base path (but still contains a few table rows that need path corrections).
Comments suppressed due to low confidence (2)

CLAUDE.md:114

  • Additional Delta module docs in this table still omit the /delta path segment (cancel, token support, agents list). These should match the new /v2/delta/... routing.
| `cancelDeltaOrder.ts` | `constructCancelDeltaOrder` | `signCancelDeltaOrderRequest` → `postCancelDeltaOrderRequest` → `cancelDeltaOrders` (orchestrator). POST `/v2/orders/cancel`. | No (`any`) |
| `getBridgeRoutes.ts` | `constructGetBridgeRoutes` | `getBridgeRoutes` (flat `BridgeRoute[]`) + `getBridgeProtocols` | No |
| `isTokenSupportedInDelta.ts` | `constructIsTokenSupportedInDelta` | GET `/v2/prices/is-token-supported` → `boolean` | No |
| `getAgentsList.ts` | `constructGetAgentsList` | GET `/v2/agents/list/:chainId` → `string[]` | No |

src/methods/delta/types.ts:202

  • This DeltaAuction doc block still references the old /v2/orders paths. Since Delta endpoints are now under /v2/delta/..., the comment should mention /v2/delta/orders... to avoid misleading consumers.
 *  union so that `order` narrows to the matching family (`OnChainOrderMap[T]`). */

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/methods/delta/types.ts
Comment thread src/methods/delta/types.ts
Comment thread CLAUDE.md
Comment thread tests/delta.test.ts Outdated
@linear

linear Bot commented Jun 15, 2026

Copy link
Copy Markdown

FRNT-1348

@andriy-shymkiv andriy-shymkiv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copilot is right about some semantics
Apart from that - good job!

Comment thread src/methods/delta/types.ts
Base automatically changed from feat/drop_legacy_LOrders to feat/delta-v2 June 16, 2026 14:30
@Velenir Velenir merged commit f2a295e into feat/delta-v2 Jun 16, 2026
1 of 2 checks passed
@Velenir Velenir deleted the chore/order_refund_field branch June 16, 2026 14:33
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.

3 participants