feat(www): add Stellar testnet metrics counter with Soroban RPC#61
Conversation
|
@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. |
|
@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! 🚀 |
|
StellarMetrics component + Faq/Privacy integration look great @Hollujay. Two things to fix:
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-leaseThen 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.
0efae5a to
d903ab2
Compare
|
@truthixify Done! Removed package-lock.json and reverted docs/CONTRIBUTING.md to develop's version. Force pushed. |
|
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. |
|
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! |
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.
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/sdkand@stellar/stellar-sdkas dependencies.Details
Data source
Uses the Soroban JSON-RPC
getEventsmethod on the Wraith announcer contract deployed on Stellar testnet. The latest ledger is obtained via thegetLatestLedgerRPC method, and ledger ranges are calculated assuming ~1 ledger per 5 seconds (17,280/day).Time windows
latestLedger - 17,280→ latestlatestLedger - 120,960→ latestEvent filtering
Events are validated as announcements by checking
event.topic.length >= 3(matching the SDK'sparseAnnouncementEventguard). This ensures only valid stealth announcement events are counted, not unrelated contract events.Caching
Mapwith a 5-minute TTL.States handled
Number formatting: raw values below 1,000,
X.Xkbelow 1M,X.XMabove.Visual design
Matches the existing pattern from
Features.tsx—bg-surface-containercards withborder-outline-variant,font-monooverline labels,font-headingcount values, and scroll-triggereddata-revealentrance animations. Section header reads "Live Metrics" / "Stellar testnet activity."Verification
npm run buildpasses (TypeScript + Vite + OG images)npm testpasses (6/6 tests, including a11y audit)npm run format:checkpasses