@0xsequence/marketplace-sdk 0.8.10 → 0.8.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/.changeset/fluffy-jokes-lay.md +5 -0
  2. package/.changeset/wise-bugs-boil.md +8 -0
  3. package/CHANGELOG.md +16 -3
  4. package/dist/{chunk-DWTLVJAW.js → chunk-6OPMUCGX.js} +1 -1
  5. package/dist/chunk-6OPMUCGX.js.map +1 -0
  6. package/dist/{chunk-O34GCB47.js → chunk-L6KWLCER.js} +4 -4
  7. package/dist/chunk-L6KWLCER.js.map +1 -0
  8. package/dist/{chunk-Y2HJO2VY.js → chunk-LAP2CKLN.js} +56 -3
  9. package/dist/chunk-LAP2CKLN.js.map +1 -0
  10. package/dist/{chunk-Y63BOO6M.js → chunk-LECCEZAO.js} +1 -1
  11. package/dist/{chunk-WH5BZC7W.js → chunk-N7SQWS2R.js} +3 -3
  12. package/dist/{chunk-7F27CJZW.js → chunk-OAOONM4S.js} +682 -439
  13. package/dist/chunk-OAOONM4S.js.map +1 -0
  14. package/dist/chunk-QY52UADF.js +107 -0
  15. package/dist/chunk-QY52UADF.js.map +1 -0
  16. package/dist/{chunk-UJSF7PSC.js → chunk-TNAR3XEF.js} +3766 -765
  17. package/dist/chunk-TNAR3XEF.js.map +1 -0
  18. package/dist/chunk-XABYNWXO.js +549 -0
  19. package/dist/chunk-XABYNWXO.js.map +1 -0
  20. package/dist/chunk-YB5UUF2G.js +11 -0
  21. package/dist/chunk-YB5UUF2G.js.map +1 -0
  22. package/dist/{chunk-M6NJ73Y5.js → chunk-YWGFI4PN.js} +87 -24
  23. package/dist/chunk-YWGFI4PN.js.map +1 -0
  24. package/dist/{create-config-CAQcvjl6.d.ts → create-config-DLMvMTkZ.d.ts} +2 -2
  25. package/dist/index.css +1 -1
  26. package/dist/index.css.map +1 -1
  27. package/dist/index.d.ts +7 -6
  28. package/dist/index.js +14 -15
  29. package/dist/{listTokenMetadata-DO4ChDjn.d.ts → marketCurrencies-enNVYwBk.d.ts} +77 -3
  30. package/dist/{marketplace.gen-DQzWciwC.d.ts → marketplace.gen-D24veUQs.d.ts} +3 -2
  31. package/dist/marketplaceConfig-BwNAbLPw.d.ts +21 -0
  32. package/dist/new-marketplace-types-BCw19X9S.d.ts +102 -0
  33. package/dist/react/_internal/api/index.d.ts +3 -3
  34. package/dist/react/_internal/api/index.js +1 -1
  35. package/dist/react/_internal/databeat/index.css +2764 -0
  36. package/dist/react/_internal/databeat/index.css.map +1 -0
  37. package/dist/react/_internal/databeat/index.d.ts +1 -1
  38. package/dist/react/_internal/databeat/index.js +12 -12
  39. package/dist/react/_internal/index.d.ts +61 -9
  40. package/dist/react/_internal/index.js +3 -3
  41. package/dist/react/_internal/wagmi/index.d.ts +5 -6
  42. package/dist/react/_internal/wagmi/index.js +1 -1
  43. package/dist/react/hooks/index.css +2764 -0
  44. package/dist/react/hooks/index.css.map +1 -0
  45. package/dist/react/hooks/index.d.ts +71 -222
  46. package/dist/react/hooks/index.js +16 -20
  47. package/dist/react/hooks/options/index.d.ts +5 -4
  48. package/dist/react/hooks/options/index.js +9 -7
  49. package/dist/react/index.css +1 -1
  50. package/dist/react/index.css.map +1 -1
  51. package/dist/react/index.d.ts +9 -9
  52. package/dist/react/index.js +28 -34
  53. package/dist/react/queries/index.d.ts +3 -3
  54. package/dist/react/queries/index.js +15 -4
  55. package/dist/react/ssr/index.d.ts +3 -3
  56. package/dist/react/ssr/index.js +6 -5
  57. package/dist/react/ssr/index.js.map +1 -1
  58. package/dist/react/ui/components/collectible-card/index.css +1 -1
  59. package/dist/react/ui/components/collectible-card/index.css.map +1 -1
  60. package/dist/react/ui/components/collectible-card/index.d.ts +3 -2
  61. package/dist/react/ui/components/collectible-card/index.js +12 -17
  62. package/dist/react/ui/icons/index.js +6 -6
  63. package/dist/react/ui/index.css +1 -1
  64. package/dist/react/ui/index.css.map +1 -1
  65. package/dist/react/ui/index.d.ts +1 -1
  66. package/dist/react/ui/index.js +12 -17
  67. package/dist/react/ui/modals/_internal/components/actionModal/index.css +2764 -0
  68. package/dist/react/ui/modals/_internal/components/actionModal/index.css.map +1 -0
  69. package/dist/react/ui/modals/_internal/components/actionModal/index.js +12 -12
  70. package/dist/sdk-config-qorA0TgF.d.ts +165 -0
  71. package/dist/{services-CMSb9ipU.d.ts → services-WrshxCqc.d.ts} +2 -2
  72. package/dist/types/index.d.ts +5 -4
  73. package/dist/types/index.js +7 -7
  74. package/dist/{index-MlUK9AQE.d.ts → useCollection-YAdXfVO7.d.ts} +1 -2
  75. package/dist/utils/abi/index.js +4 -4
  76. package/dist/utils/index.d.ts +1 -1
  77. package/dist/utils/index.js +8 -7
  78. package/package.json +15 -15
  79. package/src/react/_internal/api/__mocks__/builder.msw.ts +157 -80
  80. package/src/react/_internal/api/builder-api.ts +2 -2
  81. package/src/react/_internal/api/builder.gen.ts +667 -112
  82. package/src/react/_internal/api/marketplace.gen.ts +1981 -1316
  83. package/src/react/_internal/types.ts +1 -13
  84. package/src/react/_internal/wagmi/__tests__/create-config.test.ts +99 -84
  85. package/src/react/_internal/wagmi/create-config.ts +8 -4
  86. package/src/react/_internal/wagmi/get-connectors.ts +24 -19
  87. package/src/react/hooks/__tests__/__snapshots__/useListCollections.test.tsx.snap +114 -0
  88. package/src/react/hooks/__tests__/__snapshots__/useMarketplaceConfig.test.tsx.snap +85 -83
  89. package/src/react/hooks/__tests__/useFilters.test.tsx +0 -16
  90. package/src/react/hooks/__tests__/useInventory.test.tsx +16 -16
  91. package/src/react/hooks/__tests__/useListCollections.test.tsx +23 -56
  92. package/src/react/hooks/__tests__/{useCurrencies.test.tsx → useMarketCurrencies.test.tsx} +21 -15
  93. package/src/react/hooks/__tests__/useMarketplaceConfig.test.tsx +2 -59
  94. package/src/react/hooks/index.ts +2 -1
  95. package/src/react/hooks/useBalanceOfCollectible.tsx +5 -3
  96. package/src/react/hooks/useConvertPriceToUSD.tsx +1 -1
  97. package/src/react/hooks/useFilters.tsx +14 -22
  98. package/src/react/hooks/useGetTokenSuppliesMap.ts +28 -0
  99. package/src/react/hooks/useInventory.tsx +4 -3
  100. package/src/react/hooks/useListBalances.tsx +5 -3
  101. package/src/react/hooks/useListCollectibles.tsx +5 -3
  102. package/src/react/hooks/useListCollections.tsx +14 -76
  103. package/src/react/hooks/useMarketCurrencies.tsx +8 -0
  104. package/src/react/hooks/useMarketplaceConfig.tsx +0 -2
  105. package/src/react/queries/index.ts +1 -0
  106. package/src/react/queries/inventory.ts +1 -1
  107. package/src/react/queries/listCollections.ts +118 -0
  108. package/src/react/queries/marketCurrencies.ts +77 -0
  109. package/src/react/queries/marketplaceConfig.ts +83 -55
  110. package/src/react/ssr/__tests__/__snapshots__/create-ssr-client.test.ts.snap +85 -83
  111. package/src/react/ui/components/collectible-card/__tests__/Media.test.tsx +41 -1
  112. package/src/react/ui/components/collectible-card/media/Media.tsx +11 -6
  113. package/src/react/ui/components/collectible-card/media/MediaSkeleton.tsx +1 -1
  114. package/src/react/ui/components/collectible-card/media/types.ts +1 -0
  115. package/src/react/ui/modals/BuyModal/ERC1155QuantityModal.tsx +9 -3
  116. package/src/react/ui/modals/BuyModal/hooks/__tests__/useFees.test.tsx +31 -21
  117. package/src/react/ui/modals/BuyModal/hooks/useFees.ts +3 -2
  118. package/src/react/ui/modals/CreateListingModal/Modal.tsx +3 -5
  119. package/src/react/ui/modals/CreateListingModal/hooks/useCreateListing.tsx +5 -3
  120. package/src/react/ui/modals/CreateListingModal/hooks/useTransactionSteps.tsx +2 -2
  121. package/src/react/ui/modals/MakeOfferModal/Modal.tsx +2 -3
  122. package/src/react/ui/modals/MakeOfferModal/hooks/useMakeOffer.tsx +4 -3
  123. package/src/react/ui/modals/SellModal/Modal.tsx +0 -1
  124. package/src/react/ui/modals/SellModal/hooks/useTransactionSteps.tsx +2 -2
  125. package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/index.tsx +0 -1
  126. package/src/react/ui/modals/TransferModal/index.tsx +0 -1
  127. package/src/react/ui/modals/_internal/components/currencyOptionsSelect/__tests__/index.test.tsx +2 -2
  128. package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +7 -6
  129. package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/__tests__/SelectWaasFeeOptions.test.tsx +13 -7
  130. package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/index.tsx +3 -5
  131. package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/useWaasFeeOptionManager.tsx +5 -3
  132. package/src/react/ui/modals/_internal/components/transactionDetails/index.tsx +2 -2
  133. package/src/react/ui/modals/_internal/hooks/useSelectWaasFeeOptions.ts +2 -12
  134. package/src/types/index.ts +1 -6
  135. package/src/types/new-marketplace-types.ts +119 -0
  136. package/src/types/sdk-config.ts +18 -2
  137. package/src/types/types.ts +1 -0
  138. package/tsconfig.tsbuildinfo +1 -1
  139. package/dist/chunk-7F27CJZW.js.map +0 -1
  140. package/dist/chunk-A7BVFBWB.js +0 -81
  141. package/dist/chunk-A7BVFBWB.js.map +0 -1
  142. package/dist/chunk-D7RVSZAQ.js +0 -332
  143. package/dist/chunk-D7RVSZAQ.js.map +0 -1
  144. package/dist/chunk-DWTLVJAW.js.map +0 -1
  145. package/dist/chunk-FGM57QUU.js +0 -128
  146. package/dist/chunk-FGM57QUU.js.map +0 -1
  147. package/dist/chunk-JKCF7HEA.js +0 -1
  148. package/dist/chunk-JKCF7HEA.js.map +0 -1
  149. package/dist/chunk-KTST7ORH.js +0 -53
  150. package/dist/chunk-KTST7ORH.js.map +0 -1
  151. package/dist/chunk-M6NJ73Y5.js.map +0 -1
  152. package/dist/chunk-N7BPFK46.js +0 -1
  153. package/dist/chunk-N7BPFK46.js.map +0 -1
  154. package/dist/chunk-O34GCB47.js.map +0 -1
  155. package/dist/chunk-RVIUUJTP.js +0 -76
  156. package/dist/chunk-RVIUUJTP.js.map +0 -1
  157. package/dist/chunk-SXVUTSMT.js +0 -2895
  158. package/dist/chunk-SXVUTSMT.js.map +0 -1
  159. package/dist/chunk-UJSF7PSC.js.map +0 -1
  160. package/dist/chunk-Y2HJO2VY.js.map +0 -1
  161. package/dist/marketplaceConfig-D0MXemEl.d.ts +0 -17
  162. package/dist/sdk-config-onSPBxJj.d.ts +0 -134
  163. package/dist/types-B8xzPEKX.d.ts +0 -68
  164. package/src/react/hooks/useCurrencies.tsx +0 -77
  165. /package/dist/{chunk-Y63BOO6M.js.map → chunk-LECCEZAO.js.map} +0 -0
  166. /package/dist/{chunk-WH5BZC7W.js.map → chunk-N7SQWS2R.js.map} +0 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@0xsequence/marketplace-sdk",
3
3
  "private": false,
4
- "version": "0.8.10",
4
+ "version": "0.8.11",
5
5
  "type": "module",
6
6
  "sideEffects": [
7
7
  "**/*.css"
@@ -41,22 +41,22 @@
41
41
  "dependencies": {
42
42
  "@databeat/tracker": "^0.9.3",
43
43
  "@legendapp/state": "^3.0.0-beta.30",
44
- "@tailwindcss/postcss": "^4.1.6",
45
- "@xstate/store": "^3.6.0",
44
+ "@tailwindcss/postcss": "^4.1.7",
45
+ "@xstate/store": "^3.6.2",
46
46
  "class-variance-authority": "^0.7.1",
47
47
  "clsx": "^2.1.1",
48
48
  "date-fns": "^4.1.0",
49
49
  "dnum": "^2.14.0",
50
50
  "nuqs": "^2.4.3",
51
- "react-day-picker": "^9.6.7",
51
+ "react-day-picker": "^9.7.0",
52
52
  "tailwind-merge": "^3.3.0",
53
- "zod": "^3.24.4"
53
+ "zod": "^3.25.7"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "0xsequence": "^2.3.12",
57
57
  "@0xsequence/api": "^2.3.12",
58
- "@0xsequence/checkout": "^5.3.1",
59
- "@0xsequence/connect": "^5.3.1",
58
+ "@0xsequence/checkout": "^5.3.3",
59
+ "@0xsequence/connect": "^5.3.3",
60
60
  "@0xsequence/design-system": "^2.1.12",
61
61
  "@0xsequence/indexer": "^2.3.12",
62
62
  "@0xsequence/metadata": "^2.3.12",
@@ -64,14 +64,14 @@
64
64
  "@tanstack/react-query": "^5.76.1",
65
65
  "react": "^19.1.0",
66
66
  "react-dom": "^19.1.0",
67
- "viem": "^2.29.2",
68
- "wagmi": "^2.15.3",
67
+ "viem": "^2.30.0",
68
+ "wagmi": "^2.15.4",
69
69
  "@google/model-viewer": "^4.1.0"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@biomejs/biome": "^1.9.4",
73
73
  "@changesets/cli": "^2.29.4",
74
- "@eslint/js": "^9.26.0",
74
+ "@eslint/js": "^9.27.0",
75
75
  "@testing-library/jest-dom": "6.4.7",
76
76
  "@testing-library/react": "^16.3.0",
77
77
  "@types/react": "^19.1.4",
@@ -79,22 +79,22 @@
79
79
  "@vitest/coverage-v8": "3.0.9",
80
80
  "ctix": "^2.7.1",
81
81
  "esbuild-plugin-preserve-directives": "^0.0.11",
82
- "eslint": "^9.26.0",
82
+ "eslint": "^9.27.0",
83
83
  "eslint-config-biome": "^1.9.4",
84
84
  "eslint-plugin-react": "^7.37.5",
85
85
  "eslint-plugin-react-hooks": "^5.2.0",
86
86
  "globals": "^16.1.0",
87
87
  "happy-dom": "^17.4.7",
88
88
  "jsdom": "^26.1.0",
89
- "msw": "^2.8.2",
89
+ "msw": "^2.8.4",
90
90
  "postcss": "^8.5.3",
91
91
  "prool": "^0.0.24",
92
- "tailwindcss": "^4.1.6",
93
- "tsup": "^8.4.0",
92
+ "tailwindcss": "^4.1.7",
93
+ "tsup": "^8.5.0",
94
94
  "typescript": "^5.8.3",
95
95
  "typescript-eslint": "^8.32.1",
96
96
  "vite-tsconfig-paths": "^5.1.4",
97
- "vitest": "^3.1.3"
97
+ "vitest": "^3.1.4"
98
98
  },
99
99
  "scripts": {
100
100
  "build": "tsc -b && tsup",
@@ -2,21 +2,20 @@ import { http, HttpResponse } from 'msw';
2
2
  import { zeroAddress } from 'viem';
3
3
  import {
4
4
  FilterCondition,
5
- type LookupMarketplaceConfigReturn,
6
- type MarketplaceConfig,
7
- MarketplaceType,
8
- MarketplaceWallet,
9
- OrderbookKind,
10
- } from '../../../../types';
5
+ type LookupMarketplaceReturn,
6
+ MarketplaceWalletType,
7
+ } from '../builder.gen';
8
+ import { OrderbookKind } from '../marketplace.gen';
11
9
  import { mockCurrencies } from './marketplace.msw';
12
10
 
13
- export const mockCollections = [
11
+ export const mockMarketCollections = [
14
12
  {
15
- address: zeroAddress,
13
+ id: 1,
14
+ projectId: 1,
15
+ contractType: 'ERC721',
16
+ itemsAddress: zeroAddress,
16
17
  chainId: 1,
17
- marketplaceType: MarketplaceType.ORDERBOOK,
18
18
  currencyOptions: mockCurrencies.map((c) => c.contractAddress),
19
- exchanges: [],
20
19
  bannerUrl: '',
21
20
  feePercentage: 3.5,
22
21
  destinationMarketplace: OrderbookKind.sequence_marketplace_v2,
@@ -30,13 +29,16 @@ export const mockCollections = [
30
29
  },
31
30
  ],
32
31
  },
32
+ createdAt: new Date('2025-03-16T13:04:16.098Z').toISOString(),
33
+ updatedAt: new Date('2025-03-16T13:04:16.098Z').toISOString(),
33
34
  },
34
35
  {
35
- address: '0x1234567890123456789012345678901234567890',
36
+ id: 2,
37
+ projectId: 1,
38
+ contractType: 'ERC1155',
39
+ itemsAddress: '0x1234567890123456789012345678901234567890',
36
40
  chainId: 137,
37
- marketplaceType: MarketplaceType.ORDERBOOK,
38
41
  currencyOptions: [mockCurrencies[0].contractAddress],
39
- exchanges: [],
40
42
  bannerUrl: 'https://example.com/collection-banner.png',
41
43
  feePercentage: 2.5,
42
44
  destinationMarketplace: OrderbookKind.opensea,
@@ -54,44 +56,133 @@ export const mockCollections = [
54
56
  },
55
57
  ],
56
58
  },
59
+ createdAt: new Date('2025-03-16T13:04:16.098Z').toISOString(),
60
+ updatedAt: new Date('2025-03-16T13:04:16.098Z').toISOString(),
57
61
  },
58
62
  ];
59
63
 
60
- // Mock data
61
- export const mockConfig: MarketplaceConfig = {
62
- projectId: 1,
63
- publisherId: 'test-publisher',
64
- title: 'Test Marketplace',
65
- shortDescription: 'A test marketplace',
66
- socials: {
67
- twitter: 'https://twitter.com/test',
68
- discord: 'https://discord.com/test',
69
- instagram: 'https://instagram.com/test',
70
- website: '',
71
- tiktok: '',
72
- youtube: '',
64
+ export const mockShopCollections = [
65
+ {
66
+ id: 1,
67
+ projectId: 1,
68
+ chainId: 1,
69
+ itemsAddress: zeroAddress,
70
+ saleAddress: zeroAddress,
71
+ name: 'Mock Shop Collection',
72
+ bannerUrl: 'https://example.com/shop-banner.png',
73
+ saleBannerUrl: 'https://example.com/shop-sale-banner.png',
74
+ createdAt: new Date('2025-03-16T13:04:16.098Z').toISOString(),
75
+ updatedAt: new Date('2025-03-16T13:04:16.098Z').toISOString(),
73
76
  },
74
- faviconUrl: 'https://example.com/favicon.png',
75
- landingBannerUrl: 'https://example.com/banner.png',
76
- logoUrl: 'https://example.com/logo.png',
77
- walletOptions: {
78
- walletType: MarketplaceWallet.UNIVERSAL,
79
- oidcIssuers: {},
80
- connectors: ['coinbase', 'walletconnect'],
81
- includeEIP6963Wallets: true,
77
+ {
78
+ id: 2,
79
+ projectId: 1,
80
+ chainId: 137,
81
+ itemsAddress: '0x1234567890123456789012345678901234567890',
82
+ saleAddress: '0x1234567890123456789012345678901234567890',
83
+ name: 'Polygon Shop Collection',
84
+ bannerUrl: 'https://example.com/polygon-shop-banner.png',
85
+ saleBannerUrl: 'https://example.com/polygon-shop-sale-banner.png',
86
+ createdAt: new Date('2025-03-16T13:04:16.098Z').toISOString(),
87
+ updatedAt: new Date('2025-03-16T13:04:16.098Z').toISOString(),
82
88
  },
83
- collections: mockCollections,
84
- landingPageLayout: 'default',
85
- cssString: '',
86
- manifestUrl: '',
87
- bannerUrl: '',
88
- };
89
+ ];
89
90
 
90
- export const mockStyles = `
91
- .marketplace-theme {
92
- --primary-color: #000000;
93
- }
94
- `;
91
+ export const mockConfig = {
92
+ marketplace: {
93
+ projectId: 1,
94
+ settings: {
95
+ style: {},
96
+ publisherId: 'publisher-1',
97
+ title: 'Mock Marketplace',
98
+ socials: {
99
+ twitter: 'https://twitter.com/mock',
100
+ discord: 'https://discord.gg/mock',
101
+ website: 'https://mock.com',
102
+ tiktok: 'https://tiktok.com/@mock',
103
+ instagram: 'https://instagram.com/mock',
104
+ youtube: 'https://youtube.com/mock',
105
+ },
106
+ faviconUrl: 'https://example.com/favicon.ico',
107
+ walletOptions: {
108
+ walletType: MarketplaceWalletType.UNIVERSAL,
109
+ oidcIssuers: {},
110
+ connectors: [],
111
+ includeEIP6963Wallets: true,
112
+ },
113
+ logoUrl: 'https://example.com/logo.png',
114
+ fontUrl: 'https://example.com/font.woff2',
115
+ accessKey: 'mock-access-key',
116
+ },
117
+ market: {
118
+ enabled: true,
119
+ title: 'Mock Market Page',
120
+ bannerUrl: 'https://example.com/market-banner.png',
121
+ ogImage: 'https://example.com/og-image.png',
122
+ },
123
+ shop: {
124
+ enabled: true,
125
+ title: 'Mock Shop Page',
126
+ bannerUrl: 'https://example.com/shop-banner.png',
127
+ ogImage: 'https://example.com/shop-og-image.png',
128
+ },
129
+ createdAt: new Date('2025-03-16T13:04:16.098Z').toISOString(),
130
+ updatedAt: new Date('2025-03-16T13:04:16.098Z').toISOString(),
131
+ },
132
+ marketCollections: [
133
+ {
134
+ id: 1,
135
+ projectId: 1,
136
+ chainId: 1,
137
+ itemsAddress: zeroAddress,
138
+ contractType: 'ERC721',
139
+ bannerUrl: 'https://example.com/market-banner.png',
140
+ feePercentage: 3.5,
141
+ currencyOptions: mockCurrencies.map((c) => c.contractAddress),
142
+ destinationMarketplace: OrderbookKind.sequence_marketplace_v2,
143
+ filterSettings: {
144
+ filterOrder: ['Type', 'Rarity'],
145
+ exclusions: [
146
+ {
147
+ key: 'Type',
148
+ condition: FilterCondition.SPECIFIC_VALUE,
149
+ value: 'Sample',
150
+ },
151
+ ],
152
+ },
153
+ createdAt: new Date('2025-03-16T13:04:16.098Z').toISOString(),
154
+ updatedAt: new Date('2025-03-16T13:04:16.098Z').toISOString(),
155
+ },
156
+ {
157
+ id: 2,
158
+ projectId: 1,
159
+ chainId: 137,
160
+ itemsAddress: '0x1234567890123456789012345678901234567890',
161
+ contractType: 'ERC1155',
162
+ bannerUrl: 'https://example.com/collection-banner.png',
163
+ feePercentage: 2.5,
164
+ currencyOptions: [mockCurrencies[0].contractAddress],
165
+ destinationMarketplace: OrderbookKind.opensea,
166
+ filterSettings: {
167
+ filterOrder: ['Category', 'Level', 'Element'],
168
+ exclusions: [
169
+ {
170
+ key: 'Category',
171
+ condition: FilterCondition.ENTIRE_KEY,
172
+ },
173
+ {
174
+ key: 'Level',
175
+ condition: FilterCondition.SPECIFIC_VALUE,
176
+ value: 'Legendary',
177
+ },
178
+ ],
179
+ },
180
+ createdAt: new Date('2025-03-16T13:04:16.098Z').toISOString(),
181
+ updatedAt: new Date('2025-03-16T13:04:16.098Z').toISOString(),
182
+ },
183
+ ],
184
+ shopCollections: mockShopCollections,
185
+ } satisfies LookupMarketplaceReturn;
95
186
 
96
187
  // Debug configuration
97
188
  export let isDebugEnabled = false;
@@ -102,53 +193,39 @@ export const disableDebug = () => {
102
193
  isDebugEnabled = false;
103
194
  };
104
195
 
105
- // Debug logger function
106
- const debugLog = (endpoint: string, request: Request, response: Response) => {
107
- if (isDebugEnabled) {
108
- console.log(`[MSW Debug] ${endpoint}:`, {
109
- request,
110
- response,
111
- });
112
- }
113
- };
196
+ // // Debug logger function
197
+ // const debugLog = (endpoint: string, request: Request, response: Response) => {
198
+ // if (isDebugEnabled) {
199
+ // console.log(`[MSW Debug] ${endpoint}:`, {
200
+ // request,
201
+ // response,
202
+ // });
203
+ // }
204
+ // };
114
205
 
115
- export const mockLookupMarketplaceConfigError = () => {
206
+ export const mockLookupMarketplaceError = () => {
116
207
  return HttpResponse.json(
117
208
  { code: 3000, msg: 'Project not found' },
118
209
  { status: 404 },
119
210
  );
120
211
  };
121
212
 
122
- export const createLookupMarketplaceConfigHandler = (config = mockConfig) =>
123
- http.post('*/rpc/Builder/LookupMarketplaceConfig', () => {
213
+ export const createLookupMarketplaceHandler = (
214
+ config: LookupMarketplaceReturn = mockConfig,
215
+ ) =>
216
+ http.post('*/rpc/MarketplaceService/LookupMarketplace', () => {
124
217
  return HttpResponse.json({
125
- settings: config,
126
- } satisfies LookupMarketplaceConfigReturn);
127
- });
128
-
129
- export const createLookupMarketplaceConfigErrorHandler = () =>
130
- http.post('*/rpc/Builder/LookupMarketplaceConfig', () => {
131
- return mockLookupMarketplaceConfigError();
132
- });
133
-
134
- export const createStylesHandler = (styles = mockStyles) =>
135
- http.get('*/marketplace/*/styles.css', ({ request }) => {
136
- const response = new HttpResponse(styles, {
137
- headers: { 'Content-Type': 'text/css' },
138
- });
139
- debugLog('styles.css', request, response);
140
- return response;
218
+ ...config,
219
+ } satisfies LookupMarketplaceReturn);
141
220
  });
142
221
 
143
- export const createStylesErrorHandler = () =>
144
- http.get('*/marketplace/*/styles.css', () => {
145
- return new HttpResponse('', { status: 500 });
222
+ export const createLookupMarketplaceErrorHandler = () =>
223
+ http.post('*/rpc/MarketplaceService/LookupMarketplace', () => {
224
+ return mockLookupMarketplaceError();
146
225
  });
147
226
 
148
227
  // Default handlers
149
228
  export const handlers = [
150
- createLookupMarketplaceConfigHandler(),
151
- createLookupMarketplaceConfigErrorHandler(),
152
- createStylesHandler(),
153
- createStylesErrorHandler(),
229
+ createLookupMarketplaceHandler(),
230
+ createLookupMarketplaceErrorHandler(),
154
231
  ];
@@ -1,6 +1,6 @@
1
- import { API } from './builder.gen';
1
+ import { MarketplaceService } from './builder.gen';
2
2
 
3
- export class BuilderAPI extends API {
3
+ export class BuilderAPI extends MarketplaceService {
4
4
  constructor(
5
5
  hostname: string,
6
6
  public projectAccessKey?: string,