Repository navigation
v1.2.3
Summary
All code review findings have been addressed, unit tests added, and the CoinGecko API integration has been hardened.
🐛 Bug Fixes
Alert System
alert removenow removes all alerts for a given coin- Triggered alerts remove only themselves (other alerts for the same coin are preserved)
- Alert price comparison respects the
--currencyflag - Negative and invalid price/condition inputs are rejected
Portfolio
- Coin IDs are normalized to lowercase (fixes case-sensitivity duplicates)
- Negative amount and price values are rejected
- Zero balances are removed from holdings after a full sell
- Transaction currency is stored; history view shows the correct symbol
⚡ Performance
- Portfolio list uses a single batch API call (
GetMarketsByIDs) - Removed duplicate API call when fetching coin details
🔒 Security
~/.crypto/portfolio.jsonandalerts.jsonare written with0600file permissions
🛠 Infrastructure
- Search queries are URL-encoded
- Added retry/backoff for CoinGecko 429 rate limit responses
page/per-pageflags validate input (range 1–250)- Alert checker has safe start/stop lifecycle; runs only when active alerts exist
✅ Tests
15 new unit tests added across models, service, and utils.
go test ./... -count=1📦 Installation
go install github.com/mrcnserkan/crypto@v1.2.3