diff --git a/apps/arkmarket/README.md b/apps/arkmarket/README.md index 437b0b8e..5b67297b 100644 --- a/apps/arkmarket/README.md +++ b/apps/arkmarket/README.md @@ -9,8 +9,6 @@ We try to keep this project as simple as possible, so you can start with just th If you are not familiar with the different technologies used in this project, please refer to the respective docs. If you still are in the wind, please join our [Discord](https://t3.gg/discord) and ask for help. - [Next.js](https://nextjs.org) -- [NextAuth.js](https://next-auth.js.org) -- [Drizzle](https://orm.drizzle.team) - [Tailwind CSS](https://tailwindcss.com) - [tRPC](https://trpc.io) diff --git a/apps/arkmarket/package.json b/apps/arkmarket/package.json index 5dc66feb..b786f69d 100644 --- a/apps/arkmarket/package.json +++ b/apps/arkmarket/package.json @@ -18,18 +18,15 @@ }, "dependencies": { "@ark-market/ui": "workspace:*", - "@ark-project/core": "^2.1.1", - "@ark-project/react": "^1.1.1", + "@ark-project/core": "3.0.0-beta.2", + "@ark-project/react": "2.0.0-beta.4", "@hookform/error-message": "^2.0.1", "@starknet-react/chains": "^0.1.7", "@starknet-react/core": "^2.0.0", "@t3-oss/env-nextjs": "^0.11.1", - "@tanstack/react-query": "catalog:", + "@tanstack/react-query": "5.55.4", "@tanstack/react-table": "^8.15.3", "@tanstack/react-virtual": "^3.5.0", - "@trpc/client": "catalog:", - "@trpc/react-query": "catalog:", - "@trpc/server": "catalog:", "@vercel/speed-insights": "^1.0.10", "blockies-ts": "^1.0.0", "embla-carousel-wheel-gestures": "^8.0.1", @@ -75,4 +72,4 @@ "vitest": "^2.1.2" }, "prettier": "@ark-market/prettier-config" -} +} \ No newline at end of file diff --git a/apps/arkmarket/src/app/collection/[collectionAddress]/components/collection-items-buy-now.tsx b/apps/arkmarket/src/app/collection/[collectionAddress]/components/collection-items-buy-now.tsx index f7920318..56dc068f 100644 --- a/apps/arkmarket/src/app/collection/[collectionAddress]/components/collection-items-buy-now.tsx +++ b/apps/arkmarket/src/app/collection/[collectionAddress]/components/collection-items-buy-now.tsx @@ -30,7 +30,7 @@ export default function CollectionItemsBuyNow({ token, }: CollectionItemsBuyNowProps) { const [isOpen, setIsOpen] = useState(false); - const { fulfillListing, status } = useFulfillListing(); + const { fulfillListingAsync, status } = useFulfillListing(); const { account, address } = useAccount(); const { data } = useBalance({ address, token: ETH }); const { toast } = useToast(); @@ -38,6 +38,14 @@ export default function CollectionItemsBuyNow({ const queryClient = useQueryClient(); const buy = async () => { + if (!account) { + toast({ + variant: "canceled", + title: "Error", + description: "Please connect your wallet before Buying", + }); + return; + } let tokenMarketData: TokenMarketData | undefined; try { @@ -67,15 +75,20 @@ export default function CollectionItemsBuyNow({ return; } + if (!tokenMarketData.listing.start_amount) { + sonner.error("Token is not for sale"); + return; + } + setIsOpen(true); - await fulfillListing({ - starknetAccount: account, - brokerId: env.NEXT_PUBLIC_BROKER_ID, + await fulfillListingAsync({ + account: account, + brokerAddress: env.NEXT_PUBLIC_BROKER_ID, tokenAddress: token.collection_address, - tokenId: token.token_id, - orderHash: tokenMarketData.listing.order_hash, - startAmount: tokenMarketData.listing.start_amount, + tokenId: BigInt(token.token_id), + orderHash: BigInt(tokenMarketData.listing.order_hash), + amount: BigInt(tokenMarketData.listing.start_amount), }); }; @@ -137,17 +150,14 @@ export default function CollectionItemsBuyNow({