Skip to content

feat(universal-router-sdk): export encodeSwapStep from the package root - #653

Open
claude[bot] wants to merge 1 commit into
mainfrom
export-encode-swap-step
Open

feat(universal-router-sdk): export encodeSwapStep from the package root#653
claude[bot] wants to merge 1 commit into
mainfrom
export-encode-swap-step

Conversation

@claude

@claude claude Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Requested by Mark Toda · Slack thread

Description

Before: encodeSwapStep (per-step SwapStep → RoutePlanner command encoding) exists in the build (utils/encodeSwapStep) but is not re-exported, and package.json exports maps only "." — so consumers that need per-step {commands, inputs} without the SwapRouter.encodeSwaps envelope (Permit2 ingress + fee + final SWEEP) must vendor a copy of the function.

After: encodeSwapStep is re-exported from the package root with a doc comment noting it writes into a caller-owned RoutePlanner and applies no ingress/settlement. No new code or semantics — a one-line export.

Consumer: Uniswap/backend#10604 (BalanceSwapProxy quotes) builds a raw {commands, inputs} Universal Router plan from router-provided SwapStep[] and currently carries a vendored copy of this function pending this export.

Changeset: minor bump for @uniswap/universal-router-sdk.

How Has This Been Tested?

  • New export-surface unit test (test/unit/exports.test.ts): root re-export identity + a standalone one-step encode sanity check.
  • turbo run build --filter=@uniswap/universal-router-sdk clean; hardhat unit suite 370 passing (the pre-existing uniswapTrades mainnet-fork suite requires FORK_URL and is unavailable in this environment).

Are there any breaking changes?

No — additive export only.

🤖 Generated with Claude Code

https://claude.ai/code/session_019fVKXDjny28BtvNdeHLSZY


Generated by Claude Code

Consumers composing per-step {commands, inputs} plans (e.g. Uniswap/backend#10604's
BalanceSwapProxy plan builder) previously had to vendor the function; it existed in
the build but was not re-exported. Adds a root re-export with a doc comment, an
export-surface unit test, and a minor changeset.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019fVKXDjny28BtvNdeHLSZY
@claude
claude Bot requested a review from a team as a code owner July 19, 2026 17:53
@github-actions

github-actions Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

● Reviewed · against ca5243a · 2026-07-19 17:55 UTC · view run ↗

Note

Approved.

Re-exports the existing encodeSwapStep from the universal-router-sdk root, with a colocated test asserting re-export identity plus a one-step encode, and a minor changeset.

Tip

Teach the reviewer. React 👍 on findings that helped, 👎 on false positives. Reply to push back or add context — we aggregate this weekly to tune the bot.

Comment @request-claude-review to re-run.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note

Approved — see full review in the sticky comment ↑

@graphite-app
graphite-app Bot requested review from a team July 19, 2026 17:57
@graphite-app

graphite-app Bot commented Jul 19, 2026

Copy link
Copy Markdown

Graphite Automations

"Request reviewers once CI passes on sdks monorepo" took an action on this PR • (07/19/26)

3 reviewers were added to this PR based on Siyu Jiang (See-You John)'s automation.

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