Socket
Book a DemoInstallSign in
Socket

solana-better-cli

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

solana-better-cli

A comprehensive Solana wallet management CLI tool with portfolio tracking, token swapping, and more

1.0.3
latest
Source
npmnpm
Version published
Weekly downloads
20
-92.91%
Maintainers
1
Weekly downloads
 
Created
Source

Solana Better CLI

A comprehensive Solana wallet management CLI tool with portfolio tracking, token swapping, and more.

Features

  • 🏦 Wallet Management: Generate new wallets, load existing ones from private keys (JSON array, base58, or files), and manage multiple accounts
  • 💰 Portfolio Tracking: View your complete Solana portfolio with real-time balances
  • 🔄 Token Swapping: Swap tokens using Jupiter aggregator for best rates
  • 💸 SOL Transfers: Send SOL to other addresses with optional memos
  • 🎁 SOL Wrapping: Wrap and unwrap SOL to/from WSOL
  • 📊 Balance Checking: Check SOL and token balances individually or all at once
  • 🎯 Interactive CLI: User-friendly command-line interface with guided workflows

Installation

npm install -g solana-better-cli

Local Installation

npm install solana-better-cli

Usage

Quick Start

# Start the interactive wallet manager
solana-better start

# Or use the short alias
sol start

Available Commands

# Generate a new wallet
solana-better create-wallet

# Generate and save wallet to file
solana-better create-wallet -o wallet.json

# Initialize wallet from private key
solana-better init "[1,2,3,...]"  # JSON array format
solana-better init "base58string" # Base58 format
solana-better init wallet.json    # File path

# Initialize and save to file
solana-better init "[1,2,3,...]" -s my-wallet.json

# Start interactive mode
solana-better start

# Show help
solana-better --help

Interactive Features

Once you start the tool, you'll have access to:

  • Wallet Setup

    • Generate new wallet
    • Load from private key
    • Load from file
  • Main Operations

    • View Portfolio
    • Transfer SOL
    • Wrap/Unwrap SOL
    • Swap Tokens
    • Check Balance
    • Change Wallet

Configuration

The tool uses environment variables for configuration. Create a .env file in your project root:

# Solana RPC URL (default: https://api.mainnet-beta.solana.com)
RPC_URL=https://api.mainnet-beta.solana.com

# Your private key (optional, for automated usage)
PRIVATE_KEY=[your-private-key-array]

# Commitment level (default: confirmed)
COMMITMENT=confirmed

CLI Configuration Options

You can also configure the tool directly from the command line without environment variables:

# Use a custom RPC endpoint
solana-better --rpc-url https://api.devnet.solana.com start

# Switch to testnet
solana-better --network testnet start

# Use a different commitment level
solana-better --commitment finalized start

# Set custom slippage and priority fee
solana-better --slippage 500 --priority-fee 2000 start

# Combine multiple options
solana-better --rpc-url https://api.testnet.solana.com --network testnet --commitment processed start

Available CLI Options

  • -r, --rpc-url <url> - Custom RPC URL (default: https://api.mainnet-beta.solana.com)
  • -n, --network <network> - Solana network (mainnet-beta, testnet, devnet)
  • -c, --commitment <level> - Commitment level (confirmed, finalized, processed)
  • --slippage <bps> - Slippage tolerance in basis points (default: 300)
  • --priority-fee <lamports> - Priority fee in lamports (default: 1000)

Network-Specific RPC URLs

Here are some common RPC endpoints you can use:

  • Mainnet: https://api.mainnet-beta.solana.com
  • Testnet: https://api.testnet.solana.com
  • Devnet: https://api.devnet.solana.com
  • Local: http://localhost:8899

Examples

Generate a New Wallet

solana-better create-wallet -o my-wallet.json

Transfer SOL

solana-better start
# Then select "Transfer SOL" from the menu

Swap Tokens

solana-better start
# Then select "Swap Tokens" from the menu

Initialize from Private Key

# From JSON array
solana-better init "[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64]"

# From base58 string
solana-better init "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtrP1V5xih"

# From file
solana-better init wallet.json

Development

Prerequisites

  • Node.js 16+
  • npm or yarn

Setup

# Clone the repository
git clone https://github.com/yourusername/solana-better-cli.git
cd solana-better-cli

# Install dependencies
npm install

# Build the project
npm run build

# Run in development mode
npm run dev

Scripts

  • npm run build - Build the TypeScript project
  • npm run start - Run the built version
  • npm run dev - Run in development mode with ts-node
  • npm run clean - Clean the dist folder

Publishing

To publish to npm:

# Login to npm (if not already logged in)
npm login

# Publish the package
npm publish

Contributing

  • Fork the repository
  • Create a feature branch
  • Make your changes
  • Add tests if applicable
  • Submit a pull request

License

MIT License - see LICENSE file for details.

Support

  • Create an issue on GitHub
  • Check the documentation
  • Join our community discussions

Disclaimer

This tool is for educational and development purposes. Always test with small amounts before using with significant funds. The developers are not responsible for any financial losses.

Keywords

solana

FAQs

Package last updated on 19 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.