Skip to content

Update zkAPI SDK to fix post-mint balance reads - #30

Draft
mingyech wants to merge 33 commits into
mainfrom
codex/fix-wallet-state-refresh
Draft

Update zkAPI SDK to fix post-mint balance reads#30
mingyech wants to merge 33 commits into
mainfrom
codex/fix-wallet-state-refresh

Conversation

@mingyech

@mingyech mingyech commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Update the immutable zkAPI browser SDK dependency to fix a Sepolia deposit stopping immediately after a successful test-token mint. The SDK reads the balance at the confirmed receipt block and retries lagging reads without issuing a second mint. SDK change: OpenAnonymity/zkapi-EF-collab#1.

Also correct saved-deposit recovery text: a saved pre-deposit plan can coexist with a broadcast token approval, so the notice no longer assumes the wallet prompt closed before any transaction was sent.

Validation: fresh Node 24 install, 758 OA tests, 180 payment tests, and 44 existing render tests pass. Independent composition and follow-up copy reviews found no blockers. Live browser testing reproduced the original stale-balance error, verified saved-plan recovery across reload, and identified a separate approval queued below the current Sepolia base fee. The full patched deposit/chat/withdrawal round-trip is awaiting that wallet fee update.

dsobhani8 and others added 30 commits September 9, 2026 17:36
- signInRequiredNow(): the host's sign-in policy applies only while the
  payment mode is Tickets. Page load and the send preflight use it.
- The Log in dialog closes in zkAPI mode, and when it stands in for a
  Tickets account it offers "Use zkAPI instead", which switches mode and
  closes. Switching a signed-out chat to Tickets opens the dialog.
- Logging out (or deleting) from zkAPI mode closes the dialog; from
  Tickets it shows the form as before.
- Signed out on a sign-in host, the footer reads "Log in or sign up".
- ?auth=zkapi (the landing page's zkAPI entry) opens chat in zkAPI mode;
  selecting the mode runs the send preflight, which opens the funding
  dialog when the private balance is empty.
- context.payments (getMode / available / setMode) for extensions.
- Funding dialog: a prepared deposit that never reached the chain can be
  discarded ("Use a different amount") when the SDK offers a method.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WFoW1siuQJuRtb1Vddre7Y
… top of it

Every app tooltip (data-tooltip and the memory button's hover card) now
uses the same skin as Billing's Share and Import tips: a rounded card,
14px wrapping text up to 15rem, soft shadow, no arrow. The composer
mode buttons, the memory button and the payment-mode control dropped
their native title attributes, which had drawn a second, grey tooltip
under the app's.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WFoW1siuQJuRtb1Vddre7Y
…ys Log in

With zkAPI in the build the dialog always has its X. Closing it while
Tickets would need an account returns the chat to zkAPI; closing it
from zkAPI just closes. The "Use zkAPI instead" block is gone. The
signed-out footer reads "Log in"; the dialog says "Log in or sign up".

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WFoW1siuQJuRtb1Vddre7Y
System, Light, Purple, Dark. Purple is a light-family theme: html carries
theme-light and theme-purple, so every light rule still applies and only
the colour tokens change (lavender ground, deeper sidebar tint, near-white
card, indigo text, the send button in #627EEA's darker step). The
pre-hydration script, themeManager and the preference snapshot all accept
it, and the Account dialog's Theme control gets a fourth segment.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MfmWkYowrR6vywgZT1SS5
The shell removes #account-nav, whose menu was the only door to the Account
dialog where Appearance (Layout, Font, Theme) and Data controls live, so
zkAPI users could change neither. The gear the shell has just emptied of
Privacy, Memory and Tools now holds the Appearance section (moved, not
cloned — ChatInput binds its controls by id) and a one-row Data section
for chat export and import. Memories stay out: they need tickets.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MfmWkYowrR6vywgZT1SS5
Same frame as Account and Welcome: 560px, 24px radius, 40px inset, 22/600
title, no header hairline, rows separated by space, 32px controls at 10px
radius. The nested cards and the filled black button are gone: the primary
is the OA control tint (Ethereum-tinted only under the Purple theme). The
deposit is one row — label, a compact amount field, Continue with MetaMask
— with the prerequisites as a helper line; wallet setup and Payment
history are disclosures that open in place, like Invoices. Withdrawing is
not destructive, so nothing in the modal is red.

Every #zkapi-* id and data-* hook the render suite pins is unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MfmWkYowrR6vywgZT1SS5
…urple"

One place for Layout, Font and Theme whether or not there is an account,
so a zkAPI user and a member find it in the same gear. The Account dialog
keeps Data controls, feedback and the account actions. The zkAPI shell no
longer needs to move the section; it still adds its chat export row.
The purple theme is labelled "EF purple" (the stored preference stays
'purple').

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MfmWkYowrR6vywgZT1SS5
…rawal, EF purple by default on zkAPI

- Wallet progress no longer prints a line inside the card; it is a toast
  under the dialog that holds until the next step replaces it, and run()
  ends it with the result.
- Continue with MetaMask is an outline, never a fill (EF purple tints the
  outline and text only). Hovers ease over 180ms.
- The fund view drops the lede and the "Add funds" title; the wallet guide
  and Payment history share one font, and Payment history stays clickable
  while a wallet step runs. "Add a new private balance" is gone.
- The ? and the close glyph sit on one axis.
- Withdraw: amount as the balance figure, the method as two radio rows
  separated by space, a plain note instead of coloured boxes, actions in a
  row with a quiet Back. The primary says "Waiting for MetaMask…" while
  busy, so a disabled state explains itself.
- The Tickets / zkAPI control loses its border and the shadow that read as
  an underline.
- First use of zkAPI in a browser with no chosen theme switches the shared
  theme to EF purple, once (applyZkapiDefaultTheme, with tests).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MfmWkYowrR6vywgZT1SS5
…sion ended elsewhere shows Log in

Closing the dialog after switching to Tickets stays on Tickets (signed
out, so sending asks again) instead of bouncing back to zkAPI. A press
on the dimmed page closes it like the X. When another tab logs out or
deletes the account, this tab's session ends under it: on the Tickets
side the Log in dialog opens instead of leaving a chat that cannot send.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WFoW1siuQJuRtb1Vddre7Y
The button was removed in 96b961e; an empty modal opens on the fund view,
which is where funding lives.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MfmWkYowrR6vywgZT1SS5
The sheet is copied to the same path every release, so browsers kept a
stale copy across deploys and new markup wore old styles. The link now
carries a content hash, like the app CSS.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MfmWkYowrR6vywgZT1SS5
… type; zkAPI hides the Account row

- The deposit amount is the big editable number, as the funded state shows
  the balance, with the wallet action under it — no pill beside a button.
- The dialog's button/input font reset outranked the button classes, so
  Payment history and every button fell back to 15px/400 while the wallet
  guide's summary kept 500. The reset is now zero-specificity (:where).
- In the Tickets/zkAPI product the sidebar Account row stayed in zkAPI
  mode; it is hidden there (zkAPI needs no account; Appearance is in the
  gear) and back for Tickets.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MfmWkYowrR6vywgZT1SS5
… menu item is gone

The sidebar account bar stays (the previous commit hid the whole row —
wrong). What goes is the "Account" menu item whose dialog held Data
controls: those rows (All, Chat history, ChatGPT, Memories) and Share
feedback now sit in the composer gear under Appearance, for Tickets and
zkAPI alike; exports run at once, imports open their pickers. Delete
account gets its own menu item after Log out and opens straight into its
confirmation. The zkAPI-only build hides the Memories row.

Also: the app toast is 13px with tighter padding, and the right panel's
pending-deposit caption reads "Deposit in progress".

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MfmWkYowrR6vywgZT1SS5
…e control height pinned

- Withdraw: the title is "Withdraw", the lede is gone, and the figure's
  caption ("Returned to MetaMask") says the rest; the method rows and the
  checkbox sit closer to it.
- Delete account is no longer an account-menu item. The extension context
  exposes ui.openDeleteAccount, so the commercial Billing dialog can offer
  it as a row and hand off to the core confirmation.
- The Tickets / zkAPI control's buttons are 26px whatever the toolbar's own
  button rules say, so the toolbar never outgrows the 48px the chat area
  reserves for it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MfmWkYowrR6vywgZT1SS5
…t the gear's size

What is set once and rarely changes leads; Privacy, Memory and Tools
follow. The data text actions drop to the gear's 13px.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MfmWkYowrR6vywgZT1SS5
The unified tooltip drops from 14px in a 12px-radius card to 12px in a
smaller one. The mode control loses its tooltip: the toolbar clips
overflow, so the card drawn below it on hover showed only as a stray
hairline across the toolbar.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MfmWkYowrR6vywgZT1SS5
Title 20px, figure 26px, captions and foot 12px, buttons 30px at 13px,
disclosures 14px, a 3px bar, tighter stack.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MfmWkYowrR6vywgZT1SS5
Tabs of one browser share the ticket store through storage events but
never heard about the account: when tab A logged out, tab B's wallet
emptied at once while its account stayed "unlocked and verified" until
some later request failed — so the empty-wallet welcome opened over a
dead session and asked to sign in. logout() now broadcasts
`account-signed-out` before anything shared is cleared, and a tab holding
that account treats it as an expired session (locked, keys cleared, UI
notified), which on the Tickets side is the Log in dialog.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MfmWkYowrR6vywgZT1SS5
The link row lights up edge to edge on hover, and its icon comes forward.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MfmWkYowrR6vywgZT1SS5
…"$ per key"

The right panel's status pill truncated every busy sentence ("Starting
private c…"). While a step runs it is now a spinner, and the words go to
the app toast over the chat bar — held while the step runs, replaced by
the next, taken down when work ends unless a result toast has already
replaced it — the same voice as wallet steps. The usage box drops
"$1 per key": the cap is per model and read as a fee; the model picker
shows it where the choice is made.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MfmWkYowrR6vywgZT1SS5
…r assistive tech

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MfmWkYowrR6vywgZT1SS5
…work narrates too

- Card and popover in EF purple take a touch more lavender (232 65% 97.5%)
  so the Billing and Private balance dialogs read as part of the purple
  page rather than white cards on it.
- The panel pill while a step runs is neutral grey with the spinner — amber
  stays for states that need the person (expired, withdrawal to finish).
- The phase toast listens to the balance's work as well as the composer's,
  so a deposit or withdrawal in progress speaks over the chat bar.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MfmWkYowrR6vywgZT1SS5
…zkAPI; gear tooltips are 12px

- The private-balance bar in the dialog and the right panel share one
  token, the same #0a84ff as an "on" switch, so it no longer goes navy
  in dark mode.
- In zkAPI mode the Council review and Council model rows dim and the
  switch's hover bubble carries the reason (Parallel needs separate
  model keys); the native title is dropped so it is said once.
- The Export/Import tooltips in the gear take the unified 12px bubble.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MfmWkYowrR6vywgZT1SS5
An export is a download to this computer, so the gear's Export buttons
now close the menu and show the same confirmation card the Account
dialog used, standalone over the backdrop; the file only downloads from
its Export button.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MfmWkYowrR6vywgZT1SS5
A disabled switch had pointer-events: none, so its reason bubble never
showed; out-of-mode switches take the pointer again.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MfmWkYowrR6vywgZT1SS5
Each step gets a small numbered dot in the gutter, its name on its own
line and the how-to beneath, with a full line of air between steps; the
list had lost its numbers to the reset and ran together.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MfmWkYowrR6vywgZT1SS5
- The SDK's 'indexer is still catching up with the latest vault root'
  becomes: zkAPI is still reading your latest transaction from Ethereum,
  nothing was lost, it usually clears within a minute of the transaction
  confirming. One helper (zkapiErrorCopy.mjs) rewrites it for the wallet
  dialog, the right-panel key refresh, the settlement transition and the
  panel's last-error state; it shows as an info toast, not an error.
- The resume-deposit lede says what happened and what to do: the prompt
  closed before anything was sent, no funds moved, the amount is saved.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MfmWkYowrR6vywgZT1SS5
…Memory's reason drops Tinfoil

- The gear popover (z-100) never closed before the export confirmation
  (z-50) opened: the dialog reached for app.chatInput, which the
  component facade does not expose. It now hides the gear through
  app.elements directly, for exports and Import history alike.
- The settings panel hides every tooltip; a switch that is out in this
  payment mode is now the exception and shows its reason bubble.
- 'Memory uses a separate Tinfoil key…' becomes 'Memory needs a key paid
  with tickets. Switch to Tickets to use it.'

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MfmWkYowrR6vywgZT1SS5
- Switch bubbles describe the setting (the markup's text, kept on first
  sight) instead of restating on/off, which the switch already shows;
  Web search gets one too. In zkAPI mode Memory's rows dim like Council's
  and their bubbles carry the reason.
- 'Council needs separate model keys. Switch to Tickets to use it.'
- The indexer-lag copy loses its em dash.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MfmWkYowrR6vywgZT1SS5
dsobhani8 and others added 2 commits September 9, 2026 21:27
Cancel, Escape, the backdrop or Export itself all return to the gear
menu the card stepped in front of, instead of dropping to the chat.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MfmWkYowrR6vywgZT1SS5
@vercel

vercel Bot commented Sep 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
oa-fastchat Ready Ready Preview Sep 10, 2026 2:56pm UTC

Request Review

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.

2 participants