Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(router-sdk): add getter for amounts which returns native amounts in a trade #284

Merged
merged 15 commits into from
Feb 6, 2025

Conversation

zhongeric
Copy link
Contributor

@zhongeric zhongeric commented Jan 31, 2025

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

  • Router Trade object now supports multiple swaps where the inputAmount != pathInput, or the first currency in a swap / route
  • Also exposes a new getter amounts which returns the sum of native amounts in input/output

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]

@zhongeric zhongeric requested review from a team as code owners January 31, 2025 00:27
Copy link

graphite-app bot commented Jan 31, 2025

Graphite Automations

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

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

@zhongeric zhongeric marked this pull request as draft January 31, 2025 17:46
@zhongeric zhongeric marked this pull request as ready for review January 31, 2025 19:58
@snreynolds snreynolds self-requested a review February 3, 2025 23:52
sdks/router-sdk/src/entities/route.ts Outdated Show resolved Hide resolved
sdks/router-sdk/src/entities/trade.ts Show resolved Hide resolved
sdks/router-sdk/src/entities/trade.ts Show resolved Hide resolved
sdks/router-sdk/src/entities/trade.test.ts Show resolved Hide resolved
@zhongeric zhongeric merged commit 210d614 into main Feb 6, 2025
7 checks passed
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