Skip to content

Commit

Permalink
progress / builds
Browse files Browse the repository at this point in the history
  • Loading branch information
ewilz committed Sep 12, 2024
1 parent ec9896e commit 0128be2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions sdks/universal-router-sdk/src/entities/actions/uniswap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,22 @@ function addV3Swap<TInput extends Currency, TOutput extends Currency>(
}
}

function addV4Swap<Tnput extends Currency, TOutput extends Currency>(): void {
function addV4Swap<Tnput extends Currency, TOutput extends Currency>(
planner: RoutePlanner,
{ route, inputAmount, outputAmount }: Swap<TInput, TOutput>,
tradeType: TradeType,
options: SwapOptions,
payerIsUser: boolean,
routerMustCustody: boolean
): void {
const trade = V4Trade.createUncheckedTrade({
route: route as RouteV4<TInput, TOutput>,
inputAmount,
outputAmount,
tradeType,
})

const v4Calldata = new V4Planner().addTrade(trade, routerMustCustody ? 0 : ).finalize()
const v4Calldata = new V4Planner().addTrade(trade, routerMustCustody ? 0 : options.slippageTolerance).finalize()
planner.addCommand(CommandType.V4_SWAP, [v4Calldata])
}

Expand Down

0 comments on commit 0128be2

Please sign in to comment.