Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
prettier fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongeric committed Mar 20, 2024
1 parent 31ef4c5 commit 265f327
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
9 changes: 8 additions & 1 deletion src/entities/protocols/uniswap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class UniswapTrade implements Command {
}

encode(planner: RoutePlanner, _config: TradeConfig): void {
if(this.options.payerIsUser === undefined) {
if (this.options.payerIsUser === undefined) {
// default to user as payer
Object.assign(this.options, { payerIsUser: true })
}
Expand Down Expand Up @@ -177,6 +177,13 @@ function addV2Swap<TInput extends Currency, TOutput extends Currency>(
tradeType
)

console.log(
'ur-sdk',
options.slippageTolerance.toFixed(),
options.slippageTolerance.isPercent,
options.slippageTolerance
)

if (tradeType == TradeType.EXACT_INPUT) {
planner.addCommand(CommandType.V2_SWAP_EXACT_IN, [
// if native, we have to unwrap so keep in the router for now
Expand Down
12 changes: 10 additions & 2 deletions src/utils/routerTradeAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,18 @@ export class RouterTradeAdapter {

return {
routev3: isOnlyV3
? new V3Route((subRoute as V3PoolInRoute[]).map(RouterTradeAdapter.toPool), parsedCurrencyIn, parsedCurrencyOut)
? new V3Route(
(subRoute as V3PoolInRoute[]).map(RouterTradeAdapter.toPool),
parsedCurrencyIn,
parsedCurrencyOut
)
: null,
routev2: isOnlyV2
? new V2Route((subRoute as V2PoolInRoute[]).map(RouterTradeAdapter.toPair), parsedCurrencyIn, parsedCurrencyOut)
? new V2Route(
(subRoute as V2PoolInRoute[]).map(RouterTradeAdapter.toPair),
parsedCurrencyIn,
parsedCurrencyOut
)
: null,
mixedRoute:
!isOnlyV3 && !isOnlyV2
Expand Down
2 changes: 1 addition & 1 deletion test/forge/interop.json
Original file line number Diff line number Diff line change
Expand Up @@ -247,4 +247,4 @@
"calldata": "0x24856bc30000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000030b000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000003eb3459f0ce6ae000b00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000042c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000bb8a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480001f46b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0000000000000000000000000000000000000000000000000000000000000000",
"value": "1000000000000000000"
}
}
}

0 comments on commit 265f327

Please sign in to comment.