Running here
Balance, spend, and which window you are in
This page runs the panel's own accounting: the peak/off-peak rule, the spend split and the gaps it refuses to guess at. Paste a ledger or use the sample.
The arithmetic is the widget's own code — lib/peak.js and lib/ledger.js, copied byte for byte. What is not here is the widget itself: no key file, no balance endpoint, no host console.
computing…
current window, from the published rule
—
balance now, last ledger row
- Spend — over the tracked window.
- Of that, — happened in a peak window and — off-peak.
- Estimated saving from the off-peak half: —.
- Across that, — sits in gaps longer than six hours and is not attributed to either window.
- Top-ups seen: — (a rise is never counted as negative spend).
The ledger it read
One row per line: an ISO timestamp (or epoch milliseconds) and the balance after it, comma-separated. The real widget builds this by polling the balance endpoint with your key; this page reads what you paste.
Ten hours either side of now
Each block is a run of one billing state, taken from the rule at whole UTC hours. The marker is now.
What this page is, and what stays with the widget
- This page reads the ledger you paste, not your key file, and it never asks for a key. The widget reads a key file on your machine and polls the balance endpoint; that call stays with the widget.
- The sample ledger is a fixed two-day example (5–6 October 2026 UTC) built into this page, with a peak window, an off-peak stretch, an eight-hour gap and a top-up in it. It is not your account, and no number here comes from any API.
- No network request is made from this page at all. The rule and the arithmetic are computed locally; the only thing fetched is this page's own code.
- Chinese public holidays are not guessed. With no holiday list the rule degrades to the weekday rule, which is stated above rather than hidden.
The ledger you paste stays in this tab.