@@ -16,7 +16,9 @@ import type { GetTokensParams } from "@/types/utils/getTokens";
1616import type {
1717 PreparePermit2BatchDataParams ,
1818 PreparePermit2BatchDataResult ,
19- } from "@/types/utils/preparePermit2BatchData" ;
19+ PreparePermit2DataParams ,
20+ PreparePermit2DataResult ,
21+ } from "@/types/utils/permit2" ;
2022import { buildAddLiquidityCallData } from "@/utils/buildAddLiquidityCallData" ;
2123import { buildSwapCallData } from "@/utils/buildSwapCallData" ;
2224import { getPool } from "@/utils/getPool" ;
@@ -25,9 +27,10 @@ import { getPosition } from "@/utils/getPosition";
2527import { getQuote } from "@/utils/getQuote" ;
2628import { getTokens } from "@/utils/getTokens" ;
2729import { preparePermit2BatchData } from "@/utils/preparePermit2BatchData" ;
30+ import { preparePermit2Data } from "@/utils/preparePermit2Data" ;
2831import type { Currency } from "@uniswap/sdk-core" ;
2932import type { Pool , PoolKey } from "@uniswap/v4-sdk" ;
30- import type { Abi , Address , Hex , PublicClient } from "viem" ;
33+ import type { Abi , Address , PublicClient } from "viem" ;
3134import { http , createPublicClient } from "viem" ;
3235
3336/**
@@ -208,7 +211,7 @@ export class UniDevKitV4 {
208211 * @returns Promise resolving to swap call data including calldata and value
209212 * @throws Error if SDK instance is not found or if swap call data is invalid
210213 */
211- async buildSwapCallData ( params : BuildSwapCallDataParams ) : Promise < Hex > {
214+ async buildSwapCallData ( params : BuildSwapCallDataParams ) {
212215 return buildSwapCallData ( params , this . instance ) ;
213216 }
214217
@@ -236,4 +239,17 @@ export class UniDevKitV4 {
236239 ) : Promise < PreparePermit2BatchDataResult > {
237240 return preparePermit2BatchData ( params , this . instance ) ;
238241 }
242+
243+ /**
244+ * Prepares the permit2 simple data for a single token. (Used to swap)
245+ * Use toSign.values to sign the permit2 simple data.
246+ * @param params @type {PreparePermit2DataParams }
247+ * @returns Promise resolving to permit2 simple data
248+ * @throws Error if SDK instance is not found or if permit2 simple data is invalid
249+ */
250+ async preparePermit2Data (
251+ params : PreparePermit2DataParams ,
252+ ) : Promise < PreparePermit2DataResult > {
253+ return preparePermit2Data ( params , this . instance ) ;
254+ }
239255}
0 commit comments