Repository navigation
feat(fetcher): add crypto_watchlist (CoinGecko, 9 shapes) - #210
Conversation
CoinGecko `/coins/markets` snapshot for a configurable list of coin ids.
Safety::Safe — host fixed at `api.coingecko.com`, options sanitised
(`coins` allowlist `[a-z0-9-]`, `vs_currency` allowlist `[a-z]{2,5}`)
so config can't redirect traffic off-host. No API key required;
zero-config rendering with default `["bitcoin", "ethereum"]` in USD.
Shapes: Entries (default), Text (top mover headline), TextBlock,
MarkdownTextBlock, LinkedTextBlock (links to coin pages),
NumberSeries (first coin's 7d hourly price as cents), PointSeries
(per-coin price series for line/scatter), Bars (24h |% change|
basis points, direction encoded in the arrow label), Badge
(top mover with volatility-coded Status — direction-neutral
since a watchlist isn't sentiment-bearing).
Ticks the `crypto_watchlist` checkbox in the Life & Ambient
fetcher roadmap (#68).
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #210 +/- ##
==========================================
- Coverage 96.37% 96.26% -0.11%
==========================================
Files 149 150 +1
Lines 43446 44086 +640
==========================================
+ Hits 41872 42441 +569
- Misses 1574 1645 +71
🚀 New features to boost your workflow:
|
`chart_sparkline` normalises against the series max with an implicit zero floor, so emitting raw cents flattens the trace for any high-magnitude asset — BTC at \$40k with a 1 % daily swing collapsed into a band glued to the top of the slot, indistinguishable from a flat line. Subtract the 7d period minimum before the cents conversion so the variation occupies the full bar height. The unit becomes "cents above the period low", which is the right framing for a glance-at-the-trend sparkline anyway. `chart_line` / `chart_scatter` (PointSeries) already auto-fit y bounds to (min, max), so PointSeries is unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Summary
CoinGecko
/coins/marketssnapshot fetcher for a configurable list of coin ids. First member of thecrypto_*family; ticks[ ] crypto_watchliston the Life & Ambient fetcher roadmap (#68).["bitcoin", "ethereum"]in USD, renders without any[widget.options]editing.Safety::Safe— host fixed atapi.coingecko.com, query-string options sanitised against allowlists (coins:[a-z0-9-],vs_currency:[a-z]{2,5}) so config can't redirect traffic off-host. No API key, no token leaves the machine.Bars/Text/*TextBlock/ series /Badgeset), so the same fetcher feedsgrid_table,text_ascii,list_links,chart_sparkline,chart_line,chart_bar,list_ranking,status_badge, etc. without any reshaping.Statusmapping onEntries/Badge: large absolute moves (≥ 5%) flip Ok → Warn so the badge stands out, but direction stays in the arrow / sign so the gauge doesn't bake in a sentiment that depends on whether the user is long or short.entries(default),text,text_block,markdown_text_block,linked_text_block,number_series,point_series,bars,badgeOptions
coins["bitcoin", "ethereum"]vs_currency"usd"usd,jpy,eur,btc, …). Letters only.Compatible renderers
entriesgrid_tabletexttext_ascii,text_plain,animated_typewriter,animated_figlet_morphtext_blocklist_plainmarkdown_text_blocktext_markdownlinked_text_blocklist_linksnumber_serieschart_sparkline,chart_histogrampoint_serieschart_line,chart_scatterbarschart_bar,chart_pie,list_rankingbadgestatus_badge(Animated post-process wrappers —
animated_postfx,animated_boot,animated_scanlines,animated_splitflap,animated_wave— accept every shape viaALL_SHAPESand are omitted from the table for brevity.)Shape decisions
The full 14-row accept/reject table from the spec, in case anyone wants to re-litigate:
Text▲ BTC \$42,150.32 (+2.34%)).TextBlockMarkdownTextBlock**SYMBOL**fortext_markdown.LinkedTextBlockcoingecko.com/en/coins/<id>.Entriescoin → \"\$price (±%)\", status flips above ±5%.RatioNumberSeriesPointSeriesBarsImageCalendarHeatmapBadgeTimelineTest plan
cargo fmt --all -- --checkcargo clippy --all-targets -- -D warningscargo test— 27 inline unit tests cover URL building, coin/currency sanitisation (incl. injection-style inputs), shape branches, NumberSeries cents scaling, top-mover selection, volatility-status thresholds, options parsing, sample-body coverage of every supported shape, and a metadata round-trip.cargo run --bin splashboard -- catalog fetcher crypto_watchlist— 9 shapes + compatible renderers reflect correctly.#[ignore]-gated live smoke against CoinGecko (cargo test -- --ignored fetcher::crypto_watchlist::tests::live) for opt-in offline-safe verification.🤖 Generated with Claude Code