@0xsequence/marketplace-sdk 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/chunk-7CL54NCX.js +41 -0
  2. package/dist/chunk-7CL54NCX.js.map +1 -0
  3. package/dist/{chunk-G3D572BT.js → chunk-G3YU4NQ2.js} +24 -1
  4. package/dist/chunk-G3YU4NQ2.js.map +1 -0
  5. package/dist/{chunk-SM7V6ZWI.js → chunk-GNB736ZE.js} +226 -208
  6. package/dist/chunk-GNB736ZE.js.map +1 -0
  7. package/dist/chunk-ITJEOCDV.js +1006 -0
  8. package/dist/chunk-ITJEOCDV.js.map +1 -0
  9. package/dist/{chunk-QOJXWHRZ.js → chunk-LFQB477Y.js} +3 -1
  10. package/dist/chunk-LFQB477Y.js.map +1 -0
  11. package/dist/{chunk-VPGWEMWL.js → chunk-M4MXVMAM.js} +134 -25
  12. package/dist/chunk-M4MXVMAM.js.map +1 -0
  13. package/dist/{chunk-4PFMUVE4.js → chunk-SNOEEUPZ.js} +2 -2
  14. package/dist/{create-config-Dz0gCiQ0.d.ts → create-config-Cto2ehcz.d.ts} +1 -1
  15. package/dist/index.css +4 -1
  16. package/dist/index.d.ts +3 -2
  17. package/dist/index.js +1 -1
  18. package/dist/{marketplace-config-DZbtyrma.d.ts → marketplace-config-Bbxl-uKX.d.ts} +2 -1
  19. package/dist/react/_internal/index.d.ts +4 -3
  20. package/dist/react/_internal/index.js +9 -1
  21. package/dist/react/_internal/wagmi/index.d.ts +2 -2
  22. package/dist/react/hooks/index.d.ts +1363 -101
  23. package/dist/react/hooks/index.js +13 -7
  24. package/dist/react/index.css +4 -1
  25. package/dist/react/index.css.map +1 -1
  26. package/dist/react/index.d.ts +6 -5
  27. package/dist/react/index.js +28 -22
  28. package/dist/react/ssr/index.d.ts +2 -1
  29. package/dist/react/ssr/index.js +23 -0
  30. package/dist/react/ssr/index.js.map +1 -1
  31. package/dist/react/ui/index.css +4 -1
  32. package/dist/react/ui/index.css.map +1 -1
  33. package/dist/react/ui/index.d.ts +4 -4
  34. package/dist/react/ui/index.js +5 -5
  35. package/dist/react/ui/modals/_internal/components/actionModal/index.js +2 -2
  36. package/dist/styles/index.css +4 -1
  37. package/dist/styles/index.css.map +1 -1
  38. package/dist/styles/index.d.ts +2 -1
  39. package/dist/styles/index.js +3 -4972
  40. package/dist/styles/index.js.map +1 -1
  41. package/dist/types/index.d.ts +2 -1
  42. package/dist/types/index.js +1 -1
  43. package/dist/types-BzZVURNL.d.ts +19 -0
  44. package/dist/utils/index.d.ts +2 -1
  45. package/dist/utils/index.js +1 -1
  46. package/package.json +3 -2
  47. package/src/react/_internal/api/zod-schema.ts +636 -0
  48. package/src/react/_internal/types.ts +32 -8
  49. package/src/react/hooks/index.ts +1 -0
  50. package/src/react/hooks/useBalanceOfCollectible.tsx +43 -18
  51. package/src/react/hooks/useCollectible.tsx +17 -11
  52. package/src/react/hooks/useCollection.tsx +35 -29
  53. package/src/react/hooks/useCountOfCollectables.tsx +77 -0
  54. package/src/react/hooks/useCurrencies.tsx +23 -12
  55. package/src/react/hooks/useFilters.tsx +15 -9
  56. package/src/react/hooks/useFloorOrder.tsx +23 -8
  57. package/src/react/hooks/useGenerateSellTransaction.tsx +16 -9
  58. package/src/react/hooks/useHighestOffer.tsx +23 -13
  59. package/src/react/hooks/useListBalances.tsx +57 -26
  60. package/src/react/hooks/useListCollectibles.tsx +25 -12
  61. package/src/react/hooks/useListOffersForCollectible.tsx +13 -5
  62. package/src/react/hooks/useLowestListing.tsx +23 -14
  63. package/src/react/hooks/useRoyaltyPercentage.tsx +18 -8
  64. package/src/react/hooks/useTransferTokens.tsx +3 -3
  65. package/src/react/ui/modals/CreateListingModal/_store.ts +5 -5
  66. package/src/react/ui/modals/CreateListingModal/index.tsx +5 -4
  67. package/src/react/ui/modals/MakeOfferModal/_store.ts +6 -9
  68. package/src/react/ui/modals/MakeOfferModal/index.tsx +15 -25
  69. package/src/react/ui/modals/SellModal/_store.ts +28 -23
  70. package/src/react/ui/modals/SellModal/index.tsx +11 -10
  71. package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/index.tsx +8 -7
  72. package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +2 -1
  73. package/src/react/ui/modals/_internal/components/floorPriceText/index.tsx +3 -2
  74. package/src/react/ui/modals/_internal/components/priceInput/index.tsx +55 -12
  75. package/src/react/ui/modals/_internal/components/priceInput/styles.css.ts +4 -0
  76. package/src/react/ui/modals/_internal/components/quantityInput/index.tsx +2 -1
  77. package/src/react/ui/modals/_internal/components/tokenPreview/index.tsx +2 -1
  78. package/src/react/ui/modals/_internal/components/transactionDetails/index.tsx +2 -2
  79. package/src/react/ui/modals/_internal/components/transactionPreview/index.tsx +4 -4
  80. package/src/react/ui/modals/_internal/components/transactionStatusModal/index.tsx +14 -14
  81. package/src/react/ui/modals/_internal/components/transactionStatusModal/store.ts +5 -5
  82. package/src/types/marketplace-config.ts +2 -1
  83. package/dist/chunk-G3D572BT.js.map +0 -1
  84. package/dist/chunk-QOJXWHRZ.js.map +0 -1
  85. package/dist/chunk-SM7V6ZWI.js.map +0 -1
  86. package/dist/chunk-STO74F2I.js +0 -14
  87. package/dist/chunk-STO74F2I.js.map +0 -1
  88. package/dist/chunk-VPGWEMWL.js.map +0 -1
  89. package/dist/chunk-ZE2LNX65.js +0 -394
  90. package/dist/chunk-ZE2LNX65.js.map +0 -1
  91. package/dist/types-BrAQ8-w4.d.ts +0 -12
  92. package/src/react/hooks/useCollectionCounts.tsx +0 -61
  93. /package/dist/{chunk-4PFMUVE4.js.map → chunk-SNOEEUPZ.js.map} +0 -0
@@ -1,8 +1,9 @@
1
- export { M as MarketplaceConfig } from '../marketplace-config-DZbtyrma.js';
1
+ export { M as MarketplaceConfig } from '../marketplace-config-Bbxl-uKX.js';
2
2
  export { E as Env, S as SdkConfig } from '../sdk-config-xWkdBdrL.js';
3
3
  import { w as Currency } from '../marketplace.gen-Ceofb9Cs.js';
4
4
  export { q as Activity, y as AdditionalFee, A as Asset, L as CheckoutOptions, K as CheckoutOptionsItem, J as CheckoutOptionsMarketplaceOrder, v as Collectible, o as CollectibleOrder, f as CollectibleStatus, l as CollectiblesFilter, r as Collection, s as CollectionConfig, t as CollectionLastSynced, d as CollectionStatus, C as ContractType, D as CreateReq, I as Domain, E as ExecuteType, n as FeeBreakdown, F as Filter, G as GetOrdersInput, M as MarketplaceKind, m as Order, x as OrderData, p as OrderFilter, b as OrderSide, c as OrderStatus, O as OrderbookKind, i as Page, B as PostRequest, u as Project, e as ProjectStatus, k as PropertyFilter, P as PropertyType, H as Signature, j as SortBy, S as SortOrder, a as SourceKind, z as Step, g as StepType, h as TokenMetadata, T as TransactionCrypto, W as WalletKind } from '../marketplace.gen-Ceofb9Cs.js';
5
5
  import '@0xsequence/network';
6
+ import 'viem';
6
7
 
7
8
  type Price = {
8
9
  amountRaw: string;
@@ -1,6 +1,6 @@
1
1
  "use client"
2
2
  import "../chunk-MJ4YU7RW.js";
3
- import "../chunk-STO74F2I.js";
3
+ import "../chunk-7CL54NCX.js";
4
4
  import {
5
5
  CollectibleStatus,
6
6
  CollectionStatus,
@@ -0,0 +1,19 @@
1
+ import { ChainId as ChainId$1 } from '@0xsequence/network';
2
+ import { z } from 'zod';
3
+ import { C as ContractType } from './marketplace.gen-Ceofb9Cs.js';
4
+
5
+ declare const QueryArgSchema: z.ZodOptional<z.ZodObject<{
6
+ enabled: z.ZodOptional<z.ZodBoolean>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ enabled?: boolean | undefined;
9
+ }, {
10
+ enabled?: boolean | undefined;
11
+ }>>;
12
+ type QueryArg = z.infer<typeof QueryArgSchema>;
13
+ declare const CollectableIdSchema: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
14
+ declare const ChainIdSchema: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodNativeEnum<typeof ChainId$1>]>;
15
+ declare const AddressSchema: z.ZodEffects<z.ZodString, `0x${string}`, string>;
16
+ type ChainId = z.infer<typeof ChainIdSchema>;
17
+ type CollectionType = ContractType.ERC1155 | ContractType.ERC721;
18
+
19
+ export { AddressSchema as A, CollectableIdSchema as C, QueryArgSchema as Q, type QueryArg as a, ChainIdSchema as b, type ChainId as c, type CollectionType as d };
@@ -1,9 +1,10 @@
1
- import { C as ChainId } from '../types-BrAQ8-w4.js';
1
+ import { c as ChainId } from '../types-BzZVURNL.js';
2
2
  import { PublicClient } from 'viem';
3
3
  export { EIP2981_ABI } from './abi/abi/standard/index.js';
4
4
  export { ERC1155_ABI, ERC20_ABI, ERC721_ABI } from './abi/abi/token/index.js';
5
5
  export { ERC1155, ERC20, ERC721 } from './abi/clients/index.js';
6
6
  import '@0xsequence/network';
7
+ import 'zod';
7
8
  import '../marketplace.gen-Ceofb9Cs.js';
8
9
  import 'wagmi/query';
9
10
 
@@ -34,4 +34,4 @@ export {
34
34
  truncateEnd,
35
35
  truncateMiddle
36
36
  };
37
- //# sourceMappingURL=index.js.mapngURL=index.js.map
37
+ //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@0xsequence/marketplace-sdk",
3
3
  "private": false,
4
- "version": "0.0.1",
4
+ "version": "0.1.0",
5
5
  "description": "Marketplace SDK for Sequence",
6
6
  "repository": "https://github.com/0xsequence/marketplace-sdk",
7
7
  "author": "Horizon Blockchain Games",
@@ -34,7 +34,8 @@
34
34
  "@radix-ui/react-dialog": "^1.1.2",
35
35
  "@radix-ui/react-popover": "^1.1.2",
36
36
  "date-fns": "^4.1.0",
37
- "react-day-picker": "^9.2.0"
37
+ "react-day-picker": "^9.2.0",
38
+ "zod": "^3.23.8"
38
39
  },
39
40
  "peerDependencies": {
40
41
  "@0xsequence/api": "^2.0.13",
@@ -0,0 +1,636 @@
1
+ // generated with https://transform.tools/typescript-to-zod
2
+ //
3
+ //
4
+ import { z } from 'zod';
5
+ import {
6
+ CollectibleStatus,
7
+ CollectionStatus,
8
+ ContractType,
9
+ ExecuteType,
10
+ MarketplaceKind,
11
+ OrderSide,
12
+ OrderStatus,
13
+ OrderbookKind,
14
+ ProjectStatus,
15
+ PropertyType,
16
+ SortOrder,
17
+ SourceKind,
18
+ StepType,
19
+ TransactionCrypto,
20
+ TransactionNFTCheckoutProvider,
21
+ TransactionOnRampProvider,
22
+ TransactionSwapProvider,
23
+ WalletKind,
24
+ } from './marketplace.gen';
25
+
26
+ export const assetSchema = z.object({
27
+ id: z.number(),
28
+ collectionId: z.number(),
29
+ tokenId: z.string(),
30
+ url: z.string().optional(),
31
+ metadataField: z.string(),
32
+ name: z.string().optional(),
33
+ filesize: z.number().optional(),
34
+ mimeType: z.string().optional(),
35
+ width: z.number().optional(),
36
+ height: z.number().optional(),
37
+ updatedAt: z.string().optional(),
38
+ });
39
+
40
+ export const sortOrderSchema = z.nativeEnum(SortOrder);
41
+
42
+ export const propertyTypeSchema = z.nativeEnum(PropertyType);
43
+
44
+ export const marketplaceKindSchema = z.nativeEnum(MarketplaceKind);
45
+
46
+ export const orderbookKindSchema = z.nativeEnum(OrderbookKind);
47
+
48
+ export const sourceKindSchema = z.nativeEnum(SourceKind);
49
+
50
+ export const orderSideSchema = z.nativeEnum(OrderSide);
51
+
52
+ export const orderStatusSchema = z.nativeEnum(OrderStatus);
53
+
54
+ export const contractTypeSchema = z.nativeEnum(ContractType);
55
+
56
+ export const collectionStatusSchema = z.nativeEnum(CollectionStatus);
57
+
58
+ export const projectStatusSchema = z.nativeEnum(ProjectStatus);
59
+
60
+ export const collectibleStatusSchema = z.nativeEnum(CollectibleStatus);
61
+
62
+ export const walletKindSchema = z.nativeEnum(WalletKind);
63
+
64
+ export const stepTypeSchema = z.nativeEnum(StepType);
65
+
66
+ export const transactionCryptoSchema = z.nativeEnum(TransactionCrypto);
67
+
68
+ export const transactionNFTCheckoutProviderSchema = z.nativeEnum(
69
+ TransactionNFTCheckoutProvider,
70
+ );
71
+
72
+ export const transactionOnRampProviderSchema = z.nativeEnum(
73
+ TransactionOnRampProvider,
74
+ );
75
+
76
+ export const transactionSwapProviderSchema = z.nativeEnum(
77
+ TransactionSwapProvider,
78
+ );
79
+
80
+ export const executeTypeSchema = z.nativeEnum(ExecuteType);
81
+
82
+ export const sortBySchema = z.object({
83
+ column: z.string(),
84
+ order: sortOrderSchema,
85
+ });
86
+
87
+ export const propertyFilterSchema = z.object({
88
+ name: z.string(),
89
+ type: propertyTypeSchema,
90
+ min: z.number().optional(),
91
+ max: z.number().optional(),
92
+ values: z.array(z.any()).optional(),
93
+ });
94
+
95
+ export const collectiblesFilterSchema = z.object({
96
+ includeEmpty: z.boolean(),
97
+ searchText: z.string().optional(),
98
+ properties: z.array(propertyFilterSchema).optional(),
99
+ marketplaces: z.array(marketplaceKindSchema).optional(),
100
+ inAccounts: z.array(z.string()).optional(),
101
+ notInAccounts: z.array(z.string()).optional(),
102
+ ordersCreatedBy: z.array(z.string()).optional(),
103
+ ordersNotCreatedBy: z.array(z.string()).optional(),
104
+ });
105
+
106
+ export const feeBreakdownSchema = z.object({
107
+ kind: z.string(),
108
+ recipientAddress: z.string(),
109
+ bps: z.number(),
110
+ });
111
+
112
+ export const orderFilterSchema = z.object({
113
+ createdBy: z.array(z.string()).optional(),
114
+ marketplace: z.array(marketplaceKindSchema).optional(),
115
+ currencies: z.array(z.string()).optional(),
116
+ });
117
+
118
+ export const collectionLastSyncedSchema = z.object({
119
+ allOrders: z.string(),
120
+ newOrders: z.string(),
121
+ });
122
+
123
+ export const projectSchema = z.object({
124
+ projectId: z.number(),
125
+ chainId: z.number(),
126
+ contractAddress: z.string(),
127
+ status: projectStatusSchema,
128
+ createdAt: z.string(),
129
+ updatedAt: z.string(),
130
+ deletedAt: z.string().optional(),
131
+ });
132
+
133
+ export const collectibleSchema = z.object({
134
+ chainId: z.number(),
135
+ contractAddress: z.string(),
136
+ status: collectibleStatusSchema,
137
+ tokenId: z.string(),
138
+ createdAt: z.string(),
139
+ updatedAt: z.string(),
140
+ deletedAt: z.string().optional(),
141
+ });
142
+
143
+ export const currencySchema = z.object({
144
+ chainId: z.number(),
145
+ contractAddress: z.string(),
146
+ name: z.string(),
147
+ symbol: z.string(),
148
+ decimals: z.number(),
149
+ imageUrl: z.string(),
150
+ exchangeRate: z.number(),
151
+ defaultChainCurrency: z.boolean(),
152
+ nativeCurrency: z.boolean(),
153
+ createdAt: z.string(),
154
+ updatedAt: z.string(),
155
+ deletedAt: z.string().optional(),
156
+ });
157
+
158
+ export const orderDataSchema = z.object({
159
+ orderId: z.string(),
160
+ quantity: z.string(),
161
+ });
162
+
163
+ export const additionalFeeSchema = z.object({
164
+ amount: z.string(),
165
+ receiver: z.string(),
166
+ });
167
+
168
+ export const postRequestSchema = z.object({
169
+ endpoint: z.string(),
170
+ method: z.string(),
171
+ body: z.any(),
172
+ });
173
+
174
+ export const createReqSchema = z.object({
175
+ tokenId: z.string(),
176
+ quantity: z.string(),
177
+ expiry: z.string(),
178
+ currencyAddress: z.string(),
179
+ pricePerToken: z.string(),
180
+ });
181
+
182
+ export const getOrdersInputSchema = z.object({
183
+ contractAddress: z.string(),
184
+ orderId: z.string(),
185
+ marketplace: marketplaceKindSchema,
186
+ });
187
+
188
+ export const domainSchema = z.object({
189
+ name: z.string(),
190
+ version: z.string(),
191
+ chainId: z.number(),
192
+ verifyingContract: z.string(),
193
+ });
194
+
195
+ export const checkoutOptionsMarketplaceOrderSchema = z.object({
196
+ contractAddress: z.string(),
197
+ orderId: z.string(),
198
+ marketplace: marketplaceKindSchema,
199
+ });
200
+
201
+ export const checkoutOptionsItemSchema = z.object({
202
+ tokenId: z.string(),
203
+ quantity: z.string(),
204
+ });
205
+
206
+ export const checkoutOptionsSchema = z.object({
207
+ crypto: transactionCryptoSchema,
208
+ swap: z.array(transactionSwapProviderSchema),
209
+ nftCheckout: z.array(transactionNFTCheckoutProviderSchema),
210
+ onRamp: z.array(transactionOnRampProviderSchema),
211
+ });
212
+
213
+ export const listCurrenciesArgsSchema = z.object({});
214
+
215
+ export const listCurrenciesReturnSchema = z.object({
216
+ currencies: z.array(currencySchema),
217
+ });
218
+
219
+ export const getCollectibleArgsSchema = z.object({
220
+ contractAddress: z.string(),
221
+ tokenId: z.string(),
222
+ });
223
+
224
+ export const getLowestPriceOfferForCollectibleArgsSchema = z.object({
225
+ contractAddress: z.string(),
226
+ tokenId: z.string(),
227
+ filter: orderFilterSchema.optional(),
228
+ });
229
+
230
+ export const getHighestPriceOfferForCollectibleArgsSchema = z.object({
231
+ contractAddress: z.string(),
232
+ tokenId: z.string(),
233
+ filter: orderFilterSchema.optional(),
234
+ });
235
+
236
+ export const getLowestPriceListingForCollectibleArgsSchema = z.object({
237
+ contractAddress: z.string(),
238
+ tokenId: z.string(),
239
+ filter: orderFilterSchema.optional(),
240
+ });
241
+
242
+ export const getHighestPriceListingForCollectibleArgsSchema = z.object({
243
+ contractAddress: z.string(),
244
+ tokenId: z.string(),
245
+ filter: orderFilterSchema.optional(),
246
+ });
247
+
248
+ export const getCollectibleLowestOfferArgsSchema = z.object({
249
+ contractAddress: z.string(),
250
+ tokenId: z.string(),
251
+ filter: orderFilterSchema.optional(),
252
+ });
253
+
254
+ export const getCollectibleHighestOfferArgsSchema = z.object({
255
+ contractAddress: z.string(),
256
+ tokenId: z.string(),
257
+ filter: orderFilterSchema.optional(),
258
+ });
259
+
260
+ export const getCollectibleLowestListingArgsSchema = z.object({
261
+ contractAddress: z.string(),
262
+ tokenId: z.string(),
263
+ filters: orderFilterSchema.optional(),
264
+ });
265
+
266
+ export const getCollectibleHighestListingArgsSchema = z.object({
267
+ contractAddress: z.string(),
268
+ tokenId: z.string(),
269
+ filter: orderFilterSchema.optional(),
270
+ });
271
+
272
+ export const generateBuyTransactionArgsSchema = z.object({
273
+ collectionAddress: z.string(),
274
+ buyer: z.string(),
275
+ marketplace: marketplaceKindSchema,
276
+ ordersData: z.array(orderDataSchema),
277
+ additionalFees: z.array(additionalFeeSchema),
278
+ walletType: walletKindSchema.optional(),
279
+ });
280
+
281
+ export const generateSellTransactionArgsSchema = z.object({
282
+ collectionAddress: z.string(),
283
+ seller: z.string(),
284
+ marketplace: marketplaceKindSchema,
285
+ ordersData: z.array(orderDataSchema),
286
+ additionalFees: z.array(additionalFeeSchema),
287
+ walletType: walletKindSchema.optional(),
288
+ });
289
+
290
+ export const generateListingTransactionArgsSchema = z.object({
291
+ collectionAddress: z.string(),
292
+ owner: z.string(),
293
+ contractType: contractTypeSchema,
294
+ orderbook: orderbookKindSchema,
295
+ listing: createReqSchema,
296
+ walletType: walletKindSchema.optional(),
297
+ });
298
+
299
+ export const generateOfferTransactionArgsSchema = z.object({
300
+ collectionAddress: z.string(),
301
+ maker: z.string(),
302
+ contractType: contractTypeSchema,
303
+ orderbook: orderbookKindSchema,
304
+ offer: createReqSchema,
305
+ walletType: walletKindSchema.optional(),
306
+ });
307
+
308
+ export const executeArgsSchema = z.object({
309
+ signature: z.string(),
310
+ executeType: executeTypeSchema,
311
+ body: z.any(),
312
+ });
313
+
314
+ export const executeReturnSchema = z.object({
315
+ orderId: z.string(),
316
+ });
317
+
318
+ export const getCountOfAllCollectiblesArgsSchema = z.object({
319
+ contractAddress: z.string(),
320
+ });
321
+
322
+ export const getCountOfAllCollectiblesReturnSchema = z.object({
323
+ count: z.number(),
324
+ });
325
+
326
+ export const getCountOfFilteredCollectiblesArgsSchema = z.object({
327
+ side: orderSideSchema,
328
+ contractAddress: z.string(),
329
+ filter: collectiblesFilterSchema.optional(),
330
+ });
331
+
332
+ export const getCountOfFilteredCollectiblesReturnSchema = z.object({
333
+ count: z.number(),
334
+ });
335
+
336
+ export const getFloorOrderArgsSchema = z.object({
337
+ contractAddress: z.string(),
338
+ filter: collectiblesFilterSchema.optional(),
339
+ });
340
+
341
+ export const syncOrderReturnSchema = z.object({});
342
+
343
+ export const syncOrdersReturnSchema = z.object({});
344
+
345
+ export const checkoutOptionsMarketplaceArgsSchema = z.object({
346
+ wallet: z.string(),
347
+ orders: z.array(checkoutOptionsMarketplaceOrderSchema),
348
+ additionalFee: z.number(),
349
+ });
350
+
351
+ export const checkoutOptionsMarketplaceReturnSchema = z.object({
352
+ options: checkoutOptionsSchema,
353
+ });
354
+
355
+ export const checkoutOptionsSalesContractArgsSchema = z.object({
356
+ wallet: z.string(),
357
+ contractAddress: z.string(),
358
+ collectionAddress: z.string(),
359
+ items: z.array(checkoutOptionsItemSchema),
360
+ });
361
+
362
+ export const checkoutOptionsSalesContractReturnSchema = z.object({
363
+ options: checkoutOptionsSchema,
364
+ });
365
+
366
+ export const tokenMetadataSchema = z.object({
367
+ tokenId: z.string(),
368
+ name: z.string(),
369
+ description: z.string().optional(),
370
+ image: z.string().optional(),
371
+ video: z.string().optional(),
372
+ audio: z.string().optional(),
373
+ properties: z.record(z.any()).optional(),
374
+ attributes: z.array(z.record(z.any())),
375
+ image_data: z.string().optional(),
376
+ external_url: z.string().optional(),
377
+ background_color: z.string().optional(),
378
+ animation_url: z.string().optional(),
379
+ decimals: z.number().optional(),
380
+ updatedAt: z.string().optional(),
381
+ assets: z.array(assetSchema).optional(),
382
+ });
383
+
384
+ export const pageSchema = z.object({
385
+ page: z.number(),
386
+ pageSize: z.number(),
387
+ more: z.boolean().optional(),
388
+ sort: z.array(sortBySchema).optional(),
389
+ });
390
+
391
+ export const filterSchema = z.object({
392
+ text: z.string().optional(),
393
+ properties: z.array(propertyFilterSchema).optional(),
394
+ });
395
+
396
+ export const orderSchema = z.object({
397
+ orderId: z.string(),
398
+ marketplace: marketplaceKindSchema,
399
+ side: orderSideSchema,
400
+ status: orderStatusSchema,
401
+ chainId: z.number(),
402
+ collectionContractAddress: z.string(),
403
+ tokenId: z.string(),
404
+ createdBy: z.string(),
405
+ priceAmount: z.string(),
406
+ priceAmountFormatted: z.string(),
407
+ priceAmountNet: z.string(),
408
+ priceAmountNetFormatted: z.string(),
409
+ priceCurrencyAddress: z.string(),
410
+ priceDecimals: z.number(),
411
+ priceUSD: z.number(),
412
+ quantityInitial: z.string(),
413
+ quantityInitialFormatted: z.string(),
414
+ quantityRemaining: z.string(),
415
+ quantityRemainingFormatted: z.string(),
416
+ quantityAvailable: z.string(),
417
+ quantityAvailableFormatted: z.string(),
418
+ quantityDecimals: z.number(),
419
+ feeBps: z.number(),
420
+ feeBreakdown: z.array(feeBreakdownSchema),
421
+ validFrom: z.string(),
422
+ validUntil: z.string(),
423
+ blockNumber: z.number(),
424
+ orderCreatedAt: z.string().optional(),
425
+ orderUpdatedAt: z.string().optional(),
426
+ createdAt: z.string(),
427
+ updatedAt: z.string(),
428
+ deletedAt: z.string().optional(),
429
+ });
430
+
431
+ export const collectibleOrderSchema = z.object({
432
+ metadata: tokenMetadataSchema,
433
+ order: orderSchema.optional(),
434
+ });
435
+
436
+ export const activitySchema = z.object({
437
+ type: z.string(),
438
+ fromAddress: z.string(),
439
+ toAddress: z.string(),
440
+ txHash: z.string(),
441
+ timestamp: z.number(),
442
+ tokenId: z.string(),
443
+ tokenImage: z.string(),
444
+ tokenName: z.string(),
445
+ currency: currencySchema.optional(),
446
+ });
447
+
448
+ export const collectionConfigSchema = z.object({
449
+ lastSynced: z.record(collectionLastSyncedSchema),
450
+ collectiblesSynced: z.string(),
451
+ });
452
+
453
+ export const signatureSchema = z.object({
454
+ domain: domainSchema,
455
+ types: z.any(),
456
+ primaryType: z.string(),
457
+ value: z.any(),
458
+ });
459
+
460
+ export const getCollectibleReturnSchema = z.object({
461
+ metadata: tokenMetadataSchema,
462
+ });
463
+
464
+ export const getLowestPriceOfferForCollectibleReturnSchema = z.object({
465
+ order: orderSchema,
466
+ });
467
+
468
+ export const getHighestPriceOfferForCollectibleReturnSchema = z.object({
469
+ order: orderSchema,
470
+ });
471
+
472
+ export const getLowestPriceListingForCollectibleReturnSchema = z.object({
473
+ order: orderSchema,
474
+ });
475
+
476
+ export const getHighestPriceListingForCollectibleReturnSchema = z.object({
477
+ order: orderSchema,
478
+ });
479
+
480
+ export const listListingsForCollectibleArgsSchema = z.object({
481
+ contractAddress: z.string(),
482
+ tokenId: z.string(),
483
+ filter: orderFilterSchema.optional(),
484
+ page: pageSchema.optional(),
485
+ });
486
+
487
+ export const listListingsForCollectibleReturnSchema = z.object({
488
+ listings: z.array(orderSchema),
489
+ page: pageSchema.optional(),
490
+ });
491
+
492
+ export const listOffersForCollectibleArgsSchema = z.object({
493
+ contractAddress: z.string(),
494
+ tokenId: z.string(),
495
+ filter: orderFilterSchema.optional(),
496
+ page: pageSchema.optional(),
497
+ });
498
+
499
+ export const listOffersForCollectibleReturnSchema = z.object({
500
+ offers: z.array(orderSchema),
501
+ page: pageSchema.optional(),
502
+ });
503
+
504
+ export const getCollectibleLowestOfferReturnSchema = z.object({
505
+ order: orderSchema.optional(),
506
+ });
507
+
508
+ export const getCollectibleHighestOfferReturnSchema = z.object({
509
+ order: orderSchema.optional(),
510
+ });
511
+
512
+ export const getCollectibleLowestListingReturnSchema = z.object({
513
+ order: orderSchema.optional(),
514
+ });
515
+
516
+ export const getCollectibleHighestListingReturnSchema = z.object({
517
+ order: orderSchema.optional(),
518
+ });
519
+
520
+ export const listCollectibleListingsArgsSchema = z.object({
521
+ contractAddress: z.string(),
522
+ tokenId: z.string(),
523
+ filter: orderFilterSchema.optional(),
524
+ page: pageSchema.optional(),
525
+ });
526
+
527
+ export const listCollectibleListingsReturnSchema = z.object({
528
+ listings: z.array(orderSchema),
529
+ page: pageSchema.optional(),
530
+ });
531
+
532
+ export const listCollectibleOffersArgsSchema = z.object({
533
+ contractAddress: z.string(),
534
+ tokenId: z.string(),
535
+ filter: orderFilterSchema.optional(),
536
+ page: pageSchema.optional(),
537
+ });
538
+
539
+ export const listCollectibleOffersReturnSchema = z.object({
540
+ offers: z.array(orderSchema),
541
+ page: pageSchema.optional(),
542
+ });
543
+
544
+ export const listCollectiblesArgsSchema = z.object({
545
+ side: orderSideSchema,
546
+ contractAddress: z.string(),
547
+ filter: collectiblesFilterSchema.optional(),
548
+ page: pageSchema.optional(),
549
+ });
550
+
551
+ export const listCollectiblesReturnSchema = z.object({
552
+ collectibles: z.array(collectibleOrderSchema),
553
+ page: pageSchema.optional(),
554
+ });
555
+
556
+ export const getFloorOrderReturnSchema = z.object({
557
+ collectible: collectibleOrderSchema,
558
+ });
559
+
560
+ export const listCollectiblesWithLowestListingArgsSchema = z.object({
561
+ contractAddress: z.string(),
562
+ filter: collectiblesFilterSchema.optional(),
563
+ page: pageSchema.optional(),
564
+ });
565
+
566
+ export const listCollectiblesWithLowestListingReturnSchema = z.object({
567
+ collectibles: z.array(collectibleOrderSchema),
568
+ page: pageSchema.optional(),
569
+ });
570
+
571
+ export const listCollectiblesWithHighestOfferArgsSchema = z.object({
572
+ contractAddress: z.string(),
573
+ filter: collectiblesFilterSchema.optional(),
574
+ page: pageSchema.optional(),
575
+ });
576
+
577
+ export const listCollectiblesWithHighestOfferReturnSchema = z.object({
578
+ collectibles: z.array(collectibleOrderSchema),
579
+ page: pageSchema.optional(),
580
+ });
581
+
582
+ export const syncOrderArgsSchema = z.object({
583
+ order: orderSchema,
584
+ });
585
+
586
+ export const syncOrdersArgsSchema = z.object({
587
+ orders: z.array(orderSchema),
588
+ });
589
+
590
+ export const getOrdersArgsSchema = z.object({
591
+ input: z.array(getOrdersInputSchema),
592
+ page: pageSchema.optional(),
593
+ });
594
+
595
+ export const getOrdersReturnSchema = z.object({
596
+ orders: z.array(orderSchema),
597
+ page: pageSchema.optional(),
598
+ });
599
+
600
+ export const collectionSchema = z.object({
601
+ status: collectionStatusSchema,
602
+ chainId: z.number(),
603
+ contractAddress: z.string(),
604
+ contractType: contractTypeSchema,
605
+ tokenQuantityDecimals: z.number(),
606
+ config: collectionConfigSchema,
607
+ createdAt: z.string(),
608
+ updatedAt: z.string(),
609
+ deletedAt: z.string().optional(),
610
+ });
611
+
612
+ export const stepSchema = z.object({
613
+ id: stepTypeSchema,
614
+ data: z.string(),
615
+ to: z.string(),
616
+ value: z.string(),
617
+ signature: signatureSchema.optional(),
618
+ post: postRequestSchema.optional(),
619
+ executeType: executeTypeSchema.optional(),
620
+ });
621
+
622
+ export const generateBuyTransactionReturnSchema = z.object({
623
+ steps: z.array(stepSchema),
624
+ });
625
+
626
+ export const generateSellTransactionReturnSchema = z.object({
627
+ steps: z.array(stepSchema),
628
+ });
629
+
630
+ export const generateListingTransactionReturnSchema = z.object({
631
+ steps: z.array(stepSchema),
632
+ });
633
+
634
+ export const generateOfferTransactionReturnSchema = z.object({
635
+ steps: z.array(stepSchema),
636
+ });