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

base-gas-estimator

v0.1.1

Published

A free, open-source CLI to estimate gas costs on Base in ETH and USD.

Readme

Base Gas Estimator CLI

A free, open-source command-line tool to estimate gas costs on Base network in ETH and USDC.

npm version License: MIT

Note: Costs are displayed in USDC (USD Coin), the native stablecoin of Base. 1 USDC ≈ $1 USD.

✨ Features

  • 🚀 Zero-cost gas estimation for Base mainnet and Sepolia testnet
  • 💰 Real-time ETH/USDC pricing via CoinGecko API
  • Lightning-fast estimates using ethers.js and Base RPC
  • 🔧 Developer-friendly CLI with clear error messages
  • 📦 No API keys required - completely free to use
  • 🌐 Cross-platform support (Windows, macOS, Linux)
  • 🎯 EIP-1559 compatible with accurate fee calculations

🚀 Quick Start

Get instant gas estimates without installation:

npx base-gas-estimator transfer --to 0x742D35cC6634c0532925a3b8D4c9Db96C4B5Da5e --value 0.1

📥 Installation (Optional)

Install globally for faster access:

npm install -g base-gas-estimator
base-gas transfer --to 0x742D35cC6634c0532925a3b8D4c9Db96C4B5Da5e --value 0.1

🧪 Usage Examples

Base Mainnet (Default)

# Estimate 0.1 ETH transfer
npx base-gas-estimator transfer --to 0x742D35cC6634c0532925a3b8D4c9Db96C4B5Da5e --value 0.1

# Estimate 1 ETH transfer
npx base-gas-estimator transfer --to 0x742D35cC6634c0532925a3b8D4c9Db96C4B5Da5e --value 1.0

Base Sepolia Testnet

# Test on Sepolia
npx base-gas-estimator transfer --to 0x742D35cC6634c0532925a3b8D4c9Db96C4B5Da5e --value 0.01 --network base-sepolia

Help & Options

# Show all available commands and options
npx base-gas-estimator --help
npx base-gas-estimator transfer --help

📊 Sample Output

Gas Units: 21,000
Gas Price: 0.001897 Gwei (1,897,000,000 wei)
Total Cost: 0.000039837 ETH (~0.000150 USDC)

🌐 Why Base?

Base is Coinbase's secure, low-cost, builder-friendly Ethereum L2 built on Optimism. With significantly lower gas fees than Ethereum mainnet, Base enables:

  • Affordable DeFi transactions for everyday users
  • Scalable dApp development with Ethereum compatibility
  • Seamless onboarding via Coinbase's infrastructure
  • Growing ecosystem of innovative Web3 applications

This CLI helps developers and users estimate transaction costs before executing, enabling better financial planning and user experience optimization.

🛠️ Development

Run Tests

npm test

Local Development

git clone https://github.com/logiccrafterdz/Base-Gas-Estimator-CLI.git
cd Base-Gas-Estimator-CLI
npm install
node src/cli.js transfer --to 0x742D35cC6634c0532925a3b8D4c9Db96C4B5Da5e --value 0.1

🤝 Contributing

We welcome contributions! This project aims to be the most reliable and user-friendly Base gas estimation tool. Here's how you can help:

  • 🐛 Report bugs via GitHub Issues
  • 💡 Suggest features for better developer experience
  • 🔧 Submit pull requests with improvements
  • 📖 Improve documentation and examples
  • Star the repo to show support

Development Guidelines

  • Keep dependencies minimal (currently just 3)
  • Maintain zero-cost operation (no API keys)
  • Follow existing code style and patterns
  • Add tests for new functionality
  • Update documentation for changes

📜 License

MIT License - feel free to use this tool in your projects, commercial or otherwise.

🌟 Join the Base Builders Spotlight

Your project can be featured in the community directory!

npx base-gas-estimator spotlight --register

🔗 Links


Built with ❤️ for the Base ecosystem

Notes

  • ETH price is fetched from CoinGecko's free API (ETH/USD used as USDC equivalent).
  • For standard ETH transfers between Externally Owned Accounts (EOAs), the gas limit is fixed at 21,000. If the RPC's eth_estimateGas call fails (e.g., due to missing from context), the tool safely defaults to this standard value.
  • Gas price uses EIP-1559 fee data (gasPrice or maxFeePerGas) from the RPC.

Project Structure

Base-Gas-Estimator-CLI/
├── src/
│   ├── cli.js          # CLI command parsing and execution
│   ├── estimator.js    # Gas estimation logic using ethers.js
│   ├── price.js        # Fetch ETH/USDC equivalent from CoinGecko
│   └── utils.js        # Helper functions (address validation, number formatting)
├── package.json        # Includes "type": "module" and "bin" field
├── README.md           # Usage and Base-focused context
└── .gitignore

Error Handling

  • Invalid address → clear message to fix input
  • RPC failure → friendly retry message
  • Price fetch failure → prints ETH-only costs; USDC becomes (~N/A USDC)