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

siwx

v0.1.2

Published

Chain-agnostic authentication library implementing CAIP-122 standard for Sign-In with X (SIWx)

Readme

SIWx - Sign-In with X

A chain-agnostic authentication library implementing the CAIP-122 standard for Sign-In with X (SIWx) across multiple blockchain ecosystems.

Features

  • 🔗 Chain Agnostic: Unified API for multiple blockchain namespaces
  • 🔐 Secure: Follows CAIP-122 standard for authentication
  • 🚀 Easy to Use: Simple and intuitive API
  • 📦 TypeScript: Full TypeScript support with type definitions
  • Lightweight: Minimal dependencies

Supported Chains

  • EIP-155 (Ethereum and EVM-compatible chains)
  • Solana (Solana blockchain)
  • BIP-322 (Bitcoin)

Installation

npm install siwx

Quick Start

Basic Usage

import { SIWx } from "siwx";

// Create a message
const message = SIWx.createMessage({
  domain: "example.com",
  address: "0x1234567890123456789012345678901234567890",
  chainId: "eip155:1",
  uri: "https://example.com/login",
  statement: "Sign in to Example.com",
});

// Sign the message
const result = await SIWx.signMessage(message, privateKey);
console.log(result.signature);

// Verify the signature
const isValid = await SIWx.verifySignature(message, result.signature);
console.log(isValid); // true

Chain-Specific Usage

Ethereum (EIP-155)

import { eip155, createMessage } from "siwx";

const message = createMessage({
  domain: "example.com",
  address: "0x1234567890123456789012345678901234567890",
  chainId: "eip155:1", // Ethereum mainnet
  uri: "https://example.com/login",
  statement: "Sign in with Ethereum",
  nonce: "random-nonce",
  issuedAt: new Date().toISOString(),
});

// Sign with Ethereum private key
const result = await eip155.signMessage(message, "0x...");

// Verify
const isValid = await eip155.verifySignature({
  message,
  signature: result.signature,
});

Solana

import { solana, createMessage } from "siwx";

const message = createMessage({
  domain: "example.com",
  address: "GwAF45zjfyGzUbd3i3hXxzGeuchzEZXwpRYHZM5912F1",
  chainId: "solana:mainnet",
  uri: "https://example.com/login",
  statement: "Sign in with Solana",
});

// Sign with Solana keypair
const result = await solana.signMessage(message, keypairSecretKey);

// Verify
const isValid = await solana.verifySignature({
  message,
  signature: result.signature,
});

API Reference

SIWx

The main unified API object.

SIWx.createMessage(options)

Creates a SIWx message object.

Options:

  • domain (string, required): The domain requesting the signature
  • address (string, required): The blockchain address
  • chainId (ChainId, required): The CAIP-2 chain ID (e.g., "eip155:1")
  • uri (string, required): The URI of the service
  • version (string, optional): Version of the message (default: "1")
  • statement (string, optional): Human-readable statement
  • nonce (string, optional): Random nonce (auto-generated if not provided)
  • issuedAt (string, optional): ISO 8601 timestamp (default: current time)
  • expirationTime (string, optional): ISO 8601 timestamp
  • notBefore (string, optional): ISO 8601 timestamp
  • requestId (string, optional): Request identifier
  • resources (string[], optional): List of resources

Standards

This library implements:

Publishing to npm

Before publishing to npm, make sure to:

  1. Update package.json:

    • Change repository, bugs, homepage URLs to your GitHub repository
    • Update author field with your name
  2. Build the package:

    npm run build
  3. Test locally (optional but recommended):

    npm link
    # In another project
    npm link siwx
  4. Login to npm:

    npm login
  5. Publish:

    npm publish
  6. For updates:

    • Update version in package.json (following semver)
    • Or use: npm version patch|minor|major
    • Then: npm publish

Contributing

If you want to contribute to this project:

# Clone the repository
git clone https://github.com/lofee488/siwx.git
cd siwx

# Install dependencies
npm install

# Run tests
npm test

# Build
npm run build

License

MIT