@0xsequence/marketplace-sdk 0.5.1 → 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.
- package/dist/builder-types-wOwfTJpd.d.ts +73 -0
- package/dist/{chunk-FCF57DZI.js → chunk-7FN62HOP.js} +5 -9
- package/dist/chunk-7FN62HOP.js.map +1 -0
- package/dist/{chunk-F4E3WJ2K.js → chunk-BVXIRVEC.js} +261 -249
- package/dist/chunk-BVXIRVEC.js.map +1 -0
- package/dist/{chunk-XP3WY5AX.js → chunk-BZD2LDJJ.js} +2 -2
- package/dist/{chunk-XP3WY5AX.js.map → chunk-BZD2LDJJ.js.map} +1 -1
- package/dist/chunk-DZKPDV63.js +27 -0
- package/dist/chunk-DZKPDV63.js.map +1 -0
- package/dist/{chunk-I37CRQ4S.js → chunk-H5YWG6WN.js} +128 -88
- package/dist/chunk-H5YWG6WN.js.map +1 -0
- package/dist/{chunk-ZUEQGPLO.js → chunk-J6F5QOW5.js} +2 -2
- package/dist/{chunk-ZUEQGPLO.js.map → chunk-J6F5QOW5.js.map} +1 -1
- package/dist/{chunk-LJAB3S6U.js → chunk-TFRAOS7F.js} +22 -13
- package/dist/chunk-TFRAOS7F.js.map +1 -0
- package/dist/{chunk-5NORRVPM.js → chunk-UZIAX32Y.js} +1 -1
- package/dist/{chunk-5NORRVPM.js.map → chunk-UZIAX32Y.js.map} +1 -1
- package/dist/{chunk-MKGSGTQC.js → chunk-Y7YTLAO2.js} +3 -3
- package/dist/{create-config-BXvwUh55.d.ts → create-config-Bltg8Enl.d.ts} +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +10 -6
- package/dist/react/_internal/index.d.ts +3 -3
- package/dist/react/_internal/index.js +1 -1
- package/dist/react/_internal/wagmi/index.d.ts +2 -3
- package/dist/react/_internal/wagmi/index.js +1 -1
- package/dist/react/hooks/index.d.ts +72 -20
- package/dist/react/hooks/index.js +5 -7
- package/dist/react/index.css +1 -1
- package/dist/react/index.css.map +1 -1
- package/dist/react/index.d.ts +4 -4
- package/dist/react/index.js +8 -10
- package/dist/react/ssr/index.d.ts +54 -41
- package/dist/react/ssr/index.js +5 -9
- package/dist/react/ssr/index.js.map +1 -1
- package/dist/react/ui/components/collectible-card/index.css +1 -1
- package/dist/react/ui/components/collectible-card/index.css.map +1 -1
- package/dist/react/ui/components/collectible-card/index.d.ts +2 -2
- package/dist/react/ui/components/collectible-card/index.js +8 -8
- package/dist/react/ui/index.css +1 -1
- package/dist/react/ui/index.css.map +1 -1
- package/dist/react/ui/index.d.ts +2 -2
- package/dist/react/ui/index.js +8 -8
- package/dist/react/ui/modals/_internal/components/actionModal/index.d.ts +2 -2
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +6 -6
- package/dist/styles/index.css +1 -1
- package/dist/styles/index.css.map +1 -1
- package/dist/styles/index.js +1 -1
- package/dist/types/index.d.ts +1 -3
- package/dist/types/index.js +9 -5
- package/dist/{types-Yto6KrTN.d.ts → types-BY3husBh.d.ts} +1 -1
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.js +4 -4
- package/package.json +11 -10
- package/src/react/_internal/api/__mocks__/indexer.msw.ts +197 -0
- package/src/react/_internal/api/__mocks__/marketplace.msw.ts +140 -1
- package/src/react/_internal/api/__mocks__/metadata.msw.ts +162 -0
- package/src/react/_internal/test/mocks/publicClient.ts +39 -0
- package/src/react/_internal/test/mocks/wagmi.ts +61 -0
- package/src/react/_internal/test/mocks/wallet.ts +61 -0
- package/src/react/_internal/test/setup.ts +28 -0
- package/src/react/_internal/test-utils.tsx +31 -2
- package/src/react/_internal/wagmi/__tests__/create-config.test.ts +53 -20
- package/src/react/_internal/wagmi/create-config.ts +3 -4
- package/src/react/_internal/wagmi/embedded.ts +1 -4
- package/src/react/_internal/wagmi/universal.ts +1 -4
- package/src/react/_internal/wallet/wallet.ts +1 -0
- package/src/react/hooks/__tests__/useAutoSelectFeeOption.test.tsx +314 -0
- package/src/react/hooks/__tests__/useBalanceOfCollectible.test.tsx +148 -0
- package/src/react/hooks/__tests__/useCancelOrder.test.tsx +410 -0
- package/src/react/hooks/__tests__/useCancelTransactionSteps.test.tsx +269 -0
- package/src/react/hooks/__tests__/useCollectible.test.tsx +120 -0
- package/src/react/hooks/__tests__/useCollection.test.tsx +101 -0
- package/src/react/hooks/__tests__/useCollectionBalanceDetails.test.tsx +175 -0
- package/src/react/hooks/__tests__/useCollectionDetails.test.tsx +82 -0
- package/src/react/hooks/__tests__/useCollectionDetailsPolling.test.tsx +133 -0
- package/src/react/hooks/__tests__/useCountListingsForCollectible.test.tsx +108 -0
- package/src/react/hooks/__tests__/useCountOfCollectables.test.tsx +129 -0
- package/src/react/hooks/__tests__/useCountOffersForCollectible.test.tsx +108 -0
- package/src/react/hooks/__tests__/useCurrencies.test.tsx +176 -0
- package/src/react/hooks/__tests__/useCurrency.test.tsx +153 -0
- package/src/react/hooks/__tests__/useCurrencyBalance.test.tsx +111 -0
- package/src/react/hooks/__tests__/useFilters.test.tsx +127 -0
- package/src/react/hooks/__tests__/useFloorOrder.test.tsx +101 -0
- package/src/react/hooks/__tests__/useGenerateBuyTransaction.test.tsx +173 -0
- package/src/react/hooks/__tests__/useGenerateCancelTransaction.test.tsx +207 -0
- package/src/react/hooks/__tests__/useGenerateListingTransaction.test.tsx +207 -0
- package/src/react/hooks/__tests__/useGenerateOfferTransaction.test.tsx +205 -0
- package/src/react/hooks/__tests__/useGenerateSellTransaction.test.tsx +181 -0
- package/src/react/hooks/__tests__/useHighestOffer.test.tsx +118 -0
- package/src/react/hooks/__tests__/useListBalances.test.tsx +136 -0
- package/src/react/hooks/__tests__/useListCollectibleActivities.test.tsx +200 -0
- package/src/react/hooks/__tests__/useListCollectibles.test.tsx +232 -0
- package/src/react/hooks/__tests__/useListCollectionActivities.test.tsx +235 -0
- package/src/react/hooks/__tests__/useListCollections.test.tsx +296 -0
- package/src/react/hooks/__tests__/useListListingsForCollectible.test.tsx +140 -0
- package/src/react/hooks/__tests__/useListOffersForCollectible.test.tsx +140 -0
- package/src/react/hooks/__tests__/useLowestListing.test.tsx +148 -0
- package/src/react/hooks/__tests__/useMarketplaceConfig.test.tsx +106 -0
- package/src/react/hooks/__tests__/useRoyaltyPercentage.test.tsx +129 -0
- package/src/react/hooks/index.ts +0 -1
- package/src/react/hooks/options/__mocks__/marketplaceConfig.msw.ts +66 -10
- package/src/react/hooks/options/__tests__/marketplaceConfigOptions.test.tsx +2 -11
- package/src/react/hooks/options/marketplaceConfigOptions.ts +8 -3
- package/src/react/hooks/useAutoSelectFeeOption.tsx +4 -3
- package/src/react/hooks/useCancelTransactionSteps.tsx +17 -9
- package/src/react/hooks/useCollectionDetailsPolling.tsx +1 -1
- package/src/react/hooks/useCurrencies.tsx +29 -28
- package/src/react/hooks/useFilters.tsx +69 -2
- package/src/react/hooks/useGenerateBuyTransaction.tsx +13 -5
- package/src/react/hooks/useListCollectibleActivities.tsx +1 -0
- package/src/react/hooks/useListCollectibles.tsx +1 -0
- package/src/react/hooks/useListCollectionActivities.tsx +1 -0
- package/src/react/hooks/useListCollections.tsx +2 -2
- package/src/react/ui/components/_internals/custom-select/__tests__/CustomSelect.test.tsx +6 -2
- package/src/react/ui/components/collectible-card/CollectibleCard.tsx +1 -1
- package/src/react/ui/components/collectible-card/Footer.tsx +9 -5
- package/src/react/ui/modals/BuyModal/Modal.tsx +9 -4
- package/src/react/ui/modals/BuyModal/__tests__/Modal.test.tsx +0 -1
- package/src/react/ui/modals/BuyModal/__tests__/store.test.ts +4 -2
- package/src/react/ui/modals/BuyModal/hooks/__tests__/useBuyCollectable.test.tsx +1 -24
- package/src/react/ui/modals/BuyModal/hooks/__tests__/useCheckoutOptions.test.tsx +152 -210
- package/src/react/ui/modals/BuyModal/hooks/__tests__/useFees.test.tsx +19 -49
- package/src/react/ui/modals/BuyModal/hooks/useFees.ts +6 -6
- package/src/react/ui/modals/BuyModal/modals/Modal1155.tsx +4 -2
- package/src/react/ui/modals/BuyModal/modals/__tests__/Modal1155.test.tsx +161 -52
- package/src/react/ui/modals/BuyModal/store.ts +7 -0
- package/src/react/ui/modals/CreateListingModal/Modal.tsx +1 -3
- package/src/react/ui/modals/CreateListingModal/__tests__/Modal.test.tsx +59 -227
- package/src/react/ui/modals/CreateListingModal/hooks/useCreateListing.tsx +2 -1
- package/src/react/ui/modals/CreateListingModal/hooks/useGetTokenApproval.ts +8 -2
- package/src/react/ui/modals/CreateListingModal/hooks/useTransactionSteps.tsx +9 -5
- package/src/react/ui/modals/MakeOfferModal/Modal.tsx +1 -8
- package/src/react/ui/modals/MakeOfferModal/__tests__/Modal.test.tsx +41 -118
- package/src/react/ui/modals/MakeOfferModal/hooks/useMakeOffer.tsx +2 -1
- package/src/react/ui/modals/MakeOfferModal/hooks/useTransactionSteps.tsx +9 -5
- package/src/react/ui/modals/SellModal/__tests__/Modal.test.tsx +4 -3
- package/src/react/ui/modals/SellModal/hooks/useGetTokenApproval.tsx +33 -31
- package/src/react/ui/modals/SellModal/hooks/useSell.tsx +1 -0
- package/src/react/ui/modals/SellModal/hooks/useTransactionSteps.tsx +9 -5
- package/src/react/ui/modals/SuccessfulPurchaseModal/__tests__/Modal.test.tsx +0 -1
- package/src/react/ui/modals/_internal/components/actionModal/ErrorModal.tsx +4 -2
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/__tests__/index.test.tsx +129 -57
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +1 -3
- package/src/react/ui/modals/_internal/components/priceInput/__tests__/index.test.tsx +1 -3
- package/src/react/ui/modals/_internal/components/transactionDetails/index.tsx +2 -2
- package/src/react/ui/modals/_internal/components/transactionStatusModal/__tests__/TransactionStatusModal.test.tsx +8 -8
- package/src/react/ui/modals/_internal/components/transactionStatusModal/hooks/useTransactionStatus.ts +1 -0
- package/src/types/builder-types.ts +79 -0
- package/src/types/index.ts +1 -1
- package/src/utils/__tests__/get-public-rpc-client.test.ts +2 -0
- package/src/utils/getMarketplaceDetails.ts +2 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/vitest.config.js +2 -1
- package/dist/chunk-F4E3WJ2K.js.map +0 -1
- package/dist/chunk-FCF57DZI.js.map +0 -1
- package/dist/chunk-I37CRQ4S.js.map +0 -1
- package/dist/chunk-LJAB3S6U.js.map +0 -1
- package/dist/chunk-RK6KYMZM.js +0 -18
- package/dist/chunk-RK6KYMZM.js.map +0 -1
- package/dist/marketplace-config-znEu4L0K.d.ts +0 -60
- package/src/react/hooks/useCurrencyOptions.tsx +0 -16
- package/src/types/marketplace-config.ts +0 -67
- /package/dist/{chunk-MKGSGTQC.js.map → chunk-Y7YTLAO2.js.map} +0 -0
package/src/react/ui/modals/_internal/components/currencyOptionsSelect/__tests__/index.test.tsx
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import '@testing-library/
|
|
2
|
-
import { screen, cleanup, fireEvent } from '@testing-library/react';
|
|
1
|
+
import { screen, cleanup, fireEvent, waitFor } from '@testing-library/react';
|
|
3
2
|
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
4
3
|
import { observable } from '@legendapp/state';
|
|
4
|
+
import type { UseQueryResult } from '@tanstack/react-query';
|
|
5
5
|
import CurrencyOptionsSelect from '..';
|
|
6
6
|
import type { Currency } from '../../../../../../_internal';
|
|
7
7
|
import { useCurrencies } from '../../../../../../hooks';
|
|
8
8
|
import { mockCurrencies } from '../../../../../../_internal/api/__mocks__/marketplace.msw';
|
|
9
9
|
import { render } from '../../../../../../_internal/test-utils';
|
|
10
10
|
|
|
11
|
+
// Mock the hooks
|
|
12
|
+
vi.mock('../../../../../../hooks', () => ({
|
|
13
|
+
useCurrencies: vi.fn(),
|
|
14
|
+
}));
|
|
15
|
+
|
|
11
16
|
// Mock the Skeleton component
|
|
12
17
|
vi.mock('@0xsequence/design-system', async (importOriginal) => {
|
|
13
18
|
const actual = await importOriginal();
|
|
@@ -19,96 +24,163 @@ vi.mock('@0xsequence/design-system', async (importOriginal) => {
|
|
|
19
24
|
});
|
|
20
25
|
|
|
21
26
|
describe('CurrencyOptionsSelect', () => {
|
|
22
|
-
const
|
|
27
|
+
const createDefaultProps = () => ({
|
|
23
28
|
collectionAddress: '0xCollection' as `0x${string}`,
|
|
24
29
|
chainId: 1,
|
|
25
30
|
selectedCurrency$: observable<Currency | null | undefined>(null),
|
|
26
31
|
secondCurrencyAsDefault: false,
|
|
27
32
|
includeNativeCurrency: false,
|
|
28
|
-
};
|
|
33
|
+
});
|
|
29
34
|
|
|
30
35
|
beforeEach(() => {
|
|
31
36
|
cleanup();
|
|
32
|
-
// Reset all mocks
|
|
33
37
|
vi.clearAllMocks();
|
|
34
38
|
});
|
|
35
39
|
|
|
36
40
|
it('should render loading skeleton when currencies are loading', () => {
|
|
37
|
-
vi.mocked(useCurrencies
|
|
41
|
+
vi.mocked(useCurrencies).mockReturnValue({
|
|
38
42
|
data: undefined,
|
|
39
43
|
isLoading: true,
|
|
40
|
-
});
|
|
44
|
+
} as UseQueryResult<Currency[], Error>);
|
|
41
45
|
|
|
42
|
-
|
|
46
|
+
const props = createDefaultProps();
|
|
47
|
+
render(<CurrencyOptionsSelect {...props} />);
|
|
43
48
|
expect(screen.getByTestId('skeleton')).toBeInTheDocument();
|
|
44
49
|
});
|
|
45
50
|
|
|
46
|
-
it('should set first currency as default when currencies load', () => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
);
|
|
51
|
+
it('should set first currency as default when currencies load', async () => {
|
|
52
|
+
vi.mocked(useCurrencies).mockReturnValue({
|
|
53
|
+
data: mockCurrencies,
|
|
54
|
+
isLoading: false,
|
|
55
|
+
} as UseQueryResult<Currency[], Error>);
|
|
56
|
+
|
|
57
|
+
const props = createDefaultProps();
|
|
58
|
+
render(<CurrencyOptionsSelect {...props} />);
|
|
59
|
+
|
|
60
|
+
await waitFor(() => {
|
|
61
|
+
const selectedCurrency = props.selectedCurrency$.get();
|
|
62
|
+
expect(selectedCurrency).toBeDefined();
|
|
63
|
+
expect(selectedCurrency?.contractAddress).toBe(
|
|
64
|
+
mockCurrencies[0].contractAddress,
|
|
65
|
+
);
|
|
66
|
+
expect(selectedCurrency?.symbol).toBe(mockCurrencies[0].symbol);
|
|
67
|
+
});
|
|
54
68
|
|
|
55
|
-
expect(
|
|
69
|
+
expect(screen.getByText(mockCurrencies[0].symbol)).toBeInTheDocument();
|
|
56
70
|
});
|
|
57
71
|
|
|
58
|
-
it('should set second currency as default when secondCurrencyAsDefault is true', () => {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
72
|
+
it('should set second currency as default when secondCurrencyAsDefault is true', async () => {
|
|
73
|
+
vi.mocked(useCurrencies).mockReturnValue({
|
|
74
|
+
data: mockCurrencies,
|
|
75
|
+
isLoading: false,
|
|
76
|
+
} as UseQueryResult<Currency[], Error>);
|
|
77
|
+
|
|
78
|
+
const props = createDefaultProps();
|
|
79
|
+
render(<CurrencyOptionsSelect {...props} secondCurrencyAsDefault={true} />);
|
|
80
|
+
|
|
81
|
+
await waitFor(() => {
|
|
82
|
+
const selectedCurrency = props.selectedCurrency$.get();
|
|
83
|
+
expect(selectedCurrency).toBeDefined();
|
|
84
|
+
expect(selectedCurrency?.contractAddress).toBe(
|
|
85
|
+
mockCurrencies[1].contractAddress,
|
|
86
|
+
);
|
|
87
|
+
expect(selectedCurrency?.symbol).toBe(mockCurrencies[1].symbol);
|
|
88
|
+
});
|
|
67
89
|
|
|
68
|
-
expect(
|
|
90
|
+
expect(screen.getByText(mockCurrencies[1].symbol)).toBeInTheDocument();
|
|
69
91
|
});
|
|
70
92
|
|
|
71
|
-
it('should update selected currency when user selects a different option', () => {
|
|
72
|
-
|
|
73
|
-
|
|
93
|
+
it('should update selected currency when user selects a different option', async () => {
|
|
94
|
+
vi.mocked(useCurrencies).mockReturnValue({
|
|
95
|
+
data: mockCurrencies,
|
|
96
|
+
isLoading: false,
|
|
97
|
+
} as UseQueryResult<Currency[], Error>);
|
|
74
98
|
|
|
75
|
-
const
|
|
99
|
+
const props = createDefaultProps();
|
|
100
|
+
render(<CurrencyOptionsSelect {...props} />);
|
|
76
101
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
/>,
|
|
82
|
-
);
|
|
102
|
+
// Wait for initial currency to be set
|
|
103
|
+
await waitFor(() => {
|
|
104
|
+
expect(props.selectedCurrency$.get()).toBeDefined();
|
|
105
|
+
});
|
|
83
106
|
|
|
84
|
-
// Find and click the select
|
|
85
|
-
const selectButton = getByRole('combobox');
|
|
107
|
+
// Find and click the select element
|
|
108
|
+
const selectButton = screen.getByRole('combobox');
|
|
86
109
|
fireEvent.click(selectButton);
|
|
87
110
|
|
|
88
|
-
// Find and click the
|
|
89
|
-
const
|
|
90
|
-
fireEvent.click(
|
|
111
|
+
// Find and click the second currency option
|
|
112
|
+
const secondOption = screen.getByText(mockCurrencies[1].symbol);
|
|
113
|
+
fireEvent.click(secondOption);
|
|
91
114
|
|
|
92
|
-
|
|
115
|
+
// Verify the new selection is reflected in both the observable and UI
|
|
116
|
+
expect(props.selectedCurrency$.get()?.contractAddress).toBe(
|
|
117
|
+
mockCurrencies[1].contractAddress,
|
|
118
|
+
);
|
|
119
|
+
expect(props.selectedCurrency$.get()?.symbol).toBe(
|
|
120
|
+
mockCurrencies[1].symbol,
|
|
121
|
+
);
|
|
122
|
+
expect(screen.getByText(mockCurrencies[1].symbol)).toBeInTheDocument();
|
|
93
123
|
});
|
|
94
124
|
|
|
95
|
-
it('should maintain selected currency when currencies reload', () => {
|
|
96
|
-
const
|
|
125
|
+
it('should maintain selected currency when currencies reload', async () => {
|
|
126
|
+
const useCurrenciesMock = vi.mocked(useCurrencies);
|
|
97
127
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
128
|
+
// Initial load with currencies
|
|
129
|
+
useCurrenciesMock.mockReturnValue({
|
|
130
|
+
data: mockCurrencies,
|
|
131
|
+
isLoading: false,
|
|
132
|
+
} as UseQueryResult<Currency[], Error>);
|
|
133
|
+
|
|
134
|
+
const props = createDefaultProps();
|
|
135
|
+
render(<CurrencyOptionsSelect {...props} />);
|
|
136
|
+
|
|
137
|
+
// Wait for initial currency to be set and select the second currency
|
|
138
|
+
await waitFor(() => {
|
|
139
|
+
expect(props.selectedCurrency$.get()).toBeDefined();
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
const selectButton = screen.getByRole('combobox');
|
|
143
|
+
fireEvent.click(selectButton);
|
|
144
|
+
const secondOption = screen.getByText(mockCurrencies[1].symbol);
|
|
145
|
+
fireEvent.click(secondOption);
|
|
104
146
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
selectedCurrency$={selectedCurrency$}
|
|
109
|
-
/>,
|
|
147
|
+
// Verify second currency is selected
|
|
148
|
+
expect(props.selectedCurrency$.get()?.contractAddress).toBe(
|
|
149
|
+
mockCurrencies[1].contractAddress,
|
|
110
150
|
);
|
|
111
151
|
|
|
112
|
-
|
|
152
|
+
// Simulate reload by setting loading state
|
|
153
|
+
useCurrenciesMock.mockReturnValue({
|
|
154
|
+
data: undefined,
|
|
155
|
+
isLoading: true,
|
|
156
|
+
error: null,
|
|
157
|
+
} as unknown as UseQueryResult<Currency[], Error>);
|
|
158
|
+
|
|
159
|
+
// Verify the selected currency remains the same during loading
|
|
160
|
+
expect(props.selectedCurrency$.get()?.contractAddress).toBe(
|
|
161
|
+
mockCurrencies[1].contractAddress,
|
|
162
|
+
);
|
|
163
|
+
expect(props.selectedCurrency$.get()?.symbol).toBe(
|
|
164
|
+
mockCurrencies[1].symbol,
|
|
165
|
+
);
|
|
166
|
+
expect(screen.getByText(mockCurrencies[1].symbol)).toBeInTheDocument();
|
|
167
|
+
|
|
168
|
+
// Simulate reload completion
|
|
169
|
+
useCurrenciesMock.mockReturnValue({
|
|
170
|
+
data: mockCurrencies,
|
|
171
|
+
isLoading: false,
|
|
172
|
+
error: null,
|
|
173
|
+
} as unknown as UseQueryResult<Currency[], Error>);
|
|
174
|
+
|
|
175
|
+
// Verify the same currency is still selected after reload
|
|
176
|
+
await waitFor(() => {
|
|
177
|
+
expect(props.selectedCurrency$.get()?.contractAddress).toBe(
|
|
178
|
+
mockCurrencies[1].contractAddress,
|
|
179
|
+
);
|
|
180
|
+
expect(props.selectedCurrency$.get()?.symbol).toBe(
|
|
181
|
+
mockCurrencies[1].symbol,
|
|
182
|
+
);
|
|
183
|
+
});
|
|
184
|
+
expect(screen.getByText(mockCurrencies[1].symbol)).toBeInTheDocument();
|
|
113
185
|
});
|
|
114
186
|
});
|
|
@@ -5,7 +5,6 @@ import { useEffect } from 'react';
|
|
|
5
5
|
import type { Hex } from 'viem';
|
|
6
6
|
import type { ChainId, Currency } from '../../../../../_internal';
|
|
7
7
|
import { useCurrencies } from '../../../../../hooks';
|
|
8
|
-
import { useCurrencyOptions } from '../../../../../hooks/useCurrencyOptions';
|
|
9
8
|
import {
|
|
10
9
|
CustomSelect,
|
|
11
10
|
type SelectItem,
|
|
@@ -27,10 +26,9 @@ const CurrencyOptionsSelect = observer(function CurrencyOptionsSelect({
|
|
|
27
26
|
includeNativeCurrency,
|
|
28
27
|
}: CurrencyOptionsSelectProps) {
|
|
29
28
|
const currency = selectedCurrency$.get();
|
|
30
|
-
const currencyOptions = useCurrencyOptions({ collectionAddress });
|
|
31
29
|
const { data: currencies, isLoading: currenciesLoading } = useCurrencies({
|
|
32
30
|
chainId,
|
|
33
|
-
|
|
31
|
+
collectionAddress,
|
|
34
32
|
includeNativeCurrency,
|
|
35
33
|
});
|
|
36
34
|
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import '@testing-library/jest-dom/vitest';
|
|
2
|
-
|
|
3
1
|
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
|
4
2
|
import { observable } from '@legendapp/state';
|
|
5
3
|
import PriceInput from '..';
|
|
@@ -17,7 +15,7 @@ vi.mock('../hooks/usePriceInput', () => ({
|
|
|
17
15
|
value: '0',
|
|
18
16
|
handlePriceChange: (value: string) => {
|
|
19
17
|
try {
|
|
20
|
-
if (value === '0' || !value || isNaN(Number(value))) {
|
|
18
|
+
if (value === '0' || !value || Number.isNaN(Number(value))) {
|
|
21
19
|
return;
|
|
22
20
|
}
|
|
23
21
|
onPriceChange?.(value);
|
|
@@ -31,8 +31,8 @@ export default function TransactionDetails({
|
|
|
31
31
|
|
|
32
32
|
const marketplaceFeePercentage =
|
|
33
33
|
data?.collections.find(
|
|
34
|
-
(collection) => collection.
|
|
35
|
-
)?.
|
|
34
|
+
(collection) => collection.address === collectionAddress,
|
|
35
|
+
)?.feePercentage || DEFAULT_MARKETPLACE_FEE_PERCENTAGE;
|
|
36
36
|
const { data: royaltyPercentage, isLoading: royaltyPercentageLoading } =
|
|
37
37
|
useRoyaltyPercentage({
|
|
38
38
|
chainId,
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
screen,
|
|
5
5
|
waitFor,
|
|
6
6
|
} from '../../../../../../_internal/test-utils';
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
import TransactionStatusModal from '../index';
|
|
9
9
|
import { transactionStatusModal$ } from '../store';
|
|
10
10
|
import type { ShowTransactionStatusModalArgs } from '../index';
|
|
@@ -33,7 +33,7 @@ describe('TransactionStatusModal', () => {
|
|
|
33
33
|
beforeEach(() => {
|
|
34
34
|
transactionStatusModal$.close();
|
|
35
35
|
vi.clearAllMocks();
|
|
36
|
-
(useTransactionStatus
|
|
36
|
+
vi.mocked(useTransactionStatus).mockReturnValue('PENDING');
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
it('should not render when closed', () => {
|
|
@@ -44,7 +44,7 @@ describe('TransactionStatusModal', () => {
|
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
it('should show processing state when transaction is processing', async () => {
|
|
47
|
-
(useTransactionStatus
|
|
47
|
+
vi.mocked(useTransactionStatus).mockReturnValue('PENDING');
|
|
48
48
|
transactionStatusModal$.open(mockTransactionArgs);
|
|
49
49
|
render(<TransactionStatusModal />);
|
|
50
50
|
|
|
@@ -60,7 +60,7 @@ describe('TransactionStatusModal', () => {
|
|
|
60
60
|
});
|
|
61
61
|
|
|
62
62
|
it('should show success state when transaction is successful', async () => {
|
|
63
|
-
(useTransactionStatus
|
|
63
|
+
vi.mocked(useTransactionStatus).mockReturnValue('SUCCESS');
|
|
64
64
|
transactionStatusModal$.open(mockTransactionArgs);
|
|
65
65
|
render(<TransactionStatusModal />);
|
|
66
66
|
|
|
@@ -76,7 +76,7 @@ describe('TransactionStatusModal', () => {
|
|
|
76
76
|
});
|
|
77
77
|
|
|
78
78
|
it('should show failed state when transaction fails', async () => {
|
|
79
|
-
(useTransactionStatus
|
|
79
|
+
vi.mocked(useTransactionStatus).mockReturnValue('FAILED');
|
|
80
80
|
transactionStatusModal$.open(mockTransactionArgs);
|
|
81
81
|
render(<TransactionStatusModal />);
|
|
82
82
|
|
|
@@ -90,7 +90,7 @@ describe('TransactionStatusModal', () => {
|
|
|
90
90
|
});
|
|
91
91
|
|
|
92
92
|
it('should show timeout state when transaction times out', async () => {
|
|
93
|
-
(useTransactionStatus
|
|
93
|
+
vi.mocked(useTransactionStatus).mockReturnValue('TIMEOUT');
|
|
94
94
|
transactionStatusModal$.open(mockTransactionArgs);
|
|
95
95
|
render(<TransactionStatusModal />);
|
|
96
96
|
|
|
@@ -105,7 +105,7 @@ describe('TransactionStatusModal', () => {
|
|
|
105
105
|
|
|
106
106
|
it('should call onSuccess callback when transaction succeeds', async () => {
|
|
107
107
|
const onSuccess = vi.fn();
|
|
108
|
-
(useTransactionStatus
|
|
108
|
+
vi.mocked(useTransactionStatus).mockImplementation(() => {
|
|
109
109
|
onSuccess({
|
|
110
110
|
hash: mockTransactionArgs.hash,
|
|
111
111
|
});
|
|
@@ -128,7 +128,7 @@ describe('TransactionStatusModal', () => {
|
|
|
128
128
|
it('should call onError callback when transaction fails', async () => {
|
|
129
129
|
const onError = vi.fn();
|
|
130
130
|
const error = new Error('Transaction failed');
|
|
131
|
-
(useTransactionStatus
|
|
131
|
+
vi.mocked(useTransactionStatus).mockImplementation(() => {
|
|
132
132
|
onError(error);
|
|
133
133
|
return 'FAILED';
|
|
134
134
|
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { OrderbookKind } from '../react/_internal/api/marketplace.gen';
|
|
2
|
+
|
|
3
|
+
// Manual copy of the types from builder
|
|
4
|
+
export enum MarketplaceWallet {
|
|
5
|
+
UNIVERSAL = 'UNIVERSAL',
|
|
6
|
+
EMBEDDED = 'EMBEDDED',
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export enum FilterCondition {
|
|
10
|
+
ENTIRE_KEY = 'ENTIRE_KEY',
|
|
11
|
+
SPECIFIC_VALUE = 'SPECIFIC_VALUE',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export enum MarketplaceType { // This is only used for marketplace v1
|
|
15
|
+
AMM = 'AMM',
|
|
16
|
+
P2P = 'P2P',
|
|
17
|
+
SEQUENCE = 'SEQUENCE',
|
|
18
|
+
ORDERBOOK = 'ORDERBOOK',
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface MarketplaceWalletOptions {
|
|
22
|
+
walletType: MarketplaceWallet;
|
|
23
|
+
oidcIssuers: { [key: string]: string };
|
|
24
|
+
connectors: Array<string>;
|
|
25
|
+
includeEIP6963Wallets: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface MetadataFilterRule {
|
|
29
|
+
key: string;
|
|
30
|
+
condition: FilterCondition;
|
|
31
|
+
value?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface CollectionFilterSettings {
|
|
35
|
+
filterOrder: Array<string>;
|
|
36
|
+
exclusions: Array<MetadataFilterRule>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface MarketplaceCollection {
|
|
40
|
+
marketplaceType: MarketplaceType;
|
|
41
|
+
chainId: number;
|
|
42
|
+
address: string;
|
|
43
|
+
exchanges: Array<string>;
|
|
44
|
+
bannerUrl: string;
|
|
45
|
+
feePercentage: number;
|
|
46
|
+
currencyOptions: Array<string>;
|
|
47
|
+
destinationMarketplace: OrderbookKind;
|
|
48
|
+
filterSettings?: CollectionFilterSettings;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface MarketplaceSocials {
|
|
52
|
+
twitter: string;
|
|
53
|
+
discord: string;
|
|
54
|
+
website: string;
|
|
55
|
+
tiktok: string;
|
|
56
|
+
instagram: string;
|
|
57
|
+
youtube: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface MarketplaceSettings {
|
|
61
|
+
publisherId: string;
|
|
62
|
+
title: string;
|
|
63
|
+
shortDescription: string;
|
|
64
|
+
socials: MarketplaceSocials;
|
|
65
|
+
faviconUrl: string;
|
|
66
|
+
landingBannerUrl: string;
|
|
67
|
+
collections: Array<MarketplaceCollection>;
|
|
68
|
+
walletOptions: MarketplaceWalletOptions;
|
|
69
|
+
landingPageLayout: string;
|
|
70
|
+
logoUrl: string;
|
|
71
|
+
bannerUrl: string;
|
|
72
|
+
fontUrl?: string;
|
|
73
|
+
ogImage?: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface MarketplaceConfig extends MarketplaceSettings {
|
|
77
|
+
cssString: string;
|
|
78
|
+
manifestUrl: string;
|
|
79
|
+
}
|
package/src/types/index.ts
CHANGED
|
@@ -50,6 +50,7 @@ describe('getPublicRpcClient', () => {
|
|
|
50
50
|
expect(network).toBeDefined();
|
|
51
51
|
const client = getPublicRpcClient(chainId);
|
|
52
52
|
|
|
53
|
+
// biome-ignore lint/style/noNonNullAssertion: <explanation>
|
|
53
54
|
expect(client.chain!.rpcUrls.default.http).toEqual([network!.rpcUrl]);
|
|
54
55
|
});
|
|
55
56
|
|
|
@@ -59,6 +60,7 @@ describe('getPublicRpcClient', () => {
|
|
|
59
60
|
expect(network).toBeDefined();
|
|
60
61
|
const client = getPublicRpcClient(chainId);
|
|
61
62
|
|
|
63
|
+
// biome-ignore lint/style/noNonNullAssertion: <explanation>
|
|
62
64
|
expect(client.chain!.nativeCurrency).toEqual(network!.nativeToken);
|
|
63
65
|
});
|
|
64
66
|
});
|
|
@@ -75,8 +75,8 @@ export function getMarketplaceDetails({
|
|
|
75
75
|
kind,
|
|
76
76
|
}: MarketplaceDetailsProp) {
|
|
77
77
|
if (
|
|
78
|
-
kind
|
|
79
|
-
kind
|
|
78
|
+
kind === MarketplaceKind.sequence_marketplace_v1 ||
|
|
79
|
+
kind === MarketplaceKind.sequence_marketplace_v2
|
|
80
80
|
) {
|
|
81
81
|
return MARKETPLACES.sequence;
|
|
82
82
|
}
|
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/consts.ts","./src/index.ts","./src/react/index.ts","./src/react/provider.tsx","./src/react/__tests__/provider.test.tsx","./src/react/_internal/consts.ts","./src/react/_internal/get-provider.ts","./src/react/_internal/index.ts","./src/react/_internal/logger.ts","./src/react/_internal/test-utils.tsx","./src/react/_internal/types.ts","./src/react/_internal/utils.ts","./src/react/_internal/api/get-query-client.ts","./src/react/_internal/api/index.ts","./src/react/_internal/api/marketplace-api.ts","./src/react/_internal/api/marketplace.gen.ts","./src/react/_internal/api/query-keys.ts","./src/react/_internal/api/services.ts","./src/react/_internal/api/zod-schema.ts","./src/react/_internal/api/__mocks__/marketplace.msw.ts","./src/react/_internal/wagmi/create-config.ts","./src/react/_internal/wagmi/embedded.ts","./src/react/_internal/wagmi/index.ts","./src/react/_internal/wagmi/universal.ts","./src/react/_internal/wagmi/__tests__/create-config.test.ts","./src/react/_internal/wallet/usewallet.ts","./src/react/_internal/wallet/wallet.ts","./src/react/hooks/index.ts","./src/react/hooks/useautoselectfeeoption.tsx","./src/react/hooks/usebalanceofcollectible.tsx","./src/react/hooks/usecancelorder.tsx","./src/react/hooks/usecanceltransactionsteps.tsx","./src/react/hooks/usecheckoutoptions.tsx","./src/react/hooks/usecollectible.tsx","./src/react/hooks/usecollection.tsx","./src/react/hooks/usecollectionbalancedetails.tsx","./src/react/hooks/usecollectiondetails.tsx","./src/react/hooks/usecollectiondetailspolling.tsx","./src/react/hooks/useconfig.tsx","./src/react/hooks/usecountlistingsforcollectible.tsx","./src/react/hooks/usecountofcollectables.tsx","./src/react/hooks/usecountoffersforcollectible.tsx","./src/react/hooks/usecurrencies.tsx","./src/react/hooks/usecurrency.tsx","./src/react/hooks/usecurrencybalance.tsx","./src/react/hooks/usecurrencyoptions.tsx","./src/react/hooks/usefilters.tsx","./src/react/hooks/usefloororder.tsx","./src/react/hooks/usegeneratebuytransaction.tsx","./src/react/hooks/usegeneratecanceltransaction.tsx","./src/react/hooks/usegeneratelistingtransaction.tsx","./src/react/hooks/usegenerateoffertransaction.tsx","./src/react/hooks/usegenerateselltransaction.tsx","./src/react/hooks/usegetreceiptfromhash.tsx","./src/react/hooks/usehighestoffer.tsx","./src/react/hooks/uselistbalances.tsx","./src/react/hooks/uselistcollectibleactivities.tsx","./src/react/hooks/uselistcollectibles.tsx","./src/react/hooks/uselistcollectionactivities.tsx","./src/react/hooks/uselistcollections.tsx","./src/react/hooks/uselistlistingsforcollectible.tsx","./src/react/hooks/uselistoffersforcollectible.tsx","./src/react/hooks/uselowestlisting.tsx","./src/react/hooks/usemarketplaceconfig.tsx","./src/react/hooks/useroyaltypercentage.tsx","./src/react/hooks/usetransfertokens.tsx","./src/react/hooks/options/marketplaceconfigoptions.ts","./src/react/hooks/options/__mocks__/marketplaceconfig.msw.ts","./src/react/hooks/options/__tests__/marketplaceconfigoptions.test.tsx","./src/react/ssr/create-ssr-client.ts","./src/react/ssr/index.ts","./src/react/ui/index.ts","./src/react/ui/components/_internals/action-button/actionbutton.tsx","./src/react/ui/components/_internals/action-button/store.ts","./src/react/ui/components/_internals/action-button/styles.css.ts","./src/react/ui/components/_internals/action-button/types.ts","./src/react/ui/components/_internals/action-button/components/actionbuttonbody.tsx","./src/react/ui/components/_internals/action-button/components/nonowneractions.tsx","./src/react/ui/components/_internals/action-button/components/owneractions.tsx","./src/react/ui/components/_internals/action-button/hooks/useactionbuttonlogic.ts","./src/react/ui/components/_internals/custom-network-image/customnetworkimage.tsx","./src/react/ui/components/_internals/custom-network-image/styles.css.ts","./src/react/ui/components/_internals/custom-select/customselect.tsx","./src/react/ui/components/_internals/custom-select/styles.css.ts","./src/react/ui/components/_internals/custom-select/__tests__/customselect.test.tsx","./src/react/ui/components/_internals/pill/pill.tsx","./src/react/ui/components/collectible-card/collectiblecard.tsx","./src/react/ui/components/collectible-card/footer.tsx","./src/react/ui/components/collectible-card/index.ts","./src/react/ui/components/collectible-card/styles.css.ts","./src/react/ui/components/marketplace-logos/index.ts","./src/react/ui/components/marketplace-logos/marketplace-logos.tsx","./src/react/ui/icons/arrowup.tsx","./src/react/ui/icons/bell.tsx","./src/react/ui/icons/calendaricon.tsx","./src/react/ui/icons/carticon.tsx","./src/react/ui/icons/diamondeye.tsx","./src/react/ui/icons/infoicon.tsx","./src/react/ui/icons/inventoryicon.tsx","./src/react/ui/icons/minusicon.tsx","./src/react/ui/icons/plusicon.tsx","./src/react/ui/icons/positivecircleicon.tsx","./src/react/ui/icons/index.ts","./src/react/ui/icons/styles.css.ts","./src/react/ui/modals/modal-provider.tsx","./src/react/ui/modals/buymodal/modal.tsx","./src/react/ui/modals/buymodal/index.tsx","./src/react/ui/modals/buymodal/store.ts","./src/react/ui/modals/buymodal/__tests__/modal.test.tsx","./src/react/ui/modals/buymodal/__tests__/store.test.ts","./src/react/ui/modals/buymodal/hooks/usebuycollectable.ts","./src/react/ui/modals/buymodal/hooks/usecheckoutoptions.ts","./src/react/ui/modals/buymodal/hooks/usefees.ts","./src/react/ui/modals/buymodal/hooks/useloaddata.ts","./src/react/ui/modals/buymodal/hooks/__tests__/usebuycollectable.test.tsx","./src/react/ui/modals/buymodal/hooks/__tests__/usecheckoutoptions.test.tsx","./src/react/ui/modals/buymodal/hooks/__tests__/usefees.test.tsx","./src/react/ui/modals/buymodal/hooks/__tests__/useloaddata.test.tsx","./src/react/ui/modals/buymodal/modals/checkoutmodal.tsx","./src/react/ui/modals/buymodal/modals/modal1155.tsx","./src/react/ui/modals/buymodal/modals/__tests__/checkoutmodal.test.tsx","./src/react/ui/modals/buymodal/modals/__tests__/modal1155.test.tsx","./src/react/ui/modals/createlistingmodal/modal.tsx","./src/react/ui/modals/createlistingmodal/index.tsx","./src/react/ui/modals/createlistingmodal/store.ts","./src/react/ui/modals/createlistingmodal/__tests__/modal.test.tsx","./src/react/ui/modals/createlistingmodal/hooks/usecreatelisting.tsx","./src/react/ui/modals/createlistingmodal/hooks/usegettokenapproval.ts","./src/react/ui/modals/createlistingmodal/hooks/usetransactionsteps.tsx","./src/react/ui/modals/makeoffermodal/modal.tsx","./src/react/ui/modals/makeoffermodal/index.tsx","./src/react/ui/modals/makeoffermodal/store.ts","./src/react/ui/modals/makeoffermodal/__tests__/modal.test.tsx","./src/react/ui/modals/makeoffermodal/hooks/usegettokenapproval.tsx","./src/react/ui/modals/makeoffermodal/hooks/usemakeoffer.tsx","./src/react/ui/modals/makeoffermodal/hooks/usetransactionsteps.tsx","./src/react/ui/modals/sellmodal/modal.tsx","./src/react/ui/modals/sellmodal/index.tsx","./src/react/ui/modals/sellmodal/store.ts","./src/react/ui/modals/sellmodal/utils.ts","./src/react/ui/modals/sellmodal/__tests__/modal.test.tsx","./src/react/ui/modals/sellmodal/hooks/usegettokenapproval.tsx","./src/react/ui/modals/sellmodal/hooks/usesell.tsx","./src/react/ui/modals/sellmodal/hooks/usetransactionsteps.tsx","./src/react/ui/modals/successfulpurchasemodal/_store.ts","./src/react/ui/modals/successfulpurchasemodal/index.tsx","./src/react/ui/modals/successfulpurchasemodal/styles.css.ts","./src/react/ui/modals/successfulpurchasemodal/__tests__/modal.test.tsx","./src/react/ui/modals/transfermodal/_store.ts","./src/react/ui/modals/transfermodal/index.tsx","./src/react/ui/modals/transfermodal/messages.ts","./src/react/ui/modals/transfermodal/styles.css.ts","./src/react/ui/modals/transfermodal/_views/enterwalletaddress/index.tsx","./src/react/ui/modals/transfermodal/_views/enterwalletaddress/usehandletransfer.tsx","./src/react/ui/modals/transfermodal/_views/followwalletinstructions/index.tsx","./src/react/ui/modals/_internal/types.ts","./src/react/ui/modals/_internal/components/actionmodal/actionmodal.tsx","./src/react/ui/modals/_internal/components/actionmodal/errormodal.tsx","./src/react/ui/modals/_internal/components/actionmodal/loadingmodal.tsx","./src/react/ui/modals/_internal/components/actionmodal/index.ts","./src/react/ui/modals/_internal/components/actionmodal/store.ts","./src/react/ui/modals/_internal/components/actionmodal/styles.css.ts","./src/react/ui/modals/_internal/components/alertmessage/index.tsx","./src/react/ui/modals/_internal/components/alertmessage/styles.css.ts","./src/react/ui/modals/_internal/components/calendar/index.tsx","./src/react/ui/modals/_internal/components/calendarpopover/index.tsx","./src/react/ui/modals/_internal/components/calendarpopover/styles.css.ts","./src/react/ui/modals/_internal/components/currencyimage/index.tsx","./src/react/ui/modals/_internal/components/currencyoptionsselect/index.tsx","./src/react/ui/modals/_internal/components/currencyoptionsselect/__tests__/index.test.tsx","./src/react/ui/modals/_internal/components/expirationdateselect/index.tsx","./src/react/ui/modals/_internal/components/floorpricetext/index.tsx","./src/react/ui/modals/_internal/components/priceinput/index.tsx","./src/react/ui/modals/_internal/components/priceinput/styles.css.ts","./src/react/ui/modals/_internal/components/priceinput/types.ts","./src/react/ui/modals/_internal/components/priceinput/__tests__/index.test.tsx","./src/react/ui/modals/_internal/components/quantityinput/index.tsx","./src/react/ui/modals/_internal/components/quantityinput/styles.css.ts","./src/react/ui/modals/_internal/components/switchchainmodal/index.tsx","./src/react/ui/modals/_internal/components/switchchainmodal/store.ts","./src/react/ui/modals/_internal/components/switchchainmodal/styles.css.ts","./src/react/ui/modals/_internal/components/switchchainmodal/__tests__/switchchainmodal.test.tsx","./src/react/ui/modals/_internal/components/timeago/index.tsx","./src/react/ui/modals/_internal/components/tokenpreview/index.tsx","./src/react/ui/modals/_internal/components/tokenpreview/styles.css.ts","./src/react/ui/modals/_internal/components/transaction-footer/index.tsx","./src/react/ui/modals/_internal/components/transactiondetails/index.tsx","./src/react/ui/modals/_internal/components/transactionheader/index.tsx","./src/react/ui/modals/_internal/components/transactionpreview/consts.ts","./src/react/ui/modals/_internal/components/transactionpreview/index.tsx","./src/react/ui/modals/_internal/components/transactionpreview/usetransactionpreviewtitle.tsx","./src/react/ui/modals/_internal/components/transactionstatusmodal/index.tsx","./src/react/ui/modals/_internal/components/transactionstatusmodal/store.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/styles.css.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/__tests__/transactionstatusmodal.test.tsx","./src/react/ui/modals/_internal/components/transactionstatusmodal/__tests__/utils.test.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/hooks/usetransactionstatus.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/util/getformattedtype.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/util/getmessage.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/util/gettitle.ts","./src/react/ui/modals/_internal/components/waasfeeoptionsbox/index.tsx","./src/react/ui/modals/_internal/components/waasfeeoptionsbox/store.ts","./src/react/ui/modals/_internal/components/waasfeeoptionsbox/styles.css.ts","./src/react/ui/modals/_internal/components/waasfeeoptionsselect/waasfeeoptionsselect.tsx","./src/react/ui/modals/_internal/stores/accountmodal.ts","./src/react/ui/styles/index.ts","./src/react/ui/styles/modal.css.ts","./src/styles/index.ts","./src/types/api-types.ts","./src/types/custom.d.ts","./src/types/index.ts","./src/types/marketplace-config.ts","./src/types/messages.ts","./src/types/sdk-config.ts","./src/types/types.ts","./src/utils/address.ts","./src/utils/date.ts","./src/utils/get-public-rpc-client.ts","./src/utils/getmarketplacedetails.ts","./src/utils/index.ts","./src/utils/network.ts","./src/utils/price.ts","./src/utils/__tests__/address.test.ts","./src/utils/__tests__/date.test.ts","./src/utils/__tests__/get-public-rpc-client.test.ts","./src/utils/__tests__/getmarketplacedetails.test.ts","./src/utils/__tests__/price.test.ts","./src/utils/_internal/error/base.ts","./src/utils/_internal/error/config.ts","./src/utils/_internal/error/context.ts","./src/utils/_internal/error/transaction.ts","./src/utils/abi/index.ts","./src/utils/abi/marketplace/eip2981.ts","./src/utils/abi/marketplace/index.ts","./src/utils/abi/marketplace/sequence-marketplace-v1.ts","./src/utils/abi/marketplace/sequence-marketplace-v2.ts","./src/utils/abi/token/erc1155.ts","./src/utils/abi/token/erc20.ts","./src/utils/abi/token/erc721.ts","./src/utils/abi/token/index.ts","./tsup.config.ts"],"version":"5.7.3"}
|
|
1
|
+
{"root":["./src/consts.ts","./src/index.ts","./src/react/index.ts","./src/react/provider.tsx","./src/react/__tests__/provider.test.tsx","./src/react/_internal/consts.ts","./src/react/_internal/get-provider.ts","./src/react/_internal/index.ts","./src/react/_internal/logger.ts","./src/react/_internal/test-utils.tsx","./src/react/_internal/types.ts","./src/react/_internal/utils.ts","./src/react/_internal/api/get-query-client.ts","./src/react/_internal/api/index.ts","./src/react/_internal/api/marketplace-api.ts","./src/react/_internal/api/marketplace.gen.ts","./src/react/_internal/api/query-keys.ts","./src/react/_internal/api/services.ts","./src/react/_internal/api/zod-schema.ts","./src/react/_internal/api/__mocks__/indexer.msw.ts","./src/react/_internal/api/__mocks__/marketplace.msw.ts","./src/react/_internal/api/__mocks__/metadata.msw.ts","./src/react/_internal/test/setup.ts","./src/react/_internal/test/mocks/publicclient.ts","./src/react/_internal/test/mocks/wagmi.ts","./src/react/_internal/test/mocks/wallet.ts","./src/react/_internal/wagmi/create-config.ts","./src/react/_internal/wagmi/embedded.ts","./src/react/_internal/wagmi/index.ts","./src/react/_internal/wagmi/universal.ts","./src/react/_internal/wagmi/__tests__/create-config.test.ts","./src/react/_internal/wallet/usewallet.ts","./src/react/_internal/wallet/wallet.ts","./src/react/hooks/index.ts","./src/react/hooks/useautoselectfeeoption.tsx","./src/react/hooks/usebalanceofcollectible.tsx","./src/react/hooks/usecancelorder.tsx","./src/react/hooks/usecanceltransactionsteps.tsx","./src/react/hooks/usecheckoutoptions.tsx","./src/react/hooks/usecollectible.tsx","./src/react/hooks/usecollection.tsx","./src/react/hooks/usecollectionbalancedetails.tsx","./src/react/hooks/usecollectiondetails.tsx","./src/react/hooks/usecollectiondetailspolling.tsx","./src/react/hooks/useconfig.tsx","./src/react/hooks/usecountlistingsforcollectible.tsx","./src/react/hooks/usecountofcollectables.tsx","./src/react/hooks/usecountoffersforcollectible.tsx","./src/react/hooks/usecurrencies.tsx","./src/react/hooks/usecurrency.tsx","./src/react/hooks/usecurrencybalance.tsx","./src/react/hooks/usefilters.tsx","./src/react/hooks/usefloororder.tsx","./src/react/hooks/usegeneratebuytransaction.tsx","./src/react/hooks/usegeneratecanceltransaction.tsx","./src/react/hooks/usegeneratelistingtransaction.tsx","./src/react/hooks/usegenerateoffertransaction.tsx","./src/react/hooks/usegenerateselltransaction.tsx","./src/react/hooks/usegetreceiptfromhash.tsx","./src/react/hooks/usehighestoffer.tsx","./src/react/hooks/uselistbalances.tsx","./src/react/hooks/uselistcollectibleactivities.tsx","./src/react/hooks/uselistcollectibles.tsx","./src/react/hooks/uselistcollectionactivities.tsx","./src/react/hooks/uselistcollections.tsx","./src/react/hooks/uselistlistingsforcollectible.tsx","./src/react/hooks/uselistoffersforcollectible.tsx","./src/react/hooks/uselowestlisting.tsx","./src/react/hooks/usemarketplaceconfig.tsx","./src/react/hooks/useroyaltypercentage.tsx","./src/react/hooks/usetransfertokens.tsx","./src/react/hooks/__tests__/useautoselectfeeoption.test.tsx","./src/react/hooks/__tests__/usebalanceofcollectible.test.tsx","./src/react/hooks/__tests__/usecancelorder.test.tsx","./src/react/hooks/__tests__/usecanceltransactionsteps.test.tsx","./src/react/hooks/__tests__/usecollectible.test.tsx","./src/react/hooks/__tests__/usecollection.test.tsx","./src/react/hooks/__tests__/usecollectionbalancedetails.test.tsx","./src/react/hooks/__tests__/usecollectiondetails.test.tsx","./src/react/hooks/__tests__/usecollectiondetailspolling.test.tsx","./src/react/hooks/__tests__/usecountlistingsforcollectible.test.tsx","./src/react/hooks/__tests__/usecountofcollectables.test.tsx","./src/react/hooks/__tests__/usecountoffersforcollectible.test.tsx","./src/react/hooks/__tests__/usecurrencies.test.tsx","./src/react/hooks/__tests__/usecurrency.test.tsx","./src/react/hooks/__tests__/usecurrencybalance.test.tsx","./src/react/hooks/__tests__/usefilters.test.tsx","./src/react/hooks/__tests__/usefloororder.test.tsx","./src/react/hooks/__tests__/usegeneratebuytransaction.test.tsx","./src/react/hooks/__tests__/usegeneratecanceltransaction.test.tsx","./src/react/hooks/__tests__/usegeneratelistingtransaction.test.tsx","./src/react/hooks/__tests__/usegenerateoffertransaction.test.tsx","./src/react/hooks/__tests__/usegenerateselltransaction.test.tsx","./src/react/hooks/__tests__/usehighestoffer.test.tsx","./src/react/hooks/__tests__/uselistbalances.test.tsx","./src/react/hooks/__tests__/uselistcollectibleactivities.test.tsx","./src/react/hooks/__tests__/uselistcollectibles.test.tsx","./src/react/hooks/__tests__/uselistcollectionactivities.test.tsx","./src/react/hooks/__tests__/uselistcollections.test.tsx","./src/react/hooks/__tests__/uselistlistingsforcollectible.test.tsx","./src/react/hooks/__tests__/uselistoffersforcollectible.test.tsx","./src/react/hooks/__tests__/uselowestlisting.test.tsx","./src/react/hooks/__tests__/usemarketplaceconfig.test.tsx","./src/react/hooks/__tests__/useroyaltypercentage.test.tsx","./src/react/hooks/options/marketplaceconfigoptions.ts","./src/react/hooks/options/__mocks__/marketplaceconfig.msw.ts","./src/react/hooks/options/__tests__/marketplaceconfigoptions.test.tsx","./src/react/ssr/create-ssr-client.ts","./src/react/ssr/index.ts","./src/react/ui/index.ts","./src/react/ui/components/_internals/action-button/actionbutton.tsx","./src/react/ui/components/_internals/action-button/store.ts","./src/react/ui/components/_internals/action-button/styles.css.ts","./src/react/ui/components/_internals/action-button/types.ts","./src/react/ui/components/_internals/action-button/components/actionbuttonbody.tsx","./src/react/ui/components/_internals/action-button/components/nonowneractions.tsx","./src/react/ui/components/_internals/action-button/components/owneractions.tsx","./src/react/ui/components/_internals/action-button/hooks/useactionbuttonlogic.ts","./src/react/ui/components/_internals/custom-network-image/customnetworkimage.tsx","./src/react/ui/components/_internals/custom-network-image/styles.css.ts","./src/react/ui/components/_internals/custom-select/customselect.tsx","./src/react/ui/components/_internals/custom-select/styles.css.ts","./src/react/ui/components/_internals/custom-select/__tests__/customselect.test.tsx","./src/react/ui/components/_internals/pill/pill.tsx","./src/react/ui/components/collectible-card/collectiblecard.tsx","./src/react/ui/components/collectible-card/footer.tsx","./src/react/ui/components/collectible-card/index.ts","./src/react/ui/components/collectible-card/styles.css.ts","./src/react/ui/components/marketplace-logos/index.ts","./src/react/ui/components/marketplace-logos/marketplace-logos.tsx","./src/react/ui/icons/arrowup.tsx","./src/react/ui/icons/bell.tsx","./src/react/ui/icons/calendaricon.tsx","./src/react/ui/icons/carticon.tsx","./src/react/ui/icons/diamondeye.tsx","./src/react/ui/icons/infoicon.tsx","./src/react/ui/icons/inventoryicon.tsx","./src/react/ui/icons/minusicon.tsx","./src/react/ui/icons/plusicon.tsx","./src/react/ui/icons/positivecircleicon.tsx","./src/react/ui/icons/index.ts","./src/react/ui/icons/styles.css.ts","./src/react/ui/modals/modal-provider.tsx","./src/react/ui/modals/buymodal/modal.tsx","./src/react/ui/modals/buymodal/index.tsx","./src/react/ui/modals/buymodal/store.ts","./src/react/ui/modals/buymodal/__tests__/modal.test.tsx","./src/react/ui/modals/buymodal/__tests__/store.test.ts","./src/react/ui/modals/buymodal/hooks/usebuycollectable.ts","./src/react/ui/modals/buymodal/hooks/usecheckoutoptions.ts","./src/react/ui/modals/buymodal/hooks/usefees.ts","./src/react/ui/modals/buymodal/hooks/useloaddata.ts","./src/react/ui/modals/buymodal/hooks/__tests__/usebuycollectable.test.tsx","./src/react/ui/modals/buymodal/hooks/__tests__/usecheckoutoptions.test.tsx","./src/react/ui/modals/buymodal/hooks/__tests__/usefees.test.tsx","./src/react/ui/modals/buymodal/hooks/__tests__/useloaddata.test.tsx","./src/react/ui/modals/buymodal/modals/checkoutmodal.tsx","./src/react/ui/modals/buymodal/modals/modal1155.tsx","./src/react/ui/modals/buymodal/modals/__tests__/checkoutmodal.test.tsx","./src/react/ui/modals/buymodal/modals/__tests__/modal1155.test.tsx","./src/react/ui/modals/createlistingmodal/modal.tsx","./src/react/ui/modals/createlistingmodal/index.tsx","./src/react/ui/modals/createlistingmodal/store.ts","./src/react/ui/modals/createlistingmodal/__tests__/modal.test.tsx","./src/react/ui/modals/createlistingmodal/hooks/usecreatelisting.tsx","./src/react/ui/modals/createlistingmodal/hooks/usegettokenapproval.ts","./src/react/ui/modals/createlistingmodal/hooks/usetransactionsteps.tsx","./src/react/ui/modals/makeoffermodal/modal.tsx","./src/react/ui/modals/makeoffermodal/index.tsx","./src/react/ui/modals/makeoffermodal/store.ts","./src/react/ui/modals/makeoffermodal/__tests__/modal.test.tsx","./src/react/ui/modals/makeoffermodal/hooks/usegettokenapproval.tsx","./src/react/ui/modals/makeoffermodal/hooks/usemakeoffer.tsx","./src/react/ui/modals/makeoffermodal/hooks/usetransactionsteps.tsx","./src/react/ui/modals/sellmodal/modal.tsx","./src/react/ui/modals/sellmodal/index.tsx","./src/react/ui/modals/sellmodal/store.ts","./src/react/ui/modals/sellmodal/utils.ts","./src/react/ui/modals/sellmodal/__tests__/modal.test.tsx","./src/react/ui/modals/sellmodal/hooks/usegettokenapproval.tsx","./src/react/ui/modals/sellmodal/hooks/usesell.tsx","./src/react/ui/modals/sellmodal/hooks/usetransactionsteps.tsx","./src/react/ui/modals/successfulpurchasemodal/_store.ts","./src/react/ui/modals/successfulpurchasemodal/index.tsx","./src/react/ui/modals/successfulpurchasemodal/styles.css.ts","./src/react/ui/modals/successfulpurchasemodal/__tests__/modal.test.tsx","./src/react/ui/modals/transfermodal/_store.ts","./src/react/ui/modals/transfermodal/index.tsx","./src/react/ui/modals/transfermodal/messages.ts","./src/react/ui/modals/transfermodal/styles.css.ts","./src/react/ui/modals/transfermodal/_views/enterwalletaddress/index.tsx","./src/react/ui/modals/transfermodal/_views/enterwalletaddress/usehandletransfer.tsx","./src/react/ui/modals/transfermodal/_views/followwalletinstructions/index.tsx","./src/react/ui/modals/_internal/types.ts","./src/react/ui/modals/_internal/components/actionmodal/actionmodal.tsx","./src/react/ui/modals/_internal/components/actionmodal/errormodal.tsx","./src/react/ui/modals/_internal/components/actionmodal/loadingmodal.tsx","./src/react/ui/modals/_internal/components/actionmodal/index.ts","./src/react/ui/modals/_internal/components/actionmodal/store.ts","./src/react/ui/modals/_internal/components/actionmodal/styles.css.ts","./src/react/ui/modals/_internal/components/alertmessage/index.tsx","./src/react/ui/modals/_internal/components/alertmessage/styles.css.ts","./src/react/ui/modals/_internal/components/calendar/index.tsx","./src/react/ui/modals/_internal/components/calendarpopover/index.tsx","./src/react/ui/modals/_internal/components/calendarpopover/styles.css.ts","./src/react/ui/modals/_internal/components/currencyimage/index.tsx","./src/react/ui/modals/_internal/components/currencyoptionsselect/index.tsx","./src/react/ui/modals/_internal/components/currencyoptionsselect/__tests__/index.test.tsx","./src/react/ui/modals/_internal/components/expirationdateselect/index.tsx","./src/react/ui/modals/_internal/components/floorpricetext/index.tsx","./src/react/ui/modals/_internal/components/priceinput/index.tsx","./src/react/ui/modals/_internal/components/priceinput/styles.css.ts","./src/react/ui/modals/_internal/components/priceinput/types.ts","./src/react/ui/modals/_internal/components/priceinput/__tests__/index.test.tsx","./src/react/ui/modals/_internal/components/quantityinput/index.tsx","./src/react/ui/modals/_internal/components/quantityinput/styles.css.ts","./src/react/ui/modals/_internal/components/switchchainmodal/index.tsx","./src/react/ui/modals/_internal/components/switchchainmodal/store.ts","./src/react/ui/modals/_internal/components/switchchainmodal/styles.css.ts","./src/react/ui/modals/_internal/components/switchchainmodal/__tests__/switchchainmodal.test.tsx","./src/react/ui/modals/_internal/components/timeago/index.tsx","./src/react/ui/modals/_internal/components/tokenpreview/index.tsx","./src/react/ui/modals/_internal/components/tokenpreview/styles.css.ts","./src/react/ui/modals/_internal/components/transaction-footer/index.tsx","./src/react/ui/modals/_internal/components/transactiondetails/index.tsx","./src/react/ui/modals/_internal/components/transactionheader/index.tsx","./src/react/ui/modals/_internal/components/transactionpreview/consts.ts","./src/react/ui/modals/_internal/components/transactionpreview/index.tsx","./src/react/ui/modals/_internal/components/transactionpreview/usetransactionpreviewtitle.tsx","./src/react/ui/modals/_internal/components/transactionstatusmodal/index.tsx","./src/react/ui/modals/_internal/components/transactionstatusmodal/store.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/styles.css.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/__tests__/transactionstatusmodal.test.tsx","./src/react/ui/modals/_internal/components/transactionstatusmodal/__tests__/utils.test.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/hooks/usetransactionstatus.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/util/getformattedtype.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/util/getmessage.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/util/gettitle.ts","./src/react/ui/modals/_internal/components/waasfeeoptionsbox/index.tsx","./src/react/ui/modals/_internal/components/waasfeeoptionsbox/store.ts","./src/react/ui/modals/_internal/components/waasfeeoptionsbox/styles.css.ts","./src/react/ui/modals/_internal/components/waasfeeoptionsselect/waasfeeoptionsselect.tsx","./src/react/ui/modals/_internal/stores/accountmodal.ts","./src/react/ui/styles/index.ts","./src/react/ui/styles/modal.css.ts","./src/styles/index.ts","./src/types/api-types.ts","./src/types/builder-types.ts","./src/types/custom.d.ts","./src/types/index.ts","./src/types/messages.ts","./src/types/sdk-config.ts","./src/types/types.ts","./src/utils/address.ts","./src/utils/date.ts","./src/utils/get-public-rpc-client.ts","./src/utils/getmarketplacedetails.ts","./src/utils/index.ts","./src/utils/network.ts","./src/utils/price.ts","./src/utils/__tests__/address.test.ts","./src/utils/__tests__/date.test.ts","./src/utils/__tests__/get-public-rpc-client.test.ts","./src/utils/__tests__/getmarketplacedetails.test.ts","./src/utils/__tests__/price.test.ts","./src/utils/_internal/error/base.ts","./src/utils/_internal/error/config.ts","./src/utils/_internal/error/context.ts","./src/utils/_internal/error/transaction.ts","./src/utils/abi/index.ts","./src/utils/abi/marketplace/eip2981.ts","./src/utils/abi/marketplace/index.ts","./src/utils/abi/marketplace/sequence-marketplace-v1.ts","./src/utils/abi/marketplace/sequence-marketplace-v2.ts","./src/utils/abi/token/erc1155.ts","./src/utils/abi/token/erc20.ts","./src/utils/abi/token/erc721.ts","./src/utils/abi/token/index.ts","./tsup.config.ts"],"version":"5.7.3"}
|
package/vitest.config.js
CHANGED
|
@@ -4,7 +4,8 @@ import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
|
|
|
4
4
|
export default defineConfig({
|
|
5
5
|
plugins: [vanillaExtractPlugin()],
|
|
6
6
|
test: {
|
|
7
|
-
environment: '
|
|
7
|
+
environment: 'jsdom',
|
|
8
|
+
setupFiles: ['./src/react/_internal/test/setup.ts'],
|
|
8
9
|
include: ['./**/*.test.{ts,tsx}'],
|
|
9
10
|
},
|
|
10
11
|
});
|