@0xsequence/marketplace-sdk 0.5.2 → 0.5.3

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 (165) hide show
  1. package/dist/builder-types-wOwfTJpd.d.ts +73 -0
  2. package/dist/{chunk-FCF57DZI.js → chunk-7FN62HOP.js} +5 -9
  3. package/dist/chunk-7FN62HOP.js.map +1 -0
  4. package/dist/{chunk-MSTTVFVQ.js → chunk-BVXIRVEC.js} +251 -241
  5. package/dist/chunk-BVXIRVEC.js.map +1 -0
  6. package/dist/{chunk-XP3WY5AX.js → chunk-BZD2LDJJ.js} +2 -2
  7. package/dist/{chunk-XP3WY5AX.js.map → chunk-BZD2LDJJ.js.map} +1 -1
  8. package/dist/chunk-DZKPDV63.js +27 -0
  9. package/dist/chunk-DZKPDV63.js.map +1 -0
  10. package/dist/{chunk-I37CRQ4S.js → chunk-H5YWG6WN.js} +128 -88
  11. package/dist/chunk-H5YWG6WN.js.map +1 -0
  12. package/dist/{chunk-ZUEQGPLO.js → chunk-J6F5QOW5.js} +2 -2
  13. package/dist/{chunk-ZUEQGPLO.js.map → chunk-J6F5QOW5.js.map} +1 -1
  14. package/dist/{chunk-LJAB3S6U.js → chunk-TFRAOS7F.js} +22 -13
  15. package/dist/chunk-TFRAOS7F.js.map +1 -0
  16. package/dist/{chunk-5NORRVPM.js → chunk-UZIAX32Y.js} +1 -1
  17. package/dist/{chunk-5NORRVPM.js.map → chunk-UZIAX32Y.js.map} +1 -1
  18. package/dist/{chunk-MKGSGTQC.js → chunk-Y7YTLAO2.js} +3 -3
  19. package/dist/{create-config-BXvwUh55.d.ts → create-config-Bltg8Enl.d.ts} +1 -1
  20. package/dist/index.css +1 -1
  21. package/dist/index.d.ts +3 -3
  22. package/dist/index.js +10 -6
  23. package/dist/react/_internal/index.d.ts +3 -3
  24. package/dist/react/_internal/index.js +6 -6
  25. package/dist/react/_internal/wagmi/index.d.ts +2 -3
  26. package/dist/react/_internal/wagmi/index.js +1 -1
  27. package/dist/react/hooks/index.d.ts +72 -20
  28. package/dist/react/hooks/index.js +5 -7
  29. package/dist/react/index.css +1 -1
  30. package/dist/react/index.css.map +1 -1
  31. package/dist/react/index.d.ts +4 -4
  32. package/dist/react/index.js +10 -12
  33. package/dist/react/ssr/index.d.ts +54 -41
  34. package/dist/react/ssr/index.js +5 -9
  35. package/dist/react/ssr/index.js.map +1 -1
  36. package/dist/react/ui/components/collectible-card/index.css +1 -1
  37. package/dist/react/ui/components/collectible-card/index.css.map +1 -1
  38. package/dist/react/ui/components/collectible-card/index.d.ts +2 -2
  39. package/dist/react/ui/components/collectible-card/index.js +8 -8
  40. package/dist/react/ui/index.css +1 -1
  41. package/dist/react/ui/index.css.map +1 -1
  42. package/dist/react/ui/index.d.ts +2 -2
  43. package/dist/react/ui/index.js +8 -8
  44. package/dist/react/ui/modals/_internal/components/actionModal/index.d.ts +2 -2
  45. package/dist/react/ui/modals/_internal/components/actionModal/index.js +6 -6
  46. package/dist/react/ui/styles/index.d.ts +1 -1
  47. package/dist/styles/index.css +1 -1
  48. package/dist/styles/index.css.map +1 -1
  49. package/dist/styles/index.d.ts +1 -1
  50. package/dist/styles/index.js +1 -1
  51. package/dist/types/index.d.ts +1 -3
  52. package/dist/types/index.js +9 -5
  53. package/dist/{types-Yto6KrTN.d.ts → types-BY3husBh.d.ts} +1 -1
  54. package/dist/utils/index.d.ts +2 -2
  55. package/dist/utils/index.js +4 -4
  56. package/package.json +11 -10
  57. package/src/react/_internal/api/__mocks__/indexer.msw.ts +197 -0
  58. package/src/react/_internal/api/__mocks__/marketplace.msw.ts +140 -1
  59. package/src/react/_internal/api/__mocks__/metadata.msw.ts +162 -0
  60. package/src/react/_internal/test/mocks/publicClient.ts +39 -0
  61. package/src/react/_internal/test/mocks/wagmi.ts +61 -0
  62. package/src/react/_internal/test/mocks/wallet.ts +61 -0
  63. package/src/react/_internal/test/setup.ts +28 -0
  64. package/src/react/_internal/test-utils.tsx +31 -2
  65. package/src/react/_internal/wagmi/__tests__/create-config.test.ts +53 -20
  66. package/src/react/_internal/wagmi/create-config.ts +3 -4
  67. package/src/react/_internal/wagmi/embedded.ts +1 -4
  68. package/src/react/_internal/wagmi/universal.ts +1 -4
  69. package/src/react/_internal/wallet/wallet.ts +1 -0
  70. package/src/react/hooks/__tests__/useAutoSelectFeeOption.test.tsx +314 -0
  71. package/src/react/hooks/__tests__/useBalanceOfCollectible.test.tsx +148 -0
  72. package/src/react/hooks/__tests__/useCancelOrder.test.tsx +410 -0
  73. package/src/react/hooks/__tests__/useCancelTransactionSteps.test.tsx +269 -0
  74. package/src/react/hooks/__tests__/useCollectible.test.tsx +120 -0
  75. package/src/react/hooks/__tests__/useCollection.test.tsx +101 -0
  76. package/src/react/hooks/__tests__/useCollectionBalanceDetails.test.tsx +175 -0
  77. package/src/react/hooks/__tests__/useCollectionDetails.test.tsx +82 -0
  78. package/src/react/hooks/__tests__/useCollectionDetailsPolling.test.tsx +133 -0
  79. package/src/react/hooks/__tests__/useCountListingsForCollectible.test.tsx +108 -0
  80. package/src/react/hooks/__tests__/useCountOfCollectables.test.tsx +129 -0
  81. package/src/react/hooks/__tests__/useCountOffersForCollectible.test.tsx +108 -0
  82. package/src/react/hooks/__tests__/useCurrencies.test.tsx +176 -0
  83. package/src/react/hooks/__tests__/useCurrency.test.tsx +153 -0
  84. package/src/react/hooks/__tests__/useCurrencyBalance.test.tsx +111 -0
  85. package/src/react/hooks/__tests__/useFilters.test.tsx +127 -0
  86. package/src/react/hooks/__tests__/useFloorOrder.test.tsx +101 -0
  87. package/src/react/hooks/__tests__/useGenerateBuyTransaction.test.tsx +173 -0
  88. package/src/react/hooks/__tests__/useGenerateCancelTransaction.test.tsx +207 -0
  89. package/src/react/hooks/__tests__/useGenerateListingTransaction.test.tsx +207 -0
  90. package/src/react/hooks/__tests__/useGenerateOfferTransaction.test.tsx +205 -0
  91. package/src/react/hooks/__tests__/useGenerateSellTransaction.test.tsx +181 -0
  92. package/src/react/hooks/__tests__/useHighestOffer.test.tsx +118 -0
  93. package/src/react/hooks/__tests__/useListBalances.test.tsx +136 -0
  94. package/src/react/hooks/__tests__/useListCollectibleActivities.test.tsx +200 -0
  95. package/src/react/hooks/__tests__/useListCollectibles.test.tsx +232 -0
  96. package/src/react/hooks/__tests__/useListCollectionActivities.test.tsx +235 -0
  97. package/src/react/hooks/__tests__/useListCollections.test.tsx +296 -0
  98. package/src/react/hooks/__tests__/useListListingsForCollectible.test.tsx +140 -0
  99. package/src/react/hooks/__tests__/useListOffersForCollectible.test.tsx +140 -0
  100. package/src/react/hooks/__tests__/useLowestListing.test.tsx +148 -0
  101. package/src/react/hooks/__tests__/useMarketplaceConfig.test.tsx +106 -0
  102. package/src/react/hooks/__tests__/useRoyaltyPercentage.test.tsx +129 -0
  103. package/src/react/hooks/index.ts +0 -1
  104. package/src/react/hooks/options/__mocks__/marketplaceConfig.msw.ts +66 -10
  105. package/src/react/hooks/options/__tests__/marketplaceConfigOptions.test.tsx +2 -11
  106. package/src/react/hooks/options/marketplaceConfigOptions.ts +8 -3
  107. package/src/react/hooks/useAutoSelectFeeOption.tsx +4 -3
  108. package/src/react/hooks/useCancelTransactionSteps.tsx +17 -9
  109. package/src/react/hooks/useCollectionDetailsPolling.tsx +1 -1
  110. package/src/react/hooks/useCurrencies.tsx +29 -28
  111. package/src/react/hooks/useFilters.tsx +69 -2
  112. package/src/react/hooks/useGenerateBuyTransaction.tsx +13 -5
  113. package/src/react/hooks/useListCollectibleActivities.tsx +1 -0
  114. package/src/react/hooks/useListCollectibles.tsx +1 -0
  115. package/src/react/hooks/useListCollectionActivities.tsx +1 -0
  116. package/src/react/hooks/useListCollections.tsx +2 -2
  117. package/src/react/ui/components/_internals/custom-select/__tests__/CustomSelect.test.tsx +6 -2
  118. package/src/react/ui/components/collectible-card/CollectibleCard.tsx +1 -1
  119. package/src/react/ui/components/collectible-card/Footer.tsx +9 -5
  120. package/src/react/ui/modals/BuyModal/Modal.tsx +9 -4
  121. package/src/react/ui/modals/BuyModal/__tests__/Modal.test.tsx +0 -1
  122. package/src/react/ui/modals/BuyModal/__tests__/store.test.ts +4 -2
  123. package/src/react/ui/modals/BuyModal/hooks/__tests__/useBuyCollectable.test.tsx +1 -24
  124. package/src/react/ui/modals/BuyModal/hooks/__tests__/useCheckoutOptions.test.tsx +152 -210
  125. package/src/react/ui/modals/BuyModal/hooks/__tests__/useFees.test.tsx +19 -49
  126. package/src/react/ui/modals/BuyModal/hooks/useFees.ts +6 -6
  127. package/src/react/ui/modals/BuyModal/modals/Modal1155.tsx +4 -2
  128. package/src/react/ui/modals/BuyModal/modals/__tests__/Modal1155.test.tsx +161 -52
  129. package/src/react/ui/modals/BuyModal/store.ts +7 -0
  130. package/src/react/ui/modals/CreateListingModal/Modal.tsx +1 -3
  131. package/src/react/ui/modals/CreateListingModal/__tests__/Modal.test.tsx +59 -227
  132. package/src/react/ui/modals/CreateListingModal/hooks/useCreateListing.tsx +2 -1
  133. package/src/react/ui/modals/CreateListingModal/hooks/useTransactionSteps.tsx +9 -5
  134. package/src/react/ui/modals/MakeOfferModal/Modal.tsx +1 -8
  135. package/src/react/ui/modals/MakeOfferModal/__tests__/Modal.test.tsx +41 -118
  136. package/src/react/ui/modals/MakeOfferModal/hooks/useMakeOffer.tsx +2 -1
  137. package/src/react/ui/modals/MakeOfferModal/hooks/useTransactionSteps.tsx +9 -5
  138. package/src/react/ui/modals/SellModal/__tests__/Modal.test.tsx +4 -3
  139. package/src/react/ui/modals/SellModal/hooks/useGetTokenApproval.tsx +33 -31
  140. package/src/react/ui/modals/SellModal/hooks/useSell.tsx +1 -0
  141. package/src/react/ui/modals/SellModal/hooks/useTransactionSteps.tsx +9 -5
  142. package/src/react/ui/modals/SuccessfulPurchaseModal/__tests__/Modal.test.tsx +0 -1
  143. package/src/react/ui/modals/_internal/components/actionModal/ErrorModal.tsx +4 -2
  144. package/src/react/ui/modals/_internal/components/currencyOptionsSelect/__tests__/index.test.tsx +129 -57
  145. package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +1 -3
  146. package/src/react/ui/modals/_internal/components/priceInput/__tests__/index.test.tsx +1 -3
  147. package/src/react/ui/modals/_internal/components/transactionDetails/index.tsx +2 -2
  148. package/src/react/ui/modals/_internal/components/transactionStatusModal/__tests__/TransactionStatusModal.test.tsx +8 -8
  149. package/src/react/ui/modals/_internal/components/transactionStatusModal/hooks/useTransactionStatus.ts +1 -0
  150. package/src/types/builder-types.ts +79 -0
  151. package/src/types/index.ts +1 -1
  152. package/src/utils/__tests__/get-public-rpc-client.test.ts +2 -0
  153. package/src/utils/getMarketplaceDetails.ts +2 -2
  154. package/tsconfig.tsbuildinfo +1 -1
  155. package/vitest.config.js +2 -1
  156. package/dist/chunk-FCF57DZI.js.map +0 -1
  157. package/dist/chunk-I37CRQ4S.js.map +0 -1
  158. package/dist/chunk-LJAB3S6U.js.map +0 -1
  159. package/dist/chunk-MSTTVFVQ.js.map +0 -1
  160. package/dist/chunk-RK6KYMZM.js +0 -18
  161. package/dist/chunk-RK6KYMZM.js.map +0 -1
  162. package/dist/marketplace-config-znEu4L0K.d.ts +0 -60
  163. package/src/react/hooks/useCurrencyOptions.tsx +0 -16
  164. package/src/types/marketplace-config.ts +0 -67
  165. /package/dist/{chunk-MKGSGTQC.js.map → chunk-Y7YTLAO2.js.map} +0 -0
@@ -1,18 +0,0 @@
1
- "use client"
2
-
3
- // src/types/marketplace-config.ts
4
- var WalletOptions = /* @__PURE__ */ ((WalletOptions2) => {
5
- WalletOptions2["Sequence"] = "sequence";
6
- WalletOptions2["Metamask"] = "metamask";
7
- WalletOptions2["WalletConnect"] = "walletconnect";
8
- WalletOptions2["Coinbase"] = "coinbase";
9
- WalletOptions2["Injected"] = "injected";
10
- WalletOptions2["Ledger"] = "ledger";
11
- WalletOptions2["Rainbow"] = "rainbow";
12
- return WalletOptions2;
13
- })(WalletOptions || {});
14
-
15
- export {
16
- WalletOptions
17
- };
18
- //# sourceMappingURL=chunk-RK6KYMZM.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/types/marketplace-config.ts"],"sourcesContent":["import type { ChainId } from '@0xsequence/network';\nimport type { Hex } from 'viem';\nimport type { OrderbookKind } from './api-types';\n\ninterface Socials {\n\ttwitter?: string;\n\twebsite?: string;\n\tdiscord?: string;\n\tinstagram?: string;\n\ttiktok?: string;\n\tyoutube?: string;\n}\n\nexport enum WalletOptions {\n\tSequence = 'sequence',\n\tMetamask = 'metamask',\n\tWalletConnect = 'walletconnect',\n\tCoinbase = 'coinbase',\n\tInjected = 'injected',\n\tLedger = 'ledger',\n\tRainbow = 'rainbow',\n}\n\ntype NewWalletConnectors = 'walletconnect' | 'coinbase';\ninterface WalletOptionsNew {\n\tconnectors: NewWalletConnectors[];\n\tincludeEIP6963Wallets: boolean;\n\twalletType: 'embedded' | 'universal';\n}\n\ninterface Collection {\n\tcollectionAddress: Hex;\n\tchainId: ChainId;\n\texchanges?: string[];\n\tmarketplaceFeePercentage: number;\n\tbannerUrl?: string;\n\tmarketplaceType: 'p2p' | 'orderbook' | 'amm';\n\tdestinationMarketplace?: OrderbookKind;\n\tcurrencyOptions?: string[];\n}\n\ntype LandingPageLayout = 'default' | 'big_left_banner' | 'floating_header';\n\nexport interface MarketplaceConfig {\n\tprojectId: number; // builder project Id\n\tpublisherId: string;\n\ttitle: string;\n\tshortDescription: string;\n\tsocials?: Socials;\n\tfaviconUrl: string;\n\tlandingBannerUrl: string;\n\tlogoUrl?: string;\n\tfontUrl?: string;\n\togImage?: string;\n\ttitleTemplate: string;\n\tdisableLiquidityProviderTools?: boolean;\n\twalletOptions: WalletOptions[];\n\twalletOptionsNew?: WalletOptionsNew;\n\tcollections: Collection[];\n\n\tlandingPageLayout: LandingPageLayout;\n\t// Appended in the sdk\n\tcssString: string;\n\t// Appended in the sdk\n\n\tmanifestUrl: string;\n}\n"],"mappings":";;;AAaO,IAAK,gBAAL,kBAAKA,mBAAL;AACN,EAAAA,eAAA,cAAW;AACX,EAAAA,eAAA,cAAW;AACX,EAAAA,eAAA,mBAAgB;AAChB,EAAAA,eAAA,cAAW;AACX,EAAAA,eAAA,cAAW;AACX,EAAAA,eAAA,YAAS;AACT,EAAAA,eAAA,aAAU;AAPC,SAAAA;AAAA,GAAA;","names":["WalletOptions"]}
@@ -1,60 +0,0 @@
1
- import { ChainId } from '@0xsequence/network';
2
- import { Hex } from 'viem';
3
- import { O as OrderbookKind } from './sdk-config-B32_2bG3.js';
4
-
5
- interface Socials {
6
- twitter?: string;
7
- website?: string;
8
- discord?: string;
9
- instagram?: string;
10
- tiktok?: string;
11
- youtube?: string;
12
- }
13
- declare enum WalletOptions {
14
- Sequence = "sequence",
15
- Metamask = "metamask",
16
- WalletConnect = "walletconnect",
17
- Coinbase = "coinbase",
18
- Injected = "injected",
19
- Ledger = "ledger",
20
- Rainbow = "rainbow"
21
- }
22
- type NewWalletConnectors = 'walletconnect' | 'coinbase';
23
- interface WalletOptionsNew {
24
- connectors: NewWalletConnectors[];
25
- includeEIP6963Wallets: boolean;
26
- walletType: 'embedded' | 'universal';
27
- }
28
- interface Collection {
29
- collectionAddress: Hex;
30
- chainId: ChainId;
31
- exchanges?: string[];
32
- marketplaceFeePercentage: number;
33
- bannerUrl?: string;
34
- marketplaceType: 'p2p' | 'orderbook' | 'amm';
35
- destinationMarketplace?: OrderbookKind;
36
- currencyOptions?: string[];
37
- }
38
- type LandingPageLayout = 'default' | 'big_left_banner' | 'floating_header';
39
- interface MarketplaceConfig {
40
- projectId: number;
41
- publisherId: string;
42
- title: string;
43
- shortDescription: string;
44
- socials?: Socials;
45
- faviconUrl: string;
46
- landingBannerUrl: string;
47
- logoUrl?: string;
48
- fontUrl?: string;
49
- ogImage?: string;
50
- titleTemplate: string;
51
- disableLiquidityProviderTools?: boolean;
52
- walletOptions: WalletOptions[];
53
- walletOptionsNew?: WalletOptionsNew;
54
- collections: Collection[];
55
- landingPageLayout: LandingPageLayout;
56
- cssString: string;
57
- manifestUrl: string;
58
- }
59
-
60
- export { type MarketplaceConfig as M, WalletOptions as W };
@@ -1,16 +0,0 @@
1
- import type { Address } from 'viem';
2
- import { useMarketplaceConfig } from './useMarketplaceConfig';
3
-
4
- export const useCurrencyOptions = ({
5
- collectionAddress,
6
- }: {
7
- collectionAddress: Address;
8
- }) => {
9
- const { data: marketplaceConfig } = useMarketplaceConfig();
10
- const collections = marketplaceConfig?.collections;
11
- const currencyOptions = collections?.find(
12
- (collection) => collection.collectionAddress === collectionAddress,
13
- )?.currencyOptions;
14
-
15
- return currencyOptions;
16
- };
@@ -1,67 +0,0 @@
1
- import type { ChainId } from '@0xsequence/network';
2
- import type { Hex } from 'viem';
3
- import type { OrderbookKind } from './api-types';
4
-
5
- interface Socials {
6
- twitter?: string;
7
- website?: string;
8
- discord?: string;
9
- instagram?: string;
10
- tiktok?: string;
11
- youtube?: string;
12
- }
13
-
14
- export enum WalletOptions {
15
- Sequence = 'sequence',
16
- Metamask = 'metamask',
17
- WalletConnect = 'walletconnect',
18
- Coinbase = 'coinbase',
19
- Injected = 'injected',
20
- Ledger = 'ledger',
21
- Rainbow = 'rainbow',
22
- }
23
-
24
- type NewWalletConnectors = 'walletconnect' | 'coinbase';
25
- interface WalletOptionsNew {
26
- connectors: NewWalletConnectors[];
27
- includeEIP6963Wallets: boolean;
28
- walletType: 'embedded' | 'universal';
29
- }
30
-
31
- interface Collection {
32
- collectionAddress: Hex;
33
- chainId: ChainId;
34
- exchanges?: string[];
35
- marketplaceFeePercentage: number;
36
- bannerUrl?: string;
37
- marketplaceType: 'p2p' | 'orderbook' | 'amm';
38
- destinationMarketplace?: OrderbookKind;
39
- currencyOptions?: string[];
40
- }
41
-
42
- type LandingPageLayout = 'default' | 'big_left_banner' | 'floating_header';
43
-
44
- export interface MarketplaceConfig {
45
- projectId: number; // builder project Id
46
- publisherId: string;
47
- title: string;
48
- shortDescription: string;
49
- socials?: Socials;
50
- faviconUrl: string;
51
- landingBannerUrl: string;
52
- logoUrl?: string;
53
- fontUrl?: string;
54
- ogImage?: string;
55
- titleTemplate: string;
56
- disableLiquidityProviderTools?: boolean;
57
- walletOptions: WalletOptions[];
58
- walletOptionsNew?: WalletOptionsNew;
59
- collections: Collection[];
60
-
61
- landingPageLayout: LandingPageLayout;
62
- // Appended in the sdk
63
- cssString: string;
64
- // Appended in the sdk
65
-
66
- manifestUrl: string;
67
- }