feat(dashboard): add gas sponsorship status indicator to wallet cards (#14)#31
Merged
Emmyt24 merged 1 commit intoJun 28, 2026
Conversation
…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
This was referenced Jun 22, 2026
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).
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.
Summary
Adds a 4th column to each wallet card on the dashboard home showing the wallet's gas-sponsorship status:
GET /v1/wallets/:id/sponsorship(returns the current config or sensible defaults when no row exists yet).Closes #14.
Why these specific choices
Promise.allSettledafter the wallet list resolves, so a single failing sponsor fetch never blanks out the row. A useEffect-localabortedflag (set in cleanup, checked in both.thenand.catch) prevents setState-after-unmount.frontend/. The store model already exposesSponsorshipConfigand the API routeGET /v1/wallets/:id/sponsorshipalready exists (verified onorigin/main).<Link href="/dashboard/wallets/${id}/sponsorship">because that route doesn't exist onorigin/mainyet — 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).SponsorshipConfigtype already reserves an optionalfees_spent_today_stroops?: numberfield, so the day the API exposes it the bar can replace the cap-label inline.aria-hiddenon the decorative dot for AT cleanliness.Non-blocker note (pre-existing on
origin/main)cargo check --workspaceon this branch fails witherror: duplicate key workspace in table dependenciesincrates/api/Cargo.toml—stellar-base = { workspace = true }andstellar-strkey = { workspace = true }are listed twice in[dependencies]. Verified to be inherited fromorigin/main(repro'd by running the same command againstorigin/main). This PR does not touchCargo.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 +SponsorshipConfigtype 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 parallelPromise.allSettledfetch + theabortedrace-safety flag.Tests covered:
pnpm tsc --noEmit✅,pnpm lint✅ on this branch.