xsol-cli
v1.0.3
Published
A comprehensive Solana CLI tool for account management and transfers
Downloads
6
Maintainers
Readme
Solana Tools Collection
A comprehensive collection of Solana blockchain utilities for account management, balance checking, and fund transfers.
🌟 Features
- Account Generation: Batch generate Solana accounts with public/private key pairs
- Balance Checking: Check SOL balances for multiple accounts
- Batch Transfer: Transfer all funds from multiple accounts to a target account
- Mix Transfer: Perform random transfers between accounts for privacy mixing
🛠️ Tech Stack
- Solana Web3.js: Solana blockchain interaction
- TypeScript: Type-safe development
- bs58: Base58 encoding/decoding for private keys
📦 Installation
# Install dependencies
npm install
# or
yarn install🚀 Usage
1. Generate Accounts
Generate multiple Solana accounts with public and private keys.
# Generate 5 accounts (default)
ts-node src/generate-account.ts
# Generate specific number of accounts
ts-node src/generate-account.ts --count 10
# Generate accounts with custom output filename
ts-node src/generate-account.ts --count 10 --output ./accounts/my-accounts
# Show help
ts-node src/generate-account.ts --helpOutput Files:
<filename>.pub: Public keys (one per line)<filename>.pri: Private key data (publicKey,base58PrivateKey,arrayPrivateKey)
Parameters:
--count <number>: Number of accounts to generate (default: 5)--output <filename>: Base filename for output files (default: ./data/target-accounts)--help, -h: Show help message
2. Check Account Balances
Check SOL balances for multiple accounts from a public key file.
# Check balances using public key file
ts-node src/balance-checker.ts --public-key-file ./data/target-accounts.pub
# Check balances on mainnet
ts-node src/balance-checker.ts --public-key-file ./accounts.pub --url https://api.mainnet-beta.solana.com
# Show help
ts-node src/balance-checker.ts --helpParameters:
--public-key-file <file>: Path to public key file (.pub format) (Required)--url <rpc_url>: Solana RPC endpoint (default: https://api.devnet.solana.com)--help, -h: Show help message
3. Batch Transfer
Transfer all funds from multiple accounts to a single target account.
# Transfer all funds to target account
ts-node src/batch-transfer.ts --private-key-file ./data/accounts.pri --target-account <TARGET_PUBLIC_KEY>
# Transfer on mainnet
ts-node src/batch-transfer.ts --private-key-file ./accounts.pri --target-account <TARGET_PUBLIC_KEY> --url https://api.mainnet-beta.solana.com
# Show help
ts-node src/batch-transfer.ts --helpParameters:
--private-key-file <file>: Path to private key file (.pri format) (Required)--target-account <address>: Target account public key to receive all funds (Required)--url <rpc_url>: Solana RPC endpoint (default: https://api.devnet.solana.com)--help, -h: Show help message
4. Mix Transfer
Perform random transfers between accounts for privacy mixing.
# Perform 10 random transfers
ts-node src/mix-transfer.ts --private-key-file ./data/accounts.pri --mix-times 10
# Mix transfers on mainnet
ts-node src/mix-transfer.ts --private-key-file ./accounts.pri --mix-times 5 --url https://api.mainnet-beta.solana.com
# Show help
ts-node src/mix-transfer.ts --helpParameters:
--private-key-file <file>: Path to private key file (.pri format) (Required)--mix-times <number>: Number of random transfers to perform (Required)--url <rpc_url>: Solana RPC endpoint (default: https://api.devnet.solana.com)--help, -h: Show help message
📋 File Formats
Public Key File (.pub)
Plain text file with one public key per line: 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU 4fYNw3dojWmQ2dez8DjQBvuL8GsS3diuoQqU32Q7Uuqc ...
### Private Key File (.pri)
CSV format with public key, base58 private key, and
array private key:7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU,5Kb8kLf9zgWQnogidDA76MzPL6TsZZY36hWXMssSzNydYXYB9KF,"[1,2,3,...]" 4fYNw3dojWmQ2dez8DjQBvuL8GsS3diuoQqU32Q7Uuqc,3kzHvGJ7Vjx4H2eKyiRneuKXymdnAA5WCNyZkNi8X1s2,"[4,5,6,...]" ...
## ⚠️ Important Notes
1. **Private Key Security**: Keep your private key
files secure and never commit them to version control
2. **Network Fees**: Each transfer consumes network
fees, ensure sufficient account balance
3. **Test First**: Thoroughly test on devnet before
using on mainnet
4. **File Paths**: Use absolute or relative paths
correctly when specifying file locations
5. **Balance Requirements**: Ensure accounts have
sufficient balance for transfers and fees
## 🛡️ Security Best Practices
- Always backup your private key files securely
- Use different accounts for testing and production
- Verify target addresses before executing transfers
- Monitor transaction confirmations
- Keep your RPC endpoints secure
## 📄 License
MIT License
## 🤝 Contributing
Contributions are welcome! Please feel free to submit
Issues and Pull Requests.