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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@net-protocol/core

v0.1.3

Published

Core Net protocol SDK for interacting with Net smart contracts

Readme

@net-protocol/core

Status: Alpha - Usable but may have breaking changes over time. Suitable for early adopters and testing.

Core Net protocol SDK for reading and writing messages on the Net Protocol blockchain.

What is Net Protocol?

Net Protocol is a decentralized onchain messaging system. Every message is stored permanently on the blockchain with multi-dimensional indexing, allowing efficient queries by app, user, topic, or combinations.

Key concepts:

  • Messages: Permanent onchain records with text, data, and metadata
  • Apps: Smart contracts that send messages (like applications)
  • Topics: Categories for organizing messages
  • Indexing: Query messages by app, user, topic, or combinations

What can you do with this package?

  • Read messages: Query messages by app, user, topic, or combinations
  • Get counts: Count messages matching specific filters
  • Send messages: Prepare transactions to send messages via app contracts
  • Build apps: Create custom applications that use Net Protocol messaging

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

Learn More

Installation

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

Usage

React Hooks

import {
  useNetMessages,
  useNetMessageCount,
  NetProvider,
} from "@net-protocol/core";

function App() {
  return (
    <NetProvider overrides={{ rpcUrls: { 8453: ["https://custom-rpc.com"] } }}>
      <MyComponent />
    </NetProvider>
  );
}

function MyComponent() {
  const { messages, isLoading } = useNetMessages({
    chainId: 8453,
    filter: { appAddress: "0x..." },
    startIndex: 0,
    endIndex: 10,
  });

  const { count } = useNetMessageCount({
    chainId: 8453,
    filter: { appAddress: "0x..." },
  });

  return (
    <div>
      Messages: {messages.length}, Total: {count}
    </div>
  );
}

Non-React Utilities

import { NetClient } from "@net-protocol/core";

// Create a NetClient instance
const client = new NetClient({
  chainId: 8453,
  overrides: { rpcUrls: ["https://custom-rpc.com"] }, // Optional RPC URL override
});

// Get messages
const messages = await client.getMessages({
  chainId: 8453,
  filter: { appAddress: "0x..." },
  startIndex: 0,
  endIndex: 10,
});

// Get message count
const count = await client.getMessageCount({
  chainId: 8453,
  filter: { appAddress: "0x..." },
});

// Get message by index
const message = await client.getMessageAtIndex({
  messageIndex: 0,
  appAddress: "0x...", // Optional
  topic: "topic", // Optional
});

API Reference

See the API documentation for complete API details.

Supported Chains

  • Base (8453)
  • Ethereum Mainnet (1)
  • Degen Chain (666666666)
  • Ham Chain (5112)
  • Ink Chain (57073)
  • Unichain (130)
  • Hyperliquid EVM (999)
  • Plasma Chain (9745)
  • Monad Chain (143)
  • Base Sepolia (84532) - testnet
  • Sepolia (11155111) - testnet

License

MIT