npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@net-protocol/bazaar

v0.1.12

Published

SDK for Net Bazaar - a decentralized bazaar storing all orders onchain via Seaport

Readme

@net-protocol/bazaar

Status: In Development - This package is under active development. APIs may change without notice.

SDK for Net Bazaar - a decentralized bazaar storing all orders onchain via Seaport.

What is Net Bazaar?

Net Bazaar is a decentralized bazaar built on Net Protocol. All orders are stored onchain. It uses Seaport for order execution and Net Protocol for order storage and indexing.

Key features:

  • NFT Listings: Buy and sell NFTs with native currency
  • Collection Offers: Make offers on any NFT in a collection
  • ERC20 Offers: Make offers to buy ERC20 tokens (Base and HyperEVM only)

What can you do with this package?

  • Read listings: Get valid NFT listings for a collection
  • Read collection offers: Get valid offers for any NFT in a collection
  • Read ERC20 offers: Get valid offers for ERC20 tokens
  • Cancel orders: Prepare transactions to cancel your listings or offers
  • Create listings: Prepare and sign Seaport orders for NFT listings
  • Create offers: Prepare and sign collection offers
  • Fulfill orders: Buy listings or accept offers
  • Query ownership: Check which tokens an address owns on-chain

This package provides both React hooks (for UI) and a client class (for non-React code).

Installation

npm install @net-protocol/bazaar @net-protocol/core viem
# or
yarn add @net-protocol/bazaar @net-protocol/core viem

For React hooks, also install:

npm install react wagmi @tanstack/react-query

Usage

React Hooks

import { useBazaarListings, useBazaarCollectionOffers, useBazaarErc20Offers } from "@net-protocol/bazaar/react";

// Get NFT listings for a collection
function ListingsComponent() {
  const { listings, isLoading, error } = useBazaarListings({
    chainId: 8453,
    nftAddress: "0x...",
  });

  if (isLoading) return <div>Loading...</div>;

  return (
    <div>
      {listings.map((listing) => (
        <div key={listing.orderHash}>
          Token #{listing.tokenId}: {listing.price} {listing.currency}
        </div>
      ))}
    </div>
  );
}

// Get collection offers
function CollectionOffersComponent() {
  const { offers, isLoading } = useBazaarCollectionOffers({
    chainId: 8453,
    nftAddress: "0x...",
  });

  const bestOffer = offers[0]; // Sorted by price, highest first
  return <div>Best offer: {bestOffer?.price} {bestOffer?.currency}</div>;
}

// Get ERC20 offers (Base and HyperEVM only)
function Erc20OffersComponent() {
  const { offers, isLoading } = useBazaarErc20Offers({
    chainId: 8453,
    tokenAddress: "0x...",
  });

  const bestOffer = offers[0]; // Sorted by price per token, highest first
  return (
    <div>
      Best offer: {bestOffer?.pricePerToken} {bestOffer?.currency} per token
    </div>
  );
}

BazaarClient (Non-React)

import { BazaarClient } from "@net-protocol/bazaar";

const client = new BazaarClient({ chainId: 8453 });

// Get listings
const listings = await client.getListings({
  nftAddress: "0x...",
});

// Get collection offers
const collectionOffers = await client.getCollectionOffers({
  nftAddress: "0x...",
});

// Get ERC20 offers (Base and HyperEVM only)
const erc20Offers = await client.getErc20Offers({
  tokenAddress: "0x...",
});

// Cancel a listing
const cancelTx = client.prepareCancelListing(listing);
// Use with wagmi's useWriteContract or viem's writeContract

// Create a listing (prepare EIP-712 data + approvals)
const prepared = await client.prepareCreateListing({
  nftAddress: "0x...",
  tokenId: "42",
  priceWei: 100000000000000n, // 0.0001 ETH
  offerer: "0x...",
});
// prepared.eip712 contains the typed data to sign
// prepared.approvals contains approval txs to send first

// Submit a signed listing on-chain
const submitTx = client.prepareSubmitListing(
  prepared.eip712.orderParameters,
  prepared.eip712.counter,
  signature
);

// Fulfill a listing (buy an NFT)
const fulfillment = await client.prepareFulfillListing(listing, buyerAddress);
// fulfillment.approvals + fulfillment.fulfillment contain the txs

// Fulfill a collection offer (sell your NFT)
const offerFulfillment = await client.prepareFulfillCollectionOffer(offer, tokenId, sellerAddress);

// Get token IDs owned by an address
const tokenIds = await client.getOwnedTokens({
  nftAddress: "0x...",
  ownerAddress: "0x...",
  startTokenId: 0n,
  endTokenId: 10000n,
});

// Get recent sales
const sales = await client.getSales({ nftAddress: "0x..." });

API Reference

Types

interface Listing {
  maker: `0x${string}`;
  nftAddress: `0x${string}`;
  tokenId: string;
  priceWei: bigint;
  price: number;
  currency: string;
  expirationDate: number;
  orderHash: string;
  orderStatus: SeaportOrderStatus;
  messageData: `0x${string}`;
  orderComponents?: SeaportOrderComponents;
}

interface CollectionOffer {
  maker: `0x${string}`;
  nftAddress: `0x${string}`;
  priceWei: bigint;
  price: number;
  currency: string;
  expirationDate: number;
  orderHash: string;
  orderStatus: SeaportOrderStatus;
  messageData: `0x${string}`;
  orderComponents?: SeaportOrderComponents;
}

interface Erc20Offer {
  maker: `0x${string}`;
  tokenAddress: `0x${string}`;
  tokenAmount: bigint;
  priceWei: bigint;
  pricePerTokenWei: bigint;
  price: number;
  pricePerToken: number;
  currency: string;
  expirationDate: number;
  orderHash: `0x${string}`;
  orderStatus: SeaportOrderStatus;
  messageData: `0x${string}`;
  orderComponents?: SeaportOrderComponents;
}

Validation

All returned listings and offers are automatically validated:

  • Order status is OPEN (not filled, cancelled, or expired)
  • Not expired
  • For listings: seller still owns the NFT
  • For offers: buyer has sufficient WETH balance

Sorting

  • Listings: Sorted by price (lowest first), deduplicated per token
  • Collection offers: Sorted by price (highest first)
  • ERC20 offers: Sorted by price per token (highest first)

Supported Chains

| Chain | Listings | Collection Offers | ERC20 Offers | |-------|----------|-------------------|--------------| | Base (8453) | Yes | Yes | Yes | | Base Sepolia (84532) | Yes | Yes | No | | Degen (666666666) | Yes | Yes | No | | Ham (5112) | Yes | Yes | No | | Ink (57073) | Yes | Yes | No | | Unichain (130) | Yes | Yes | No | | HyperEVM (999) | Yes | Yes | Yes | | Plasma (9745) | Yes | Yes | No | | Monad (143) | Yes | Yes | No |

License

MIT