Skip to content

Update check-pr-title.yaml#507

Closed
Dargon789 wants to merge 82 commits intoUniswap:kris/smartwallet-executeUserOpfrom
Dargon789:patch-1
Closed

Update check-pr-title.yaml#507
Dargon789 wants to merge 82 commits intoUniswap:kris/smartwallet-executeUserOpfrom
Dargon789:patch-1

Conversation

@Dargon789
Copy link
Copy Markdown

PR Scope

Please title your PR according to the following types and scopes following conventional commits:

  • fix(SDK name): will trigger a patch version
  • chore(<type>): will not trigger any release and should be used for internal repo changes
  • <type>(public): will trigger a patch version for non-code changes (e.g. README changes)
  • feat(SDK name): will trigger a minor version
  • feat(breaking): will trigger a major version for a breaking change

Description

[Summary of the change, motivation, and context]

How Has This Been Tested?

[e.g. Manually, E2E tests, unit tests, Storybook]

Are there any breaking changes?

[e.g. Type definitions, API definitions]

If there are breaking changes, please ensure you bump the major version Bump the major version (by using the title feat(breaking): ...), post a notice in #eng-sdks, and explicitly notify all Uniswap Labs consumers of the SDK.

(Optional) Feedback Focus

[Specific parts of this PR you'd like feedback on, or that reviewers should pay closer attention to]

(Optional) Follow Ups

[Things that weren't addressed in this PR, ways you plan to build on this work, or other ways this work could be extended]

@graphite-app graphite-app Bot requested review from a team February 1, 2026 04:32
@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented Feb 1, 2026

Graphite Automations

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

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

@socket-security
Copy link
Copy Markdown

socket-security Bot commented Feb 1, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​typescript-eslint/​parser@​2.34.0 ⏵ 8.58.210010071 -2898100
Updated@​typescript-eslint/​eslint-plugin@​2.34.0 ⏵ 8.58.299 +310080 -1998100
Updated@​nomicfoundation/​hardhat-network-helpers@​1.1.0 ⏵ 1.1.2100 +11008290 -3100
Updatedcommander@​14.0.2 ⏵ 14.0.398 +1100100 +187100
Added@​changesets/​cli@​2.30.09610010093100
Updatedviem@​2.38.4 ⏵ 2.48.098 -110010098 +1100

View full report

@socket-security
Copy link
Copy Markdown

socket-security Bot commented Apr 17, 2026

Caution

Review the following alerts detected in dependencies.

According to your organization's Security Policy, you must resolve all "Block" alerts before proceeding. It is recommended to resolve "Warn" alerts too. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Block Medium
Potential vulnerability: npm picomatch with risk level "medium"

Location: Package overview

From: ?npm/hardhat@2.28.6npm/@typescript-eslint/eslint-plugin@8.58.2npm/@typescript-eslint/parser@8.58.2npm/danger@11.2.6npm/eslint-config-react-app@7.0.1npm/@typescript-eslint/parser@5.62.0npm/eslint-plugin-functional@3.7.2npm/@uniswap/swap-router-contracts@1.3.1npm/picomatch@2.3.2

ℹ Read more on: This package | This alert | Navigating potential vulnerabilities

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: It is advisable to proceed with caution. Engage in a review of the package's security aspects and consider reaching out to the package maintainer for the latest information or patches.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/picomatch@2.3.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
System shell access: npm @changesets/cli in module child_process

Module: child_process

Location: Package overview

From: package.jsonnpm/@changesets/cli@2.30.0

ℹ Read more on: This package | This alert | What is shell access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should avoid accessing the shell which can reduce portability, and make it easier for malicious shell access to be introduced.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@changesets/cli@2.30.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Dynamic module loading: npm @changesets/cli

Location: Package overview

From: package.jsonnpm/@changesets/cli@2.30.0

ℹ Read more on: This package | This alert | What is dynamic require?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should avoid dynamic imports when possible. Audit the use of dynamic require to ensure it is not executing malicious or vulnerable code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@changesets/cli@2.30.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Filesystem access: npm @changesets/cli with module fs-extra

Module: fs-extra

Location: Package overview

From: package.jsonnpm/@changesets/cli@2.30.0

ℹ Read more on: This package | This alert | What is filesystem access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: If a package must read the file system, clarify what it will read and ensure it reads only what it claims to. If appropriate, packages can leave file system access to consumers and operate on data passed to it instead.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@changesets/cli@2.30.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Dynamic module loading: npm @eslint/config-array

Location: Package overview

From: ?npm/eslint-plugin-prettier@3.4.1npm/@eslint/config-array@0.23.5

ℹ Read more on: This package | This alert | What is dynamic require?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should avoid dynamic imports when possible. Audit the use of dynamic require to ensure it is not executing malicious or vulnerable code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@eslint/config-array@0.23.5. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Dynamic module loading: npm @eslint/eslintrc

Location: Package overview

From: ?npm/eslint-plugin-functional@3.7.2npm/@eslint/eslintrc@0.4.3

ℹ Read more on: This package | This alert | What is dynamic require?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should avoid dynamic imports when possible. Audit the use of dynamic require to ensure it is not executing malicious or vulnerable code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@eslint/eslintrc@0.4.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

cam-uni and others added 13 commits April 17, 2026 01:31
## Description

bump sdks in ur-sdk for xlayer

## How Has This Been Tested?

_[e.g. Manually, E2E tests, unit tests, Storybook]_

## Are there any breaking changes?

_[e.g. Type definitions, API definitions]_

If there are breaking changes, please ensure you bump the major version Bump the major version (by using the title `feat(breaking): ...`), post a notice in #eng-sdks, and explicitly notify all Uniswap Labs consumers of the SDK.

## (Optional) Feedback Focus

_[Specific parts of this PR you'd like feedback on, or that reviewers should pay closer attention to]_

## (Optional) Follow Ups

_[Things that weren't addressed in this PR, ways you plan to build on this work, or other ways this work could be extended]_

<!-- claude-pr-description-start -->
---
## ✨ Claude-Generated Content

## Description
Bumps SDK dependencies in universal-router-sdk and adds X-Layer chain configuration to enable X-Layer support. This follows the recent SDK version bumps (Uniswap#463, Uniswap#464, Uniswap#465, Uniswap#466) that added X-Layer support to the individual SDKs.
## Changes
- Updated `@uniswap/router-sdk` version in `sdks/universal-router-sdk/package.json` from `^2.1.0` to `^2.3.0`
- Updated `@uniswap/sdk-core` version from `^7.8.0` to `^7.10.0`
- Updated `@uniswap/v2-sdk` version from `^4.16.0` to `^4.17.0`
- Updated `@uniswap/v3-sdk` version from `^3.26.0` to `^3.27.0`
- Updated `@uniswap/v4-sdk` version from `^1.23.0` to `^1.24.0`
- Added X-Layer chain configuration (chain ID 196) in `constants.ts` with WETH address and Universal Router addresses for V1_2, V2_0, and V2_1
- Updated `yarn.lock` to reflect the new dependency versions
## How Has This Been Tested?
Will test in routing
## Are there any breaking changes?
No
<!-- claude-pr-description-end -->
…wap#471)

## Description

Revert Universal Router 2.1 support

## How Has This Been Tested?

_[e.g. Manually, E2E tests, unit tests, Storybook]_

## Are there any breaking changes?

_[e.g. Type definitions, API definitions]_

If there are breaking changes, please ensure you bump the major version Bump the major version (by using the title `feat(breaking): ...`), post a notice in #eng-sdks, and explicitly notify all Uniswap Labs consumers of the SDK.

## (Optional) Feedback Focus

_[Specific parts of this PR you'd like feedback on, or that reviewers should pay closer attention to]_

## (Optional) Follow Ups

_[Things that weren't addressed in this PR, ways you plan to build on this work, or other ways this work could be extended]_

<!-- claude-pr-description-start -->
---
## ✨ Claude-Generated Content

## Description
Reverts Universal Router 2.1 support that was added in PR Uniswap#442. This PR removes all v2.1-specific features to roll back to a v2.0-only state.
## Changes
- Removed `UniversalRouterVersion.V2_1` enum value and all v2.1 router addresses from chain configurations
- Deleted `src/utils/eip712.ts` (EIP712 signing utilities for signed route execution)
- Deleted `src/entities/actions/across.ts` (Across V4 bridge types)
- Removed `SignedRouteOptions`, `EIP712Payload` types and `getExecuteSignedPayload()`, `encodeExecuteSigned()` methods from `swapRouter.ts`
- Removed `maxHopSlippage` option from `SwapOptions` interface
- Removed `addAcrossBridge()` method and `ACROSS_V4_DEPOSIT_V3` command from `routerCommands.ts`
- Removed exports: `NONCE_SKIP_CHECK`, `generateNonce`, `EXECUTE_SIGNED_TYPES`, `getUniversalRouterDomain`
- Deleted unit tests for signed routes (`signedRoutes.test.ts`) and Across bridge (`across.test.ts`)
- Removed v2.1 documentation from README.md (per-hop slippage, signed routes, cross-chain bridging)
## How Has This Been Tested?
Unit tests updated to remove v2.1-specific test cases.
## Are there any breaking changes?
Yes - removes the following exports and functionality:
- `UniversalRouterVersion.V2_1`
- `SignedRouteOptions`, `EIP712Payload` types
- `NONCE_SKIP_CHECK`, `generateNonce`, `EXECUTE_SIGNED_TYPES`, `getUniversalRouterDomain` exports
- `SwapRouter.getExecuteSignedPayload()` and `SwapRouter.encodeExecuteSigned()` methods
- `AcrossV4DepositV3Params` type and `CONTRACT_BALANCE` from across module
- `maxHopSlippage` option in `SwapOptions`
- Bridge parameters in `SwapRouter.swapCallParameters()`
<!-- claude-pr-description-end -->
## PR Scope

Please title your PR according to the following types and scopes following [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/):

- `fix(SDK name):` will trigger a patch version
- `chore(<type>):` will not trigger any release and should be used for internal repo changes
- `<type>(public):` will trigger a patch version for non-code changes (e.g. README changes)
- `feat(SDK name):` will trigger a minor version
- `feat(breaking):` will trigger a major version for a breaking change

## Description

_[Summary of the change, motivation, and context]_

## How Has This Been Tested?

_[e.g. Manually, E2E tests, unit tests, Storybook]_

## Are there any breaking changes?

_[e.g. Type definitions, API definitions]_

If there are breaking changes, please ensure you bump the major version Bump the major version (by using the title `feat(breaking): ...`), post a notice in #eng-sdks, and explicitly notify all Uniswap Labs consumers of the SDK.

## (Optional) Feedback Focus

_[Specific parts of this PR you'd like feedback on, or that reviewers should pay closer attention to]_

## (Optional) Follow Ups

_[Things that weren't addressed in this PR, ways you plan to build on this work, or other ways this work could be extended]_

<!-- claude-pr-description-start -->
---
## ✨ Claude-Generated Content

## Description
Adds the Universal Router V2.0 deployment configuration for X-Layer (chain ID 196) by updating from placeholder values to the actual deployed contract address.
## Changes
- Updated X-Layer Universal Router V2.0 address from placeholder (`0x0000000000000000000000000000000000000000`) to deployed contract (`0x6bdbd02e751bca2c029cfc21098da04acce8d582`) in `sdks/universal-router-sdk/src/utils/constants.ts`
- Updated X-Layer Universal Router V2.0 creation block from `1` to `47680350`
## How Has This Been Tested?
Will be tested in routing pipeline.
## Are there any breaking changes?
No
<!-- claude-pr-description-end -->
thomasthachil and others added 28 commits April 17, 2026 01:31
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…tocol (Uniswap#539)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…swap#552)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: David Gilman <david.gilman@uniswap.org>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…#554)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
## Description

For maxHopSlippage, **a partial implementation exists for multi-hop V4-only routes in UR-sdk, but it is incorrect:**

1. Flat array on **`SwapOptions`** -- A single `maxHopSlippage?: BigNumber[]` on `SwapOptions` cannot correctly map values to specific routes in a split-route trade (e.g. 40% Route A with 3 hops, 60% Route B with 2 hops).
2. Mixed routes pass the full array -- In `addMixedSwap`, the entire `options.maxHopSlippage` array is passed to V4 sections without slicing; V2/V3 sections get nothing.



**We need to ensure that per-hop slippage is saved per** **_route_** **data model, not per** **_trade_** **(i.e. for split route trades)**

**This PR adds** `maxHopSlippage` **support to the** `Trade.swaps` **object in router-sdk, enabling per-hop slippage protection for multi-hop swaps across all route types (V2, V3, V4, and mixed routes)**

## How Has This Been Tested?

_[e.g. Manually, E2E tests, unit tests, Storybook]_

## Are there any breaking changes?


Purely additive, no breaking changes, no existing code uses the new field yet. Can merge independently.

## Follow Ups

- in order to be used in UR-sdk, need to publish minor version bump to router-sdk



<!-- claude-pr-description-start -->

---

## ✨ Claude-Generated Content

## Summary

Adds `maxHopSlippage` support to the `Trade` class in router-sdk, enabling per-hop slippage protection for multi-hop swaps across all route types (V2, V3, V4, and mixed routes).

## Changes

- Added optional `maxHopSlippage?: bigint[]` field to the `swaps` array type in `Trade` class
- Extended route input types for V2, V3, V4, and mixed routes to accept `maxHopSlippage` parameter
- Propagated `maxHopSlippage` through the constructor for all route types
- Extended `fromRoutes()` static method to pass `maxHopSlippage` through populated routes

## How Has This Been Tested?

This is a type extension.

## Are there any breaking changes?

No - `maxHopSlippage` is an optional parameter with no changes to existing behavior.

<!-- claude-pr-description-end -->
…hop ABI struct (Uniswap#530)

## Description

- Rename URVersion.V2_1 to `V2_1_1 `in v4-sdk
- Rename V4_SWAP_ACTIONS_V2_1 to `V4_SWAP_ACTIONS_V2_1_1` and update all references in v4Planner.ts

## How Has This Been Tested?

_[e.g. Manually, E2E tests, unit tests, Storybook]_

## Are there any breaking changes?

The version rename is breaking. (And it is intentionally breaking, as opposed to keeping v2.1 around, because v2.1.1 fixes a precision bug. Plus we don't actually use v2.1 in prod yet)

1. publish v4-sdk as major version
2. update UR-sdk and router-SDK

## (Optional) Feedback Focus

_[Specific parts of this PR you'd like feedback on, or that reviewers should pay closer attention to]_

## (Optional) Follow Ups

Need to explicitly update UR-sdk and router-SDK versions

<!-- claude-pr-description-start -->

---

## ✨ Claude-Generated Content

## Summary

Updates v4-sdk to use Universal Router version 2.1.1 instead of 2.1 by renaming version enums, ABI definitions, and struct types throughout the codebase. Adds V2.1.1-specific struct definitions for single-hop swap actions.

## Changes

- Renamed `URVersion.V2_1` to `URVersion.V2_1_1` in the `URVersion` enum
- Renamed `V4_SWAP_ACTIONS_V2_1` to `V4_SWAP_ACTIONS_V2_1_1` and expanded to include single-hop swap actions (`SWAP_EXACT_IN_SINGLE`, `SWAP_EXACT_OUT_SINGLE`)
- Added new V2.1.1 struct definitions with `maxHopSlippage` field:
    - `SWAP_EXACT_IN_SINGLE_STRUCT_V2_1_1`
    - `SWAP_EXACT_IN_STRUCT_V2_1_1`
    - `SWAP_EXACT_OUT_SINGLE_STRUCT_V2_1_1`
    - `SWAP_EXACT_OUT_STRUCT_V2_1_1`
- Renamed V2.0 single-hop structs to be explicit: `SWAP_EXACT_IN_SINGLE_STRUCT_V2_0`, `SWAP_EXACT_OUT_SINGLE_STRUCT_V2_0`
- Refactored `addTrade` method to use conditional spread operator for cleaner version-specific struct building
- Added validation that `maxHopSlippage` length matches `route.pools.length`
- Updated `v4BaseActionsParser.ts` to use the new version enum and ABI definitions
- Updated all comments referencing "V2.1" to "V2.1.1"
- Updated all test files to use `URVersion.V2_1_1`

## How Has This Been Tested?

Existing unit tests updated to use the new version constant.

## Are there any breaking changes?

Yes - this is a breaking change for consumers using `URVersion.V2_1` or `V4_SWAP_ACTIONS_V2_1`. They will need to update to `URVersion.V2_1_1` and `V4_SWAP_ACTIONS_V2_1_1` respectively.

<!-- claude-pr-description-end -->
…wap#531)

## Description



TODO : Need to explicitly update UR-sdk and router-SDK versions based on v4-sdk breaking changes

- Rename UniversalRouterVersion.V2_1 to V2_1_1 in constants.ts + update contract addresses
- Add V2.1.1 ABI definitions for V2/V3 swap commands in routerCommands.ts (the new V2V3_SWAP_COMMANDS_V2_1_1 map)
- Make addCommand/createCommand accept optional urVersion parameter for ABI selection

This is all infrastructure/plumbing. The new V2.1.1 ABI defs exist but nothing calls them yet. The version rename is technically breaking but no consumers use UR V2.1 from the SDK.

## How Has This Been Tested?

_[e.g. Manually, E2E tests, unit tests, Storybook]_

## Are there any breaking changes?

_[e.g. Type definitions, API definitions]_

If there are breaking changes, please ensure you bump the major version Bump the major version (by using the title `feat(breaking): ...`), post a notice in #eng-sdks, and explicitly notify all Uniswap Labs consumers of the SDK.

## (Optional) Feedback Focus

_[Specific parts of this PR you'd like feedback on, or that reviewers should pay closer attention to]_

## (Optional) Follow Ups

_[Things that weren't addressed in this PR, ways you plan to build on this work, or other ways this work could be extended]_

<!-- claude-pr-description-start -->

---

## ✨ Claude-Generated Content

## Summary

Renames `UniversalRouterVersion.V2_1` to `V2_1_1` and adds ABI infrastructure for V2.1.1 swap commands with `maxHopSlippage` support.

## Changes

- Renamed `UniversalRouterVersion.V2_1` to `V2_1_1` in `constants.ts` enum (version string `'2.1'` → `'2.1.1'`)
- Updated all chain configs (20+ chains) to use `[UniversalRouterVersion.V2_1_1]` key
- Added `V2V3_SWAP_COMMANDS_V2_1_1` ABI definitions for V2/V3 swap commands with extended `maxHopSlippage` parameter:
    - `V3_SWAP_EXACT_IN`
    - `V3_SWAP_EXACT_OUT`
    - `V2_SWAP_EXACT_IN`
    - `V2_SWAP_EXACT_OUT`
- Updated `addCommand()` and `createCommand()` to accept optional `urVersion` parameter for ABI selection
- Fixed comment typo in `Parser.V3Actions` case ("v4 swap data" → "v3 position data")

## How Has This Been Tested?

Infrastructure/plumbing changes only - the new V2.1.1 ABI definitions exist but are not yet called by any code paths.

## Are there any breaking changes?

The version enum rename from `V2_1` to `V2_1_1` is technically breaking, but per the design doc, no consumers currently use V2.1.

<!-- claude-pr-description-end -->
…p#532)

## Description

- Remove maxHopSlippage from SwapOptions
- Update Swap interface to carry maxHopSlippage (from trade.swaps)
- addV2Swap / addV3Swap: branch on urVersion to encode with or without maxHopSlippage
- addV4Swap: read maxHopSlippage from swap instead of options
- addMixedSwap: slice maxHopSlippage per section with hop offset tracking
- Tests for all protocol paths (V2, V3, V4, mixed) with and without per-hop slippage

## How Has This Been Tested?

_[e.g. Manually, E2E tests, unit tests, Storybook]_

## Are there any breaking changes?

If consumers want to use UR v2.1.1, they must update to this version of the UR-sdk.

<!-- claude-pr-description-start -->
---
## ✨ Claude-Generated Content

## Summary
Wire up per-hop slippage encoding for Universal Router v2.1.1 across all protocol versions (V2, V3, V4, and mixed routes). The `maxHopSlippage` parameter has been moved from `SwapOptions` to individual swaps, enabling granular slippage protection per route.
## Changes
### `sdks/universal-router-sdk/src/entities/actions/uniswap.ts`
- Removed `maxHopSlippage` from `SwapOptions` interface
- Added `maxHopSlippage?: bigint[]` to the `Swap` interface to carry per-hop slippage from trade.swaps
- `addV2Swap`: branches on `urVersion` to encode with/without `maxHopSlippage` for V2_SWAP_EXACT_IN and V2_SWAP_EXACT_OUT commands
- `addV3Swap`: branches on `urVersion` to encode with/without `maxHopSlippage` for V3_SWAP_EXACT_IN and V3_SWAP_EXACT_OUT commands
- `addV4Swap`: reads `maxHopSlippage` from the swap object instead of options
- `addMixedSwap`: tracks `hopOffset` to slice the flat `maxHopSlippage` array per protocol section
- Added validation to ensure `maxHopSlippage` length matches `route.pools.length`
### `sdks/universal-router-sdk/README.md`
- Updated per-hop slippage documentation to reflect new API where `maxHopSlippage` is specified on each route within `RouterTrade`
- Added mixed routes example showing how the SDK slices hop slippage by section
- Updated references from v2.1 to v2.1.1
### `sdks/universal-router-sdk/test/unit/perHopSlippage.test.ts` (new)
- Tests for V2_SWAP_EXACT_IN/OUT with maxHopSlippage (V2.1.1 ABI)
- Tests for V3_SWAP_EXACT_IN/OUT with maxHopSlippage (V2.1.1 ABI)
- Tests for empty maxHopSlippage arrays
- Backward compatibility tests (V2.0 ABI without maxHopSlippage)
- Mixed route slippage slicing tests
## How Has This Been Tested?
Unit tests covering all protocol paths (V2, V3, V4, mixed) with and without per-hop slippage encoding.
## Are there any breaking changes?
**Minor breaking change**: `maxHopSlippage` has been removed from `SwapOptions`. Consumers must now specify `maxHopSlippage` on individual routes within the `RouterTrade` constructor.
Migration:
```typescript
// Before (v2.1)
SwapRouter.swapCallParameters(trade, { maxHopSlippage: [...], urVersion: URVersion.V2_1 })
// After (v2.1.1)
const trade = new RouterTrade({
  v3Routes: [{ routev3, inputAmount, outputAmount, maxHopSlippage: [...] }],
  tradeType,
})
SwapRouter.swapCallParameters(trade, { urVersion: URVersion.V2_1_1 })
```
<!-- claude-pr-description-end -->
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Thomas Thachil <github@thomasthachil.com>
a changeset changelog update. will auto-bump + release SDKs once merged
…sion (Uniswap#565)

## Description

previously we were exporting URVersion from v4-sdk for the `urVersion` field in universal-router-sdk's `SwapOptions`. it's a strange import pattern, and also forces ur-sdk consumers to import v4-sdk just for the typing

we should use UniversalRouterVersion from universal-router-sdk.

## How Has This Been Tested?

ran tests

## Are there any breaking changes?

_[e.g. Type definitions, API definitions]_

If there are breaking changes, please ensure you bump the major version Bump the major version (by using the title `feat(breaking): ...`), post a notice in #eng-sdks, and explicitly notify all Uniswap Labs consumers of the SDK.
## PR Scope

Please title your PR according to the following types and scopes following [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/):

- `fix(SDK name):` will trigger a patch version
- `chore(<type>):` will not trigger any release and should be used for internal repo changes
- `<type>(public):` will trigger a patch version for non-code changes (e.g. README changes)
- `feat(SDK name):` will trigger a minor version
- `feat(breaking):` will trigger a major version for a breaking change

## Description

_[Summary of the change, motivation, and context]_

## How Has This Been Tested?

_[e.g. Manually, E2E tests, unit tests, Storybook]_

## Are there any breaking changes?

_[e.g. Type definitions, API definitions]_

If there are breaking changes, please ensure you bump the major version Bump the major version (by using the title `feat(breaking): ...`), post a notice in #eng-sdks, and explicitly notify all Uniswap Labs consumers of the SDK.

## (Optional) Feedback Focus

_[Specific parts of this PR you'd like feedback on, or that reviewers should pay closer attention to]_

## (Optional) Follow Ups

_[Things that weren't addressed in this PR, ways you plan to build on this work, or other ways this work could be extended]_
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…niswap#573)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.