feat(ur-sdk): PAY_PORTION_FULL_PRECISION support#528
Conversation
269c7cc to
42a18c5
Compare
42a18c5 to
f5ae63a
Compare
🤖 Claude Code Review
SummaryThis PR adds support for Changes ReviewedCore Logic (
Fee Encoding (
Command Definitions (
Tests (
Verification of Existing CommentsAll previously raised concerns have been addressed:
No Issues FoundThe implementation is correct and handles backward compatibility properly. V2_0 consumers will continue to receive 💡 Want a fresh review? Add a comment containing |
There was a problem hiding this comment.
📋 Review verdict: APPROVE
👆 The main review comment above is the source of truth for this PR review. It is automatically updated on each review cycle, so always refer to it for the most current feedback.
This formal review submission is for the verdict only.
Graphite Automations"Request reviewers once CI passes on sdks monorepo" took an action on this PR • (03/20/26)3 reviewers were added and 1 assignee was added to this PR based on Siyu Jiang (See-You John)'s automation. |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
kristiehuang
left a comment
There was a problem hiding this comment.
some comments/questions
| TradeType.EXACT_INPUT | ||
| ) | ||
| const feeOptions: FeeOptions = { fee: new Percent(5, 100), recipient: TEST_FEE_RECIPIENT_ADDRESS } | ||
| const opts = swapOptions({ fee: feeOptions, urVersion: URVersion.V2_1 }) |
There was a problem hiding this comment.
this will fail to compile -- deprecated 2.1 entirely, this enum value doesn't exist. only 2.0 and 2.1.1
There was a problem hiding this comment.
actually wait how did it pass typecheck lol
Superseded by new review after PR update
There was a problem hiding this comment.
📋 Review verdict: APPROVE
👆 The main review comment above is the source of truth for this PR review. It is automatically updated on each review cycle, so always refer to it for the most current feedback.
This formal review submission is for the verdict only.
There was a problem hiding this comment.
📋 Review verdict: APPROVE
👆 The main review comment above is the source of truth for this PR review. It is automatically updated on each review cycle, so always refer to it for the most current feedback.
This formal review submission is for the verdict only.

PR Scope
Please title your PR according to the following types and scopes following conventional commits:
fix(SDK name):will trigger a patch versionchore(<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 versionfeat(breaking):will trigger a major version for a breaking changeDescription
[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-Generated Content
Summary
PAY_PORTION_FULL_PRECISIONcommand (0x07) support for higher precision fee calculations using 1e18 scale instead of basis points (1e4)Changes
sdks/universal-router-sdk/src/utils/routerCommands.tsPAY_PORTION_FULL_PRECISIONcommand type (0x07) withportionparameter (1e18 scale)sdks/universal-router-sdk/src/utils/numbers.tsencodeFee1e18()function to encode fees with 18 decimal precisionsdks/universal-router-sdk/src/entities/actions/uniswap.tsUniswapTrade.encode()to usePAY_PORTION_FULL_PRECISIONwhenurVersion >= V2_1_1PAY_PORTION(bips) for older router versionssdks/universal-router-sdk/test/utils/commandParser.test.tsPAY_PORTION_FULL_PRECISIONcommand parsingsdks/universal-router-sdk/test/utils/feeEncoding.test.ts(new)encodeFeeBips()andencodeFee1e18()functionsAre there any breaking changes?
No — the external API (
options.fee) remains unchanged. The new command is only used whenurVersion >= V2_1_1, maintaining backward compatibility with older router versions.