1.7 KiB
1.7 KiB
US-040 — Devnet top-up button on the dashboard
Status: planned Priority: High (friends-test convenience — refill without on-chain deposits) Stage: Designed
Context
Once Caller Credit (US-039) is spent, the only refill path is a real USDT deposit through the treasury watcher — devnet Solana plumbing friends won't have. For test deployments the dashboard needs a "add $10" style button. This is a faucet: 0 disables it, and mainnet deployments must set 0.
Design
--devnet-topup N(USDT per click) onmeshnet-tracker start; stack variableDEVNET_TOPUP. Default is the single constantDEFAULT_DEVNET_TOPUP_USDT = 1.0inserver.py(devnet-friendly alpha, revised 2026-07-06 — the alpha's public trackers are devnet-only).POST /v1/account/topup— session-authenticated (same as key management). Body:{"api_key": "sk-mesh-..."}. Rules:- 404 when the feature is disabled (flag absent/0)
- key must belong to the logged-in account (403 otherwise)
- credits exactly the configured amount (client cannot choose it),
note
devnet-topup; returns the new balance
- Dashboard:
/v1/accountresponse gainstopup_amount(0 when disabled); when positive, each key row renders a+$N (devnet)button calling the endpoint. - Abuse bound: per-click amount is operator-set and requires a registered session; acceptable for a friends-test faucet. Mainnet deployments simply never set the flag. (Rate limiting is deliberately out of scope.)
Acceptance criteria
- Flag off: endpoint 404s, dashboard shows no top-up button
- Flag on: logged-in user tops up own key, balance rises by exactly N
- Topping up another account's key → 403
python -m pytestpasses from repo root