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

consolechain

v0.2.2

Published

consolechain CLI

Readme

ConsoleChain

ConsoleChain is a powerful command-line interface (CLI) tool for seamless interaction with smart contracts on various blockchain networks. Built with TypeScript for enhanced type safety and developer experience.

ConsoleChain Screenshot

Features

  • 1000+ Chains - Access any EVM chain via chainlist.org integration
  • RPC Fallback System - Automatically uses backup RPCs if primary fails
  • Smart Chain Selection - Simple UI showing only chain slugs
  • Custom RPC Support - Use any RPC endpoint you prefer
  • Secure Private Key Storage - Optional encryption for your keys
  • Interactive REPL - Autocomplete, command history, and help system
  • Type Safety - Built with TypeScript
  • Standard Support - Built-in ABIs for ERC-20, ERC-721, and ERC-1155

Installation

Install ConsoleChain globally using npm:

npm install -g consolechain

Quick Start

Option 1: Let CLI Ask for Chain (Recommended)

Just provide the contract address - CLI will prompt you to select the chain:

consolechain 0xYourContractAddress --standard 20

# You'll be prompted:
# 🔗 Select a blockchain network
# ? Search (name, symbol, or chain ID): ethereum
# ? Select chain: ethereum

Option 2: Specify Chain by Name

consolechain 0xYourContractAddress --chain ethereum --standard 721
consolechain 0xYourContractAddress --chain polygon --standard 20
consolechain 0xYourContractAddress --chain base --abi ./abi.json

Option 3: Custom RPC URL

Use any RPC endpoint directly:

consolechain 0xYourContractAddress --rpc https://eth.llamarpc.com --standard 20

List Available Chains

# Show popular chains
consolechain list-chains

# Search for specific chains
consolechain list-chains polygon
consolechain list-chains arbitrum
consolechain list-chains 8453  # Search by chain ID

Setting Up Your Private Key

To execute transactions that modify state, set your private key:

consolechain set-pk your-private-key-here

🔒 Security Best Practice: Set the CONSOLECHAIN_ENCRYPTION_KEY environment variable to encrypt your private key:

export CONSOLECHAIN_ENCRYPTION_KEY=$(openssl rand -hex 32)
consolechain set-pk your-private-key

Interactive Console

Once connected, you have access to several features:

Autocomplete

  • Press TAB to autocomplete function names
  • Press TAB twice to see all available functions

Get Function Help

Ξ balanceOf -h
balanceOf(owner: address)

Call Functions

Ξ balanceOf 0x1234567890123456789012345678901234567890
  1000000000000000000

Special Commands

  • help - Show available commands
  • exit - Exit the console
  • clear - Clear the screen

Chain Selection Examples

Interactive Selection

# Start interactive mode
consolechain 0xYourAddress --interactive --standard 721

# You'll be prompted to:
# 1. Search for a chain (e.g., "base", "polygon", "arbitrum")
# 2. Select from matching results
# 3. Automatically connects with best RPC

Direct Chain Selection

# Ethereum Mainnet
consolechain 0xAddress --chain ethereum --standard 20

# Polygon
consolechain 0xAddress --chain polygon --standard 721

# Base
consolechain 0xAddress --chain base --standard 1155

# Arbitrum
consolechain 0xAddress --chain arbitrum --abi ./MyContract.json

# Any chain by ID
consolechain 0xAddress --chain 8453 --standard 20  # Base

Custom RPC Examples

# Use a specific RPC provider
consolechain 0xAddress --rpc https://eth.llamarpc.com --standard 20

# Use your own node
consolechain 0xAddress --rpc http://localhost:8545 --abi ./abi.json

# Use a premium RPC service
consolechain 0xAddress --rpc https://mainnet.infura.io/v3/YOUR_KEY --standard 721

Examples

Interacting with USDC on Ethereum

# Using chain name
consolechain 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 --chain ethereum --standard 20

# Inside console
Ξ name
  USD Coin
Ξ symbol
  USDC
Ξ decimals
  6
Ξ totalSupply
  24835236580839861

Interacting with NFTs on Base

# Interactive mode
consolechain 0xYourNFTAddress --interactive --standard 721

# Search for "base" → Select "Base" → Auto-connects
Ξ name
Ξ ownerOf 1

Using Custom ABI

consolechain 0xCustomContract --chain arbitrum --abi ./MyContract.json
Ξ myCustomFunction arg1 arg2

Passing Complex Arguments

# Arrays
Ξ batchTransfer '["0xAddr1","0xAddr2"]' '[100,200]'

# Strings with spaces
Ξ setName 'My Token Name'

# Numbers
Ξ setValue 123456

# Booleans
Ξ setFlag true

Commands

| Command | Aliases | Description | | ------------------------ | -------------- | -------------------------------------------------- | | consolechain <address> | - | Interactive console for smart contract interaction | | list-chains [search] | ls, chains | List and search available blockchain networks | | set-pk <key> | - | Set your private key for signing transactions | | --help | -h | Show help information | | --version | -v | Show version number |

Command Options

| Option | Alias | Description | | ------------------- | ----- | -------------------------------- | | --chain <name> | -c | Specify chain by name or ID | | --rpc <url> | -r | Use custom RPC URL | | --interactive | -i | Interactive chain selection | | --standard <type> | -s | Use standard ABI (20, 721, 1155) | | --abi <path> | - | Path to custom ABI file |

Development

Build from Source

git clone https://github.com/vieiraricardo/consolechain.git
cd consolechain
npm install
npm run build
npm link

Run Tests

npm test

Development Mode

npm run dev

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

🔗 Links

Security Notice

  • Always use the encryption feature for private key storage
  • Use testnets for development and testing
  • Verify contract addresses and chain IDs before executing transactions
  • When using custom RPCs, ensure they are from trusted sources