diff --git a/sdks/v4-sdk/src/utils/v4BaseActionsParser.test.ts b/sdks/v4-sdk/src/utils/v4BaseActionsParser.test.ts index 78ca8f6a..b97f80aa 100644 --- a/sdks/v4-sdk/src/utils/v4BaseActionsParser.test.ts +++ b/sdks/v4-sdk/src/utils/v4BaseActionsParser.test.ts @@ -1,6 +1,6 @@ import { expect } from 'chai' import { WETH9 } from '@uniswap/sdk-core' -import { BigNumber, ethers } from 'ethers' +import { ethers } from 'ethers' import { Route } from '../entities/route' import { encodeRouteToPath } from './encodeRouteToPath' import { V4BaseActionsParser, V4RouterCall } from './v4BaseActionsParser' @@ -147,7 +147,6 @@ describe('Command Parser', () => { zeroForOne: true, amountIn: amount, amountOutMinimum: amount, - sqrtPriceLimitX96: 0, hookData: '0x', }, ]), @@ -164,7 +163,6 @@ describe('Command Parser', () => { zeroForOne: true, amountIn: amount, amountOutMinimum: amount, - sqrtPriceLimitX96: BigNumber.from(0), hookData: '0x', }, }, @@ -180,7 +178,6 @@ describe('Command Parser', () => { zeroForOne: true, amountOut: amount, amountInMaximum: amount, - sqrtPriceLimitX96: 0, hookData: '0x', }, ]), @@ -197,7 +194,6 @@ describe('Command Parser', () => { zeroForOne: true, amountOut: amount, amountInMaximum: amount, - sqrtPriceLimitX96: BigNumber.from(0), hookData: '0x', }, }, diff --git a/sdks/v4-sdk/src/utils/v4BaseActionsParser.ts b/sdks/v4-sdk/src/utils/v4BaseActionsParser.ts index eae284e6..caa3d761 100644 --- a/sdks/v4-sdk/src/utils/v4BaseActionsParser.ts +++ b/sdks/v4-sdk/src/utils/v4BaseActionsParser.ts @@ -23,7 +23,6 @@ export type SwapExactInSingle = { readonly zeroForOne: boolean readonly amountIn: string readonly amountOutMinimum: string - readonly sqrtPriceLimitX96: string readonly hookData: string } @@ -39,7 +38,6 @@ export type SwapExactOutSingle = { readonly zeroForOne: boolean readonly amountOut: string readonly amountInMaximum: string - readonly sqrtPriceLimitX96: string readonly hookData: string } @@ -146,7 +144,7 @@ function parsePathKey(data: string): PathKey { } function parseV4ExactInSingle(data: any[]): SwapExactInSingle { - const [poolKey, zeroForOne, amountIn, amountOutMinimum, sqrtPriceLimitX96, hookData] = data + const [poolKey, zeroForOne, amountIn, amountOutMinimum, hookData] = data const [currency0, currency1, fee, tickSpacing, hooks] = poolKey return { poolKey: { @@ -159,7 +157,6 @@ function parseV4ExactInSingle(data: any[]): SwapExactInSingle { zeroForOne, amountIn, amountOutMinimum, - sqrtPriceLimitX96, hookData, } } @@ -177,7 +174,7 @@ function parseV4ExactIn(data: any[]): SwapExactIn { } function parseV4ExactOutSingle(data: any[]): SwapExactOutSingle { - const [poolKey, zeroForOne, amountOut, amountInMaximum, sqrtPriceLimitX96, hookData] = data + const [poolKey, zeroForOne, amountOut, amountInMaximum, hookData] = data const { currency0, currency1, fee, tickSpacing, hooks } = poolKey return { @@ -191,7 +188,6 @@ function parseV4ExactOutSingle(data: any[]): SwapExactOutSingle { zeroForOne, amountOut, amountInMaximum, - sqrtPriceLimitX96, hookData, } } diff --git a/sdks/v4-sdk/src/utils/v4Planner.test.ts b/sdks/v4-sdk/src/utils/v4Planner.test.ts index bdc4264a..d467415e 100644 --- a/sdks/v4-sdk/src/utils/v4Planner.test.ts +++ b/sdks/v4-sdk/src/utils/v4Planner.test.ts @@ -76,14 +76,13 @@ describe('RouterPlanner', () => { zeroForOne: true, amountIn: ONE_ETHER_BN, amountOutMinimum: ONE_ETHER_BN.div(2), - sqrtPriceLimitX96: 0, hookData: '0x', }, ]) expect(planner.actions).toEqual('0x06') expect(planner.params[0]).toEqual( - '0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000bb8000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000006f05b59d3b20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000' + '0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000bb8000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000006f05b59d3b2000000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000000' ) }) }) diff --git a/sdks/v4-sdk/src/utils/v4Planner.ts b/sdks/v4-sdk/src/utils/v4Planner.ts index bd75bf35..4e2e7ddd 100644 --- a/sdks/v4-sdk/src/utils/v4Planner.ts +++ b/sdks/v4-sdk/src/utils/v4Planner.ts @@ -68,17 +68,13 @@ const POOL_KEY_STRUCT = '(address currency0,address currency1,uint24 fee,int24 t const PATH_KEY_STRUCT = '(address intermediateCurrency,uint256 fee,int24 tickSpacing,address hooks,bytes hookData)' const SWAP_EXACT_IN_SINGLE_STRUCT = - '(' + - POOL_KEY_STRUCT + - ' poolKey,bool zeroForOne,uint128 amountIn,uint128 amountOutMinimum,uint160 sqrtPriceLimitX96,bytes hookData)' + '(' + POOL_KEY_STRUCT + ' poolKey,bool zeroForOne,uint128 amountIn,uint128 amountOutMinimum,bytes hookData)' const SWAP_EXACT_IN_STRUCT = '(address currencyIn,' + PATH_KEY_STRUCT + '[] path,uint128 amountIn,uint128 amountOutMinimum)' const SWAP_EXACT_OUT_SINGLE_STRUCT = - '(' + - POOL_KEY_STRUCT + - ' poolKey,bool zeroForOne,uint128 amountOut,uint128 amountInMaximum,uint160 sqrtPriceLimitX96,bytes hookData)' + '(' + POOL_KEY_STRUCT + ' poolKey,bool zeroForOne,uint128 amountOut,uint128 amountInMaximum,bytes hookData)' const SWAP_EXACT_OUT_STRUCT = '(address currencyOut,' + PATH_KEY_STRUCT + '[] path,uint128 amountOut,uint128 amountInMaximum)'