@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
@@ -6,7 +6,7 @@ import { observer } from '@legendapp/state/react';
6
6
  import { useEffect } from 'react';
7
7
  import type { Hex } from 'viem';
8
8
  import type { Currency } from '../../../../../_internal';
9
- import { useCurrencies } from '../../../../../hooks';
9
+ import { useMarketCurrencies } from '../../../../../hooks';
10
10
  import {
11
11
  CustomSelect,
12
12
  type SelectItem,
@@ -28,11 +28,12 @@ const CurrencyOptionsSelect = observer(function CurrencyOptionsSelect({
28
28
  includeNativeCurrency,
29
29
  }: CurrencyOptionsSelectProps) {
30
30
  const currency = selectedCurrency$.get();
31
- const { data: currencies, isLoading: currenciesLoading } = useCurrencies({
32
- chainId,
33
- collectionAddress,
34
- includeNativeCurrency,
35
- });
31
+ const { data: currencies, isLoading: currenciesLoading } =
32
+ useMarketCurrencies({
33
+ chainId,
34
+ collectionAddress,
35
+ includeNativeCurrency,
36
+ });
36
37
 
37
38
  // set default currency
38
39
  // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
@@ -84,12 +84,18 @@ describe('SelectWaasFeeOptions', () => {
84
84
  expect(container.firstChild).toBeNull();
85
85
  });
86
86
 
87
- it('should not render on testnet', () => {
87
+ it('should not render when fees are sponsored (empty options array)', () => {
88
+ const sponsoredFeeOptionConfirmation: WaasFeeOptionConfirmation = {
89
+ id: 'fee-confirmation-id',
90
+ options: [], // Empty array indicates sponsored fees
91
+ chainId: 1,
92
+ };
93
+
88
94
  vi.spyOn(useWaasFeeOptionManagerModule, 'default').mockReturnValue({
89
- selectedFeeOption$: observable<FeeOption | undefined>(mockFeeOption),
90
- selectedFeeOption: mockFeeOption,
95
+ selectedFeeOption$: observable<FeeOption | undefined>(undefined),
96
+ selectedFeeOption: undefined,
91
97
  // @ts-expect-error - types are not compatible
92
- pendingFeeOptionConfirmation: mockPendingFeeOptionConfirmation,
98
+ pendingFeeOptionConfirmation: sponsoredFeeOptionConfirmation,
93
99
  currencyBalance: mockCurrencyBalance,
94
100
  currencyBalanceLoading: false,
95
101
  insufficientBalance: false,
@@ -98,14 +104,14 @@ describe('SelectWaasFeeOptions', () => {
98
104
  });
99
105
 
100
106
  vi.spyOn(useNetworkModule, 'getNetwork').mockReturnValue({
101
- type: NetworkType.TESTNET,
107
+ type: NetworkType.MAINNET,
102
108
  chainId: 1,
103
- name: 'Testnet',
109
+ name: 'Mainnet',
104
110
  nativeToken: TEST_CURRENCY,
105
111
  });
106
112
  vi.spyOn(useWaasFeeOptionsModule, 'useWaasFeeOptions').mockReturnValue([
107
113
  // @ts-expect-error - types are not compatible
108
- mockPendingFeeOptionConfirmation,
114
+ sponsoredFeeOptionConfirmation,
109
115
  vi.fn(),
110
116
  ]);
111
117
 
@@ -1,8 +1,6 @@
1
1
  'use client';
2
2
 
3
- import { getNetwork } from '@0xsequence/connect';
4
3
  import { Divider, Skeleton, Text } from '@0xsequence/design-system';
5
- import { NetworkType } from '@0xsequence/network';
6
4
  import { observer } from '@legendapp/state/react';
7
5
  import type { FeeOption } from '../../../../../../types/waas-types';
8
6
  import { cn } from '../../../../../../utils';
@@ -26,8 +24,6 @@ const SelectWaasFeeOptions = observer(
26
24
  titleOnConfirm,
27
25
  className,
28
26
  }: SelectWaasFeeOptionsProps) => {
29
- const network = getNetwork(chainId);
30
- const isTestnet = network.type === NetworkType.TESTNET;
31
27
  const {
32
28
  selectedFeeOption$,
33
29
  selectedFeeOption,
@@ -47,9 +43,11 @@ const SelectWaasFeeOptions = observer(
47
43
  onCancel?.();
48
44
  };
49
45
 
46
+ const isSponsored = pendingFeeOptionConfirmation?.options?.length === 0;
47
+
50
48
  if (
51
49
  !selectWaasFeeOptions$.isVisible.get() ||
52
- isTestnet ||
50
+ isSponsored ||
53
51
  !selectedFeeOption
54
52
  ) {
55
53
  return null;
@@ -25,9 +25,11 @@ const useWaasFeeOptionManager = (chainId: number) => {
25
25
  // biome-ignore lint/correctness/useExhaustiveDependencies: it causes a loop
26
26
  useEffect(() => {
27
27
  if (!selectedFeeOption && pendingFeeOptionConfirmation) {
28
- selectedFeeOption$.set(
29
- pendingFeeOptionConfirmation.options[0] as FeeOption,
30
- );
28
+ if (pendingFeeOptionConfirmation.options.length > 0) {
29
+ selectedFeeOption$.set(
30
+ pendingFeeOptionConfirmation.options[0] as FeeOption,
31
+ );
32
+ }
31
33
  }
32
34
  }, [pendingFeeOptionConfirmation]);
33
35
 
@@ -30,8 +30,8 @@ export default function TransactionDetails({
30
30
  const { data, isLoading: marketplaceConfigLoading } = useMarketplaceConfig();
31
31
 
32
32
  const marketplaceFeePercentage = includeMarketplaceFee
33
- ? data?.collections.find(
34
- (collection) => collection.address === collectionAddress,
33
+ ? data?.market.collections.find(
34
+ (collection) => collection.itemsAddress === collectionAddress,
35
35
  )?.feePercentage || DEFAULT_MARKETPLACE_FEE_PERCENTAGE
36
36
  : 0;
37
37
  // royaltyPercentage is an array of [recipient, percentage]
@@ -1,32 +1,23 @@
1
- import { getNetwork } from '@0xsequence/connect';
2
- import { NetworkType } from '@0xsequence/network';
3
1
  import type { FeeOption } from '../../../../../types/waas-types';
4
2
  import { useWallet } from '../../../../_internal/wallet/useWallet';
5
3
 
6
4
  interface UseSelectWaasFeeOptionsProps {
7
- chainId: string | number;
8
5
  isProcessing: boolean;
9
6
  feeOptionsVisible: boolean;
10
7
  selectedFeeOption: FeeOption;
11
8
  }
12
9
 
13
10
  export const useSelectWaasFeeOptions = ({
14
- chainId,
15
11
  isProcessing,
16
12
  feeOptionsVisible,
17
13
  selectedFeeOption,
18
14
  }: UseSelectWaasFeeOptionsProps) => {
19
15
  const { wallet } = useWallet();
20
- const network = chainId ? getNetwork(Number(chainId)) : undefined;
21
- const isTestnet = network?.type === NetworkType.TESTNET;
22
16
  const isWaaS = wallet?.isWaaS;
23
17
  const isProcessingWithWaaS = isProcessing && isWaaS;
24
18
 
25
19
  const shouldHideActionButton =
26
- !isTestnet &&
27
- isProcessingWithWaaS &&
28
- feeOptionsVisible === true &&
29
- !!selectedFeeOption;
20
+ isProcessingWithWaaS && feeOptionsVisible === true && !!selectedFeeOption;
30
21
 
31
22
  const waasFeeOptionsShown =
32
23
  wallet?.isWaaS && isProcessing && feeOptionsVisible;
@@ -36,14 +27,13 @@ export const useSelectWaasFeeOptions = ({
36
27
  loadingLabel = 'Loading fee options',
37
28
  ) => {
38
29
  if (isProcessing) {
39
- return isWaaS && !isTestnet ? loadingLabel : defaultLabel;
30
+ return isWaaS ? loadingLabel : defaultLabel;
40
31
  }
41
32
  return defaultLabel;
42
33
  };
43
34
 
44
35
  return {
45
36
  isWaaS,
46
- isTestnet,
47
37
  feeOptionsVisible,
48
38
  shouldHideActionButton,
49
39
  waasFeeOptionsShown,
@@ -1,10 +1,5 @@
1
1
  export * from './api-types';
2
2
  export * from './sdk-config';
3
3
  export * from './types';
4
- export type * from '../react/_internal/api/builder.gen';
5
4
  export type * from './../react/queries/marketplaceConfig';
6
- export {
7
- MarketplaceWallet,
8
- FilterCondition,
9
- MarketplaceType,
10
- } from '../react/_internal/api/builder.gen';
5
+ export { FilterCondition } from '../react/_internal/api/builder.gen';
@@ -0,0 +1,119 @@
1
+ import type {
2
+ FilterCondition,
3
+ MarketplaceWallet,
4
+ MarketplaceWalletType,
5
+ OpenIdProvider,
6
+ } from '../react/_internal/api/builder.gen';
7
+ import type { ContractType, OrderbookKind } from './api-types';
8
+
9
+ export interface MarketplaceConfig {
10
+ projectId: number;
11
+ settings: NewMarketplaceSettings;
12
+ market: MarketPage;
13
+ shop: ShopPage;
14
+ }
15
+
16
+ export interface NewMarketplaceSettings {
17
+ publisherId: string;
18
+ title: string;
19
+ socials: MarketplaceSocials;
20
+ faviconUrl: string;
21
+ walletOptions: MarketplaceWallet;
22
+ logoUrl: string;
23
+ fontUrl?: string;
24
+ accessKey?: string;
25
+ }
26
+
27
+ interface MarketplacePage {
28
+ enabled: boolean;
29
+ bannerUrl: string;
30
+ ogImage?: string;
31
+ }
32
+
33
+ export interface MarketPage extends MarketplacePage {
34
+ collections: MarketCollection[];
35
+ }
36
+
37
+ export interface ShopPage extends MarketplacePage {
38
+ collections: ShopCollection[];
39
+ }
40
+
41
+ export interface MarketplaceSocials {
42
+ twitter: string;
43
+ discord: string;
44
+ website: string;
45
+ tiktok: string;
46
+ instagram: string;
47
+ youtube: string;
48
+ }
49
+
50
+ export interface MarketplaceWalletEcosystem {
51
+ walletUrl: string;
52
+ walletAppName: string;
53
+ logoLightUrl?: string;
54
+ logoDarkUrl?: string;
55
+ }
56
+
57
+ export interface MarketplaceWalletEmbedded {
58
+ tenantKey: string;
59
+ emailEnabled: boolean;
60
+ providers: Array<OpenIdProvider>;
61
+ }
62
+
63
+ export enum MarketplaceType {
64
+ SHOP = 'SHOP',
65
+ MARKET = 'MARKET',
66
+ }
67
+
68
+ interface MarketplaceCollection {
69
+ contractType: ContractType;
70
+ chainId: number;
71
+ bannerUrl: string;
72
+ itemsAddress: string;
73
+ filterSettings?: CollectionFilterSettings;
74
+ }
75
+
76
+ export interface MarketCollection extends MarketplaceCollection {
77
+ marketplaceType: MarketplaceType.MARKET;
78
+ feePercentage: number;
79
+ destinationMarketplace: OrderbookKind;
80
+ currencyOptions: Array<string>;
81
+ }
82
+
83
+ export interface ShopCollection extends MarketplaceCollection {
84
+ marketplaceType: MarketplaceType.SHOP;
85
+ saleAddress: string;
86
+ }
87
+
88
+ export interface EcosystemWalletSettings {
89
+ walletUrl: string;
90
+ walletAppName: string;
91
+ logoLightUrl?: string;
92
+ logoDarkUrl?: string;
93
+ }
94
+
95
+ export interface MarketplaceWalletOptions {
96
+ walletType: MarketplaceWalletType;
97
+ oidcIssuers: { [key: string]: string };
98
+ connectors: Array<string>;
99
+ includeEIP6963Wallets: boolean;
100
+ ecosystem?: EcosystemWalletSettings;
101
+ waas?: MarketplaceWalletWaasSettings;
102
+ }
103
+
104
+ export interface MarketplaceWalletWaasSettings {
105
+ tenantKey: string;
106
+ emailEnabled: boolean;
107
+ providers: Array<OpenIdProvider>;
108
+ }
109
+
110
+ export interface MetadataFilterRule {
111
+ key: string;
112
+ condition: FilterCondition;
113
+ value?: string;
114
+ }
115
+
116
+ export interface CollectionFilterSettings {
117
+ filterOrder: Array<string>;
118
+ exclusions: Array<MetadataFilterRule>;
119
+ }
@@ -1,13 +1,29 @@
1
- import type { MarketplaceSettings } from '../react/_internal/api/builder.gen';
1
+ import type { LookupMarketplaceReturn } from '../react/_internal/api/builder.gen';
2
+ import type { ContractType } from './api-types';
2
3
 
3
4
  export type Env = 'development' | 'next' | 'production';
4
5
 
6
+ export type ShopConfig = {
7
+ title: string;
8
+ bannerUrl: string;
9
+ ogImage?: string;
10
+ collections: {
11
+ address: string;
12
+ contractType: ContractType;
13
+ bannerUrl: string;
14
+ chainId: number;
15
+ primarySalesContractAddress: string;
16
+ tokenIds: string[];
17
+ }[];
18
+ };
19
+
5
20
  export type SdkConfig = {
6
21
  projectAccessKey: string;
7
22
  projectId: string;
8
23
  walletConnectProjectId?: string;
24
+ tmpShopConfig?: ShopConfig;
9
25
  _internal?: {
10
- prefetchedMarketplaceSettings?: MarketplaceSettings;
26
+ prefetchedMarketplaceSettings?: LookupMarketplaceReturn;
11
27
  devAccessKey?: string;
12
28
  nextAccessKey?: string;
13
29
  builderEnv?: Env;
@@ -15,6 +31,7 @@ export type SdkConfig = {
15
31
  nodeGatewayEnv?: Env;
16
32
  metadataEnv?: Env;
17
33
  indexerEnv?: Env;
34
+ sequenceApiEnv?: Env;
18
35
  sequenceWalletEnv?: Env;
19
36
  };
20
37
  };
@@ -1,4 +1,5 @@
1
1
  import type { Currency } from './api-types';
2
+ export * from './new-marketplace-types';
2
3
 
3
4
  export type Price = {
4
5
  amountRaw: string;
@@ -1,2 +1,3 @@
1
1
  export * from './marketplace';
2
2
  export * from './token';
3
+ export * from './primary-sale';
@@ -0,0 +1,2 @@
1
+ export * from './sequence-1155-sales-contract';
2
+ export * from './sequence-721-sales-contract';