Skip to content

web: subscription UI#407

Open
Jared-dz wants to merge 4 commits intomainfrom
subscription-ui
Open

web: subscription UI#407
Jared-dz wants to merge 4 commits intomainfrom
subscription-ui

Conversation

@Jared-dz
Copy link
Copy Markdown

@Jared-dz Jared-dz commented Apr 9, 2026

Summary

  • Add "Pay for Subscription" nav item under Shreds, wiring up the existing ShredsSubscribePage (previously hidden behind a comment)
  • Add live epoch progress counter (epoch #, progress bar, % complete, ETA) to the Configure Subscription section, fetched from /api/solana/ledger
  • Add dev-only simulate mode (?simulate=true) that runs the subscribe transaction through connection.simulateTransaction() — program logic executes on-chain, no funds spent, no wallet signature required

Diff Breakdown

Category Files Lines (+/-) Net
Core logic 3 +172 / -4 +168
Scaffolding 2 +41 / -2 +39

Core logic dominates: transaction simulation hook, epoch polling hook, and subscribe page UI state.

Key files (click to expand)
  • web/src/components/shreds-subscribe-page.tsx — epoch counter component, simulate mode (banner, button, status states), USDC balance bypass in simulate mode
  • web/src/hooks/use-shred-transaction.tssimulate() function alongside execute(); adds 'simulating' and 'simulated' statuses
  • web/src/hooks/use-epoch-info.ts — new hook polling /api/solana/ledger every 30s for epoch/slot/ETA data
  • web/src/App.tsx — imports ShredsSubscribePage, adds /dz/shreds/pay route
  • web/src/components/sidebar.tsx — adds "Pay for Subscription" sub-item under Shreds nav

Testing Verification

  • Epoch counter verified against solanabeach.io (epoch, %, ETA match within expected drift)
  • Simulate mode tested at http://localhost:5173/dz/shreds/pay?simulate=true — amber banner appears, button reflects simulate state, result shows pass/fail with program logs, no wallet popup
  • Simulate mode gate (import.meta.env.DEV) ensures the feature is stripped from production builds

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

🔗 Preview: https://pr-407.data.malbeclabs.com

Jared-dz added 3 commits April 9, 2026 14:01
Run `doublezero latency --json` on the subscribing server, paste the
output into Step 1 to get a ranked device table with Recommended/Next
best badges and latency column. IP input and subscription flow unchanged
for users without the CLI.
- Read VITE_SOLANA_RPC_URL from env (falls back to mainnet-beta)
- Surface Program log lines in simulation errors instead of generic Anchor codes
- Fix latency command display and decimal precision
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant