|
3 недель назад | |
---|---|---|
.. | ||
src | 3 недель назад | |
Cargo.toml | 4 недель назад | |
README.md | 3 недель назад |
Warning This project is in early development, it does however work with real sats! Always use amounts you don't mind losing.
A command-line Cashu wallet implementation built with the Cashu Development Kit (CDK). This tool allows you to interact with Cashu mints from the terminal, performing operations like minting, melting, and transferring ecash tokens.
Download the latest release from the GitHub releases page.
git clone https://github.com/cashubtc/cdk.git
cd cdk
cargo build --bin cdk-cli --release
# Binary will be at ./target/release/cdk-cli
# Add a mint (use a real mint URL or start your own with cdk-mintd)
cdk-cli wallet add-mint http://127.0.0.1:8085
# Create a mint quote for 100 sats
cdk-cli wallet mint-quote 100
# Pay the Lightning invoice shown, then mint the tokens
cdk-cli wallet mint <quote_id>
# Send 50 sats as a token
cdk-cli wallet send 50
# Receive a token from someone else
cdk-cli wallet receive <cashu_token>
# View your current balance
cdk-cli wallet balance
# List all wallets
cdk-cli wallet list
# Create a new wallet
cdk-cli wallet new --name my-wallet
# Set default wallet
cdk-cli wallet set-default my-wallet
# Show wallet info
cdk-cli wallet info
# List connected mints
cdk-cli wallet list-mints
# Remove a mint
cdk-cli wallet remove-mint <mint_url>
# Get mint information
cdk-cli wallet mint-info <mint_url>
# Pay a Lightning invoice
cdk-cli wallet pay-invoice <lightning_invoice>
# Create melt quote for an invoice
cdk-cli wallet melt-quote <lightning_invoice>
# Execute the melt
cdk-cli wallet melt <quote_id>
# List all tokens
cdk-cli wallet list-tokens
# Check token states
cdk-cli wallet check-tokens
# Restore wallet from seed
cdk-cli wallet restore --seed <seed_words>
The CLI stores its configuration and wallet data in:
~/.config/cdk-cli/
%APPDATA%\cdk-cli\
# 1. Start a test mint (in another terminal)
cdk-mintd
# 2. Add the mint
cdk-cli wallet add-mint http://127.0.0.1:8085
# 3. Create a mint quote
cdk-cli wallet mint-quote 1000
# 4. Pay the Lightning invoice (if using real Lightning backend)
# or wait a few seconds if using fake wallet
# 5. Mint the tokens
cdk-cli wallet mint <quote_id>
# 6. Check balance
cdk-cli wallet balance
# 7. Send some tokens
cdk-cli wallet send 100
# 8. The recipient can receive with:
cdk-cli wallet receive <cashu_token_string>
# Create wallets for different purposes
cdk-cli wallet new --name savings
cdk-cli wallet new --name daily
# Switch between wallets
cdk-cli wallet set-default savings
cdk-cli wallet balance
cdk-cli wallet set-default daily
cdk-cli wallet balance
# General help
cdk-cli --help
# Help for specific commands
cdk-cli wallet --help
cdk-cli wallet mint-quote --help
Code is under the MIT License
All contributions are welcome.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, shall be licensed as above, without any additional terms or conditions.