Skip to content

feat(dashboard): add gas sponsorship status indicator to wallet cards (#14)#31

Merged
Emmyt24 merged 1 commit into
Octo-Protocol-org:mainfrom
Senorespecial:feat/dashboard/sponsor-card
Jun 28, 2026
Merged

feat(dashboard): add gas sponsorship status indicator to wallet cards (#14)#31
Emmyt24 merged 1 commit into
Octo-Protocol-org:mainfrom
Senorespecial:feat/dashboard/sponsor-card

Conversation

@Senorespecial

Copy link
Copy Markdown
Contributor

Summary

Adds a 4th column to each wallet card on the dashboard home showing the wallet's gas-sponsorship status:

  • Status indicator — a dot + "Enabled" / "Off" label pulled live from GET /v1/wallets/:id/sponsorship (returns the current config or sensible defaults when no row exists yet).
  • Daily-budget cap label — e.g. "10.00 XLM/day cap" when the API returns a numeric budget.

Closes #14.

Why these specific choices

  • Sponsorship configs are fetched in parallel via Promise.allSettled after the wallet list resolves, so a single failing sponsor fetch never blanks out the row. A useEffect-local aborted flag (set in cleanup, checked in both .then and .catch) prevents setState-after-unmount.
  • No new backend work. This PR touches only frontend/. The store model already exposes SponsorshipConfig and the API route GET /v1/wallets/:id/sponsorship already exists (verified on origin/main).
  • Two deliberate scope cuts vs the spirit of the issue title:
    • Dropped the per-card <Link href="/dashboard/wallets/${id}/sponsorship"> because that route doesn't exist on origin/main yet — owning the per-wallet settings panel is a separate open issue (feat(dashboard): Build per-wallet sponsorship settings panel — enable toggle, fee cap, daily budget #12, assigned elsewhere).
    • Omitted the "consumption progress" fill-bar because the API does not yet return a spent-today value. The SponsorshipConfig type already reserves an optional fees_spent_today_stroops?: number field, so the day the API exposes it the bar can replace the cap-label inline.
  • aria-hidden on the decorative dot for AT cleanliness.

Non-blocker note (pre-existing on origin/main)

cargo check --workspace on this branch fails with
error: duplicate key workspace in table dependencies in crates/api/Cargo.tomlstellar-base = { workspace = true } and stellar-strkey = { workspace = true } are listed twice in [dependencies]. Verified to be inherited from origin/main (repro'd by running the same command against origin/main). This PR does not touch Cargo.toml. Out of scope for #14; a separate one-line fix PR can dedupe.

Files

  • frontend/src/lib/sponsorship.ts (new, 22 lines): client util + SponsorshipConfig type that mirrors the API response (wallet_id, enabled, max_fee_per_tx_stroops, daily_budget_stroops, created_at, updated_at; fees_spent_today_stroops? reserved).
  • frontend/src/app/dashboard/page.tsx (modified): adds the 4th cell + the parallel Promise.allSettled fetch + the aborted race-safety flag.

Tests covered: pnpm tsc --noEmit ✅, pnpm lint ✅ on this branch.

…Octo-Protocol-org#14)

Adds a 4th column to each wallet card on the dashboard home with:
- a dot + "Enabled"/"Off" status indicator from GET /v1/wallets/:id/sponsorship
- a daily-budget cap label (e.g. "10.00 XLM/day cap") when the API returns a budget

Sponsorship configs are fetched in parallel after the wallet list resolves,
gated on a useEffect-local `aborted` flag so a slow or failing sponsorship
request never blanks out the list and we don't setState after unmount.

Two deliberate scope cuts vs the orphan version:
- Removed the orphan-version's <Link href="/dashboard/wallets/${id}/sponsorship">
  because that route does not exist on origin/main (issue Octo-Protocol-org#12 still open).
- Omitted a "consumption progress" fill-bar because the API does not yet
  return fees_spent_today_stroops; the type is reserved as optional. When
  the API evolves, swap the cap label for a fill-bar.

Non-blocker note (pre-existing):
cargo check --workspace on origin/main fails with
"duplicate key workspace in table dependencies" in crates/api/Cargo.toml
(stellar-base / stellar-strkey listed twice in [dependencies]).
This PR does not touch that file. Out of scope for Octo-Protocol-org#14.

Files:
- frontend/src/lib/sponsorship.ts (new): client util + SponsorshipConfig type
- frontend/src/app/dashboard/page.tsx (modified): 4th cell + parallel fetch
@Emmyt24 Emmyt24 merged commit 9e87079 into Octo-Protocol-org:main Jun 28, 2026
0 of 4 checks passed
Emmyt24 pushed a commit that referenced this pull request Jun 28, 2026
…citly

The `rust-toolchain` install step in `.github/workflows/ci.yml` currently
uses a fully-qualified action reference: `dtolnay/rust-toolchain@1.84.1`.

That conflates two concerns: action version and Rust toolchain version.
This PR decouples them by pinning the action to its major-version tag
(`dtolnay/rust-toolchain@v1`) and moving the version into the explicit
`with.toolchain` input. Practical effects:

- Action upgrades (e.g. 1.84.1 -> 1.85.x of the action) are now a separate
  decision from Rust toolchain upgrades.
- The Rust toolchain is still effectively pinned to `1.84.1` (matches
  `rust-toolchain.toml`'s channel = "1.84.1"), so behavior on the runner
  remains identical for non-upgrade paths.
- rustup now derives the per-host triple correctly from `with.toolchain`
  ("1.84.1"), which closes the channel-name CI failure surfaced as
  `error: target tuple in channel name 'stable-x86_64-pc-windows-msvc'`
  on `ubuntu-latest` for `cargo install cargo-audit`.

Closes #33.

Cross-links (in order):
- PR #31 (Senorespecial/Octo-Protocol -> Octo-Protocol-org/Octo-Protocol): feat(dashboard): add gas sponsorship status indicator to wallet cards (#14)
- #32: api: surface fees_spent_today_stroops in GET /v1/wallets/:id/sponsorship
- PR #34: ci: enforce --locked on workspace cargo invocations
- #33: ci: install of cargo-audit errors out with stable-x86_64-pc-windows-msvc on ubuntu-latest

Files: .github/workflows/ci.yml (one block edit).
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.

feat(dashboard): Add gas sponsorship status indicator to wallet cards on the dashboard home

2 participants