Skip to content

feat(web-client): migrate all tutorials to MidenClient API#164

Open
WiktorStarczewski wants to merge 14 commits intomainfrom
wiktor-v14
Open

feat(web-client): migrate all tutorials to MidenClient API#164
WiktorStarczewski wants to merge 14 commits intomainfrom
wiktor-v14

Conversation

@WiktorStarczewski
Copy link
Contributor

@WiktorStarczewski WiktorStarczewski commented Feb 26, 2026

Summary

  • Migrates all 5 web-client tutorial implementations (lib/*.ts) from the old WebClient API to the new MidenClient 0.14 namespaced API (client.accounts.*, client.transactions.*, client.notes.*, client.compile.*)
  • Migrates counter contract and FPI tutorials (incrementCounterContract, foreignProcedureInvocation) to self-contained MidenClient examples
  • Updates all tutorial docs (.md) to match the new API patterns in both TypeScript and React code snippets
  • Replaces string literals with enums throughout: AccountType, StorageMode, NoteVisibility
  • Passes account/faucet objects directly to SDK calls instead of .id() string IDs, wherever the SDK accepts AccountRef
  • Adds --disable-web-security to Playwright config to allow browser→RPC requests in headless tests
    - Switches tutorial RPC endpoint to local node (http://localhost:57291) for E2E tests
    Not sure whether to merge it with local node for unstable docs, and change on release of 0.14? wdyt @Keinberger
  • All 5 Playwright tutorial tests pass

Test plan

  • createMintConsume — passes
  • multiSendWithDelegatedProver — passes
  • incrementCounterContract — passes
  • unauthenticatedNoteTransfer — passes
  • foreignProcedureInvocation — passes

…Client API

- Replace WebClient with MidenClient.create()
- Replace syncState() with sync()
- Replace newWallet/newFaucet with client.accounts.create()
- Replace manual tx request builders with client.transactions.mint/consume/send/submit()
- Replace getConsumableNotes() with client.notes.listAvailable()
- Pass account objects directly instead of .id() to transaction methods
- Use NoteVisibility enum instead of 'public' string literals
- Update React files to pass account objects instead of string IDs
@WiktorStarczewski WiktorStarczewski changed the title feat: migrate counter contract and FPI tutorials to MidenClient API feat: migrate tutorials to 0.14 Feb 26, 2026
@WiktorStarczewski WiktorStarczewski changed the title feat: migrate tutorials to 0.14 feat(web-client): migrate all tutorials to MidenClient API Feb 26, 2026
…or unauthenticated notes

Replace the manual TransactionRequestBuilder loop with the new send() API:
- unauthenticatedNoteTransfer.ts: replace 10-line builder pattern with
  send({ authenticated: false }) + consume({ notes: [note] })
- unauthenticatedNoteTransfer.tsx: replace useInternalTransfer/transferChain
  with explicit useSend + useConsume loop
- unauthenticated_note_how_to.md: update both TypeScript and React code snippets
Replace per-call TransactionProver.newLocalProver() with proverUrl: 'local'
in MidenClient.create(). Removes the TransactionProver import from tutorial files.
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