docs: migrate Quick Start TypeScript to MidenClient + fix migration ch07#241
Open
BrianSeong99 wants to merge 6 commits intomainfrom
Open
docs: migrate Quick Start TypeScript to MidenClient + fix migration ch07#241BrianSeong99 wants to merge 6 commits intomainfrom
BrianSeong99 wants to merge 6 commits intomainfrom
Conversation
- setup/installation.md: add "Set Up React App" section with one-time MidenProvider wiring (rpcUrl: "testnet" shortcut). - accounts.md: convert wallet + faucet creation snippets to useCreateWallet / useCreateFaucet hooks. - notes.md: convert mint / consume / send snippets to useMint / useWaitForNotes / useConsume / useSend (plus useMidenClient for post-consume balance read). - read-storage.md: convert count + balance readers to useMidenClient. Each snippet is a small React component mounted inside <MidenProvider>; replaces the v0.13 demo() async-function style against the now-stale WebClient API. Rust snippets untouched (already on v0.14). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ider create-miden-app scaffolds src/providers.tsx with MidenProvider already wired, and src/App.tsx renders AppProviders → AppContent. RPC URL is config-driven via src/config.ts + VITE_MIDEN_RPC_URL. - setup/installation.md: rewrite "Set Up React App" to reflect what the template actually does — no manual provider wiring, mount components in src/components/AppContent.tsx, env var for custom RPC. - accounts.md, notes.md, read-storage.md: every snippet callout updated from "Mount inside <MidenProvider> in App.tsx" to "Import and render inside src/components/AppContent.tsx". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previous commit trimmed TypeScript Environment to a 2-line pointer. Restore full per-guide scaffolding steps (yarn create-miden-app / cd / yarn install, then touch src/components/X.tsx, then yarn dev), matching the weight of the Rust Environment subsection above it. Keeps a link to installation.md#set-up-react-app for the first-time setup. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…h07 field names
Switch Quick Start TypeScript snippets from the @miden-sdk/react hooks
direction to imperative MidenClient demo() functions — aligns with the
v0.14 migration guide chapter 07 and mirrors the Rust main() shape.
Setup becomes a plain Vite vanilla-ts scaffold; no React/MidenProvider.
- setup/installation.md: replace "Set Up React App" with "Set Up
TypeScript Project" — vanilla-ts Vite, import demo() from main.ts.
- accounts.md: 2 snippets (wallet, faucet) as demo() using
client.accounts.create({ type: "MutableWallet" | "FungibleFaucet" }).
- notes.md: 3 snippets (mint, consume, send) as demo() using
client.transactions.mint/consume/send with correct option shapes
(account/to/token/type, waitForConfirmation) and client.accounts.getBalance.
- read-storage.md: 2 snippets (count, balance) as demo() using
client.accounts.getOrImport + getBalance, no useMidenClient hook.
Also fixes migration/07-client-changes.md to match what's actually
shipped in @miden-sdk/miden-sdk@0.14.0 (and Wiktor's original draft
in issue #239):
- @miden/sdk → @miden-sdk/miden-sdk (correct package name).
- createTestnet() now awaited.
- Account creation: storageMode → storage.
- Sending: from/faucetId/noteType → account/token/type (+ waitForConfirmation).
- Consuming: add the full After example (listAvailable + consume +
consumeAll), not just the Before.
- Custom contracts: sourceCode → source, drop accountId, add
storageSlots + seed + auth; use client.compile.txScript for scripts
and pass the Account (not .id) to transactions.execute.
- Keystore: get(pubKeyCommitment), getCommitments(accountId) per
shipped api-types; previous doc had the arguments wrong.
All v0.13 API names (WebClient, newWallet, newFaucet, newMint/Consume/
SendTransactionRequest, submitNewTransaction, storageMode, useX hooks,
MidenProvider, AppContent.tsx) removed from Quick Start. npm run build
passes with zero new broken links on any changed page.
…p are symmetric Move the `miden new my-test-project` step out of "Verify Installation" (where it was buried as an h3 afterthought) and introduce a new "Set Up a Project" h2 with two parallel h3 subsections — Rust Project and TypeScript Project. "Verify Installation" is now focused on just the midenup toolchain check. Per-page "Set Up Development Environment" callouts in accounts.md now point at the matching anchors (#rust-project, #typescript-project).
The <CodeTabs /> JSX wrapper was rendering broken in production — MDX's
parser couldn't handle the nested template-literal payloads with braces
inside, causing entire blocks to fall through to raw text. Replace all 7
<CodeTabs /> instances across the Quick Start pages with paired markdown
code fences (Rust first, then TypeScript) using the title= attribute to
keep the suggested filename visible.
- accounts.md: 2 CodeTabs blocks → 4 fences
- notes.md: 3 CodeTabs blocks → 6 fences
- read-storage.md: 2 CodeTabs blocks → 4 fences
- Removed the now-unused `import { CodeTabs } from '@site/src/components'`
from each of the three files.
Code bodies preserved verbatim; only the surrounding wrapper changed.
npm run build passes with no new broken links on any changed page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates the Quick Start TypeScript snippets from the v0.13
WebClientAPI to the v0.14MidenClientresource-based API documented in migration guide ch07. Rust snippets were already v0.14 and are untouched.Also fixes
migration/07-client-changes.mdso its code examples match what's actually shipped in@miden-sdk/miden-sdk@0.14.0(and align with the original authored content in issue #239).Changes
Quick Start (TypeScript)
setup/installation.md— new "Set Up TypeScript Project" section using a minimal Vite vanilla-ts scaffold. Each snippet goes insrc/demo.tsand is called fromsrc/main.ts.accounts.md— 2 snippets (wallet creation, faucet creation) converted toMidenClientdemo() functions usingclient.accounts.create({ type: "MutableWallet" | "FungibleFaucet", ... }).notes.md— 3 snippets (mint, consume, send) usingclient.transactions.mint/consume/sendwith the shipped option shapes (account/to/token/type) andclient.accounts.getBalancefor balance reads.read-storage.md— 2 snippets (counter read, balance read) usingclient.accounts.getOrImport+getBalance.Migration guide ch07 fixes
Brought the published
07-client-changes.mdback in line with shipped@miden-sdk/miden-sdk@0.14.0(and Wiktor's original draft in #239):@miden/sdk→@miden-sdk/miden-sdk(correct package name).MidenClient.createTestnet()now properly awaited.storageMode→storage.{ from, faucetId, noteType }→{ account, token, type }, addwaitForConfirmation.listAvailable+consume+consumeAll), not just the v0.13 Before.sourceCode→source,accountId: undefined→storageSlots: [], addseed+auth, wrap scripts withclient.compile.txScript, pass theAccount(not.id) totransactions.execute.get(pubKeyCommitment)andgetCommitments(accountId)— previous doc had wrong argument types for both.Test plan
npm run buildsucceeds with zero new broken links on any changed page.docs/builder/get-started/(WebClient,newWallet,newFaucet,createClient,submitNewTransaction,newMintTransactionRequest,newConsumeTransactionRequest,newSendTransactionRequest,export async function demohook-era).useMidenClient,useCreateWallet,useSend,MidenProvider,AppContent.tsx,@miden-sdk/react).MidenClientmethod signatures verified against@miden-sdk/miden-sdk@0.14.0dist/api-types.d.ts.npm run startlocally to preview.