From 16364028bc7dc4c67d67a976ee1e5164926168b5 Mon Sep 17 00:00:00 2001 From: kwiss Date: Sat, 12 Oct 2024 00:11:30 +0200 Subject: [PATCH 1/8] chore(sdk): update ark package to use next beta --- apps/arkmarket/package.json | 4 ++-- pnpm-lock.yaml | 46 +++++++++++++++++++++++++------------ 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/apps/arkmarket/package.json b/apps/arkmarket/package.json index 5dc66feb..487856d5 100644 --- a/apps/arkmarket/package.json +++ b/apps/arkmarket/package.json @@ -18,8 +18,8 @@ }, "dependencies": { "@ark-market/ui": "workspace:*", - "@ark-project/core": "^2.1.1", - "@ark-project/react": "^1.1.1", + "@ark-project/core": "3.0.0-beta.1", + "@ark-project/react": "2.0.0-beta.1", "@hookform/error-message": "^2.0.1", "@starknet-react/chains": "^0.1.7", "@starknet-react/core": "^2.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 99349618..fbf4bcc0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -82,11 +82,11 @@ importers: specifier: workspace:* version: link:../../packages/ui '@ark-project/core': - specifier: ^2.1.1 - version: 2.1.1(typescript@5.5.4)(viem@2.17.3(typescript@5.5.4)(zod@3.23.8)) + specifier: 3.0.0-beta.1 + version: 3.0.0-beta.1(typescript@5.5.4)(viem@2.17.3(typescript@5.5.4)(zod@3.23.8)) '@ark-project/react': - specifier: ^1.1.1 - version: 1.1.1(typescript@5.5.4)(viem@2.17.3(typescript@5.5.4)(zod@3.23.8)) + specifier: 2.0.0-beta.1 + version: 2.0.0-beta.1(typescript@5.5.4)(viem@2.17.3(typescript@5.5.4)(zod@3.23.8)) '@hookform/error-message': specifier: ^2.0.1 version: 2.0.1(react-dom@18.3.1(react@18.3.1))(react-hook-form@7.52.1(react@18.3.1))(react@18.3.1) @@ -397,7 +397,7 @@ importers: version: 7.35.0(eslint@9.9.1(jiti@1.21.6)) eslint-plugin-react-hooks: specifier: rc - version: 5.1.0-rc-459fd418-20241001(eslint@9.9.1(jiti@1.21.6)) + version: 5.1.0-rc-09111202-20241011(eslint@9.9.1(jiti@1.21.6)) eslint-plugin-turbo: specifier: ^2.0.13 version: 2.1.0(eslint@9.9.1(jiti@1.21.6)) @@ -494,8 +494,8 @@ packages: resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} - '@ark-project/core@2.1.1': - resolution: {integrity: sha512-qA4eYtRrHgJlE5SdhbJxIQsRDcHZ46wdt/+61GfprmEAfT3LZTW1nzZW/nnI7/Bmvcj6uHgsQQjnkBLSHGS6iQ==} + '@ark-project/core@3.0.0-beta.1': + resolution: {integrity: sha512-KqisqFQxYHFq5cdnRy8dz/RjHiqFXUTuOx/gkn1iRBKP1gcrUvBQYJZaZIXl8xSIhI2lhI+/6Boa+JFv50MHIw==} peerDependencies: typescript: '>=5.0.4' viem: '>=0.3.35' @@ -503,8 +503,8 @@ packages: typescript: optional: true - '@ark-project/react@1.1.1': - resolution: {integrity: sha512-YCN0+9RexyDjgidEqv6hnoVeVmKPqqYFWKEZTg19jx/t+JmvminACbUHqWWjArMjbCYbe/v/fYLA1+GsaOWpAA==} + '@ark-project/react@2.0.0-beta.1': + resolution: {integrity: sha512-PwkiiTWJmKcvrpo6yiA5IjGAP7fKITTUnT/ihzlpuKpp/7lw/bsRn6h2n3gsjG7fRtTW76x3Pt7iyDgRVTposg==} '@babel/code-frame@7.24.7': resolution: {integrity: sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==} @@ -2051,11 +2051,19 @@ packages: '@tanstack/query-core@5.53.3': resolution: {integrity: sha512-ZfjAgd7NpqDx0e4aYBt7EmS2enbulPrJwowTy+mayRE93WUUH+sIYHun1TdRjpGwDPMNNZ5D6goh7n3CwoO+HA==} + '@tanstack/query-core@5.59.10': + resolution: {integrity: sha512-XxvnKeBWqDTHstyjA1qmSD5VS/FZ2g/qYvPMhFM7IZF0JnMqMxtzbiUkiTFaZ4YZo/Q84LS0hZi0UncKJ3vIhg==} + '@tanstack/react-query@5.53.3': resolution: {integrity: sha512-286mN/91CeM7vC6CZFLKYDHSw+WyMX6ekIvzoTbpM4xyPb99VSyCKPLyPgaOatKqYm6ooMBquSq9NGRdKgsJfg==} peerDependencies: react: ^18 || ^19 + '@tanstack/react-query@5.59.11': + resolution: {integrity: sha512-m5I4+4NHy6p0uzKLiq30EdRGk37CHHjXJsfMT0bty/Z/aO11LgXUgDBCq/xma4eO5RlV95sFVmi2QB9nVaLlxg==} + peerDependencies: + react: ^18 || ^19 + '@tanstack/react-table@8.19.2': resolution: {integrity: sha512-itoSIAkA/Vsg+bjY23FSemcTyPhc5/1YjYyaMsr9QSH/cdbZnQxHVWrpWn0Sp2BWN71qkzR7e5ye8WuMmwyOjg==} engines: {node: '>=12'} @@ -3184,8 +3192,8 @@ packages: peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 - eslint-plugin-react-hooks@5.1.0-rc-459fd418-20241001: - resolution: {integrity: sha512-vBUzji1JDwLxFAsmVtdbWQBo6LMnN7J2ZpDrGWo/ve4NnJGDeNFQOGqMJM1j0uDzLC1/sgQcFEOHofb8BsvJUQ==} + eslint-plugin-react-hooks@5.1.0-rc-09111202-20241011: + resolution: {integrity: sha512-HLdP3Qpr9KUckSEhxwWHqpXGJYKlZV+P9gqdOwPa45Ka3qhY1kuflvtwRMMA9dd7p8AL/lRLU3UUfNcDVh5DGw==} engines: {node: '>=10'} peerDependencies: eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 @@ -5731,7 +5739,7 @@ snapshots: '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 - '@ark-project/core@2.1.1(typescript@5.5.4)(viem@2.17.3(typescript@5.5.4)(zod@3.23.8))': + '@ark-project/core@3.0.0-beta.1(typescript@5.5.4)(viem@2.17.3(typescript@5.5.4)(zod@3.23.8))': dependencies: '@scure/starknet': 0.3.0 starknet: 6.11.0 @@ -5741,11 +5749,12 @@ snapshots: transitivePeerDependencies: - encoding - '@ark-project/react@1.1.1(typescript@5.5.4)(viem@2.17.3(typescript@5.5.4)(zod@3.23.8))': + '@ark-project/react@2.0.0-beta.1(typescript@5.5.4)(viem@2.17.3(typescript@5.5.4)(zod@3.23.8))': dependencies: - '@ark-project/core': 2.1.1(typescript@5.5.4)(viem@2.17.3(typescript@5.5.4)(zod@3.23.8)) + '@ark-project/core': 3.0.0-beta.1(typescript@5.5.4)(viem@2.17.3(typescript@5.5.4)(zod@3.23.8)) '@starknet-react/chains': 0.1.7 '@starknet-react/core': 2.8.3(get-starknet-core@3.3.2(starknet@6.11.0))(react@18.3.1)(starknet@6.11.0) + '@tanstack/react-query': 5.59.11(react@18.3.1) get-starknet-core: 3.3.2(starknet@6.11.0) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -7325,11 +7334,18 @@ snapshots: '@tanstack/query-core@5.53.3': {} + '@tanstack/query-core@5.59.10': {} + '@tanstack/react-query@5.53.3(react@18.3.1)': dependencies: '@tanstack/query-core': 5.53.3 react: 18.3.1 + '@tanstack/react-query@5.59.11(react@18.3.1)': + dependencies: + '@tanstack/query-core': 5.59.10 + react: 18.3.1 + '@tanstack/react-table@8.19.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@tanstack/table-core': 8.19.2 @@ -8801,7 +8817,7 @@ snapshots: safe-regex-test: 1.0.3 string.prototype.includes: 2.0.0 - eslint-plugin-react-hooks@5.1.0-rc-459fd418-20241001(eslint@9.9.1(jiti@1.21.6)): + eslint-plugin-react-hooks@5.1.0-rc-09111202-20241011(eslint@9.9.1(jiti@1.21.6)): dependencies: eslint: 9.9.1(jiti@1.21.6) From d694ec1ac23ccb632cd56ac8e1920e172eb66cdb Mon Sep 17 00:00:00 2001 From: kwiss Date: Mon, 14 Oct 2024 15:32:15 +0200 Subject: [PATCH 2/8] chore: update packages --- apps/arkmarket/package.json | 2 +- apps/arkmarket/src/env.ts | 2 -- apps/arkmarket/src/lib/getSystemStatus.ts | 2 +- pnpm-lock.yaml | 18 +++++++++--------- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/apps/arkmarket/package.json b/apps/arkmarket/package.json index 487856d5..11b78180 100644 --- a/apps/arkmarket/package.json +++ b/apps/arkmarket/package.json @@ -19,7 +19,7 @@ "dependencies": { "@ark-market/ui": "workspace:*", "@ark-project/core": "3.0.0-beta.1", - "@ark-project/react": "2.0.0-beta.1", + "@ark-project/react": "2.0.0-beta.2", "@hookform/error-message": "^2.0.1", "@starknet-react/chains": "^0.1.7", "@starknet-react/core": "^2.0.0", diff --git a/apps/arkmarket/src/env.ts b/apps/arkmarket/src/env.ts index 8039e02b..bdfce81a 100644 --- a/apps/arkmarket/src/env.ts +++ b/apps/arkmarket/src/env.ts @@ -19,7 +19,6 @@ export const env = createEnv({ * For them to be exposed to the client, prefix them with `NEXT_PUBLIC_`. */ client: { - NEXT_PUBLIC_ORDERBOOK_API_URL: z.string().url(), NEXT_PUBLIC_MARKETPLACE_API_URL: z.string().url(), NEXT_PUBLIC_BROKER_ID: z.string(), NEXT_PUBLIC_IPFS_GATEWAY: z.string().url(), @@ -33,7 +32,6 @@ export const env = createEnv({ */ experimental__runtimeEnv: { NODE_ENV: process.env.NODE_ENV, - NEXT_PUBLIC_ORDERBOOK_API_URL: process.env.NEXT_PUBLIC_ORDERBOOK_API_URL, NEXT_PUBLIC_MARKETPLACE_API_URL: process.env.NEXT_PUBLIC_MARKETPLACE_API_URL, NEXT_PUBLIC_BROKER_ID: process.env.NEXT_PUBLIC_BROKER_ID, diff --git a/apps/arkmarket/src/lib/getSystemStatus.ts b/apps/arkmarket/src/lib/getSystemStatus.ts index 006d7a59..c70ae519 100644 --- a/apps/arkmarket/src/lib/getSystemStatus.ts +++ b/apps/arkmarket/src/lib/getSystemStatus.ts @@ -2,7 +2,7 @@ import type { SystemStatus } from "~/types"; import { env } from "~/env"; export default async function getSystemStatus() { - const response = await fetch(env.NEXT_PUBLIC_ORDERBOOK_API_URL); + const response = await fetch(env.NEXT_PUBLIC_MARKETPLACE_API_URL); const data = (await response.json()) as SystemStatus; return data; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fbf4bcc0..3fc57c7a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -85,8 +85,8 @@ importers: specifier: 3.0.0-beta.1 version: 3.0.0-beta.1(typescript@5.5.4)(viem@2.17.3(typescript@5.5.4)(zod@3.23.8)) '@ark-project/react': - specifier: 2.0.0-beta.1 - version: 2.0.0-beta.1(typescript@5.5.4)(viem@2.17.3(typescript@5.5.4)(zod@3.23.8)) + specifier: 2.0.0-beta.2 + version: 2.0.0-beta.2(typescript@5.5.4)(viem@2.17.3(typescript@5.5.4)(zod@3.23.8)) '@hookform/error-message': specifier: ^2.0.1 version: 2.0.1(react-dom@18.3.1(react@18.3.1))(react-hook-form@7.52.1(react@18.3.1))(react@18.3.1) @@ -397,7 +397,7 @@ importers: version: 7.35.0(eslint@9.9.1(jiti@1.21.6)) eslint-plugin-react-hooks: specifier: rc - version: 5.1.0-rc-09111202-20241011(eslint@9.9.1(jiti@1.21.6)) + version: 5.1.0-rc-cd22717c-20241013(eslint@9.9.1(jiti@1.21.6)) eslint-plugin-turbo: specifier: ^2.0.13 version: 2.1.0(eslint@9.9.1(jiti@1.21.6)) @@ -503,8 +503,8 @@ packages: typescript: optional: true - '@ark-project/react@2.0.0-beta.1': - resolution: {integrity: sha512-PwkiiTWJmKcvrpo6yiA5IjGAP7fKITTUnT/ihzlpuKpp/7lw/bsRn6h2n3gsjG7fRtTW76x3Pt7iyDgRVTposg==} + '@ark-project/react@2.0.0-beta.2': + resolution: {integrity: sha512-QmnL2Y5ondgYpMWaIcm8nva7/7HPKonHg7QrAXIsVU2N63pwbCbK6sNrksPoZ4PKUFgPUBRbF7/kOwKvwG/uKA==} '@babel/code-frame@7.24.7': resolution: {integrity: sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==} @@ -3192,8 +3192,8 @@ packages: peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 - eslint-plugin-react-hooks@5.1.0-rc-09111202-20241011: - resolution: {integrity: sha512-HLdP3Qpr9KUckSEhxwWHqpXGJYKlZV+P9gqdOwPa45Ka3qhY1kuflvtwRMMA9dd7p8AL/lRLU3UUfNcDVh5DGw==} + eslint-plugin-react-hooks@5.1.0-rc-cd22717c-20241013: + resolution: {integrity: sha512-p4gcOd9uRugj0w+23DAcb1quxz0RLLQrebiQ2wQ3+LbRlSic5SwixqdZmMsuQLkKdWYYftVIH6gsBoUBHNdsZg==} engines: {node: '>=10'} peerDependencies: eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 @@ -5749,7 +5749,7 @@ snapshots: transitivePeerDependencies: - encoding - '@ark-project/react@2.0.0-beta.1(typescript@5.5.4)(viem@2.17.3(typescript@5.5.4)(zod@3.23.8))': + '@ark-project/react@2.0.0-beta.2(typescript@5.5.4)(viem@2.17.3(typescript@5.5.4)(zod@3.23.8))': dependencies: '@ark-project/core': 3.0.0-beta.1(typescript@5.5.4)(viem@2.17.3(typescript@5.5.4)(zod@3.23.8)) '@starknet-react/chains': 0.1.7 @@ -8817,7 +8817,7 @@ snapshots: safe-regex-test: 1.0.3 string.prototype.includes: 2.0.0 - eslint-plugin-react-hooks@5.1.0-rc-09111202-20241011(eslint@9.9.1(jiti@1.21.6)): + eslint-plugin-react-hooks@5.1.0-rc-cd22717c-20241013(eslint@9.9.1(jiti@1.21.6)): dependencies: eslint: 9.9.1(jiti@1.21.6) From be6c76a1eb05d8dec47a6f34a520b87925ba6390 Mon Sep 17 00:00:00 2001 From: kwiss Date: Mon, 14 Oct 2024 15:33:03 +0200 Subject: [PATCH 3/8] fix: remove arkchain --- apps/arkmarket/src/components/providers.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/arkmarket/src/components/providers.tsx b/apps/arkmarket/src/components/providers.tsx index 62a5a9a7..2f222131 100644 --- a/apps/arkmarket/src/components/providers.tsx +++ b/apps/arkmarket/src/components/providers.tsx @@ -17,7 +17,6 @@ export default function Providers({ children }: PropsWithChildren) { From 9a081435b9c70aa6a85a5a023d96036368becb89 Mon Sep 17 00:00:00 2001 From: kwiss Date: Wed, 30 Oct 2024 13:58:10 +0100 Subject: [PATCH 4/8] fix: readme --- apps/arkmarket/README.md | 2 -- 1 file changed, 2 deletions(-) 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) From cebd2e08da25f6bf9bc6670b987d1bc908ffcb03 Mon Sep 17 00:00:00 2001 From: kwiss Date: Wed, 30 Oct 2024 21:38:37 +0100 Subject: [PATCH 5/8] fix: temp fix for chain id in api --- apps/arkmarket/src/lib/getCollection.ts | 2 +- apps/arkmarket/src/lib/getCollectionTokens.ts | 2 +- apps/arkmarket/src/lib/getToken.ts | 2 +- apps/arkmarket/src/lib/getTokenActivity.ts | 2 +- apps/arkmarket/src/lib/getTokenMarketData.ts | 2 +- apps/arkmarket/src/lib/getTokenOffers.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/arkmarket/src/lib/getCollection.ts b/apps/arkmarket/src/lib/getCollection.ts index b9e2de4f..53a3083b 100644 --- a/apps/arkmarket/src/lib/getCollection.ts +++ b/apps/arkmarket/src/lib/getCollection.ts @@ -10,7 +10,7 @@ export interface CollectionApiResponse { data: Collection; } -const defaultChainId = "0x534e5f4d41494e"; +const defaultChainId = "0x00000000000000000000000000000000000000000000000000534e5f4d41494e"; export default async function getCollection({ collectionAddress, diff --git a/apps/arkmarket/src/lib/getCollectionTokens.ts b/apps/arkmarket/src/lib/getCollectionTokens.ts index 60a2d6ed..02f7c3c6 100644 --- a/apps/arkmarket/src/lib/getCollectionTokens.ts +++ b/apps/arkmarket/src/lib/getCollectionTokens.ts @@ -69,7 +69,7 @@ export async function getCollectionTokens({ queryParams.push(`direction=${sortDirection}`); } - const url = `${env.NEXT_PUBLIC_MARKETPLACE_API_URL}/collections/${collectionAddress}/0x534e5f4d41494e/tokens?${queryParams.join("&")}`; + const url = `${env.NEXT_PUBLIC_MARKETPLACE_API_URL}/collections/${collectionAddress}/0x00000000000000000000000000000000000000000000000000534e5f4d41494e/tokens?${queryParams.join("&")}`; const response = await fetch(url, { headers: { "Content-Type": "application/json", diff --git a/apps/arkmarket/src/lib/getToken.ts b/apps/arkmarket/src/lib/getToken.ts index 001b5a0a..9bfc9c92 100644 --- a/apps/arkmarket/src/lib/getToken.ts +++ b/apps/arkmarket/src/lib/getToken.ts @@ -14,7 +14,7 @@ export default async function getToken({ contractAddress, tokenId, }: GetCollectionTokenProps) { - const url = `${env.NEXT_PUBLIC_MARKETPLACE_API_URL}/tokens/${contractAddress}/0x534e5f4d41494e/${tokenId}`; + const url = `${env.NEXT_PUBLIC_MARKETPLACE_API_URL}/tokens/${contractAddress}/0x00000000000000000000000000000000000000000000000000534e5f4d41494e/${tokenId}`; const response = await fetch(url); if (!response.ok) { diff --git a/apps/arkmarket/src/lib/getTokenActivity.ts b/apps/arkmarket/src/lib/getTokenActivity.ts index 9a98bf51..06f5953b 100644 --- a/apps/arkmarket/src/lib/getTokenActivity.ts +++ b/apps/arkmarket/src/lib/getTokenActivity.ts @@ -24,7 +24,7 @@ export default async function getTokenActivity({ queryParams.push(`page=${page}`); } - const url = `${env.NEXT_PUBLIC_MARKETPLACE_API_URL}/tokens/${contractAddress}/0x534e5f4d41494e/${tokenId}/activity?${queryParams.join("&")}`; + const url = `${env.NEXT_PUBLIC_MARKETPLACE_API_URL}/tokens/${contractAddress}/0x00000000000000000000000000000000000000000000000000534e5f4d41494e/${tokenId}/activity?${queryParams.join("&")}`; const response = await fetch(url, { headers: { "Content-Type": "application/json", diff --git a/apps/arkmarket/src/lib/getTokenMarketData.ts b/apps/arkmarket/src/lib/getTokenMarketData.ts index ad8a34d5..8bef1d37 100644 --- a/apps/arkmarket/src/lib/getTokenMarketData.ts +++ b/apps/arkmarket/src/lib/getTokenMarketData.ts @@ -15,7 +15,7 @@ export default async function getTokenMarketData({ tokenId, }: GetTokenMarketParams) { const response = await fetch( - `${env.NEXT_PUBLIC_MARKETPLACE_API_URL}/tokens/${contractAddress}/0x534e5f4d41494e/${tokenId}/marketdata`, + `${env.NEXT_PUBLIC_MARKETPLACE_API_URL}/tokens/${contractAddress}/0x00000000000000000000000000000000000000000000000000534e5f4d41494e/${tokenId}/marketdata`, ); if (!response.ok) { diff --git a/apps/arkmarket/src/lib/getTokenOffers.ts b/apps/arkmarket/src/lib/getTokenOffers.ts index cec63823..7be1c225 100644 --- a/apps/arkmarket/src/lib/getTokenOffers.ts +++ b/apps/arkmarket/src/lib/getTokenOffers.ts @@ -24,7 +24,7 @@ export async function getTokenOffers({ queryParams.push(`page=${page}`); } - const url = `${env.NEXT_PUBLIC_MARKETPLACE_API_URL}/tokens/${contractAddress}/0x534e5f4d41494e/${tokenId}/offers?${queryParams.join("&")}`; + const url = `${env.NEXT_PUBLIC_MARKETPLACE_API_URL}/tokens/${contractAddress}/0x00000000000000000000000000000000000000000000000000534e5f4d41494e/${tokenId}/offers?${queryParams.join("&")}`; const response = await fetch(url, { headers: { "Content-Type": "application/json", From 938e7a3b8fe8cb30c5c627af07525cb2fbbfe3b4 Mon Sep 17 00:00:00 2001 From: remiroyc Date: Thu, 31 Oct 2024 12:07:51 +0100 Subject: [PATCH 6/8] Revert "fix: temp fix for chain id in api" This reverts commit cebd2e08da25f6bf9bc6670b987d1bc908ffcb03. --- apps/arkmarket/src/lib/getCollection.ts | 2 +- apps/arkmarket/src/lib/getCollectionTokens.ts | 2 +- apps/arkmarket/src/lib/getToken.ts | 2 +- apps/arkmarket/src/lib/getTokenActivity.ts | 2 +- apps/arkmarket/src/lib/getTokenMarketData.ts | 2 +- apps/arkmarket/src/lib/getTokenOffers.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/arkmarket/src/lib/getCollection.ts b/apps/arkmarket/src/lib/getCollection.ts index 53a3083b..b9e2de4f 100644 --- a/apps/arkmarket/src/lib/getCollection.ts +++ b/apps/arkmarket/src/lib/getCollection.ts @@ -10,7 +10,7 @@ export interface CollectionApiResponse { data: Collection; } -const defaultChainId = "0x00000000000000000000000000000000000000000000000000534e5f4d41494e"; +const defaultChainId = "0x534e5f4d41494e"; export default async function getCollection({ collectionAddress, diff --git a/apps/arkmarket/src/lib/getCollectionTokens.ts b/apps/arkmarket/src/lib/getCollectionTokens.ts index 02f7c3c6..60a2d6ed 100644 --- a/apps/arkmarket/src/lib/getCollectionTokens.ts +++ b/apps/arkmarket/src/lib/getCollectionTokens.ts @@ -69,7 +69,7 @@ export async function getCollectionTokens({ queryParams.push(`direction=${sortDirection}`); } - const url = `${env.NEXT_PUBLIC_MARKETPLACE_API_URL}/collections/${collectionAddress}/0x00000000000000000000000000000000000000000000000000534e5f4d41494e/tokens?${queryParams.join("&")}`; + const url = `${env.NEXT_PUBLIC_MARKETPLACE_API_URL}/collections/${collectionAddress}/0x534e5f4d41494e/tokens?${queryParams.join("&")}`; const response = await fetch(url, { headers: { "Content-Type": "application/json", diff --git a/apps/arkmarket/src/lib/getToken.ts b/apps/arkmarket/src/lib/getToken.ts index 9bfc9c92..001b5a0a 100644 --- a/apps/arkmarket/src/lib/getToken.ts +++ b/apps/arkmarket/src/lib/getToken.ts @@ -14,7 +14,7 @@ export default async function getToken({ contractAddress, tokenId, }: GetCollectionTokenProps) { - const url = `${env.NEXT_PUBLIC_MARKETPLACE_API_URL}/tokens/${contractAddress}/0x00000000000000000000000000000000000000000000000000534e5f4d41494e/${tokenId}`; + const url = `${env.NEXT_PUBLIC_MARKETPLACE_API_URL}/tokens/${contractAddress}/0x534e5f4d41494e/${tokenId}`; const response = await fetch(url); if (!response.ok) { diff --git a/apps/arkmarket/src/lib/getTokenActivity.ts b/apps/arkmarket/src/lib/getTokenActivity.ts index 06f5953b..9a98bf51 100644 --- a/apps/arkmarket/src/lib/getTokenActivity.ts +++ b/apps/arkmarket/src/lib/getTokenActivity.ts @@ -24,7 +24,7 @@ export default async function getTokenActivity({ queryParams.push(`page=${page}`); } - const url = `${env.NEXT_PUBLIC_MARKETPLACE_API_URL}/tokens/${contractAddress}/0x00000000000000000000000000000000000000000000000000534e5f4d41494e/${tokenId}/activity?${queryParams.join("&")}`; + const url = `${env.NEXT_PUBLIC_MARKETPLACE_API_URL}/tokens/${contractAddress}/0x534e5f4d41494e/${tokenId}/activity?${queryParams.join("&")}`; const response = await fetch(url, { headers: { "Content-Type": "application/json", diff --git a/apps/arkmarket/src/lib/getTokenMarketData.ts b/apps/arkmarket/src/lib/getTokenMarketData.ts index 8bef1d37..ad8a34d5 100644 --- a/apps/arkmarket/src/lib/getTokenMarketData.ts +++ b/apps/arkmarket/src/lib/getTokenMarketData.ts @@ -15,7 +15,7 @@ export default async function getTokenMarketData({ tokenId, }: GetTokenMarketParams) { const response = await fetch( - `${env.NEXT_PUBLIC_MARKETPLACE_API_URL}/tokens/${contractAddress}/0x00000000000000000000000000000000000000000000000000534e5f4d41494e/${tokenId}/marketdata`, + `${env.NEXT_PUBLIC_MARKETPLACE_API_URL}/tokens/${contractAddress}/0x534e5f4d41494e/${tokenId}/marketdata`, ); if (!response.ok) { diff --git a/apps/arkmarket/src/lib/getTokenOffers.ts b/apps/arkmarket/src/lib/getTokenOffers.ts index 7be1c225..cec63823 100644 --- a/apps/arkmarket/src/lib/getTokenOffers.ts +++ b/apps/arkmarket/src/lib/getTokenOffers.ts @@ -24,7 +24,7 @@ export async function getTokenOffers({ queryParams.push(`page=${page}`); } - const url = `${env.NEXT_PUBLIC_MARKETPLACE_API_URL}/tokens/${contractAddress}/0x00000000000000000000000000000000000000000000000000534e5f4d41494e/${tokenId}/offers?${queryParams.join("&")}`; + const url = `${env.NEXT_PUBLIC_MARKETPLACE_API_URL}/tokens/${contractAddress}/0x534e5f4d41494e/${tokenId}/offers?${queryParams.join("&")}`; const response = await fetch(url, { headers: { "Content-Type": "application/json", From 888178fde51196ea8b138467b048d392a8ace067 Mon Sep 17 00:00:00 2001 From: kwiss Date: Mon, 18 Nov 2024 20:55:09 +0100 Subject: [PATCH 7/8] fix: update provider & hooks usage --- apps/arkmarket/package.json | 9 +- .../components/collection-items-buy-now.tsx | 38 +- apps/arkmarket/src/app/layout.tsx | 2 +- .../[tokenId]/components/accept-offer.tsx | 38 +- .../[tokenId]/components/cancel-offer.tsx | 13 +- .../token-actions-accept-best-offer.tsx | 37 +- .../token-actions-cancel-listing.tsx | 8 +- .../token-actions-create-listing.tsx | 31 +- .../components/token-actions-make-bid.tsx | 23 +- .../components/token-actions-make-offer.tsx | 23 +- .../token-summary-mobile-actions.tsx | 4 +- .../token-summary-share-dropdown.tsx | 4 +- .../components/tokens-actions-buy-now.tsx | 30 +- .../[contractAddress]/[tokenId]/page.tsx | 1 + apps/arkmarket/src/components/providers.tsx | 26 +- package.json | 5 +- pnpm-lock.yaml | 5243 +++++++---------- pnpm-workspace.yaml | 8 +- 18 files changed, 2325 insertions(+), 3218 deletions(-) diff --git a/apps/arkmarket/package.json b/apps/arkmarket/package.json index 11b78180..eaa6bab4 100644 --- a/apps/arkmarket/package.json +++ b/apps/arkmarket/package.json @@ -19,17 +19,14 @@ "dependencies": { "@ark-market/ui": "workspace:*", "@ark-project/core": "3.0.0-beta.1", - "@ark-project/react": "2.0.0-beta.2", + "@ark-project/react": "2.0.0-beta.3", "@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({