@0xsequence/marketplace-sdk 0.8.9 → 0.8.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.changeset/fluffy-jokes-lay.md +5 -0
- package/.changeset/wise-bugs-boil.md +8 -0
- package/CHANGELOG.md +43 -0
- package/dist/{chunk-FMEEJFAF.js → chunk-5C6ZZ6WX.js} +1 -1
- package/dist/{chunk-YEGD7PWE.js → chunk-5O44EPXZ.js} +2 -2
- package/dist/chunk-6CTFVBKU.js +1 -0
- package/dist/{chunk-DWTLVJAW.js → chunk-6OPMUCGX.js} +1 -1
- package/dist/chunk-6OPMUCGX.js.map +1 -0
- package/dist/{chunk-O34GCB47.js → chunk-L6KWLCER.js} +4 -4
- package/dist/chunk-L6KWLCER.js.map +1 -0
- package/dist/{chunk-4XLXOEXQ.js → chunk-LAP2CKLN.js} +78 -4
- package/dist/chunk-LAP2CKLN.js.map +1 -0
- package/dist/{chunk-Y63BOO6M.js → chunk-LECCEZAO.js} +1 -1
- package/dist/{chunk-YALXP2PW.js → chunk-N7SQWS2R.js} +3 -3
- package/dist/{chunk-KGM2WLSP.js → chunk-OAOONM4S.js} +695 -440
- package/dist/chunk-OAOONM4S.js.map +1 -0
- package/dist/chunk-Q3ECVC4F.js +811 -0
- package/dist/chunk-Q3ECVC4F.js.map +1 -0
- package/dist/chunk-QY52UADF.js +107 -0
- package/dist/chunk-QY52UADF.js.map +1 -0
- package/dist/{chunk-I2BYHDFE.js → chunk-TNAR3XEF.js} +3898 -844
- package/dist/chunk-TNAR3XEF.js.map +1 -0
- package/dist/chunk-XABYNWXO.js +549 -0
- package/dist/chunk-XABYNWXO.js.map +1 -0
- package/dist/chunk-YB5UUF2G.js +11 -0
- package/dist/chunk-YB5UUF2G.js.map +1 -0
- package/dist/{chunk-35WWD5V6.js → chunk-YWGFI4PN.js} +88 -25
- package/dist/chunk-YWGFI4PN.js.map +1 -0
- package/dist/{create-config-DwrnzwpM.d.ts → create-config-DLMvMTkZ.d.ts} +2 -2
- package/dist/index.css +7 -7
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +8 -6
- package/dist/index.js +19 -14
- package/dist/{lowestListing-BQHIuvNF.d.ts → marketCurrencies-enNVYwBk.d.ts} +95 -3
- package/dist/{marketplace.gen-DQzWciwC.d.ts → marketplace.gen-D24veUQs.d.ts} +3 -2
- package/dist/marketplaceConfig-BwNAbLPw.d.ts +21 -0
- package/dist/new-marketplace-types-BCw19X9S.d.ts +102 -0
- package/dist/react/_internal/api/index.d.ts +4 -3
- package/dist/react/_internal/api/index.js +5 -1
- package/dist/react/_internal/databeat/index.css +2764 -0
- package/dist/react/_internal/databeat/index.css.map +1 -0
- package/dist/react/_internal/databeat/index.d.ts +1 -1
- package/dist/react/_internal/databeat/index.js +15 -14
- package/dist/react/_internal/index.d.ts +62 -9
- package/dist/react/_internal/index.js +7 -3
- package/dist/react/_internal/wagmi/index.d.ts +5 -6
- package/dist/react/_internal/wagmi/index.js +1 -1
- package/dist/react/hooks/index.css +2764 -0
- package/dist/react/hooks/index.css.map +1 -0
- package/dist/react/hooks/index.d.ts +74 -222
- package/dist/react/hooks/index.js +21 -22
- package/dist/react/hooks/options/index.d.ts +5 -4
- package/dist/react/hooks/options/index.js +9 -7
- package/dist/react/index.css +7 -7
- package/dist/react/index.css.map +1 -1
- package/dist/react/index.d.ts +12 -11
- package/dist/react/index.js +34 -37
- package/dist/react/queries/index.d.ts +4 -3
- package/dist/react/queries/index.js +19 -6
- package/dist/react/ssr/index.d.ts +3 -3
- package/dist/react/ssr/index.js +6 -5
- package/dist/react/ssr/index.js.map +1 -1
- package/dist/react/ui/components/collectible-card/index.css +7 -7
- package/dist/react/ui/components/collectible-card/index.css.map +1 -1
- package/dist/react/ui/components/collectible-card/index.d.ts +9 -6
- package/dist/react/ui/components/collectible-card/index.js +19 -23
- package/dist/react/ui/components/marketplace-logos/index.js +1 -1
- package/dist/react/ui/icons/index.js +9 -8
- package/dist/react/ui/index.css +7 -7
- package/dist/react/ui/index.css.map +1 -1
- package/dist/react/ui/index.d.ts +2 -2
- package/dist/react/ui/index.js +17 -21
- package/dist/react/ui/modals/_internal/components/actionModal/index.css +2764 -0
- package/dist/react/ui/modals/_internal/components/actionModal/index.css.map +1 -0
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +15 -14
- package/dist/sdk-config-qorA0TgF.d.ts +165 -0
- package/dist/{services-BI_w8Eq4.d.ts → services-WrshxCqc.d.ts} +6 -3
- package/dist/types/index.d.ts +5 -4
- package/dist/types/index.js +7 -7
- package/dist/{index-DGsVBflk.d.ts → useCollection-YAdXfVO7.d.ts} +1 -2
- package/dist/utils/abi/index.d.ts +1 -0
- package/dist/utils/abi/index.js +7 -1
- package/dist/utils/abi/primary-sale/index.d.ts +1054 -0
- package/dist/utils/abi/primary-sale/index.js +9 -0
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.js +13 -6
- package/package.json +32 -32
- package/src/react/_internal/api/__mocks__/builder.msw.ts +157 -80
- package/src/react/_internal/api/builder-api.ts +2 -2
- package/src/react/_internal/api/builder.gen.ts +667 -112
- package/src/react/_internal/api/marketplace.gen.ts +1981 -1316
- package/src/react/_internal/api/services.ts +12 -1
- package/src/react/_internal/types.ts +1 -13
- package/src/react/_internal/wagmi/__tests__/create-config.test.ts +99 -84
- package/src/react/_internal/wagmi/create-config.ts +8 -4
- package/src/react/_internal/wagmi/get-connectors.ts +24 -19
- package/src/react/hooks/__tests__/__snapshots__/useListCollections.test.tsx.snap +114 -0
- package/src/react/hooks/__tests__/__snapshots__/useMarketplaceConfig.test.tsx.snap +85 -83
- package/src/react/hooks/__tests__/useFilters.test.tsx +0 -16
- package/src/react/hooks/__tests__/useInventory.test.tsx +16 -16
- package/src/react/hooks/__tests__/useListCollections.test.tsx +23 -56
- package/src/react/hooks/__tests__/{useCurrencies.test.tsx → useMarketCurrencies.test.tsx} +21 -15
- package/src/react/hooks/__tests__/useMarketplaceConfig.test.tsx +2 -59
- package/src/react/hooks/index.ts +3 -1
- package/src/react/hooks/useBalanceOfCollectible.tsx +5 -3
- package/src/react/hooks/useConvertPriceToUSD.tsx +1 -1
- package/src/react/hooks/useFilters.tsx +14 -22
- package/src/react/hooks/useGetTokenSuppliesMap.ts +28 -0
- package/src/react/hooks/useInventory.tsx +4 -3
- package/src/react/hooks/useList1155SaleSupplies.tsx +62 -0
- package/src/react/hooks/useListBalances.tsx +5 -3
- package/src/react/hooks/useListCollectibles.tsx +5 -3
- package/src/react/hooks/useListCollections.tsx +14 -76
- package/src/react/hooks/useListTokenMetadata.ts +19 -0
- package/src/react/hooks/useMarketCurrencies.tsx +8 -0
- package/src/react/hooks/useMarketplaceConfig.tsx +0 -2
- package/src/react/queries/index.ts +2 -0
- package/src/react/queries/inventory.ts +1 -1
- package/src/react/queries/listCollections.ts +118 -0
- package/src/react/queries/listTokenMetadata.ts +38 -0
- package/src/react/queries/marketCurrencies.ts +77 -0
- package/src/react/queries/marketplaceConfig.ts +83 -55
- package/src/react/ssr/__tests__/__snapshots__/create-ssr-client.test.ts.snap +85 -83
- package/src/react/ui/components/collectible-card/CollectibleCard.tsx +2 -2
- package/src/react/ui/components/collectible-card/__tests__/{CollectibleAsset.test.tsx → Media.test.tsx} +48 -14
- package/src/react/ui/components/collectible-card/index.ts +1 -1
- package/src/react/ui/components/collectible-card/media/Media.tsx +211 -0
- package/src/react/ui/components/collectible-card/{collectible-asset/CollectibleAssetSkeleton.tsx → media/MediaSkeleton.tsx} +2 -2
- package/src/react/ui/components/collectible-card/media/types.ts +18 -0
- package/src/react/ui/components/collectible-card/{collectible-asset → media}/utils.ts +8 -3
- package/src/react/ui/index.ts +1 -1
- package/src/react/ui/modals/BuyModal/ERC1155QuantityModal.tsx +9 -3
- package/src/react/ui/modals/BuyModal/hooks/__tests__/useFees.test.tsx +31 -21
- package/src/react/ui/modals/BuyModal/hooks/useFees.ts +3 -2
- package/src/react/ui/modals/BuyModal/hooks/usePaymentModalParams.ts +28 -3
- package/src/react/ui/modals/CreateListingModal/Modal.tsx +3 -5
- package/src/react/ui/modals/CreateListingModal/hooks/useCreateListing.tsx +5 -3
- package/src/react/ui/modals/CreateListingModal/hooks/useTransactionSteps.tsx +2 -2
- package/src/react/ui/modals/MakeOfferModal/Modal.tsx +2 -3
- package/src/react/ui/modals/MakeOfferModal/hooks/useMakeOffer.tsx +4 -3
- package/src/react/ui/modals/SellModal/Modal.tsx +0 -1
- package/src/react/ui/modals/SellModal/hooks/useTransactionSteps.tsx +2 -2
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/_components/WalletAddressInput.tsx +1 -1
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/index.tsx +0 -1
- package/src/react/ui/modals/TransferModal/index.tsx +0 -1
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/__tests__/index.test.tsx +2 -2
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +7 -6
- package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/__tests__/SelectWaasFeeOptions.test.tsx +13 -7
- package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/index.tsx +3 -5
- package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/useWaasFeeOptionManager.tsx +5 -3
- package/src/react/ui/modals/_internal/components/transactionDetails/index.tsx +2 -2
- package/src/react/ui/modals/_internal/hooks/useSelectWaasFeeOptions.ts +2 -12
- package/src/types/index.ts +1 -6
- package/src/types/new-marketplace-types.ts +119 -0
- package/src/types/sdk-config.ts +19 -2
- package/src/types/types.ts +1 -0
- package/src/utils/abi/index.ts +1 -0
- package/src/utils/abi/primary-sale/index.ts +2 -0
- package/src/utils/abi/primary-sale/sequence-1155-sales-contract.ts +450 -0
- package/src/utils/abi/primary-sale/sequence-721-sales-contract.ts +352 -0
- package/src/utils/abi/token/sequence-erc1155-items.ts +454 -0
- package/src/utils/fetchContentType.ts +5 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/chunk-35WWD5V6.js.map +0 -1
- package/dist/chunk-4XLXOEXQ.js.map +0 -1
- package/dist/chunk-D7RVSZAQ.js +0 -332
- package/dist/chunk-D7RVSZAQ.js.map +0 -1
- package/dist/chunk-DWTLVJAW.js.map +0 -1
- package/dist/chunk-EODKQL6Y.js +0 -76
- package/dist/chunk-EODKQL6Y.js.map +0 -1
- package/dist/chunk-G3447GIP.js +0 -2880
- package/dist/chunk-G3447GIP.js.map +0 -1
- package/dist/chunk-HHYNOPPI.js +0 -53
- package/dist/chunk-HHYNOPPI.js.map +0 -1
- package/dist/chunk-I2BYHDFE.js.map +0 -1
- package/dist/chunk-JKCF7HEA.js +0 -1
- package/dist/chunk-KGM2WLSP.js.map +0 -1
- package/dist/chunk-MAD64DLJ.js +0 -81
- package/dist/chunk-MAD64DLJ.js.map +0 -1
- package/dist/chunk-N7BPFK46.js +0 -1
- package/dist/chunk-O34GCB47.js.map +0 -1
- package/dist/chunk-UISBTKFF.js +0 -1
- package/dist/chunk-UISBTKFF.js.map +0 -1
- package/dist/chunk-YBOFRP65.js +0 -128
- package/dist/chunk-YBOFRP65.js.map +0 -1
- package/dist/marketplaceConfig-B4Fdsmxu.d.ts +0 -17
- package/dist/sdk-config-txlivEKe.d.ts +0 -133
- package/dist/types-isjvwapz.d.ts +0 -68
- package/src/react/hooks/useCurrencies.tsx +0 -77
- package/src/react/ui/components/collectible-card/collectible-asset/CollectibleAsset.tsx +0 -174
- /package/dist/{chunk-FMEEJFAF.js.map → chunk-5C6ZZ6WX.js.map} +0 -0
- /package/dist/{chunk-YEGD7PWE.js.map → chunk-5O44EPXZ.js.map} +0 -0
- /package/dist/{chunk-JKCF7HEA.js.map → chunk-6CTFVBKU.js.map} +0 -0
- /package/dist/{chunk-Y63BOO6M.js.map → chunk-LECCEZAO.js.map} +0 -0
- /package/dist/{chunk-YALXP2PW.js.map → chunk-N7SQWS2R.js.map} +0 -0
- /package/dist/{chunk-N7BPFK46.js.map → utils/abi/primary-sale/index.js.map} +0 -0
|
@@ -6,7 +6,7 @@ import { observer } from '@legendapp/state/react';
|
|
|
6
6
|
import { useEffect } from 'react';
|
|
7
7
|
import type { Hex } from 'viem';
|
|
8
8
|
import type { Currency } from '../../../../../_internal';
|
|
9
|
-
import {
|
|
9
|
+
import { useMarketCurrencies } from '../../../../../hooks';
|
|
10
10
|
import {
|
|
11
11
|
CustomSelect,
|
|
12
12
|
type SelectItem,
|
|
@@ -28,11 +28,12 @@ const CurrencyOptionsSelect = observer(function CurrencyOptionsSelect({
|
|
|
28
28
|
includeNativeCurrency,
|
|
29
29
|
}: CurrencyOptionsSelectProps) {
|
|
30
30
|
const currency = selectedCurrency$.get();
|
|
31
|
-
const { data: currencies, isLoading: currenciesLoading } =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
const { data: currencies, isLoading: currenciesLoading } =
|
|
32
|
+
useMarketCurrencies({
|
|
33
|
+
chainId,
|
|
34
|
+
collectionAddress,
|
|
35
|
+
includeNativeCurrency,
|
|
36
|
+
});
|
|
36
37
|
|
|
37
38
|
// set default currency
|
|
38
39
|
// biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
|
|
@@ -84,12 +84,18 @@ describe('SelectWaasFeeOptions', () => {
|
|
|
84
84
|
expect(container.firstChild).toBeNull();
|
|
85
85
|
});
|
|
86
86
|
|
|
87
|
-
it('should not render
|
|
87
|
+
it('should not render when fees are sponsored (empty options array)', () => {
|
|
88
|
+
const sponsoredFeeOptionConfirmation: WaasFeeOptionConfirmation = {
|
|
89
|
+
id: 'fee-confirmation-id',
|
|
90
|
+
options: [], // Empty array indicates sponsored fees
|
|
91
|
+
chainId: 1,
|
|
92
|
+
};
|
|
93
|
+
|
|
88
94
|
vi.spyOn(useWaasFeeOptionManagerModule, 'default').mockReturnValue({
|
|
89
|
-
selectedFeeOption$: observable<FeeOption | undefined>(
|
|
90
|
-
selectedFeeOption:
|
|
95
|
+
selectedFeeOption$: observable<FeeOption | undefined>(undefined),
|
|
96
|
+
selectedFeeOption: undefined,
|
|
91
97
|
// @ts-expect-error - types are not compatible
|
|
92
|
-
pendingFeeOptionConfirmation:
|
|
98
|
+
pendingFeeOptionConfirmation: sponsoredFeeOptionConfirmation,
|
|
93
99
|
currencyBalance: mockCurrencyBalance,
|
|
94
100
|
currencyBalanceLoading: false,
|
|
95
101
|
insufficientBalance: false,
|
|
@@ -98,14 +104,14 @@ describe('SelectWaasFeeOptions', () => {
|
|
|
98
104
|
});
|
|
99
105
|
|
|
100
106
|
vi.spyOn(useNetworkModule, 'getNetwork').mockReturnValue({
|
|
101
|
-
type: NetworkType.
|
|
107
|
+
type: NetworkType.MAINNET,
|
|
102
108
|
chainId: 1,
|
|
103
|
-
name: '
|
|
109
|
+
name: 'Mainnet',
|
|
104
110
|
nativeToken: TEST_CURRENCY,
|
|
105
111
|
});
|
|
106
112
|
vi.spyOn(useWaasFeeOptionsModule, 'useWaasFeeOptions').mockReturnValue([
|
|
107
113
|
// @ts-expect-error - types are not compatible
|
|
108
|
-
|
|
114
|
+
sponsoredFeeOptionConfirmation,
|
|
109
115
|
vi.fn(),
|
|
110
116
|
]);
|
|
111
117
|
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { getNetwork } from '@0xsequence/connect';
|
|
4
3
|
import { Divider, Skeleton, Text } from '@0xsequence/design-system';
|
|
5
|
-
import { NetworkType } from '@0xsequence/network';
|
|
6
4
|
import { observer } from '@legendapp/state/react';
|
|
7
5
|
import type { FeeOption } from '../../../../../../types/waas-types';
|
|
8
6
|
import { cn } from '../../../../../../utils';
|
|
@@ -26,8 +24,6 @@ const SelectWaasFeeOptions = observer(
|
|
|
26
24
|
titleOnConfirm,
|
|
27
25
|
className,
|
|
28
26
|
}: SelectWaasFeeOptionsProps) => {
|
|
29
|
-
const network = getNetwork(chainId);
|
|
30
|
-
const isTestnet = network.type === NetworkType.TESTNET;
|
|
31
27
|
const {
|
|
32
28
|
selectedFeeOption$,
|
|
33
29
|
selectedFeeOption,
|
|
@@ -47,9 +43,11 @@ const SelectWaasFeeOptions = observer(
|
|
|
47
43
|
onCancel?.();
|
|
48
44
|
};
|
|
49
45
|
|
|
46
|
+
const isSponsored = pendingFeeOptionConfirmation?.options?.length === 0;
|
|
47
|
+
|
|
50
48
|
if (
|
|
51
49
|
!selectWaasFeeOptions$.isVisible.get() ||
|
|
52
|
-
|
|
50
|
+
isSponsored ||
|
|
53
51
|
!selectedFeeOption
|
|
54
52
|
) {
|
|
55
53
|
return null;
|
package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/useWaasFeeOptionManager.tsx
CHANGED
|
@@ -25,9 +25,11 @@ const useWaasFeeOptionManager = (chainId: number) => {
|
|
|
25
25
|
// biome-ignore lint/correctness/useExhaustiveDependencies: it causes a loop
|
|
26
26
|
useEffect(() => {
|
|
27
27
|
if (!selectedFeeOption && pendingFeeOptionConfirmation) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
if (pendingFeeOptionConfirmation.options.length > 0) {
|
|
29
|
+
selectedFeeOption$.set(
|
|
30
|
+
pendingFeeOptionConfirmation.options[0] as FeeOption,
|
|
31
|
+
);
|
|
32
|
+
}
|
|
31
33
|
}
|
|
32
34
|
}, [pendingFeeOptionConfirmation]);
|
|
33
35
|
|
|
@@ -30,8 +30,8 @@ export default function TransactionDetails({
|
|
|
30
30
|
const { data, isLoading: marketplaceConfigLoading } = useMarketplaceConfig();
|
|
31
31
|
|
|
32
32
|
const marketplaceFeePercentage = includeMarketplaceFee
|
|
33
|
-
? data?.collections.find(
|
|
34
|
-
(collection) => collection.
|
|
33
|
+
? data?.market.collections.find(
|
|
34
|
+
(collection) => collection.itemsAddress === collectionAddress,
|
|
35
35
|
)?.feePercentage || DEFAULT_MARKETPLACE_FEE_PERCENTAGE
|
|
36
36
|
: 0;
|
|
37
37
|
// royaltyPercentage is an array of [recipient, percentage]
|
|
@@ -1,32 +1,23 @@
|
|
|
1
|
-
import { getNetwork } from '@0xsequence/connect';
|
|
2
|
-
import { NetworkType } from '@0xsequence/network';
|
|
3
1
|
import type { FeeOption } from '../../../../../types/waas-types';
|
|
4
2
|
import { useWallet } from '../../../../_internal/wallet/useWallet';
|
|
5
3
|
|
|
6
4
|
interface UseSelectWaasFeeOptionsProps {
|
|
7
|
-
chainId: string | number;
|
|
8
5
|
isProcessing: boolean;
|
|
9
6
|
feeOptionsVisible: boolean;
|
|
10
7
|
selectedFeeOption: FeeOption;
|
|
11
8
|
}
|
|
12
9
|
|
|
13
10
|
export const useSelectWaasFeeOptions = ({
|
|
14
|
-
chainId,
|
|
15
11
|
isProcessing,
|
|
16
12
|
feeOptionsVisible,
|
|
17
13
|
selectedFeeOption,
|
|
18
14
|
}: UseSelectWaasFeeOptionsProps) => {
|
|
19
15
|
const { wallet } = useWallet();
|
|
20
|
-
const network = chainId ? getNetwork(Number(chainId)) : undefined;
|
|
21
|
-
const isTestnet = network?.type === NetworkType.TESTNET;
|
|
22
16
|
const isWaaS = wallet?.isWaaS;
|
|
23
17
|
const isProcessingWithWaaS = isProcessing && isWaaS;
|
|
24
18
|
|
|
25
19
|
const shouldHideActionButton =
|
|
26
|
-
|
|
27
|
-
isProcessingWithWaaS &&
|
|
28
|
-
feeOptionsVisible === true &&
|
|
29
|
-
!!selectedFeeOption;
|
|
20
|
+
isProcessingWithWaaS && feeOptionsVisible === true && !!selectedFeeOption;
|
|
30
21
|
|
|
31
22
|
const waasFeeOptionsShown =
|
|
32
23
|
wallet?.isWaaS && isProcessing && feeOptionsVisible;
|
|
@@ -36,14 +27,13 @@ export const useSelectWaasFeeOptions = ({
|
|
|
36
27
|
loadingLabel = 'Loading fee options',
|
|
37
28
|
) => {
|
|
38
29
|
if (isProcessing) {
|
|
39
|
-
return isWaaS
|
|
30
|
+
return isWaaS ? loadingLabel : defaultLabel;
|
|
40
31
|
}
|
|
41
32
|
return defaultLabel;
|
|
42
33
|
};
|
|
43
34
|
|
|
44
35
|
return {
|
|
45
36
|
isWaaS,
|
|
46
|
-
isTestnet,
|
|
47
37
|
feeOptionsVisible,
|
|
48
38
|
shouldHideActionButton,
|
|
49
39
|
waasFeeOptionsShown,
|
package/src/types/index.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
export * from './api-types';
|
|
2
2
|
export * from './sdk-config';
|
|
3
3
|
export * from './types';
|
|
4
|
-
export type * from '../react/_internal/api/builder.gen';
|
|
5
4
|
export type * from './../react/queries/marketplaceConfig';
|
|
6
|
-
export {
|
|
7
|
-
MarketplaceWallet,
|
|
8
|
-
FilterCondition,
|
|
9
|
-
MarketplaceType,
|
|
10
|
-
} from '../react/_internal/api/builder.gen';
|
|
5
|
+
export { FilterCondition } from '../react/_internal/api/builder.gen';
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
FilterCondition,
|
|
3
|
+
MarketplaceWallet,
|
|
4
|
+
MarketplaceWalletType,
|
|
5
|
+
OpenIdProvider,
|
|
6
|
+
} from '../react/_internal/api/builder.gen';
|
|
7
|
+
import type { ContractType, OrderbookKind } from './api-types';
|
|
8
|
+
|
|
9
|
+
export interface MarketplaceConfig {
|
|
10
|
+
projectId: number;
|
|
11
|
+
settings: NewMarketplaceSettings;
|
|
12
|
+
market: MarketPage;
|
|
13
|
+
shop: ShopPage;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface NewMarketplaceSettings {
|
|
17
|
+
publisherId: string;
|
|
18
|
+
title: string;
|
|
19
|
+
socials: MarketplaceSocials;
|
|
20
|
+
faviconUrl: string;
|
|
21
|
+
walletOptions: MarketplaceWallet;
|
|
22
|
+
logoUrl: string;
|
|
23
|
+
fontUrl?: string;
|
|
24
|
+
accessKey?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface MarketplacePage {
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
bannerUrl: string;
|
|
30
|
+
ogImage?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface MarketPage extends MarketplacePage {
|
|
34
|
+
collections: MarketCollection[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface ShopPage extends MarketplacePage {
|
|
38
|
+
collections: ShopCollection[];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface MarketplaceSocials {
|
|
42
|
+
twitter: string;
|
|
43
|
+
discord: string;
|
|
44
|
+
website: string;
|
|
45
|
+
tiktok: string;
|
|
46
|
+
instagram: string;
|
|
47
|
+
youtube: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface MarketplaceWalletEcosystem {
|
|
51
|
+
walletUrl: string;
|
|
52
|
+
walletAppName: string;
|
|
53
|
+
logoLightUrl?: string;
|
|
54
|
+
logoDarkUrl?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface MarketplaceWalletEmbedded {
|
|
58
|
+
tenantKey: string;
|
|
59
|
+
emailEnabled: boolean;
|
|
60
|
+
providers: Array<OpenIdProvider>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export enum MarketplaceType {
|
|
64
|
+
SHOP = 'SHOP',
|
|
65
|
+
MARKET = 'MARKET',
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
interface MarketplaceCollection {
|
|
69
|
+
contractType: ContractType;
|
|
70
|
+
chainId: number;
|
|
71
|
+
bannerUrl: string;
|
|
72
|
+
itemsAddress: string;
|
|
73
|
+
filterSettings?: CollectionFilterSettings;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface MarketCollection extends MarketplaceCollection {
|
|
77
|
+
marketplaceType: MarketplaceType.MARKET;
|
|
78
|
+
feePercentage: number;
|
|
79
|
+
destinationMarketplace: OrderbookKind;
|
|
80
|
+
currencyOptions: Array<string>;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface ShopCollection extends MarketplaceCollection {
|
|
84
|
+
marketplaceType: MarketplaceType.SHOP;
|
|
85
|
+
saleAddress: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface EcosystemWalletSettings {
|
|
89
|
+
walletUrl: string;
|
|
90
|
+
walletAppName: string;
|
|
91
|
+
logoLightUrl?: string;
|
|
92
|
+
logoDarkUrl?: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface MarketplaceWalletOptions {
|
|
96
|
+
walletType: MarketplaceWalletType;
|
|
97
|
+
oidcIssuers: { [key: string]: string };
|
|
98
|
+
connectors: Array<string>;
|
|
99
|
+
includeEIP6963Wallets: boolean;
|
|
100
|
+
ecosystem?: EcosystemWalletSettings;
|
|
101
|
+
waas?: MarketplaceWalletWaasSettings;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface MarketplaceWalletWaasSettings {
|
|
105
|
+
tenantKey: string;
|
|
106
|
+
emailEnabled: boolean;
|
|
107
|
+
providers: Array<OpenIdProvider>;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface MetadataFilterRule {
|
|
111
|
+
key: string;
|
|
112
|
+
condition: FilterCondition;
|
|
113
|
+
value?: string;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface CollectionFilterSettings {
|
|
117
|
+
filterOrder: Array<string>;
|
|
118
|
+
exclusions: Array<MetadataFilterRule>;
|
|
119
|
+
}
|
package/src/types/sdk-config.ts
CHANGED
|
@@ -1,13 +1,29 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LookupMarketplaceReturn } from '../react/_internal/api/builder.gen';
|
|
2
|
+
import type { ContractType } from './api-types';
|
|
2
3
|
|
|
3
4
|
export type Env = 'development' | 'next' | 'production';
|
|
4
5
|
|
|
6
|
+
export type ShopConfig = {
|
|
7
|
+
title: string;
|
|
8
|
+
bannerUrl: string;
|
|
9
|
+
ogImage?: string;
|
|
10
|
+
collections: {
|
|
11
|
+
address: string;
|
|
12
|
+
contractType: ContractType;
|
|
13
|
+
bannerUrl: string;
|
|
14
|
+
chainId: number;
|
|
15
|
+
primarySalesContractAddress: string;
|
|
16
|
+
tokenIds: string[];
|
|
17
|
+
}[];
|
|
18
|
+
};
|
|
19
|
+
|
|
5
20
|
export type SdkConfig = {
|
|
6
21
|
projectAccessKey: string;
|
|
7
22
|
projectId: string;
|
|
8
23
|
walletConnectProjectId?: string;
|
|
24
|
+
tmpShopConfig?: ShopConfig;
|
|
9
25
|
_internal?: {
|
|
10
|
-
prefetchedMarketplaceSettings?:
|
|
26
|
+
prefetchedMarketplaceSettings?: LookupMarketplaceReturn;
|
|
11
27
|
devAccessKey?: string;
|
|
12
28
|
nextAccessKey?: string;
|
|
13
29
|
builderEnv?: Env;
|
|
@@ -15,6 +31,7 @@ export type SdkConfig = {
|
|
|
15
31
|
nodeGatewayEnv?: Env;
|
|
16
32
|
metadataEnv?: Env;
|
|
17
33
|
indexerEnv?: Env;
|
|
34
|
+
sequenceApiEnv?: Env;
|
|
18
35
|
sequenceWalletEnv?: Env;
|
|
19
36
|
};
|
|
20
37
|
};
|
package/src/types/types.ts
CHANGED
package/src/utils/abi/index.ts
CHANGED