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-cast

v0.1.3

Published

Read-only developer CLI for Midnight: network health, indexer queries, error decoding

Downloads

678

Readme

midnight-cast (mn)

Read-only developer CLI for Midnight network health, indexer queries, error decoding. Think Foundry cast for Midnight, not a wallet or app scaffold.

npm i -g midnight-cast
mn ping preprod && mn tip preprod && mn versions preprod

Requires Node.js 20+ (22+ recommended).

What it does

| Area | Commands | |------|----------| | Health | ping, tip, versions | | Chain | block latest, rpc | | Errors | decode (ledger, pallet, 1010, jsonrpc, --raw) | | Indexer | tx, dust-event, dust-events | | Config | config init, config show |

No wallet keys. No signing or proving.

Quick start

npm i -g midnight-cast          # or: npx midnight-cast …
mn config init                  # ~/.config/midnight-cast/config.toml
mn ping preprod
mn tip preprod
mn decode 170

Networks: preview, preprod, mainnet, local — use --network or MN_NETWORK.

Debug ladder

When something breaks, run in order:

  1. mn ping — services up?
  2. mn tip — indexer synced?
  3. mn versions — stack matches support matrix?
  4. mn decode — what does the error mean?
  5. mn tx — what happened on chain?

Common one-liners

mn decode --raw "1010: Invalid Transaction: Custom error: 186"
mn decode 1010                          # Substrate envelope → find inner N
mn tx <hash> --network preprod          # tx status, fees, segments (+ decode hint on fail)
mn dust-events --from 565900 --limit 10 --network preprod
mn rpc chain_getHeader --json
mn versions preprod --fail-on-mismatch  # CI; scans all @midnight-ntwrk/* in package.json

Community & support

| Need | Where | |------|--------| | Midnight errors, network issues, dev questions | Midnight Discord | | mn bug or something not working | GitHub Issues | | New command or feature idea | GitHub Issues (feature request) |

mn decode --raw "…" auto-detects 1010 envelopes, Custom(N), ledger error names, pallet module errors, and JSON-RPC codes in one paste. Map is stamped with ledger version. For codes not in the map or protocol questions — Discord + Midnight docs are the right place.

Note: mn may clash with midnight-wallet-cli on some machines (both install a mn binary). Use npx midnight-cast or midnight-cast if needed.

Documentation

Cast ↔ mn

cast block  →  mn block latest
cast rpc    →  mn rpc
cast logs   →  mn dust-events
cast 4byte  →  mn decode
cast send   →  wallet / Lace (not mn)

Development

git clone https://github.com/Kanasjnr/midnight-cast.git
cd midnight-cast && npm install && npm run build
npm link                        # global mn
npm run mn -- decode 170        # without link
npm test
INTEGRATION=1 npm run test:integration

License

Apache-2.0