@0xsequence/marketplace-sdk 0.5.6 → 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.
- package/dist/chunk-2J7JIOW5.js +2 -0
- package/dist/chunk-2J7JIOW5.js.map +1 -0
- package/dist/{chunk-Y75XGZOB.js → chunk-5O3ZAEEX.js} +4 -2
- package/dist/chunk-5O3ZAEEX.js.map +1 -0
- package/dist/{chunk-J6F5QOW5.js → chunk-6MYDUGVO.js} +28 -77
- package/dist/chunk-6MYDUGVO.js.map +1 -0
- package/dist/chunk-6WMO5YM5.js +94 -0
- package/dist/chunk-6WMO5YM5.js.map +1 -0
- package/dist/{chunk-AIGFG26L.js → chunk-A5ICXOCZ.js} +183 -250
- package/dist/chunk-A5ICXOCZ.js.map +1 -0
- package/dist/{chunk-4YR6AIXG.js → chunk-C42WHQRT.js} +6 -8
- package/dist/chunk-C42WHQRT.js.map +1 -0
- package/dist/{chunk-ZBLU3Q22.js → chunk-DLB2EQRX.js} +2 -2
- package/dist/{chunk-ZBLU3Q22.js.map → chunk-DLB2EQRX.js.map} +1 -1
- package/dist/{chunk-YOKGP2EQ.js → chunk-FG2BBP3P.js} +1 -1
- package/dist/{chunk-YOKGP2EQ.js.map → chunk-FG2BBP3P.js.map} +1 -1
- package/dist/{chunk-UZIAX32Y.js → chunk-GMWUIMX4.js} +10 -8
- package/dist/{chunk-UZIAX32Y.js.map → chunk-GMWUIMX4.js.map} +1 -1
- package/dist/{chunk-7C7ADZ2H.js → chunk-NKHM2AIS.js} +28 -44
- package/dist/chunk-NKHM2AIS.js.map +1 -0
- package/dist/{chunk-RIGIV5XT.js → chunk-NXORBVUS.js} +10 -4
- package/dist/chunk-NXORBVUS.js.map +1 -0
- package/dist/{chunk-7FN62HOP.js → chunk-UMYRZJVY.js} +11 -3
- package/dist/chunk-UMYRZJVY.js.map +1 -0
- package/dist/{chunk-E2V2BMF6.js → chunk-UZ3GJXBR.js} +2979 -3037
- package/dist/chunk-UZ3GJXBR.js.map +1 -0
- package/dist/{chunk-6YHHCGGY.js → chunk-VPJHNXZ2.js} +50 -74
- package/dist/chunk-VPJHNXZ2.js.map +1 -0
- package/dist/{create-config-CtFGrwXc.d.ts → create-config-CILyA_Hy.d.ts} +1 -1
- package/dist/index-BwDj_3at.d.ts +72 -0
- package/dist/index.css +12 -6
- package/dist/index.d.ts +7 -6
- package/dist/index.js +175 -85
- package/dist/react/_internal/api/index.d.ts +2 -2
- package/dist/react/_internal/databeat/index.css.map +1 -1
- package/dist/react/_internal/databeat/index.js +9 -8
- package/dist/react/_internal/index.d.ts +5 -5
- package/dist/react/_internal/index.js +2 -2
- package/dist/react/_internal/wagmi/index.d.ts +2 -2
- package/dist/react/_internal/wagmi/index.js +1 -1
- package/dist/react/hooks/index.css.map +1 -1
- package/dist/react/hooks/index.d.ts +10 -79
- package/dist/react/hooks/index.js +10 -10
- package/dist/react/hooks/options/index.d.ts +8 -0
- package/dist/react/hooks/options/index.js +17 -0
- package/dist/react/hooks/options/index.js.map +1 -0
- package/dist/react/index.css +52 -35
- package/dist/react/index.css.map +1 -1
- package/dist/react/index.d.ts +6 -5
- package/dist/react/index.js +19 -14
- package/dist/react/ssr/index.d.ts +1 -0
- package/dist/react/ssr/index.js +10 -2
- package/dist/react/ssr/index.js.map +1 -1
- package/dist/react/ui/components/collectible-card/index.css +52 -35
- package/dist/react/ui/components/collectible-card/index.css.map +1 -1
- package/dist/react/ui/components/collectible-card/index.d.ts +4 -3
- package/dist/react/ui/components/collectible-card/index.js +14 -12
- package/dist/react/ui/components/marketplace-logos/index.d.ts +1 -1
- package/dist/react/ui/components/marketplace-logos/index.js +1 -1
- package/dist/react/ui/icons/index.css.map +1 -1
- package/dist/react/ui/icons/index.js +1 -1
- package/dist/react/ui/index.css +52 -35
- package/dist/react/ui/index.css.map +1 -1
- package/dist/react/ui/index.d.ts +2 -2
- package/dist/react/ui/index.js +14 -12
- package/dist/react/ui/modals/_internal/components/actionModal/index.css +48 -48
- package/dist/react/ui/modals/_internal/components/actionModal/index.css.map +1 -1
- package/dist/react/ui/modals/_internal/components/actionModal/index.d.ts +2 -2
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +9 -8
- package/dist/react/ui/styles/index.css.map +1 -1
- package/dist/{sdk-config-xWkdBdrL.d.ts → sdk-config-Bs3H_le_.d.ts} +1 -0
- package/dist/{services-Cled3TJr.d.ts → services-C3lzi1sL.d.ts} +1 -1
- package/dist/styles/index.css +12 -6
- package/dist/styles/index.css.map +1 -1
- package/dist/styles/index.d.ts +3 -2
- package/dist/styles/index.js +3 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +2 -2
- package/dist/{types-C4oGsbnK.d.ts → types-CPl0DH-A.d.ts} +2 -2
- package/dist/utils/abi/index.js +5 -5
- package/dist/utils/index.d.ts +10 -9
- package/dist/utils/index.js +13 -11
- package/package.json +19 -15
- package/src/consts.ts +2 -0
- package/src/react/__tests__/provider.test.tsx +4 -4
- package/src/react/_internal/api/__mocks__/indexer.msw.ts +5 -5
- package/src/react/_internal/api/__mocks__/metadata.msw.ts +2 -2
- package/src/react/_internal/api/zod-schema.ts +2 -2
- package/src/react/_internal/databeat/index.ts +11 -3
- package/src/react/_internal/types.ts +2 -2
- package/src/react/_internal/wagmi/__tests__/create-config.test.ts +6 -6
- package/src/react/_internal/wagmi/create-config.ts +11 -2
- package/src/react/_internal/wallet/__tests__/wallet.test.ts +343 -0
- package/src/react/_internal/wallet/useWallet.ts +22 -15
- package/src/react/_internal/wallet/wallet.ts +17 -11
- package/src/react/hooks/__tests__/useAutoSelectFeeOption.test.tsx +8 -12
- package/src/react/hooks/__tests__/useBalanceOfCollectible.test.tsx +6 -13
- package/src/react/hooks/__tests__/useCancelOrder.test.tsx +59 -155
- package/src/react/hooks/__tests__/useCancelTransactionSteps.test.tsx +21 -20
- package/src/react/hooks/__tests__/useCollectible.test.tsx +6 -7
- package/src/react/hooks/__tests__/useCollection.test.tsx +5 -6
- package/src/react/hooks/__tests__/useCollectionBalanceDetails.test.tsx +8 -16
- package/src/react/hooks/__tests__/useCollectionDetails.test.tsx +7 -6
- package/src/react/hooks/__tests__/useCollectionDetailsPolling.test.tsx +8 -12
- package/src/react/hooks/__tests__/useComparePrices.test.tsx +1 -2
- package/src/react/hooks/__tests__/useConvertPriceToUSD.test.tsx +2 -3
- package/src/react/hooks/__tests__/useCountListingsForCollectible.test.tsx +4 -5
- package/src/react/hooks/__tests__/useCountOfCollectables.test.tsx +6 -7
- package/src/react/hooks/__tests__/useCountOffersForCollectible.test.tsx +4 -5
- package/src/react/hooks/__tests__/useCurrencies.test.tsx +3 -4
- package/src/react/hooks/__tests__/useCurrency.test.tsx +4 -6
- package/src/react/hooks/__tests__/useCurrencyBalance.test.tsx +78 -84
- package/src/react/hooks/__tests__/useFilters.test.tsx +5 -6
- package/src/react/hooks/__tests__/useFloorOrder.test.tsx +5 -6
- package/src/react/hooks/__tests__/useGenerateBuyTransaction.test.tsx +6 -7
- package/src/react/hooks/__tests__/useGenerateCancelTransaction.test.tsx +11 -67
- package/src/react/hooks/__tests__/useGenerateListingTransaction.test.tsx +6 -17
- package/src/react/hooks/__tests__/useGenerateOfferTransaction.test.tsx +6 -16
- package/src/react/hooks/__tests__/useGenerateSellTransaction.test.tsx +7 -17
- package/src/react/hooks/__tests__/useHighestOffer.test.tsx +6 -7
- package/src/react/hooks/__tests__/useListBalances.test.tsx +4 -9
- package/src/react/hooks/__tests__/useListCollectibleActivities.test.tsx +5 -11
- package/src/react/hooks/__tests__/useListCollectibles.test.tsx +6 -7
- package/src/react/hooks/__tests__/useListCollectiblesPaginated.test.tsx +2 -3
- package/src/react/hooks/__tests__/useListCollectionActivities.test.tsx +6 -12
- package/src/react/hooks/__tests__/useListCollections.test.tsx +5 -14
- package/src/react/hooks/__tests__/useListListingsForCollectible.test.tsx +6 -7
- package/src/react/hooks/__tests__/useListOffersForCollectible.test.tsx +6 -7
- package/src/react/hooks/__tests__/useLowestListing.test.tsx +6 -7
- package/src/react/hooks/__tests__/useMarketplaceConfig.test.tsx +5 -14
- package/src/react/hooks/__tests__/useRoyaltyPercentage.test.tsx +46 -78
- package/src/react/hooks/options/__mocks__/marketplaceConfig.msw.ts +9 -4
- package/src/react/hooks/options/__tests__/marketplaceConfigOptions.test.tsx +3 -4
- package/src/react/hooks/options/collectionOptions.ts +42 -0
- package/src/react/hooks/options/index.ts +2 -0
- package/src/react/hooks/useCancelOrder.tsx +3 -3
- package/src/react/hooks/useCancelTransactionSteps.tsx +11 -11
- package/src/react/hooks/useCollection.tsx +6 -37
- package/src/react/hooks/useCollectionBalanceDetails.tsx +3 -3
- package/src/react/hooks/useCollectionDetailsPolling.tsx +1 -1
- package/src/react/hooks/useCurrencies.tsx +1 -1
- package/src/react/hooks/useCurrencyBalance.tsx +4 -5
- package/src/react/hooks/useGenerateListingTransaction.tsx +1 -1
- package/src/react/hooks/useGenerateOfferTransaction.tsx +1 -1
- package/src/react/hooks/useGetReceiptFromHash.tsx +1 -1
- package/src/react/hooks/useListCollectibleActivities.tsx +1 -1
- package/src/react/hooks/useListCollectionActivities.tsx +1 -1
- package/src/react/hooks/useRoyaltyPercentage.tsx +16 -8
- package/src/react/index.ts +1 -0
- package/src/react/provider.tsx +2 -2
- package/src/react/ssr/__tests__/create-ssr-client.test.ts +97 -0
- package/src/react/ssr/create-ssr-client.ts +1 -1
- package/src/react/ui/components/_internals/action-button/ActionButton.tsx +3 -3
- package/src/react/ui/components/_internals/action-button/components/ActionButtonBody.tsx +2 -2
- package/src/react/ui/components/_internals/action-button/components/NonOwnerActions.tsx +4 -4
- package/src/react/ui/components/_internals/action-button/components/OwnerActions.tsx +2 -2
- package/src/react/ui/components/_internals/action-button/hooks/useActionButtonLogic.ts +1 -1
- package/src/react/ui/components/_internals/custom-select/__tests__/CustomSelect.test.tsx +2 -7
- package/src/react/ui/components/collectible-card/CollectibleCard.tsx +33 -7
- package/src/react/ui/components/collectible-card/Footer.tsx +47 -8
- package/src/react/ui/components/collectible-card/styles.css.ts +26 -2
- package/src/react/ui/components/marketplace-logos/marketplace-logos.tsx +1 -1
- package/src/react/ui/icons/index.ts +2 -5
- package/src/react/ui/{icons/DiamondEye.tsx → images/marketplaces/LooksRare.tsx} +1 -1
- package/src/react/ui/modals/BuyModal/__tests__/Modal.test.tsx +10 -11
- package/src/react/ui/modals/BuyModal/hooks/__tests__/useBuyCollectable.test.tsx +343 -0
- package/src/react/ui/modals/BuyModal/hooks/__tests__/useCheckoutOptions.test.tsx +8 -31
- package/src/react/ui/modals/BuyModal/hooks/__tests__/useFees.test.tsx +4 -4
- package/src/react/ui/modals/BuyModal/hooks/__tests__/useLoadData.test.tsx +9 -36
- package/src/react/ui/modals/BuyModal/hooks/useCheckoutOptions.ts +3 -3
- package/src/react/ui/modals/BuyModal/hooks/useLoadData.ts +1 -1
- package/src/react/ui/modals/BuyModal/modals/Modal1155.tsx +25 -15
- package/src/react/ui/modals/BuyModal/modals/__tests__/CheckoutModal.test.tsx +2 -2
- package/src/react/ui/modals/BuyModal/modals/__tests__/Modal1155.test.tsx +209 -242
- package/src/react/ui/modals/CreateListingModal/Modal.tsx +3 -2
- package/src/react/ui/modals/CreateListingModal/__tests__/Modal.test.tsx +5 -11
- package/src/react/ui/modals/CreateListingModal/hooks/useGetTokenApproval.ts +1 -1
- package/src/react/ui/modals/CreateListingModal/index.tsx +1 -1
- package/src/react/ui/modals/MakeOfferModal/Modal.tsx +1 -1
- package/src/react/ui/modals/MakeOfferModal/__tests__/Modal.test.tsx +46 -49
- package/src/react/ui/modals/SellModal/Modal.tsx +1 -0
- package/src/react/ui/modals/SellModal/__tests__/Modal.test.tsx +9 -28
- package/src/react/ui/modals/SellModal/hooks/useGetTokenApproval.tsx +2 -2
- package/src/react/ui/modals/SuccessfulPurchaseModal/__tests__/Modal.test.tsx +3 -3
- package/src/react/ui/modals/_internal/components/actionModal/ActionModal.tsx +4 -4
- package/src/react/ui/modals/_internal/components/actionModal/store.ts +1 -1
- package/src/react/ui/modals/_internal/components/alertMessage/index.tsx +2 -3
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/__tests__/index.test.tsx +4 -4
- package/src/react/ui/modals/_internal/components/expirationDateSelect/index.tsx +1 -1
- package/src/react/ui/modals/_internal/components/priceInput/__tests__/index.test.tsx +1 -8
- package/src/react/ui/modals/_internal/components/quantityInput/index.tsx +9 -5
- package/src/react/ui/modals/_internal/components/switchChainModal/__tests__/SwitchChainModal.test.tsx +4 -10
- package/src/react/ui/modals/_internal/components/switchChainModal/index.tsx +2 -2
- package/src/react/ui/modals/_internal/components/switchChainModal/store.ts +1 -1
- package/src/react/ui/modals/_internal/components/transaction-footer/index.tsx +9 -3
- package/src/react/ui/modals/_internal/components/transaction-footer/transactionFooter.css.ts +11 -0
- package/src/react/ui/modals/_internal/components/transactionDetails/index.tsx +8 -7
- package/src/react/ui/modals/_internal/components/transactionStatusModal/__tests__/TransactionStatusModal.test.tsx +4 -9
- package/src/react/ui/modals/_internal/components/transactionStatusModal/__tests__/utils.test.ts +3 -3
- package/src/react/ui/modals/_internal/components/transactionStatusModal/hooks/useTransactionStatus.ts +4 -4
- package/src/react/ui/modals/_internal/components/transactionStatusModal/index.tsx +1 -1
- package/src/react/ui/modals/modal-provider.tsx +2 -2
- package/src/types/sdk-config.ts +1 -0
- package/src/utils/__tests__/address.test.ts +1 -1
- package/src/utils/__tests__/getMarketplaceDetails.test.ts +4 -4
- package/src/utils/getMarketplaceDetails.ts +7 -7
- package/src/utils/index.ts +1 -1
- package/src/utils/networkconfigToWagmiChain.ts +17 -0
- package/src/utils/price.ts +8 -0
- package/test/const.ts +35 -0
- package/test/globalSetup.ts +15 -0
- package/test/index.ts +1 -0
- package/{src/react/_internal/test → test}/mocks/wallet.ts +5 -5
- package/test/setup.ts +20 -0
- package/test/test-utils.tsx +157 -0
- package/tsconfig.json +7 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/vitest.config.js +5 -3
- package/dist/chunk-4YR6AIXG.js.map +0 -1
- package/dist/chunk-6YHHCGGY.js.map +0 -1
- package/dist/chunk-7C7ADZ2H.js.map +0 -1
- package/dist/chunk-7FN62HOP.js.map +0 -1
- package/dist/chunk-AIGFG26L.js.map +0 -1
- package/dist/chunk-E2V2BMF6.js.map +0 -1
- package/dist/chunk-J6F5QOW5.js.map +0 -1
- package/dist/chunk-RIGIV5XT.js.map +0 -1
- package/dist/chunk-Y75XGZOB.js.map +0 -1
- package/src/react/_internal/test/mocks/publicClient.ts +0 -39
- package/src/react/_internal/test/mocks/wagmi.ts +0 -61
- package/src/react/_internal/test/setup.ts +0 -28
- package/src/react/_internal/test-utils.tsx +0 -97
- package/src/react/ui/icons/ArrowUp.tsx +0 -32
- package/src/react/ui/icons/InventoryIcon.tsx +0 -44
- package/src/react/ui/icons/MinusIcon.tsx +0 -34
- package/src/react/ui/icons/PlusIcon.tsx +0 -32
- package/src/react/ui/icons/PositiveCircleIcon.tsx +0 -38
- package/src/react/ui/modals/BuyModal/hooks/__tests__/useBuyCollectable.test.tsx.bak +0 -379
- package/src/utils/__tests__/get-public-rpc-client.test.ts +0 -111
- package/src/utils/get-public-rpc-client.ts +0 -41
- /package/src/react/ui/icons/{Bell.tsx → BellIcon.tsx} +0 -0
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
cleanup,
|
|
5
|
-
waitFor,
|
|
6
|
-
fireEvent,
|
|
7
|
-
} from '../../../../_internal/test-utils';
|
|
8
|
-
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
1
|
+
import { cleanup, render, screen } from '@test';
|
|
2
|
+
import { zeroAddress } from 'viem';
|
|
3
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
9
4
|
import { MakeOfferModal } from '../Modal';
|
|
10
5
|
import { makeOfferModal$ } from '../store';
|
|
11
|
-
import { zeroAddress } from 'viem';
|
|
12
|
-
import * as hooks from '../../../../hooks';
|
|
13
6
|
|
|
14
7
|
// TODO: This should be moved to a shared test file
|
|
15
8
|
vi.mock(import('../../../../hooks'), async (importOriginal) => {
|
|
@@ -24,6 +17,10 @@ vi.mock(import('../../../../hooks'), async (importOriginal) => {
|
|
|
24
17
|
};
|
|
25
18
|
});
|
|
26
19
|
|
|
20
|
+
vi.mock('@0xsequence/kit', () => ({
|
|
21
|
+
useWaasFeeOptions: vi.fn().mockReturnValue([]),
|
|
22
|
+
}));
|
|
23
|
+
|
|
27
24
|
const defaultArgs = {
|
|
28
25
|
collectionAddress: zeroAddress,
|
|
29
26
|
chainId: '1',
|
|
@@ -43,36 +40,36 @@ describe('MakeOfferModal', () => {
|
|
|
43
40
|
expect(screen.queryByText('Make an offer')).toBeNull();
|
|
44
41
|
});
|
|
45
42
|
|
|
46
|
-
it('should render loading state', () => {
|
|
47
|
-
|
|
43
|
+
// it('should render loading state', () => {
|
|
44
|
+
// makeOfferModal$.open(defaultArgs);
|
|
48
45
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
});
|
|
46
|
+
// render(<MakeOfferModal />);
|
|
47
|
+
// const loadingModal = screen.getByTestId('loading-modal');
|
|
48
|
+
// expect(loadingModal).toBeVisible();
|
|
49
|
+
// });
|
|
53
50
|
|
|
54
|
-
it('should render error state', async () => {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
51
|
+
// it('should render error state', async () => {
|
|
52
|
+
// // @ts-expect-error - TODO: Add a common mock object with the correct shape
|
|
53
|
+
// vi.mocked(hooks.useCollection).mockReturnValue({
|
|
54
|
+
// data: undefined,
|
|
55
|
+
// isLoading: false,
|
|
56
|
+
// isError: true,
|
|
57
|
+
// });
|
|
61
58
|
|
|
62
|
-
|
|
59
|
+
// makeOfferModal$.open(defaultArgs);
|
|
63
60
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
});
|
|
61
|
+
// render(<MakeOfferModal />);
|
|
62
|
+
// const errorModal = await screen.findByTestId('error-modal');
|
|
63
|
+
// expect(errorModal).toBeVisible();
|
|
64
|
+
// });
|
|
68
65
|
|
|
69
|
-
it('should render main form when data is loaded', async () => {
|
|
70
|
-
|
|
66
|
+
// it('should render main form when data is loaded', async () => {
|
|
67
|
+
// makeOfferModal$.open(defaultArgs);
|
|
71
68
|
|
|
72
|
-
|
|
69
|
+
// render(<MakeOfferModal />);
|
|
73
70
|
|
|
74
|
-
|
|
75
|
-
});
|
|
71
|
+
// expect(await screen.findByText('Enter price')).toBeInTheDocument();
|
|
72
|
+
// });
|
|
76
73
|
|
|
77
74
|
it('should reset store values when modal is closed and reopened', () => {
|
|
78
75
|
// Open modal first time
|
|
@@ -97,26 +94,26 @@ describe('MakeOfferModal', () => {
|
|
|
97
94
|
expect(makeOfferModal$.expiry.get()).toBeDefined();
|
|
98
95
|
});
|
|
99
96
|
|
|
100
|
-
it('should update state based on price input', async () => {
|
|
101
|
-
|
|
97
|
+
// it('should update state based on price input', async () => {
|
|
98
|
+
// makeOfferModal$.open(defaultArgs);
|
|
102
99
|
|
|
103
|
-
|
|
100
|
+
// render(<MakeOfferModal />);
|
|
104
101
|
|
|
105
|
-
|
|
106
|
-
|
|
102
|
+
// // Initial price should be 0
|
|
103
|
+
// expect(makeOfferModal$.offerPrice.amountRaw.get()).toBe('0');
|
|
107
104
|
|
|
108
|
-
|
|
105
|
+
// // Find and interact with price input
|
|
109
106
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
107
|
+
// const priceInput = await screen.findByRole('textbox', {
|
|
108
|
+
// name: 'Enter price',
|
|
109
|
+
// });
|
|
110
|
+
// expect(priceInput).toBeInTheDocument();
|
|
114
111
|
|
|
115
|
-
|
|
112
|
+
// fireEvent.change(priceInput, { target: { value: '1.5' } });
|
|
116
113
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
});
|
|
114
|
+
// // Wait for the state to update and verify it's not 0 anymore
|
|
115
|
+
// await waitFor(() => {
|
|
116
|
+
// expect(makeOfferModal$.offerPrice.amountRaw.get()).not.toBe('0');
|
|
117
|
+
// });
|
|
118
|
+
// });
|
|
122
119
|
});
|
|
@@ -1,26 +1,14 @@
|
|
|
1
|
-
import { render, screen
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
it,
|
|
5
|
-
expect,
|
|
6
|
-
vi,
|
|
7
|
-
beforeEach,
|
|
8
|
-
beforeAll,
|
|
9
|
-
afterAll,
|
|
10
|
-
} from 'vitest';
|
|
1
|
+
import { cleanup, render, screen } from '@test';
|
|
2
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
3
|
+
import { useCollection, useCurrency } from '../../../../hooks';
|
|
11
4
|
import { SellModal } from '../Modal';
|
|
12
5
|
import { type OpenSellModalArgs, sellModal$ } from '../store';
|
|
13
|
-
import { useCollection, useCurrency } from '../../../../hooks';
|
|
14
6
|
|
|
15
7
|
import { MarketplaceKind, type Order } from '../../../../_internal';
|
|
16
8
|
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
mockMarketplaceEndpoint,
|
|
21
|
-
} from '../../../../_internal/api/__mocks__/marketplace.msw';
|
|
22
|
-
import { delay, http, HttpResponse } from 'msw';
|
|
23
|
-
import { afterEach } from 'node:test';
|
|
9
|
+
import { server } from '@test';
|
|
10
|
+
import { http, HttpResponse, delay } from 'msw';
|
|
11
|
+
import { mockMarketplaceEndpoint } from '../../../../_internal/api/__mocks__/marketplace.msw';
|
|
24
12
|
|
|
25
13
|
// Test data
|
|
26
14
|
const mockOrder = {
|
|
@@ -49,16 +37,9 @@ vi.mock(import('../../../../hooks'), async (importOriginal) => {
|
|
|
49
37
|
};
|
|
50
38
|
});
|
|
51
39
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// Enable API mocking before tests
|
|
56
|
-
beforeAll(() => server.listen());
|
|
57
|
-
|
|
58
|
-
// Disable API mocking after the tests are done
|
|
59
|
-
afterAll(() => server.close());
|
|
60
|
-
|
|
61
|
-
afterEach(() => server.resetHandlers());
|
|
40
|
+
vi.mock('@0xsequence/kit', () => ({
|
|
41
|
+
useWaasFeeOptions: vi.fn().mockReturnValue([]),
|
|
42
|
+
}));
|
|
62
43
|
|
|
63
44
|
beforeEach(() => {
|
|
64
45
|
cleanup();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { skipToken, useQuery } from '@tanstack/react-query';
|
|
1
2
|
import {
|
|
2
3
|
type GenerateSellTransactionArgs,
|
|
3
|
-
getMarketplaceClient,
|
|
4
4
|
type MarketplaceKind,
|
|
5
5
|
type OrderData,
|
|
6
6
|
StepType,
|
|
7
|
+
getMarketplaceClient,
|
|
7
8
|
} from '../../../../_internal';
|
|
8
|
-
import { skipToken, useQuery } from '@tanstack/react-query';
|
|
9
9
|
import { useWallet } from '../../../../_internal/wallet/useWallet';
|
|
10
10
|
import { useConfig } from '../../../../hooks/useConfig';
|
|
11
11
|
import { useFees } from '../../BuyModal/hooks/useFees';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { render, screen
|
|
2
|
-
import {
|
|
1
|
+
import { cleanup, render, screen } from '@test';
|
|
2
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
3
3
|
import SuccessfulPurchaseModal, { useSuccessfulPurchaseModal } from '..';
|
|
4
|
-
import { successfulPurchaseModal$ } from '../_store';
|
|
5
4
|
import type { ModalCallbacks } from '../../_internal/types';
|
|
5
|
+
import { successfulPurchaseModal$ } from '../_store';
|
|
6
6
|
|
|
7
7
|
describe('SuccessfulPurchaseModal', () => {
|
|
8
8
|
beforeEach(() => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import type React from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { type ComponentProps, useState } from 'react';
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
Box,
|
|
@@ -21,15 +21,15 @@ import {
|
|
|
21
21
|
Title,
|
|
22
22
|
} from '@radix-ui/react-dialog';
|
|
23
23
|
import { getProviderEl } from '../../../../../_internal';
|
|
24
|
+
import { useWallet } from '../../../../../_internal/wallet/useWallet';
|
|
25
|
+
import { useSwitchChainModal } from '../switchChainModal';
|
|
26
|
+
import WaasFeeOptionsBox from '../waasFeeOptionsBox';
|
|
24
27
|
import {
|
|
25
28
|
closeButton,
|
|
26
29
|
cta as ctaStyle,
|
|
27
30
|
dialogContent,
|
|
28
31
|
dialogOverlay,
|
|
29
32
|
} from './styles.css';
|
|
30
|
-
import WaasFeeOptionsBox from '../waasFeeOptionsBox';
|
|
31
|
-
import { useSwitchChainModal } from '../switchChainModal';
|
|
32
|
-
import { useWallet } from '../../../../../_internal/wallet/useWallet';
|
|
33
33
|
|
|
34
34
|
export interface ActionModalProps {
|
|
35
35
|
isOpen: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Observable, observable } from '@legendapp/state';
|
|
2
|
-
import type { ChainId } from '../../../../../_internal';
|
|
3
2
|
import type { Address } from 'viem';
|
|
3
|
+
import type { ChainId } from '../../../../../_internal';
|
|
4
4
|
|
|
5
5
|
export interface ActionModalState {
|
|
6
6
|
isOpen: boolean;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Box, Text, WarningIcon } from '@0xsequence/design-system';
|
|
2
|
-
import
|
|
2
|
+
import InfoIcon from '../../../../icons/InfoIcon';
|
|
3
3
|
import { alertMessageBox, alertMessageBoxVariants } from './styles.css';
|
|
4
|
-
|
|
5
4
|
type AlertMessageProps = {
|
|
6
5
|
message: string;
|
|
7
6
|
type: 'warning' | 'info';
|
|
@@ -20,7 +19,7 @@ export default function AlertMessage({ message, type }: AlertMessageProps) {
|
|
|
20
19
|
</Text>
|
|
21
20
|
|
|
22
21
|
{type === 'warning' && <WarningIcon size="sm" color="white" />}
|
|
23
|
-
{type === 'info' && <
|
|
22
|
+
{type === 'info' && <InfoIcon size="sm" color="white" />}
|
|
24
23
|
</Box>
|
|
25
24
|
);
|
|
26
25
|
}
|
package/src/react/ui/modals/_internal/components/currencyOptionsSelect/__tests__/index.test.tsx
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { screen, cleanup, fireEvent, waitFor } from '@testing-library/react';
|
|
2
|
-
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
3
1
|
import { observable } from '@legendapp/state';
|
|
4
2
|
import type { UseQueryResult } from '@tanstack/react-query';
|
|
3
|
+
import { render } from '@test';
|
|
4
|
+
import { cleanup, fireEvent, screen, waitFor } from '@testing-library/react';
|
|
5
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
5
6
|
import CurrencyOptionsSelect from '..';
|
|
6
7
|
import type { Currency } from '../../../../../../_internal';
|
|
7
|
-
import { useCurrencies } from '../../../../../../hooks';
|
|
8
8
|
import { mockCurrencies } from '../../../../../../_internal/api/__mocks__/marketplace.msw';
|
|
9
|
-
import {
|
|
9
|
+
import { useCurrencies } from '../../../../../../hooks';
|
|
10
10
|
|
|
11
11
|
// Mock the hooks
|
|
12
12
|
vi.mock('../../../../../../hooks', () => ({
|
|
@@ -2,9 +2,9 @@ import { Box, Skeleton, Text } from '@0xsequence/design-system';
|
|
|
2
2
|
import type { Observable } from '@legendapp/state';
|
|
3
3
|
import { observer } from '@legendapp/state/react';
|
|
4
4
|
import { addDays } from 'date-fns';
|
|
5
|
+
import { useState } from 'react';
|
|
5
6
|
import { CustomSelect } from '../../../../components/_internals/custom-select/CustomSelect';
|
|
6
7
|
import CalendarPopover from '../calendarPopover';
|
|
7
|
-
import { useState } from 'react';
|
|
8
8
|
|
|
9
9
|
const setToEndOfDay = (date: Date): Date => {
|
|
10
10
|
const endOfDay = new Date(date);
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
import { observable } from '@legendapp/state';
|
|
2
|
+
import { act, cleanup, fireEvent, render, screen, waitFor } from '@test';
|
|
2
3
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
3
4
|
import PriceInput from '..';
|
|
4
5
|
import type { Currency, Price } from '../../../../../../../types';
|
|
5
6
|
import { CurrencyStatus } from '../../../../../../_internal';
|
|
6
|
-
import {
|
|
7
|
-
act,
|
|
8
|
-
cleanup,
|
|
9
|
-
fireEvent,
|
|
10
|
-
render,
|
|
11
|
-
screen,
|
|
12
|
-
waitFor,
|
|
13
|
-
} from '../../../../../../_internal/test-utils';
|
|
14
7
|
|
|
15
8
|
vi.mock('../hooks/usePriceInput', () => ({
|
|
16
9
|
usePriceInput: vi.fn(({ onPriceChange }) => ({
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
AddIcon,
|
|
3
|
+
Box,
|
|
4
|
+
IconButton,
|
|
5
|
+
NumericInput,
|
|
6
|
+
SubtractIcon,
|
|
7
|
+
} from '@0xsequence/design-system';
|
|
2
8
|
import type { Observable } from '@legendapp/state';
|
|
3
|
-
import SvgMinusIcon from '../../../../icons/MinusIcon';
|
|
4
|
-
import SvgPlusIcon from '../../../../icons/PlusIcon';
|
|
5
9
|
import { quantityInputWrapper } from './styles.css';
|
|
6
10
|
|
|
7
11
|
type QuantityInputProps = {
|
|
@@ -105,7 +109,7 @@ export default function QuantityInput({
|
|
|
105
109
|
onClick={handleDecrement}
|
|
106
110
|
background={'buttonGlass'}
|
|
107
111
|
size="xs"
|
|
108
|
-
icon={
|
|
112
|
+
icon={SubtractIcon}
|
|
109
113
|
/>
|
|
110
114
|
|
|
111
115
|
<IconButton
|
|
@@ -113,7 +117,7 @@ export default function QuantityInput({
|
|
|
113
117
|
onClick={handleIncrement}
|
|
114
118
|
background={'buttonGlass'}
|
|
115
119
|
size="xs"
|
|
116
|
-
icon={
|
|
120
|
+
icon={AddIcon}
|
|
117
121
|
/>
|
|
118
122
|
</Box>
|
|
119
123
|
}
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
cleanup,
|
|
4
|
-
render,
|
|
5
|
-
screen,
|
|
6
|
-
fireEvent,
|
|
7
|
-
waitFor,
|
|
8
|
-
} from '../../../../../../_internal/test-utils';
|
|
1
|
+
import { cleanup, fireEvent, render, screen, waitFor } from '@test';
|
|
9
2
|
import * as matchers from '@testing-library/jest-dom/matchers';
|
|
10
|
-
import SwitchChainModal, { useSwitchChainModal } from '../index';
|
|
11
|
-
import { switchChainModal$, initialState } from '../store';
|
|
12
3
|
import type { SwitchChainError } from 'viem';
|
|
4
|
+
import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';
|
|
5
|
+
import SwitchChainModal, { useSwitchChainModal } from '../index';
|
|
6
|
+
import { initialState, switchChainModal$ } from '../store';
|
|
13
7
|
|
|
14
8
|
expect.extend(matchers);
|
|
15
9
|
|
|
@@ -7,9 +7,10 @@ import {
|
|
|
7
7
|
} from '@0xsequence/design-system';
|
|
8
8
|
import { observer } from '@legendapp/state/react';
|
|
9
9
|
import { Close, Content, Overlay, Portal, Root } from '@radix-ui/react-dialog';
|
|
10
|
+
import type { SwitchChainError } from 'viem';
|
|
10
11
|
import { useSwitchChain } from 'wagmi';
|
|
11
12
|
import { getPresentableChainName } from '../../../../../../utils/network';
|
|
12
|
-
import {
|
|
13
|
+
import { type ChainId, getProviderEl } from '../../../../../_internal';
|
|
13
14
|
import AlertMessage from '../alertMessage';
|
|
14
15
|
import { switchChainModal$ } from './store';
|
|
15
16
|
import {
|
|
@@ -18,7 +19,6 @@ import {
|
|
|
18
19
|
switchChainCta,
|
|
19
20
|
switchChainModalContent,
|
|
20
21
|
} from './styles.css';
|
|
21
|
-
import type { SwitchChainError } from 'viem';
|
|
22
22
|
|
|
23
23
|
export type ShowSwitchChainModalArgs = {
|
|
24
24
|
chainIdToSwitchTo: ChainId;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { observable } from '@legendapp/state';
|
|
2
|
+
import type { SwitchChainError } from 'viem';
|
|
2
3
|
import type { ShowSwitchChainModalArgs } from '.';
|
|
3
4
|
import type { ChainId } from '../../../../../_internal';
|
|
4
|
-
import type { SwitchChainError } from 'viem';
|
|
5
5
|
|
|
6
6
|
export interface SwitchChainModalState {
|
|
7
7
|
isOpen: boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { Box, CheckmarkIcon, Spinner, Text } from '@0xsequence/design-system';
|
|
1
2
|
import { type ChainId, networks } from '@0xsequence/network';
|
|
2
3
|
import type { Hex } from 'viem';
|
|
3
|
-
import { Box, Text, Spinner } from '@0xsequence/design-system';
|
|
4
4
|
import { truncateMiddle } from '../../../../../../utils';
|
|
5
|
-
import
|
|
5
|
+
import { positiveCircle } from './transactionFooter.css';
|
|
6
6
|
|
|
7
7
|
type TransactionFooterProps = {
|
|
8
8
|
transactionHash: Hex | undefined;
|
|
@@ -24,7 +24,7 @@ export default function TransactionFooter({
|
|
|
24
24
|
chainId,
|
|
25
25
|
}: TransactionFooterProps) {
|
|
26
26
|
const icon =
|
|
27
|
-
((isConfirmed || orderId) && <
|
|
27
|
+
((isConfirmed || orderId) && <PositiveCircle />) ||
|
|
28
28
|
(isConfirming && <Spinner size="md" />);
|
|
29
29
|
|
|
30
30
|
const title =
|
|
@@ -73,3 +73,9 @@ export default function TransactionFooter({
|
|
|
73
73
|
</Box>
|
|
74
74
|
);
|
|
75
75
|
}
|
|
76
|
+
|
|
77
|
+
export const PositiveCircle = () => (
|
|
78
|
+
<div className={positiveCircle}>
|
|
79
|
+
<CheckmarkIcon size="xs" color="white" />
|
|
80
|
+
</div>
|
|
81
|
+
);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Box, Image, Skeleton, Text } from '@0xsequence/design-system';
|
|
2
2
|
import { type Hex, formatUnits } from 'viem';
|
|
3
|
+
import { DEFAULT_MARKETPLACE_FEE_PERCENTAGE } from '../../../../../../consts';
|
|
3
4
|
import type { Price } from '../../../../../../types';
|
|
4
5
|
import {
|
|
5
6
|
useMarketplaceConfig,
|
|
@@ -12,27 +13,27 @@ type TransactionDetailsProps = {
|
|
|
12
13
|
chainId: string;
|
|
13
14
|
price?: Price;
|
|
14
15
|
currencyImageUrl?: string;
|
|
16
|
+
includeMarketplaceFee: boolean;
|
|
15
17
|
// We use a placeholder price for create listing modal
|
|
16
18
|
showPlaceholderPrice?: boolean;
|
|
17
19
|
};
|
|
18
20
|
|
|
19
|
-
//TODO: Move this
|
|
20
|
-
const DEFAULT_MARKETPLACE_FEE_PERCENTAGE = 2.5;
|
|
21
|
-
|
|
22
21
|
export default function TransactionDetails({
|
|
23
22
|
collectibleId,
|
|
24
23
|
collectionAddress,
|
|
25
24
|
chainId,
|
|
25
|
+
includeMarketplaceFee,
|
|
26
26
|
price,
|
|
27
27
|
showPlaceholderPrice,
|
|
28
28
|
currencyImageUrl,
|
|
29
29
|
}: TransactionDetailsProps) {
|
|
30
30
|
const { data, isLoading: marketplaceConfigLoading } = useMarketplaceConfig();
|
|
31
31
|
|
|
32
|
-
const marketplaceFeePercentage =
|
|
33
|
-
data?.collections.find(
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
const marketplaceFeePercentage = includeMarketplaceFee
|
|
33
|
+
? data?.collections.find(
|
|
34
|
+
(collection) => collection.address === collectionAddress,
|
|
35
|
+
)?.feePercentage || DEFAULT_MARKETPLACE_FEE_PERCENTAGE
|
|
36
|
+
: 0;
|
|
36
37
|
const { data: royaltyPercentage, isLoading: royaltyPercentageLoading } =
|
|
37
38
|
useRoyaltyPercentage({
|
|
38
39
|
chainId,
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
render,
|
|
3
|
-
cleanup,
|
|
4
|
-
screen,
|
|
5
|
-
waitFor,
|
|
6
|
-
} from '../../../../../../_internal/test-utils';
|
|
1
|
+
import { cleanup, render, screen, waitFor } from '@test';
|
|
7
2
|
|
|
3
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
4
|
+
import { TransactionType } from '../../../../../../_internal/types';
|
|
8
5
|
import TransactionStatusModal from '../index';
|
|
9
|
-
import { transactionStatusModal$ } from '../store';
|
|
10
6
|
import type { ShowTransactionStatusModalArgs } from '../index';
|
|
11
|
-
import {
|
|
12
|
-
import { beforeEach, describe, expect, it, vi, afterEach } from 'vitest';
|
|
7
|
+
import { transactionStatusModal$ } from '../store';
|
|
13
8
|
|
|
14
9
|
const mockTransactionArgs: ShowTransactionStatusModalArgs = {
|
|
15
10
|
hash: '0x123' as `0x${string}`,
|
package/src/react/ui/modals/_internal/components/transactionStatusModal/__tests__/utils.test.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { CurrencyStatus } from '../../../../../../_internal';
|
|
2
3
|
import { TransactionType } from '../../../../../../_internal/types';
|
|
4
|
+
import type { TransactionStatus } from '../store';
|
|
3
5
|
import { getFormattedType } from '../util/getFormattedType';
|
|
4
6
|
import { getTransactionStatusModalMessage } from '../util/getMessage';
|
|
5
7
|
import {
|
|
6
|
-
getTransactionStatusModalTitle,
|
|
7
8
|
getTransactionStatusModalSpinnerTitle,
|
|
9
|
+
getTransactionStatusModalTitle,
|
|
8
10
|
} from '../util/getTitle';
|
|
9
|
-
import type { TransactionStatus } from '../store';
|
|
10
|
-
import { CurrencyStatus } from '../../../../../../_internal';
|
|
11
11
|
|
|
12
12
|
describe('Transaction Status Modal Utils', () => {
|
|
13
13
|
describe('getFormattedType', () => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { skipToken, useQuery } from '@tanstack/react-query';
|
|
2
|
-
import { useWallet } from '../../../../../../_internal/wallet/useWallet';
|
|
3
|
-
import type { TransactionStatus } from '../store';
|
|
4
1
|
import { TransactionStatus as IndexerTransactionStatus } from '@0xsequence/indexer';
|
|
2
|
+
import { skipToken, useQuery } from '@tanstack/react-query';
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
5
4
|
import { type Hex, WaitForTransactionReceiptTimeoutError } from 'viem';
|
|
5
|
+
import { useWallet } from '../../../../../../_internal/wallet/useWallet';
|
|
6
6
|
import type { ModalCallbacks } from '../../../types';
|
|
7
|
-
import {
|
|
7
|
+
import type { TransactionStatus } from '../store';
|
|
8
8
|
|
|
9
9
|
const useTransactionStatus = (
|
|
10
10
|
hash: Hex | undefined,
|
|
@@ -23,6 +23,7 @@ import { useCollectible } from '../../../../../hooks';
|
|
|
23
23
|
import type { ModalCallbacks } from '../../types';
|
|
24
24
|
import TransactionFooter from '../transaction-footer';
|
|
25
25
|
import TransactionPreview from '../transactionPreview';
|
|
26
|
+
import useTransactionStatus from './hooks/useTransactionStatus';
|
|
26
27
|
import { transactionStatusModal$ } from './store';
|
|
27
28
|
import {
|
|
28
29
|
closeButton,
|
|
@@ -31,7 +32,6 @@ import {
|
|
|
31
32
|
} from './styles.css';
|
|
32
33
|
import { getTransactionStatusModalMessage } from './util/getMessage';
|
|
33
34
|
import { getTransactionStatusModalTitle } from './util/getTitle';
|
|
34
|
-
import useTransactionStatus from './hooks/useTransactionStatus';
|
|
35
35
|
|
|
36
36
|
export type ShowTransactionStatusModalArgs = {
|
|
37
37
|
hash?: Hex;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { observer } from '@legendapp/state/react';
|
|
2
|
+
import { BuyModal } from './BuyModal/Modal';
|
|
3
|
+
import { CreateListingModal } from './CreateListingModal/Modal';
|
|
2
4
|
import { MakeOfferModal } from './MakeOfferModal/Modal';
|
|
3
5
|
import { SellModal } from './SellModal/Modal';
|
|
4
6
|
import SuccessfulPurchaseModal from './SuccessfulPurchaseModal';
|
|
@@ -6,8 +8,6 @@ import { TransferModal } from './TransferModal';
|
|
|
6
8
|
import SwitchChainModal from './_internal/components/switchChainModal';
|
|
7
9
|
import TransactionStatusModal from './_internal/components/transactionStatusModal';
|
|
8
10
|
import { _accountModalOpen$ } from './_internal/stores/accountModal';
|
|
9
|
-
import { CreateListingModal } from './CreateListingModal/Modal';
|
|
10
|
-
import { BuyModal } from './BuyModal/Modal';
|
|
11
11
|
|
|
12
12
|
export const ModalProvider = observer(() => {
|
|
13
13
|
return (
|
package/src/types/sdk-config.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, test } from 'vitest';
|
|
2
|
-
import {
|
|
2
|
+
import { compareAddress, truncateEnd, truncateMiddle } from '../address';
|
|
3
3
|
|
|
4
4
|
describe('address utils', () => {
|
|
5
5
|
describe('truncateMiddle', () => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { describe, expect, test } from 'vitest';
|
|
2
|
-
import { getMarketplaceDetails } from '../getMarketplaceDetails';
|
|
3
|
-
import { MarketplaceKind } from '../../types';
|
|
4
2
|
import {
|
|
5
|
-
SequenceLogo,
|
|
6
|
-
OpenSeaLogo,
|
|
7
3
|
MagicEdenLogo,
|
|
4
|
+
OpenSeaLogo,
|
|
5
|
+
SequenceLogo,
|
|
8
6
|
} from '../../react/ui/components/marketplace-logos';
|
|
7
|
+
import { MarketplaceKind } from '../../types';
|
|
8
|
+
import { getMarketplaceDetails } from '../getMarketplaceDetails';
|
|
9
9
|
|
|
10
10
|
describe('getMarketplaceDetails', () => {
|
|
11
11
|
describe('detection by marketplace kind', () => {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { MarketplaceKind } from '../types';
|
|
2
|
-
import type { ComponentType } from 'react';
|
|
3
1
|
import type { Image } from '@0xsequence/design-system';
|
|
2
|
+
import type { ComponentType } from 'react';
|
|
4
3
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
AlienSwapLogo,
|
|
5
|
+
BlurLogo,
|
|
6
|
+
LooksRareLogo,
|
|
7
7
|
MagicEdenLogo,
|
|
8
8
|
MintifyLogo,
|
|
9
|
-
|
|
9
|
+
OpenSeaLogo,
|
|
10
|
+
SequenceLogo,
|
|
10
11
|
X2y2Logo,
|
|
11
|
-
BlurLogo,
|
|
12
|
-
AlienSwapLogo,
|
|
13
12
|
} from '../react/ui/components/marketplace-logos';
|
|
13
|
+
import { MarketplaceKind } from '../types';
|
|
14
14
|
|
|
15
15
|
interface Marketplace {
|
|
16
16
|
logo: ComponentType<React.ComponentProps<typeof Image>>;
|