Public TypeScript SDK packages for the Net Protocol. Provides React hooks and client classes for interacting with Net smart contracts and storage systems.
Net Protocol is a decentralized onchain messaging system that stores all data permanently on the blockchain. Think of it as a public bulletin board where:
- Anyone can post (permissionless)
- Posts are permanent (immutable blockchain storage)
- Everything is transparent (publicly verifiable)
- Works across multiple chains (same contract address everywhere)
Net uses sophisticated multi-dimensional indexing, allowing you to query messages by:
- App: All messages from a specific application contract
- User: Messages from a specific user address
- Topic: Messages with a specific category/topic
- Combinations: App + User + Topic for precise queries
This SDK provides TypeScript/React tools to interact with Net Protocol and build applications on top of it.
For complete Net Protocol documentation, visit docs.netprotocol.app.
| Package | Status | Description |
|---|---|---|
| @net-protocol/core | Alpha | Usable but may have breaking changes over time |
| @net-protocol/storage | Alpha | Usable but may have breaking changes over time |
| @net-protocol/cli | Alpha | Usable but may have breaking changes over time |
| @net-protocol/netr | Alpha | Usable but may have breaking changes over time |
| @net-protocol/profiles | Alpha | Usable but may have breaking changes over time |
| @net-protocol/bazaar | In Development | Do not use yet. Will have breaking changes |
| @net-protocol/relay | In Development | Do not use yet. Will have breaking changes |
| @net-protocol/feeds | In Development | Do not use yet. Will have breaking changes |
| @net-protocol/score | In Development | Do not use yet. Will have breaking changes |
Core messaging primitives - Read and write Net Protocol messages. This is the foundation for everything else.
What you can do:
- Query messages by app, user, topic, or combinations
- Get message counts
- Send messages via app contracts
- Build custom applications on Net Protocol
Onchain key-value storage - Store data permanently on the blockchain with complete version history.
What you can do:
- Store small data (< 20KB) with Regular Storage
- Store medium files (20KB-80KB) with Chunked Storage
- Store large files (multi-MB) with XML Storage pattern
- Access complete version history of all changes
- Build applications that need permanent, verifiable data storage
Transaction relay service - Submit on-chain transactions without holding ETH by paying with USDC via x402.
What you can do:
- Submit transactions via relay service (backend wallet pays gas)
- Fund backend wallets via x402 payments (USDC)
- Batch transactions automatically to respect API limits
- Retry failed transactions with exponential backoff
- Create session tokens for authenticated batch requests
- Check backend wallet balance before submitting
- Wait for transaction confirmations on-chain
- Build applications that allow users to interact without ETH
On-chain user profiles - Read and write user profile data on Net Protocol.
What you can do:
- Read profile data: profile picture, X username, bio, display name, token address, canvas
- Write profile data with utilities to prepare Storage.put() transactions
- Batch-read multiple profile fields efficiently
- Build applications with decentralized user identity
Decentralized NFT marketplace - Buy, sell, and trade NFTs via Seaport on Net Protocol.
What you can do:
- Create and manage NFT listings and collection offers
- Buy listings and accept offers
- Query NFT ownership on-chain
- Build marketplace UIs with React hooks or the BazaarClient class
Topic-based message streams - Build social feeds, announcements, and community discussions.
What you can do:
- Read posts from topic-based feeds
- Post to feeds (social media style)
- Build decentralized social applications
- Create community discussion forums
On-chain scoring/upvoting - Upvote tokens, storage entries, and feed posts with strategy-based voting.
What you can do:
- Read upvote counts for tokens, storage entries, and feed posts
- Batch-read upvotes for multiple items in a single contract call
- Query scores by strategy or app
- Decode upvote messages and strategy metadata
- Build applications with on-chain reputation and curation
Command-line interface - Interact with Net Protocol from the terminal.
What you can do:
- Send and read messages on Net Protocol
- Upload files to Net Storage (supports small and large files)
- Read data from Net Storage
- Deploy Netr tokens (memecoin-NFT pairs with automatic Uniswap pool, locked liquidity, and creator fee share)
- Preview transactions before executing
- Works with environment variables for secure key management
Quick examples:
# Install globally
npm install -g @net-protocol/cli
# Send a message
netp message send --text "Hello from CLI!" --private-key $PRIVATE_KEY --chain-id 8453
# Read recent messages from an app
netp message read --app 0x1234... --limit 10 --chain-id 8453
# Read messages by topic
netp message read --topic "announcements" --chain-id 8453
# Deploy a Netr token
netp token deploy \
--name "My Token" \
--symbol "MTK" \
--image "https://example.com/image.png" \
--private-key $PRIVATE_KEY \
--chain-id 8453
# Encode-only mode (outputs transaction JSON without executing)
netp message send --text "Hello!" --chain-id 8453 --encode-only
netp token deploy --name "My Token" --symbol "MTK" --image "https://example.com/image.png" --chain-id 8453 --encode-onlyNetr token SDK - Deploy and interact with memecoin-NFT pairs on Net Protocol.
What you can do:
- Deploy memecoins with automatic Uniswap V3 liquidity
- Query token metadata, prices, and pool information
- Build deployment transactions for external signing
- Access locker data (LP locked for ~1000 years)
Quick examples:
import { NetrClient } from "@net-protocol/netr";
const client = new NetrClient({ chainId: 8453 });
// Get token info
const token = await client.getToken("0x...");
console.log(token?.name, token?.symbol);
// Get current price
const price = await client.getPrice("0x...");
console.log(`Price: ${price?.priceInEth} ETH`);
// Generate salt and build deploy transaction
const saltResult = await client.generateSalt({
name: "My Token",
symbol: "MTK",
image: "https://example.com/image.png",
deployer: "0x...",
});
const txConfig = client.buildDeployConfig(
{ name: "My Token", symbol: "MTK", image: "https://...", deployer: "0x..." },
saltResult.salt
);npm install @net-protocol/core @net-protocol/storage @net-protocol/relay @net-protocol/feeds wagmi viem react
# or
yarn add @net-protocol/core @net-protocol/storage @net-protocol/relay @net-protocol/feeds wagmi viem reactimport { useNetMessages, NetProvider } from "@net-protocol/core";
import { useStorage } from "@net-protocol/storage";
function App() {
return (
<NetProvider>
<MyComponent />
</NetProvider>
);
}
function MyComponent() {
const { messages, isLoading } = useNetMessages({
chainId: 8453,
filter: { appAddress: "0x..." },
});
const { data, isLoading: storageLoading } = useStorage({
chainId: 8453,
key: "my-key",
operatorAddress: "0x...",
});
return (
<div>
<div>Messages: {messages.length}</div>
{data && (
<div>
Storage: {data.text} - {data.value}
</div>
)}
</div>
);
}import { NetClient } from "@net-protocol/core";
import { StorageClient } from "@net-protocol/storage";
// Create clients
const netClient = new NetClient({ chainId: 8453 });
const storageClient = new StorageClient({ chainId: 8453 });
// Get messages
const messages = await netClient.getMessages({
filter: { appAddress: "0x..." },
});
// Get storage value
const storageData = await storageClient.get({
key: "my-key",
operator: "0x...",
});For detailed usage, API reference, and examples, see the individual package documentation:
- @net-protocol/core documentation
- @net-protocol/storage documentation
- @net-protocol/profiles documentation
- @net-protocol/bazaar documentation
- @net-protocol/cli documentation
- @net-protocol/netr documentation
- @net-protocol/relay documentation
- @net-protocol/feeds documentation
- @net-protocol/score documentation
Working examples demonstrating how to build with Net Protocol:
- Basic App - A Next.js React application showing chat messaging and storage features with wallet integration
See the examples directory for more details and setup instructions.
This repository includes a Claude Code plugin that enables AI-assisted development with Net Protocol. The plugin provides skills and agents that understand Net Protocol's contracts, SDK patterns, and best practices.
The quickest way to get started:
npx skills install stuckinaboot/net-publicAlternatively, you can install via the plugin marketplace:
-
Add the marketplace:
/plugin marketplace add stuckinaboot/net-public -
Install the plugin:
/plugin install net-protocol@net-protocol-marketplace
- Net Protocol skill - Contextual knowledge about Net contracts, SDK usage patterns, and best practices
- Net Explorer agent - Specialized agent for exploring and building with Net Protocol
See the plugin README for more details.
This is a monorepo managed with Yarn workspaces. Each package is independently versioned and can be used standalone.
packages/- SDK packagesdocs/- Additional documentationscripts/- Build and utility scripts
- Node.js 18+
- Yarn 4.0+
# Install dependencies
yarn install
# Build all packages
yarn build
# Run tests
yarn test
# Type check
yarn typecheckPackages are linked via Yarn workspaces for local development.
- Make your changes
- Run tests:
yarn test - Type check:
yarn typecheck - Build:
yarn build - Submit a pull request
MIT