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

fix(universal-router-sdk): handles all ETH/WETH transitions #157

Merged
merged 27 commits into from
Nov 19, 2024
Merged

Conversation

ewilz
Copy link
Member

@ewilz ewilz commented Oct 8, 2024

now enables:

  • unwrap WETH to ETH before trading on Uniswap
  • wrap ETH output to WETH
  • exactOutput can trade ETH and get refund

@ewilz ewilz requested review from jsy1218, dannythedawger, cgkol and a team as code owners October 8, 2024 21:02
@ewilz ewilz requested a review from a team as a code owner October 10, 2024 20:18
@ewilz ewilz changed the title universal-router-sdk handles ETH output fee fix(universal-router-sdk): handles all ETH/WETH transitions Oct 14, 2024
Copy link

graphite-app bot commented Oct 15, 2024

Graphite Automations

"Request reviewers once CI passes on sdks monorepo" took an action on this PR • (10/15/24)

1 reviewer was added and 1 assignee was added to this PR based on 's automation.

@@ -65,8 +65,7 @@ export class UniswapTrade implements Command {

constructor(public trade: RouterTrade<Currency, Currency, TradeType>, public options: SwapOptions) {
if (!!options.fee && !!options.flatFee) throw new Error('Only one fee option permitted')
if (this.inputRequiresWrap) this.payerIsUser = false
else if (this.options.useRouterBalance) this.payerIsUser = false
if (this.inputRequiresWrap || this.inputRequiresUnwrap || this.options.useRouterBalance) this.payerIsUser = false
Copy link
Contributor

Choose a reason for hiding this comment

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

could just be done using a this.payerIsUser = () ? false : true might be clearer?

Copy link
Member Author

Choose a reason for hiding this comment

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

linting on this is ugly IMO but could be done...

Copy link
Contributor

Choose a reason for hiding this comment

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

ok fair

sdks/universal-router-sdk/test/uniswapTrades.test.ts Outdated Show resolved Hide resolved
sdks/universal-router-sdk/test/uniswapTrades.test.ts Outdated Show resolved Hide resolved
sdks/universal-router-sdk/test/uniswapTrades.test.ts Outdated Show resolved Hide resolved
@ewilz ewilz merged commit 5a00420 into main Nov 19, 2024
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