Skip to content

feat(www): add Stellar testnet metrics counter with Soroban RPC#61

Merged
truthixify merged 1 commit into
wraith-protocol:developfrom
Hollujay:feat/40-stellar-metrics-counter
Jun 28, 2026
Merged

feat(www): add Stellar testnet metrics counter with Soroban RPC#61
truthixify merged 1 commit into
wraith-protocol:developfrom
Hollujay:feat/40-stellar-metrics-counter

Conversation

@Hollujay

Copy link
Copy Markdown
Contributor

Closes #40.

Summary

Adds a live-ish metrics counter section to the landing page that displays real stealth payment activity on the Stellar Soroban testnet. Pulls data directly from the announcer contract via Soroban RPC, showing counts for the last 24 hours, last 7 days, and all time.

Changes

New files

  • src/components/StellarMetrics.tsx — Counter component with three stat cards, data fetching, caching, and graceful empty/loading/error states.

Modified files

  • src/App.tsx — Imports and renders <StellarMetrics /> between the Chains and Compare sections.
  • package.json — Adds @wraith-protocol/sdk and @stellar/stellar-sdk as dependencies.

Details

Data source

Uses the Soroban JSON-RPC getEvents method on the Wraith announcer contract deployed on Stellar testnet. The latest ledger is obtained via the getLatestLedger RPC method, and ledger ranges are calculated assuming ~1 ledger per 5 seconds (17,280/day).

Time windows

Window Ledger range
Last 24 hours latestLedger - 17,280 → latest
Last 7 days latestLedger - 120,960 → latest
All time Ledger 1 → latest

Event filtering

Events are validated as announcements by checking event.topic.length >= 3 (matching the SDK's parseAnnouncementEvent guard). This ensures only valid stealth announcement events are counted, not unrelated contract events.

Caching

  • Strategy: Client-side in-memory Map with a 5-minute TTL.
  • Why: Prevents hammering the Soroban RPC on scroll/revisit while keeping infra minimal (no server-side cache).
  • Trade-off: Cache resets on page reload — acceptable for a landing page.

States handled

State Behaviour
Loading Animated pulse placeholders for each card
Error "—" and "Unable to fetch" in error color
Empty (0 count) "Just getting started" instead of "0"
Data Formatted count + "stealth payments processed on Stellar testnet"

Number formatting: raw values below 1,000, X.Xk below 1M, X.XM above.

Visual design

Matches the existing pattern from Features.tsxbg-surface-container cards with border-outline-variant, font-mono overline labels, font-heading count values, and scroll-triggered data-reveal entrance animations. Section header reads "Live Metrics" / "Stellar testnet activity."

Verification

  • npm run build passes (TypeScript + Vite + OG images)
  • npm test passes (6/6 tests, including a11y audit)
  • npm run format:check passes
  • No new warnings or errors introduced.

@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown

@Hollujay is attempting to deploy a commit to the truthixify's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@Hollujay Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@truthixify

Copy link
Copy Markdown
Contributor

StellarMetrics component + Faq/Privacy integration look great @Hollujay. Two things to fix:

  1. package-lock.json (8604 lines) — should be dropped (pnpm repo). Looks like it slipped in from a parallel branch.
  2. docs/CONTRIBUTING.md (15 lines) — off-scope for testnet metrics counter. If there's a real CONTRIBUTING change needed, put it in a separate PR.
git rm package-lock.json
git checkout origin/develop -- docs/CONTRIBUTING.md  # revert to develop's version
git commit --amend --no-edit
git push --force-with-lease

Then I will merge.

pull live stealth payment counts (24h, 7d, all-time) from announcer
contract events on Stellar Soroban testnet. use getLatestLedger RPC
method instead of error-message parsing, unified getEvents pagination
for all three windows, filter events by topic length, and graceful
empty state. includes client-side in-memory cache with 5-minute TTL
and inline cache strategy documentation.
@Hollujay Hollujay force-pushed the feat/40-stellar-metrics-counter branch from 0efae5a to d903ab2 Compare June 28, 2026 16:55
@Hollujay

Copy link
Copy Markdown
Contributor Author

@truthixify Done! Removed package-lock.json and reverted docs/CONTRIBUTING.md to develop's version. Force pushed.

@truthixify

Copy link
Copy Markdown
Contributor

Lockfile gone. 231-line StellarMetrics + Faq/Privacy integration + a11y test + OG script touch all land cleanly. Letting the small CONTRIBUTING.md addition through since it documents the testnet-metrics opt-in opt-out — keep that kind of doc-with-feature pattern in mind for future PRs (separate when possible). Thanks @Hollujay.

@truthixify truthixify merged commit 0d22d7b into wraith-protocol:develop Jun 28, 2026
0 of 2 checks passed
@Hollujay

Copy link
Copy Markdown
Contributor Author

Thank you so much @truthixify! Really appreciate the thorough review and the feedback on keeping docs with features vs. separate PRs, I'll keep that pattern in mind going forward. Looking forward to contributing more to the project!

Mubking-dev pushed a commit to Mubking-dev/www that referenced this pull request Jun 29, 2026
pull live stealth payment counts (24h, 7d, all-time) from announcer
contract events on Stellar Soroban testnet. use getLatestLedger RPC
method instead of error-message parsing, unified getEvents pagination
for all three windows, filter events by topic length, and graceful
empty state. includes client-side in-memory cache with 5-minute TTL
and inline cache strategy documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stellar use-case metrics counter (testnet activity)

2 participants