@net-protocol/bazaar 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.
@@ -0,0 +1,921 @@
1
+ import { G as GetListingsOptions, L as Listing, a as GetCollectionOffersOptions, C as CollectionOffer, b as GetErc20OffersOptions, E as Erc20Offer, W as WriteTransactionConfig, S as SeaportOrderComponents, c as SeaportSubmission, d as SeaportOrderParameters, e as SeaportOrderStatusInfo, f as SeaportOrderStatus } from './types-CY-6M9Ta.mjs';
2
+ export { h as ConsiderationItem, j as CreateCollectionOfferParams, i as CreateListingParams, I as ItemType, g as OfferItem, O as OrderType } from './types-CY-6M9Ta.mjs';
3
+ import { Seaport } from '@opensea/seaport-js';
4
+ import { PublicClient } from 'viem';
5
+ import { NetMessage } from '@net-protocol/core';
6
+
7
+ /**
8
+ * BazaarClient - Client for interacting with Net Bazaar (NFT marketplace)
9
+ *
10
+ * Provides methods for:
11
+ * - Reading NFT listings and collection offers
12
+ * - Preparing transactions for creating/canceling listings and offers
13
+ */
14
+
15
+ declare class BazaarClient {
16
+ private chainId;
17
+ private client;
18
+ private netClient;
19
+ private rpcUrl;
20
+ constructor(params: {
21
+ chainId: number;
22
+ rpcUrl?: string;
23
+ });
24
+ /**
25
+ * Get valid NFT listings for a collection
26
+ *
27
+ * Returns listings that are:
28
+ * - OPEN status (not filled, cancelled, or expired)
29
+ * - Not expired
30
+ * - Seller still owns the NFT
31
+ *
32
+ * Results are deduplicated (one per token) and sorted by price (lowest first)
33
+ */
34
+ getListings(options: GetListingsOptions): Promise<Listing[]>;
35
+ /**
36
+ * Get valid collection offers for a collection
37
+ *
38
+ * Returns offers that are:
39
+ * - OPEN status (not filled, cancelled, or expired)
40
+ * - Not expired
41
+ * - Buyer has sufficient WETH balance
42
+ *
43
+ * Results are sorted by price (highest first)
44
+ */
45
+ getCollectionOffers(options: GetCollectionOffersOptions): Promise<CollectionOffer[]>;
46
+ /**
47
+ * Get valid ERC20 offers for a token
48
+ *
49
+ * ERC20 offers are only available on Base (8453) and HyperEVM (999).
50
+ *
51
+ * Returns offers that are:
52
+ * - OPEN status (not filled, cancelled, or expired)
53
+ * - Not expired
54
+ * - Buyer has sufficient WETH balance
55
+ *
56
+ * Results are sorted by price per token (highest first)
57
+ */
58
+ getErc20Offers(options: GetErc20OffersOptions): Promise<Erc20Offer[]>;
59
+ /**
60
+ * Get the chain ID this client is configured for
61
+ */
62
+ getChainId(): number;
63
+ /**
64
+ * Get the bazaar contract address for this chain
65
+ */
66
+ getBazaarAddress(): `0x${string}`;
67
+ /**
68
+ * Get the collection offers contract address for this chain
69
+ */
70
+ getCollectionOffersAddress(): `0x${string}`;
71
+ /**
72
+ * Get the ERC20 offers contract address for this chain
73
+ * Only available on Base (8453) and HyperEVM (999)
74
+ */
75
+ getErc20OffersAddress(): `0x${string}` | undefined;
76
+ /**
77
+ * Get the Seaport contract address for this chain
78
+ */
79
+ getSeaportAddress(): `0x${string}`;
80
+ /**
81
+ * Prepare a transaction to cancel a listing
82
+ *
83
+ * The listing must have been created by the caller.
84
+ * Use the orderComponents from the Listing object returned by getListings().
85
+ */
86
+ prepareCancelListing(listing: Listing): WriteTransactionConfig;
87
+ /**
88
+ * Prepare a transaction to cancel a collection offer
89
+ *
90
+ * The offer must have been created by the caller.
91
+ * Use the orderComponents from the CollectionOffer object returned by getCollectionOffers().
92
+ */
93
+ prepareCancelCollectionOffer(offer: CollectionOffer): WriteTransactionConfig;
94
+ /**
95
+ * Prepare a transaction to cancel a Seaport order
96
+ *
97
+ * This is a low-level method. Prefer prepareCancelListing or prepareCancelCollectionOffer.
98
+ */
99
+ prepareCancelOrder(orderComponents: SeaportOrderComponents): WriteTransactionConfig;
100
+ }
101
+
102
+ /**
103
+ * Bazaar chain configuration
104
+ *
105
+ * Contains contract addresses and configuration for each supported chain.
106
+ */
107
+ interface WrappedNativeCurrency {
108
+ address: `0x${string}`;
109
+ name: string;
110
+ symbol: string;
111
+ }
112
+ interface BazaarChainConfig {
113
+ /** Main NFT listing contract */
114
+ bazaarAddress: `0x${string}`;
115
+ /** Collection offers contract */
116
+ collectionOffersAddress: `0x${string}`;
117
+ /** ERC20 offers contract (only on Base and HyperEVM) */
118
+ erc20OffersAddress?: `0x${string}`;
119
+ /** Seaport contract address */
120
+ seaportAddress: `0x${string}`;
121
+ /** Fee collector address */
122
+ feeCollectorAddress: `0x${string}`;
123
+ /** Fee in basis points for NFT trades */
124
+ nftFeeBps: number;
125
+ /** Wrapped native currency (WETH, etc.) */
126
+ wrappedNativeCurrency: WrappedNativeCurrency;
127
+ /** Address with high ETH balance for Seaport checks */
128
+ highEthAddress?: `0x${string}`;
129
+ /** Native currency symbol (lowercase) */
130
+ currencySymbol: string;
131
+ }
132
+ declare const BULK_SEAPORT_ORDER_STATUS_FETCHER_ADDRESS: "0x0000009112ABCE652674b4fE3eD9C765B22d11A7";
133
+ declare const ERC721_OWNER_OF_HELPER_ADDRESS: "0x000000aa4eFa2e5A4a6002C7F08B6e8Ec8cf1dDa";
134
+ declare const ERC20_BULK_BALANCE_CHECKER_ADDRESS: "0x000000b50a9f2923f2db931391824f6d1278f712";
135
+ declare const NET_SEAPORT_ZONE_ADDRESS: "0x000000007F8c58fbf215bF91Bda7421A806cf3ae";
136
+ declare const NET_SEAPORT_COLLECTION_OFFER_ZONE_ADDRESS: "0x000000B799ec6D7aCC1B578f62bFc324c25DFC5A";
137
+ /**
138
+ * Get bazaar configuration for a chain
139
+ */
140
+ declare function getBazaarChainConfig(chainId: number): BazaarChainConfig | undefined;
141
+ /**
142
+ * Get all supported bazaar chain IDs
143
+ */
144
+ declare function getBazaarSupportedChainIds(): number[];
145
+ /**
146
+ * Check if bazaar is supported on a chain
147
+ */
148
+ declare function isBazaarSupportedOnChain(chainId: number): boolean;
149
+ /**
150
+ * Get bazaar contract address for a chain
151
+ */
152
+ declare function getBazaarAddress(chainId: number): `0x${string}`;
153
+ /**
154
+ * Get collection offers contract address for a chain
155
+ */
156
+ declare function getCollectionOffersAddress(chainId: number): `0x${string}`;
157
+ /**
158
+ * Get Seaport contract address for a chain
159
+ */
160
+ declare function getSeaportAddress(chainId: number): `0x${string}`;
161
+ /**
162
+ * Get fee collector address for a chain
163
+ */
164
+ declare function getFeeCollectorAddress(chainId: number): `0x${string}`;
165
+ /**
166
+ * Get NFT fee in basis points for a chain
167
+ */
168
+ declare function getNftFeeBps(chainId: number): number;
169
+ /**
170
+ * Get wrapped native currency for a chain
171
+ */
172
+ declare function getWrappedNativeCurrency(chainId: number): WrappedNativeCurrency | undefined;
173
+ /**
174
+ * Get currency symbol for a chain (lowercase)
175
+ */
176
+ declare function getCurrencySymbol(chainId: number): string;
177
+ /**
178
+ * Get high ETH address for Seaport balance checks
179
+ */
180
+ declare function getHighEthAddress(chainId: number): `0x${string}` | undefined;
181
+ /**
182
+ * Get ERC20 offers contract address for a chain
183
+ * Only deployed on Base (8453) and HyperEVM (999)
184
+ */
185
+ declare function getErc20OffersAddress(chainId: number): `0x${string}` | undefined;
186
+
187
+ declare const BAZAAR_V2_ABI: readonly [{
188
+ readonly type: "function";
189
+ readonly name: "submit";
190
+ readonly inputs: readonly [{
191
+ readonly name: "submission";
192
+ readonly type: "tuple";
193
+ readonly internalType: "struct BazaarV1.Submission";
194
+ readonly components: readonly [{
195
+ readonly name: "parameters";
196
+ readonly type: "tuple";
197
+ readonly internalType: "struct OrderParameters";
198
+ readonly components: readonly [{
199
+ readonly name: "offerer";
200
+ readonly type: "address";
201
+ readonly internalType: "address";
202
+ }, {
203
+ readonly name: "zone";
204
+ readonly type: "address";
205
+ readonly internalType: "address";
206
+ }, {
207
+ readonly name: "offer";
208
+ readonly type: "tuple[]";
209
+ readonly internalType: "struct OfferItem[]";
210
+ readonly components: readonly [{
211
+ readonly name: "itemType";
212
+ readonly type: "uint8";
213
+ readonly internalType: "enum ItemType";
214
+ }, {
215
+ readonly name: "token";
216
+ readonly type: "address";
217
+ readonly internalType: "address";
218
+ }, {
219
+ readonly name: "identifierOrCriteria";
220
+ readonly type: "uint256";
221
+ readonly internalType: "uint256";
222
+ }, {
223
+ readonly name: "startAmount";
224
+ readonly type: "uint256";
225
+ readonly internalType: "uint256";
226
+ }, {
227
+ readonly name: "endAmount";
228
+ readonly type: "uint256";
229
+ readonly internalType: "uint256";
230
+ }];
231
+ }, {
232
+ readonly name: "consideration";
233
+ readonly type: "tuple[]";
234
+ readonly internalType: "struct ConsiderationItem[]";
235
+ readonly components: readonly [{
236
+ readonly name: "itemType";
237
+ readonly type: "uint8";
238
+ readonly internalType: "enum ItemType";
239
+ }, {
240
+ readonly name: "token";
241
+ readonly type: "address";
242
+ readonly internalType: "address";
243
+ }, {
244
+ readonly name: "identifierOrCriteria";
245
+ readonly type: "uint256";
246
+ readonly internalType: "uint256";
247
+ }, {
248
+ readonly name: "startAmount";
249
+ readonly type: "uint256";
250
+ readonly internalType: "uint256";
251
+ }, {
252
+ readonly name: "endAmount";
253
+ readonly type: "uint256";
254
+ readonly internalType: "uint256";
255
+ }, {
256
+ readonly name: "recipient";
257
+ readonly type: "address";
258
+ readonly internalType: "address payable";
259
+ }];
260
+ }, {
261
+ readonly name: "orderType";
262
+ readonly type: "uint8";
263
+ readonly internalType: "enum OrderType";
264
+ }, {
265
+ readonly name: "startTime";
266
+ readonly type: "uint256";
267
+ readonly internalType: "uint256";
268
+ }, {
269
+ readonly name: "endTime";
270
+ readonly type: "uint256";
271
+ readonly internalType: "uint256";
272
+ }, {
273
+ readonly name: "zoneHash";
274
+ readonly type: "bytes32";
275
+ readonly internalType: "bytes32";
276
+ }, {
277
+ readonly name: "salt";
278
+ readonly type: "uint256";
279
+ readonly internalType: "uint256";
280
+ }, {
281
+ readonly name: "conduitKey";
282
+ readonly type: "bytes32";
283
+ readonly internalType: "bytes32";
284
+ }, {
285
+ readonly name: "totalOriginalConsiderationItems";
286
+ readonly type: "uint256";
287
+ readonly internalType: "uint256";
288
+ }];
289
+ }, {
290
+ readonly name: "counter";
291
+ readonly type: "uint256";
292
+ readonly internalType: "uint256";
293
+ }, {
294
+ readonly name: "signature";
295
+ readonly type: "bytes";
296
+ readonly internalType: "bytes";
297
+ }];
298
+ }];
299
+ readonly outputs: readonly [];
300
+ readonly stateMutability: "nonpayable";
301
+ }, {
302
+ readonly type: "event";
303
+ readonly name: "Submitted";
304
+ readonly inputs: readonly [{
305
+ readonly name: "tokenAddress";
306
+ readonly type: "address";
307
+ readonly indexed: true;
308
+ readonly internalType: "address";
309
+ }, {
310
+ readonly name: "tokenId";
311
+ readonly type: "uint256";
312
+ readonly indexed: true;
313
+ readonly internalType: "uint256";
314
+ }];
315
+ readonly anonymous: false;
316
+ }, {
317
+ readonly type: "error";
318
+ readonly name: "ConsiderationItemsMustContainTwoItems";
319
+ readonly inputs: readonly [];
320
+ }, {
321
+ readonly type: "error";
322
+ readonly name: "OfferItemsMustContainOneItem";
323
+ readonly inputs: readonly [];
324
+ }];
325
+ declare const BAZAAR_COLLECTION_OFFERS_ABI: readonly [{
326
+ readonly type: "function";
327
+ readonly name: "NET_APP_NAME";
328
+ readonly inputs: readonly [];
329
+ readonly outputs: readonly [{
330
+ readonly name: "";
331
+ readonly type: "string";
332
+ readonly internalType: "string";
333
+ }];
334
+ readonly stateMutability: "view";
335
+ }, {
336
+ readonly type: "function";
337
+ readonly name: "submit";
338
+ readonly inputs: readonly [{
339
+ readonly name: "submission";
340
+ readonly type: "tuple";
341
+ readonly internalType: "struct BazaarV2CollectionOffers.Submission";
342
+ readonly components: readonly [{
343
+ readonly name: "parameters";
344
+ readonly type: "tuple";
345
+ readonly internalType: "struct OrderParameters";
346
+ readonly components: readonly [{
347
+ readonly name: "offerer";
348
+ readonly type: "address";
349
+ readonly internalType: "address";
350
+ }, {
351
+ readonly name: "zone";
352
+ readonly type: "address";
353
+ readonly internalType: "address";
354
+ }, {
355
+ readonly name: "offer";
356
+ readonly type: "tuple[]";
357
+ readonly internalType: "struct OfferItem[]";
358
+ readonly components: readonly [{
359
+ readonly name: "itemType";
360
+ readonly type: "uint8";
361
+ readonly internalType: "enum ItemType";
362
+ }, {
363
+ readonly name: "token";
364
+ readonly type: "address";
365
+ readonly internalType: "address";
366
+ }, {
367
+ readonly name: "identifierOrCriteria";
368
+ readonly type: "uint256";
369
+ readonly internalType: "uint256";
370
+ }, {
371
+ readonly name: "startAmount";
372
+ readonly type: "uint256";
373
+ readonly internalType: "uint256";
374
+ }, {
375
+ readonly name: "endAmount";
376
+ readonly type: "uint256";
377
+ readonly internalType: "uint256";
378
+ }];
379
+ }, {
380
+ readonly name: "consideration";
381
+ readonly type: "tuple[]";
382
+ readonly internalType: "struct ConsiderationItem[]";
383
+ readonly components: readonly [{
384
+ readonly name: "itemType";
385
+ readonly type: "uint8";
386
+ readonly internalType: "enum ItemType";
387
+ }, {
388
+ readonly name: "token";
389
+ readonly type: "address";
390
+ readonly internalType: "address";
391
+ }, {
392
+ readonly name: "identifierOrCriteria";
393
+ readonly type: "uint256";
394
+ readonly internalType: "uint256";
395
+ }, {
396
+ readonly name: "startAmount";
397
+ readonly type: "uint256";
398
+ readonly internalType: "uint256";
399
+ }, {
400
+ readonly name: "endAmount";
401
+ readonly type: "uint256";
402
+ readonly internalType: "uint256";
403
+ }, {
404
+ readonly name: "recipient";
405
+ readonly type: "address";
406
+ readonly internalType: "address payable";
407
+ }];
408
+ }, {
409
+ readonly name: "orderType";
410
+ readonly type: "uint8";
411
+ readonly internalType: "enum OrderType";
412
+ }, {
413
+ readonly name: "startTime";
414
+ readonly type: "uint256";
415
+ readonly internalType: "uint256";
416
+ }, {
417
+ readonly name: "endTime";
418
+ readonly type: "uint256";
419
+ readonly internalType: "uint256";
420
+ }, {
421
+ readonly name: "zoneHash";
422
+ readonly type: "bytes32";
423
+ readonly internalType: "bytes32";
424
+ }, {
425
+ readonly name: "salt";
426
+ readonly type: "uint256";
427
+ readonly internalType: "uint256";
428
+ }, {
429
+ readonly name: "conduitKey";
430
+ readonly type: "bytes32";
431
+ readonly internalType: "bytes32";
432
+ }, {
433
+ readonly name: "totalOriginalConsiderationItems";
434
+ readonly type: "uint256";
435
+ readonly internalType: "uint256";
436
+ }];
437
+ }, {
438
+ readonly name: "counter";
439
+ readonly type: "uint256";
440
+ readonly internalType: "uint256";
441
+ }, {
442
+ readonly name: "signature";
443
+ readonly type: "bytes";
444
+ readonly internalType: "bytes";
445
+ }];
446
+ }];
447
+ readonly outputs: readonly [];
448
+ readonly stateMutability: "nonpayable";
449
+ }, {
450
+ readonly type: "event";
451
+ readonly name: "Submitted";
452
+ readonly inputs: readonly [{
453
+ readonly name: "tokenAddress";
454
+ readonly type: "address";
455
+ readonly indexed: true;
456
+ readonly internalType: "address";
457
+ }, {
458
+ readonly name: "tokenId";
459
+ readonly type: "uint256";
460
+ readonly indexed: true;
461
+ readonly internalType: "uint256";
462
+ }];
463
+ readonly anonymous: false;
464
+ }, {
465
+ readonly type: "error";
466
+ readonly name: "ConsiderationItemsMustContainTwoItems";
467
+ readonly inputs: readonly [];
468
+ }, {
469
+ readonly type: "error";
470
+ readonly name: "ConsiderationItemsMustIncludeFeeAddress";
471
+ readonly inputs: readonly [];
472
+ }, {
473
+ readonly type: "error";
474
+ readonly name: "ConsiderationItemsMustIncludeMsgSender";
475
+ readonly inputs: readonly [];
476
+ }, {
477
+ readonly type: "error";
478
+ readonly name: "InvalidFee";
479
+ readonly inputs: readonly [];
480
+ }, {
481
+ readonly type: "error";
482
+ readonly name: "OfferItemsMustContainOneItem";
483
+ readonly inputs: readonly [];
484
+ }];
485
+
486
+ declare const BULK_SEAPORT_ORDER_STATUS_FETCHER_ABI: readonly [{
487
+ readonly type: "constructor";
488
+ readonly inputs: readonly [];
489
+ readonly stateMutability: "nonpayable";
490
+ }, {
491
+ readonly type: "function";
492
+ readonly name: "getOrderStatuses";
493
+ readonly inputs: readonly [{
494
+ readonly name: "seaport";
495
+ readonly type: "address";
496
+ readonly internalType: "address";
497
+ }, {
498
+ readonly name: "orderHashes";
499
+ readonly type: "bytes32[]";
500
+ readonly internalType: "bytes32[]";
501
+ }];
502
+ readonly outputs: readonly [{
503
+ readonly name: "results";
504
+ readonly type: "tuple[]";
505
+ readonly internalType: "struct BulkSeaportOrderStatusFetcher.OrderStatusInfo[]";
506
+ readonly components: readonly [{
507
+ readonly name: "isValidated";
508
+ readonly type: "bool";
509
+ readonly internalType: "bool";
510
+ }, {
511
+ readonly name: "isCancelled";
512
+ readonly type: "bool";
513
+ readonly internalType: "bool";
514
+ }, {
515
+ readonly name: "totalFilled";
516
+ readonly type: "uint256";
517
+ readonly internalType: "uint256";
518
+ }, {
519
+ readonly name: "totalSize";
520
+ readonly type: "uint256";
521
+ readonly internalType: "uint256";
522
+ }];
523
+ }];
524
+ readonly stateMutability: "view";
525
+ }];
526
+ declare const ERC721_OWNER_OF_HELPER_ABI: readonly [{
527
+ readonly type: "function";
528
+ readonly name: "getTokenOwners";
529
+ readonly inputs: readonly [{
530
+ readonly name: "nftContract";
531
+ readonly type: "address";
532
+ readonly internalType: "address";
533
+ }, {
534
+ readonly name: "tokenIds";
535
+ readonly type: "uint256[]";
536
+ readonly internalType: "uint256[]";
537
+ }];
538
+ readonly outputs: readonly [{
539
+ readonly name: "owners";
540
+ readonly type: "address[]";
541
+ readonly internalType: "address[]";
542
+ }];
543
+ readonly stateMutability: "view";
544
+ }, {
545
+ readonly type: "error";
546
+ readonly name: "InvalidAddress";
547
+ readonly inputs: readonly [];
548
+ }, {
549
+ readonly type: "error";
550
+ readonly name: "TokenQueryFailed";
551
+ readonly inputs: readonly [];
552
+ }];
553
+ declare const ERC20_BULK_BALANCE_CHECKER_ABI: readonly [{
554
+ readonly type: "function";
555
+ readonly name: "getBalances";
556
+ readonly inputs: readonly [{
557
+ readonly name: "token";
558
+ readonly type: "address";
559
+ readonly internalType: "address";
560
+ }, {
561
+ readonly name: "addresses";
562
+ readonly type: "address[]";
563
+ readonly internalType: "address[]";
564
+ }];
565
+ readonly outputs: readonly [{
566
+ readonly name: "balances";
567
+ readonly type: "uint256[]";
568
+ readonly internalType: "uint256[]";
569
+ }];
570
+ readonly stateMutability: "view";
571
+ }];
572
+
573
+ /**
574
+ * Minimal Seaport ABI for cancel operations
575
+ */
576
+ declare const SEAPORT_CANCEL_ABI: readonly [{
577
+ readonly inputs: readonly [{
578
+ readonly components: readonly [{
579
+ readonly internalType: "address";
580
+ readonly name: "offerer";
581
+ readonly type: "address";
582
+ }, {
583
+ readonly internalType: "address";
584
+ readonly name: "zone";
585
+ readonly type: "address";
586
+ }, {
587
+ readonly components: readonly [{
588
+ readonly internalType: "enum ItemType";
589
+ readonly name: "itemType";
590
+ readonly type: "uint8";
591
+ }, {
592
+ readonly internalType: "address";
593
+ readonly name: "token";
594
+ readonly type: "address";
595
+ }, {
596
+ readonly internalType: "uint256";
597
+ readonly name: "identifierOrCriteria";
598
+ readonly type: "uint256";
599
+ }, {
600
+ readonly internalType: "uint256";
601
+ readonly name: "startAmount";
602
+ readonly type: "uint256";
603
+ }, {
604
+ readonly internalType: "uint256";
605
+ readonly name: "endAmount";
606
+ readonly type: "uint256";
607
+ }];
608
+ readonly internalType: "struct OfferItem[]";
609
+ readonly name: "offer";
610
+ readonly type: "tuple[]";
611
+ }, {
612
+ readonly components: readonly [{
613
+ readonly internalType: "enum ItemType";
614
+ readonly name: "itemType";
615
+ readonly type: "uint8";
616
+ }, {
617
+ readonly internalType: "address";
618
+ readonly name: "token";
619
+ readonly type: "address";
620
+ }, {
621
+ readonly internalType: "uint256";
622
+ readonly name: "identifierOrCriteria";
623
+ readonly type: "uint256";
624
+ }, {
625
+ readonly internalType: "uint256";
626
+ readonly name: "startAmount";
627
+ readonly type: "uint256";
628
+ }, {
629
+ readonly internalType: "uint256";
630
+ readonly name: "endAmount";
631
+ readonly type: "uint256";
632
+ }, {
633
+ readonly internalType: "address payable";
634
+ readonly name: "recipient";
635
+ readonly type: "address";
636
+ }];
637
+ readonly internalType: "struct ConsiderationItem[]";
638
+ readonly name: "consideration";
639
+ readonly type: "tuple[]";
640
+ }, {
641
+ readonly internalType: "enum OrderType";
642
+ readonly name: "orderType";
643
+ readonly type: "uint8";
644
+ }, {
645
+ readonly internalType: "uint256";
646
+ readonly name: "startTime";
647
+ readonly type: "uint256";
648
+ }, {
649
+ readonly internalType: "uint256";
650
+ readonly name: "endTime";
651
+ readonly type: "uint256";
652
+ }, {
653
+ readonly internalType: "bytes32";
654
+ readonly name: "zoneHash";
655
+ readonly type: "bytes32";
656
+ }, {
657
+ readonly internalType: "uint256";
658
+ readonly name: "salt";
659
+ readonly type: "uint256";
660
+ }, {
661
+ readonly internalType: "bytes32";
662
+ readonly name: "conduitKey";
663
+ readonly type: "bytes32";
664
+ }, {
665
+ readonly internalType: "uint256";
666
+ readonly name: "counter";
667
+ readonly type: "uint256";
668
+ }];
669
+ readonly internalType: "struct OrderComponents[]";
670
+ readonly name: "orders";
671
+ readonly type: "tuple[]";
672
+ }];
673
+ readonly name: "cancel";
674
+ readonly outputs: readonly [{
675
+ readonly internalType: "bool";
676
+ readonly name: "cancelled";
677
+ readonly type: "bool";
678
+ }];
679
+ readonly stateMutability: "nonpayable";
680
+ readonly type: "function";
681
+ }];
682
+
683
+ /**
684
+ * ABI for decoding Seaport submission from Net message data
685
+ */
686
+ declare const BAZAAR_SUBMISSION_ABI: readonly [{
687
+ readonly name: "submission";
688
+ readonly type: "tuple";
689
+ readonly internalType: "struct BazaarV2.Submission";
690
+ readonly components: readonly [{
691
+ readonly name: "parameters";
692
+ readonly type: "tuple";
693
+ readonly internalType: "struct OrderParameters";
694
+ readonly components: readonly [{
695
+ readonly name: "offerer";
696
+ readonly type: "address";
697
+ readonly internalType: "address";
698
+ }, {
699
+ readonly name: "zone";
700
+ readonly type: "address";
701
+ readonly internalType: "address";
702
+ }, {
703
+ readonly name: "offer";
704
+ readonly type: "tuple[]";
705
+ readonly internalType: "struct OfferItem[]";
706
+ readonly components: readonly [{
707
+ readonly name: "itemType";
708
+ readonly type: "uint8";
709
+ readonly internalType: "enum ItemType";
710
+ }, {
711
+ readonly name: "token";
712
+ readonly type: "address";
713
+ readonly internalType: "address";
714
+ }, {
715
+ readonly name: "identifierOrCriteria";
716
+ readonly type: "uint256";
717
+ readonly internalType: "uint256";
718
+ }, {
719
+ readonly name: "startAmount";
720
+ readonly type: "uint256";
721
+ readonly internalType: "uint256";
722
+ }, {
723
+ readonly name: "endAmount";
724
+ readonly type: "uint256";
725
+ readonly internalType: "uint256";
726
+ }];
727
+ }, {
728
+ readonly name: "consideration";
729
+ readonly type: "tuple[]";
730
+ readonly internalType: "struct ConsiderationItem[]";
731
+ readonly components: readonly [{
732
+ readonly name: "itemType";
733
+ readonly type: "uint8";
734
+ readonly internalType: "enum ItemType";
735
+ }, {
736
+ readonly name: "token";
737
+ readonly type: "address";
738
+ readonly internalType: "address";
739
+ }, {
740
+ readonly name: "identifierOrCriteria";
741
+ readonly type: "uint256";
742
+ readonly internalType: "uint256";
743
+ }, {
744
+ readonly name: "startAmount";
745
+ readonly type: "uint256";
746
+ readonly internalType: "uint256";
747
+ }, {
748
+ readonly name: "endAmount";
749
+ readonly type: "uint256";
750
+ readonly internalType: "uint256";
751
+ }, {
752
+ readonly name: "recipient";
753
+ readonly type: "address";
754
+ readonly internalType: "address payable";
755
+ }];
756
+ }, {
757
+ readonly name: "orderType";
758
+ readonly type: "uint8";
759
+ readonly internalType: "enum OrderType";
760
+ }, {
761
+ readonly name: "startTime";
762
+ readonly type: "uint256";
763
+ readonly internalType: "uint256";
764
+ }, {
765
+ readonly name: "endTime";
766
+ readonly type: "uint256";
767
+ readonly internalType: "uint256";
768
+ }, {
769
+ readonly name: "zoneHash";
770
+ readonly type: "bytes32";
771
+ readonly internalType: "bytes32";
772
+ }, {
773
+ readonly name: "salt";
774
+ readonly type: "uint256";
775
+ readonly internalType: "uint256";
776
+ }, {
777
+ readonly name: "conduitKey";
778
+ readonly type: "bytes32";
779
+ readonly internalType: "bytes32";
780
+ }, {
781
+ readonly name: "totalOriginalConsiderationItems";
782
+ readonly type: "uint256";
783
+ readonly internalType: "uint256";
784
+ }];
785
+ }, {
786
+ readonly name: "counter";
787
+ readonly type: "uint256";
788
+ readonly internalType: "uint256";
789
+ }, {
790
+ readonly name: "signature";
791
+ readonly type: "bytes";
792
+ readonly internalType: "bytes";
793
+ }];
794
+ }];
795
+
796
+ /**
797
+ * Seaport-related utilities for decoding and computing order hashes
798
+ */
799
+
800
+ /**
801
+ * Decode Seaport submission from Net message data
802
+ */
803
+ declare function decodeSeaportSubmission(messageData: `0x${string}`): SeaportSubmission;
804
+ /**
805
+ * Get Seaport order from message data with string identifiers
806
+ * (needed for Seaport SDK compatibility)
807
+ */
808
+ declare function getSeaportOrderFromMessageData(messageData: `0x${string}`): {
809
+ parameters: any;
810
+ signature: `0x${string}`;
811
+ counter: bigint;
812
+ };
813
+ /**
814
+ * Create a Seaport instance for a chain using a public RPC
815
+ */
816
+ declare function createSeaportInstance(chainId: number, rpcUrl: string): Seaport;
817
+ /**
818
+ * Compute Seaport order hash
819
+ */
820
+ declare function computeOrderHash(seaport: Seaport, orderParameters: any, counter: bigint | string): string;
821
+ /**
822
+ * Determine order status from on-chain status info
823
+ */
824
+ declare function getOrderStatusFromInfo(orderParameters: SeaportOrderParameters, statusInfo: SeaportOrderStatusInfo): SeaportOrderStatus;
825
+ /**
826
+ * Calculate total consideration amount (price) from order
827
+ */
828
+ declare function getTotalConsiderationAmount(parameters: SeaportOrderParameters): bigint;
829
+ /**
830
+ * Format price from wei to display string
831
+ */
832
+ declare function formatPrice(priceWei: bigint): number;
833
+
834
+ /**
835
+ * Validation utilities for checking order status and ownership
836
+ */
837
+
838
+ /**
839
+ * Bulk fetch Seaport order statuses
840
+ */
841
+ declare function bulkFetchOrderStatuses(client: PublicClient, chainId: number, orderHashes: `0x${string}`[]): Promise<SeaportOrderStatusInfo[]>;
842
+ /**
843
+ * Create a mapping of order hash to status
844
+ */
845
+ declare function createOrderStatusMap(client: PublicClient, chainId: number, orderHashes: `0x${string}`[]): Promise<Map<string, SeaportOrderStatusInfo>>;
846
+ /**
847
+ * Bulk fetch NFT owners for specific token IDs
848
+ */
849
+ declare function bulkFetchNftOwners(client: PublicClient, nftAddress: `0x${string}`, tokenIds: string[]): Promise<(`0x${string}` | null)[]>;
850
+ /**
851
+ * Create a mapping of token ID to owner address
852
+ */
853
+ declare function createOwnershipMap(client: PublicClient, nftAddress: `0x${string}`, tokenIds: string[]): Promise<Map<string, `0x${string}` | null>>;
854
+ /**
855
+ * Bulk fetch ERC20 balances for addresses
856
+ */
857
+ declare function bulkFetchErc20Balances(client: PublicClient, tokenAddress: `0x${string}`, addresses: `0x${string}`[]): Promise<bigint[]>;
858
+ /**
859
+ * Create a mapping of address to ERC20 balance
860
+ */
861
+ declare function createBalanceMap(client: PublicClient, tokenAddress: `0x${string}`, addresses: `0x${string}`[]): Promise<Map<string, bigint>>;
862
+ /**
863
+ * Validate that a listing is still valid:
864
+ * - Order is OPEN
865
+ * - Not expired
866
+ * - Seller still owns the NFT
867
+ */
868
+ declare function isListingValid(orderStatus: SeaportOrderStatus, expirationDate: number, sellerAddress: `0x${string}`, currentOwner: `0x${string}` | null): boolean;
869
+ /**
870
+ * Validate that a collection offer is still valid:
871
+ * - Order is OPEN
872
+ * - Not expired
873
+ * - Buyer has sufficient WETH balance
874
+ */
875
+ declare function isCollectionOfferValid(orderStatus: SeaportOrderStatus, expirationDate: number, priceWei: bigint, buyerBalance: bigint): boolean;
876
+ /**
877
+ * Validate that an ERC20 offer is still valid:
878
+ * - Order is OPEN
879
+ * - Not expired
880
+ * - Buyer has sufficient WETH balance
881
+ */
882
+ declare function isErc20OfferValid(orderStatus: SeaportOrderStatus, expirationDate: number, priceWei: bigint, buyerWethBalance: bigint): boolean;
883
+
884
+ /**
885
+ * Utilities for parsing Net messages into listings and offers
886
+ */
887
+
888
+ /**
889
+ * Parse a Net message into an NFT listing
890
+ */
891
+ declare function parseListingFromMessage(message: NetMessage, chainId: number): Listing | null;
892
+ /**
893
+ * Parse a Net message into a collection offer
894
+ */
895
+ declare function parseCollectionOfferFromMessage(message: NetMessage, chainId: number): CollectionOffer | null;
896
+ /**
897
+ * Get the best listing for each token (lowest price)
898
+ */
899
+ declare function getBestListingPerToken(listings: Listing[]): Listing[];
900
+ /**
901
+ * Get the best collection offer (highest price)
902
+ */
903
+ declare function getBestCollectionOffer(offers: CollectionOffer[]): CollectionOffer | null;
904
+ /**
905
+ * Sort listings by price (lowest first)
906
+ */
907
+ declare function sortListingsByPrice(listings: Listing[]): Listing[];
908
+ /**
909
+ * Sort offers by price (highest first)
910
+ */
911
+ declare function sortOffersByPrice(offers: CollectionOffer[]): CollectionOffer[];
912
+ /**
913
+ * Parse a Net message into an ERC20 offer
914
+ */
915
+ declare function parseErc20OfferFromMessage(message: NetMessage, chainId: number): Erc20Offer | null;
916
+ /**
917
+ * Sort ERC20 offers by price per token (highest first)
918
+ */
919
+ declare function sortErc20OffersByPricePerToken(offers: Erc20Offer[]): Erc20Offer[];
920
+
921
+ export { BAZAAR_COLLECTION_OFFERS_ABI, BAZAAR_SUBMISSION_ABI, BAZAAR_V2_ABI, BULK_SEAPORT_ORDER_STATUS_FETCHER_ABI, BULK_SEAPORT_ORDER_STATUS_FETCHER_ADDRESS, type BazaarChainConfig, BazaarClient, CollectionOffer, ERC20_BULK_BALANCE_CHECKER_ABI, ERC20_BULK_BALANCE_CHECKER_ADDRESS, ERC721_OWNER_OF_HELPER_ABI, ERC721_OWNER_OF_HELPER_ADDRESS, Erc20Offer, GetCollectionOffersOptions, GetErc20OffersOptions, GetListingsOptions, Listing, NET_SEAPORT_COLLECTION_OFFER_ZONE_ADDRESS, NET_SEAPORT_ZONE_ADDRESS, SEAPORT_CANCEL_ABI, SeaportOrderComponents, SeaportOrderParameters, SeaportOrderStatus, SeaportOrderStatusInfo, SeaportSubmission, type WrappedNativeCurrency, WriteTransactionConfig, bulkFetchErc20Balances, bulkFetchNftOwners, bulkFetchOrderStatuses, computeOrderHash, createBalanceMap, createOrderStatusMap, createOwnershipMap, createSeaportInstance, decodeSeaportSubmission, formatPrice, getBazaarAddress, getBazaarChainConfig, getBazaarSupportedChainIds, getBestCollectionOffer, getBestListingPerToken, getCollectionOffersAddress, getCurrencySymbol, getErc20OffersAddress, getFeeCollectorAddress, getHighEthAddress, getNftFeeBps, getOrderStatusFromInfo, getSeaportAddress, getSeaportOrderFromMessageData, getTotalConsiderationAmount, getWrappedNativeCurrency, isBazaarSupportedOnChain, isCollectionOfferValid, isErc20OfferValid, isListingValid, parseCollectionOfferFromMessage, parseErc20OfferFromMessage, parseListingFromMessage, sortErc20OffersByPricePerToken, sortListingsByPrice, sortOffersByPrice };