@net-protocol/bazaar 0.1.7 → 0.1.9

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/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { PublicClient } from 'viem';
2
2
  import { NetMessage } from '@net-protocol/core';
3
- import { G as GetListingsOptions, L as Listing, a as GetCollectionOffersOptions, C as CollectionOffer, b as GetErc20OffersOptions, E as Erc20Offer, c as GetErc20ListingsOptions, d as Erc20Listing, e as GetSalesOptions, S as Sale, W as WriteTransactionConfig, f as SeaportOrderComponents, g as SeaportSubmission, h as SeaportOrderParameters, i as SeaportOrderStatusInfo, j as SeaportOrderStatus } from './types-5kMf461x.mjs';
4
- export { l as ConsiderationItem, n as CreateCollectionOfferParams, m as CreateListingParams, I as ItemType, k as OfferItem, O as OrderType } from './types-5kMf461x.mjs';
3
+ import { G as GetListingsOptions, L as Listing, a as GetCollectionOffersOptions, C as CollectionOffer, b as GetErc20OffersOptions, E as Erc20Offer, c as GetErc20ListingsOptions, d as Erc20Listing, e as GetSalesOptions, S as Sale, W as WriteTransactionConfig, f as SeaportOrderComponents, P as PreparedFulfillment, g as CreateListingParams, h as PreparedOrder, i as CreateCollectionOfferParams, j as CreateErc20OfferParams, k as CreateErc20ListingParams, l as SeaportOrderParameters, m as SeaportSubmission, n as SeaportOrderStatusInfo, o as SeaportOrderStatus, p as EIP712OrderData } from './types-oOrmJnNJ.mjs';
4
+ export { q as ConsiderationItem, I as ItemType, O as OfferItem, r as OrderType } from './types-oOrmJnNJ.mjs';
5
5
  import { Seaport } from '@opensea/seaport-js';
6
6
 
7
7
  /**
@@ -165,6 +165,112 @@ declare class BazaarClient {
165
165
  * This is a low-level method. Prefer prepareCancelListing or prepareCancelCollectionOffer.
166
166
  */
167
167
  prepareCancelOrder(orderComponents: SeaportOrderComponents): WriteTransactionConfig;
168
+ /**
169
+ * Prepare a fulfillment for an NFT listing (buy an NFT).
170
+ *
171
+ * Returns approval transactions (if the listing requires ERC20 payment) and
172
+ * the Seaport `fulfillAdvancedOrder` transaction with the correct native currency value.
173
+ */
174
+ prepareFulfillListing(listing: Listing, fulfillerAddress: `0x${string}`): Promise<PreparedFulfillment>;
175
+ /**
176
+ * Prepare a fulfillment for a collection offer (sell your NFT into an offer).
177
+ *
178
+ * Returns ERC721 approval transaction (if the NFT isn't approved for Seaport)
179
+ * and the Seaport `fulfillAdvancedOrder` transaction.
180
+ */
181
+ prepareFulfillCollectionOffer(offer: CollectionOffer, tokenId: string, fulfillerAddress: `0x${string}`): Promise<PreparedFulfillment>;
182
+ /**
183
+ * Prepare a fulfillment for an ERC20 offer (sell your ERC20 tokens into an offer).
184
+ *
185
+ * Returns ERC20 approval transaction (if the token isn't approved for Seaport)
186
+ * and the Seaport `fulfillOrder` transaction.
187
+ */
188
+ prepareFulfillErc20Offer(offer: Erc20Offer, fulfillerAddress: `0x${string}`): Promise<PreparedFulfillment>;
189
+ /**
190
+ * Prepare a fulfillment for an ERC20 listing (buy ERC20 tokens with native currency).
191
+ *
192
+ * Returns the Seaport `fulfillAdvancedOrder` transaction with the correct native currency value.
193
+ * No approvals needed since the buyer pays in native currency.
194
+ */
195
+ prepareFulfillErc20Listing(listing: Erc20Listing, fulfillerAddress: `0x${string}`): Promise<PreparedFulfillment>;
196
+ /**
197
+ * Fetch the Seaport counter for an address
198
+ */
199
+ private getSeaportCounter;
200
+ /**
201
+ * Prepare an NFT listing order for signing.
202
+ *
203
+ * Returns EIP-712 typed data for the caller to sign, plus any maker approvals needed
204
+ * (ERC721 `setApprovalForAll` for Seaport).
205
+ */
206
+ prepareCreateListing(params: CreateListingParams & {
207
+ offerer: `0x${string}`;
208
+ targetFulfiller?: `0x${string}`;
209
+ }): Promise<PreparedOrder>;
210
+ /**
211
+ * Prepare a collection offer order for signing.
212
+ *
213
+ * Returns EIP-712 typed data for the caller to sign, plus any maker approvals needed
214
+ * (WETH `approve` for Seaport).
215
+ */
216
+ prepareCreateCollectionOffer(params: CreateCollectionOfferParams & {
217
+ offerer: `0x${string}`;
218
+ }): Promise<PreparedOrder>;
219
+ /**
220
+ * Prepare an ERC20 offer order for signing.
221
+ *
222
+ * Returns EIP-712 typed data for the caller to sign, plus any maker approvals needed
223
+ * (WETH `approve` for Seaport).
224
+ */
225
+ prepareCreateErc20Offer(params: CreateErc20OfferParams & {
226
+ offerer: `0x${string}`;
227
+ }): Promise<PreparedOrder>;
228
+ /**
229
+ * Prepare an ERC20 listing order for signing.
230
+ *
231
+ * Returns EIP-712 typed data for the caller to sign, plus any maker approvals needed
232
+ * (ERC20 `approve` for Seaport).
233
+ */
234
+ prepareCreateErc20Listing(params: CreateErc20ListingParams & {
235
+ offerer: `0x${string}`;
236
+ targetFulfiller?: `0x${string}`;
237
+ }): Promise<PreparedOrder>;
238
+ /**
239
+ * Prepare a submit transaction for an NFT listing.
240
+ *
241
+ * Call this after the user has signed the EIP-712 data from prepareCreateListing().
242
+ */
243
+ prepareSubmitListing(orderParameters: SeaportOrderParameters, counter: bigint, signature: `0x${string}`): WriteTransactionConfig;
244
+ /**
245
+ * Prepare a submit transaction for a collection offer.
246
+ *
247
+ * Call this after the user has signed the EIP-712 data from prepareCreateCollectionOffer().
248
+ */
249
+ prepareSubmitCollectionOffer(orderParameters: SeaportOrderParameters, counter: bigint, signature: `0x${string}`): WriteTransactionConfig;
250
+ /**
251
+ * Prepare a submit transaction for an ERC20 offer.
252
+ *
253
+ * Call this after the user has signed the EIP-712 data from prepareCreateErc20Offer().
254
+ */
255
+ prepareSubmitErc20Offer(orderParameters: SeaportOrderParameters, counter: bigint, signature: `0x${string}`): WriteTransactionConfig;
256
+ /**
257
+ * Prepare a submit transaction for an ERC20 listing.
258
+ *
259
+ * Call this after the user has signed the EIP-712 data from prepareCreateErc20Listing().
260
+ */
261
+ prepareSubmitErc20Listing(orderParameters: SeaportOrderParameters, counter: bigint, signature: `0x${string}`): WriteTransactionConfig;
262
+ /**
263
+ * Get token IDs owned by an address for an ERC721 collection.
264
+ *
265
+ * Uses the on-chain ERC721TokenOwnerRangeHelper contract, batching
266
+ * large ranges into 5000-token chunks to avoid RPC limits.
267
+ */
268
+ getOwnedTokens(params: {
269
+ nftAddress: `0x${string}`;
270
+ ownerAddress: `0x${string}`;
271
+ startTokenId?: bigint;
272
+ endTokenId?: bigint;
273
+ }): Promise<bigint[]>;
168
274
  }
169
275
 
170
276
  /**
@@ -557,6 +663,124 @@ declare const BAZAAR_COLLECTION_OFFERS_ABI: readonly [{
557
663
  readonly name: "OfferItemsMustContainOneItem";
558
664
  readonly inputs: readonly [];
559
665
  }];
666
+ /**
667
+ * ERC20 offers contract ABI (same submit signature as collection offers, different contract address)
668
+ */
669
+ declare const BAZAAR_ERC20_OFFERS_ABI: readonly [{
670
+ readonly type: "function";
671
+ readonly name: "submit";
672
+ readonly inputs: readonly [{
673
+ readonly name: "submission";
674
+ readonly type: "tuple";
675
+ readonly internalType: "struct BazaarV2CollectionOffers.Submission";
676
+ readonly components: readonly [{
677
+ readonly name: "parameters";
678
+ readonly type: "tuple";
679
+ readonly internalType: "struct OrderParameters";
680
+ readonly components: readonly [{
681
+ readonly name: "offerer";
682
+ readonly type: "address";
683
+ readonly internalType: "address";
684
+ }, {
685
+ readonly name: "zone";
686
+ readonly type: "address";
687
+ readonly internalType: "address";
688
+ }, {
689
+ readonly name: "offer";
690
+ readonly type: "tuple[]";
691
+ readonly internalType: "struct OfferItem[]";
692
+ readonly components: readonly [{
693
+ readonly name: "itemType";
694
+ readonly type: "uint8";
695
+ readonly internalType: "enum ItemType";
696
+ }, {
697
+ readonly name: "token";
698
+ readonly type: "address";
699
+ readonly internalType: "address";
700
+ }, {
701
+ readonly name: "identifierOrCriteria";
702
+ readonly type: "uint256";
703
+ readonly internalType: "uint256";
704
+ }, {
705
+ readonly name: "startAmount";
706
+ readonly type: "uint256";
707
+ readonly internalType: "uint256";
708
+ }, {
709
+ readonly name: "endAmount";
710
+ readonly type: "uint256";
711
+ readonly internalType: "uint256";
712
+ }];
713
+ }, {
714
+ readonly name: "consideration";
715
+ readonly type: "tuple[]";
716
+ readonly internalType: "struct ConsiderationItem[]";
717
+ readonly components: readonly [{
718
+ readonly name: "itemType";
719
+ readonly type: "uint8";
720
+ readonly internalType: "enum ItemType";
721
+ }, {
722
+ readonly name: "token";
723
+ readonly type: "address";
724
+ readonly internalType: "address";
725
+ }, {
726
+ readonly name: "identifierOrCriteria";
727
+ readonly type: "uint256";
728
+ readonly internalType: "uint256";
729
+ }, {
730
+ readonly name: "startAmount";
731
+ readonly type: "uint256";
732
+ readonly internalType: "uint256";
733
+ }, {
734
+ readonly name: "endAmount";
735
+ readonly type: "uint256";
736
+ readonly internalType: "uint256";
737
+ }, {
738
+ readonly name: "recipient";
739
+ readonly type: "address";
740
+ readonly internalType: "address payable";
741
+ }];
742
+ }, {
743
+ readonly name: "orderType";
744
+ readonly type: "uint8";
745
+ readonly internalType: "enum OrderType";
746
+ }, {
747
+ readonly name: "startTime";
748
+ readonly type: "uint256";
749
+ readonly internalType: "uint256";
750
+ }, {
751
+ readonly name: "endTime";
752
+ readonly type: "uint256";
753
+ readonly internalType: "uint256";
754
+ }, {
755
+ readonly name: "zoneHash";
756
+ readonly type: "bytes32";
757
+ readonly internalType: "bytes32";
758
+ }, {
759
+ readonly name: "salt";
760
+ readonly type: "uint256";
761
+ readonly internalType: "uint256";
762
+ }, {
763
+ readonly name: "conduitKey";
764
+ readonly type: "bytes32";
765
+ readonly internalType: "bytes32";
766
+ }, {
767
+ readonly name: "totalOriginalConsiderationItems";
768
+ readonly type: "uint256";
769
+ readonly internalType: "uint256";
770
+ }];
771
+ }, {
772
+ readonly name: "counter";
773
+ readonly type: "uint256";
774
+ readonly internalType: "uint256";
775
+ }, {
776
+ readonly name: "signature";
777
+ readonly type: "bytes";
778
+ readonly internalType: "bytes";
779
+ }];
780
+ }];
781
+ readonly outputs: readonly [];
782
+ readonly stateMutability: "nonpayable";
783
+ }];
560
784
 
561
785
  declare const BULK_SEAPORT_ORDER_STATUS_FETCHER_ABI: readonly [{
562
786
  readonly type: "constructor";
@@ -754,51 +978,430 @@ declare const SEAPORT_CANCEL_ABI: readonly [{
754
978
  readonly stateMutability: "nonpayable";
755
979
  readonly type: "function";
756
980
  }];
757
-
758
981
  /**
759
- * ABI for decoding Seaport submission from Net message data
982
+ * Seaport fulfillOrder ABI
760
983
  */
761
- declare const BAZAAR_SUBMISSION_ABI: readonly [{
762
- readonly name: "submission";
763
- readonly type: "tuple";
764
- readonly internalType: "struct BazaarV2.Submission";
765
- readonly components: readonly [{
766
- readonly name: "parameters";
767
- readonly type: "tuple";
768
- readonly internalType: "struct OrderParameters";
984
+ declare const SEAPORT_FULFILL_ORDER_ABI: readonly [{
985
+ readonly inputs: readonly [{
769
986
  readonly components: readonly [{
770
- readonly name: "offerer";
771
- readonly type: "address";
772
- readonly internalType: "address";
773
- }, {
774
- readonly name: "zone";
775
- readonly type: "address";
776
- readonly internalType: "address";
777
- }, {
778
- readonly name: "offer";
779
- readonly type: "tuple[]";
780
- readonly internalType: "struct OfferItem[]";
781
987
  readonly components: readonly [{
782
- readonly name: "itemType";
783
- readonly type: "uint8";
784
- readonly internalType: "enum ItemType";
785
- }, {
786
- readonly name: "token";
988
+ readonly internalType: "address";
989
+ readonly name: "offerer";
787
990
  readonly type: "address";
991
+ }, {
788
992
  readonly internalType: "address";
993
+ readonly name: "zone";
994
+ readonly type: "address";
789
995
  }, {
790
- readonly name: "identifierOrCriteria";
791
- readonly type: "uint256";
792
- readonly internalType: "uint256";
996
+ readonly components: readonly [{
997
+ readonly internalType: "enum ItemType";
998
+ readonly name: "itemType";
999
+ readonly type: "uint8";
1000
+ }, {
1001
+ readonly internalType: "address";
1002
+ readonly name: "token";
1003
+ readonly type: "address";
1004
+ }, {
1005
+ readonly internalType: "uint256";
1006
+ readonly name: "identifierOrCriteria";
1007
+ readonly type: "uint256";
1008
+ }, {
1009
+ readonly internalType: "uint256";
1010
+ readonly name: "startAmount";
1011
+ readonly type: "uint256";
1012
+ }, {
1013
+ readonly internalType: "uint256";
1014
+ readonly name: "endAmount";
1015
+ readonly type: "uint256";
1016
+ }];
1017
+ readonly internalType: "struct OfferItem[]";
1018
+ readonly name: "offer";
1019
+ readonly type: "tuple[]";
793
1020
  }, {
794
- readonly name: "startAmount";
795
- readonly type: "uint256";
796
- readonly internalType: "uint256";
1021
+ readonly components: readonly [{
1022
+ readonly internalType: "enum ItemType";
1023
+ readonly name: "itemType";
1024
+ readonly type: "uint8";
1025
+ }, {
1026
+ readonly internalType: "address";
1027
+ readonly name: "token";
1028
+ readonly type: "address";
1029
+ }, {
1030
+ readonly internalType: "uint256";
1031
+ readonly name: "identifierOrCriteria";
1032
+ readonly type: "uint256";
1033
+ }, {
1034
+ readonly internalType: "uint256";
1035
+ readonly name: "startAmount";
1036
+ readonly type: "uint256";
1037
+ }, {
1038
+ readonly internalType: "uint256";
1039
+ readonly name: "endAmount";
1040
+ readonly type: "uint256";
1041
+ }, {
1042
+ readonly internalType: "address payable";
1043
+ readonly name: "recipient";
1044
+ readonly type: "address";
1045
+ }];
1046
+ readonly internalType: "struct ConsiderationItem[]";
1047
+ readonly name: "consideration";
1048
+ readonly type: "tuple[]";
797
1049
  }, {
798
- readonly name: "endAmount";
1050
+ readonly internalType: "enum OrderType";
1051
+ readonly name: "orderType";
1052
+ readonly type: "uint8";
1053
+ }, {
1054
+ readonly internalType: "uint256";
1055
+ readonly name: "startTime";
799
1056
  readonly type: "uint256";
1057
+ }, {
800
1058
  readonly internalType: "uint256";
801
- }];
1059
+ readonly name: "endTime";
1060
+ readonly type: "uint256";
1061
+ }, {
1062
+ readonly internalType: "bytes32";
1063
+ readonly name: "zoneHash";
1064
+ readonly type: "bytes32";
1065
+ }, {
1066
+ readonly internalType: "uint256";
1067
+ readonly name: "salt";
1068
+ readonly type: "uint256";
1069
+ }, {
1070
+ readonly internalType: "bytes32";
1071
+ readonly name: "conduitKey";
1072
+ readonly type: "bytes32";
1073
+ }, {
1074
+ readonly internalType: "uint256";
1075
+ readonly name: "totalOriginalConsiderationItems";
1076
+ readonly type: "uint256";
1077
+ }];
1078
+ readonly internalType: "struct OrderParameters";
1079
+ readonly name: "parameters";
1080
+ readonly type: "tuple";
1081
+ }, {
1082
+ readonly internalType: "bytes";
1083
+ readonly name: "signature";
1084
+ readonly type: "bytes";
1085
+ }];
1086
+ readonly internalType: "struct Order";
1087
+ readonly name: "";
1088
+ readonly type: "tuple";
1089
+ }, {
1090
+ readonly internalType: "bytes32";
1091
+ readonly name: "fulfillerConduitKey";
1092
+ readonly type: "bytes32";
1093
+ }];
1094
+ readonly name: "fulfillOrder";
1095
+ readonly outputs: readonly [{
1096
+ readonly internalType: "bool";
1097
+ readonly name: "fulfilled";
1098
+ readonly type: "bool";
1099
+ }];
1100
+ readonly stateMutability: "payable";
1101
+ readonly type: "function";
1102
+ }];
1103
+ /**
1104
+ * Seaport fulfillAdvancedOrder ABI
1105
+ */
1106
+ declare const SEAPORT_FULFILL_ADVANCED_ORDER_ABI: readonly [{
1107
+ readonly inputs: readonly [{
1108
+ readonly components: readonly [{
1109
+ readonly components: readonly [{
1110
+ readonly internalType: "address";
1111
+ readonly name: "offerer";
1112
+ readonly type: "address";
1113
+ }, {
1114
+ readonly internalType: "address";
1115
+ readonly name: "zone";
1116
+ readonly type: "address";
1117
+ }, {
1118
+ readonly components: readonly [{
1119
+ readonly internalType: "enum ItemType";
1120
+ readonly name: "itemType";
1121
+ readonly type: "uint8";
1122
+ }, {
1123
+ readonly internalType: "address";
1124
+ readonly name: "token";
1125
+ readonly type: "address";
1126
+ }, {
1127
+ readonly internalType: "uint256";
1128
+ readonly name: "identifierOrCriteria";
1129
+ readonly type: "uint256";
1130
+ }, {
1131
+ readonly internalType: "uint256";
1132
+ readonly name: "startAmount";
1133
+ readonly type: "uint256";
1134
+ }, {
1135
+ readonly internalType: "uint256";
1136
+ readonly name: "endAmount";
1137
+ readonly type: "uint256";
1138
+ }];
1139
+ readonly internalType: "struct OfferItem[]";
1140
+ readonly name: "offer";
1141
+ readonly type: "tuple[]";
1142
+ }, {
1143
+ readonly components: readonly [{
1144
+ readonly internalType: "enum ItemType";
1145
+ readonly name: "itemType";
1146
+ readonly type: "uint8";
1147
+ }, {
1148
+ readonly internalType: "address";
1149
+ readonly name: "token";
1150
+ readonly type: "address";
1151
+ }, {
1152
+ readonly internalType: "uint256";
1153
+ readonly name: "identifierOrCriteria";
1154
+ readonly type: "uint256";
1155
+ }, {
1156
+ readonly internalType: "uint256";
1157
+ readonly name: "startAmount";
1158
+ readonly type: "uint256";
1159
+ }, {
1160
+ readonly internalType: "uint256";
1161
+ readonly name: "endAmount";
1162
+ readonly type: "uint256";
1163
+ }, {
1164
+ readonly internalType: "address payable";
1165
+ readonly name: "recipient";
1166
+ readonly type: "address";
1167
+ }];
1168
+ readonly internalType: "struct ConsiderationItem[]";
1169
+ readonly name: "consideration";
1170
+ readonly type: "tuple[]";
1171
+ }, {
1172
+ readonly internalType: "enum OrderType";
1173
+ readonly name: "orderType";
1174
+ readonly type: "uint8";
1175
+ }, {
1176
+ readonly internalType: "uint256";
1177
+ readonly name: "startTime";
1178
+ readonly type: "uint256";
1179
+ }, {
1180
+ readonly internalType: "uint256";
1181
+ readonly name: "endTime";
1182
+ readonly type: "uint256";
1183
+ }, {
1184
+ readonly internalType: "bytes32";
1185
+ readonly name: "zoneHash";
1186
+ readonly type: "bytes32";
1187
+ }, {
1188
+ readonly internalType: "uint256";
1189
+ readonly name: "salt";
1190
+ readonly type: "uint256";
1191
+ }, {
1192
+ readonly internalType: "bytes32";
1193
+ readonly name: "conduitKey";
1194
+ readonly type: "bytes32";
1195
+ }, {
1196
+ readonly internalType: "uint256";
1197
+ readonly name: "totalOriginalConsiderationItems";
1198
+ readonly type: "uint256";
1199
+ }];
1200
+ readonly internalType: "struct OrderParameters";
1201
+ readonly name: "parameters";
1202
+ readonly type: "tuple";
1203
+ }, {
1204
+ readonly internalType: "uint120";
1205
+ readonly name: "numerator";
1206
+ readonly type: "uint120";
1207
+ }, {
1208
+ readonly internalType: "uint120";
1209
+ readonly name: "denominator";
1210
+ readonly type: "uint120";
1211
+ }, {
1212
+ readonly internalType: "bytes";
1213
+ readonly name: "signature";
1214
+ readonly type: "bytes";
1215
+ }, {
1216
+ readonly internalType: "bytes";
1217
+ readonly name: "extraData";
1218
+ readonly type: "bytes";
1219
+ }];
1220
+ readonly internalType: "struct AdvancedOrder";
1221
+ readonly name: "";
1222
+ readonly type: "tuple";
1223
+ }, {
1224
+ readonly components: readonly [{
1225
+ readonly internalType: "uint256";
1226
+ readonly name: "orderIndex";
1227
+ readonly type: "uint256";
1228
+ }, {
1229
+ readonly internalType: "enum Side";
1230
+ readonly name: "side";
1231
+ readonly type: "uint8";
1232
+ }, {
1233
+ readonly internalType: "uint256";
1234
+ readonly name: "index";
1235
+ readonly type: "uint256";
1236
+ }, {
1237
+ readonly internalType: "uint256";
1238
+ readonly name: "identifier";
1239
+ readonly type: "uint256";
1240
+ }, {
1241
+ readonly internalType: "bytes32[]";
1242
+ readonly name: "criteriaProof";
1243
+ readonly type: "bytes32[]";
1244
+ }];
1245
+ readonly internalType: "struct CriteriaResolver[]";
1246
+ readonly name: "";
1247
+ readonly type: "tuple[]";
1248
+ }, {
1249
+ readonly internalType: "bytes32";
1250
+ readonly name: "fulfillerConduitKey";
1251
+ readonly type: "bytes32";
1252
+ }, {
1253
+ readonly internalType: "address";
1254
+ readonly name: "recipient";
1255
+ readonly type: "address";
1256
+ }];
1257
+ readonly name: "fulfillAdvancedOrder";
1258
+ readonly outputs: readonly [{
1259
+ readonly internalType: "bool";
1260
+ readonly name: "fulfilled";
1261
+ readonly type: "bool";
1262
+ }];
1263
+ readonly stateMutability: "payable";
1264
+ readonly type: "function";
1265
+ }];
1266
+ /**
1267
+ * Seaport getCounter ABI
1268
+ */
1269
+ declare const SEAPORT_GET_COUNTER_ABI: readonly [{
1270
+ readonly inputs: readonly [{
1271
+ readonly internalType: "address";
1272
+ readonly name: "offerer";
1273
+ readonly type: "address";
1274
+ }];
1275
+ readonly name: "getCounter";
1276
+ readonly outputs: readonly [{
1277
+ readonly internalType: "uint256";
1278
+ readonly name: "counter";
1279
+ readonly type: "uint256";
1280
+ }];
1281
+ readonly stateMutability: "view";
1282
+ readonly type: "function";
1283
+ }];
1284
+ /**
1285
+ * ERC721 approval ABIs (isApprovedForAll + setApprovalForAll)
1286
+ */
1287
+ declare const ERC721_APPROVAL_ABI: readonly [{
1288
+ readonly inputs: readonly [{
1289
+ readonly internalType: "address";
1290
+ readonly name: "owner";
1291
+ readonly type: "address";
1292
+ }, {
1293
+ readonly internalType: "address";
1294
+ readonly name: "operator";
1295
+ readonly type: "address";
1296
+ }];
1297
+ readonly name: "isApprovedForAll";
1298
+ readonly outputs: readonly [{
1299
+ readonly internalType: "bool";
1300
+ readonly name: "";
1301
+ readonly type: "bool";
1302
+ }];
1303
+ readonly stateMutability: "view";
1304
+ readonly type: "function";
1305
+ }, {
1306
+ readonly inputs: readonly [{
1307
+ readonly internalType: "address";
1308
+ readonly name: "operator";
1309
+ readonly type: "address";
1310
+ }, {
1311
+ readonly internalType: "bool";
1312
+ readonly name: "approved";
1313
+ readonly type: "bool";
1314
+ }];
1315
+ readonly name: "setApprovalForAll";
1316
+ readonly outputs: readonly [];
1317
+ readonly stateMutability: "nonpayable";
1318
+ readonly type: "function";
1319
+ }];
1320
+ /**
1321
+ * ERC20 approval ABIs (allowance + approve)
1322
+ */
1323
+ declare const ERC20_APPROVAL_ABI: readonly [{
1324
+ readonly inputs: readonly [{
1325
+ readonly internalType: "address";
1326
+ readonly name: "owner";
1327
+ readonly type: "address";
1328
+ }, {
1329
+ readonly internalType: "address";
1330
+ readonly name: "spender";
1331
+ readonly type: "address";
1332
+ }];
1333
+ readonly name: "allowance";
1334
+ readonly outputs: readonly [{
1335
+ readonly internalType: "uint256";
1336
+ readonly name: "";
1337
+ readonly type: "uint256";
1338
+ }];
1339
+ readonly stateMutability: "view";
1340
+ readonly type: "function";
1341
+ }, {
1342
+ readonly inputs: readonly [{
1343
+ readonly internalType: "address";
1344
+ readonly name: "spender";
1345
+ readonly type: "address";
1346
+ }, {
1347
+ readonly internalType: "uint256";
1348
+ readonly name: "amount";
1349
+ readonly type: "uint256";
1350
+ }];
1351
+ readonly name: "approve";
1352
+ readonly outputs: readonly [{
1353
+ readonly internalType: "bool";
1354
+ readonly name: "";
1355
+ readonly type: "bool";
1356
+ }];
1357
+ readonly stateMutability: "nonpayable";
1358
+ readonly type: "function";
1359
+ }];
1360
+
1361
+ /**
1362
+ * ABI for decoding Seaport submission from Net message data
1363
+ */
1364
+ declare const BAZAAR_SUBMISSION_ABI: readonly [{
1365
+ readonly name: "submission";
1366
+ readonly type: "tuple";
1367
+ readonly internalType: "struct BazaarV2.Submission";
1368
+ readonly components: readonly [{
1369
+ readonly name: "parameters";
1370
+ readonly type: "tuple";
1371
+ readonly internalType: "struct OrderParameters";
1372
+ readonly components: readonly [{
1373
+ readonly name: "offerer";
1374
+ readonly type: "address";
1375
+ readonly internalType: "address";
1376
+ }, {
1377
+ readonly name: "zone";
1378
+ readonly type: "address";
1379
+ readonly internalType: "address";
1380
+ }, {
1381
+ readonly name: "offer";
1382
+ readonly type: "tuple[]";
1383
+ readonly internalType: "struct OfferItem[]";
1384
+ readonly components: readonly [{
1385
+ readonly name: "itemType";
1386
+ readonly type: "uint8";
1387
+ readonly internalType: "enum ItemType";
1388
+ }, {
1389
+ readonly name: "token";
1390
+ readonly type: "address";
1391
+ readonly internalType: "address";
1392
+ }, {
1393
+ readonly name: "identifierOrCriteria";
1394
+ readonly type: "uint256";
1395
+ readonly internalType: "uint256";
1396
+ }, {
1397
+ readonly name: "startAmount";
1398
+ readonly type: "uint256";
1399
+ readonly internalType: "uint256";
1400
+ }, {
1401
+ readonly name: "endAmount";
1402
+ readonly type: "uint256";
1403
+ readonly internalType: "uint256";
1404
+ }];
802
1405
  }, {
803
1406
  readonly name: "consideration";
804
1407
  readonly type: "tuple[]";
@@ -1023,4 +1626,158 @@ declare function parseSaleFromStoredData(storedData: string, chainId: number): S
1023
1626
  */
1024
1627
  declare function sortSalesByTimestamp(sales: Sale[]): Sale[];
1025
1628
 
1026
- 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, Erc20Listing, Erc20Offer, GetCollectionOffersOptions, GetErc20ListingsOptions, GetErc20OffersOptions, GetListingsOptions, GetSalesOptions, Listing, NET_SEAPORT_COLLECTION_OFFER_ZONE_ADDRESS, NET_SEAPORT_PRIVATE_ORDER_ZONE_ADDRESS, NET_SEAPORT_ZONE_ADDRESS, SEAPORT_CANCEL_ABI, Sale, 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, getErc20BazaarAddress, getErc20OffersAddress, getFeeCollectorAddress, getHighEthAddress, getNftFeeBps, getOrderStatusFromInfo, getSeaportAddress, getSeaportOrderFromMessageData, getTotalConsiderationAmount, getWrappedNativeCurrency, isBazaarSupportedOnChain, isCollectionOfferValid, isErc20ListingValid, isErc20OfferValid, isListingValid, parseCollectionOfferFromMessage, parseErc20ListingFromMessage, parseErc20OfferFromMessage, parseListingFromMessage, parseSaleFromStoredData, sortErc20ListingsByPricePerToken, sortErc20OffersByPricePerToken, sortListingsByPrice, sortOffersByPrice, sortSalesByTimestamp };
1629
+ /**
1630
+ * Approval utilities for checking and building ERC721/ERC20 approval transactions
1631
+ */
1632
+
1633
+ /**
1634
+ * Check if an ERC721 collection is approved for a spender, and return an approval tx if not.
1635
+ *
1636
+ * @returns A `setApprovalForAll` tx if not approved, or `null` if already approved.
1637
+ */
1638
+ declare function checkErc721Approval(client: PublicClient, nftAddress: `0x${string}`, owner: `0x${string}`, spender: `0x${string}`): Promise<WriteTransactionConfig | null>;
1639
+ /**
1640
+ * Check if an ERC20 token has sufficient allowance for a spender, and return an approval tx if not.
1641
+ *
1642
+ * @returns An `approve(spender, maxUint256)` tx if allowance is insufficient, or `null` if sufficient.
1643
+ */
1644
+ declare function checkErc20Approval(client: PublicClient, tokenAddress: `0x${string}`, owner: `0x${string}`, spender: `0x${string}`, amount: bigint): Promise<WriteTransactionConfig | null>;
1645
+
1646
+ /**
1647
+ * Fulfillment utilities for building Seaport fulfillOrder/fulfillAdvancedOrder transaction data
1648
+ */
1649
+
1650
+ /**
1651
+ * Build a fulfillAdvancedOrder transaction for an NFT listing (buyer pays native currency for NFT).
1652
+ *
1653
+ * Uses fulfillAdvancedOrder (instead of fulfillOrder) to support both standard and
1654
+ * private listings — private listings use a restricted zone that requires the
1655
+ * advanced order path.
1656
+ *
1657
+ * @param submission - Decoded Seaport submission from the listing's messageData
1658
+ * @param recipient - Address to receive the NFT
1659
+ * @param seaportAddress - Seaport contract address
1660
+ * @returns WriteTransactionConfig with value set to the native currency payment
1661
+ */
1662
+ declare function buildFulfillListingTx(submission: SeaportSubmission, recipient: `0x${string}`, seaportAddress: `0x${string}`): WriteTransactionConfig;
1663
+ /**
1664
+ * Build a fulfillAdvancedOrder transaction for a collection offer.
1665
+ *
1666
+ * The fulfiller provides a specific NFT (tokenId) to satisfy the offerer's
1667
+ * ERC721_WITH_CRITERIA consideration item.
1668
+ *
1669
+ * @param submission - Decoded Seaport submission from the offer's messageData
1670
+ * @param tokenId - The specific token ID the fulfiller is providing
1671
+ * @param recipient - Address to receive the WETH payment
1672
+ * @param seaportAddress - Seaport contract address
1673
+ * @returns WriteTransactionConfig with value=0 (no native currency needed)
1674
+ */
1675
+ declare function buildFulfillCollectionOfferTx(submission: SeaportSubmission, tokenId: bigint, recipient: `0x${string}`, seaportAddress: `0x${string}`): WriteTransactionConfig;
1676
+ /**
1677
+ * Build a fulfillOrder transaction for an ERC20 offer (seller provides ERC20 tokens, buyer pays WETH).
1678
+ *
1679
+ * @param submission - Decoded Seaport submission from the offer's messageData
1680
+ * @param seaportAddress - Seaport contract address
1681
+ * @returns WriteTransactionConfig with value=0 (no native currency needed)
1682
+ */
1683
+ declare function buildFulfillErc20OfferTx(submission: SeaportSubmission, seaportAddress: `0x${string}`): WriteTransactionConfig;
1684
+ /**
1685
+ * Build a fulfillAdvancedOrder transaction for an ERC20 listing (buyer pays native currency for ERC20 tokens).
1686
+ *
1687
+ * Uses fulfillAdvancedOrder to support both standard and private listings.
1688
+ *
1689
+ * @param submission - Decoded Seaport submission from the listing's messageData
1690
+ * @param recipient - Address to receive the ERC20 tokens
1691
+ * @param seaportAddress - Seaport contract address
1692
+ * @returns WriteTransactionConfig with value set to the native currency payment
1693
+ */
1694
+ declare function buildFulfillErc20ListingTx(submission: SeaportSubmission, recipient: `0x${string}`, seaportAddress: `0x${string}`): WriteTransactionConfig;
1695
+
1696
+ /**
1697
+ * Order creation utilities for building EIP-712 typed data and Bazaar submit transactions
1698
+ */
1699
+
1700
+ /**
1701
+ * Calculate fee amount.
1702
+ *
1703
+ * - NFTs use floor division: `(price * bps) / 10000`
1704
+ * - ERC20s use ceiling division: `(price * bps + 9999) / 10000`
1705
+ */
1706
+ declare function calculateFee(price: bigint, feeBps: number, useCeilingDivision: boolean): bigint;
1707
+ /**
1708
+ * Generate a random salt for order uniqueness
1709
+ */
1710
+ declare function generateSalt(): bigint;
1711
+ /**
1712
+ * Get default expiration timestamp (24 hours from now, in seconds)
1713
+ */
1714
+ declare function getDefaultExpiration(): number;
1715
+ /**
1716
+ * Build order components for an NFT listing.
1717
+ *
1718
+ * Offer: one ERC721 item
1719
+ * Consideration: native currency payment to offerer + optional fee to feeCollector
1720
+ */
1721
+ declare function buildListingOrderComponents(params: CreateListingParams & {
1722
+ offerer: `0x${string}`;
1723
+ targetFulfiller?: `0x${string}`;
1724
+ }, chainId: number, counter: bigint): {
1725
+ orderParameters: SeaportOrderParameters;
1726
+ counter: bigint;
1727
+ };
1728
+ /**
1729
+ * Build order components for a collection offer.
1730
+ *
1731
+ * Offer: WETH payment
1732
+ * Consideration: ERC721_WITH_CRITERIA (any token from collection) to offerer + optional fee
1733
+ */
1734
+ declare function buildCollectionOfferOrderComponents(params: CreateCollectionOfferParams & {
1735
+ offerer: `0x${string}`;
1736
+ }, chainId: number, counter: bigint): {
1737
+ orderParameters: SeaportOrderParameters;
1738
+ counter: bigint;
1739
+ };
1740
+ /**
1741
+ * Build order components for an ERC20 offer (buying ERC20 tokens with WETH).
1742
+ *
1743
+ * Offer: WETH payment
1744
+ * Consideration: ERC20 tokens to offerer + optional WETH fee to feeCollector
1745
+ */
1746
+ declare function buildErc20OfferOrderComponents(params: CreateErc20OfferParams & {
1747
+ offerer: `0x${string}`;
1748
+ }, chainId: number, counter: bigint): {
1749
+ orderParameters: SeaportOrderParameters;
1750
+ counter: bigint;
1751
+ };
1752
+ /**
1753
+ * Build order components for an ERC20 listing (selling ERC20 tokens for native currency).
1754
+ *
1755
+ * Offer: ERC20 tokens
1756
+ * Consideration: native currency payment to offerer + optional fee to feeCollector
1757
+ */
1758
+ declare function buildErc20ListingOrderComponents(params: CreateErc20ListingParams & {
1759
+ offerer: `0x${string}`;
1760
+ targetFulfiller?: `0x${string}`;
1761
+ }, chainId: number, counter: bigint): {
1762
+ orderParameters: SeaportOrderParameters;
1763
+ counter: bigint;
1764
+ };
1765
+ /**
1766
+ * Build EIP-712 typed data for a Seaport order.
1767
+ *
1768
+ * The message object uses `counter` instead of `totalOriginalConsiderationItems`,
1769
+ * matching Seaport's EIP-712 domain specification.
1770
+ */
1771
+ declare function buildEIP712OrderData(orderParameters: SeaportOrderParameters, counter: bigint, chainId: number, seaportAddress: `0x${string}`): EIP712OrderData;
1772
+ /**
1773
+ * Build a submit transaction for a Bazaar contract (NFT listings, collection offers, ERC20 offers/listings).
1774
+ *
1775
+ * @param contractAddress - The Bazaar contract address to submit to
1776
+ * @param abi - The contract ABI (BAZAAR_V2_ABI, BAZAAR_COLLECTION_OFFERS_ABI, or BAZAAR_ERC20_OFFERS_ABI)
1777
+ * @param orderParameters - The signed order parameters
1778
+ * @param counter - The order counter
1779
+ * @param signature - The EIP-712 signature from the offerer
1780
+ */
1781
+ declare function buildSubmitOrderTx(contractAddress: `0x${string}`, abi: readonly unknown[], orderParameters: SeaportOrderParameters, counter: bigint, signature: `0x${string}`): WriteTransactionConfig;
1782
+
1783
+ export { BAZAAR_COLLECTION_OFFERS_ABI, BAZAAR_ERC20_OFFERS_ABI, BAZAAR_SUBMISSION_ABI, BAZAAR_V2_ABI, BULK_SEAPORT_ORDER_STATUS_FETCHER_ABI, BULK_SEAPORT_ORDER_STATUS_FETCHER_ADDRESS, type BazaarChainConfig, BazaarClient, CollectionOffer, CreateCollectionOfferParams, CreateErc20ListingParams, CreateErc20OfferParams, CreateListingParams, EIP712OrderData, ERC20_APPROVAL_ABI, ERC20_BULK_BALANCE_CHECKER_ABI, ERC20_BULK_BALANCE_CHECKER_ADDRESS, ERC721_APPROVAL_ABI, ERC721_OWNER_OF_HELPER_ABI, ERC721_OWNER_OF_HELPER_ADDRESS, Erc20Listing, Erc20Offer, GetCollectionOffersOptions, GetErc20ListingsOptions, GetErc20OffersOptions, GetListingsOptions, GetSalesOptions, Listing, NET_SEAPORT_COLLECTION_OFFER_ZONE_ADDRESS, NET_SEAPORT_PRIVATE_ORDER_ZONE_ADDRESS, NET_SEAPORT_ZONE_ADDRESS, PreparedFulfillment, PreparedOrder, SEAPORT_CANCEL_ABI, SEAPORT_FULFILL_ADVANCED_ORDER_ABI, SEAPORT_FULFILL_ORDER_ABI, SEAPORT_GET_COUNTER_ABI, Sale, SeaportOrderComponents, SeaportOrderParameters, SeaportOrderStatus, SeaportOrderStatusInfo, SeaportSubmission, type WrappedNativeCurrency, WriteTransactionConfig, buildCollectionOfferOrderComponents, buildEIP712OrderData, buildErc20ListingOrderComponents, buildErc20OfferOrderComponents, buildFulfillCollectionOfferTx, buildFulfillErc20ListingTx, buildFulfillErc20OfferTx, buildFulfillListingTx, buildListingOrderComponents, buildSubmitOrderTx, bulkFetchErc20Balances, bulkFetchNftOwners, bulkFetchOrderStatuses, calculateFee, checkErc20Approval, checkErc721Approval, computeOrderHash, createBalanceMap, createOrderStatusMap, createOwnershipMap, createSeaportInstance, decodeSeaportSubmission, formatPrice, generateSalt, getBazaarAddress, getBazaarChainConfig, getBazaarSupportedChainIds, getBestCollectionOffer, getBestListingPerToken, getCollectionOffersAddress, getCurrencySymbol, getDefaultExpiration, getErc20BazaarAddress, getErc20OffersAddress, getFeeCollectorAddress, getHighEthAddress, getNftFeeBps, getOrderStatusFromInfo, getSeaportAddress, getSeaportOrderFromMessageData, getTotalConsiderationAmount, getWrappedNativeCurrency, isBazaarSupportedOnChain, isCollectionOfferValid, isErc20ListingValid, isErc20OfferValid, isListingValid, parseCollectionOfferFromMessage, parseErc20ListingFromMessage, parseErc20OfferFromMessage, parseListingFromMessage, parseSaleFromStoredData, sortErc20ListingsByPricePerToken, sortErc20OffersByPricePerToken, sortListingsByPrice, sortOffersByPrice, sortSalesByTimestamp };