@0xsequence/marketplace-sdk 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-HV2X2VZN.js → chunk-I37CRQ4S.js} +591 -576
- package/dist/chunk-I37CRQ4S.js.map +1 -0
- package/dist/{chunk-J2XJZ6SJ.js → chunk-MKGSGTQC.js} +14 -7
- package/dist/chunk-MKGSGTQC.js.map +1 -0
- package/dist/{chunk-OUVFTA63.js → chunk-MSTTVFVQ.js} +13 -11
- package/dist/chunk-MSTTVFVQ.js.map +1 -0
- package/dist/index.js +2 -2
- package/dist/react/_internal/index.js +6 -6
- package/dist/react/hooks/index.d.ts +106 -35
- package/dist/react/hooks/index.js +3 -3
- package/dist/react/index.js +7 -7
- package/dist/react/ui/components/collectible-card/index.js +5 -5
- package/dist/react/ui/index.js +5 -5
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +4 -4
- package/dist/react/ui/styles/index.d.ts +1 -1
- package/dist/styles/index.d.ts +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/index.js +2 -2
- package/package.json +1 -1
- package/src/react/hooks/useAutoSelectFeeOption.tsx +154 -61
- package/src/react/hooks/useCancelOrder.tsx +7 -23
- package/src/react/ui/modals/CreateListingModal/hooks/useGetTokenApproval.ts +8 -2
- package/src/react/ui/modals/_internal/components/waasFeeOptionsSelect/WaasFeeOptionsSelect.tsx +14 -7
- package/dist/chunk-HV2X2VZN.js.map +0 -1
- package/dist/chunk-J2XJZ6SJ.js.map +0 -1
- package/dist/chunk-OUVFTA63.js.map +0 -1
|
@@ -77,78 +77,14 @@ import {
|
|
|
77
77
|
} from "./chunk-WM4RGBFQ.js";
|
|
78
78
|
|
|
79
79
|
// src/react/hooks/useAutoSelectFeeOption.tsx
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
80
|
+
import { zeroAddress } from "viem";
|
|
81
|
+
import { useAccount } from "wagmi";
|
|
82
82
|
import { useCallback } from "react";
|
|
83
|
-
|
|
84
|
-
pendingFeeOptionConfirmation
|
|
85
|
-
}) {
|
|
86
|
-
const { address: userAddress } = useAccount();
|
|
87
|
-
const config = useConfig();
|
|
88
|
-
const findAffordableOption = useCallback(async () => {
|
|
89
|
-
if (!userAddress) {
|
|
90
|
-
return {
|
|
91
|
-
selectedOption: null,
|
|
92
|
-
error: "User not connected",
|
|
93
|
-
isLoading: false
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
if (!pendingFeeOptionConfirmation.options) {
|
|
97
|
-
return {
|
|
98
|
-
selectedOption: null,
|
|
99
|
-
error: "No options provided",
|
|
100
|
-
isLoading: false
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
try {
|
|
104
|
-
for (const option of pendingFeeOptionConfirmation.options) {
|
|
105
|
-
if (!option.token.contractAddress) continue;
|
|
106
|
-
try {
|
|
107
|
-
const balance = await getBalance(config, {
|
|
108
|
-
address: userAddress,
|
|
109
|
-
token: option.token.contractAddress,
|
|
110
|
-
chainId: pendingFeeOptionConfirmation.chainId
|
|
111
|
-
});
|
|
112
|
-
const optionValue = BigInt(option.value);
|
|
113
|
-
if (balance.value >= optionValue) {
|
|
114
|
-
return {
|
|
115
|
-
selectedOption: option,
|
|
116
|
-
error: null,
|
|
117
|
-
isLoading: false
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
} catch (error) {
|
|
121
|
-
console.error(
|
|
122
|
-
"Error fetching balance for currency:",
|
|
123
|
-
option.token.contractAddress,
|
|
124
|
-
error
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
return {
|
|
129
|
-
selectedOption: null,
|
|
130
|
-
error: "Insufficient balance for any fee option",
|
|
131
|
-
isLoading: false
|
|
132
|
-
};
|
|
133
|
-
} catch (error) {
|
|
134
|
-
return {
|
|
135
|
-
selectedOption: null,
|
|
136
|
-
error: "Failed to check balances",
|
|
137
|
-
isLoading: false
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
}, [
|
|
141
|
-
pendingFeeOptionConfirmation.options,
|
|
142
|
-
pendingFeeOptionConfirmation.chainId,
|
|
143
|
-
userAddress,
|
|
144
|
-
config
|
|
145
|
-
]);
|
|
146
|
-
return findAffordableOption();
|
|
147
|
-
}
|
|
83
|
+
import { useChain } from "@0xsequence/kit";
|
|
148
84
|
|
|
149
|
-
// src/react/hooks/
|
|
150
|
-
import { queryOptions, skipToken, useQuery } from "@tanstack/react-query";
|
|
85
|
+
// src/react/hooks/useCollectionBalanceDetails.tsx
|
|
151
86
|
import { z } from "zod";
|
|
87
|
+
import { queryOptions, useQuery } from "@tanstack/react-query";
|
|
152
88
|
|
|
153
89
|
// src/react/hooks/useConfig.tsx
|
|
154
90
|
import { useContext } from "react";
|
|
@@ -197,7 +133,7 @@ function MarketplaceProvider({
|
|
|
197
133
|
}
|
|
198
134
|
|
|
199
135
|
// src/react/hooks/useConfig.tsx
|
|
200
|
-
function
|
|
136
|
+
function useConfig() {
|
|
201
137
|
const context = useContext(MarketplaceSdkContext);
|
|
202
138
|
if (!context) {
|
|
203
139
|
throw new MarketplaceSdkProviderNotFoundError();
|
|
@@ -205,12 +141,157 @@ function useConfig2() {
|
|
|
205
141
|
return context;
|
|
206
142
|
}
|
|
207
143
|
|
|
144
|
+
// src/react/hooks/useCollectionBalanceDetails.tsx
|
|
145
|
+
var filterSchema = z.object({
|
|
146
|
+
accountAddresses: z.array(AddressSchema),
|
|
147
|
+
contractWhitelist: z.array(AddressSchema).optional(),
|
|
148
|
+
omitNativeBalances: z.boolean()
|
|
149
|
+
});
|
|
150
|
+
var useCollectionBalanceDetailsArgsSchema = z.object({
|
|
151
|
+
chainId: ChainIdSchema.pipe(z.coerce.number()),
|
|
152
|
+
filter: filterSchema,
|
|
153
|
+
query: QueryArgSchema.optional()
|
|
154
|
+
});
|
|
155
|
+
var fetchCollectionBalanceDetails = async (args, indexerClient) => {
|
|
156
|
+
const promises = args.filter.accountAddresses.map(
|
|
157
|
+
(accountAddress) => indexerClient.getTokenBalancesDetails({
|
|
158
|
+
filter: {
|
|
159
|
+
accountAddresses: [accountAddress],
|
|
160
|
+
contractWhitelist: args.filter.contractWhitelist,
|
|
161
|
+
omitNativeBalances: args.filter.omitNativeBalances
|
|
162
|
+
}
|
|
163
|
+
})
|
|
164
|
+
);
|
|
165
|
+
const responses = await Promise.all(promises);
|
|
166
|
+
const mergedResponse = responses.reduce(
|
|
167
|
+
(acc, curr) => {
|
|
168
|
+
if (!curr) return acc;
|
|
169
|
+
return {
|
|
170
|
+
page: curr.page,
|
|
171
|
+
nativeBalances: [
|
|
172
|
+
...acc.nativeBalances || [],
|
|
173
|
+
...curr.nativeBalances || []
|
|
174
|
+
],
|
|
175
|
+
balances: [...acc.balances || [], ...curr.balances || []]
|
|
176
|
+
};
|
|
177
|
+
},
|
|
178
|
+
{ page: {}, nativeBalances: [], balances: [] }
|
|
179
|
+
);
|
|
180
|
+
if (!mergedResponse) {
|
|
181
|
+
throw new Error("Failed to fetch collection balance details");
|
|
182
|
+
}
|
|
183
|
+
return mergedResponse;
|
|
184
|
+
};
|
|
185
|
+
var collectionBalanceDetailsOptions = (args, config) => {
|
|
186
|
+
const parsedArgs = useCollectionBalanceDetailsArgsSchema.parse(args);
|
|
187
|
+
const indexerClient = getIndexerClient(parsedArgs.chainId, config);
|
|
188
|
+
return queryOptions({
|
|
189
|
+
queryKey: [...balanceQueries.collectionBalanceDetails, args, config],
|
|
190
|
+
queryFn: () => fetchCollectionBalanceDetails(parsedArgs, indexerClient),
|
|
191
|
+
...args.query
|
|
192
|
+
});
|
|
193
|
+
};
|
|
194
|
+
var useCollectionBalanceDetails = (args) => {
|
|
195
|
+
const config = useConfig();
|
|
196
|
+
return useQuery(collectionBalanceDetailsOptions(args, config));
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
// src/react/hooks/useAutoSelectFeeOption.tsx
|
|
200
|
+
function useAutoSelectFeeOption({
|
|
201
|
+
pendingFeeOptionConfirmation
|
|
202
|
+
}) {
|
|
203
|
+
const { address: userAddress } = useAccount();
|
|
204
|
+
const contractWhitelist = pendingFeeOptionConfirmation.options?.map(
|
|
205
|
+
(option) => option.token.contractAddress === null ? zeroAddress : option.token.contractAddress
|
|
206
|
+
);
|
|
207
|
+
const {
|
|
208
|
+
data: balanceDetails,
|
|
209
|
+
isLoading: isBalanceDetailsLoading,
|
|
210
|
+
isError: isBalanceDetailsError
|
|
211
|
+
} = useCollectionBalanceDetails({
|
|
212
|
+
chainId: pendingFeeOptionConfirmation.chainId,
|
|
213
|
+
filter: {
|
|
214
|
+
accountAddresses: userAddress ? [userAddress] : [],
|
|
215
|
+
contractWhitelist,
|
|
216
|
+
omitNativeBalances: false
|
|
217
|
+
},
|
|
218
|
+
query: {
|
|
219
|
+
enabled: !!pendingFeeOptionConfirmation.options && !!userAddress
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
const chain = useChain(pendingFeeOptionConfirmation.chainId);
|
|
223
|
+
const combinedBalances = balanceDetails && [
|
|
224
|
+
...balanceDetails.nativeBalances.map((b) => ({
|
|
225
|
+
chainId: pendingFeeOptionConfirmation.chainId,
|
|
226
|
+
balance: b.balance,
|
|
227
|
+
symbol: chain?.nativeCurrency.symbol,
|
|
228
|
+
contractAddress: zeroAddress
|
|
229
|
+
})),
|
|
230
|
+
...balanceDetails.balances.map((b) => ({
|
|
231
|
+
chainId: b.chainId,
|
|
232
|
+
balance: b.balance,
|
|
233
|
+
symbol: b.contractInfo?.symbol,
|
|
234
|
+
contractAddress: b.contractAddress
|
|
235
|
+
}))
|
|
236
|
+
];
|
|
237
|
+
console.debug("currency balances", combinedBalances);
|
|
238
|
+
const autoSelectedOption = useCallback(async () => {
|
|
239
|
+
if (!userAddress) {
|
|
240
|
+
return {
|
|
241
|
+
selectedOption: null,
|
|
242
|
+
error: "User not connected" /* UserNotConnected */
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
if (!pendingFeeOptionConfirmation.options) {
|
|
246
|
+
return {
|
|
247
|
+
selectedOption: null,
|
|
248
|
+
error: "No options provided" /* NoOptionsProvided */
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
if (isBalanceDetailsLoading) {
|
|
252
|
+
return { selectedOption: null, error: null, isLoading: true };
|
|
253
|
+
}
|
|
254
|
+
if (isBalanceDetailsError || !combinedBalances) {
|
|
255
|
+
return {
|
|
256
|
+
selectedOption: null,
|
|
257
|
+
error: "Failed to check balances" /* FailedToCheckBalances */
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
const selectedOption = pendingFeeOptionConfirmation.options.find(
|
|
261
|
+
(option) => {
|
|
262
|
+
const tokenBalance = combinedBalances.find(
|
|
263
|
+
(balance) => balance.contractAddress.toLowerCase() === (option.token.contractAddress === null ? zeroAddress : option.token.contractAddress).toLowerCase()
|
|
264
|
+
);
|
|
265
|
+
if (!tokenBalance) return false;
|
|
266
|
+
return BigInt(tokenBalance.balance) >= BigInt(option.value);
|
|
267
|
+
}
|
|
268
|
+
);
|
|
269
|
+
if (!selectedOption) {
|
|
270
|
+
return {
|
|
271
|
+
selectedOption: null,
|
|
272
|
+
error: "Insufficient balance for any fee option" /* InsufficientBalanceForAnyFeeOption */
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
console.debug("auto selected option", selectedOption);
|
|
276
|
+
return { selectedOption, error: null };
|
|
277
|
+
}, [
|
|
278
|
+
userAddress,
|
|
279
|
+
pendingFeeOptionConfirmation.options,
|
|
280
|
+
isBalanceDetailsLoading,
|
|
281
|
+
isBalanceDetailsError,
|
|
282
|
+
combinedBalances
|
|
283
|
+
]);
|
|
284
|
+
return autoSelectedOption();
|
|
285
|
+
}
|
|
286
|
+
|
|
208
287
|
// src/react/hooks/useBalanceOfCollectible.tsx
|
|
209
|
-
|
|
288
|
+
import { queryOptions as queryOptions2, skipToken, useQuery as useQuery2 } from "@tanstack/react-query";
|
|
289
|
+
import { z as z2 } from "zod";
|
|
290
|
+
var fetchBalanceOfCollectibleSchema = z2.object({
|
|
210
291
|
collectionAddress: AddressSchema,
|
|
211
|
-
collectableId: CollectableIdSchema.pipe(
|
|
292
|
+
collectableId: CollectableIdSchema.pipe(z2.coerce.string()),
|
|
212
293
|
userAddress: AddressSchema,
|
|
213
|
-
chainId: ChainIdSchema.pipe(
|
|
294
|
+
chainId: ChainIdSchema.pipe(z2.coerce.number())
|
|
214
295
|
});
|
|
215
296
|
var fetchBalanceOfCollectible = async (args, config) => {
|
|
216
297
|
const parsedArgs = fetchBalanceOfCollectibleSchema.parse(args);
|
|
@@ -228,7 +309,7 @@ var fetchBalanceOfCollectible = async (args, config) => {
|
|
|
228
309
|
};
|
|
229
310
|
var balanceOfCollectibleOptions = (args, config) => {
|
|
230
311
|
const enabled = !!args.userAddress && (args.query?.enabled ?? true);
|
|
231
|
-
return
|
|
312
|
+
return queryOptions2({
|
|
232
313
|
...args.query,
|
|
233
314
|
queryKey: [...collectableKeys.userBalances, args],
|
|
234
315
|
queryFn: enabled ? () => fetchBalanceOfCollectible(
|
|
@@ -243,574 +324,574 @@ var balanceOfCollectibleOptions = (args, config) => {
|
|
|
243
324
|
});
|
|
244
325
|
};
|
|
245
326
|
var useBalanceOfCollectible = (args) => {
|
|
246
|
-
const config =
|
|
247
|
-
return
|
|
327
|
+
const config = useConfig();
|
|
328
|
+
return useQuery2(balanceOfCollectibleOptions(args, config));
|
|
248
329
|
};
|
|
249
330
|
|
|
250
331
|
// src/react/hooks/useCountOfCollectables.tsx
|
|
251
|
-
import { queryOptions as
|
|
252
|
-
import { z as
|
|
332
|
+
import { queryOptions as queryOptions3, useQuery as useQuery3 } from "@tanstack/react-query";
|
|
333
|
+
import { z as z4 } from "zod";
|
|
253
334
|
|
|
254
335
|
// src/react/_internal/api/zod-schema.ts
|
|
255
|
-
import { z as
|
|
256
|
-
var assetSchema =
|
|
257
|
-
id:
|
|
258
|
-
collectionId:
|
|
259
|
-
tokenId:
|
|
260
|
-
url:
|
|
261
|
-
metadataField:
|
|
262
|
-
name:
|
|
263
|
-
filesize:
|
|
264
|
-
mimeType:
|
|
265
|
-
width:
|
|
266
|
-
height:
|
|
267
|
-
updatedAt:
|
|
268
|
-
});
|
|
269
|
-
var sortOrderSchema =
|
|
270
|
-
var propertyTypeSchema =
|
|
271
|
-
var marketplaceKindSchema =
|
|
272
|
-
var orderbookKindSchema =
|
|
273
|
-
var sourceKindSchema =
|
|
274
|
-
var orderSideSchema =
|
|
275
|
-
var orderStatusSchema =
|
|
276
|
-
var contractTypeSchema =
|
|
277
|
-
var collectionStatusSchema =
|
|
278
|
-
var projectStatusSchema =
|
|
279
|
-
var collectibleStatusSchema =
|
|
280
|
-
var walletKindSchema =
|
|
281
|
-
var stepTypeSchema =
|
|
282
|
-
var transactionCryptoSchema =
|
|
283
|
-
var transactionNFTCheckoutProviderSchema =
|
|
336
|
+
import { z as z3 } from "zod";
|
|
337
|
+
var assetSchema = z3.object({
|
|
338
|
+
id: z3.number(),
|
|
339
|
+
collectionId: z3.number(),
|
|
340
|
+
tokenId: z3.string(),
|
|
341
|
+
url: z3.string().optional(),
|
|
342
|
+
metadataField: z3.string(),
|
|
343
|
+
name: z3.string().optional(),
|
|
344
|
+
filesize: z3.number().optional(),
|
|
345
|
+
mimeType: z3.string().optional(),
|
|
346
|
+
width: z3.number().optional(),
|
|
347
|
+
height: z3.number().optional(),
|
|
348
|
+
updatedAt: z3.string().optional()
|
|
349
|
+
});
|
|
350
|
+
var sortOrderSchema = z3.nativeEnum(SortOrder);
|
|
351
|
+
var propertyTypeSchema = z3.nativeEnum(PropertyType);
|
|
352
|
+
var marketplaceKindSchema = z3.nativeEnum(MarketplaceKind);
|
|
353
|
+
var orderbookKindSchema = z3.nativeEnum(OrderbookKind);
|
|
354
|
+
var sourceKindSchema = z3.nativeEnum(SourceKind);
|
|
355
|
+
var orderSideSchema = z3.nativeEnum(OrderSide);
|
|
356
|
+
var orderStatusSchema = z3.nativeEnum(OrderStatus);
|
|
357
|
+
var contractTypeSchema = z3.nativeEnum(ContractType);
|
|
358
|
+
var collectionStatusSchema = z3.nativeEnum(CollectionStatus);
|
|
359
|
+
var projectStatusSchema = z3.nativeEnum(ProjectStatus);
|
|
360
|
+
var collectibleStatusSchema = z3.nativeEnum(CollectibleStatus);
|
|
361
|
+
var walletKindSchema = z3.nativeEnum(WalletKind);
|
|
362
|
+
var stepTypeSchema = z3.nativeEnum(StepType);
|
|
363
|
+
var transactionCryptoSchema = z3.nativeEnum(TransactionCrypto);
|
|
364
|
+
var transactionNFTCheckoutProviderSchema = z3.nativeEnum(
|
|
284
365
|
TransactionNFTCheckoutProvider
|
|
285
366
|
);
|
|
286
|
-
var transactionOnRampProviderSchema =
|
|
367
|
+
var transactionOnRampProviderSchema = z3.nativeEnum(
|
|
287
368
|
TransactionOnRampProvider
|
|
288
369
|
);
|
|
289
|
-
var transactionSwapProviderSchema =
|
|
370
|
+
var transactionSwapProviderSchema = z3.nativeEnum(
|
|
290
371
|
TransactionSwapProvider
|
|
291
372
|
);
|
|
292
|
-
var executeTypeSchema =
|
|
293
|
-
var sortBySchema =
|
|
294
|
-
column:
|
|
373
|
+
var executeTypeSchema = z3.nativeEnum(ExecuteType);
|
|
374
|
+
var sortBySchema = z3.object({
|
|
375
|
+
column: z3.string(),
|
|
295
376
|
order: sortOrderSchema
|
|
296
377
|
});
|
|
297
|
-
var propertyFilterSchema =
|
|
298
|
-
name:
|
|
378
|
+
var propertyFilterSchema = z3.object({
|
|
379
|
+
name: z3.string(),
|
|
299
380
|
type: propertyTypeSchema,
|
|
300
|
-
min:
|
|
301
|
-
max:
|
|
302
|
-
values:
|
|
303
|
-
});
|
|
304
|
-
var collectiblesFilterSchema =
|
|
305
|
-
includeEmpty:
|
|
306
|
-
searchText:
|
|
307
|
-
properties:
|
|
308
|
-
marketplaces:
|
|
309
|
-
inAccounts:
|
|
310
|
-
notInAccounts:
|
|
311
|
-
ordersCreatedBy:
|
|
312
|
-
ordersNotCreatedBy:
|
|
313
|
-
});
|
|
314
|
-
var feeBreakdownSchema =
|
|
315
|
-
kind:
|
|
316
|
-
recipientAddress:
|
|
317
|
-
bps:
|
|
318
|
-
});
|
|
319
|
-
var orderFilterSchema =
|
|
320
|
-
createdBy:
|
|
321
|
-
marketplace:
|
|
322
|
-
currencies:
|
|
323
|
-
});
|
|
324
|
-
var collectionLastSyncedSchema =
|
|
325
|
-
allOrders:
|
|
326
|
-
newOrders:
|
|
327
|
-
});
|
|
328
|
-
var projectSchema =
|
|
329
|
-
projectId:
|
|
330
|
-
chainId:
|
|
331
|
-
contractAddress:
|
|
381
|
+
min: z3.number().optional(),
|
|
382
|
+
max: z3.number().optional(),
|
|
383
|
+
values: z3.array(z3.any()).optional()
|
|
384
|
+
});
|
|
385
|
+
var collectiblesFilterSchema = z3.object({
|
|
386
|
+
includeEmpty: z3.boolean(),
|
|
387
|
+
searchText: z3.string().optional(),
|
|
388
|
+
properties: z3.array(propertyFilterSchema).optional(),
|
|
389
|
+
marketplaces: z3.array(marketplaceKindSchema).optional(),
|
|
390
|
+
inAccounts: z3.array(z3.string()).optional(),
|
|
391
|
+
notInAccounts: z3.array(z3.string()).optional(),
|
|
392
|
+
ordersCreatedBy: z3.array(z3.string()).optional(),
|
|
393
|
+
ordersNotCreatedBy: z3.array(z3.string()).optional()
|
|
394
|
+
});
|
|
395
|
+
var feeBreakdownSchema = z3.object({
|
|
396
|
+
kind: z3.string(),
|
|
397
|
+
recipientAddress: z3.string(),
|
|
398
|
+
bps: z3.number()
|
|
399
|
+
});
|
|
400
|
+
var orderFilterSchema = z3.object({
|
|
401
|
+
createdBy: z3.array(z3.string()).optional(),
|
|
402
|
+
marketplace: z3.array(marketplaceKindSchema).optional(),
|
|
403
|
+
currencies: z3.array(z3.string()).optional()
|
|
404
|
+
});
|
|
405
|
+
var collectionLastSyncedSchema = z3.object({
|
|
406
|
+
allOrders: z3.string(),
|
|
407
|
+
newOrders: z3.string()
|
|
408
|
+
});
|
|
409
|
+
var projectSchema = z3.object({
|
|
410
|
+
projectId: z3.number(),
|
|
411
|
+
chainId: z3.number(),
|
|
412
|
+
contractAddress: z3.string(),
|
|
332
413
|
status: projectStatusSchema,
|
|
333
|
-
createdAt:
|
|
334
|
-
updatedAt:
|
|
335
|
-
deletedAt:
|
|
414
|
+
createdAt: z3.string(),
|
|
415
|
+
updatedAt: z3.string(),
|
|
416
|
+
deletedAt: z3.string().optional()
|
|
336
417
|
});
|
|
337
|
-
var collectibleSchema =
|
|
338
|
-
chainId:
|
|
339
|
-
contractAddress:
|
|
418
|
+
var collectibleSchema = z3.object({
|
|
419
|
+
chainId: z3.number(),
|
|
420
|
+
contractAddress: z3.string(),
|
|
340
421
|
status: collectibleStatusSchema,
|
|
341
|
-
tokenId:
|
|
342
|
-
createdAt:
|
|
343
|
-
updatedAt:
|
|
344
|
-
deletedAt:
|
|
345
|
-
});
|
|
346
|
-
var currencySchema =
|
|
347
|
-
chainId:
|
|
348
|
-
contractAddress:
|
|
349
|
-
name:
|
|
350
|
-
symbol:
|
|
351
|
-
decimals:
|
|
352
|
-
imageUrl:
|
|
353
|
-
exchangeRate:
|
|
354
|
-
defaultChainCurrency:
|
|
355
|
-
nativeCurrency:
|
|
356
|
-
createdAt:
|
|
357
|
-
updatedAt:
|
|
358
|
-
deletedAt:
|
|
359
|
-
});
|
|
360
|
-
var orderDataSchema =
|
|
361
|
-
orderId:
|
|
362
|
-
quantity:
|
|
363
|
-
});
|
|
364
|
-
var additionalFeeSchema =
|
|
365
|
-
amount:
|
|
366
|
-
receiver:
|
|
367
|
-
});
|
|
368
|
-
var postRequestSchema =
|
|
369
|
-
endpoint:
|
|
370
|
-
method:
|
|
371
|
-
body:
|
|
372
|
-
});
|
|
373
|
-
var createReqSchema =
|
|
374
|
-
tokenId:
|
|
375
|
-
quantity:
|
|
376
|
-
expiry:
|
|
377
|
-
currencyAddress:
|
|
378
|
-
pricePerToken:
|
|
379
|
-
});
|
|
380
|
-
var getOrdersInputSchema =
|
|
381
|
-
contractAddress:
|
|
382
|
-
orderId:
|
|
422
|
+
tokenId: z3.string(),
|
|
423
|
+
createdAt: z3.string(),
|
|
424
|
+
updatedAt: z3.string(),
|
|
425
|
+
deletedAt: z3.string().optional()
|
|
426
|
+
});
|
|
427
|
+
var currencySchema = z3.object({
|
|
428
|
+
chainId: z3.number(),
|
|
429
|
+
contractAddress: z3.string(),
|
|
430
|
+
name: z3.string(),
|
|
431
|
+
symbol: z3.string(),
|
|
432
|
+
decimals: z3.number(),
|
|
433
|
+
imageUrl: z3.string(),
|
|
434
|
+
exchangeRate: z3.number(),
|
|
435
|
+
defaultChainCurrency: z3.boolean(),
|
|
436
|
+
nativeCurrency: z3.boolean(),
|
|
437
|
+
createdAt: z3.string(),
|
|
438
|
+
updatedAt: z3.string(),
|
|
439
|
+
deletedAt: z3.string().optional()
|
|
440
|
+
});
|
|
441
|
+
var orderDataSchema = z3.object({
|
|
442
|
+
orderId: z3.string(),
|
|
443
|
+
quantity: z3.string()
|
|
444
|
+
});
|
|
445
|
+
var additionalFeeSchema = z3.object({
|
|
446
|
+
amount: z3.string(),
|
|
447
|
+
receiver: z3.string()
|
|
448
|
+
});
|
|
449
|
+
var postRequestSchema = z3.object({
|
|
450
|
+
endpoint: z3.string(),
|
|
451
|
+
method: z3.string(),
|
|
452
|
+
body: z3.any()
|
|
453
|
+
});
|
|
454
|
+
var createReqSchema = z3.object({
|
|
455
|
+
tokenId: z3.string(),
|
|
456
|
+
quantity: z3.string(),
|
|
457
|
+
expiry: z3.string(),
|
|
458
|
+
currencyAddress: z3.string(),
|
|
459
|
+
pricePerToken: z3.string()
|
|
460
|
+
});
|
|
461
|
+
var getOrdersInputSchema = z3.object({
|
|
462
|
+
contractAddress: z3.string(),
|
|
463
|
+
orderId: z3.string(),
|
|
383
464
|
marketplace: marketplaceKindSchema
|
|
384
465
|
});
|
|
385
|
-
var domainSchema =
|
|
386
|
-
name:
|
|
387
|
-
version:
|
|
388
|
-
chainId:
|
|
389
|
-
verifyingContract:
|
|
466
|
+
var domainSchema = z3.object({
|
|
467
|
+
name: z3.string(),
|
|
468
|
+
version: z3.string(),
|
|
469
|
+
chainId: z3.number(),
|
|
470
|
+
verifyingContract: z3.string()
|
|
390
471
|
});
|
|
391
|
-
var checkoutOptionsMarketplaceOrderSchema =
|
|
392
|
-
contractAddress:
|
|
393
|
-
orderId:
|
|
472
|
+
var checkoutOptionsMarketplaceOrderSchema = z3.object({
|
|
473
|
+
contractAddress: z3.string(),
|
|
474
|
+
orderId: z3.string(),
|
|
394
475
|
marketplace: marketplaceKindSchema
|
|
395
476
|
});
|
|
396
|
-
var checkoutOptionsItemSchema =
|
|
397
|
-
tokenId:
|
|
398
|
-
quantity:
|
|
477
|
+
var checkoutOptionsItemSchema = z3.object({
|
|
478
|
+
tokenId: z3.string(),
|
|
479
|
+
quantity: z3.string()
|
|
399
480
|
});
|
|
400
|
-
var checkoutOptionsSchema =
|
|
481
|
+
var checkoutOptionsSchema = z3.object({
|
|
401
482
|
crypto: transactionCryptoSchema,
|
|
402
|
-
swap:
|
|
403
|
-
nftCheckout:
|
|
404
|
-
onRamp:
|
|
483
|
+
swap: z3.array(transactionSwapProviderSchema),
|
|
484
|
+
nftCheckout: z3.array(transactionNFTCheckoutProviderSchema),
|
|
485
|
+
onRamp: z3.array(transactionOnRampProviderSchema)
|
|
405
486
|
});
|
|
406
|
-
var listCurrenciesArgsSchema =
|
|
407
|
-
var listCurrenciesReturnSchema =
|
|
408
|
-
currencies:
|
|
487
|
+
var listCurrenciesArgsSchema = z3.object({});
|
|
488
|
+
var listCurrenciesReturnSchema = z3.object({
|
|
489
|
+
currencies: z3.array(currencySchema)
|
|
409
490
|
});
|
|
410
|
-
var getCollectibleArgsSchema =
|
|
411
|
-
contractAddress:
|
|
412
|
-
tokenId:
|
|
491
|
+
var getCollectibleArgsSchema = z3.object({
|
|
492
|
+
contractAddress: z3.string(),
|
|
493
|
+
tokenId: z3.string()
|
|
413
494
|
});
|
|
414
|
-
var getLowestPriceOfferForCollectibleArgsSchema =
|
|
415
|
-
contractAddress:
|
|
416
|
-
tokenId:
|
|
495
|
+
var getLowestPriceOfferForCollectibleArgsSchema = z3.object({
|
|
496
|
+
contractAddress: z3.string(),
|
|
497
|
+
tokenId: z3.string(),
|
|
417
498
|
filter: orderFilterSchema.optional()
|
|
418
499
|
});
|
|
419
|
-
var getHighestPriceOfferForCollectibleArgsSchema =
|
|
420
|
-
contractAddress:
|
|
421
|
-
tokenId:
|
|
500
|
+
var getHighestPriceOfferForCollectibleArgsSchema = z3.object({
|
|
501
|
+
contractAddress: z3.string(),
|
|
502
|
+
tokenId: z3.string(),
|
|
422
503
|
filter: orderFilterSchema.optional()
|
|
423
504
|
});
|
|
424
|
-
var getLowestPriceListingForCollectibleArgsSchema =
|
|
425
|
-
contractAddress:
|
|
426
|
-
tokenId:
|
|
505
|
+
var getLowestPriceListingForCollectibleArgsSchema = z3.object({
|
|
506
|
+
contractAddress: z3.string(),
|
|
507
|
+
tokenId: z3.string(),
|
|
427
508
|
filter: orderFilterSchema.optional()
|
|
428
509
|
});
|
|
429
|
-
var getHighestPriceListingForCollectibleArgsSchema =
|
|
430
|
-
contractAddress:
|
|
431
|
-
tokenId:
|
|
510
|
+
var getHighestPriceListingForCollectibleArgsSchema = z3.object({
|
|
511
|
+
contractAddress: z3.string(),
|
|
512
|
+
tokenId: z3.string(),
|
|
432
513
|
filter: orderFilterSchema.optional()
|
|
433
514
|
});
|
|
434
|
-
var getCollectibleLowestOfferArgsSchema =
|
|
435
|
-
contractAddress:
|
|
436
|
-
tokenId:
|
|
515
|
+
var getCollectibleLowestOfferArgsSchema = z3.object({
|
|
516
|
+
contractAddress: z3.string(),
|
|
517
|
+
tokenId: z3.string(),
|
|
437
518
|
filter: orderFilterSchema.optional()
|
|
438
519
|
});
|
|
439
|
-
var getCollectibleHighestOfferArgsSchema =
|
|
440
|
-
contractAddress:
|
|
441
|
-
tokenId:
|
|
520
|
+
var getCollectibleHighestOfferArgsSchema = z3.object({
|
|
521
|
+
contractAddress: z3.string(),
|
|
522
|
+
tokenId: z3.string(),
|
|
442
523
|
filter: orderFilterSchema.optional()
|
|
443
524
|
});
|
|
444
|
-
var getCollectibleLowestListingArgsSchema =
|
|
445
|
-
contractAddress:
|
|
446
|
-
tokenId:
|
|
525
|
+
var getCollectibleLowestListingArgsSchema = z3.object({
|
|
526
|
+
contractAddress: z3.string(),
|
|
527
|
+
tokenId: z3.string(),
|
|
447
528
|
filters: orderFilterSchema.optional()
|
|
448
529
|
});
|
|
449
|
-
var getCollectibleHighestListingArgsSchema =
|
|
450
|
-
contractAddress:
|
|
451
|
-
tokenId:
|
|
530
|
+
var getCollectibleHighestListingArgsSchema = z3.object({
|
|
531
|
+
contractAddress: z3.string(),
|
|
532
|
+
tokenId: z3.string(),
|
|
452
533
|
filter: orderFilterSchema.optional()
|
|
453
534
|
});
|
|
454
|
-
var generateBuyTransactionArgsSchema =
|
|
455
|
-
collectionAddress:
|
|
456
|
-
buyer:
|
|
535
|
+
var generateBuyTransactionArgsSchema = z3.object({
|
|
536
|
+
collectionAddress: z3.string(),
|
|
537
|
+
buyer: z3.string(),
|
|
457
538
|
marketplace: marketplaceKindSchema,
|
|
458
|
-
ordersData:
|
|
459
|
-
additionalFees:
|
|
539
|
+
ordersData: z3.array(orderDataSchema),
|
|
540
|
+
additionalFees: z3.array(additionalFeeSchema),
|
|
460
541
|
walletType: walletKindSchema.optional()
|
|
461
542
|
});
|
|
462
|
-
var generateSellTransactionArgsSchema =
|
|
463
|
-
collectionAddress:
|
|
464
|
-
seller:
|
|
543
|
+
var generateSellTransactionArgsSchema = z3.object({
|
|
544
|
+
collectionAddress: z3.string(),
|
|
545
|
+
seller: z3.string(),
|
|
465
546
|
marketplace: marketplaceKindSchema,
|
|
466
|
-
ordersData:
|
|
467
|
-
additionalFees:
|
|
547
|
+
ordersData: z3.array(orderDataSchema),
|
|
548
|
+
additionalFees: z3.array(additionalFeeSchema),
|
|
468
549
|
walletType: walletKindSchema.optional()
|
|
469
550
|
});
|
|
470
|
-
var generateListingTransactionArgsSchema =
|
|
471
|
-
collectionAddress:
|
|
472
|
-
owner:
|
|
551
|
+
var generateListingTransactionArgsSchema = z3.object({
|
|
552
|
+
collectionAddress: z3.string(),
|
|
553
|
+
owner: z3.string(),
|
|
473
554
|
contractType: contractTypeSchema,
|
|
474
555
|
orderbook: orderbookKindSchema,
|
|
475
556
|
listing: createReqSchema,
|
|
476
557
|
walletType: walletKindSchema.optional()
|
|
477
558
|
});
|
|
478
|
-
var generateOfferTransactionArgsSchema =
|
|
479
|
-
collectionAddress:
|
|
480
|
-
maker:
|
|
559
|
+
var generateOfferTransactionArgsSchema = z3.object({
|
|
560
|
+
collectionAddress: z3.string(),
|
|
561
|
+
maker: z3.string(),
|
|
481
562
|
contractType: contractTypeSchema,
|
|
482
563
|
orderbook: orderbookKindSchema,
|
|
483
564
|
offer: createReqSchema,
|
|
484
565
|
walletType: walletKindSchema.optional()
|
|
485
566
|
});
|
|
486
|
-
var executeArgsSchema =
|
|
487
|
-
signature:
|
|
567
|
+
var executeArgsSchema = z3.object({
|
|
568
|
+
signature: z3.string(),
|
|
488
569
|
executeType: executeTypeSchema,
|
|
489
|
-
body:
|
|
570
|
+
body: z3.any()
|
|
490
571
|
});
|
|
491
|
-
var executeReturnSchema =
|
|
492
|
-
orderId:
|
|
572
|
+
var executeReturnSchema = z3.object({
|
|
573
|
+
orderId: z3.string()
|
|
493
574
|
});
|
|
494
|
-
var getCountOfAllCollectiblesArgsSchema =
|
|
495
|
-
contractAddress:
|
|
575
|
+
var getCountOfAllCollectiblesArgsSchema = z3.object({
|
|
576
|
+
contractAddress: z3.string()
|
|
496
577
|
});
|
|
497
|
-
var getCountOfAllCollectiblesReturnSchema =
|
|
498
|
-
count:
|
|
578
|
+
var getCountOfAllCollectiblesReturnSchema = z3.object({
|
|
579
|
+
count: z3.number()
|
|
499
580
|
});
|
|
500
|
-
var getCountOfFilteredCollectiblesArgsSchema =
|
|
581
|
+
var getCountOfFilteredCollectiblesArgsSchema = z3.object({
|
|
501
582
|
side: orderSideSchema,
|
|
502
|
-
contractAddress:
|
|
583
|
+
contractAddress: z3.string(),
|
|
503
584
|
filter: collectiblesFilterSchema.optional()
|
|
504
585
|
});
|
|
505
|
-
var getCountOfFilteredCollectiblesReturnSchema =
|
|
506
|
-
count:
|
|
586
|
+
var getCountOfFilteredCollectiblesReturnSchema = z3.object({
|
|
587
|
+
count: z3.number()
|
|
507
588
|
});
|
|
508
|
-
var getFloorOrderArgsSchema =
|
|
509
|
-
contractAddress:
|
|
589
|
+
var getFloorOrderArgsSchema = z3.object({
|
|
590
|
+
contractAddress: z3.string(),
|
|
510
591
|
filter: collectiblesFilterSchema.optional()
|
|
511
592
|
});
|
|
512
|
-
var syncOrderReturnSchema =
|
|
513
|
-
var syncOrdersReturnSchema =
|
|
514
|
-
var checkoutOptionsMarketplaceArgsSchema =
|
|
515
|
-
wallet:
|
|
516
|
-
orders:
|
|
517
|
-
additionalFee:
|
|
593
|
+
var syncOrderReturnSchema = z3.object({});
|
|
594
|
+
var syncOrdersReturnSchema = z3.object({});
|
|
595
|
+
var checkoutOptionsMarketplaceArgsSchema = z3.object({
|
|
596
|
+
wallet: z3.string(),
|
|
597
|
+
orders: z3.array(checkoutOptionsMarketplaceOrderSchema),
|
|
598
|
+
additionalFee: z3.number()
|
|
518
599
|
});
|
|
519
|
-
var checkoutOptionsMarketplaceReturnSchema =
|
|
600
|
+
var checkoutOptionsMarketplaceReturnSchema = z3.object({
|
|
520
601
|
options: checkoutOptionsSchema
|
|
521
602
|
});
|
|
522
|
-
var checkoutOptionsSalesContractArgsSchema =
|
|
523
|
-
wallet:
|
|
524
|
-
contractAddress:
|
|
525
|
-
collectionAddress:
|
|
526
|
-
items:
|
|
603
|
+
var checkoutOptionsSalesContractArgsSchema = z3.object({
|
|
604
|
+
wallet: z3.string(),
|
|
605
|
+
contractAddress: z3.string(),
|
|
606
|
+
collectionAddress: z3.string(),
|
|
607
|
+
items: z3.array(checkoutOptionsItemSchema)
|
|
527
608
|
});
|
|
528
|
-
var checkoutOptionsSalesContractReturnSchema =
|
|
609
|
+
var checkoutOptionsSalesContractReturnSchema = z3.object({
|
|
529
610
|
options: checkoutOptionsSchema
|
|
530
611
|
});
|
|
531
|
-
var countListingsForCollectibleArgsSchema =
|
|
532
|
-
contractAddress:
|
|
533
|
-
tokenId:
|
|
612
|
+
var countListingsForCollectibleArgsSchema = z3.object({
|
|
613
|
+
contractAddress: z3.string(),
|
|
614
|
+
tokenId: z3.string(),
|
|
534
615
|
filter: orderFilterSchema.optional()
|
|
535
616
|
});
|
|
536
|
-
var countListingsForCollectibleReturnSchema =
|
|
537
|
-
count:
|
|
617
|
+
var countListingsForCollectibleReturnSchema = z3.object({
|
|
618
|
+
count: z3.number()
|
|
538
619
|
});
|
|
539
|
-
var countOffersForCollectibleArgsSchema =
|
|
540
|
-
contractAddress:
|
|
541
|
-
tokenId:
|
|
620
|
+
var countOffersForCollectibleArgsSchema = z3.object({
|
|
621
|
+
contractAddress: z3.string(),
|
|
622
|
+
tokenId: z3.string(),
|
|
542
623
|
filter: orderFilterSchema.optional()
|
|
543
624
|
});
|
|
544
|
-
var countOffersForCollectibleReturnSchema =
|
|
545
|
-
count:
|
|
546
|
-
});
|
|
547
|
-
var tokenMetadataSchema =
|
|
548
|
-
tokenId:
|
|
549
|
-
name:
|
|
550
|
-
description:
|
|
551
|
-
image:
|
|
552
|
-
video:
|
|
553
|
-
audio:
|
|
554
|
-
properties:
|
|
555
|
-
attributes:
|
|
556
|
-
image_data:
|
|
557
|
-
external_url:
|
|
558
|
-
background_color:
|
|
559
|
-
animation_url:
|
|
560
|
-
decimals:
|
|
561
|
-
updatedAt:
|
|
562
|
-
assets:
|
|
563
|
-
});
|
|
564
|
-
var pageSchema =
|
|
565
|
-
page:
|
|
566
|
-
pageSize:
|
|
567
|
-
more:
|
|
568
|
-
sort:
|
|
569
|
-
});
|
|
570
|
-
var
|
|
571
|
-
text:
|
|
572
|
-
properties:
|
|
573
|
-
});
|
|
574
|
-
var orderSchema =
|
|
575
|
-
orderId:
|
|
625
|
+
var countOffersForCollectibleReturnSchema = z3.object({
|
|
626
|
+
count: z3.number()
|
|
627
|
+
});
|
|
628
|
+
var tokenMetadataSchema = z3.object({
|
|
629
|
+
tokenId: z3.string(),
|
|
630
|
+
name: z3.string(),
|
|
631
|
+
description: z3.string().optional(),
|
|
632
|
+
image: z3.string().optional(),
|
|
633
|
+
video: z3.string().optional(),
|
|
634
|
+
audio: z3.string().optional(),
|
|
635
|
+
properties: z3.record(z3.any()).optional(),
|
|
636
|
+
attributes: z3.array(z3.record(z3.any())),
|
|
637
|
+
image_data: z3.string().optional(),
|
|
638
|
+
external_url: z3.string().optional(),
|
|
639
|
+
background_color: z3.string().optional(),
|
|
640
|
+
animation_url: z3.string().optional(),
|
|
641
|
+
decimals: z3.number().optional(),
|
|
642
|
+
updatedAt: z3.string().optional(),
|
|
643
|
+
assets: z3.array(assetSchema).optional()
|
|
644
|
+
});
|
|
645
|
+
var pageSchema = z3.object({
|
|
646
|
+
page: z3.number(),
|
|
647
|
+
pageSize: z3.number(),
|
|
648
|
+
more: z3.boolean().optional(),
|
|
649
|
+
sort: z3.array(sortBySchema).optional()
|
|
650
|
+
});
|
|
651
|
+
var filterSchema2 = z3.object({
|
|
652
|
+
text: z3.string().optional(),
|
|
653
|
+
properties: z3.array(propertyFilterSchema).optional()
|
|
654
|
+
});
|
|
655
|
+
var orderSchema = z3.object({
|
|
656
|
+
orderId: z3.string(),
|
|
576
657
|
marketplace: marketplaceKindSchema,
|
|
577
658
|
side: orderSideSchema,
|
|
578
659
|
status: orderStatusSchema,
|
|
579
|
-
chainId:
|
|
580
|
-
collectionContractAddress:
|
|
581
|
-
tokenId:
|
|
582
|
-
createdBy:
|
|
583
|
-
priceAmount:
|
|
584
|
-
priceAmountFormatted:
|
|
585
|
-
priceAmountNet:
|
|
586
|
-
priceAmountNetFormatted:
|
|
587
|
-
priceCurrencyAddress:
|
|
588
|
-
priceDecimals:
|
|
589
|
-
priceUSD:
|
|
590
|
-
quantityInitial:
|
|
591
|
-
quantityInitialFormatted:
|
|
592
|
-
quantityRemaining:
|
|
593
|
-
quantityRemainingFormatted:
|
|
594
|
-
quantityAvailable:
|
|
595
|
-
quantityAvailableFormatted:
|
|
596
|
-
quantityDecimals:
|
|
597
|
-
feeBps:
|
|
598
|
-
feeBreakdown:
|
|
599
|
-
validFrom:
|
|
600
|
-
validUntil:
|
|
601
|
-
blockNumber:
|
|
602
|
-
orderCreatedAt:
|
|
603
|
-
orderUpdatedAt:
|
|
604
|
-
createdAt:
|
|
605
|
-
updatedAt:
|
|
606
|
-
deletedAt:
|
|
607
|
-
});
|
|
608
|
-
var collectibleOrderSchema =
|
|
660
|
+
chainId: z3.number(),
|
|
661
|
+
collectionContractAddress: z3.string(),
|
|
662
|
+
tokenId: z3.string(),
|
|
663
|
+
createdBy: z3.string(),
|
|
664
|
+
priceAmount: z3.string(),
|
|
665
|
+
priceAmountFormatted: z3.string(),
|
|
666
|
+
priceAmountNet: z3.string(),
|
|
667
|
+
priceAmountNetFormatted: z3.string(),
|
|
668
|
+
priceCurrencyAddress: z3.string(),
|
|
669
|
+
priceDecimals: z3.number(),
|
|
670
|
+
priceUSD: z3.number(),
|
|
671
|
+
quantityInitial: z3.string(),
|
|
672
|
+
quantityInitialFormatted: z3.string(),
|
|
673
|
+
quantityRemaining: z3.string(),
|
|
674
|
+
quantityRemainingFormatted: z3.string(),
|
|
675
|
+
quantityAvailable: z3.string(),
|
|
676
|
+
quantityAvailableFormatted: z3.string(),
|
|
677
|
+
quantityDecimals: z3.number(),
|
|
678
|
+
feeBps: z3.number(),
|
|
679
|
+
feeBreakdown: z3.array(feeBreakdownSchema),
|
|
680
|
+
validFrom: z3.string(),
|
|
681
|
+
validUntil: z3.string(),
|
|
682
|
+
blockNumber: z3.number(),
|
|
683
|
+
orderCreatedAt: z3.string().optional(),
|
|
684
|
+
orderUpdatedAt: z3.string().optional(),
|
|
685
|
+
createdAt: z3.string(),
|
|
686
|
+
updatedAt: z3.string(),
|
|
687
|
+
deletedAt: z3.string().optional()
|
|
688
|
+
});
|
|
689
|
+
var collectibleOrderSchema = z3.object({
|
|
609
690
|
metadata: tokenMetadataSchema,
|
|
610
691
|
order: orderSchema.optional()
|
|
611
692
|
});
|
|
612
|
-
var activitySchema =
|
|
613
|
-
type:
|
|
614
|
-
fromAddress:
|
|
615
|
-
toAddress:
|
|
616
|
-
txHash:
|
|
617
|
-
timestamp:
|
|
618
|
-
tokenId:
|
|
619
|
-
tokenImage:
|
|
620
|
-
tokenName:
|
|
693
|
+
var activitySchema = z3.object({
|
|
694
|
+
type: z3.string(),
|
|
695
|
+
fromAddress: z3.string(),
|
|
696
|
+
toAddress: z3.string(),
|
|
697
|
+
txHash: z3.string(),
|
|
698
|
+
timestamp: z3.number(),
|
|
699
|
+
tokenId: z3.string(),
|
|
700
|
+
tokenImage: z3.string(),
|
|
701
|
+
tokenName: z3.string(),
|
|
621
702
|
currency: currencySchema.optional()
|
|
622
703
|
});
|
|
623
|
-
var collectionConfigSchema =
|
|
624
|
-
lastSynced:
|
|
625
|
-
collectiblesSynced:
|
|
704
|
+
var collectionConfigSchema = z3.object({
|
|
705
|
+
lastSynced: z3.record(collectionLastSyncedSchema),
|
|
706
|
+
collectiblesSynced: z3.string()
|
|
626
707
|
});
|
|
627
|
-
var signatureSchema =
|
|
708
|
+
var signatureSchema = z3.object({
|
|
628
709
|
domain: domainSchema,
|
|
629
|
-
types:
|
|
630
|
-
primaryType:
|
|
631
|
-
value:
|
|
710
|
+
types: z3.any(),
|
|
711
|
+
primaryType: z3.string(),
|
|
712
|
+
value: z3.any()
|
|
632
713
|
});
|
|
633
|
-
var getCollectibleReturnSchema =
|
|
714
|
+
var getCollectibleReturnSchema = z3.object({
|
|
634
715
|
metadata: tokenMetadataSchema
|
|
635
716
|
});
|
|
636
|
-
var getLowestPriceOfferForCollectibleReturnSchema =
|
|
717
|
+
var getLowestPriceOfferForCollectibleReturnSchema = z3.object({
|
|
637
718
|
order: orderSchema
|
|
638
719
|
});
|
|
639
|
-
var getHighestPriceOfferForCollectibleReturnSchema =
|
|
720
|
+
var getHighestPriceOfferForCollectibleReturnSchema = z3.object({
|
|
640
721
|
order: orderSchema
|
|
641
722
|
});
|
|
642
|
-
var getLowestPriceListingForCollectibleReturnSchema =
|
|
723
|
+
var getLowestPriceListingForCollectibleReturnSchema = z3.object({
|
|
643
724
|
order: orderSchema
|
|
644
725
|
});
|
|
645
|
-
var getHighestPriceListingForCollectibleReturnSchema =
|
|
726
|
+
var getHighestPriceListingForCollectibleReturnSchema = z3.object({
|
|
646
727
|
order: orderSchema
|
|
647
728
|
});
|
|
648
|
-
var listListingsForCollectibleArgsSchema =
|
|
649
|
-
contractAddress:
|
|
650
|
-
tokenId:
|
|
729
|
+
var listListingsForCollectibleArgsSchema = z3.object({
|
|
730
|
+
contractAddress: z3.string(),
|
|
731
|
+
tokenId: z3.string(),
|
|
651
732
|
filter: orderFilterSchema.optional(),
|
|
652
733
|
page: pageSchema.optional()
|
|
653
734
|
});
|
|
654
|
-
var listListingsForCollectibleReturnSchema =
|
|
655
|
-
listings:
|
|
735
|
+
var listListingsForCollectibleReturnSchema = z3.object({
|
|
736
|
+
listings: z3.array(orderSchema),
|
|
656
737
|
page: pageSchema.optional()
|
|
657
738
|
});
|
|
658
|
-
var listOffersForCollectibleArgsSchema =
|
|
659
|
-
contractAddress:
|
|
660
|
-
tokenId:
|
|
739
|
+
var listOffersForCollectibleArgsSchema = z3.object({
|
|
740
|
+
contractAddress: z3.string(),
|
|
741
|
+
tokenId: z3.string(),
|
|
661
742
|
filter: orderFilterSchema.optional(),
|
|
662
743
|
page: pageSchema.optional()
|
|
663
744
|
});
|
|
664
|
-
var listOffersForCollectibleReturnSchema =
|
|
665
|
-
offers:
|
|
745
|
+
var listOffersForCollectibleReturnSchema = z3.object({
|
|
746
|
+
offers: z3.array(orderSchema),
|
|
666
747
|
page: pageSchema.optional()
|
|
667
748
|
});
|
|
668
|
-
var getListCollectibleActivitiesArgsSchema =
|
|
669
|
-
chainId: ChainIdSchema.pipe(
|
|
749
|
+
var getListCollectibleActivitiesArgsSchema = z3.object({
|
|
750
|
+
chainId: ChainIdSchema.pipe(z3.coerce.string()),
|
|
670
751
|
collectionAddress: AddressSchema,
|
|
671
|
-
tokenId: CollectableIdSchema.pipe(
|
|
752
|
+
tokenId: CollectableIdSchema.pipe(z3.coerce.string()),
|
|
672
753
|
query: pageSchema.extend({
|
|
673
|
-
enabled:
|
|
754
|
+
enabled: z3.boolean().optional()
|
|
674
755
|
}).optional()
|
|
675
756
|
});
|
|
676
|
-
var getListCollectibleActivitiesReturnSchema =
|
|
677
|
-
activities:
|
|
757
|
+
var getListCollectibleActivitiesReturnSchema = z3.object({
|
|
758
|
+
activities: z3.array(activitySchema),
|
|
678
759
|
page: pageSchema.optional()
|
|
679
760
|
});
|
|
680
|
-
var getListCollectionActivitiesArgsSchema =
|
|
681
|
-
chainId: ChainIdSchema.pipe(
|
|
761
|
+
var getListCollectionActivitiesArgsSchema = z3.object({
|
|
762
|
+
chainId: ChainIdSchema.pipe(z3.coerce.string()),
|
|
682
763
|
collectionAddress: AddressSchema,
|
|
683
764
|
query: pageSchema.extend({
|
|
684
|
-
enabled:
|
|
765
|
+
enabled: z3.boolean().optional()
|
|
685
766
|
}).optional()
|
|
686
767
|
});
|
|
687
|
-
var getListCollectionActivitiesReturnSchema =
|
|
688
|
-
activities:
|
|
768
|
+
var getListCollectionActivitiesReturnSchema = z3.object({
|
|
769
|
+
activities: z3.array(activitySchema),
|
|
689
770
|
page: pageSchema.optional()
|
|
690
771
|
});
|
|
691
|
-
var getCollectibleLowestOfferReturnSchema =
|
|
772
|
+
var getCollectibleLowestOfferReturnSchema = z3.object({
|
|
692
773
|
order: orderSchema.optional()
|
|
693
774
|
});
|
|
694
|
-
var getCollectibleHighestOfferReturnSchema =
|
|
775
|
+
var getCollectibleHighestOfferReturnSchema = z3.object({
|
|
695
776
|
order: orderSchema.optional()
|
|
696
777
|
});
|
|
697
|
-
var getCollectibleLowestListingReturnSchema =
|
|
778
|
+
var getCollectibleLowestListingReturnSchema = z3.object({
|
|
698
779
|
order: orderSchema.optional()
|
|
699
780
|
});
|
|
700
|
-
var getCollectibleHighestListingReturnSchema =
|
|
781
|
+
var getCollectibleHighestListingReturnSchema = z3.object({
|
|
701
782
|
order: orderSchema.optional()
|
|
702
783
|
});
|
|
703
|
-
var listCollectibleListingsArgsSchema =
|
|
704
|
-
contractAddress:
|
|
705
|
-
tokenId:
|
|
784
|
+
var listCollectibleListingsArgsSchema = z3.object({
|
|
785
|
+
contractAddress: z3.string(),
|
|
786
|
+
tokenId: z3.string(),
|
|
706
787
|
filter: orderFilterSchema.optional(),
|
|
707
788
|
page: pageSchema.optional()
|
|
708
789
|
});
|
|
709
|
-
var listCollectibleListingsReturnSchema =
|
|
710
|
-
listings:
|
|
790
|
+
var listCollectibleListingsReturnSchema = z3.object({
|
|
791
|
+
listings: z3.array(orderSchema),
|
|
711
792
|
page: pageSchema.optional()
|
|
712
793
|
});
|
|
713
|
-
var listCollectibleOffersArgsSchema =
|
|
714
|
-
contractAddress:
|
|
715
|
-
tokenId:
|
|
794
|
+
var listCollectibleOffersArgsSchema = z3.object({
|
|
795
|
+
contractAddress: z3.string(),
|
|
796
|
+
tokenId: z3.string(),
|
|
716
797
|
filter: orderFilterSchema.optional(),
|
|
717
798
|
page: pageSchema.optional()
|
|
718
799
|
});
|
|
719
|
-
var listCollectibleOffersReturnSchema =
|
|
720
|
-
offers:
|
|
800
|
+
var listCollectibleOffersReturnSchema = z3.object({
|
|
801
|
+
offers: z3.array(orderSchema),
|
|
721
802
|
page: pageSchema.optional()
|
|
722
803
|
});
|
|
723
|
-
var listCollectiblesArgsSchema =
|
|
804
|
+
var listCollectiblesArgsSchema = z3.object({
|
|
724
805
|
side: orderSideSchema,
|
|
725
|
-
contractAddress:
|
|
806
|
+
contractAddress: z3.string(),
|
|
726
807
|
filter: collectiblesFilterSchema.optional(),
|
|
727
808
|
page: pageSchema.optional()
|
|
728
809
|
});
|
|
729
|
-
var listCollectiblesReturnSchema =
|
|
730
|
-
collectibles:
|
|
810
|
+
var listCollectiblesReturnSchema = z3.object({
|
|
811
|
+
collectibles: z3.array(collectibleOrderSchema),
|
|
731
812
|
page: pageSchema.optional()
|
|
732
813
|
});
|
|
733
|
-
var getFloorOrderReturnSchema =
|
|
814
|
+
var getFloorOrderReturnSchema = z3.object({
|
|
734
815
|
collectible: collectibleOrderSchema
|
|
735
816
|
});
|
|
736
|
-
var listCollectiblesWithLowestListingArgsSchema =
|
|
737
|
-
contractAddress:
|
|
817
|
+
var listCollectiblesWithLowestListingArgsSchema = z3.object({
|
|
818
|
+
contractAddress: z3.string(),
|
|
738
819
|
filter: collectiblesFilterSchema.optional(),
|
|
739
820
|
page: pageSchema.optional()
|
|
740
821
|
});
|
|
741
|
-
var listCollectiblesWithLowestListingReturnSchema =
|
|
742
|
-
collectibles:
|
|
822
|
+
var listCollectiblesWithLowestListingReturnSchema = z3.object({
|
|
823
|
+
collectibles: z3.array(collectibleOrderSchema),
|
|
743
824
|
page: pageSchema.optional()
|
|
744
825
|
});
|
|
745
|
-
var listCollectiblesWithHighestOfferArgsSchema =
|
|
746
|
-
contractAddress:
|
|
826
|
+
var listCollectiblesWithHighestOfferArgsSchema = z3.object({
|
|
827
|
+
contractAddress: z3.string(),
|
|
747
828
|
filter: collectiblesFilterSchema.optional(),
|
|
748
829
|
page: pageSchema.optional()
|
|
749
830
|
});
|
|
750
|
-
var listCollectiblesWithHighestOfferReturnSchema =
|
|
751
|
-
collectibles:
|
|
831
|
+
var listCollectiblesWithHighestOfferReturnSchema = z3.object({
|
|
832
|
+
collectibles: z3.array(collectibleOrderSchema),
|
|
752
833
|
page: pageSchema.optional()
|
|
753
834
|
});
|
|
754
|
-
var syncOrderArgsSchema =
|
|
835
|
+
var syncOrderArgsSchema = z3.object({
|
|
755
836
|
order: orderSchema
|
|
756
837
|
});
|
|
757
|
-
var syncOrdersArgsSchema =
|
|
758
|
-
orders:
|
|
838
|
+
var syncOrdersArgsSchema = z3.object({
|
|
839
|
+
orders: z3.array(orderSchema)
|
|
759
840
|
});
|
|
760
|
-
var getOrdersArgsSchema =
|
|
761
|
-
input:
|
|
841
|
+
var getOrdersArgsSchema = z3.object({
|
|
842
|
+
input: z3.array(getOrdersInputSchema),
|
|
762
843
|
page: pageSchema.optional()
|
|
763
844
|
});
|
|
764
|
-
var getOrdersReturnSchema =
|
|
765
|
-
orders:
|
|
845
|
+
var getOrdersReturnSchema = z3.object({
|
|
846
|
+
orders: z3.array(orderSchema),
|
|
766
847
|
page: pageSchema.optional()
|
|
767
848
|
});
|
|
768
|
-
var collectionSchema =
|
|
849
|
+
var collectionSchema = z3.object({
|
|
769
850
|
status: collectionStatusSchema,
|
|
770
|
-
chainId:
|
|
771
|
-
contractAddress:
|
|
851
|
+
chainId: z3.number(),
|
|
852
|
+
contractAddress: z3.string(),
|
|
772
853
|
contractType: contractTypeSchema,
|
|
773
|
-
tokenQuantityDecimals:
|
|
854
|
+
tokenQuantityDecimals: z3.number(),
|
|
774
855
|
config: collectionConfigSchema,
|
|
775
|
-
createdAt:
|
|
776
|
-
updatedAt:
|
|
777
|
-
deletedAt:
|
|
856
|
+
createdAt: z3.string(),
|
|
857
|
+
updatedAt: z3.string(),
|
|
858
|
+
deletedAt: z3.string().optional()
|
|
778
859
|
});
|
|
779
|
-
var stepSchema =
|
|
860
|
+
var stepSchema = z3.object({
|
|
780
861
|
id: stepTypeSchema,
|
|
781
|
-
data:
|
|
782
|
-
to:
|
|
783
|
-
value:
|
|
862
|
+
data: z3.string(),
|
|
863
|
+
to: z3.string(),
|
|
864
|
+
value: z3.string(),
|
|
784
865
|
signature: signatureSchema.optional(),
|
|
785
866
|
post: postRequestSchema.optional(),
|
|
786
867
|
executeType: executeTypeSchema.optional()
|
|
787
868
|
});
|
|
788
|
-
var generateBuyTransactionReturnSchema =
|
|
789
|
-
steps:
|
|
869
|
+
var generateBuyTransactionReturnSchema = z3.object({
|
|
870
|
+
steps: z3.array(stepSchema)
|
|
790
871
|
});
|
|
791
|
-
var generateSellTransactionReturnSchema =
|
|
792
|
-
steps:
|
|
872
|
+
var generateSellTransactionReturnSchema = z3.object({
|
|
873
|
+
steps: z3.array(stepSchema)
|
|
793
874
|
});
|
|
794
|
-
var generateListingTransactionReturnSchema =
|
|
795
|
-
steps:
|
|
875
|
+
var generateListingTransactionReturnSchema = z3.object({
|
|
876
|
+
steps: z3.array(stepSchema)
|
|
796
877
|
});
|
|
797
|
-
var generateOfferTransactionReturnSchema =
|
|
798
|
-
steps:
|
|
878
|
+
var generateOfferTransactionReturnSchema = z3.object({
|
|
879
|
+
steps: z3.array(stepSchema)
|
|
799
880
|
});
|
|
800
881
|
|
|
801
882
|
// src/react/hooks/useCountOfCollectables.tsx
|
|
802
|
-
var BaseSchema =
|
|
803
|
-
chainId: ChainIdSchema.pipe(
|
|
883
|
+
var BaseSchema = z4.object({
|
|
884
|
+
chainId: ChainIdSchema.pipe(z4.coerce.string()),
|
|
804
885
|
collectionAddress: AddressSchema,
|
|
805
886
|
query: QueryArgSchema
|
|
806
887
|
});
|
|
807
888
|
var UseCountOfCollectableSchema = BaseSchema.extend({
|
|
808
889
|
filter: collectiblesFilterSchema,
|
|
809
|
-
side:
|
|
890
|
+
side: z4.nativeEnum(OrderSide)
|
|
810
891
|
}).or(
|
|
811
892
|
BaseSchema.extend({
|
|
812
|
-
filter:
|
|
813
|
-
side:
|
|
893
|
+
filter: z4.undefined(),
|
|
894
|
+
side: z4.undefined()
|
|
814
895
|
})
|
|
815
896
|
);
|
|
816
897
|
var fetchCountOfCollectables = async (args, config) => {
|
|
@@ -830,24 +911,24 @@ var fetchCountOfCollectables = async (args, config) => {
|
|
|
830
911
|
}).then((resp) => resp.count);
|
|
831
912
|
};
|
|
832
913
|
var countOfCollectablesOptions = (args, config) => {
|
|
833
|
-
return
|
|
914
|
+
return queryOptions3({
|
|
834
915
|
...args.query,
|
|
835
916
|
queryKey: [...collectableKeys.counts, args],
|
|
836
917
|
queryFn: () => fetchCountOfCollectables(args, config)
|
|
837
918
|
});
|
|
838
919
|
};
|
|
839
920
|
var useCountOfCollectables = (args) => {
|
|
840
|
-
const config =
|
|
841
|
-
return
|
|
921
|
+
const config = useConfig();
|
|
922
|
+
return useQuery3(countOfCollectablesOptions(args, config));
|
|
842
923
|
};
|
|
843
924
|
|
|
844
925
|
// src/react/hooks/useCollectible.tsx
|
|
845
|
-
import { queryOptions as
|
|
846
|
-
import { z as
|
|
847
|
-
var UseCollectibleSchema =
|
|
848
|
-
chainId: ChainIdSchema.pipe(
|
|
926
|
+
import { queryOptions as queryOptions4, useQuery as useQuery4 } from "@tanstack/react-query";
|
|
927
|
+
import { z as z5 } from "zod";
|
|
928
|
+
var UseCollectibleSchema = z5.object({
|
|
929
|
+
chainId: ChainIdSchema.pipe(z5.coerce.string()),
|
|
849
930
|
collectionAddress: AddressSchema,
|
|
850
|
-
collectibleId:
|
|
931
|
+
collectibleId: z5.string(),
|
|
851
932
|
query: QueryArgSchema
|
|
852
933
|
});
|
|
853
934
|
var fetchCollectible = async (args, config) => {
|
|
@@ -860,22 +941,22 @@ var fetchCollectible = async (args, config) => {
|
|
|
860
941
|
}).then((resp) => resp.tokenMetadata[0]);
|
|
861
942
|
};
|
|
862
943
|
var collectibleOptions = (args, config) => {
|
|
863
|
-
return
|
|
944
|
+
return queryOptions4({
|
|
864
945
|
...args.query,
|
|
865
946
|
queryKey: [...collectableKeys.details, args, config],
|
|
866
947
|
queryFn: () => fetchCollectible(args, config)
|
|
867
948
|
});
|
|
868
949
|
};
|
|
869
950
|
var useCollectible = (args) => {
|
|
870
|
-
const config =
|
|
871
|
-
return
|
|
951
|
+
const config = useConfig();
|
|
952
|
+
return useQuery4(collectibleOptions(args, config));
|
|
872
953
|
};
|
|
873
954
|
|
|
874
955
|
// src/react/hooks/useCollection.tsx
|
|
875
|
-
import { queryOptions as
|
|
876
|
-
import { z as
|
|
877
|
-
var UseCollectionSchema =
|
|
878
|
-
chainId: ChainIdSchema.pipe(
|
|
956
|
+
import { queryOptions as queryOptions5, useQuery as useQuery5 } from "@tanstack/react-query";
|
|
957
|
+
import { z as z6 } from "zod";
|
|
958
|
+
var UseCollectionSchema = z6.object({
|
|
959
|
+
chainId: ChainIdSchema.pipe(z6.coerce.string()),
|
|
879
960
|
collectionAddress: AddressSchema,
|
|
880
961
|
query: QueryArgSchema
|
|
881
962
|
});
|
|
@@ -888,77 +969,20 @@ var fetchCollection = async (args, config) => {
|
|
|
888
969
|
}).then((resp) => resp.contractInfo);
|
|
889
970
|
};
|
|
890
971
|
var collectionOptions = (args, config) => {
|
|
891
|
-
return
|
|
972
|
+
return queryOptions5({
|
|
892
973
|
...args.query,
|
|
893
974
|
queryKey: [...collectionKeys.detail, args, config],
|
|
894
975
|
queryFn: () => fetchCollection(args, config)
|
|
895
976
|
});
|
|
896
977
|
};
|
|
897
978
|
var useCollection = (args) => {
|
|
898
|
-
const config =
|
|
899
|
-
return
|
|
900
|
-
};
|
|
901
|
-
|
|
902
|
-
// src/react/hooks/useCollectionBalanceDetails.tsx
|
|
903
|
-
import { z as z6 } from "zod";
|
|
904
|
-
import { queryOptions as queryOptions5, useQuery as useQuery5 } from "@tanstack/react-query";
|
|
905
|
-
var filterSchema2 = z6.object({
|
|
906
|
-
accountAddresses: z6.array(AddressSchema),
|
|
907
|
-
contractWhitelist: z6.array(AddressSchema).optional(),
|
|
908
|
-
omitNativeBalances: z6.boolean()
|
|
909
|
-
});
|
|
910
|
-
var useCollectionBalanceDetailsArgsSchema = z6.object({
|
|
911
|
-
chainId: ChainIdSchema.pipe(z6.coerce.number()),
|
|
912
|
-
filter: filterSchema2,
|
|
913
|
-
query: QueryArgSchema.optional()
|
|
914
|
-
});
|
|
915
|
-
var fetchCollectionBalanceDetails = async (args, indexerClient) => {
|
|
916
|
-
const promises = args.filter.accountAddresses.map(
|
|
917
|
-
(accountAddress) => indexerClient.getTokenBalancesDetails({
|
|
918
|
-
filter: {
|
|
919
|
-
accountAddresses: [accountAddress],
|
|
920
|
-
contractWhitelist: args.filter.contractWhitelist,
|
|
921
|
-
omitNativeBalances: args.filter.omitNativeBalances
|
|
922
|
-
}
|
|
923
|
-
})
|
|
924
|
-
);
|
|
925
|
-
const responses = await Promise.all(promises);
|
|
926
|
-
const mergedResponse = responses.reduce(
|
|
927
|
-
(acc, curr) => {
|
|
928
|
-
if (!curr) return acc;
|
|
929
|
-
return {
|
|
930
|
-
page: curr.page,
|
|
931
|
-
nativeBalances: [
|
|
932
|
-
...acc.nativeBalances || [],
|
|
933
|
-
...curr.nativeBalances || []
|
|
934
|
-
],
|
|
935
|
-
balances: [...acc.balances || [], ...curr.balances || []]
|
|
936
|
-
};
|
|
937
|
-
},
|
|
938
|
-
{ page: {}, nativeBalances: [], balances: [] }
|
|
939
|
-
);
|
|
940
|
-
if (!mergedResponse) {
|
|
941
|
-
throw new Error("Failed to fetch collection balance details");
|
|
942
|
-
}
|
|
943
|
-
return mergedResponse;
|
|
944
|
-
};
|
|
945
|
-
var collectionBalanceDetailsOptions = (args, config) => {
|
|
946
|
-
const parsedArgs = useCollectionBalanceDetailsArgsSchema.parse(args);
|
|
947
|
-
const indexerClient = getIndexerClient(parsedArgs.chainId, config);
|
|
948
|
-
return queryOptions5({
|
|
949
|
-
queryKey: [...balanceQueries.collectionBalanceDetails, args, config],
|
|
950
|
-
queryFn: () => fetchCollectionBalanceDetails(parsedArgs, indexerClient),
|
|
951
|
-
...args.query
|
|
952
|
-
});
|
|
953
|
-
};
|
|
954
|
-
var useCollectionBalanceDetails = (args) => {
|
|
955
|
-
const config = useConfig2();
|
|
956
|
-
return useQuery5(collectionBalanceDetailsOptions(args, config));
|
|
979
|
+
const config = useConfig();
|
|
980
|
+
return useQuery5(collectionOptions(args, config));
|
|
957
981
|
};
|
|
958
982
|
|
|
959
983
|
// src/react/hooks/useCurrencies.tsx
|
|
960
984
|
import { queryOptions as queryOptions6, useQuery as useQuery6 } from "@tanstack/react-query";
|
|
961
|
-
import { zeroAddress } from "viem";
|
|
985
|
+
import { zeroAddress as zeroAddress2 } from "viem";
|
|
962
986
|
import { z as z7 } from "zod";
|
|
963
987
|
var ChainIdCoerce = ChainIdSchema.transform((val) => val.toString());
|
|
964
988
|
var UseCurrenciesArgsSchema = z7.object({
|
|
@@ -974,7 +998,7 @@ var fetchCurrencies = async (chainId, config) => {
|
|
|
974
998
|
(resp) => resp.currencies.map((currency) => ({
|
|
975
999
|
...currency,
|
|
976
1000
|
// TODO: remove this, when we are sure of the schema
|
|
977
|
-
contractAddress: currency.contractAddress ||
|
|
1001
|
+
contractAddress: currency.contractAddress || zeroAddress2
|
|
978
1002
|
}))
|
|
979
1003
|
);
|
|
980
1004
|
};
|
|
@@ -1004,7 +1028,7 @@ var currenciesOptions = (args, config) => {
|
|
|
1004
1028
|
});
|
|
1005
1029
|
};
|
|
1006
1030
|
var useCurrencies = (args) => {
|
|
1007
|
-
const config =
|
|
1031
|
+
const config = useConfig();
|
|
1008
1032
|
return useQuery6(currenciesOptions(args, config));
|
|
1009
1033
|
};
|
|
1010
1034
|
|
|
@@ -1060,7 +1084,7 @@ var marketplaceConfigOptions = (config) => {
|
|
|
1060
1084
|
|
|
1061
1085
|
// src/react/hooks/useMarketplaceConfig.tsx
|
|
1062
1086
|
var useMarketplaceConfig = () => {
|
|
1063
|
-
const config =
|
|
1087
|
+
const config = useConfig();
|
|
1064
1088
|
return useQuery7(marketplaceConfigOptions(config));
|
|
1065
1089
|
};
|
|
1066
1090
|
|
|
@@ -1112,7 +1136,7 @@ var currencyOptions = (args, config) => {
|
|
|
1112
1136
|
});
|
|
1113
1137
|
};
|
|
1114
1138
|
var useCurrency = (args) => {
|
|
1115
|
-
const config =
|
|
1139
|
+
const config = useConfig();
|
|
1116
1140
|
return useQuery8(currencyOptions(args, config));
|
|
1117
1141
|
};
|
|
1118
1142
|
|
|
@@ -1140,7 +1164,7 @@ var filtersOptions = (args, config) => {
|
|
|
1140
1164
|
});
|
|
1141
1165
|
};
|
|
1142
1166
|
var useFilters = (args) => {
|
|
1143
|
-
const config =
|
|
1167
|
+
const config = useConfig();
|
|
1144
1168
|
return useQuery9(filtersOptions(args, config));
|
|
1145
1169
|
};
|
|
1146
1170
|
|
|
@@ -1163,7 +1187,7 @@ var floorOrderOptions = (args, config) => {
|
|
|
1163
1187
|
});
|
|
1164
1188
|
};
|
|
1165
1189
|
var useFloorOrder = (args) => {
|
|
1166
|
-
const config =
|
|
1190
|
+
const config = useConfig();
|
|
1167
1191
|
return useQuery10(floorOrderOptions(args, config));
|
|
1168
1192
|
};
|
|
1169
1193
|
|
|
@@ -1193,7 +1217,7 @@ var highestOfferOptions = (args, config) => {
|
|
|
1193
1217
|
});
|
|
1194
1218
|
};
|
|
1195
1219
|
var useHighestOffer = (args) => {
|
|
1196
|
-
const config =
|
|
1220
|
+
const config = useConfig();
|
|
1197
1221
|
return useQuery11(highestOfferOptions(args, config));
|
|
1198
1222
|
};
|
|
1199
1223
|
|
|
@@ -1250,7 +1274,7 @@ var listBalancesOptions = (args, config) => {
|
|
|
1250
1274
|
});
|
|
1251
1275
|
};
|
|
1252
1276
|
var useListBalances = (args) => {
|
|
1253
|
-
const config =
|
|
1277
|
+
const config = useConfig();
|
|
1254
1278
|
return useInfiniteQuery(listBalancesOptions(args, config));
|
|
1255
1279
|
};
|
|
1256
1280
|
|
|
@@ -1278,7 +1302,7 @@ var listCollectibleActivitiesOptions = (args, config) => {
|
|
|
1278
1302
|
});
|
|
1279
1303
|
};
|
|
1280
1304
|
var useListCollectibleActivities = (args) => {
|
|
1281
|
-
const config =
|
|
1305
|
+
const config = useConfig();
|
|
1282
1306
|
return useQuery12(listCollectibleActivitiesOptions(args, config));
|
|
1283
1307
|
};
|
|
1284
1308
|
|
|
@@ -1311,7 +1335,7 @@ var listCollectiblesOptions = (args, config) => {
|
|
|
1311
1335
|
});
|
|
1312
1336
|
};
|
|
1313
1337
|
var useListCollectibles = (args) => {
|
|
1314
|
-
const config =
|
|
1338
|
+
const config = useConfig();
|
|
1315
1339
|
return useInfiniteQuery2(listCollectiblesOptions(args, config));
|
|
1316
1340
|
};
|
|
1317
1341
|
|
|
@@ -1338,7 +1362,7 @@ var listCollectionActivitiesOptions = (args, config) => {
|
|
|
1338
1362
|
});
|
|
1339
1363
|
};
|
|
1340
1364
|
var useListCollectionActivities = (args) => {
|
|
1341
|
-
const config =
|
|
1365
|
+
const config = useConfig();
|
|
1342
1366
|
return useQuery13(listCollectionActivitiesOptions(args, config));
|
|
1343
1367
|
};
|
|
1344
1368
|
|
|
@@ -1367,7 +1391,7 @@ var listOffersForCollectibleOptions = (args, config) => {
|
|
|
1367
1391
|
});
|
|
1368
1392
|
};
|
|
1369
1393
|
var useListOffersForCollectible = (args) => {
|
|
1370
|
-
const config =
|
|
1394
|
+
const config = useConfig();
|
|
1371
1395
|
return useQuery14(listOffersForCollectibleOptions(args, config));
|
|
1372
1396
|
};
|
|
1373
1397
|
|
|
@@ -1400,7 +1424,7 @@ var countOffersForCollectibleOptions = (args, config) => {
|
|
|
1400
1424
|
});
|
|
1401
1425
|
};
|
|
1402
1426
|
var useCountOffersForCollectible = (args) => {
|
|
1403
|
-
const config =
|
|
1427
|
+
const config = useConfig();
|
|
1404
1428
|
return useQuery15(countOffersForCollectibleOptions(args, config));
|
|
1405
1429
|
};
|
|
1406
1430
|
|
|
@@ -1429,7 +1453,7 @@ var listListingsForCollectibleOptions = (args, config) => {
|
|
|
1429
1453
|
});
|
|
1430
1454
|
};
|
|
1431
1455
|
var useListListingsForCollectible = (args) => {
|
|
1432
|
-
const config =
|
|
1456
|
+
const config = useConfig();
|
|
1433
1457
|
return useQuery16(listListingsForCollectibleOptions(args, config));
|
|
1434
1458
|
};
|
|
1435
1459
|
|
|
@@ -1462,7 +1486,7 @@ var countListingsForCollectibleOptions = (args, config) => {
|
|
|
1462
1486
|
});
|
|
1463
1487
|
};
|
|
1464
1488
|
var useCountListingsForCollectible = (args) => {
|
|
1465
|
-
const config =
|
|
1489
|
+
const config = useConfig();
|
|
1466
1490
|
return useQuery17(countListingsForCollectibleOptions(args, config));
|
|
1467
1491
|
};
|
|
1468
1492
|
|
|
@@ -1492,7 +1516,7 @@ var lowestListingOptions = (args, config) => {
|
|
|
1492
1516
|
});
|
|
1493
1517
|
};
|
|
1494
1518
|
var useLowestListing = (args) => {
|
|
1495
|
-
const config =
|
|
1519
|
+
const config = useConfig();
|
|
1496
1520
|
return useQuery18(lowestListingOptions(args, config));
|
|
1497
1521
|
};
|
|
1498
1522
|
|
|
@@ -1552,7 +1576,7 @@ var generateListingTransaction = async (params, config, chainId) => {
|
|
|
1552
1576
|
return (await marketplaceClient.generateListingTransaction(args)).steps;
|
|
1553
1577
|
};
|
|
1554
1578
|
var useGenerateListingTransaction = (params) => {
|
|
1555
|
-
const config =
|
|
1579
|
+
const config = useConfig();
|
|
1556
1580
|
const { mutate, mutateAsync, ...result } = useMutation({
|
|
1557
1581
|
onSuccess: params.onSuccess,
|
|
1558
1582
|
mutationFn: (args) => generateListingTransaction(args, config, params.chainId)
|
|
@@ -1575,7 +1599,7 @@ var generateOfferTransaction = async (params, config, chainId) => {
|
|
|
1575
1599
|
return (await marketplaceClient.generateOfferTransaction(args)).steps;
|
|
1576
1600
|
};
|
|
1577
1601
|
var useGenerateOfferTransaction = (params) => {
|
|
1578
|
-
const config =
|
|
1602
|
+
const config = useConfig();
|
|
1579
1603
|
const { mutate, mutateAsync, ...result } = useMutation2({
|
|
1580
1604
|
onSuccess: params.onSuccess,
|
|
1581
1605
|
mutationFn: (args) => generateOfferTransaction(args, config, params.chainId)
|
|
@@ -1600,7 +1624,7 @@ var generateSellTransaction = async (args, config, chainId) => {
|
|
|
1600
1624
|
return marketplaceClient.generateSellTransaction(args).then((data) => data.steps);
|
|
1601
1625
|
};
|
|
1602
1626
|
var useGenerateSellTransaction = (params) => {
|
|
1603
|
-
const config =
|
|
1627
|
+
const config = useConfig();
|
|
1604
1628
|
const { mutate, mutateAsync, ...result } = useMutation3({
|
|
1605
1629
|
onSuccess: params.onSuccess,
|
|
1606
1630
|
mutationFn: (args) => generateSellTransaction(args, config, params.chainId)
|
|
@@ -1625,7 +1649,7 @@ var generateCancelTransaction = async (args, config, chainId) => {
|
|
|
1625
1649
|
return marketplaceClient.generateCancelTransaction(args).then((data) => data.steps);
|
|
1626
1650
|
};
|
|
1627
1651
|
var useGenerateCancelTransaction = (params) => {
|
|
1628
|
-
const config =
|
|
1652
|
+
const config = useConfig();
|
|
1629
1653
|
const { mutate, mutateAsync, ...result } = useMutation4({
|
|
1630
1654
|
onSuccess: params.onSuccess,
|
|
1631
1655
|
mutationFn: (args) => generateCancelTransaction(args, config, params.chainId)
|
|
@@ -1728,7 +1752,7 @@ var checkoutOptionsOptions = (args, config) => {
|
|
|
1728
1752
|
};
|
|
1729
1753
|
var useCheckoutOptions = (args) => {
|
|
1730
1754
|
const { address } = useAccount3();
|
|
1731
|
-
const config =
|
|
1755
|
+
const config = useConfig();
|
|
1732
1756
|
return useQuery20(
|
|
1733
1757
|
// biome-ignore lint/style/noNonNullAssertion: <explanation>
|
|
1734
1758
|
checkoutOptionsOptions({ walletAddress: address, ...args }, config)
|
|
@@ -1771,7 +1795,7 @@ var listCollectionsOptions = (args, config) => {
|
|
|
1771
1795
|
});
|
|
1772
1796
|
};
|
|
1773
1797
|
var useListCollections = (args = {}) => {
|
|
1774
|
-
const config =
|
|
1798
|
+
const config = useConfig();
|
|
1775
1799
|
const { data: marketplaceConfig, isLoading: isLoadingConfig } = useMarketplaceConfig();
|
|
1776
1800
|
return useQuery21({
|
|
1777
1801
|
...listCollectionsOptions(
|
|
@@ -1820,7 +1844,7 @@ var generateBuyTransactionOptions = (args, config) => {
|
|
|
1820
1844
|
};
|
|
1821
1845
|
var useGenerateBuyTransaction = (args) => {
|
|
1822
1846
|
const { address } = useAccount4();
|
|
1823
|
-
const config =
|
|
1847
|
+
const config = useConfig();
|
|
1824
1848
|
return useQuery22(
|
|
1825
1849
|
// biome-ignore lint/style/noNonNullAssertion: <explanation>
|
|
1826
1850
|
generateBuyTransactionOptions({ buyer: address, ...args }, config)
|
|
@@ -2089,7 +2113,7 @@ var useWallet = () => {
|
|
|
2089
2113
|
const { chains } = useSwitchChain();
|
|
2090
2114
|
const { data: walletClient, isLoading: wagmiWalletIsLoading } = useWalletClient();
|
|
2091
2115
|
const { connector, isConnected, isConnecting } = useAccount5();
|
|
2092
|
-
const sdkConfig =
|
|
2116
|
+
const sdkConfig = useConfig();
|
|
2093
2117
|
const chainId = useChainId();
|
|
2094
2118
|
const { data, isLoading, isError } = useQuery23({
|
|
2095
2119
|
queryKey: ["wallet", chainId, connector?.uid],
|
|
@@ -2262,7 +2286,7 @@ var useCancelTransactionSteps = ({
|
|
|
2262
2286
|
const { show: showSwitchChainModal } = useSwitchChainModal();
|
|
2263
2287
|
const { wallet: wallet2, isLoading, isError } = useWallet();
|
|
2264
2288
|
const walletIsInitialized = wallet2 && !isLoading && !isError;
|
|
2265
|
-
const sdkConfig =
|
|
2289
|
+
const sdkConfig = useConfig();
|
|
2266
2290
|
const marketplaceClient = getMarketplaceClient(chainId, sdkConfig);
|
|
2267
2291
|
const { generateCancelTransactionAsync } = useGenerateCancelTransaction({
|
|
2268
2292
|
chainId
|
|
@@ -2424,7 +2448,7 @@ var useCancelOrder = ({
|
|
|
2424
2448
|
null
|
|
2425
2449
|
);
|
|
2426
2450
|
const [pendingFeeOptionConfirmation, confirmPendingFeeOption] = useWaasFeeOptions();
|
|
2427
|
-
const
|
|
2451
|
+
const autoSelectOptionPromise = useAutoSelectFeeOption({
|
|
2428
2452
|
pendingFeeOptionConfirmation: pendingFeeOptionConfirmation ? {
|
|
2429
2453
|
id: pendingFeeOptionConfirmation.id,
|
|
2430
2454
|
options: pendingFeeOptionConfirmation.options?.map((opt) => ({
|
|
@@ -2444,27 +2468,18 @@ var useCancelOrder = ({
|
|
|
2444
2468
|
}
|
|
2445
2469
|
});
|
|
2446
2470
|
useEffect(() => {
|
|
2447
|
-
|
|
2448
|
-
if (
|
|
2449
|
-
const { selectedOption, error } = await autoSelectFeeOptionResult;
|
|
2450
|
-
if (error) {
|
|
2451
|
-
console.error("Error selecting fee option:", error);
|
|
2452
|
-
onError?.(new Error(`Failed to select fee option: ${error}`));
|
|
2453
|
-
return;
|
|
2454
|
-
}
|
|
2455
|
-
if (selectedOption?.token.contractAddress && pendingFeeOptionConfirmation.id) {
|
|
2471
|
+
autoSelectOptionPromise.then((res) => {
|
|
2472
|
+
if (pendingFeeOptionConfirmation?.id && res.selectedOption) {
|
|
2456
2473
|
confirmPendingFeeOption(
|
|
2457
2474
|
pendingFeeOptionConfirmation.id,
|
|
2458
|
-
selectedOption.token.contractAddress
|
|
2475
|
+
res.selectedOption.token.contractAddress
|
|
2459
2476
|
);
|
|
2460
2477
|
}
|
|
2461
|
-
};
|
|
2462
|
-
handleFeeOptionSelection();
|
|
2478
|
+
});
|
|
2463
2479
|
}, [
|
|
2464
|
-
|
|
2465
|
-
autoSelectFeeOptionResult,
|
|
2480
|
+
autoSelectOptionPromise,
|
|
2466
2481
|
confirmPendingFeeOption,
|
|
2467
|
-
|
|
2482
|
+
pendingFeeOptionConfirmation
|
|
2468
2483
|
]);
|
|
2469
2484
|
const { cancelOrder: cancelOrderBase } = useCancelTransactionSteps({
|
|
2470
2485
|
collectionAddress,
|
|
@@ -2506,7 +2521,7 @@ var collectionDetailsOptions = (args, config) => {
|
|
|
2506
2521
|
});
|
|
2507
2522
|
};
|
|
2508
2523
|
var useCollectionDetails = (args) => {
|
|
2509
|
-
const config =
|
|
2524
|
+
const config = useConfig();
|
|
2510
2525
|
return useQuery24(collectionDetailsOptions(args, config));
|
|
2511
2526
|
};
|
|
2512
2527
|
|
|
@@ -2546,7 +2561,7 @@ var collectionDetailsPollingOptions = (args, config) => {
|
|
|
2546
2561
|
});
|
|
2547
2562
|
};
|
|
2548
2563
|
var useCollectionDetailsPolling = (args) => {
|
|
2549
|
-
const config =
|
|
2564
|
+
const config = useConfig();
|
|
2550
2565
|
return useQuery25(collectionDetailsPollingOptions(args, config));
|
|
2551
2566
|
};
|
|
2552
2567
|
|
|
@@ -2554,8 +2569,10 @@ export {
|
|
|
2554
2569
|
MarketplaceSdkContext,
|
|
2555
2570
|
MarketplaceQueryClientProvider,
|
|
2556
2571
|
MarketplaceProvider,
|
|
2572
|
+
useConfig,
|
|
2573
|
+
collectionBalanceDetailsOptions,
|
|
2574
|
+
useCollectionBalanceDetails,
|
|
2557
2575
|
useAutoSelectFeeOption,
|
|
2558
|
-
useConfig2 as useConfig,
|
|
2559
2576
|
balanceOfCollectibleOptions,
|
|
2560
2577
|
useBalanceOfCollectible,
|
|
2561
2578
|
countOfCollectablesOptions,
|
|
@@ -2564,8 +2581,6 @@ export {
|
|
|
2564
2581
|
useCollectible,
|
|
2565
2582
|
collectionOptions,
|
|
2566
2583
|
useCollection,
|
|
2567
|
-
collectionBalanceDetailsOptions,
|
|
2568
|
-
useCollectionBalanceDetails,
|
|
2569
2584
|
currenciesOptions,
|
|
2570
2585
|
useCurrencies,
|
|
2571
2586
|
marketplaceConfigOptions,
|
|
@@ -2629,4 +2644,4 @@ export {
|
|
|
2629
2644
|
collectionDetailsPollingOptions,
|
|
2630
2645
|
useCollectionDetailsPolling
|
|
2631
2646
|
};
|
|
2632
|
-
//# sourceMappingURL=chunk-
|
|
2647
|
+
//# sourceMappingURL=chunk-I37CRQ4S.js.map
|