A command-line tool for converting between different cryptocurrency units (Bitcoin, Ethereum, and Solana).
This Rust-based CLI application provides a simple way to convert between various cryptocurrency units. Whether you need to convert BTC to Satoshis, ETH to Gwei, or SOL to Lamports, this tool makes it quick and easy.
- Support for Bitcoin, Ethereum, and Solana cryptocurrencies
- Conversion between multiple denomination units
- Simple command-line interface
- Precise conversion with proper decimal handling
- Rust and Cargo (Install from rustup.rs)
# Clone the repository
git clone https://github.com/DieHard073055/cc.git
cd cc
# Build the project
cargo build --release
# The binary will be available at ./target/release/cc
cc <AMOUNT> <FROM_UNIT> to <TO_UNIT>
For help:
cc help
- btc - Bitcoin
- mbtc - Milli-Bitcoin (1/1,000 BTC)
- bit - Micro-Bitcoin (1/1,000,000 BTC)
- sats or satoshi - Satoshi (1/100,000,000 BTC)
- eth - Ether
- gwei - Giga-wei (1/1,000,000,000 ETH)
- wei - Wei (1/1,000,000,000,000,000,000 ETH)
- fin - Fin
- sol - SOL
- lamports - Lamports (1/1,000,000,000 SOL)
Convert 1 Bitcoin to Satoshis:
cc 1 btc to sats
# Output: 1 btc = 100000000 sats
Convert 5000 Gwei to ETH:
cc 5000 gwei to eth
# Output: 5000 gwei = 0.000005 eth
Convert 0.5 SOL to Lamports:
cc 0.5 sol to lamports
# Output: 0.5 sol = 500000000 lamports
The converter will display helpful error messages for:
- Invalid units
- Invalid amount formats
- Incompatible unit conversions
- Missing arguments
cc/
├── src/
│ ├── main.rs # Application entry point
│ ├── lib.rs # Module exports
│ ├── cli.rs # Command-line interface logic
│ ├── conversion.rs # Conversion algorithms
│ └── currency.rs # Currency definitions and unit handling
├── Cargo.toml # Project dependencies and metadata
└── README.md # This file
- thiserror - For error handling
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (git checkout -b feature/amazing-feature)
- Commit your changes (git commit -m 'Add some amazing feature')
- Push to the branch (git push origin feature/amazing-feature)
- Open a Pull Request