@0xsequence/marketplace-sdk 0.5.7 → 0.6.0

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 (199) hide show
  1. package/dist/chunk-2J7JIOW5.js +2 -0
  2. package/dist/{chunk-3OU7BADC.js → chunk-6MYDUGVO.js} +21 -4
  3. package/dist/chunk-6MYDUGVO.js.map +1 -0
  4. package/dist/chunk-6WMO5YM5.js +94 -0
  5. package/dist/chunk-6WMO5YM5.js.map +1 -0
  6. package/dist/{chunk-YA3DWLDC.js → chunk-A5ICXOCZ.js} +156 -227
  7. package/dist/chunk-A5ICXOCZ.js.map +1 -0
  8. package/dist/{chunk-G2T7HCWE.js → chunk-C42WHQRT.js} +3 -3
  9. package/dist/{chunk-G2T7HCWE.js.map → chunk-C42WHQRT.js.map} +1 -1
  10. package/dist/{chunk-ZBLU3Q22.js → chunk-DLB2EQRX.js} +2 -2
  11. package/dist/{chunk-ZBLU3Q22.js.map → chunk-DLB2EQRX.js.map} +1 -1
  12. package/dist/{chunk-YOKGP2EQ.js → chunk-FG2BBP3P.js} +1 -1
  13. package/dist/{chunk-YOKGP2EQ.js.map → chunk-FG2BBP3P.js.map} +1 -1
  14. package/dist/{chunk-Y56IIYDF.js → chunk-GMWUIMX4.js} +5 -5
  15. package/dist/{chunk-Y56IIYDF.js.map → chunk-GMWUIMX4.js.map} +1 -1
  16. package/dist/{chunk-OMCWTRBR.js → chunk-NKHM2AIS.js} +21 -4
  17. package/dist/chunk-NKHM2AIS.js.map +1 -0
  18. package/dist/{chunk-YYBU45PK.js → chunk-NXORBVUS.js} +2 -2
  19. package/dist/{chunk-L2K4DBH2.js → chunk-UZ3GJXBR.js} +3003 -3124
  20. package/dist/chunk-UZ3GJXBR.js.map +1 -0
  21. package/dist/{chunk-6YHHCGGY.js → chunk-VPJHNXZ2.js} +50 -74
  22. package/dist/chunk-VPJHNXZ2.js.map +1 -0
  23. package/dist/index-BwDj_3at.d.ts +72 -0
  24. package/dist/index.d.ts +4 -4
  25. package/dist/index.js +175 -88
  26. package/dist/react/_internal/databeat/index.js +7 -6
  27. package/dist/react/_internal/index.d.ts +2 -2
  28. package/dist/react/_internal/index.js +1 -1
  29. package/dist/react/hooks/index.d.ts +3 -65
  30. package/dist/react/hooks/index.js +8 -8
  31. package/dist/react/hooks/options/index.d.ts +8 -0
  32. package/dist/react/hooks/options/index.js +17 -0
  33. package/dist/react/hooks/options/index.js.map +1 -0
  34. package/dist/react/index.css +40 -29
  35. package/dist/react/index.css.map +1 -1
  36. package/dist/react/index.d.ts +3 -2
  37. package/dist/react/index.js +17 -13
  38. package/dist/react/ssr/index.js.map +1 -1
  39. package/dist/react/ui/components/collectible-card/index.css +40 -29
  40. package/dist/react/ui/components/collectible-card/index.css.map +1 -1
  41. package/dist/react/ui/components/collectible-card/index.d.ts +3 -2
  42. package/dist/react/ui/components/collectible-card/index.js +12 -11
  43. package/dist/react/ui/components/marketplace-logos/index.d.ts +1 -1
  44. package/dist/react/ui/components/marketplace-logos/index.js +1 -1
  45. package/dist/react/ui/icons/index.js +1 -1
  46. package/dist/react/ui/index.css +40 -29
  47. package/dist/react/ui/index.css.map +1 -1
  48. package/dist/react/ui/index.d.ts +1 -1
  49. package/dist/react/ui/index.js +12 -11
  50. package/dist/react/ui/modals/_internal/components/actionModal/index.css +48 -48
  51. package/dist/react/ui/modals/_internal/components/actionModal/index.css.map +1 -1
  52. package/dist/react/ui/modals/_internal/components/actionModal/index.d.ts +1 -1
  53. package/dist/react/ui/modals/_internal/components/actionModal/index.js +7 -6
  54. package/dist/styles/index.js +2 -2
  55. package/dist/types/index.js +1 -1
  56. package/dist/utils/index.d.ts +9 -7
  57. package/dist/utils/index.js +5 -3
  58. package/package.json +9 -5
  59. package/src/react/__tests__/provider.test.tsx +4 -4
  60. package/src/react/_internal/api/__mocks__/indexer.msw.ts +5 -5
  61. package/src/react/_internal/api/__mocks__/metadata.msw.ts +2 -2
  62. package/src/react/_internal/api/zod-schema.ts +2 -2
  63. package/src/react/_internal/types.ts +2 -2
  64. package/src/react/_internal/wagmi/__tests__/create-config.test.ts +6 -6
  65. package/src/react/_internal/wallet/__tests__/wallet.test.ts +1 -1
  66. package/src/react/_internal/wallet/wallet.ts +6 -2
  67. package/src/react/hooks/__tests__/useAutoSelectFeeOption.test.tsx +8 -12
  68. package/src/react/hooks/__tests__/useBalanceOfCollectible.test.tsx +5 -4
  69. package/src/react/hooks/__tests__/useCancelOrder.test.tsx +13 -6
  70. package/src/react/hooks/__tests__/useCancelTransactionSteps.test.tsx +6 -7
  71. package/src/react/hooks/__tests__/useCollectible.test.tsx +6 -7
  72. package/src/react/hooks/__tests__/useCollection.test.tsx +5 -6
  73. package/src/react/hooks/__tests__/useCollectionBalanceDetails.test.tsx +5 -4
  74. package/src/react/hooks/__tests__/useCollectionDetails.test.tsx +7 -6
  75. package/src/react/hooks/__tests__/useCollectionDetailsPolling.test.tsx +5 -4
  76. package/src/react/hooks/__tests__/useComparePrices.test.tsx +1 -2
  77. package/src/react/hooks/__tests__/useConvertPriceToUSD.test.tsx +2 -3
  78. package/src/react/hooks/__tests__/useCountListingsForCollectible.test.tsx +4 -5
  79. package/src/react/hooks/__tests__/useCountOfCollectables.test.tsx +6 -7
  80. package/src/react/hooks/__tests__/useCountOffersForCollectible.test.tsx +4 -5
  81. package/src/react/hooks/__tests__/useCurrencies.test.tsx +3 -4
  82. package/src/react/hooks/__tests__/useCurrency.test.tsx +4 -6
  83. package/src/react/hooks/__tests__/useCurrencyBalance.test.tsx +12 -7
  84. package/src/react/hooks/__tests__/useFilters.test.tsx +5 -6
  85. package/src/react/hooks/__tests__/useFloorOrder.test.tsx +5 -6
  86. package/src/react/hooks/__tests__/useGenerateBuyTransaction.test.tsx +6 -7
  87. package/src/react/hooks/__tests__/useGenerateCancelTransaction.test.tsx +1 -2
  88. package/src/react/hooks/__tests__/useGenerateListingTransaction.test.tsx +2 -3
  89. package/src/react/hooks/__tests__/useGenerateOfferTransaction.test.tsx +1 -2
  90. package/src/react/hooks/__tests__/useGenerateSellTransaction.test.tsx +1 -2
  91. package/src/react/hooks/__tests__/useHighestOffer.test.tsx +6 -7
  92. package/src/react/hooks/__tests__/useListBalances.test.tsx +1 -1
  93. package/src/react/hooks/__tests__/useListCollectibleActivities.test.tsx +2 -3
  94. package/src/react/hooks/__tests__/useListCollectibles.test.tsx +6 -7
  95. package/src/react/hooks/__tests__/useListCollectiblesPaginated.test.tsx +2 -3
  96. package/src/react/hooks/__tests__/useListCollectionActivities.test.tsx +3 -4
  97. package/src/react/hooks/__tests__/useListCollections.test.tsx +1 -2
  98. package/src/react/hooks/__tests__/useListListingsForCollectible.test.tsx +6 -7
  99. package/src/react/hooks/__tests__/useListOffersForCollectible.test.tsx +6 -7
  100. package/src/react/hooks/__tests__/useLowestListing.test.tsx +6 -7
  101. package/src/react/hooks/__tests__/useMarketplaceConfig.test.tsx +1 -2
  102. package/src/react/hooks/__tests__/useRoyaltyPercentage.test.tsx +1 -1
  103. package/src/react/hooks/options/__tests__/marketplaceConfigOptions.test.tsx +3 -4
  104. package/src/react/hooks/options/collectionOptions.ts +42 -0
  105. package/src/react/hooks/options/index.ts +2 -0
  106. package/src/react/hooks/useCancelOrder.tsx +3 -3
  107. package/src/react/hooks/useCancelTransactionSteps.tsx +11 -11
  108. package/src/react/hooks/useCollection.tsx +6 -37
  109. package/src/react/hooks/useCollectionBalanceDetails.tsx +3 -3
  110. package/src/react/hooks/useCollectionDetailsPolling.tsx +1 -1
  111. package/src/react/hooks/useCurrencies.tsx +1 -1
  112. package/src/react/hooks/useGenerateListingTransaction.tsx +1 -1
  113. package/src/react/hooks/useGenerateOfferTransaction.tsx +1 -1
  114. package/src/react/hooks/useGetReceiptFromHash.tsx +1 -1
  115. package/src/react/hooks/useListCollectibleActivities.tsx +1 -1
  116. package/src/react/hooks/useListCollectionActivities.tsx +1 -1
  117. package/src/react/index.ts +1 -0
  118. package/src/react/provider.tsx +2 -2
  119. package/src/react/ssr/__tests__/create-ssr-client.test.ts +1 -22
  120. package/src/react/ssr/create-ssr-client.ts +1 -1
  121. package/src/react/ui/components/_internals/action-button/ActionButton.tsx +3 -3
  122. package/src/react/ui/components/_internals/action-button/components/ActionButtonBody.tsx +2 -2
  123. package/src/react/ui/components/_internals/action-button/components/NonOwnerActions.tsx +4 -4
  124. package/src/react/ui/components/_internals/action-button/components/OwnerActions.tsx +2 -2
  125. package/src/react/ui/components/_internals/action-button/hooks/useActionButtonLogic.ts +1 -1
  126. package/src/react/ui/components/_internals/custom-select/__tests__/CustomSelect.test.tsx +2 -7
  127. package/src/react/ui/components/collectible-card/CollectibleCard.tsx +9 -2
  128. package/src/react/ui/components/collectible-card/Footer.tsx +1 -1
  129. package/src/react/ui/components/marketplace-logos/marketplace-logos.tsx +1 -1
  130. package/src/react/ui/icons/index.ts +2 -5
  131. package/src/react/ui/{icons/DiamondEye.tsx → images/marketplaces/LooksRare.tsx} +1 -1
  132. package/src/react/ui/modals/BuyModal/__tests__/Modal.test.tsx +10 -11
  133. package/src/react/ui/modals/BuyModal/hooks/__tests__/useBuyCollectable.test.tsx +343 -0
  134. package/src/react/ui/modals/BuyModal/hooks/__tests__/useCheckoutOptions.test.tsx +2 -7
  135. package/src/react/ui/modals/BuyModal/hooks/__tests__/useFees.test.tsx +4 -4
  136. package/src/react/ui/modals/BuyModal/hooks/__tests__/useLoadData.test.tsx +1 -1
  137. package/src/react/ui/modals/BuyModal/hooks/useCheckoutOptions.ts +3 -3
  138. package/src/react/ui/modals/BuyModal/hooks/useLoadData.ts +1 -1
  139. package/src/react/ui/modals/BuyModal/modals/Modal1155.tsx +23 -24
  140. package/src/react/ui/modals/BuyModal/modals/__tests__/CheckoutModal.test.tsx +2 -2
  141. package/src/react/ui/modals/BuyModal/modals/__tests__/Modal1155.test.tsx +209 -242
  142. package/src/react/ui/modals/CreateListingModal/__tests__/Modal.test.tsx +5 -11
  143. package/src/react/ui/modals/CreateListingModal/hooks/useGetTokenApproval.ts +1 -1
  144. package/src/react/ui/modals/CreateListingModal/index.tsx +1 -1
  145. package/src/react/ui/modals/MakeOfferModal/Modal.tsx +1 -1
  146. package/src/react/ui/modals/MakeOfferModal/__tests__/Modal.test.tsx +46 -49
  147. package/src/react/ui/modals/SellModal/__tests__/Modal.test.tsx +9 -28
  148. package/src/react/ui/modals/SellModal/hooks/useGetTokenApproval.tsx +2 -2
  149. package/src/react/ui/modals/SuccessfulPurchaseModal/__tests__/Modal.test.tsx +3 -3
  150. package/src/react/ui/modals/_internal/components/actionModal/ActionModal.tsx +4 -4
  151. package/src/react/ui/modals/_internal/components/actionModal/store.ts +1 -1
  152. package/src/react/ui/modals/_internal/components/alertMessage/index.tsx +2 -3
  153. package/src/react/ui/modals/_internal/components/currencyOptionsSelect/__tests__/index.test.tsx +4 -4
  154. package/src/react/ui/modals/_internal/components/expirationDateSelect/index.tsx +1 -1
  155. package/src/react/ui/modals/_internal/components/priceInput/__tests__/index.test.tsx +1 -8
  156. package/src/react/ui/modals/_internal/components/quantityInput/index.tsx +9 -5
  157. package/src/react/ui/modals/_internal/components/switchChainModal/__tests__/SwitchChainModal.test.tsx +4 -10
  158. package/src/react/ui/modals/_internal/components/switchChainModal/index.tsx +2 -2
  159. package/src/react/ui/modals/_internal/components/switchChainModal/store.ts +1 -1
  160. package/src/react/ui/modals/_internal/components/transaction-footer/index.tsx +9 -3
  161. package/src/react/ui/modals/_internal/components/transaction-footer/transactionFooter.css.ts +11 -0
  162. package/src/react/ui/modals/_internal/components/transactionStatusModal/__tests__/TransactionStatusModal.test.tsx +4 -9
  163. package/src/react/ui/modals/_internal/components/transactionStatusModal/__tests__/utils.test.ts +3 -3
  164. package/src/react/ui/modals/_internal/components/transactionStatusModal/hooks/useTransactionStatus.ts +4 -4
  165. package/src/react/ui/modals/_internal/components/transactionStatusModal/index.tsx +1 -1
  166. package/src/react/ui/modals/modal-provider.tsx +2 -2
  167. package/src/utils/__tests__/address.test.ts +1 -1
  168. package/src/utils/__tests__/getMarketplaceDetails.test.ts +4 -4
  169. package/src/utils/getMarketplaceDetails.ts +7 -7
  170. package/src/utils/index.ts +1 -0
  171. package/src/utils/networkconfigToWagmiChain.ts +17 -0
  172. package/src/utils/price.ts +2 -5
  173. package/test/const.ts +35 -0
  174. package/test/globalSetup.ts +15 -0
  175. package/test/index.ts +1 -0
  176. package/{src/react/_internal/test → test}/mocks/wallet.ts +5 -5
  177. package/test/setup.ts +20 -0
  178. package/test/test-utils.tsx +157 -0
  179. package/tsconfig.json +7 -1
  180. package/tsconfig.tsbuildinfo +1 -1
  181. package/vitest.config.js +5 -3
  182. package/dist/chunk-3OU7BADC.js.map +0 -1
  183. package/dist/chunk-6YHHCGGY.js.map +0 -1
  184. package/dist/chunk-GFADBQPX.js +0 -2
  185. package/dist/chunk-L2K4DBH2.js.map +0 -1
  186. package/dist/chunk-OMCWTRBR.js.map +0 -1
  187. package/dist/chunk-YA3DWLDC.js.map +0 -1
  188. package/src/react/_internal/test/setup.ts +0 -28
  189. package/src/react/_internal/test-utils.tsx +0 -97
  190. package/src/react/ui/icons/ArrowUp.tsx +0 -32
  191. package/src/react/ui/icons/InventoryIcon.tsx +0 -44
  192. package/src/react/ui/icons/MinusIcon.tsx +0 -34
  193. package/src/react/ui/icons/PlusIcon.tsx +0 -32
  194. package/src/react/ui/icons/PositiveCircleIcon.tsx +0 -38
  195. package/src/react/ui/modals/BuyModal/hooks/__tests__/useBuyCollectable.test.tsx.bak +0 -379
  196. package/dist/{chunk-GFADBQPX.js.map → chunk-2J7JIOW5.js.map} +0 -0
  197. package/dist/{chunk-YYBU45PK.js.map → chunk-NXORBVUS.js.map} +0 -0
  198. package/dist/{types-BVD42zE_.d.ts → types-CPl0DH-A.d.ts} +1 -1
  199. /package/src/react/ui/icons/{Bell.tsx → BellIcon.tsx} +0 -0
@@ -61,6 +61,9 @@ export interface WalletInstance {
61
61
  }) => Promise<bigint | boolean>;
62
62
  }
63
63
 
64
+ const isSequenceWallet = (connector: Connector) =>
65
+ connector.id === 'sequence' || connector.id === 'sequence-waas';
66
+
64
67
  export const wallet = ({
65
68
  wallet,
66
69
  chains,
@@ -79,8 +82,9 @@ export const wallet = ({
79
82
  const walletInstance = {
80
83
  transport: custom(wallet.transport),
81
84
  isWaaS: connector.id.endsWith('waas'),
82
- walletKind:
83
- connector.id === 'sequence' ? WalletKind.sequence : WalletKind.unknown,
85
+ walletKind: isSequenceWallet(connector)
86
+ ? WalletKind.sequence
87
+ : WalletKind.unknown,
84
88
  getChainId: wallet.getChainId,
85
89
  address: async () => {
86
90
  let address = wallet.account?.address;
@@ -1,18 +1,17 @@
1
- import { describe, expect, it, vi, beforeEach, afterEach } from 'vitest';
2
- import { useAutoSelectFeeOption } from '../useAutoSelectFeeOption';
3
- import { renderHook, waitFor } from '../../_internal/test-utils';
4
- import { zeroAddress } from 'viem';
1
+ import { useChain } from '@0xsequence/kit';
2
+ import { renderHook, server, waitFor } from '@test';
5
3
  import { http, HttpResponse } from 'msw';
6
- import { server } from '../../_internal/test/setup';
4
+ import { zeroAddress } from 'viem';
5
+ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
6
+ import { useAccount } from 'wagmi';
7
+ import { mainnet } from 'wagmi/chains';
7
8
  import {
8
- mockTokenBalance,
9
9
  mockIndexerEndpoint,
10
10
  mockIndexerHandler,
11
+ mockTokenBalance,
11
12
  } from '../../_internal/api/__mocks__/indexer.msw';
12
- import { useAccount } from 'wagmi';
13
- import { useChain } from '@0xsequence/kit';
14
- import { mainnet } from 'wagmi/chains';
15
13
  import type { FeeOption } from '../../ui/modals/_internal/components/waasFeeOptionsSelect/WaasFeeOptionsSelect';
14
+ import { useAutoSelectFeeOption } from '../useAutoSelectFeeOption';
16
15
 
17
16
  // Mock wagmi hooks
18
17
  vi.mock('wagmi', async () => {
@@ -74,9 +73,6 @@ describe('useAutoSelectFeeOption', () => {
74
73
  };
75
74
 
76
75
  beforeEach(() => {
77
- // Reset handlers before each test
78
- server.resetHandlers();
79
-
80
76
  // Mock useAccount hook with complete wagmi account type
81
77
  vi.mocked(useAccount).mockReturnValue({
82
78
  address: mockUserAddress as `0x${string}`,
@@ -1,10 +1,11 @@
1
+ import { renderHook, server, waitFor } from '@test';
1
2
  import { http, HttpResponse } from 'msw';
2
3
  import { zeroAddress } from 'viem';
3
4
  import { describe, expect, it } from 'vitest';
4
- import { mockTokenBalance } from '../../_internal/api/__mocks__/indexer.msw';
5
- import { mockIndexerEndpoint } from '../../_internal/api/__mocks__/indexer.msw';
6
- import { renderHook, waitFor } from '../../_internal/test-utils';
7
- import { server } from '../../_internal/test/setup';
5
+ import {
6
+ mockIndexerEndpoint,
7
+ mockTokenBalance,
8
+ } from '../../_internal/api/__mocks__/indexer.msw';
8
9
  import { useBalanceOfCollectible } from '../useBalanceOfCollectible';
9
10
 
10
11
  describe('useBalanceOfCollectible', () => {
@@ -1,14 +1,13 @@
1
+ import { renderHook, server, waitFor } from '@test';
1
2
  import { http, HttpResponse } from 'msw';
2
3
  import { beforeEach, describe, expect, it, vi } from 'vitest';
3
- import { MarketplaceKind } from '../../../types';
4
- import { mockMarketplaceEndpoint } from '../../_internal/api/__mocks__/marketplace.msw';
5
- import { StepType } from '../../_internal/api/marketplace.gen';
6
- import { renderHook, waitFor } from '../../_internal/test-utils';
7
4
  import {
8
5
  commonWalletMocks,
9
6
  createMockWallet,
10
- } from '../../_internal/test/mocks/wallet';
11
- import { server } from '../../_internal/test/setup';
7
+ } from '../../../../test/mocks/wallet';
8
+ import { MarketplaceKind } from '../../../types';
9
+ import { mockMarketplaceEndpoint } from '../../_internal/api/__mocks__/marketplace.msw';
10
+ import { StepType } from '../../_internal/api/marketplace.gen';
12
11
  import { useWallet } from '../../_internal/wallet/useWallet';
13
12
  import { useCancelOrder } from '../useCancelOrder';
14
13
 
@@ -37,6 +36,14 @@ describe('useCancelOrder', () => {
37
36
  switchChain: vi.fn().mockResolvedValue(undefined),
38
37
  });
39
38
 
39
+ vi.mock(import('@0xsequence/kit'), async (importOriginal) => {
40
+ const actual = await importOriginal();
41
+ return {
42
+ ...actual,
43
+ useWaasFeeOptions: vi.fn().mockReturnValue([]),
44
+ };
45
+ });
46
+
40
47
  beforeEach(() => {
41
48
  // Set up the mock implementation for useWallet
42
49
  vi.mocked(useWallet).mockReturnValue({
@@ -1,7 +1,12 @@
1
+ import { renderHook, server, waitFor } from '@test';
1
2
  import { http, HttpResponse } from 'msw';
2
3
  import { zeroAddress } from 'viem';
3
- import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
4
4
  import type { Mock } from 'vitest';
5
+ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
6
+ import {
7
+ commonWalletMocks,
8
+ createMockWallet,
9
+ } from '../../../../test/mocks/wallet';
5
10
  import {
6
11
  ChainSwitchUserRejectedError,
7
12
  WalletInstanceNotFoundError,
@@ -11,12 +16,6 @@ import {
11
16
  mockSteps,
12
17
  } from '../../_internal/api/__mocks__/marketplace.msw';
13
18
  import { MarketplaceKind, StepType } from '../../_internal/api/marketplace.gen';
14
- import { renderHook, waitFor } from '../../_internal/test-utils';
15
- import {
16
- commonWalletMocks,
17
- createMockWallet,
18
- } from '../../_internal/test/mocks/wallet';
19
- import { server } from '../../_internal/test/setup';
20
19
  import { useWallet } from '../../_internal/wallet/useWallet';
21
20
  import { useCancelTransactionSteps } from '../useCancelTransactionSteps';
22
21
 
@@ -1,14 +1,13 @@
1
- import { describe, expect, it } from 'vitest';
2
- import { useCollectible } from '../useCollectible';
3
- import { renderHook, waitFor } from '../../_internal/test-utils';
4
- import { zeroAddress } from 'viem';
5
- import type { UseCollectibleArgs } from '../useCollectible';
1
+ import { renderHook, server, waitFor } from '@test';
6
2
  import { http, HttpResponse } from 'msw';
3
+ import { zeroAddress } from 'viem';
4
+ import { describe, expect, it } from 'vitest';
7
5
  import {
8
- mockTokenMetadata,
9
6
  mockMetadataEndpoint,
7
+ mockTokenMetadata,
10
8
  } from '../../_internal/api/__mocks__/metadata.msw';
11
- import { server } from '../../_internal/test/setup';
9
+ import type { UseCollectibleArgs } from '../useCollectible';
10
+ import { useCollectible } from '../useCollectible';
12
11
 
13
12
  describe('useCollectible', () => {
14
13
  const defaultArgs: UseCollectibleArgs = {
@@ -1,14 +1,13 @@
1
- import { describe, expect, it } from 'vitest';
2
- import { useCollection } from '../useCollection';
3
- import { renderHook, waitFor } from '../../_internal/test-utils';
4
- import { zeroAddress } from 'viem';
5
- import type { UseCollectionArgs } from '../useCollection';
1
+ import { renderHook, server, waitFor } from '@test';
6
2
  import { http, HttpResponse } from 'msw';
3
+ import { zeroAddress } from 'viem';
4
+ import { describe, expect, it } from 'vitest';
7
5
  import {
8
6
  mockContractInfo,
9
7
  mockMetadataEndpoint,
10
8
  } from '../../_internal/api/__mocks__/metadata.msw';
11
- import { server } from '../../_internal/test/setup';
9
+ import type { UseCollectionArgs } from '../useCollection';
10
+ import { useCollection } from '../useCollection';
12
11
 
13
12
  describe('useCollection', () => {
14
13
  const defaultArgs: UseCollectionArgs = {
@@ -1,11 +1,12 @@
1
+ import { renderHook, server } from '@test';
1
2
  import { waitFor } from '@testing-library/react';
2
3
  import { http, HttpResponse } from 'msw';
3
4
  import { zeroAddress } from 'viem';
4
5
  import { describe, expect, it } from 'vitest';
5
- import { mockTokenBalance } from '../../_internal/api/__mocks__/indexer.msw';
6
- import { mockIndexerEndpoint } from '../../_internal/api/__mocks__/indexer.msw';
7
- import { renderHook } from '../../_internal/test-utils';
8
- import { server } from '../../_internal/test/setup';
6
+ import {
7
+ mockIndexerEndpoint,
8
+ mockTokenBalance,
9
+ } from '../../_internal/api/__mocks__/indexer.msw';
9
10
  import { useCollectionBalanceDetails } from '../useCollectionBalanceDetails';
10
11
 
11
12
  describe('useCollectionBalanceDetails', () => {
@@ -1,11 +1,12 @@
1
+ import { renderHook, server, waitFor } from '@test';
2
+ import { http, HttpResponse } from 'msw';
3
+ import { zeroAddress } from 'viem';
1
4
  import { describe, expect, it } from 'vitest';
5
+ import {
6
+ mockCollection,
7
+ mockMarketplaceEndpoint,
8
+ } from '../../_internal/api/__mocks__/marketplace.msw';
2
9
  import { useCollectionDetails } from '../useCollectionDetails';
3
- import { renderHook, waitFor } from '../../_internal/test-utils';
4
- import { zeroAddress } from 'viem';
5
- import { http, HttpResponse } from 'msw';
6
- import { mockCollection } from '../../_internal/api/__mocks__/marketplace.msw';
7
- import { server } from '../../_internal/test/setup';
8
- import { mockMarketplaceEndpoint } from '../../_internal/api/__mocks__/marketplace.msw';
9
10
 
10
11
  describe('useCollectionDetails', () => {
11
12
  const defaultArgs = {
@@ -1,11 +1,12 @@
1
+ import { renderHook, server, waitFor } from '@test';
1
2
  import { http, HttpResponse } from 'msw';
2
3
  import { zeroAddress } from 'viem';
3
4
  import { beforeEach, describe, expect, it, vi } from 'vitest';
4
- import { mockCollection } from '../../_internal/api/__mocks__/marketplace.msw';
5
- import { mockMarketplaceEndpoint } from '../../_internal/api/__mocks__/marketplace.msw';
5
+ import {
6
+ mockCollection,
7
+ mockMarketplaceEndpoint,
8
+ } from '../../_internal/api/__mocks__/marketplace.msw';
6
9
  import { CollectionStatus } from '../../_internal/api/marketplace.gen';
7
- import { renderHook, waitFor } from '../../_internal/test-utils';
8
- import { server } from '../../_internal/test/setup';
9
10
  import { useCollectionDetailsPolling } from '../useCollectionDetailsPolling';
10
11
 
11
12
  describe('useCollectionDetailsPolling', () => {
@@ -1,3 +1,4 @@
1
+ import { renderHook, server, waitFor } from '@test';
1
2
  import { http, HttpResponse } from 'msw';
2
3
  import { zeroAddress } from 'viem';
3
4
  import { describe, expect, it } from 'vitest';
@@ -5,8 +6,6 @@ import {
5
6
  mockCurrencies,
6
7
  mockMarketplaceEndpoint,
7
8
  } from '../../_internal/api/__mocks__/marketplace.msw';
8
- import { renderHook, waitFor } from '../../_internal/test-utils';
9
- import { server } from '../../_internal/test/setup';
10
9
  import { useComparePrices } from '../useComparePrices';
11
10
 
12
11
  describe('useComparePrices', () => {
@@ -1,3 +1,4 @@
1
+ import { renderHook, server, waitFor } from '@test';
1
2
  import { http, HttpResponse } from 'msw';
2
3
  import { zeroAddress } from 'viem';
3
4
  import { describe, expect, it } from 'vitest';
@@ -5,10 +6,8 @@ import {
5
6
  mockCurrencies,
6
7
  mockMarketplaceEndpoint,
7
8
  } from '../../_internal/api/__mocks__/marketplace.msw';
8
- import { renderHook, waitFor } from '../../_internal/test-utils';
9
- import { server } from '../../_internal/test/setup';
10
- import { useConvertPriceToUSD } from '../useConvertPriceToUSD';
11
9
  import type { UseConvertPriceToUSDArgs } from '../useConvertPriceToUSD';
10
+ import { useConvertPriceToUSD } from '../useConvertPriceToUSD';
12
11
 
13
12
  describe('useConvertPriceToUSD', () => {
14
13
  const defaultArgs: UseConvertPriceToUSDArgs = {
@@ -1,10 +1,9 @@
1
- import { describe, expect, it } from 'vitest';
2
- import { useCountListingsForCollectible } from '../useCountListingsForCollectible';
3
- import { renderHook, waitFor } from '../../_internal/test-utils';
4
- import { zeroAddress } from 'viem';
1
+ import { renderHook, server, waitFor } from '@test';
5
2
  import { http, HttpResponse } from 'msw';
6
- import { server } from '../../_internal/test/setup';
3
+ import { zeroAddress } from 'viem';
4
+ import { describe, expect, it } from 'vitest';
7
5
  import { mockMarketplaceEndpoint } from '../../_internal/api/__mocks__/marketplace.msw';
6
+ import { useCountListingsForCollectible } from '../useCountListingsForCollectible';
8
7
 
9
8
  describe('useCountListingsForCollectible', () => {
10
9
  const defaultArgs = {
@@ -1,12 +1,11 @@
1
- import { describe, expect, it } from 'vitest';
2
- import { useCountOfCollectables } from '../useCountOfCollectables';
3
- import { renderHook, waitFor } from '../../_internal/test-utils';
4
- import { zeroAddress } from 'viem';
5
- import type { UseCountOfCollectablesArgs } from '../useCountOfCollectables';
1
+ import { renderHook, server, waitFor } from '@test';
6
2
  import { http, HttpResponse } from 'msw';
7
- import { mockMarketplaceEndpoint } from '../../_internal/api/__mocks__/marketplace.msw';
3
+ import { zeroAddress } from 'viem';
4
+ import { describe, expect, it } from 'vitest';
8
5
  import { OrderSide } from '../../_internal';
9
- import { server } from '../../_internal/test/setup';
6
+ import { mockMarketplaceEndpoint } from '../../_internal/api/__mocks__/marketplace.msw';
7
+ import type { UseCountOfCollectablesArgs } from '../useCountOfCollectables';
8
+ import { useCountOfCollectables } from '../useCountOfCollectables';
10
9
 
11
10
  describe('useCountOfCollectables', () => {
12
11
  const defaultArgs: UseCountOfCollectablesArgs = {
@@ -1,10 +1,9 @@
1
- import { describe, expect, it } from 'vitest';
2
- import { useCountOffersForCollectible } from '../useCountOffersForCollectible';
3
- import { renderHook, waitFor } from '../../_internal/test-utils';
4
- import { zeroAddress } from 'viem';
1
+ import { renderHook, server, waitFor } from '@test';
5
2
  import { http, HttpResponse } from 'msw';
6
- import { server } from '../../_internal/test/setup';
3
+ import { zeroAddress } from 'viem';
4
+ import { describe, expect, it } from 'vitest';
7
5
  import { mockMarketplaceEndpoint } from '../../_internal/api/__mocks__/marketplace.msw';
6
+ import { useCountOffersForCollectible } from '../useCountOffersForCollectible';
8
7
 
9
8
  describe('useCountOffersForCollectible', () => {
10
9
  const defaultArgs = {
@@ -1,13 +1,12 @@
1
- import { describe, expect, it } from 'vitest';
2
- import { useCurrencies } from '../useCurrencies';
3
- import { renderHook, waitFor } from '../../_internal/test-utils';
1
+ import { renderHook, server, waitFor } from '@test';
4
2
  import { http, HttpResponse } from 'msw';
5
- import { server } from '../../_internal/test/setup';
3
+ import { describe, expect, it } from 'vitest';
6
4
  import {
7
5
  mockCurrencies,
8
6
  mockMarketplaceEndpoint,
9
7
  } from '../../_internal/api/__mocks__/marketplace.msw';
10
8
  import { mockConfig } from '../options/__mocks__/marketplaceConfig.msw';
9
+ import { useCurrencies } from '../useCurrencies';
11
10
 
12
11
  describe('useCurrencies', () => {
13
12
  const defaultArgs = {
@@ -1,14 +1,12 @@
1
- import { beforeEach, describe, expect, it } from 'vitest';
2
- import { useCurrency } from '../useCurrency';
3
- import { renderHook, waitFor } from '../../_internal/test-utils';
1
+ import { renderHook, server, waitFor } from '@test';
4
2
  import { http, HttpResponse } from 'msw';
5
- import { server } from '../../_internal/test/setup';
3
+ import { beforeEach, describe, expect, it } from 'vitest';
4
+ import { currencyKeys, getQueryClient } from '../../_internal';
6
5
  import {
7
6
  mockCurrencies,
8
7
  mockMarketplaceEndpoint,
9
8
  } from '../../_internal/api/__mocks__/marketplace.msw';
10
- import { getQueryClient } from '../../_internal';
11
- import { currencyKeys } from '../../_internal';
9
+ import { useCurrency } from '../useCurrency';
12
10
 
13
11
  describe('useCurrency', () => {
14
12
  const defaultArgs = {
@@ -1,12 +1,13 @@
1
+ import { renderHook, waitFor } from '@test';
1
2
  import { zeroAddress } from 'viem';
2
3
  import { beforeEach, describe, expect, it, vi } from 'vitest';
3
- import { renderHook, waitFor } from '../../_internal/test-utils';
4
+ import { TEST_ACCOUNTS } from '../../../../test/const';
4
5
  import { useCurrencyBalance } from '../useCurrencyBalance';
5
6
 
6
7
  describe('useCurrencyBalance', () => {
7
8
  const defaultArgs = {
8
9
  chainId: 1,
9
- userAddress: '0x1234567890123456789012345678901234567890' as `0x${string}`,
10
+ userAddress: TEST_ACCOUNTS[0],
10
11
  currencyAddress: zeroAddress,
11
12
  };
12
13
 
@@ -22,17 +23,21 @@ describe('useCurrencyBalance', () => {
22
23
  expect(result.current.data).toBeUndefined();
23
24
 
24
25
  // Wait for data to be loaded
25
- await waitFor(() => {
26
- expect(result.current.isLoading).toBe(false);
27
- });
26
+ await waitFor(
27
+ () => {
28
+ expect(result.current.isLoading).toBe(false);
29
+ },
30
+ { timeout: 100000 },
31
+ );
28
32
 
29
33
  // Verify the data matches our mock
30
34
  expect(result.current.data).toMatchInlineSnapshot(`
31
35
  {
32
- "formatted": "17.162337608910246648",
33
- "value": 17162337608910246648n,
36
+ "formatted": "4722.366482869645213697",
37
+ "value": 4722366482869645213697n,
34
38
  }
35
39
  `);
40
+ console.log(result.current.error);
36
41
  expect(result.current.error).toBeNull();
37
42
  });
38
43
 
@@ -1,11 +1,10 @@
1
- import { describe, expect, it } from 'vitest';
2
- import { useFilters } from '../useFilters';
3
- import { renderHook, waitFor } from '../../_internal/test-utils';
4
- import { zeroAddress } from 'viem';
5
- import type { UseFiltersArgs } from '../useFilters';
1
+ import { renderHook, server, waitFor } from '@test';
6
2
  import { http, HttpResponse } from 'msw';
3
+ import { zeroAddress } from 'viem';
4
+ import { describe, expect, it } from 'vitest';
7
5
  import { mockMetadataEndpoint } from '../../_internal/api/__mocks__/metadata.msw';
8
- import { server } from '../../_internal/test/setup';
6
+ import type { UseFiltersArgs } from '../useFilters';
7
+ import { useFilters } from '../useFilters';
9
8
 
10
9
  describe('useFilters', () => {
11
10
  const defaultArgs: UseFiltersArgs = {
@@ -1,14 +1,13 @@
1
- import { describe, expect, it } from 'vitest';
2
- import { useFloorOrder } from '../useFloorOrder';
3
- import { renderHook, waitFor } from '../../_internal/test-utils';
4
- import { zeroAddress } from 'viem';
5
- import type { UseFloorOrderArgs } from '../useFloorOrder';
1
+ import { renderHook, server, waitFor } from '@test';
6
2
  import { http, HttpResponse } from 'msw';
3
+ import { zeroAddress } from 'viem';
4
+ import { describe, expect, it } from 'vitest';
7
5
  import {
8
6
  mockCollectibleOrder,
9
7
  mockMarketplaceEndpoint,
10
8
  } from '../../_internal/api/__mocks__/marketplace.msw';
11
- import { server } from '../../_internal/test/setup';
9
+ import { useFloorOrder } from '../useFloorOrder';
10
+ import type { UseFloorOrderArgs } from '../useFloorOrder';
12
11
 
13
12
  describe('useFloorOrder', () => {
14
13
  const defaultArgs: UseFloorOrderArgs = {
@@ -1,14 +1,13 @@
1
- import { describe, expect, it, vi, beforeEach } from 'vitest';
2
- import { useGenerateBuyTransaction } from '../useGenerateBuyTransaction';
3
- import { MarketplaceKind, WalletKind } from '../../_internal';
1
+ import { renderHook, server } from '@test';
4
2
  import { http, HttpResponse } from 'msw';
3
+ import { beforeEach, describe, expect, it, vi } from 'vitest';
4
+ import { mock, useAccount, useConnect, useDisconnect } from 'wagmi';
5
+ import { MarketplaceKind, WalletKind } from '../../_internal';
5
6
  import {
6
- mockSteps,
7
7
  mockMarketplaceEndpoint,
8
+ mockSteps,
8
9
  } from '../../_internal/api/__mocks__/marketplace.msw';
9
- import { server } from '../../_internal/test/setup';
10
- import { renderHook } from '../../_internal/test-utils';
11
- import { useDisconnect, useConnect, mock, useAccount } from 'wagmi';
10
+ import { useGenerateBuyTransaction } from '../useGenerateBuyTransaction';
12
11
 
13
12
  describe('useGenerateBuyTransaction', () => {
14
13
  const defaultArgs = {
@@ -1,3 +1,4 @@
1
+ import { renderHook, server, waitFor } from '@test';
1
2
  import { act } from '@testing-library/react';
2
3
  import { http, HttpResponse } from 'msw';
3
4
  import { zeroAddress } from 'viem';
@@ -7,8 +8,6 @@ import {
7
8
  mockSteps,
8
9
  } from '../../_internal/api/__mocks__/marketplace.msw';
9
10
  import { MarketplaceKind } from '../../_internal/api/marketplace.gen';
10
- import { renderHook, waitFor } from '../../_internal/test-utils';
11
- import { server } from '../../_internal/test/setup';
12
11
  import { useConfig } from '../useConfig';
13
12
  import { useGenerateCancelTransaction } from '../useGenerateCancelTransaction';
14
13
 
@@ -1,3 +1,4 @@
1
+ import { renderHook, server, waitFor } from '@test';
1
2
  import { http, HttpResponse } from 'msw';
2
3
  import { zeroAddress } from 'viem';
3
4
  import { beforeEach, describe, expect, it, vi } from 'vitest';
@@ -10,11 +11,9 @@ import {
10
11
  ContractType,
11
12
  OrderbookKind,
12
13
  } from '../../_internal/api/marketplace.gen';
13
- import { renderHook, waitFor } from '../../_internal/test-utils';
14
- import { server } from '../../_internal/test/setup';
15
14
  import { useConfig } from '../useConfig';
16
- import { useGenerateListingTransaction } from '../useGenerateListingTransaction';
17
15
  import type { CreateReqWithDateExpiry } from '../useGenerateListingTransaction';
16
+ import { useGenerateListingTransaction } from '../useGenerateListingTransaction';
18
17
 
19
18
  // Mock useConfig hook
20
19
  vi.mock('../useConfig');
@@ -1,3 +1,4 @@
1
+ import { renderHook, server, waitFor } from '@test';
1
2
  import { http, HttpResponse } from 'msw';
2
3
  import { zeroAddress } from 'viem';
3
4
  import { beforeEach, describe, expect, it, vi } from 'vitest';
@@ -10,8 +11,6 @@ import {
10
11
  ContractType,
11
12
  OrderbookKind,
12
13
  } from '../../_internal/api/marketplace.gen';
13
- import { renderHook, waitFor } from '../../_internal/test-utils';
14
- import { server } from '../../_internal/test/setup';
15
14
  import { useConfig } from '../useConfig';
16
15
  import { useGenerateOfferTransaction } from '../useGenerateOfferTransaction';
17
16
 
@@ -1,3 +1,4 @@
1
+ import { renderHook, server, waitFor } from '@test';
1
2
  import { http, HttpResponse } from 'msw';
2
3
  import { zeroAddress } from 'viem';
3
4
  import { beforeEach, describe, expect, it, vi } from 'vitest';
@@ -11,8 +12,6 @@ import {
11
12
  MarketplaceKind,
12
13
  OrderbookKind,
13
14
  } from '../../_internal/api/marketplace.gen';
14
- import { renderHook, waitFor } from '../../_internal/test-utils';
15
- import { server } from '../../_internal/test/setup';
16
15
  import { useConfig } from '../useConfig';
17
16
  import { useGenerateSellTransaction } from '../useGenerateSellTransaction';
18
17
 
@@ -1,14 +1,13 @@
1
- import { describe, expect, it } from 'vitest';
2
- import { useHighestOffer } from '../useHighestOffer';
3
- import { renderHook, waitFor } from '../../_internal/test-utils';
4
- import { zeroAddress } from 'viem';
5
- import type { UseHighestOfferArgs } from '../useHighestOffer';
1
+ import { renderHook, server, waitFor } from '@test';
6
2
  import { http, HttpResponse } from 'msw';
7
- import { server } from '../../_internal/test/setup';
3
+ import { zeroAddress } from 'viem';
4
+ import { describe, expect, it } from 'vitest';
8
5
  import {
9
- mockOrder,
10
6
  mockMarketplaceEndpoint,
7
+ mockOrder,
11
8
  } from '../../_internal/api/__mocks__/marketplace.msw';
9
+ import type { UseHighestOfferArgs } from '../useHighestOffer';
10
+ import { useHighestOffer } from '../useHighestOffer';
12
11
 
13
12
  describe('useHighestOffer', () => {
14
13
  const defaultArgs: UseHighestOfferArgs = {
@@ -1,8 +1,8 @@
1
+ import { renderHook } from '@test';
1
2
  import { waitFor } from '@testing-library/react';
2
3
  import { zeroAddress } from 'viem';
3
4
  import { describe, expect, it } from 'vitest';
4
5
  import { mockTokenBalance } from '../../_internal/api/__mocks__/indexer.msw';
5
- import { renderHook } from '../../_internal/test-utils';
6
6
  import { useListBalances } from '../useListBalances';
7
7
 
8
8
  describe('useListBalances', () => {
@@ -1,3 +1,4 @@
1
+ import { renderHook, server, waitFor } from '@test';
1
2
  import { http, HttpResponse } from 'msw';
2
3
  import { zeroAddress } from 'viem';
3
4
  import { describe, expect, it } from 'vitest';
@@ -5,10 +6,8 @@ import {
5
6
  mockActivity,
6
7
  mockMarketplaceEndpoint,
7
8
  } from '../../_internal/api/__mocks__/marketplace.msw';
8
- import { renderHook, waitFor } from '../../_internal/test-utils';
9
- import { server } from '../../_internal/test/setup';
10
- import { useListCollectibleActivities } from '../useListCollectibleActivities';
11
9
  import type { UseListCollectibleActivitiesArgs } from '../useListCollectibleActivities';
10
+ import { useListCollectibleActivities } from '../useListCollectibleActivities';
12
11
 
13
12
  describe('useListCollectibleActivities', () => {
14
13
  const defaultArgs: UseListCollectibleActivitiesArgs = {
@@ -1,19 +1,18 @@
1
- import { describe, expect, it } from 'vitest';
2
- import { useListCollectibles } from '../useListCollectibles';
3
- import { renderHook, waitFor } from '../../_internal/test-utils';
4
- import { zeroAddress } from 'viem';
5
- import type { UseListCollectiblesArgs } from '../useListCollectibles';
1
+ import { renderHook, server, waitFor } from '@test';
6
2
  import { http, HttpResponse } from 'msw';
3
+ import { zeroAddress } from 'viem';
4
+ import { describe, expect, it } from 'vitest';
5
+ import type { ListCollectiblesArgs } from '../../_internal';
7
6
  import {
8
7
  mockCollectibleOrder,
9
8
  mockMarketplaceEndpoint,
10
9
  } from '../../_internal/api/__mocks__/marketplace.msw';
11
- import { server } from '../../_internal/test/setup';
12
10
  import {
13
11
  MarketplaceKind,
14
12
  OrderSide,
15
13
  } from '../../_internal/api/marketplace.gen';
16
- import type { ListCollectiblesArgs } from '../../_internal';
14
+ import type { UseListCollectiblesArgs } from '../useListCollectibles';
15
+ import { useListCollectibles } from '../useListCollectibles';
17
16
 
18
17
  describe('useListCollectibles', () => {
19
18
  const defaultArgs: UseListCollectiblesArgs = {
@@ -1,3 +1,4 @@
1
+ import { renderHook, server } from '@test';
1
2
  import { waitFor } from '@testing-library/react';
2
3
  import { http, HttpResponse } from 'msw';
3
4
  import { zeroAddress } from 'viem';
@@ -7,10 +8,8 @@ import {
7
8
  mockMarketplaceEndpoint,
8
9
  } from '../../_internal/api/__mocks__/marketplace.msw';
9
10
  import { OrderSide } from '../../_internal/api/marketplace.gen';
10
- import { renderHook } from '../../_internal/test-utils';
11
- import { server } from '../../_internal/test/setup';
12
- import { useListCollectiblesPaginated } from '../useListCollectiblesPaginated';
13
11
  import type { UseListCollectiblesPaginatedArgs } from '../useListCollectiblesPaginated';
12
+ import { useListCollectiblesPaginated } from '../useListCollectiblesPaginated';
14
13
 
15
14
  describe('useListCollectiblesPaginated', () => {
16
15
  const defaultArgs: UseListCollectiblesPaginatedArgs = {