@0xsequence/marketplace-sdk 0.8.7 → 0.8.8
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/CHANGELOG.md +26 -0
- package/dist/chunk-2PSNAIAT.js +1 -0
- package/dist/chunk-2PSNAIAT.js.map +1 -0
- package/dist/{chunk-7FVZD2LL.js → chunk-4XLXOEXQ.js} +2 -2
- package/dist/{chunk-Y6AOCO3Q.js → chunk-7IYKUVC3.js} +312 -145
- package/dist/chunk-7IYKUVC3.js.map +1 -0
- package/dist/{chunk-5HEZNTSU.js → chunk-D7RVSZAQ.js} +131 -83
- package/dist/chunk-D7RVSZAQ.js.map +1 -0
- package/dist/chunk-DWTLVJAW.js +42 -0
- package/dist/chunk-DWTLVJAW.js.map +1 -0
- package/dist/{chunk-YAUZLETY.js → chunk-G3447GIP.js} +37 -18
- package/dist/chunk-G3447GIP.js.map +1 -0
- package/dist/{chunk-O6GWM7C3.js → chunk-HHYNOPPI.js} +2 -2
- package/dist/{chunk-KTT27YUN.js → chunk-KGM2WLSP.js} +12 -156
- package/dist/chunk-KGM2WLSP.js.map +1 -0
- package/dist/chunk-MAD64DLJ.js +81 -0
- package/dist/chunk-MAD64DLJ.js.map +1 -0
- package/dist/chunk-N7BPFK46.js +1 -0
- package/dist/chunk-N7BPFK46.js.map +1 -0
- package/dist/chunk-NX52D7NX.js +135 -0
- package/dist/chunk-NX52D7NX.js.map +1 -0
- package/dist/chunk-O34GCB47.js +32 -0
- package/dist/chunk-O34GCB47.js.map +1 -0
- package/dist/{chunk-Q2DA477S.js → chunk-YALXP2PW.js} +3 -3
- package/dist/{chunk-A6V7XDY4.js → chunk-YBOFRP65.js} +2 -2
- package/dist/{create-config-CdooE7aU.d.ts → create-config-DwrnzwpM.d.ts} +2 -2
- package/dist/{index-ClKHzm0B.d.ts → index-DGsVBflk.d.ts} +3 -12
- package/dist/index.css +7 -5
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +13 -4
- package/dist/index.js +13 -5
- package/dist/{lowestListing-kFyrUGha.d.ts → lowestListing-BQHIuvNF.d.ts} +2 -2
- package/dist/{marketplace.gen-BU6T6f0m.d.ts → marketplace.gen-DQzWciwC.d.ts} +1 -1
- package/dist/marketplaceConfig-B4Fdsmxu.d.ts +17 -0
- package/dist/react/_internal/api/index.d.ts +3 -3
- package/dist/react/_internal/api/index.js +4 -3
- package/dist/react/_internal/databeat/index.d.ts +2 -1
- package/dist/react/_internal/databeat/index.js +11 -7
- package/dist/react/_internal/index.d.ts +6 -6
- package/dist/react/_internal/index.js +13 -10
- package/dist/react/_internal/wagmi/index.d.ts +6 -5
- package/dist/react/_internal/wagmi/index.js +2 -2
- package/dist/react/hooks/index.d.ts +9 -8
- package/dist/react/hooks/index.js +10 -6
- package/dist/react/hooks/options/index.d.ts +4 -4
- package/dist/react/hooks/options/index.js +7 -4
- package/dist/react/index.css +2650 -0
- package/dist/react/index.css.map +1 -1
- package/dist/react/index.d.ts +8 -8
- package/dist/react/index.js +16 -11
- package/dist/react/queries/index.d.ts +3 -3
- package/dist/react/queries/index.js +6 -3
- package/dist/react/ssr/index.d.ts +3 -3
- package/dist/react/ssr/index.js +6 -3
- package/dist/react/ssr/index.js.map +1 -1
- package/dist/react/ui/components/collectible-card/index.css +2650 -0
- package/dist/react/ui/components/collectible-card/index.css.map +1 -1
- package/dist/react/ui/components/collectible-card/index.d.ts +1 -1
- package/dist/react/ui/components/collectible-card/index.js +14 -9
- package/dist/react/ui/icons/index.js +5 -2
- package/dist/react/ui/index.css +2650 -0
- package/dist/react/ui/index.css.map +1 -1
- package/dist/react/ui/index.d.ts +2 -1
- package/dist/react/ui/index.js +14 -9
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +11 -7
- package/dist/sdk-config-txlivEKe.d.ts +133 -0
- package/dist/{services-9ApY0U-o.d.ts → services-BI_w8Eq4.d.ts} +4 -4
- package/dist/types/index.d.ts +5 -4
- package/dist/types/index.js +9 -6
- package/dist/{types-DsTwmKG-.d.ts → types-isjvwapz.d.ts} +3 -3
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +5 -2
- package/package.json +3 -3
- package/src/index.ts +1 -0
- package/src/react/{hooks/options/__mocks__/marketplaceConfig.msw.ts → _internal/api/__mocks__/builder.msw.ts} +70 -63
- package/src/react/_internal/api/__mocks__/metadata.msw.ts +30 -10
- package/src/react/_internal/api/builder-api.ts +32 -0
- package/src/react/_internal/api/builder.gen.ts +215 -0
- package/src/react/_internal/api/services.ts +9 -2
- package/src/react/_internal/databeat/types.ts +1 -0
- package/src/react/_internal/wagmi/__tests__/create-config.test.ts +16 -41
- package/src/react/_internal/wagmi/create-config.ts +3 -16
- package/src/react/_internal/wagmi/get-connectors.ts +31 -21
- package/src/react/_internal/wallet/__tests__/wallet.test.ts +30 -0
- package/src/react/_internal/wallet/wallet.ts +25 -2
- package/src/react/hooks/__tests__/__snapshots__/useMarketplaceConfig.test.tsx.snap +96 -0
- package/src/react/hooks/__tests__/useCollection.test.tsx +4 -5
- package/src/react/hooks/__tests__/useCurrencies.test.tsx +1 -1
- package/src/react/hooks/__tests__/useInventory.test.tsx +15 -16
- package/src/react/hooks/__tests__/useListCollections.test.tsx +18 -163
- package/src/react/hooks/__tests__/useMarketplaceConfig.test.tsx +10 -11
- package/src/react/hooks/options/index.ts +1 -1
- package/src/react/hooks/useAutoSelectFeeOption.tsx +1 -0
- package/src/react/hooks/useMarketplaceConfig.tsx +2 -2
- package/src/react/queries/marketplaceConfig.ts +101 -0
- package/src/react/ssr/__tests__/__snapshots__/create-ssr-client.test.ts.snap +1 -0
- package/src/react/ssr/create-ssr-client.ts +1 -1
- package/src/react/ui/components/collectible-card/CollectibleCard.tsx +2 -2
- package/src/react/ui/components/collectible-card/__tests__/CollectibleAsset.test.tsx +72 -42
- package/src/react/ui/components/collectible-card/{CollectibleAsset.tsx → collectible-asset/CollectibleAsset.tsx} +44 -44
- package/src/react/ui/components/collectible-card/collectible-asset/CollectibleAssetSkeleton.tsx +14 -0
- package/src/react/ui/components/collectible-card/collectible-asset/utils.ts +36 -0
- package/src/react/ui/modals/BuyModal/hooks/usePaymentModalParams.ts +6 -1
- package/src/react/ui/modals/BuyModal/store.ts +1 -0
- package/src/react/ui/modals/CreateListingModal/hooks/useTransactionSteps.tsx +20 -2
- package/src/react/ui/modals/MakeOfferModal/hooks/useTransactionSteps.tsx +17 -1
- package/src/react/ui/modals/SellModal/hooks/useTransactionSteps.tsx +4 -0
- package/src/react/ui/modals/_internal/components/actionModal/ActionModal.test.tsx +7 -1
- package/src/types/index.ts +7 -1
- package/src/types/sdk-config.ts +4 -9
- package/src/utils/fetchContentType.ts +101 -0
- package/src/utils/getSequenceMarketRequestId.ts +32 -0
- package/test/mocks/wallet.ts +3 -1
- package/test/test-utils.tsx +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/builder-types-D5HgAUWR.d.ts +0 -82
- package/dist/chunk-5HEZNTSU.js.map +0 -1
- package/dist/chunk-KTT27YUN.js.map +0 -1
- package/dist/chunk-N7E37ENQ.js +0 -58
- package/dist/chunk-N7E37ENQ.js.map +0 -1
- package/dist/chunk-Y6AOCO3Q.js.map +0 -1
- package/dist/chunk-YAUZLETY.js.map +0 -1
- package/dist/sdk-config-DIzJk_tI.d.ts +0 -26
- package/src/react/hooks/options/__tests__/marketplaceConfigOptions.test.tsx +0 -134
- package/src/react/hooks/options/marketplaceConfigOptions.ts +0 -71
- package/src/types/builder-types.ts +0 -88
- /package/dist/{chunk-7FVZD2LL.js.map → chunk-4XLXOEXQ.js.map} +0 -0
- /package/dist/{chunk-O6GWM7C3.js.map → chunk-HHYNOPPI.js.map} +0 -0
- /package/dist/{chunk-Q2DA477S.js.map → chunk-YALXP2PW.js.map} +0 -0
- /package/dist/{chunk-A6V7XDY4.js.map → chunk-YBOFRP65.js.map} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Observable } from '@legendapp/state';
|
|
2
2
|
import { type Address, type Hex, formatUnits } from 'viem';
|
|
3
3
|
import { OrderbookKind, type Price } from '../../../../../types';
|
|
4
|
+
import { getSequenceMarketplaceRequestId } from '../../../../../utils/getSequenceMarketRequestId';
|
|
4
5
|
import {
|
|
5
6
|
type Step,
|
|
6
7
|
StepType,
|
|
@@ -177,7 +178,6 @@ export const useTransactionSteps = ({
|
|
|
177
178
|
|
|
178
179
|
if (orderId) {
|
|
179
180
|
// no need to wait for receipt, because the order is already created
|
|
180
|
-
|
|
181
181
|
steps$.transaction.isExecuting.set(false);
|
|
182
182
|
steps$.transaction.exist.set(false);
|
|
183
183
|
}
|
|
@@ -189,6 +189,20 @@ export const useTransactionSteps = ({
|
|
|
189
189
|
formatUnits(BigInt(currencyValueRaw), currencyDecimal),
|
|
190
190
|
);
|
|
191
191
|
|
|
192
|
+
let requestId = orderId;
|
|
193
|
+
|
|
194
|
+
if (
|
|
195
|
+
hash &&
|
|
196
|
+
(orderbookKind === OrderbookKind.sequence_marketplace_v1 ||
|
|
197
|
+
orderbookKind === OrderbookKind.sequence_marketplace_v2)
|
|
198
|
+
) {
|
|
199
|
+
requestId = await getSequenceMarketplaceRequestId(
|
|
200
|
+
hash,
|
|
201
|
+
wallet.publicClient,
|
|
202
|
+
await wallet.address(),
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
|
|
192
206
|
analytics.trackCreateOffer({
|
|
193
207
|
props: {
|
|
194
208
|
orderbookKind,
|
|
@@ -196,6 +210,7 @@ export const useTransactionSteps = ({
|
|
|
196
210
|
currencyAddress: offerInput.offer.currencyAddress,
|
|
197
211
|
currencySymbol: currency?.symbol || '',
|
|
198
212
|
chainId: chainId.toString(),
|
|
213
|
+
requestId: requestId || '',
|
|
199
214
|
txnHash: hash || '',
|
|
200
215
|
},
|
|
201
216
|
nums: {
|
|
@@ -207,6 +222,7 @@ export const useTransactionSteps = ({
|
|
|
207
222
|
} catch (error) {
|
|
208
223
|
steps$.transaction.isExecuting.set(false);
|
|
209
224
|
steps$.transaction.exist.set(false);
|
|
225
|
+
|
|
210
226
|
if (callbacks?.onError && typeof callbacks.onError === 'function') {
|
|
211
227
|
callbacks.onError(error as Error);
|
|
212
228
|
}
|
|
@@ -196,9 +196,12 @@ export const useTransactionSteps = ({
|
|
|
196
196
|
analytics.trackSellItems({
|
|
197
197
|
props: {
|
|
198
198
|
marketplaceKind: marketplace,
|
|
199
|
+
userId: await wallet.address(),
|
|
199
200
|
collectionAddress,
|
|
200
201
|
currencyAddress: ordersData[0].currencyAddress,
|
|
201
202
|
currencySymbol,
|
|
203
|
+
requestId: ordersData[0].orderId,
|
|
204
|
+
tokenId: collectibleId,
|
|
202
205
|
chainId: chainId.toString(),
|
|
203
206
|
txnHash: hash || '',
|
|
204
207
|
},
|
|
@@ -211,6 +214,7 @@ export const useTransactionSteps = ({
|
|
|
211
214
|
} catch (error) {
|
|
212
215
|
steps$.transaction.isExecuting.set(false);
|
|
213
216
|
steps$.transaction.exist.set(false);
|
|
217
|
+
|
|
214
218
|
if (callbacks?.onError && typeof callbacks.onError === 'function') {
|
|
215
219
|
callbacks.onError(error as Error);
|
|
216
220
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fireEvent, render, screen, waitFor } from '@test';
|
|
2
|
-
import { type Address, custom, zeroAddress } from 'viem';
|
|
2
|
+
import { type Address, type PublicClient, custom, zeroAddress } from 'viem';
|
|
3
3
|
import { mainnet, polygon } from 'viem/chains';
|
|
4
4
|
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
5
5
|
import { WalletKind } from '../../../../../_internal';
|
|
@@ -102,6 +102,8 @@ describe('ActionModal', () => {
|
|
|
102
102
|
handleSendTransactionStep: vi.fn(),
|
|
103
103
|
handleSignMessageStep: vi.fn(),
|
|
104
104
|
hasTokenApproval: vi.fn(),
|
|
105
|
+
// @ts-expect-error
|
|
106
|
+
publicClient: vi.fn().mockResolvedValue({} as PublicClient),
|
|
105
107
|
},
|
|
106
108
|
isLoading: false,
|
|
107
109
|
isError: false,
|
|
@@ -127,6 +129,8 @@ describe('ActionModal', () => {
|
|
|
127
129
|
handleSendTransactionStep: vi.fn(),
|
|
128
130
|
handleSignMessageStep: vi.fn(),
|
|
129
131
|
hasTokenApproval: vi.fn(),
|
|
132
|
+
// @ts-expect-error
|
|
133
|
+
publicClient: vi.fn().mockResolvedValue({} as PublicClient),
|
|
130
134
|
},
|
|
131
135
|
isLoading: false,
|
|
132
136
|
isError: false,
|
|
@@ -160,6 +164,8 @@ describe('ActionModal', () => {
|
|
|
160
164
|
handleSendTransactionStep: vi.fn(),
|
|
161
165
|
handleSignMessageStep: vi.fn(),
|
|
162
166
|
hasTokenApproval: vi.fn(),
|
|
167
|
+
// @ts-expect-error
|
|
168
|
+
publicClient: vi.fn().mockResolvedValue({} as PublicClient),
|
|
163
169
|
},
|
|
164
170
|
isLoading: false,
|
|
165
171
|
isError: false,
|
package/src/types/index.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export * from './api-types';
|
|
2
2
|
export * from './sdk-config';
|
|
3
3
|
export * from './types';
|
|
4
|
-
export * from '
|
|
4
|
+
export type * from '../react/_internal/api/builder.gen';
|
|
5
|
+
export type * from './../react/queries/marketplaceConfig';
|
|
6
|
+
export {
|
|
7
|
+
MarketplaceWallet,
|
|
8
|
+
FilterCondition,
|
|
9
|
+
MarketplaceType,
|
|
10
|
+
} from '../react/_internal/api/builder.gen';
|
package/src/types/sdk-config.ts
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
|
+
import type { MarketplaceSettings } from '../react/_internal/api/builder.gen';
|
|
2
|
+
|
|
1
3
|
export type Env = 'development' | 'next' | 'production';
|
|
2
4
|
|
|
3
5
|
export type SdkConfig = {
|
|
4
6
|
projectAccessKey: string;
|
|
5
7
|
projectId: string;
|
|
6
|
-
|
|
7
|
-
walletConnectProjectId?: string;
|
|
8
|
-
embedded?: {
|
|
9
|
-
waasConfigKey: string;
|
|
10
|
-
googleClientId?: string;
|
|
11
|
-
appleClientId?: string;
|
|
12
|
-
appleRedirectURI?: string;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
8
|
+
walletConnectProjectId?: string;
|
|
15
9
|
_internal?: {
|
|
10
|
+
prefetchedMarketplaceSettings?: MarketplaceSettings;
|
|
16
11
|
devAccessKey?: string;
|
|
17
12
|
nextAccessKey?: string;
|
|
18
13
|
builderEnv?: Env;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fetches the Content-Type header of a given URL and returns the primary type if it's supported.
|
|
3
|
+
* @param url The URL to send the request to.
|
|
4
|
+
* @returns A Promise that resolves with 'image', 'video', 'html', or null.
|
|
5
|
+
*/
|
|
6
|
+
export function fetchContentType(
|
|
7
|
+
url: string,
|
|
8
|
+
): Promise<'image' | 'video' | 'html' | null> {
|
|
9
|
+
return new Promise((resolve, reject) => {
|
|
10
|
+
if (typeof XMLHttpRequest === 'undefined') {
|
|
11
|
+
reject(new Error('XMLHttpRequest is not supported in this environment.'));
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const client = new XMLHttpRequest();
|
|
16
|
+
let settled = false;
|
|
17
|
+
|
|
18
|
+
const settle = (value: 'image' | 'video' | 'html' | null) => {
|
|
19
|
+
if (!settled) {
|
|
20
|
+
settled = true;
|
|
21
|
+
resolve(value);
|
|
22
|
+
client.abort();
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const fail = (error: Error) => {
|
|
27
|
+
if (!settled) {
|
|
28
|
+
settled = true;
|
|
29
|
+
reject(error);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
client.open('HEAD', url, true);
|
|
34
|
+
|
|
35
|
+
client.onreadystatechange = () => {
|
|
36
|
+
if (settled || client.readyState < XMLHttpRequest.HEADERS_RECEIVED) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (client.readyState === XMLHttpRequest.HEADERS_RECEIVED) {
|
|
41
|
+
const status = client.status;
|
|
42
|
+
|
|
43
|
+
if (status < 200 || status >= 300) {
|
|
44
|
+
settle(null);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const contentType = client.getResponseHeader('Content-Type');
|
|
49
|
+
|
|
50
|
+
if (!contentType) {
|
|
51
|
+
settle(null);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const primaryType = contentType.split('/')[0].toLowerCase();
|
|
56
|
+
let result: 'image' | 'video' | 'html' | null = null;
|
|
57
|
+
|
|
58
|
+
switch (primaryType) {
|
|
59
|
+
case 'image':
|
|
60
|
+
result = 'image';
|
|
61
|
+
break;
|
|
62
|
+
case 'video':
|
|
63
|
+
result = 'video';
|
|
64
|
+
break;
|
|
65
|
+
case 'text':
|
|
66
|
+
if (contentType.toLowerCase().includes('html')) {
|
|
67
|
+
result = 'html';
|
|
68
|
+
}
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
settle(result);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
client.onerror = (errorEvent) => {
|
|
78
|
+
fail(
|
|
79
|
+
new Error(`XMLHttpRequest network error for URL: ${url}`, {
|
|
80
|
+
cause: errorEvent,
|
|
81
|
+
}),
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
client.onabort = () => {
|
|
86
|
+
if (!settled) {
|
|
87
|
+
settle(null);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
try {
|
|
92
|
+
client.send();
|
|
93
|
+
} catch (error) {
|
|
94
|
+
fail(
|
|
95
|
+
new Error(`Error sending XMLHttpRequest for URL: ${url}`, {
|
|
96
|
+
cause: error,
|
|
97
|
+
}),
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type Address,
|
|
3
|
+
type Hex,
|
|
4
|
+
type PublicClient,
|
|
5
|
+
parseEventLogs,
|
|
6
|
+
} from 'viem';
|
|
7
|
+
import { SequenceMarketplaceV1_ABI } from '..';
|
|
8
|
+
|
|
9
|
+
export const getSequenceMarketplaceRequestId = async (
|
|
10
|
+
hash: Hex,
|
|
11
|
+
publicClient: PublicClient,
|
|
12
|
+
walletAddress: Address,
|
|
13
|
+
) => {
|
|
14
|
+
try {
|
|
15
|
+
const receipt = await publicClient.getTransactionReceipt({
|
|
16
|
+
hash: hash,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const logs = parseEventLogs({
|
|
20
|
+
abi: SequenceMarketplaceV1_ABI,
|
|
21
|
+
eventName: 'RequestCreated',
|
|
22
|
+
args: {
|
|
23
|
+
creator: walletAddress,
|
|
24
|
+
},
|
|
25
|
+
logs: receipt.logs,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
return logs[0].args.requestId.toString();
|
|
29
|
+
} catch (error) {
|
|
30
|
+
console.error(error);
|
|
31
|
+
}
|
|
32
|
+
};
|
package/test/mocks/wallet.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TransactionReceipt } from '@0xsequence/indexer';
|
|
2
|
-
import { type Hex, custom } from 'viem';
|
|
2
|
+
import { type Hex, type PublicClient, custom } from 'viem';
|
|
3
3
|
import { vi } from 'vitest';
|
|
4
4
|
import { WalletKind } from '../../src';
|
|
5
5
|
import type { WalletInstance } from '../../src/react/_internal/wallet/wallet';
|
|
@@ -30,6 +30,8 @@ export function createMockWallet(overrides?: Partial<MockWallet>): MockWallet {
|
|
|
30
30
|
}),
|
|
31
31
|
walletKind: WalletKind.unknown,
|
|
32
32
|
hasTokenApproval: vi.fn().mockResolvedValue(true),
|
|
33
|
+
// @ts-expect-error
|
|
34
|
+
publicClient: vi.fn().mockResolvedValue({} as PublicClient),
|
|
33
35
|
};
|
|
34
36
|
|
|
35
37
|
return {
|
package/test/test-utils.tsx
CHANGED
|
@@ -18,10 +18,10 @@ import {
|
|
|
18
18
|
import { mainnet as wagmiMainet, polygon as wagmiPolygon } from 'viem/chains';
|
|
19
19
|
import { http, type Config, WagmiProvider, createConfig } from 'wagmi';
|
|
20
20
|
import { mock } from 'wagmi/connectors';
|
|
21
|
+
import { handlers as marketplaceConfigHandlers } from '../src/react/_internal/api/__mocks__/builder.msw';
|
|
21
22
|
import { handlers as indexerHandlers } from '../src/react/_internal/api/__mocks__/indexer.msw';
|
|
22
23
|
import { handlers as marketplaceHandlers } from '../src/react/_internal/api/__mocks__/marketplace.msw';
|
|
23
24
|
import { handlers as metadataHandlers } from '../src/react/_internal/api/__mocks__/metadata.msw';
|
|
24
|
-
import { handlers as marketplaceConfigHandlers } from '../src/react/hooks/options/__mocks__/marketplaceConfig.msw';
|
|
25
25
|
import { TEST_ACCOUNTS, TEST_CHAIN, TEST_PRIVATE_KEYS } from './const';
|
|
26
26
|
|
|
27
27
|
const tickHandler = mswHttp.post(
|
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/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/laos-api.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/databeat/index.ts","./src/react/_internal/databeat/types.ts","./src/react/_internal/wagmi/create-config.ts","./src/react/_internal/wagmi/get-connectors.ts","./src/react/_internal/wagmi/index.ts","./src/react/_internal/wagmi/__tests__/create-config.test.ts","./src/react/_internal/wallet/usewallet.ts","./src/react/_internal/wallet/wallet.ts","./src/react/_internal/wallet/__tests__/wallet.test.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/usecompareprices.tsx","./src/react/hooks/useconfig.tsx","./src/react/hooks/useconvertpricetousd.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/usefilterstate.tsx","./src/react/hooks/usefilters.tsx","./src/react/hooks/usefloororder.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/useinventory.tsx","./src/react/hooks/uselistbalances.tsx","./src/react/hooks/uselistcollectibleactivities.tsx","./src/react/hooks/uselistcollectibles.tsx","./src/react/hooks/uselistcollectiblespaginated.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/useroyalty.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__/usecompareprices.test.tsx","./src/react/hooks/__tests__/useconvertpricetousd.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__/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__/useinventory.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__/uselistcollectiblespaginated.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__/useroyalty.test.tsx","./src/react/hooks/options/collectionoptions.ts","./src/react/hooks/options/index.ts","./src/react/hooks/options/marketplaceconfigoptions.ts","./src/react/hooks/options/__mocks__/marketplaceconfig.msw.ts","./src/react/hooks/options/__tests__/marketplaceconfigoptions.test.tsx","./src/react/hooks/util/optimisticcancelupdates.ts","./src/react/queries/balanceofcollectible.ts","./src/react/queries/gettokensupplies.ts","./src/react/queries/highestoffer.ts","./src/react/queries/index.ts","./src/react/queries/inventory.ts","./src/react/queries/listbalances.ts","./src/react/queries/listcollectibles.ts","./src/react/queries/lowestlisting.ts","./src/react/ssr/create-ssr-client.ts","./src/react/ssr/index.ts","./src/react/ssr/__tests__/create-ssr-client.test.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/types.ts","./src/react/ui/components/_internals/action-button/__tests__/actionbuttonbody.test.tsx","./src/react/ui/components/_internals/action-button/__tests__/nonowneractions.test.tsx","./src/react/ui/components/_internals/action-button/__tests__/owneractions.test.tsx","./src/react/ui/components/_internals/action-button/__tests__/useactionbuttonlogic.test.tsx","./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-select/customselect.tsx","./src/react/ui/components/_internals/custom-select/__tests__/customselect.test.tsx","./src/react/ui/components/_internals/pill/pill.tsx","./src/react/ui/components/_internals/pill/__tests__/pill.test.tsx","./src/react/ui/components/collectible-card/collectibleasset.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/__tests__/collectibleasset.test.tsx","./src/react/ui/components/collectible-card/__tests__/collectiblecard.test.tsx","./src/react/ui/components/collectible-card/__tests__/footer.test.tsx","./src/react/ui/components/marketplace-logos/index.ts","./src/react/ui/components/marketplace-logos/marketplace-logos.tsx","./src/react/ui/icons/bellicon.tsx","./src/react/ui/icons/calendaricon.tsx","./src/react/ui/icons/carticon.tsx","./src/react/ui/icons/infoicon.tsx","./src/react/ui/icons/iconvariants.ts","./src/react/ui/icons/index.ts","./src/react/ui/modals/modal-provider.tsx","./src/react/ui/modals/buymodal/erc1155quantitymodal.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__/modal1155.test.tsx","./src/react/ui/modals/buymodal/__tests__/store.test.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/usepaymentmodalparams.ts","./src/react/ui/modals/buymodal/hooks/__tests__/usecheckoutoptions.test.tsx","./src/react/ui/modals/buymodal/hooks/__tests__/usefees.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/__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/_views/enterwalletaddress/index.tsx","./src/react/ui/modals/transfermodal/_views/enterwalletaddress/usehandletransfer.tsx","./src/react/ui/modals/transfermodal/_views/enterwalletaddress/_components/tokenquantityinput.tsx","./src/react/ui/modals/transfermodal/_views/enterwalletaddress/_components/transferbutton.tsx","./src/react/ui/modals/transfermodal/_views/enterwalletaddress/_components/walletaddressinput.tsx","./src/react/ui/modals/transfermodal/_views/followwalletinstructions/index.tsx","./src/react/ui/modals/_internal/types.ts","./src/react/ui/modals/_internal/components/consts.ts","./src/react/ui/modals/_internal/components/actionmodal/actionmodal.test.tsx","./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/alertmessage/index.tsx","./src/react/ui/modals/_internal/components/calendar/index.tsx","./src/react/ui/modals/_internal/components/calendardropdown/index.tsx","./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/floorpricetext/__tests__/floorpricetext.test.tsx","./src/react/ui/modals/_internal/components/priceinput/index.tsx","./src/react/ui/modals/_internal/components/priceinput/types.ts","./src/react/ui/modals/_internal/components/priceinput/__tests__/priceinput.test.tsx","./src/react/ui/modals/_internal/components/quantityinput/index.tsx","./src/react/ui/modals/_internal/components/quantityinput/__tests__/index.test.tsx","./src/react/ui/modals/_internal/components/selectwaasfeeoptions/index.tsx","./src/react/ui/modals/_internal/components/selectwaasfeeoptions/store.ts","./src/react/ui/modals/_internal/components/selectwaasfeeoptions/usewaasfeeoptionmanager.tsx","./src/react/ui/modals/_internal/components/selectwaasfeeoptions/__tests__/actionbuttons.test.tsx","./src/react/ui/modals/_internal/components/selectwaasfeeoptions/__tests__/balanceindicator.test.tsx","./src/react/ui/modals/_internal/components/selectwaasfeeoptions/__tests__/selectwaasfeeoptions.test.tsx","./src/react/ui/modals/_internal/components/selectwaasfeeoptions/_components/actionbuttons.tsx","./src/react/ui/modals/_internal/components/selectwaasfeeoptions/_components/balanceindicator.tsx","./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/__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/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/__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/waasfeeoptionsselect/waasfeeoptionsselect.tsx","./src/react/ui/modals/_internal/hooks/useselectwaasfeeoptions.ts","./src/react/ui/modals/_internal/stores/accountmodal.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/types/waas-types.ts","./src/utils/address.ts","./src/utils/cn.ts","./src/utils/date.ts","./src/utils/getmarketplacedetails.ts","./src/utils/index.ts","./src/utils/network.ts","./src/utils/networkconfigtowagmichain.ts","./src/utils/price.ts","./src/utils/__tests__/address.test.ts","./src/utils/__tests__/date.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","./src/utils/decode/erc20.ts","./tsup.config.ts","./test/const.ts","./test/globalsetup.ts","./test/index.ts","./test/setup.ts","./test/test-utils.tsx","./test/mocks/wallet.ts"],"version":"5.8.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/types.ts","./src/react/_internal/utils.ts","./src/react/_internal/api/builder-api.ts","./src/react/_internal/api/builder.gen.ts","./src/react/_internal/api/get-query-client.ts","./src/react/_internal/api/index.ts","./src/react/_internal/api/laos-api.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__/builder.msw.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/databeat/index.ts","./src/react/_internal/databeat/types.ts","./src/react/_internal/wagmi/create-config.ts","./src/react/_internal/wagmi/get-connectors.ts","./src/react/_internal/wagmi/index.ts","./src/react/_internal/wagmi/__tests__/create-config.test.ts","./src/react/_internal/wallet/usewallet.ts","./src/react/_internal/wallet/wallet.ts","./src/react/_internal/wallet/__tests__/wallet.test.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/usecompareprices.tsx","./src/react/hooks/useconfig.tsx","./src/react/hooks/useconvertpricetousd.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/usefilterstate.tsx","./src/react/hooks/usefilters.tsx","./src/react/hooks/usefloororder.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/useinventory.tsx","./src/react/hooks/uselistbalances.tsx","./src/react/hooks/uselistcollectibleactivities.tsx","./src/react/hooks/uselistcollectibles.tsx","./src/react/hooks/uselistcollectiblespaginated.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/useroyalty.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__/usecompareprices.test.tsx","./src/react/hooks/__tests__/useconvertpricetousd.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__/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__/useinventory.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__/uselistcollectiblespaginated.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__/useroyalty.test.tsx","./src/react/hooks/options/collectionoptions.ts","./src/react/hooks/options/index.ts","./src/react/hooks/util/optimisticcancelupdates.ts","./src/react/queries/balanceofcollectible.ts","./src/react/queries/gettokensupplies.ts","./src/react/queries/highestoffer.ts","./src/react/queries/index.ts","./src/react/queries/inventory.ts","./src/react/queries/listbalances.ts","./src/react/queries/listcollectibles.ts","./src/react/queries/lowestlisting.ts","./src/react/queries/marketplaceconfig.ts","./src/react/ssr/create-ssr-client.ts","./src/react/ssr/index.ts","./src/react/ssr/__tests__/create-ssr-client.test.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/types.ts","./src/react/ui/components/_internals/action-button/__tests__/actionbuttonbody.test.tsx","./src/react/ui/components/_internals/action-button/__tests__/nonowneractions.test.tsx","./src/react/ui/components/_internals/action-button/__tests__/owneractions.test.tsx","./src/react/ui/components/_internals/action-button/__tests__/useactionbuttonlogic.test.tsx","./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-select/customselect.tsx","./src/react/ui/components/_internals/custom-select/__tests__/customselect.test.tsx","./src/react/ui/components/_internals/pill/pill.tsx","./src/react/ui/components/_internals/pill/__tests__/pill.test.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/__tests__/collectibleasset.test.tsx","./src/react/ui/components/collectible-card/__tests__/collectiblecard.test.tsx","./src/react/ui/components/collectible-card/__tests__/footer.test.tsx","./src/react/ui/components/collectible-card/collectible-asset/collectibleasset.tsx","./src/react/ui/components/collectible-card/collectible-asset/collectibleassetskeleton.tsx","./src/react/ui/components/collectible-card/collectible-asset/utils.ts","./src/react/ui/components/marketplace-logos/index.ts","./src/react/ui/components/marketplace-logos/marketplace-logos.tsx","./src/react/ui/icons/bellicon.tsx","./src/react/ui/icons/calendaricon.tsx","./src/react/ui/icons/carticon.tsx","./src/react/ui/icons/infoicon.tsx","./src/react/ui/icons/iconvariants.ts","./src/react/ui/icons/index.ts","./src/react/ui/modals/modal-provider.tsx","./src/react/ui/modals/buymodal/erc1155quantitymodal.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__/modal1155.test.tsx","./src/react/ui/modals/buymodal/__tests__/store.test.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/usepaymentmodalparams.ts","./src/react/ui/modals/buymodal/hooks/__tests__/usecheckoutoptions.test.tsx","./src/react/ui/modals/buymodal/hooks/__tests__/usefees.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/__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/_views/enterwalletaddress/index.tsx","./src/react/ui/modals/transfermodal/_views/enterwalletaddress/usehandletransfer.tsx","./src/react/ui/modals/transfermodal/_views/enterwalletaddress/_components/tokenquantityinput.tsx","./src/react/ui/modals/transfermodal/_views/enterwalletaddress/_components/transferbutton.tsx","./src/react/ui/modals/transfermodal/_views/enterwalletaddress/_components/walletaddressinput.tsx","./src/react/ui/modals/transfermodal/_views/followwalletinstructions/index.tsx","./src/react/ui/modals/_internal/types.ts","./src/react/ui/modals/_internal/components/consts.ts","./src/react/ui/modals/_internal/components/actionmodal/actionmodal.test.tsx","./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/alertmessage/index.tsx","./src/react/ui/modals/_internal/components/calendar/index.tsx","./src/react/ui/modals/_internal/components/calendardropdown/index.tsx","./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/floorpricetext/__tests__/floorpricetext.test.tsx","./src/react/ui/modals/_internal/components/priceinput/index.tsx","./src/react/ui/modals/_internal/components/priceinput/types.ts","./src/react/ui/modals/_internal/components/priceinput/__tests__/priceinput.test.tsx","./src/react/ui/modals/_internal/components/quantityinput/index.tsx","./src/react/ui/modals/_internal/components/quantityinput/__tests__/index.test.tsx","./src/react/ui/modals/_internal/components/selectwaasfeeoptions/index.tsx","./src/react/ui/modals/_internal/components/selectwaasfeeoptions/store.ts","./src/react/ui/modals/_internal/components/selectwaasfeeoptions/usewaasfeeoptionmanager.tsx","./src/react/ui/modals/_internal/components/selectwaasfeeoptions/__tests__/actionbuttons.test.tsx","./src/react/ui/modals/_internal/components/selectwaasfeeoptions/__tests__/balanceindicator.test.tsx","./src/react/ui/modals/_internal/components/selectwaasfeeoptions/__tests__/selectwaasfeeoptions.test.tsx","./src/react/ui/modals/_internal/components/selectwaasfeeoptions/_components/actionbuttons.tsx","./src/react/ui/modals/_internal/components/selectwaasfeeoptions/_components/balanceindicator.tsx","./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/__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/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/__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/waasfeeoptionsselect/waasfeeoptionsselect.tsx","./src/react/ui/modals/_internal/hooks/useselectwaasfeeoptions.ts","./src/react/ui/modals/_internal/stores/accountmodal.ts","./src/types/api-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/types/waas-types.ts","./src/utils/address.ts","./src/utils/cn.ts","./src/utils/date.ts","./src/utils/fetchcontenttype.ts","./src/utils/getmarketplacedetails.ts","./src/utils/getsequencemarketrequestid.ts","./src/utils/index.ts","./src/utils/network.ts","./src/utils/networkconfigtowagmichain.ts","./src/utils/price.ts","./src/utils/__tests__/address.test.ts","./src/utils/__tests__/date.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","./src/utils/decode/erc20.ts","./tsup.config.ts","./test/const.ts","./test/globalsetup.ts","./test/index.ts","./test/setup.ts","./test/test-utils.tsx","./test/mocks/wallet.ts"],"version":"5.8.3"}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { O as OrderbookKind } from './marketplace.gen-BU6T6f0m.js';
|
|
2
|
-
|
|
3
|
-
declare enum MarketplaceWallet {
|
|
4
|
-
UNIVERSAL = "UNIVERSAL",
|
|
5
|
-
EMBEDDED = "EMBEDDED",
|
|
6
|
-
ECOSYSTEM = "ECOSYSTEM"
|
|
7
|
-
}
|
|
8
|
-
declare enum FilterCondition {
|
|
9
|
-
ENTIRE_KEY = "ENTIRE_KEY",
|
|
10
|
-
SPECIFIC_VALUE = "SPECIFIC_VALUE"
|
|
11
|
-
}
|
|
12
|
-
declare enum MarketplaceType {
|
|
13
|
-
AMM = "AMM",
|
|
14
|
-
P2P = "P2P",
|
|
15
|
-
SEQUENCE = "SEQUENCE",
|
|
16
|
-
ORDERBOOK = "ORDERBOOK"
|
|
17
|
-
}
|
|
18
|
-
interface EcosystemWalletSettings {
|
|
19
|
-
walletUrl: string;
|
|
20
|
-
walletAppName: string;
|
|
21
|
-
logoLightUrl?: string;
|
|
22
|
-
logoDarkUrl?: string;
|
|
23
|
-
}
|
|
24
|
-
interface MarketplaceWalletOptions {
|
|
25
|
-
walletType: MarketplaceWallet;
|
|
26
|
-
oidcIssuers: {
|
|
27
|
-
[key: string]: string;
|
|
28
|
-
};
|
|
29
|
-
connectors: Array<string>;
|
|
30
|
-
includeEIP6963Wallets: boolean;
|
|
31
|
-
ecosystem?: EcosystemWalletSettings;
|
|
32
|
-
}
|
|
33
|
-
interface MetadataFilterRule {
|
|
34
|
-
key: string;
|
|
35
|
-
condition: FilterCondition;
|
|
36
|
-
value?: string;
|
|
37
|
-
}
|
|
38
|
-
interface CollectionFilterSettings {
|
|
39
|
-
filterOrder: Array<string>;
|
|
40
|
-
exclusions: Array<MetadataFilterRule>;
|
|
41
|
-
}
|
|
42
|
-
interface MarketplaceCollection {
|
|
43
|
-
marketplaceType: MarketplaceType;
|
|
44
|
-
chainId: number;
|
|
45
|
-
address: string;
|
|
46
|
-
exchanges: Array<string>;
|
|
47
|
-
bannerUrl: string;
|
|
48
|
-
feePercentage: number;
|
|
49
|
-
currencyOptions: Array<string>;
|
|
50
|
-
destinationMarketplace: OrderbookKind;
|
|
51
|
-
filterSettings?: CollectionFilterSettings;
|
|
52
|
-
isLAOSERC721?: boolean;
|
|
53
|
-
}
|
|
54
|
-
interface MarketplaceSocials {
|
|
55
|
-
twitter: string;
|
|
56
|
-
discord: string;
|
|
57
|
-
website: string;
|
|
58
|
-
tiktok: string;
|
|
59
|
-
instagram: string;
|
|
60
|
-
youtube: string;
|
|
61
|
-
}
|
|
62
|
-
interface MarketplaceSettings {
|
|
63
|
-
publisherId: string;
|
|
64
|
-
title: string;
|
|
65
|
-
shortDescription: string;
|
|
66
|
-
socials: MarketplaceSocials;
|
|
67
|
-
faviconUrl: string;
|
|
68
|
-
landingBannerUrl: string;
|
|
69
|
-
collections: Array<MarketplaceCollection>;
|
|
70
|
-
walletOptions: MarketplaceWalletOptions;
|
|
71
|
-
landingPageLayout: string;
|
|
72
|
-
logoUrl: string;
|
|
73
|
-
bannerUrl: string;
|
|
74
|
-
fontUrl?: string;
|
|
75
|
-
ogImage?: string;
|
|
76
|
-
}
|
|
77
|
-
interface MarketplaceConfig extends MarketplaceSettings {
|
|
78
|
-
cssString: string;
|
|
79
|
-
manifestUrl: string;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export { type CollectionFilterSettings as C, type EcosystemWalletSettings as E, FilterCondition as F, MarketplaceWallet as M, MarketplaceType as a, type MarketplaceWalletOptions as b, type MetadataFilterRule as c, type MarketplaceCollection as d, type MarketplaceSocials as e, type MarketplaceSettings as f, type MarketplaceConfig as g };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/_internal/wagmi/create-config.ts","../src/react/_internal/consts.ts","../src/react/_internal/get-provider.ts","../src/react/_internal/types.ts","../src/types/builder-types.ts","../src/react/_internal/wagmi/get-connectors.ts"],"sourcesContent":["import { getDefaultChains } from '@0xsequence/connect';\nimport { allNetworks, findNetworkConfig } from '@0xsequence/network';\nimport type { Chain, Transport } from 'viem';\nimport { http, cookieStorage, createConfig, createStorage } from 'wagmi';\nimport {\n\ttype Env,\n\ttype MarketplaceConfig,\n\tMarketplaceWallet,\n\ttype SdkConfig,\n} from '../../../types';\nimport { DEFAULT_NETWORK } from '../consts';\nimport { getConnectors } from './get-connectors';\n\nexport const createWagmiConfig = (\n\tmarketplaceConfig: MarketplaceConfig,\n\tsdkConfig: SdkConfig,\n\tssr?: boolean,\n) => {\n\tconst chains = getChainConfigs(marketplaceConfig);\n\tconst nodeGatewayEnv = sdkConfig._internal?.nodeGatewayEnv ?? 'production';\n\tconst transports = getTransportConfigs(\n\t\tchains,\n\t\tsdkConfig.projectAccessKey,\n\t\tnodeGatewayEnv,\n\t);\n\n\tlet walletType = marketplaceConfig.walletOptions.walletType;\n\n\t// TODO: This will bring issues.. But we relay on the waasConfigKey to detect if the boilerplates should use\n\t// waas or universal.. we need to find a better way to do this..\n\tif (\n\t\tsdkConfig.wallet?.embedded?.waasConfigKey &&\n\t\twalletType !== MarketplaceWallet.ECOSYSTEM\n\t) {\n\t\twalletType = MarketplaceWallet.EMBEDDED;\n\t}\n\n\tconst connectors = getConnectors({\n\t\tmarketplaceConfig,\n\t\tsdkConfig,\n\t\twalletType,\n\t});\n\n\tconst multiInjectedProviderDiscovery =\n\t\tmarketplaceConfig.walletOptions.includeEIP6963Wallets;\n\n\treturn createConfig({\n\t\tconnectors,\n\t\tchains,\n\t\tssr,\n\t\tmultiInjectedProviderDiscovery,\n\t\tstorage: ssr\n\t\t\t? createStorage({\n\t\t\t\t\tstorage: cookieStorage,\n\t\t\t\t})\n\t\t\t: undefined,\n\t\ttransports,\n\t});\n};\n\nfunction getChainConfigs(marketConfig: MarketplaceConfig): [Chain, ...Chain[]] {\n\tconst supportedChainIds = new Set(\n\t\tmarketConfig.collections.map((c) => c.chainId),\n\t);\n\n\tif (supportedChainIds.size === 0) {\n\t\tsupportedChainIds.add(DEFAULT_NETWORK);\n\t}\n\n\tconst chains = getDefaultChains([...supportedChainIds]);\n\n\treturn chains;\n}\n\nfunction getTransportConfigs(\n\tchains: [Chain, ...Chain[]],\n\tprojectAccessKey: string,\n\tnodeGatewayEnv: Env,\n): Record<number, Transport> {\n\treturn chains.reduce(\n\t\t(acc, chain) => {\n\t\t\tconst network = findNetworkConfig(allNetworks, chain.id);\n\t\t\tif (network) {\n\t\t\t\tlet rpcUrl = network.rpcUrl;\n\t\t\t\tif (nodeGatewayEnv === 'development') {\n\t\t\t\t\trpcUrl = rpcUrl.replace('nodes.', 'dev-nodes.');\n\t\t\t\t}\n\t\t\t\tif (!network.rpcUrl.endsWith(projectAccessKey))\n\t\t\t\t\trpcUrl = `${rpcUrl}/${projectAccessKey}`;\n\t\t\t\tacc[chain.id] = http(rpcUrl);\n\t\t\t}\n\t\t\treturn acc;\n\t\t},\n\t\t{} as Record<number, Transport>,\n\t);\n}\n","export const DEFAULT_NETWORK = 137;\n","export const PROVIDER_ID = 'sdk-provider';\n\nexport function getProviderEl() {\n\tif (!globalThis.document) return null;\n\treturn document.getElementById(PROVIDER_ID);\n}\n","import type { Address } from 'viem';\nimport type { Chain } from 'viem';\nimport { z } from 'zod';\nimport type { ContractType, CreateReq } from '../../types';\nimport type { MarketplaceConfig, SdkConfig } from '../../types';\nimport type { MarketplaceKind, OrderbookKind } from './api';\n\nexport const QueryArgSchema = z\n\t.object({\n\t\tenabled: z.boolean().optional(),\n\t})\n\t.optional();\n\nexport type QueryArg = z.infer<typeof QueryArgSchema>;\n\nexport const CollectableIdSchema = z.string().or(z.number());\n\nexport const AddressSchema = z.string().transform((val, ctx) => {\n\tconst regex = /^0x[a-fA-F0-9]{40}$/;\n\n\tif (!regex.test(val)) {\n\t\tctx.addIssue({\n\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\tmessage: `Invalid Address ${val}`,\n\t\t});\n\t}\n\n\treturn val as Address;\n});\n\nexport type CollectionType = ContractType.ERC1155 | ContractType.ERC721;\n\ntype TransactionStep = {\n\texist: boolean;\n\tisExecuting: boolean;\n\texecute: () => Promise<void>;\n};\n\nexport type TransactionSteps = {\n\tapproval: TransactionStep;\n\ttransaction: TransactionStep;\n};\n\nexport enum TransactionType {\n\tBUY = 'BUY',\n\tSELL = 'SELL',\n\tLISTING = 'LISTING',\n\tOFFER = 'OFFER',\n\tTRANSFER = 'TRANSFER',\n\tCANCEL = 'CANCEL',\n}\n\nexport interface TransactionConfig {\n\ttype: TransactionType;\n\tchainId: number;\n\tchains: readonly Chain[];\n\tcollectionAddress: string;\n\tsdkConfig: SdkConfig;\n\tmarketplaceConfig: MarketplaceConfig;\n\torderbookKind?: OrderbookKind;\n}\n\nexport interface BuyInput {\n\torderId: string;\n\tcollectableDecimals: number;\n\tmarketplace: MarketplaceKind;\n\tquantity: string;\n}\n\nexport interface SellInput {\n\torderId: string;\n\tmarketplace: MarketplaceKind;\n\tquantity?: string;\n}\n\nexport interface ListingInput {\n\tcontractType: ContractType;\n\tlisting: CreateReq;\n}\n\nexport interface OfferInput {\n\tcontractType: ContractType;\n\toffer: CreateReq;\n}\n\nexport interface CancelInput {\n\torderId: string;\n\tmarketplace: MarketplaceKind;\n}\n","import type { OrderbookKind } from '../react/_internal/api/marketplace.gen';\n\n// Manual copy of the types from builder\nexport enum MarketplaceWallet {\n\tUNIVERSAL = 'UNIVERSAL',\n\tEMBEDDED = 'EMBEDDED',\n\tECOSYSTEM = 'ECOSYSTEM',\n}\n\nexport enum FilterCondition {\n\tENTIRE_KEY = 'ENTIRE_KEY',\n\tSPECIFIC_VALUE = 'SPECIFIC_VALUE',\n}\n\nexport enum MarketplaceType { // This is only used for marketplace v1\n\tAMM = 'AMM',\n\tP2P = 'P2P',\n\tSEQUENCE = 'SEQUENCE',\n\tORDERBOOK = 'ORDERBOOK',\n}\n\nexport interface EcosystemWalletSettings {\n\twalletUrl: string;\n\twalletAppName: string;\n\tlogoLightUrl?: string;\n\tlogoDarkUrl?: string;\n}\nexport interface MarketplaceWalletOptions {\n\twalletType: MarketplaceWallet;\n\toidcIssuers: { [key: string]: string };\n\tconnectors: Array<string>;\n\tincludeEIP6963Wallets: boolean;\n\tecosystem?: EcosystemWalletSettings;\n}\n\nexport interface MetadataFilterRule {\n\tkey: string;\n\tcondition: FilterCondition;\n\tvalue?: string;\n}\n\nexport interface CollectionFilterSettings {\n\tfilterOrder: Array<string>;\n\texclusions: Array<MetadataFilterRule>;\n}\n\nexport interface MarketplaceCollection {\n\tmarketplaceType: MarketplaceType;\n\tchainId: number;\n\taddress: string;\n\texchanges: Array<string>;\n\tbannerUrl: string;\n\tfeePercentage: number;\n\tcurrencyOptions: Array<string>;\n\tdestinationMarketplace: OrderbookKind;\n\tfilterSettings?: CollectionFilterSettings;\n\tisLAOSERC721?: boolean;\n}\n\nexport interface MarketplaceSocials {\n\ttwitter: string;\n\tdiscord: string;\n\twebsite: string;\n\ttiktok: string;\n\tinstagram: string;\n\tyoutube: string;\n}\n\nexport interface MarketplaceSettings {\n\tpublisherId: string;\n\ttitle: string;\n\tshortDescription: string;\n\tsocials: MarketplaceSocials;\n\tfaviconUrl: string;\n\tlandingBannerUrl: string;\n\tcollections: Array<MarketplaceCollection>;\n\twalletOptions: MarketplaceWalletOptions;\n\tlandingPageLayout: string;\n\tlogoUrl: string;\n\tbannerUrl: string;\n\tfontUrl?: string;\n\togImage?: string;\n}\n\nexport interface MarketplaceConfig extends MarketplaceSettings {\n\tcssString: string;\n\tmanifestUrl: string;\n}\n","import {\n\ttype SequenceOptions,\n\ttype Wallet,\n\tapple,\n\tappleWaas,\n\tcoinbaseWallet,\n\tecosystemWallet,\n\temail,\n\temailWaas,\n\tfacebook,\n\tgetConnectWallets,\n\tgoogle,\n\tgoogleWaas,\n\tsequence,\n\ttwitch,\n\twalletConnect,\n} from '@0xsequence/connect';\nimport React, { type FunctionComponent } from 'react';\nimport type { CreateConnectorFn } from 'wagmi';\nimport {\n\ttype Env,\n\ttype MarketplaceConfig,\n\tMarketplaceWallet,\n\ttype SdkConfig,\n} from '../../../types';\nimport { MissingConfigError } from '../../../utils/_internal/error/transaction';\nimport { DEFAULT_NETWORK } from '../consts';\n\nexport function getConnectors({\n\tmarketplaceConfig,\n\tsdkConfig,\n\twalletType,\n}: {\n\tmarketplaceConfig: MarketplaceConfig;\n\tsdkConfig: SdkConfig;\n\twalletType: MarketplaceWallet;\n}): CreateConnectorFn[] {\n\tconst connectors = commonConnectors(marketplaceConfig, sdkConfig);\n\n\tif (walletType === MarketplaceWallet.UNIVERSAL) {\n\t\tconnectors.push(...getUniversalWalletConfigs(sdkConfig, marketplaceConfig));\n\t} else if (walletType === MarketplaceWallet.EMBEDDED) {\n\t\tconnectors.push(...getWaasConnectors(sdkConfig));\n\t} else if (walletType === MarketplaceWallet.ECOSYSTEM) {\n\t\tconnectors.push(getEcosystemConnector(marketplaceConfig, sdkConfig));\n\t} else {\n\t\tthrow new Error('Invalid wallet type');\n\t}\n\n\treturn getConnectWallets(sdkConfig.projectAccessKey, connectors);\n}\n\nfunction commonConnectors(\n\tmarketplaceConfig: MarketplaceConfig,\n\tsdkConfig: SdkConfig,\n) {\n\tconst wallets = [];\n\tconst { title: appName } = marketplaceConfig;\n\tconst walletOptions = marketplaceConfig.walletOptions;\n\tconst walletConnectProjectId = sdkConfig.wallet?.walletConnectProjectId;\n\n\tif (walletOptions.connectors.includes('coinbase')) {\n\t\twallets.push(\n\t\t\tcoinbaseWallet({\n\t\t\t\tappName,\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (\n\t\twalletConnectProjectId &&\n\t\twalletOptions.connectors.includes('walletconnect')\n\t) {\n\t\twallets.push(\n\t\t\twalletConnect({\n\t\t\t\tprojectId: walletConnectProjectId,\n\t\t\t}),\n\t\t);\n\t}\n\n\treturn wallets;\n}\n\nfunction getUniversalWalletConfigs(\n\tconfig: SdkConfig,\n\tmarketplaceConfig: MarketplaceConfig,\n): Wallet[] {\n\tconst { projectAccessKey } = config;\n\tconst sequenceWalletEnv = config._internal?.sequenceWalletEnv || 'production';\n\n\tconst sequenceWalletOptions = {\n\t\twalletAppURL: getSequenceWalletURL(sequenceWalletEnv),\n\t\tdefaultNetwork: DEFAULT_NETWORK,\n\t\tconnect: {\n\t\t\tprojectAccessKey,\n\t\t\tapp: marketplaceConfig.title,\n\t\t\tsettings: {\n\t\t\t\tbannerUrl: marketplaceConfig.ogImage,\n\t\t\t},\n\t\t},\n\t} satisfies SequenceOptions;\n\n\treturn [\n\t\tsequence(sequenceWalletOptions),\n\t\temail(sequenceWalletOptions),\n\t\tfacebook(sequenceWalletOptions),\n\t\tgoogle(sequenceWalletOptions),\n\t\tapple(sequenceWalletOptions),\n\t\ttwitch(sequenceWalletOptions),\n\t] as const;\n}\n\nexport function getWaasConnectors(sdkConfig: SdkConfig): Wallet[] {\n\tconst { projectAccessKey } = sdkConfig;\n\n\tconst waasConfigKey = sdkConfig.wallet?.embedded?.waasConfigKey;\n\n\tif (!waasConfigKey) throw new MissingConfigError('waasConfigKey');\n\n\tconst { googleClientId, appleClientId, appleRedirectURI } =\n\t\tsdkConfig.wallet?.embedded || {};\n\n\tconst wallets: Wallet[] = [\n\t\temailWaas({\n\t\t\tprojectAccessKey,\n\t\t\twaasConfigKey,\n\t\t\tnetwork: DEFAULT_NETWORK,\n\t\t}),\n\t];\n\n\tif (googleClientId) {\n\t\twallets.push(\n\t\t\tgoogleWaas({\n\t\t\t\tprojectAccessKey,\n\t\t\t\tgoogleClientId,\n\t\t\t\twaasConfigKey,\n\t\t\t\tnetwork: DEFAULT_NETWORK,\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (appleClientId) {\n\t\twallets.push(\n\t\t\tappleWaas({\n\t\t\t\tprojectAccessKey,\n\t\t\t\tappleClientId,\n\t\t\t\tappleRedirectURI,\n\t\t\t\twaasConfigKey,\n\t\t\t\tnetwork: DEFAULT_NETWORK,\n\t\t\t}),\n\t\t);\n\t}\n\n\treturn wallets;\n}\n\nexport function getEcosystemConnector(\n\tmarketplaceConfig: MarketplaceConfig,\n\tsdkConfig: SdkConfig,\n): Wallet {\n\tconst ecosystemOptions = marketplaceConfig.walletOptions.ecosystem;\n\tif (!ecosystemOptions) throw new MissingConfigError('ecosystem');\n\tconst { walletAppName, walletUrl, logoDarkUrl, logoLightUrl } =\n\t\tecosystemOptions;\n\n\treturn ecosystemWallet({\n\t\tprojectAccessKey: sdkConfig.projectAccessKey,\n\t\twalletUrl,\n\t\tname: walletAppName,\n\t\tdefaultNetwork: DEFAULT_NETWORK,\n\t\tlogoDark: getEcosystemLogo(logoDarkUrl, walletAppName),\n\t\tlogoLight: getEcosystemLogo(logoLightUrl, walletAppName),\n\t});\n}\n\nfunction getEcosystemLogo(\n\turl: string | undefined,\n\tname: string,\n): FunctionComponent {\n\tif (!url) return () => null;\n\tconst Logo = () =>\n\t\tReact.createElement('img', { src: url, alt: name, width: 32, height: 32 });\n\tLogo.displayName = 'EcosystemLogo';\n\treturn Logo;\n}\n\nfunction getSequenceWalletURL(env: Env) {\n\tswitch (env) {\n\t\tcase 'development':\n\t\t\treturn 'https://dev.sequence.app';\n\t\tcase 'production':\n\t\t\treturn 'https://sequence.app';\n\t\tcase 'next':\n\t\t\treturn 'https://next.sequence.app';\n\t}\n}\n"],"mappings":"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","names":["TransactionType","MarketplaceWallet","FilterCondition","MarketplaceType"]}
|