Skip to content

feat: switch real pool flow to the Wallet API route, unblocking mainnet - #20

Merged
sainathr19 merged 1 commit into
mainfrom
feat/ui-wallet-api-privacy-route
Aug 19, 2026
Merged

feat: switch real pool flow to the Wallet API route, unblocking mainnet#20
sainathr19 merged 1 commit into
mainfrom
feat/ui-wallet-api-privacy-route

Conversation

@sainathr19

Copy link
Copy Markdown
Collaborator

Summary

This unblocks mainnet. strk20.js's create/claim/cancel were built on the SDK-direct route — the app itself calling ProvingServiceProofProvider/IndexerDiscoveryProvider with explicit provingUrl/discoveryUrl config. StarkWare hasn't published those mainnet URLs (strk20-hackathon issue #31, still open with no reply as of today) — that was the actual blocker on real mainnet transactions.

Checked which sprint projects have actually gotten a working mainnet demo scored (demo + video + mainnet all true in the hub's projects.json) — only one: Philoxenia. It uses a completely different integration route: WalletAccountV6 (starknet.js) talking to the user's Ready wallet extension, which does its own proving and discovery internally. The app never touches a proving/discovery URL or a viewing key — not blocked on anything StarkWare hasn't shipped.

What changed

  • New ui/src/wallet-account-v6.js — Ready wallet detection (@starknet-io/get-starknet-discovery), wallet-API version check (needs ≥0.10 for STRK20), connect.
  • Rewrote ui/src/strk20.js:
    • shield{type: "deposit", token, amount}
    • createPlanwithdraw (to Iceberg) + invoke CreatePlan, no open note — matches CreatePlan's empty-span return exactly, same shape as Philoxenia's zero-leftover anonymizer call
    • claim/cancel → open a note + invoke with the ${openNoteIds[0]} placeholder, which the wallet resolves to the just-opened note's id at submission time
  • Fixed the now-stale "waiting on StarkWare's mainnet proving and discovery endpoints" message in App.jsx's pool-mode UI panel.

Verification

Every action shape here — field names for deposit/withdraw/transfer/invoke, the "OPEN" literal, the ${openNoteIds[N]} placeholder pattern — is checked directly against @starknet-io/starknet-types-0104's shipped .d.ts (not just Philoxenia's example code), using the same starknet@10.7.0 already installed here. vite build succeeds, existing ui test suite still 4/4.

Not verified: an actual live Ready wallet in a browser. No such environment available in this session. This is real production integration code handling real funds — please manually test shield → create → claim/cancel against a real Ready wallet before relying on it for the hackathon's required 3 mainnet transactions. Pool-mode buttons also aren't wired to these functions yet in the UI — devnet demo mode is untouched and remains the only interactive path for now; wiring real buttons is a natural follow-up.

Test plan

  • vite build succeeds
  • npm test (ui) — 4/4 pass, unaffected
  • Every wallet-API action shape cross-checked against the installed package's type definitions
  • Manual test against a real Ready wallet on mainnet — not done here, needs a human with a funded wallet

strk20.js's create/claim/cancel were built on the SDK-direct route:
the app itself calls ProvingServiceProofProvider/IndexerDiscoveryProvider
with explicit provingUrl/discoveryUrl config. StarkWare has not
published those mainnet URLs (strk20-hackathon issue #31, still
unresolved) — this was the actual mainnet blocker.

Philoxenia (github.com/SergioSSantiago/philoxenia), the only STRK20
Private Sprint project with a working mainnet demo so far, uses a
different route entirely: WalletAccountV6 (starknet.js), where the
connected wallet (Ready) does its own proving and discovery
internally. The app never touches a proving/discovery URL or a
viewing key. Not blocked on anything StarkWare hasn't shipped.

Adds:
- ui/src/wallet-account-v6.js: Ready detection (get-starknet-discovery),
  wallet-API version check (>=0.10 for STRK20), connect.
- ui/src/strk20.js rewritten: shield -> {type: "deposit"}; createPlan ->
  withdraw + invoke (no open note, matches CreatePlan's empty-span
  return); claim/cancel -> open note + invoke with the
  ${openNoteIds[0]} placeholder the wallet resolves at submission time.

Verified every action shape (deposit/withdraw/transfer/invoke field
names, the OPEN literal, the ${openNoteIds[N]} placeholder pattern)
directly against @starknet-io/starknet-types-0104's shipped .d.ts,
not just against Philoxenia's example — same starknet@10.7.0 already
installed here. `vite build` and the existing ui test suite (4/4)
both pass.

Not verified: an actual live Ready wallet in a browser — no such
environment available here. This is real production integration code;
that gap should be closed with a manual test before relying on it for
the hackathon's required mainnet transactions.

Also fixes the now-stale "waiting on StarkWare's mainnet proving and
discovery endpoints" message in App.jsx's pool-mode UI. Pool-mode
buttons still aren't wired to these functions — devnet demo mode is
unaffected and remains the only interactive path in the UI for now.
@sainathr19
sainathr19 merged commit a220381 into main Aug 19, 2026
3 checks passed
@sainathr19
sainathr19 deleted the feat/ui-wallet-api-privacy-route branch August 19, 2026 09:13
sainathr19 added a commit that referenced this pull request Aug 19, 2026
The "act on this plan" buttons only ever called the devnet demo
writer; pool mode just showed a static "not wired yet" message.
Wires them to strk20.js's real create/claim/cancel via the Wallet API
route from #20.

- strk20.js: createPlan/claim/cancel now resolve in_token/out_token
  internally (one cached view call per contract address) instead of
  requiring the caller to already know them — matches
  devnet-writer.js's existing viewCall convention, and lets App.jsx's
  demo and pool code paths share the same params shape.
- App.jsx: buttons are gated on demoMode OR an actually-detected,
  STRK20-capable wallet (detectPrivacyCapable from #20's
  wallet-account-v6.js) rather than just "not demo mode" — so the
  button's enabled state matches what a click would actually do,
  never promises something that immediately fails.

Verified: vite build succeeds, ui test suite still 4/4 (unaffected —
touches strk20.js/App.jsx, not iceberg.js). Not verified: an actual
live Ready wallet clicking these buttons end to end — still no such
environment available here. This is the last piece before the
required mainnet transactions can happen through the real UI; needs
a human test before relying on it for those.
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.

1 participant