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

necjs-test

v0.0.2

Published

NECJS SDK for NCOG Earth Chain RPC

Readme

NEC BLOCKCHAIN SDK

The all-in-one JavaScript/TypeScript SDK for building apps on the NCOG Earth Chain.
Supports Node.js, browsers, React, Next.js, Vite, and more.
Includes post-quantum cryptography, wallet management, contract interaction, extension wallet support, contract deployment, and real-time subscriptions.


🚀 Quick Start

1. Install

npm install necjs

2. Connect in Your App

With a Private Key:

import { loadWasm, Provider, Wallet } from 'necjs';

(async () => {
  await loadWasm(); // Required for cryptography
  const wallet = await Wallet.create('your-private-key-hex');
  const provider = new Provider('https://rpc.ncog.earth');
  const balance = await provider.getBalance(wallet.address);
  console.log('Balance:', balance);
})();

With a Browser Extension Wallet:

import { Provider, ExtensionSigner } from 'necjs';

(async () => {
  if (window.ncogWallet) {
    const provider = new Provider('https://rpc.ncog.earth');
    const signer = new ExtensionSigner(window.ncogWallet, provider);
    const address = await signer.getAddress();
    const balance = await provider.getBalance(address);
    console.log('Extension Wallet Address:', address);
    console.log('Balance:', balance);
  }
})();

🧩 Features

  • Ethereum-compatible JSON-RPC: Connect to any NCOG or Ethereum-style node.
  • Wallets: Use private keys or browser extension wallets.
  • Smart Contracts: Deploy, call, and interact with contracts.
  • ContractFactory: Deploy and attach to contracts with gas estimation and constructor args.
  • WebSocket Subscriptions: Real-time blockchain event subscriptions (Node.js & browser).
  • Post-Quantum Security: MLKEM cryptography and MLDSA87 transaction signing via WebAssembly.
  • Utilities: Hex/decimal conversion, Ether/Wei conversion, address validation, and more.
  • Framework Ready: Works out-of-the-box with React, Next.js, Vite, and more.

🏗️ Modules Overview

  • Provider: Low-level JSON-RPC client for blockchain nodes.
  • Wallet & Signer: Private key management, address derivation, MLKEM crypto, and transaction signing.
  • ExtensionSigner: Integrates with browser extension wallets (e.g., window.ncogWallet).
  • Contract: Interact with smart contracts (web3.js-style dynamic methods).
  • ContractFactory: Deploy new contracts and attach to existing ones.
  • Subscription: WebSocket-based real-time event subscriptions.
  • MLKEM: Post-quantum cryptography (keygen, encrypt/decrypt, sign, address derivation).

🛠️ Utilities

  • hexToDecimalString(hex): Convert hex to decimal string/number.
  • decimalToHex(value): Convert decimal to hex (0x-prefixed).
  • etherToWeiHex(value): Convert Ether to Wei (hex).
  • valueToNineDecimalHex(value): Convert value to hex with 9 decimals.
  • formatUnits(value, decimals): Format value with specified decimals.
  • isValidAddress(address): Validate EVM address format.
  • serializeForRpc(payload): Prepare transaction payload for JSON-RPC.
  • normalizeResponse(resp): Normalize JSON-RPC responses (hex to decimal, etc).

📦 Framework Integration


📱 React Native Support

The SDK includes a React Native specific export that excludes wallet and MLKEM functionality for better compatibility:

// React Native automatically uses the optimized export
import { Provider, Contract, ContractFactory } from 'necjs';

Features included in React Native:

  • Provider, Contract, ContractFactory
  • ExtensionSigner (if browser extension is available)
  • All utility functions
  • GraphQL functions
  • WebSocket subscriptions

Excluded for React Native:

  • Wallet management and private key handling
  • MLKEM post-quantum cryptography
  • WASM dependencies

See React Native Integration Guide for detailed setup instructions.

NECJS can be used in React Native projects with additional configuration and polyfills. While React Native is not natively supported by Node.js or browser-only JavaScript packages, you can follow our step-by-step guide to enable NECJS in your React Native app.

  • Guide: React Native Integration Guide
  • Requirements: Polyfills for Node.js core modules, Metro bundler configuration, and (optionally) WASM loader adjustments.
  • Limitations: Some advanced features may require extra patching. See the guide for troubleshooting and caveats.

📚 Documentation


🛠️ Development

  • Build: npm run build
  • Test: npm test
  • Lint: npm run lint

🤝 Community & Support


📝 License

MIT


Ready to build the future? Start with NECJS SDK today!