Problem
pumpfun buy <mint> 0 sends a 0-lamport transaction to the network, wasting fees. Negative amounts are parsed as CLI flags (-1 → "No such option"), which is safe but confusing.
Fix
Add validation in src/pumpfun_cli/commands/trade.py buy(), after _validate_mint():
if sol_amount <= 0:
error("Buy amount must be greater than zero.")
Files to change
src/pumpfun_cli/commands/trade.py — add guard in buy()
tests/test_commands/test_trade_cmd.py — add test for zero amount
How to test
uv run pytest tests/test_commands/test_trade_cmd.py -v
Problem
pumpfun buy <mint> 0sends a 0-lamport transaction to the network, wasting fees. Negative amounts are parsed as CLI flags (-1→ "No such option"), which is safe but confusing.Fix
Add validation in
src/pumpfun_cli/commands/trade.pybuy(), after_validate_mint():Files to change
src/pumpfun_cli/commands/trade.py— add guard inbuy()tests/test_commands/test_trade_cmd.py— add test for zero amountHow to test