feat(www): add Stellar testnet metrics counter with Soroban RPC#61
Open
Hollujay wants to merge 1 commit into
Open
feat(www): add Stellar testnet metrics counter with Soroban RPC#61Hollujay wants to merge 1 commit into
Hollujay wants to merge 1 commit into
Conversation
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 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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