Skip to content

Commit 98c372a

Browse files
committed
fix: getQuote separated types
1 parent 8307630 commit 98c372a

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

src/hooks/useGetQuote.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,7 @@
1+
import type { UseGetQuoteOptions } from "@/types/hooks/useGetQuote";
12
import type { QuoteParams, QuoteResponse } from "@/types/utils/getQuote";
23
import { getQuote } from "@/utils/getQuote";
3-
import { type UseQueryOptions, useQuery } from "@tanstack/react-query";
4-
5-
export type UseGetQuoteOptions = {
6-
/** Initial quote parameters */
7-
params?: QuoteParams;
8-
/** Chain ID to use */
9-
chainId?: number;
10-
/** React Query options */
11-
queryOptions?: Omit<
12-
UseQueryOptions<QuoteResponse, Error, QuoteResponse, unknown[]>,
13-
"queryKey"
14-
>;
15-
};
4+
import { useQuery } from "@tanstack/react-query";
165

176
/**
187
* React hook for fetching quotes from Uniswap V4 using React Query.
@@ -41,7 +30,6 @@ export type UseGetQuoteOptions = {
4130
* });
4231
* ```
4332
*/
44-
4533
function serializeParams(params?: QuoteParams) {
4634
if (!params) return undefined;
4735
return {

src/types/hooks/useGetQuote.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import type { QuoteParams, QuoteResponse } from "@/types/utils/getQuote";
2+
import type { UseQueryOptions } from "@tanstack/react-query";
3+
4+
/**
5+
* Configuration options for the useGetQuote hook.
6+
*/
7+
export type UseGetQuoteOptions = {
8+
/** Initial quote parameters */
9+
params?: QuoteParams;
10+
/** Chain ID to use */
11+
chainId?: number;
12+
/** React Query options */
13+
queryOptions?: Omit<
14+
UseQueryOptions<QuoteResponse, Error, QuoteResponse, unknown[]>,
15+
"queryKey"
16+
>;
17+
};

0 commit comments

Comments
 (0)