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/profiles

v0.1.4

Published

Net Profiles SDK for reading and writing user profile data on the Net protocol

Downloads

969

Readme

@net-protocol/profiles

Net Profiles SDK for reading and writing user profile data on the Net protocol.

Installation

npm install @net-protocol/profiles
# or
yarn add @net-protocol/profiles

Features

  • Read profile data: Profile picture, X username, bio, canvas content
  • Write profile data: Utilities to prepare Storage.put() transactions
  • Efficient batch reads: useBasicUserProfileMetadata batches multiple reads
  • Built on net-storage: Uses the Net Storage SDK for underlying storage operations

Usage

Reading Profile Data (React)

import {
  useProfilePicture,
  useProfileXUsername,
  useBasicUserProfileMetadata,
} from "@net-protocol/profiles/react";

function UserProfile({ address }: { address: string }) {
  // Option 1: Individual hooks
  const { profilePicture, isLoading: pictureLoading } = useProfilePicture({
    chainId: 8453, // Base
    userAddress: address,
  });

  const { xUsername, isLoading: usernameLoading } = useProfileXUsername({
    chainId: 8453,
    userAddress: address,
  });

  // Option 2: Batch read (more efficient)
  const { profilePicture, xUsername, isLoading } = useBasicUserProfileMetadata({
    chainId: 8453,
    userAddress: address,
  });

  return (
    <div>
      {profilePicture && <img src={profilePicture} alt="Profile" />}
      {xUsername && <a href={`https://x.com/${xUsername}`}>@{xUsername}</a>}
    </div>
  );
}

Writing Profile Data

import { useWriteContract } from "wagmi";
import {
  getProfilePictureStorageArgs,
  getXUsernameStorageArgs,
  STORAGE_CONTRACT,
} from "@net-protocol/profiles";

function UpdateProfile() {
  const { writeContract } = useWriteContract();

  const handleUpdatePicture = (imageUrl: string) => {
    const args = getProfilePictureStorageArgs(imageUrl);
    writeContract({
      abi: STORAGE_CONTRACT.abi,
      address: STORAGE_CONTRACT.address,
      functionName: "put",
      args: [args.bytesKey, args.topic, args.bytesValue],
    });
  };

  const handleUpdateXUsername = (username: string) => {
    const args = getXUsernameStorageArgs(username);
    writeContract({
      abi: STORAGE_CONTRACT.abi,
      address: STORAGE_CONTRACT.address,
      functionName: "put",
      args: [args.bytesKey, args.topic, args.bytesValue],
    });
  };

  return (
    <form>
      {/* Form fields */}
    </form>
  );
}

Profile Fields

| Field | Description | Notes | |-------|-------------|-------| | Profile Picture | URL to your profile image | Any valid URL (HTTPS, IPFS, etc.) | | X Username | Your X (Twitter) handle | Stored without @ prefix (e.g., myusername) | | Bio | Short profile bio | Max 280 characters | | Display Name | User-chosen display name | Max 25 characters | | Canvas | Custom HTML profile page | For advanced customization |

Storage Keys

| Key | Description | Data Format | |-----|-------------|-------------| | PROFILE_PICTURE_STORAGE_KEY | Profile picture URL | Plain string (URL) | | PROFILE_METADATA_STORAGE_KEY | Profile metadata JSON | { x_username: "handle", bio: "...", display_name: "..." } | | PROFILE_CANVAS_STORAGE_KEY | Custom HTML canvas | HTML string |

API Reference

Hooks (from @net-protocol/profiles/react)

  • useProfilePicture({ chainId, userAddress }) - Fetch profile picture URL
  • useProfileXUsername({ chainId, userAddress }) - Fetch X username
  • useProfileCanvas({ chainId, userAddress }) - Fetch canvas HTML
  • useBasicUserProfileMetadata({ chainId, userAddress }) - Batch fetch picture & username

Utilities (from @net-protocol/profiles)

  • getProfilePictureStorageArgs(imageUrl) - Prepare picture update args
  • getXUsernameStorageArgs(username) - Prepare X username update args
  • getBioStorageArgs(bio) - Prepare bio update args
  • getDisplayNameStorageArgs(displayName) - Prepare display name update args
  • getProfileMetadataStorageArgs(metadata) - Prepare metadata update args
  • getProfileCanvasStorageArgs(html) - Prepare canvas update args
  • parseProfileMetadata(json) - Parse metadata JSON
  • isValidUrl(url) - Validate URL format
  • isValidXUsername(username) - Validate X username format
  • isValidBio(bio) - Validate bio format (max 280 chars, no control chars)
  • isValidDisplayName(displayName) - Validate display name format (max 25 chars, no control chars)

Dependencies

  • @net-protocol/storage - Storage SDK
  • @net-protocol/core - Core utilities
  • viem - Ethereum utilities

Peer Dependencies (for React hooks)

  • react ^18.0.0
  • wagmi ^2.15.0

License

MIT