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

midnight-wallet-kit

v1.0.3

Published

Production-grade wallet adapter system for the Midnight Network

Readme

Midnight Wallet Kit

Production-grade wallet integration kit for the Midnight Network. Supports ALL major wallets in the Midnight ecosystem with a unified, type-safe API.


🎯 Supported Wallets

| Wallet | Type | Dust-Free | Shielded Balances | Networks | Install | |--------|------|-----------|-------------------|----------|--------| | 1AM | Midnight-Native | ✅ | ✅ | preview, preprod, mainnet | Chrome | | Nocturne | Midnight-Native | ❌ | ✅ | preview, preprod, mainnet | GitHub | | NuFi | CIP-30 | ❌ | ❌ | preview, preprod, mainnet | Website | | GeroWallet | CIP-30 | ❌ | ❌ | preview, preprod, mainnet | Website | | VESPR | CIP-30 | ❌ | ❌ | preview, preprod, mainnet | Website | | Yoroi | CIP-30 | ❌ | ❌ | preview, preprod, mainnet | Website | | Ctrl | CIP-30 | ❌ | ❌ | preview, preprod, mainnet | Website | | SubWallet | CIP-30 | ❌ | ❌ | preview, preprod, mainnet | Website |


🚀 Key Features

  • 🛡️ Resilient Probing: Exhaustively searches for working RPC methods across different provider standards
  • 🔐 Dust-Free Execution: 1AM wallet + ProofStation sponsors all fees (zero dust needed)
  • 🏗️ Safe Intent Builder: Automatic sanitization and Zod-backed validation
  • ⚛️ First-Class React Support: Hooks (useWallet, useConnect, useIntent, useBalance)
  • 📋 Wallet Registry: Pre-configured registry of all 8 supported wallets
  • 🧪 Simplified Unit Testing: Mock adapter included

📦 Install

npm install midnight-wallet-kit

⚡ Quick Start (Easiest Way)

import { createMidnightWalletManager } from 'midnight-wallet-kit';

// Creates a manager with ALL 8 wallets pre-registered
const manager = createMidnightWalletManager({
  network: 'preprod', // default network for Midnight-native wallets
});

// Connect to the first available wallet (tries 1AM → Nocturne → NuFi → ...)
await manager.connectWithFallback([
  '1AM',        // Dust-free, best UX
  'Nocturne',   // Midnight-native
  'NuFi',       // Popular multi-chain
  'GeroWallet',
  'VESPR',
  'Yoroi',
  'Ctrl',
  'SubWallet',
]);

🔧 Advanced: Select Specific Wallets

import { createMidnightWalletManager } from 'midnight-wallet-kit';

// Only register specific wallets
const manager = createMidnightWalletManager({
  only: ['1AM', 'NuFi', 'Nocturne'],
});

// Or skip specific wallets
const manager = createMidnightWalletManager({
  skip: ['SubWallet', 'Ctrl'],
});

⚛️ React Integration

import { WalletProvider, useWallet, useConnect, useBalance } from 'midnight-wallet-kit';

function App() {
  return (
    <WalletProvider manager={manager} autoRestore={true}>
      <YourApp />
    </WalletProvider>
  );
}

function YourApp() {
  const { address, isConnected } = useWallet();
  const { connect, disconnect } = useConnect();
  const { balance } = useBalance();

  if (!isConnected) {
    return <button onClick={() => connect('1AM')}>Connect 1AM</button>;
  }

  return (
    <div>
      <p>Address: {address}</p>
      <p>Balance: {balance?.tDUST?.toString() || '0'} tDUST</p>
      <button onClick={disconnect}>Disconnect</button>
    </div>
  );
}

🏗️ 1AM-Specific: Dust-Free Contract Deployment

import { OneAMWalletAdapter, buildOneAMProviders, deployContract } from 'midnight-wallet-kit';

// Connect to 1AM (dust-free execution)
await manager.connect('1AM');
const adapter = manager.getActiveWallet() as OneAMWalletAdapter;

// Build providers (ProofStation sponsors fees)
const providers = await buildOneAMProviders(adapter, {
  zkConfigBaseUrl: 'https://your-app.com/contract/compiled/your-contract',
});

// Deploy contract (zero dust needed!)
const deployed = await deployContract(providers, {
  compiledContract: yourCompiledContract,
});
console.log('Contract deployed:', deployed.contractAddress);

📝 Available Adapters

import {
  OneAMWalletAdapter,      // 1AM - Dust-free
  NocturneWalletAdapter,   // Nocturne - Midnight-native
  NuFiWalletAdapter,        // NuFi
  GeroWalletAdapter,        // GeroWallet
  VesprWalletAdapter,       // VESPR
  YoroiWalletAdapter,       // Yoroi
  CtrlWalletAdapter,        // Ctrl
  SubWalletAdapter,         // SubWallet
  InjectedWalletAdapter,    // Generic CIP-30/Midnight
  MockWalletAdapter,         // Testing
} from 'midnight-wallet-kit';

🧪 Testing

import { MockWalletAdapter } from 'midnight-wallet-kit';

const mockAdapter = new MockWalletAdapter({
  name: 'TestWallet',
  shouldFail: false,
});

📚 Full API Reference

For complete documentation, see DOCS.md.


MIT © 2026 Tushar Pamnani