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

anchorx-ray

v0.1.0

Published

## Overview This script scans and extracts account information for Solana programs based on their Interface Definition Language (IDL) files. It uses the `@coral-xyz/anchor` and `@solana/web3.js` libraries to interact with the Solana blockchain, identify d

Readme

Solana Program Account Scanner

Overview

This script scans and extracts account information for Solana programs based on their Interface Definition Language (IDL) files. It uses the @coral-xyz/anchor and @solana/web3.js libraries to interact with the Solana blockchain, identify different types of accounts, and decode account data.

Features

  • Loads IDL files from target/idl/.
  • Scans all accounts associated with detected programs.
  • Identifies account types: Wallets, PDAs, Data Accounts, and Programs.
  • Decodes account data using the BorshAccountsCoder.
  • Saves all extracted information to accounts.json.
  • Display it

Example

Prerequisites

Ensure you have the following installed:

  • Node.js (>=16.x recommended)
  • Anchor framework (for building Solana programs)
  • Solana CLI (for interacting with the blockchain)

Installation

npm install https://github.com/crytic/anchorx-ray

Configuration

If your test don't use the same rpc url, you can change in the .env file:

RPC_URL=<YOUR_RPC>

If no RPC URL is provided, the script defaults to http://127.0.0.1:8899 (local Solana test validator).

Usage

Run the script in your Anchor project:

npx anchorx-ray

This will:

  1. Load all IDL files from target/idl/.
  2. Fetch programs owned by the accounts from the RPC.
  3. Identify and categorize these accounts using IDL and some other computations.
  4. Save the results in accounts.json.
  5. Open a visualization at http://localhost:3000/ in the browser.

Account Type Identification

The script categorizes accounts as:

  • Program Account: The executable program itself.
  • Wallet: A system account owned by the Solana System Program. (normally it will not happen for the moment since only accounts owned by the program are taken from the RPC)
  • PDA (Program Derived Address): A non-executable program-owned address.
  • Data Account: A regular program-owned account storing data.
  • Other: Any account that doesn’t fit the above categories.

Output Format

The output is saved in accounts.json and contains details like:

[
  {
    "name": "example_program",
    "address": "ABC123...",
    "owner": "11111111111111111111111111111111",
    "lamports": 1000000,
    "executable": true,
    "dataSize": 0,
    "accountType": "Program",
    "decodedData": null
  }
]

And it will open a diagram showing all accounts used in the tests (program + accounts owned by the program)

Troubleshooting

  • No IDL files found: Ensure you have built your Anchor program using anchor build.
  • Failed to fetch accounts: Check your RPC URL and network connection.
  • Only one program is shown in the diagram: Ensure you have run tests.

For developers

If you want to update a part of the script,

  1. Clone the repo
gh repo clone crytic/anchorx-ray
  1. Install dependencies
npm install
  1. Do your modifications
  2. Then
npm run build