@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.
- package/.changeset/fluffy-jokes-lay.md +5 -0
- package/.changeset/wise-bugs-boil.md +8 -0
- package/CHANGELOG.md +43 -0
- package/dist/{chunk-FMEEJFAF.js → chunk-5C6ZZ6WX.js} +1 -1
- package/dist/{chunk-YEGD7PWE.js → chunk-5O44EPXZ.js} +2 -2
- package/dist/chunk-6CTFVBKU.js +1 -0
- package/dist/{chunk-DWTLVJAW.js → chunk-6OPMUCGX.js} +1 -1
- package/dist/chunk-6OPMUCGX.js.map +1 -0
- package/dist/{chunk-O34GCB47.js → chunk-L6KWLCER.js} +4 -4
- package/dist/chunk-L6KWLCER.js.map +1 -0
- package/dist/{chunk-4XLXOEXQ.js → chunk-LAP2CKLN.js} +78 -4
- package/dist/chunk-LAP2CKLN.js.map +1 -0
- package/dist/{chunk-Y63BOO6M.js → chunk-LECCEZAO.js} +1 -1
- package/dist/{chunk-YALXP2PW.js → chunk-N7SQWS2R.js} +3 -3
- package/dist/{chunk-KGM2WLSP.js → chunk-OAOONM4S.js} +695 -440
- package/dist/chunk-OAOONM4S.js.map +1 -0
- package/dist/chunk-Q3ECVC4F.js +811 -0
- package/dist/chunk-Q3ECVC4F.js.map +1 -0
- package/dist/chunk-QY52UADF.js +107 -0
- package/dist/chunk-QY52UADF.js.map +1 -0
- package/dist/{chunk-I2BYHDFE.js → chunk-TNAR3XEF.js} +3898 -844
- package/dist/chunk-TNAR3XEF.js.map +1 -0
- package/dist/chunk-XABYNWXO.js +549 -0
- package/dist/chunk-XABYNWXO.js.map +1 -0
- package/dist/chunk-YB5UUF2G.js +11 -0
- package/dist/chunk-YB5UUF2G.js.map +1 -0
- package/dist/{chunk-35WWD5V6.js → chunk-YWGFI4PN.js} +88 -25
- package/dist/chunk-YWGFI4PN.js.map +1 -0
- package/dist/{create-config-DwrnzwpM.d.ts → create-config-DLMvMTkZ.d.ts} +2 -2
- package/dist/index.css +7 -7
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +8 -6
- package/dist/index.js +19 -14
- package/dist/{lowestListing-BQHIuvNF.d.ts → marketCurrencies-enNVYwBk.d.ts} +95 -3
- package/dist/{marketplace.gen-DQzWciwC.d.ts → marketplace.gen-D24veUQs.d.ts} +3 -2
- package/dist/marketplaceConfig-BwNAbLPw.d.ts +21 -0
- package/dist/new-marketplace-types-BCw19X9S.d.ts +102 -0
- package/dist/react/_internal/api/index.d.ts +4 -3
- package/dist/react/_internal/api/index.js +5 -1
- package/dist/react/_internal/databeat/index.css +2764 -0
- package/dist/react/_internal/databeat/index.css.map +1 -0
- package/dist/react/_internal/databeat/index.d.ts +1 -1
- package/dist/react/_internal/databeat/index.js +15 -14
- package/dist/react/_internal/index.d.ts +62 -9
- package/dist/react/_internal/index.js +7 -3
- package/dist/react/_internal/wagmi/index.d.ts +5 -6
- package/dist/react/_internal/wagmi/index.js +1 -1
- package/dist/react/hooks/index.css +2764 -0
- package/dist/react/hooks/index.css.map +1 -0
- package/dist/react/hooks/index.d.ts +74 -222
- package/dist/react/hooks/index.js +21 -22
- package/dist/react/hooks/options/index.d.ts +5 -4
- package/dist/react/hooks/options/index.js +9 -7
- package/dist/react/index.css +7 -7
- package/dist/react/index.css.map +1 -1
- package/dist/react/index.d.ts +12 -11
- package/dist/react/index.js +34 -37
- package/dist/react/queries/index.d.ts +4 -3
- package/dist/react/queries/index.js +19 -6
- package/dist/react/ssr/index.d.ts +3 -3
- package/dist/react/ssr/index.js +6 -5
- package/dist/react/ssr/index.js.map +1 -1
- package/dist/react/ui/components/collectible-card/index.css +7 -7
- package/dist/react/ui/components/collectible-card/index.css.map +1 -1
- package/dist/react/ui/components/collectible-card/index.d.ts +9 -6
- package/dist/react/ui/components/collectible-card/index.js +19 -23
- package/dist/react/ui/components/marketplace-logos/index.js +1 -1
- package/dist/react/ui/icons/index.js +9 -8
- package/dist/react/ui/index.css +7 -7
- package/dist/react/ui/index.css.map +1 -1
- package/dist/react/ui/index.d.ts +2 -2
- package/dist/react/ui/index.js +17 -21
- package/dist/react/ui/modals/_internal/components/actionModal/index.css +2764 -0
- package/dist/react/ui/modals/_internal/components/actionModal/index.css.map +1 -0
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +15 -14
- package/dist/sdk-config-qorA0TgF.d.ts +165 -0
- package/dist/{services-BI_w8Eq4.d.ts → services-WrshxCqc.d.ts} +6 -3
- package/dist/types/index.d.ts +5 -4
- package/dist/types/index.js +7 -7
- package/dist/{index-DGsVBflk.d.ts → useCollection-YAdXfVO7.d.ts} +1 -2
- package/dist/utils/abi/index.d.ts +1 -0
- package/dist/utils/abi/index.js +7 -1
- package/dist/utils/abi/primary-sale/index.d.ts +1054 -0
- package/dist/utils/abi/primary-sale/index.js +9 -0
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.js +13 -6
- package/package.json +32 -32
- package/src/react/_internal/api/__mocks__/builder.msw.ts +157 -80
- package/src/react/_internal/api/builder-api.ts +2 -2
- package/src/react/_internal/api/builder.gen.ts +667 -112
- package/src/react/_internal/api/marketplace.gen.ts +1981 -1316
- package/src/react/_internal/api/services.ts +12 -1
- package/src/react/_internal/types.ts +1 -13
- package/src/react/_internal/wagmi/__tests__/create-config.test.ts +99 -84
- package/src/react/_internal/wagmi/create-config.ts +8 -4
- package/src/react/_internal/wagmi/get-connectors.ts +24 -19
- package/src/react/hooks/__tests__/__snapshots__/useListCollections.test.tsx.snap +114 -0
- package/src/react/hooks/__tests__/__snapshots__/useMarketplaceConfig.test.tsx.snap +85 -83
- package/src/react/hooks/__tests__/useFilters.test.tsx +0 -16
- package/src/react/hooks/__tests__/useInventory.test.tsx +16 -16
- package/src/react/hooks/__tests__/useListCollections.test.tsx +23 -56
- package/src/react/hooks/__tests__/{useCurrencies.test.tsx → useMarketCurrencies.test.tsx} +21 -15
- package/src/react/hooks/__tests__/useMarketplaceConfig.test.tsx +2 -59
- package/src/react/hooks/index.ts +3 -1
- package/src/react/hooks/useBalanceOfCollectible.tsx +5 -3
- package/src/react/hooks/useConvertPriceToUSD.tsx +1 -1
- package/src/react/hooks/useFilters.tsx +14 -22
- package/src/react/hooks/useGetTokenSuppliesMap.ts +28 -0
- package/src/react/hooks/useInventory.tsx +4 -3
- package/src/react/hooks/useList1155SaleSupplies.tsx +62 -0
- package/src/react/hooks/useListBalances.tsx +5 -3
- package/src/react/hooks/useListCollectibles.tsx +5 -3
- package/src/react/hooks/useListCollections.tsx +14 -76
- package/src/react/hooks/useListTokenMetadata.ts +19 -0
- package/src/react/hooks/useMarketCurrencies.tsx +8 -0
- package/src/react/hooks/useMarketplaceConfig.tsx +0 -2
- package/src/react/queries/index.ts +2 -0
- package/src/react/queries/inventory.ts +1 -1
- package/src/react/queries/listCollections.ts +118 -0
- package/src/react/queries/listTokenMetadata.ts +38 -0
- package/src/react/queries/marketCurrencies.ts +77 -0
- package/src/react/queries/marketplaceConfig.ts +83 -55
- package/src/react/ssr/__tests__/__snapshots__/create-ssr-client.test.ts.snap +85 -83
- package/src/react/ui/components/collectible-card/CollectibleCard.tsx +2 -2
- package/src/react/ui/components/collectible-card/__tests__/{CollectibleAsset.test.tsx → Media.test.tsx} +48 -14
- package/src/react/ui/components/collectible-card/index.ts +1 -1
- package/src/react/ui/components/collectible-card/media/Media.tsx +211 -0
- package/src/react/ui/components/collectible-card/{collectible-asset/CollectibleAssetSkeleton.tsx → media/MediaSkeleton.tsx} +2 -2
- package/src/react/ui/components/collectible-card/media/types.ts +18 -0
- package/src/react/ui/components/collectible-card/{collectible-asset → media}/utils.ts +8 -3
- package/src/react/ui/index.ts +1 -1
- package/src/react/ui/modals/BuyModal/ERC1155QuantityModal.tsx +9 -3
- package/src/react/ui/modals/BuyModal/hooks/__tests__/useFees.test.tsx +31 -21
- package/src/react/ui/modals/BuyModal/hooks/useFees.ts +3 -2
- package/src/react/ui/modals/BuyModal/hooks/usePaymentModalParams.ts +28 -3
- package/src/react/ui/modals/CreateListingModal/Modal.tsx +3 -5
- package/src/react/ui/modals/CreateListingModal/hooks/useCreateListing.tsx +5 -3
- package/src/react/ui/modals/CreateListingModal/hooks/useTransactionSteps.tsx +2 -2
- package/src/react/ui/modals/MakeOfferModal/Modal.tsx +2 -3
- package/src/react/ui/modals/MakeOfferModal/hooks/useMakeOffer.tsx +4 -3
- package/src/react/ui/modals/SellModal/Modal.tsx +0 -1
- package/src/react/ui/modals/SellModal/hooks/useTransactionSteps.tsx +2 -2
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/_components/WalletAddressInput.tsx +1 -1
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/index.tsx +0 -1
- package/src/react/ui/modals/TransferModal/index.tsx +0 -1
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/__tests__/index.test.tsx +2 -2
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +7 -6
- package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/__tests__/SelectWaasFeeOptions.test.tsx +13 -7
- package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/index.tsx +3 -5
- package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/useWaasFeeOptionManager.tsx +5 -3
- package/src/react/ui/modals/_internal/components/transactionDetails/index.tsx +2 -2
- package/src/react/ui/modals/_internal/hooks/useSelectWaasFeeOptions.ts +2 -12
- package/src/types/index.ts +1 -6
- package/src/types/new-marketplace-types.ts +119 -0
- package/src/types/sdk-config.ts +19 -2
- package/src/types/types.ts +1 -0
- package/src/utils/abi/index.ts +1 -0
- package/src/utils/abi/primary-sale/index.ts +2 -0
- package/src/utils/abi/primary-sale/sequence-1155-sales-contract.ts +450 -0
- package/src/utils/abi/primary-sale/sequence-721-sales-contract.ts +352 -0
- package/src/utils/abi/token/sequence-erc1155-items.ts +454 -0
- package/src/utils/fetchContentType.ts +5 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/chunk-35WWD5V6.js.map +0 -1
- package/dist/chunk-4XLXOEXQ.js.map +0 -1
- package/dist/chunk-D7RVSZAQ.js +0 -332
- package/dist/chunk-D7RVSZAQ.js.map +0 -1
- package/dist/chunk-DWTLVJAW.js.map +0 -1
- package/dist/chunk-EODKQL6Y.js +0 -76
- package/dist/chunk-EODKQL6Y.js.map +0 -1
- package/dist/chunk-G3447GIP.js +0 -2880
- package/dist/chunk-G3447GIP.js.map +0 -1
- package/dist/chunk-HHYNOPPI.js +0 -53
- package/dist/chunk-HHYNOPPI.js.map +0 -1
- package/dist/chunk-I2BYHDFE.js.map +0 -1
- package/dist/chunk-JKCF7HEA.js +0 -1
- package/dist/chunk-KGM2WLSP.js.map +0 -1
- package/dist/chunk-MAD64DLJ.js +0 -81
- package/dist/chunk-MAD64DLJ.js.map +0 -1
- package/dist/chunk-N7BPFK46.js +0 -1
- package/dist/chunk-O34GCB47.js.map +0 -1
- package/dist/chunk-UISBTKFF.js +0 -1
- package/dist/chunk-UISBTKFF.js.map +0 -1
- package/dist/chunk-YBOFRP65.js +0 -128
- package/dist/chunk-YBOFRP65.js.map +0 -1
- package/dist/marketplaceConfig-B4Fdsmxu.d.ts +0 -17
- package/dist/sdk-config-txlivEKe.d.ts +0 -133
- package/dist/types-isjvwapz.d.ts +0 -68
- package/src/react/hooks/useCurrencies.tsx +0 -77
- package/src/react/ui/components/collectible-card/collectible-asset/CollectibleAsset.tsx +0 -174
- /package/dist/{chunk-FMEEJFAF.js.map → chunk-5C6ZZ6WX.js.map} +0 -0
- /package/dist/{chunk-YEGD7PWE.js.map → chunk-5O44EPXZ.js.map} +0 -0
- /package/dist/{chunk-JKCF7HEA.js.map → chunk-6CTFVBKU.js.map} +0 -0
- /package/dist/{chunk-Y63BOO6M.js.map → chunk-LECCEZAO.js.map} +0 -0
- /package/dist/{chunk-YALXP2PW.js.map → chunk-N7SQWS2R.js.map} +0 -0
- /package/dist/{chunk-N7BPFK46.js.map → utils/abi/primary-sale/index.js.map} +0 -0
package/dist/utils/index.d.ts
CHANGED
|
@@ -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-
|
|
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';
|
package/dist/utils/index.js
CHANGED
|
@@ -10,29 +10,36 @@ import {
|
|
|
10
10
|
networkToWagmiChain,
|
|
11
11
|
truncateEnd,
|
|
12
12
|
truncateMiddle
|
|
13
|
-
} from "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
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-
|
|
28
|
-
import "../chunk-
|
|
29
|
-
import "../chunk-
|
|
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.
|
|
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.
|
|
45
|
-
"@xstate/store": "^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.
|
|
52
|
-
"tailwind-merge": "^3.0
|
|
53
|
-
"zod": "^3.
|
|
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.
|
|
57
|
-
"@0xsequence/api": "^2.3.
|
|
58
|
-
"@0xsequence/checkout": "^5.
|
|
59
|
-
"@0xsequence/connect": "^5.
|
|
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.
|
|
62
|
-
"@0xsequence/metadata": "^2.3.
|
|
63
|
-
"@0xsequence/network": "^2.3.
|
|
64
|
-
"@tanstack/react-query": "^5.
|
|
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.
|
|
68
|
-
"wagmi": "^2.
|
|
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.
|
|
74
|
-
"@eslint/js": "^9.
|
|
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.
|
|
77
|
-
"@types/react": "^19.1.
|
|
78
|
-
"@types/react-dom": "^19.1.
|
|
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.
|
|
82
|
+
"eslint": "^9.27.0",
|
|
83
83
|
"eslint-config-biome": "^1.9.4",
|
|
84
|
-
"eslint-plugin-react": "^7.37.
|
|
84
|
+
"eslint-plugin-react": "^7.37.5",
|
|
85
85
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
86
|
-
"globals": "^16.
|
|
87
|
-
"happy-dom": "^17.4.
|
|
88
|
-
"jsdom": "^26.
|
|
89
|
-
"msw": "^2.
|
|
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.
|
|
92
|
-
"tailwindcss": "^4.1.
|
|
93
|
-
"tsup": "^8.
|
|
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.
|
|
95
|
+
"typescript-eslint": "^8.32.1",
|
|
96
96
|
"vite-tsconfig-paths": "^5.1.4",
|
|
97
|
-
"vitest": "^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
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
|
11
|
+
export const mockMarketCollections = [
|
|
14
12
|
{
|
|
15
|
-
|
|
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
|
-
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
|
|
84
|
-
landingPageLayout: 'default',
|
|
85
|
-
cssString: '',
|
|
86
|
-
manifestUrl: '',
|
|
87
|
-
bannerUrl: '',
|
|
88
|
-
};
|
|
89
|
+
];
|
|
89
90
|
|
|
90
|
-
export const
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
|
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
|
|
123
|
-
|
|
213
|
+
export const createLookupMarketplaceHandler = (
|
|
214
|
+
config: LookupMarketplaceReturn = mockConfig,
|
|
215
|
+
) =>
|
|
216
|
+
http.post('*/rpc/MarketplaceService/LookupMarketplace', () => {
|
|
124
217
|
return HttpResponse.json({
|
|
125
|
-
|
|
126
|
-
} satisfies
|
|
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
|
|
144
|
-
http.
|
|
145
|
-
return
|
|
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
|
-
|
|
151
|
-
|
|
152
|
-
createStylesHandler(),
|
|
153
|
-
createStylesErrorHandler(),
|
|
229
|
+
createLookupMarketplaceHandler(),
|
|
230
|
+
createLookupMarketplaceErrorHandler(),
|
|
154
231
|
];
|