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

solana-balance-cli

v1.1.0

Published

CLI tool to check Solana wallet balance in SOL and USD

Readme

Solana Balance CLI

A simple command-line tool to check your Solana wallet balance in both SOL and USD.

Package: solana-balance-cli | Command: sol-balance

Features

  • ✅ Fetch real-time Solana wallet balance
  • ✅ Display balance in SOL
  • ✅ Convert balance to USD using live price data from CoinGecko
  • ✅ Clean, formatted output
  • ✅ Error handling for invalid addresses

Installation

Install from npm (Recommended)

npm install -g solana-balance-cli

Install locally

npm install solana-balance-cli

Development Installation

git clone <repository-url>
cd solana-balance-cli
npm install
npm run build

Usage

Global Installation

After installing globally, you can use the sol-balance command from anywhere:

sol-balance <WALLET_ADDRESS>

Local Installation

If installed locally, use it with npx:

npx sol-balance <WALLET_ADDRESS>

Or add it to your package.json scripts:

{
  "scripts": {
    "check-balance": "sol-balance"
  }
}

Example

sol-balance CuieVDEDtLo7FypA9SbLM9saXFdb1dsshEkyErMqkRQq

Output

🔍 Fetching wallet balance...

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📍 Wallet: CuieVDEDtLo7FypA9SbLM9saXFdb1dsshEkyErMqkRQq
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💰 Balance: 0.0057 SOL
💵 SOL Price: $123.23 USD
💸 USD Value: $0.71 USD
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Global Installation (Optional)

To use the tool globally as sol-balance:

npm link

Then you can run:

sol-balance <WALLET_ADDRESS>

Technologies Used

  • TypeScript - Type-safe development
  • @solana/web3.js - Solana blockchain interaction
  • axios - HTTP requests for price data
  • commander - CLI framework
  • CoinGecko API - Real-time SOL/USD price data

Project Structure

solana-balance-cli/
├── src/
│   ├── index.ts      # Main CLI entry point
│   ├── solana.ts     # Solana balance fetching logic
│   └── price.ts      # USD price fetching logic
├── dist/             # Compiled JavaScript output
├── package.json
├── tsconfig.json
└── README.md

Error Handling

The tool handles various error scenarios:

  • Invalid wallet addresses
  • Network connection issues
  • API failures

Development

Version Management

This project uses Changesets for version management and changelog generation.

Creating a Changeset

When you make changes that should be released:

npm run changeset

This will prompt you to:

  1. Select the type of change (major, minor, patch)
  2. Write a summary of the changes

This creates a changeset file in .changeset/ that describes your changes.

After creating a changeset, commit and push it:

git add .changeset/
git commit -m "chore: add changeset"
git push

Versioning and Publishing

To create a new version and update the changelog:

npm run version

This will:

  • Read all changesets
  • Update the version in package.json
  • Generate/update CHANGELOG.md
  • Remove used changeset files

After versioning, commit the changes:

git add .
git commit -m "chore: version bump"
git push

To publish to npm:

npm run release

This will:

  • Build the project
  • Publish to npm using changesets

Or you can publish manually after versioning:

npm run version
git add .
git commit -m "chore: version bump"
git push
npm publish

License

ISC