@@ -5,7 +5,6 @@ import { useEffect, useState } from "react";
5
5
import { useCreateAuction , useCreateListing } from "@ark-project/react" ;
6
6
import { zodResolver } from "@hookform/resolvers/zod" ;
7
7
import { useAccount } from "@starknet-react/core" ;
8
- import { useQuery } from "@tanstack/react-query" ;
9
8
import moment from "moment" ;
10
9
import { useForm } from "react-hook-form" ;
11
10
import { formatEther , parseEther } from "viem" ;
@@ -46,11 +45,12 @@ import { env } from "~/env";
46
45
import usePrices from "~/hooks/usePrices" ;
47
46
import useTokenMarketdata from "~/hooks/useTokenMarketData" ;
48
47
import formatAmount from "~/lib/formatAmount" ;
49
- import getCollection from "~/lib/getCollection" ;
50
48
import ToastExecutedTransactionContent from "./toast-executed-transaction-content" ;
51
49
import ToastRejectedTransactionContent from "./toast-rejected-transaction-content" ;
52
50
import TokenActionsTokenOverview from "./token-actions-token-overview" ;
53
51
52
+ import useCollection from "~/hooks/useCollection" ;
53
+
54
54
interface TokenActionsCreateListingProps {
55
55
token : Token | WalletToken ;
56
56
small ?: boolean ;
@@ -69,14 +69,7 @@ export function TokenActionsCreateListing({
69
69
} ) ;
70
70
const [ isOpen , setIsOpen ] = useState ( false ) ;
71
71
const [ isAuction , setIsAuction ] = useState ( false ) ;
72
- const { data : collection } = useQuery ( {
73
- queryKey : [ "collection" , token . collection_address ] ,
74
- queryFn : ( ) =>
75
- getCollection ( {
76
- collectionAddress : token . collection_address ,
77
- } ) ,
78
- refetchInterval : 5_000 ,
79
- } ) ;
72
+ const { data : collection } = useCollection ( { address :token . collection_address } )
80
73
const { createListing, status } = useCreateListing ( ) ;
81
74
const { create : createAuction , status : auctionStatus } = useCreateAuction ( ) ;
82
75
const { toast } = useToast ( ) ;
0 commit comments