@0xsequence/marketplace-sdk 0.8.9 → 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 (196) hide show
  1. package/.changeset/fluffy-jokes-lay.md +5 -0
  2. package/.changeset/wise-bugs-boil.md +8 -0
  3. package/CHANGELOG.md +43 -0
  4. package/dist/{chunk-FMEEJFAF.js → chunk-5C6ZZ6WX.js} +1 -1
  5. package/dist/{chunk-YEGD7PWE.js → chunk-5O44EPXZ.js} +2 -2
  6. package/dist/chunk-6CTFVBKU.js +1 -0
  7. package/dist/{chunk-DWTLVJAW.js → chunk-6OPMUCGX.js} +1 -1
  8. package/dist/chunk-6OPMUCGX.js.map +1 -0
  9. package/dist/{chunk-O34GCB47.js → chunk-L6KWLCER.js} +4 -4
  10. package/dist/chunk-L6KWLCER.js.map +1 -0
  11. package/dist/{chunk-4XLXOEXQ.js → chunk-LAP2CKLN.js} +78 -4
  12. package/dist/chunk-LAP2CKLN.js.map +1 -0
  13. package/dist/{chunk-Y63BOO6M.js → chunk-LECCEZAO.js} +1 -1
  14. package/dist/{chunk-YALXP2PW.js → chunk-N7SQWS2R.js} +3 -3
  15. package/dist/{chunk-KGM2WLSP.js → chunk-OAOONM4S.js} +695 -440
  16. package/dist/chunk-OAOONM4S.js.map +1 -0
  17. package/dist/chunk-Q3ECVC4F.js +811 -0
  18. package/dist/chunk-Q3ECVC4F.js.map +1 -0
  19. package/dist/chunk-QY52UADF.js +107 -0
  20. package/dist/chunk-QY52UADF.js.map +1 -0
  21. package/dist/{chunk-I2BYHDFE.js → chunk-TNAR3XEF.js} +3898 -844
  22. package/dist/chunk-TNAR3XEF.js.map +1 -0
  23. package/dist/chunk-XABYNWXO.js +549 -0
  24. package/dist/chunk-XABYNWXO.js.map +1 -0
  25. package/dist/chunk-YB5UUF2G.js +11 -0
  26. package/dist/chunk-YB5UUF2G.js.map +1 -0
  27. package/dist/{chunk-35WWD5V6.js → chunk-YWGFI4PN.js} +88 -25
  28. package/dist/chunk-YWGFI4PN.js.map +1 -0
  29. package/dist/{create-config-DwrnzwpM.d.ts → create-config-DLMvMTkZ.d.ts} +2 -2
  30. package/dist/index.css +7 -7
  31. package/dist/index.css.map +1 -1
  32. package/dist/index.d.ts +8 -6
  33. package/dist/index.js +19 -14
  34. package/dist/{lowestListing-BQHIuvNF.d.ts → marketCurrencies-enNVYwBk.d.ts} +95 -3
  35. package/dist/{marketplace.gen-DQzWciwC.d.ts → marketplace.gen-D24veUQs.d.ts} +3 -2
  36. package/dist/marketplaceConfig-BwNAbLPw.d.ts +21 -0
  37. package/dist/new-marketplace-types-BCw19X9S.d.ts +102 -0
  38. package/dist/react/_internal/api/index.d.ts +4 -3
  39. package/dist/react/_internal/api/index.js +5 -1
  40. package/dist/react/_internal/databeat/index.css +2764 -0
  41. package/dist/react/_internal/databeat/index.css.map +1 -0
  42. package/dist/react/_internal/databeat/index.d.ts +1 -1
  43. package/dist/react/_internal/databeat/index.js +15 -14
  44. package/dist/react/_internal/index.d.ts +62 -9
  45. package/dist/react/_internal/index.js +7 -3
  46. package/dist/react/_internal/wagmi/index.d.ts +5 -6
  47. package/dist/react/_internal/wagmi/index.js +1 -1
  48. package/dist/react/hooks/index.css +2764 -0
  49. package/dist/react/hooks/index.css.map +1 -0
  50. package/dist/react/hooks/index.d.ts +74 -222
  51. package/dist/react/hooks/index.js +21 -22
  52. package/dist/react/hooks/options/index.d.ts +5 -4
  53. package/dist/react/hooks/options/index.js +9 -7
  54. package/dist/react/index.css +7 -7
  55. package/dist/react/index.css.map +1 -1
  56. package/dist/react/index.d.ts +12 -11
  57. package/dist/react/index.js +34 -37
  58. package/dist/react/queries/index.d.ts +4 -3
  59. package/dist/react/queries/index.js +19 -6
  60. package/dist/react/ssr/index.d.ts +3 -3
  61. package/dist/react/ssr/index.js +6 -5
  62. package/dist/react/ssr/index.js.map +1 -1
  63. package/dist/react/ui/components/collectible-card/index.css +7 -7
  64. package/dist/react/ui/components/collectible-card/index.css.map +1 -1
  65. package/dist/react/ui/components/collectible-card/index.d.ts +9 -6
  66. package/dist/react/ui/components/collectible-card/index.js +19 -23
  67. package/dist/react/ui/components/marketplace-logos/index.js +1 -1
  68. package/dist/react/ui/icons/index.js +9 -8
  69. package/dist/react/ui/index.css +7 -7
  70. package/dist/react/ui/index.css.map +1 -1
  71. package/dist/react/ui/index.d.ts +2 -2
  72. package/dist/react/ui/index.js +17 -21
  73. package/dist/react/ui/modals/_internal/components/actionModal/index.css +2764 -0
  74. package/dist/react/ui/modals/_internal/components/actionModal/index.css.map +1 -0
  75. package/dist/react/ui/modals/_internal/components/actionModal/index.js +15 -14
  76. package/dist/sdk-config-qorA0TgF.d.ts +165 -0
  77. package/dist/{services-BI_w8Eq4.d.ts → services-WrshxCqc.d.ts} +6 -3
  78. package/dist/types/index.d.ts +5 -4
  79. package/dist/types/index.js +7 -7
  80. package/dist/{index-DGsVBflk.d.ts → useCollection-YAdXfVO7.d.ts} +1 -2
  81. package/dist/utils/abi/index.d.ts +1 -0
  82. package/dist/utils/abi/index.js +7 -1
  83. package/dist/utils/abi/primary-sale/index.d.ts +1054 -0
  84. package/dist/utils/abi/primary-sale/index.js +9 -0
  85. package/dist/utils/index.d.ts +2 -1
  86. package/dist/utils/index.js +13 -6
  87. package/package.json +32 -32
  88. package/src/react/_internal/api/__mocks__/builder.msw.ts +157 -80
  89. package/src/react/_internal/api/builder-api.ts +2 -2
  90. package/src/react/_internal/api/builder.gen.ts +667 -112
  91. package/src/react/_internal/api/marketplace.gen.ts +1981 -1316
  92. package/src/react/_internal/api/services.ts +12 -1
  93. package/src/react/_internal/types.ts +1 -13
  94. package/src/react/_internal/wagmi/__tests__/create-config.test.ts +99 -84
  95. package/src/react/_internal/wagmi/create-config.ts +8 -4
  96. package/src/react/_internal/wagmi/get-connectors.ts +24 -19
  97. package/src/react/hooks/__tests__/__snapshots__/useListCollections.test.tsx.snap +114 -0
  98. package/src/react/hooks/__tests__/__snapshots__/useMarketplaceConfig.test.tsx.snap +85 -83
  99. package/src/react/hooks/__tests__/useFilters.test.tsx +0 -16
  100. package/src/react/hooks/__tests__/useInventory.test.tsx +16 -16
  101. package/src/react/hooks/__tests__/useListCollections.test.tsx +23 -56
  102. package/src/react/hooks/__tests__/{useCurrencies.test.tsx → useMarketCurrencies.test.tsx} +21 -15
  103. package/src/react/hooks/__tests__/useMarketplaceConfig.test.tsx +2 -59
  104. package/src/react/hooks/index.ts +3 -1
  105. package/src/react/hooks/useBalanceOfCollectible.tsx +5 -3
  106. package/src/react/hooks/useConvertPriceToUSD.tsx +1 -1
  107. package/src/react/hooks/useFilters.tsx +14 -22
  108. package/src/react/hooks/useGetTokenSuppliesMap.ts +28 -0
  109. package/src/react/hooks/useInventory.tsx +4 -3
  110. package/src/react/hooks/useList1155SaleSupplies.tsx +62 -0
  111. package/src/react/hooks/useListBalances.tsx +5 -3
  112. package/src/react/hooks/useListCollectibles.tsx +5 -3
  113. package/src/react/hooks/useListCollections.tsx +14 -76
  114. package/src/react/hooks/useListTokenMetadata.ts +19 -0
  115. package/src/react/hooks/useMarketCurrencies.tsx +8 -0
  116. package/src/react/hooks/useMarketplaceConfig.tsx +0 -2
  117. package/src/react/queries/index.ts +2 -0
  118. package/src/react/queries/inventory.ts +1 -1
  119. package/src/react/queries/listCollections.ts +118 -0
  120. package/src/react/queries/listTokenMetadata.ts +38 -0
  121. package/src/react/queries/marketCurrencies.ts +77 -0
  122. package/src/react/queries/marketplaceConfig.ts +83 -55
  123. package/src/react/ssr/__tests__/__snapshots__/create-ssr-client.test.ts.snap +85 -83
  124. package/src/react/ui/components/collectible-card/CollectibleCard.tsx +2 -2
  125. package/src/react/ui/components/collectible-card/__tests__/{CollectibleAsset.test.tsx → Media.test.tsx} +48 -14
  126. package/src/react/ui/components/collectible-card/index.ts +1 -1
  127. package/src/react/ui/components/collectible-card/media/Media.tsx +211 -0
  128. package/src/react/ui/components/collectible-card/{collectible-asset/CollectibleAssetSkeleton.tsx → media/MediaSkeleton.tsx} +2 -2
  129. package/src/react/ui/components/collectible-card/media/types.ts +18 -0
  130. package/src/react/ui/components/collectible-card/{collectible-asset → media}/utils.ts +8 -3
  131. package/src/react/ui/index.ts +1 -1
  132. package/src/react/ui/modals/BuyModal/ERC1155QuantityModal.tsx +9 -3
  133. package/src/react/ui/modals/BuyModal/hooks/__tests__/useFees.test.tsx +31 -21
  134. package/src/react/ui/modals/BuyModal/hooks/useFees.ts +3 -2
  135. package/src/react/ui/modals/BuyModal/hooks/usePaymentModalParams.ts +28 -3
  136. package/src/react/ui/modals/CreateListingModal/Modal.tsx +3 -5
  137. package/src/react/ui/modals/CreateListingModal/hooks/useCreateListing.tsx +5 -3
  138. package/src/react/ui/modals/CreateListingModal/hooks/useTransactionSteps.tsx +2 -2
  139. package/src/react/ui/modals/MakeOfferModal/Modal.tsx +2 -3
  140. package/src/react/ui/modals/MakeOfferModal/hooks/useMakeOffer.tsx +4 -3
  141. package/src/react/ui/modals/SellModal/Modal.tsx +0 -1
  142. package/src/react/ui/modals/SellModal/hooks/useTransactionSteps.tsx +2 -2
  143. package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/_components/WalletAddressInput.tsx +1 -1
  144. package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/index.tsx +0 -1
  145. package/src/react/ui/modals/TransferModal/index.tsx +0 -1
  146. package/src/react/ui/modals/_internal/components/currencyOptionsSelect/__tests__/index.test.tsx +2 -2
  147. package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +7 -6
  148. package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/__tests__/SelectWaasFeeOptions.test.tsx +13 -7
  149. package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/index.tsx +3 -5
  150. package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/useWaasFeeOptionManager.tsx +5 -3
  151. package/src/react/ui/modals/_internal/components/transactionDetails/index.tsx +2 -2
  152. package/src/react/ui/modals/_internal/hooks/useSelectWaasFeeOptions.ts +2 -12
  153. package/src/types/index.ts +1 -6
  154. package/src/types/new-marketplace-types.ts +119 -0
  155. package/src/types/sdk-config.ts +19 -2
  156. package/src/types/types.ts +1 -0
  157. package/src/utils/abi/index.ts +1 -0
  158. package/src/utils/abi/primary-sale/index.ts +2 -0
  159. package/src/utils/abi/primary-sale/sequence-1155-sales-contract.ts +450 -0
  160. package/src/utils/abi/primary-sale/sequence-721-sales-contract.ts +352 -0
  161. package/src/utils/abi/token/sequence-erc1155-items.ts +454 -0
  162. package/src/utils/fetchContentType.ts +5 -1
  163. package/tsconfig.tsbuildinfo +1 -1
  164. package/dist/chunk-35WWD5V6.js.map +0 -1
  165. package/dist/chunk-4XLXOEXQ.js.map +0 -1
  166. package/dist/chunk-D7RVSZAQ.js +0 -332
  167. package/dist/chunk-D7RVSZAQ.js.map +0 -1
  168. package/dist/chunk-DWTLVJAW.js.map +0 -1
  169. package/dist/chunk-EODKQL6Y.js +0 -76
  170. package/dist/chunk-EODKQL6Y.js.map +0 -1
  171. package/dist/chunk-G3447GIP.js +0 -2880
  172. package/dist/chunk-G3447GIP.js.map +0 -1
  173. package/dist/chunk-HHYNOPPI.js +0 -53
  174. package/dist/chunk-HHYNOPPI.js.map +0 -1
  175. package/dist/chunk-I2BYHDFE.js.map +0 -1
  176. package/dist/chunk-JKCF7HEA.js +0 -1
  177. package/dist/chunk-KGM2WLSP.js.map +0 -1
  178. package/dist/chunk-MAD64DLJ.js +0 -81
  179. package/dist/chunk-MAD64DLJ.js.map +0 -1
  180. package/dist/chunk-N7BPFK46.js +0 -1
  181. package/dist/chunk-O34GCB47.js.map +0 -1
  182. package/dist/chunk-UISBTKFF.js +0 -1
  183. package/dist/chunk-UISBTKFF.js.map +0 -1
  184. package/dist/chunk-YBOFRP65.js +0 -128
  185. package/dist/chunk-YBOFRP65.js.map +0 -1
  186. package/dist/marketplaceConfig-B4Fdsmxu.d.ts +0 -17
  187. package/dist/sdk-config-txlivEKe.d.ts +0 -133
  188. package/dist/types-isjvwapz.d.ts +0 -68
  189. package/src/react/hooks/useCurrencies.tsx +0 -77
  190. package/src/react/ui/components/collectible-card/collectible-asset/CollectibleAsset.tsx +0 -174
  191. /package/dist/{chunk-FMEEJFAF.js.map → chunk-5C6ZZ6WX.js.map} +0 -0
  192. /package/dist/{chunk-YEGD7PWE.js.map → chunk-5O44EPXZ.js.map} +0 -0
  193. /package/dist/{chunk-JKCF7HEA.js.map → chunk-6CTFVBKU.js.map} +0 -0
  194. /package/dist/{chunk-Y63BOO6M.js.map → chunk-LECCEZAO.js.map} +0 -0
  195. /package/dist/{chunk-YALXP2PW.js.map → chunk-N7SQWS2R.js.map} +0 -0
  196. /package/dist/{chunk-N7BPFK46.js.map → utils/abi/primary-sale/index.js.map} +0 -0
@@ -0,0 +1,9 @@
1
+ import {
2
+ ERC1155_SALES_CONTRACT_ABI,
3
+ ERC721_SALE_ABI
4
+ } from "../../../chunk-Q3ECVC4F.js";
5
+ export {
6
+ ERC1155_SALES_CONTRACT_ABI,
7
+ ERC721_SALE_ABI
8
+ };
9
+ //# sourceMappingURL=index.js.map
@@ -1,8 +1,9 @@
1
1
  export { EIP2981_ABI, SequenceMarketplaceV1_ABI, SequenceMarketplaceV2_ABI } from './abi/marketplace/index.js';
2
2
  export { ERC1155_ABI, ERC20_ABI, ERC721_ABI } from './abi/token/index.js';
3
+ export { ERC1155_SALES_CONTRACT_ABI, ERC721_SALE_ABI } from './abi/primary-sale/index.js';
3
4
  import { Image } from '@0xsequence/design-system';
4
5
  import { ComponentType } from 'react';
5
- import { M as MarketplaceKind } from '../marketplace.gen-DQzWciwC.js';
6
+ import { M as MarketplaceKind } from '../marketplace.gen-D24veUQs.js';
6
7
  import { NetworkConfig } from '@0xsequence/network';
7
8
  import { Chain } from 'viem';
8
9
  import { ClassValue } from 'clsx';
@@ -10,29 +10,36 @@ import {
10
10
  networkToWagmiChain,
11
11
  truncateEnd,
12
12
  truncateMiddle
13
- } from "../chunk-YEGD7PWE.js";
14
- import "../chunk-FMEEJFAF.js";
15
- import "../chunk-UISBTKFF.js";
13
+ } from "../chunk-5O44EPXZ.js";
14
+ import "../chunk-5C6ZZ6WX.js";
15
+ import "../chunk-6CTFVBKU.js";
16
16
  import {
17
17
  ERC1155_ABI,
18
18
  ERC20_ABI,
19
19
  ERC721_ABI
20
20
  } from "../chunk-FUM4OGOQ.js";
21
+ import {
22
+ ERC1155_SALES_CONTRACT_ABI,
23
+ ERC721_SALE_ABI
24
+ } from "../chunk-Q3ECVC4F.js";
21
25
  import {
22
26
  EIP2981_ABI,
23
27
  SequenceMarketplaceV1_ABI,
24
28
  SequenceMarketplaceV2_ABI
25
29
  } from "../chunk-XX4EVWBF.js";
26
30
  import "../chunk-2PSNAIAT.js";
27
- import "../chunk-DWTLVJAW.js";
28
- import "../chunk-KGM2WLSP.js";
29
- import "../chunk-D7RVSZAQ.js";
31
+ import "../chunk-YB5UUF2G.js";
32
+ import "../chunk-6OPMUCGX.js";
33
+ import "../chunk-OAOONM4S.js";
34
+ import "../chunk-XABYNWXO.js";
30
35
  import "../chunk-NX52D7NX.js";
31
36
  export {
32
37
  EIP2981_ABI,
33
38
  ERC1155_ABI,
39
+ ERC1155_SALES_CONTRACT_ABI,
34
40
  ERC20_ABI,
35
41
  ERC721_ABI,
42
+ ERC721_SALE_ABI,
36
43
  SequenceMarketplaceV1_ABI,
37
44
  SequenceMarketplaceV2_ABI,
38
45
  calculateEarningsAfterFees,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@0xsequence/marketplace-sdk",
3
3
  "private": false,
4
- "version": "0.8.9",
4
+ "version": "0.8.11",
5
5
  "type": "module",
6
6
  "sideEffects": [
7
7
  "**/*.css"
@@ -41,60 +41,60 @@
41
41
  "dependencies": {
42
42
  "@databeat/tracker": "^0.9.3",
43
43
  "@legendapp/state": "^3.0.0-beta.30",
44
- "@tailwindcss/postcss": "^4.0.15",
45
- "@xstate/store": "^3.4.3",
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",
52
- "tailwind-merge": "^3.0.2",
53
- "zod": "^3.24.2"
51
+ "react-day-picker": "^9.7.0",
52
+ "tailwind-merge": "^3.3.0",
53
+ "zod": "^3.25.7"
54
54
  },
55
55
  "peerDependencies": {
56
- "0xsequence": "^2.3.8",
57
- "@0xsequence/api": "^2.3.8",
58
- "@0xsequence/checkout": "^5.2.2",
59
- "@0xsequence/connect": "^5.2.2",
56
+ "0xsequence": "^2.3.12",
57
+ "@0xsequence/api": "^2.3.12",
58
+ "@0xsequence/checkout": "^5.3.3",
59
+ "@0xsequence/connect": "^5.3.3",
60
60
  "@0xsequence/design-system": "^2.1.12",
61
- "@0xsequence/indexer": "^2.3.8",
62
- "@0xsequence/metadata": "^2.3.8",
63
- "@0xsequence/network": "^2.3.8",
64
- "@tanstack/react-query": "^5.74.3",
61
+ "@0xsequence/indexer": "^2.3.12",
62
+ "@0xsequence/metadata": "^2.3.12",
63
+ "@0xsequence/network": "^2.3.12",
64
+ "@tanstack/react-query": "^5.76.1",
65
65
  "react": "^19.1.0",
66
66
  "react-dom": "^19.1.0",
67
- "viem": "^2.27.0",
68
- "wagmi": "^2.14.16",
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
- "@changesets/cli": "^2.29.0",
74
- "@eslint/js": "^9.23.0",
73
+ "@changesets/cli": "^2.29.4",
74
+ "@eslint/js": "^9.27.0",
75
75
  "@testing-library/jest-dom": "6.4.7",
76
- "@testing-library/react": "^16.2.0",
77
- "@types/react": "^19.1.2",
78
- "@types/react-dom": "^19.1.2",
76
+ "@testing-library/react": "^16.3.0",
77
+ "@types/react": "^19.1.4",
78
+ "@types/react-dom": "^19.1.5",
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.23.0",
82
+ "eslint": "^9.27.0",
83
83
  "eslint-config-biome": "^1.9.4",
84
- "eslint-plugin-react": "^7.37.4",
84
+ "eslint-plugin-react": "^7.37.5",
85
85
  "eslint-plugin-react-hooks": "^5.2.0",
86
- "globals": "^16.0.0",
87
- "happy-dom": "^17.4.4",
88
- "jsdom": "^26.0.0",
89
- "msw": "^2.7.3",
86
+ "globals": "^16.1.0",
87
+ "happy-dom": "^17.4.7",
88
+ "jsdom": "^26.1.0",
89
+ "msw": "^2.8.4",
90
90
  "postcss": "^8.5.3",
91
- "prool": "^0.0.23",
92
- "tailwindcss": "^4.1.4",
93
- "tsup": "^8.4.0",
91
+ "prool": "^0.0.24",
92
+ "tailwindcss": "^4.1.7",
93
+ "tsup": "^8.5.0",
94
94
  "typescript": "^5.8.3",
95
- "typescript-eslint": "^8.27.0",
95
+ "typescript-eslint": "^8.32.1",
96
96
  "vite-tsconfig-paths": "^5.1.4",
97
- "vitest": "^3.0.9"
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,