@net-protocol/bazaar 0.1.1 → 0.1.3

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @net-protocol/bazaar
2
2
 
3
- **Status: Alpha** - Usable but may have breaking changes over time. Suitable for early adopters and testing.
3
+ **Status: In Development** - This package is under active development. APIs may change without notice.
4
4
 
5
5
  NFT marketplace SDK for Net Protocol - read listings, collection offers, and ERC20 offers via Seaport.
6
6
 
package/dist/index.d.mts CHANGED
@@ -1,8 +1,8 @@
1
- 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, W as WriteTransactionConfig, S as SeaportOrderComponents, e as SeaportSubmission, f as SeaportOrderParameters, g as SeaportOrderStatusInfo, h as SeaportOrderStatus } from './types--4_RIuQ5.mjs';
2
- export { j as ConsiderationItem, l as CreateCollectionOfferParams, k as CreateListingParams, I as ItemType, i as OfferItem, O as OrderType } from './types--4_RIuQ5.mjs';
3
- import { Seaport } from '@opensea/seaport-js';
4
1
  import { PublicClient } from 'viem';
5
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, W as WriteTransactionConfig, S as SeaportOrderComponents, e as SeaportSubmission, f as SeaportOrderParameters, g as SeaportOrderStatusInfo, h as SeaportOrderStatus } from './types-DDHh9yJB.mjs';
4
+ export { j as ConsiderationItem, l as CreateCollectionOfferParams, k as CreateListingParams, I as ItemType, i as OfferItem, O as OrderType } from './types-DDHh9yJB.mjs';
5
+ import { Seaport } from '@opensea/seaport-js';
6
6
 
7
7
  /**
8
8
  * BazaarClient - Client for interacting with Net Bazaar (NFT marketplace)
@@ -20,6 +20,7 @@ declare class BazaarClient {
20
20
  constructor(params: {
21
21
  chainId: number;
22
22
  rpcUrl?: string;
23
+ publicClient?: PublicClient;
23
24
  });
24
25
  /**
25
26
  * Get valid NFT listings for a collection
@@ -32,6 +33,13 @@ declare class BazaarClient {
32
33
  * Results are deduplicated (one per token) and sorted by price (lowest first)
33
34
  */
34
35
  getListings(options: GetListingsOptions): Promise<Listing[]>;
36
+ /**
37
+ * Process pre-fetched messages into valid NFT listings.
38
+ *
39
+ * Use this when messages have already been fetched (e.g. via useNetMessages)
40
+ * to avoid redundant RPC calls.
41
+ */
42
+ processListingsFromMessages(messages: NetMessage[], options: Pick<GetListingsOptions, "nftAddress" | "excludeMaker" | "includeExpired">): Promise<Listing[]>;
35
43
  /**
36
44
  * Get valid collection offers for a collection
37
45
  *
@@ -43,6 +51,13 @@ declare class BazaarClient {
43
51
  * Results are sorted by price (highest first)
44
52
  */
45
53
  getCollectionOffers(options: GetCollectionOffersOptions): Promise<CollectionOffer[]>;
54
+ /**
55
+ * Process pre-fetched messages into valid collection offers.
56
+ *
57
+ * Use this when messages have already been fetched (e.g. via useNetMessages)
58
+ * to avoid redundant RPC calls.
59
+ */
60
+ processCollectionOffersFromMessages(messages: NetMessage[], options: Pick<GetCollectionOffersOptions, "nftAddress" | "excludeMaker">): Promise<CollectionOffer[]>;
46
61
  /**
47
62
  * Get valid ERC20 offers for a token
48
63
  *
@@ -56,6 +71,13 @@ declare class BazaarClient {
56
71
  * Results are sorted by price per token (highest first)
57
72
  */
58
73
  getErc20Offers(options: GetErc20OffersOptions): Promise<Erc20Offer[]>;
74
+ /**
75
+ * Process pre-fetched messages into valid ERC20 offers.
76
+ *
77
+ * Use this when messages have already been fetched (e.g. via useNetMessages)
78
+ * to avoid redundant RPC calls.
79
+ */
80
+ processErc20OffersFromMessages(messages: NetMessage[], options: Pick<GetErc20OffersOptions, "tokenAddress" | "excludeMaker">): Promise<Erc20Offer[]>;
59
81
  /**
60
82
  * Get valid ERC20 listings for a token
61
83
  *
@@ -68,6 +90,13 @@ declare class BazaarClient {
68
90
  * all valid listings are returned (grouped by maker in the UI).
69
91
  */
70
92
  getErc20Listings(options: GetErc20ListingsOptions): Promise<Erc20Listing[]>;
93
+ /**
94
+ * Process pre-fetched messages into valid ERC20 listings.
95
+ *
96
+ * Use this when messages have already been fetched (e.g. via useNetMessages)
97
+ * to avoid redundant RPC calls.
98
+ */
99
+ processErc20ListingsFromMessages(messages: NetMessage[], options: Pick<GetErc20ListingsOptions, "tokenAddress" | "excludeMaker">): Promise<Erc20Listing[]>;
71
100
  /**
72
101
  * Get the chain ID this client is configured for
73
102
  */
@@ -155,10 +184,11 @@ interface BazaarChainConfig {
155
184
  currencySymbol: string;
156
185
  }
157
186
  declare const BULK_SEAPORT_ORDER_STATUS_FETCHER_ADDRESS: "0x0000009112ABCE652674b4fE3eD9C765B22d11A7";
158
- declare const ERC721_OWNER_OF_HELPER_ADDRESS: "0x000000aa4eFa2e5A4a6002C7F08B6e8Ec8cf1dDa";
159
- declare const ERC20_BULK_BALANCE_CHECKER_ADDRESS: "0x000000b50a9f2923f2db931391824f6d1278f712";
187
+ declare const ERC721_OWNER_OF_HELPER_ADDRESS: "0x00000012E3eb0700925947fAF9cd1440319b4F37";
188
+ declare const ERC20_BULK_BALANCE_CHECKER_ADDRESS: "0x000000B50A9f2923F2DB931391824F6D1278f712";
160
189
  declare const NET_SEAPORT_ZONE_ADDRESS: "0x000000007F8c58fbf215bF91Bda7421A806cf3ae";
161
190
  declare const NET_SEAPORT_COLLECTION_OFFER_ZONE_ADDRESS: "0x000000B799ec6D7aCC1B578f62bFc324c25DFC5A";
191
+ declare const NET_SEAPORT_PRIVATE_ORDER_ZONE_ADDRESS: "0x000000bC63761cbb05305632212e2f3AE2BE7a9B";
162
192
  /**
163
193
  * Get bazaar configuration for a chain
164
194
  */
@@ -966,4 +996,4 @@ declare function parseErc20ListingFromMessage(message: NetMessage, chainId: numb
966
996
  */
967
997
  declare function sortErc20ListingsByPricePerToken(listings: Erc20Listing[]): Erc20Listing[];
968
998
 
969
- 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, 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, getErc20BazaarAddress, getErc20OffersAddress, getFeeCollectorAddress, getHighEthAddress, getNftFeeBps, getOrderStatusFromInfo, getSeaportAddress, getSeaportOrderFromMessageData, getTotalConsiderationAmount, getWrappedNativeCurrency, isBazaarSupportedOnChain, isCollectionOfferValid, isErc20ListingValid, isErc20OfferValid, isListingValid, parseCollectionOfferFromMessage, parseErc20ListingFromMessage, parseErc20OfferFromMessage, parseListingFromMessage, sortErc20ListingsByPricePerToken, sortErc20OffersByPricePerToken, sortListingsByPrice, sortOffersByPrice };
999
+ 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, Listing, NET_SEAPORT_COLLECTION_OFFER_ZONE_ADDRESS, NET_SEAPORT_PRIVATE_ORDER_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, getErc20BazaarAddress, getErc20OffersAddress, getFeeCollectorAddress, getHighEthAddress, getNftFeeBps, getOrderStatusFromInfo, getSeaportAddress, getSeaportOrderFromMessageData, getTotalConsiderationAmount, getWrappedNativeCurrency, isBazaarSupportedOnChain, isCollectionOfferValid, isErc20ListingValid, isErc20OfferValid, isListingValid, parseCollectionOfferFromMessage, parseErc20ListingFromMessage, parseErc20OfferFromMessage, parseListingFromMessage, sortErc20ListingsByPricePerToken, sortErc20OffersByPricePerToken, sortListingsByPrice, sortOffersByPrice };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- 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, W as WriteTransactionConfig, S as SeaportOrderComponents, e as SeaportSubmission, f as SeaportOrderParameters, g as SeaportOrderStatusInfo, h as SeaportOrderStatus } from './types--4_RIuQ5.js';
2
- export { j as ConsiderationItem, l as CreateCollectionOfferParams, k as CreateListingParams, I as ItemType, i as OfferItem, O as OrderType } from './types--4_RIuQ5.js';
3
- import { Seaport } from '@opensea/seaport-js';
4
1
  import { PublicClient } from 'viem';
5
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, W as WriteTransactionConfig, S as SeaportOrderComponents, e as SeaportSubmission, f as SeaportOrderParameters, g as SeaportOrderStatusInfo, h as SeaportOrderStatus } from './types-DDHh9yJB.js';
4
+ export { j as ConsiderationItem, l as CreateCollectionOfferParams, k as CreateListingParams, I as ItemType, i as OfferItem, O as OrderType } from './types-DDHh9yJB.js';
5
+ import { Seaport } from '@opensea/seaport-js';
6
6
 
7
7
  /**
8
8
  * BazaarClient - Client for interacting with Net Bazaar (NFT marketplace)
@@ -20,6 +20,7 @@ declare class BazaarClient {
20
20
  constructor(params: {
21
21
  chainId: number;
22
22
  rpcUrl?: string;
23
+ publicClient?: PublicClient;
23
24
  });
24
25
  /**
25
26
  * Get valid NFT listings for a collection
@@ -32,6 +33,13 @@ declare class BazaarClient {
32
33
  * Results are deduplicated (one per token) and sorted by price (lowest first)
33
34
  */
34
35
  getListings(options: GetListingsOptions): Promise<Listing[]>;
36
+ /**
37
+ * Process pre-fetched messages into valid NFT listings.
38
+ *
39
+ * Use this when messages have already been fetched (e.g. via useNetMessages)
40
+ * to avoid redundant RPC calls.
41
+ */
42
+ processListingsFromMessages(messages: NetMessage[], options: Pick<GetListingsOptions, "nftAddress" | "excludeMaker" | "includeExpired">): Promise<Listing[]>;
35
43
  /**
36
44
  * Get valid collection offers for a collection
37
45
  *
@@ -43,6 +51,13 @@ declare class BazaarClient {
43
51
  * Results are sorted by price (highest first)
44
52
  */
45
53
  getCollectionOffers(options: GetCollectionOffersOptions): Promise<CollectionOffer[]>;
54
+ /**
55
+ * Process pre-fetched messages into valid collection offers.
56
+ *
57
+ * Use this when messages have already been fetched (e.g. via useNetMessages)
58
+ * to avoid redundant RPC calls.
59
+ */
60
+ processCollectionOffersFromMessages(messages: NetMessage[], options: Pick<GetCollectionOffersOptions, "nftAddress" | "excludeMaker">): Promise<CollectionOffer[]>;
46
61
  /**
47
62
  * Get valid ERC20 offers for a token
48
63
  *
@@ -56,6 +71,13 @@ declare class BazaarClient {
56
71
  * Results are sorted by price per token (highest first)
57
72
  */
58
73
  getErc20Offers(options: GetErc20OffersOptions): Promise<Erc20Offer[]>;
74
+ /**
75
+ * Process pre-fetched messages into valid ERC20 offers.
76
+ *
77
+ * Use this when messages have already been fetched (e.g. via useNetMessages)
78
+ * to avoid redundant RPC calls.
79
+ */
80
+ processErc20OffersFromMessages(messages: NetMessage[], options: Pick<GetErc20OffersOptions, "tokenAddress" | "excludeMaker">): Promise<Erc20Offer[]>;
59
81
  /**
60
82
  * Get valid ERC20 listings for a token
61
83
  *
@@ -68,6 +90,13 @@ declare class BazaarClient {
68
90
  * all valid listings are returned (grouped by maker in the UI).
69
91
  */
70
92
  getErc20Listings(options: GetErc20ListingsOptions): Promise<Erc20Listing[]>;
93
+ /**
94
+ * Process pre-fetched messages into valid ERC20 listings.
95
+ *
96
+ * Use this when messages have already been fetched (e.g. via useNetMessages)
97
+ * to avoid redundant RPC calls.
98
+ */
99
+ processErc20ListingsFromMessages(messages: NetMessage[], options: Pick<GetErc20ListingsOptions, "tokenAddress" | "excludeMaker">): Promise<Erc20Listing[]>;
71
100
  /**
72
101
  * Get the chain ID this client is configured for
73
102
  */
@@ -155,10 +184,11 @@ interface BazaarChainConfig {
155
184
  currencySymbol: string;
156
185
  }
157
186
  declare const BULK_SEAPORT_ORDER_STATUS_FETCHER_ADDRESS: "0x0000009112ABCE652674b4fE3eD9C765B22d11A7";
158
- declare const ERC721_OWNER_OF_HELPER_ADDRESS: "0x000000aa4eFa2e5A4a6002C7F08B6e8Ec8cf1dDa";
159
- declare const ERC20_BULK_BALANCE_CHECKER_ADDRESS: "0x000000b50a9f2923f2db931391824f6d1278f712";
187
+ declare const ERC721_OWNER_OF_HELPER_ADDRESS: "0x00000012E3eb0700925947fAF9cd1440319b4F37";
188
+ declare const ERC20_BULK_BALANCE_CHECKER_ADDRESS: "0x000000B50A9f2923F2DB931391824F6D1278f712";
160
189
  declare const NET_SEAPORT_ZONE_ADDRESS: "0x000000007F8c58fbf215bF91Bda7421A806cf3ae";
161
190
  declare const NET_SEAPORT_COLLECTION_OFFER_ZONE_ADDRESS: "0x000000B799ec6D7aCC1B578f62bFc324c25DFC5A";
191
+ declare const NET_SEAPORT_PRIVATE_ORDER_ZONE_ADDRESS: "0x000000bC63761cbb05305632212e2f3AE2BE7a9B";
162
192
  /**
163
193
  * Get bazaar configuration for a chain
164
194
  */
@@ -966,4 +996,4 @@ declare function parseErc20ListingFromMessage(message: NetMessage, chainId: numb
966
996
  */
967
997
  declare function sortErc20ListingsByPricePerToken(listings: Erc20Listing[]): Erc20Listing[];
968
998
 
969
- 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, 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, getErc20BazaarAddress, getErc20OffersAddress, getFeeCollectorAddress, getHighEthAddress, getNftFeeBps, getOrderStatusFromInfo, getSeaportAddress, getSeaportOrderFromMessageData, getTotalConsiderationAmount, getWrappedNativeCurrency, isBazaarSupportedOnChain, isCollectionOfferValid, isErc20ListingValid, isErc20OfferValid, isListingValid, parseCollectionOfferFromMessage, parseErc20ListingFromMessage, parseErc20OfferFromMessage, parseListingFromMessage, sortErc20ListingsByPricePerToken, sortErc20OffersByPricePerToken, sortListingsByPrice, sortOffersByPrice };
999
+ 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, Listing, NET_SEAPORT_COLLECTION_OFFER_ZONE_ADDRESS, NET_SEAPORT_PRIVATE_ORDER_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, getErc20BazaarAddress, getErc20OffersAddress, getFeeCollectorAddress, getHighEthAddress, getNftFeeBps, getOrderStatusFromInfo, getSeaportAddress, getSeaportOrderFromMessageData, getTotalConsiderationAmount, getWrappedNativeCurrency, isBazaarSupportedOnChain, isCollectionOfferValid, isErc20ListingValid, isErc20OfferValid, isListingValid, parseCollectionOfferFromMessage, parseErc20ListingFromMessage, parseErc20OfferFromMessage, parseListingFromMessage, sortErc20ListingsByPricePerToken, sortErc20OffersByPricePerToken, sortListingsByPrice, sortOffersByPrice };