docs: restructure client docs, expand Rust library, add React/TS SDKs#1881
docs: restructure client docs, expand Rust library, add React/TS SDKs#1881WiktorStarczewski wants to merge 17 commits intonextfrom
Conversation
Move 12 reference pages into library/ subfolder, add get-started tutorials (create account, public/private P2P transfers, mock client), and create structural pages (install, features, design, api-docs, library index). Delete dead rpc_client.md stub. Rewrite index.md as slim overview.
…ages - Client index: add four-layer SDK architecture diagram and table (rust-sdk → wasm-bridge → ts-sdk / react-sdk) - web-client/design: focus on ts-sdk design, move high-level architecture to parent index - web-client/examples: rewrite as navigation hub linking to tutorials and library reference pages - web-client/features: swap position with get-started to match Rust order
Reorganize by category (connection, account, note, transaction, store) and add errors sourced from the codebase's ErrorHint implementations.
- Add full React SDK docs section (react-client/) with overview, install, features, design, get-started tutorials, and library reference - Document MultiSignerProvider and useMultiSigner for multi-signer dapps - Fix mermaid diagrams using \n instead of <br/> in web-client and react-client - Link React SDK from parent client index page
This reverts commit a7cc917.
- @miden-sdk/miden-sdk → @miden-sdk/ts-sdk in all web-client imports/installs - @miden-sdk/miden-sdk → @miden-sdk/wasm-bridge in react-client peer dep refs - @miden-sdk/react → @miden-sdk/react-sdk in all react-client imports/installs - Fix signer package names to match PR #1872 actuals - Update GitHub links from miden-client to ts-sdk/wasm-bridge repos
…cs for library - Move CLI docs from rust-client/cli/ to top-level cli/ (will be synced under Tools) - Rewrite Rust client docs to focus on library API (no CLI references) - Rewrite get-started tutorials with Rust library API instead of CLI commands - Fix broken links and frontmatter typos (sidebar-position → sidebar_position) - Fix non-Docusaurus admonition syntax in CLI docs - Update version references from 0.11 to 0.14 - Update top-level index to remove CLI from Rust SDK description
…nsport), restore CLI get-started, delete orphaned PNGs
| # Miden Client | ||
|
|
||
| The Miden client currently has three main components: | ||
| The Miden Client SDK is organized as a layered stack. The Rust core is the single source of truth for all client logic. Browser-facing SDKs build on top of it through a WASM bridge layer, giving TypeScript and React developers native access to the full protocol without needing a Rust toolchain. |
There was a problem hiding this comment.
This is a bit confusing. Should all components be mentioned here? It feels like each repo (once the split is done) should contain its own information and then a higher-level component (miden-docs) should mention each separately
There was a problem hiding this comment.
Or maybe this is for the current repo split, but in that case I don't see how this should mention these names (eg, wasm-bridge should be web-client)
There was a problem hiding this comment.
Well, first of all, we pull the docs from current client repo so they can be maintained in the client, if we move them to the docs repo, then they have to be maintained there (which is fine, but against our current strategy).
This already includes the repo split, so the WASM bridge is the correct name.
There was a problem hiding this comment.
But if this includes the split, why would this repo need to maintain the docs for other repos then? Should those docs not be added to their own? cc @Keinberger
Address PR review feedback from igamigo.
BrianSeong99
left a comment
There was a problem hiding this comment.
LGTM — docs restructure aligns with our miden-docs CI changes (tools/clients + tools/cli split). All checks pass.
Keinberger
left a comment
There was a problem hiding this comment.
Hey @WiktorStarczewski, thanks a lot for this restructure, this has been overdue for some time and is really valuable!
I let my agent run through the PR to find potentially incorrect API references, package names, etc. so that we make sure everything is accurate against next. See the inline comments below.
Thanks!
- Fix Rust client API: use submit_new_transaction(), correct build_pay_to_id/build_consume_notes/build_swap signatures, replace nonexistent get_account()/get_accounts()/export_note()/ import_note_from_file()/get_latest_epoch_block() with real API - Fix npm package names: @miden-sdk/react-sdk -> @miden-sdk/react, @miden-sdk/ts-sdk -> @miden-sdk/miden-sdk, @miden-sdk/wasm-bridge -> @miden-sdk/miden-sdk - Fix environment="BETA" -> "PRODUCTION" inconsistency in signers.md
There was a problem hiding this comment.
Hey @WiktorStarczewski, almost everything looks solid, thanks! I left two inline comments on the remaining issues found by my agents.
Everything else looks correct, thanks!
I think two small fixes and this is ready to merge. Thanks!
| ```rust | ||
| // Get consumable notes for an account | ||
| let consumable = client.get_consumable_notes(Some(account_id)).await?; | ||
| let notes: Vec<_> = consumable.into_iter().map(|n| n.note).collect(); |
There was a problem hiding this comment.
get_consumable_notes returns Vec<(InputNoteRecord, Vec<NoteConsumability>)> a tuple. The iterator variable n is a (InputNoteRecord, Vec<NoteConsumability>), so .note doesn't exist and this won't compile. You'll need to destructure the tuple and convert the record, something like:
let notes: Vec<Note> = consumable
.into_iter()
.map(|(record, _)| record.try_into())
.collect::<Result<_, _>>()?;| Retrieve an output note and convert it to a `NoteFile` for export: | ||
|
|
||
| ```rust | ||
| use miden_client::note::NoteExportType; |
There was a problem hiding this comment.
Three issues here:
use miden_client::note::NoteExportType:NoteExportTypeis not exported from thenotemodule. The correct import isuse miden_client::store::NoteExportType.- Line 20:
NoteExportType::Fulldoesn't exist. The correct variant isNoteExportType::NoteWithProof. - Lines 26-29: The table lists
Id,Details,Full-- these should beNoteId,NoteDetails,NoteWithProofto match the actual enum.
Summary
Major restructure of the client documentation in
docs/external/src/:Structural changes
rust-client/cli/to top-levelcli/— these are now synced toTools/CLIin miden-docs (no longer nested under the Rust client)cli/get-started/with full tutorials (create account, public P2P, private P2P)cli/get-started/as the first subsectionlibrary.mdto a multi-pagelibrary/directory with 11 pagesNew Rust library pages
library/index.md— Client initialization, API overview, dependencieslibrary/accounts.md— Retrieving accounts, checking balancelibrary/new-accounts.md— Creating wallets (private/public/mutable), faucetslibrary/compile.md— CodeBuilder API: compile account components, transaction scripts, note scripts, library linkinglibrary/import.md— Importing accounts by ID, from objects, importing notes from NoteFile variantslibrary/export.md— Exporting notes and accountslibrary/new-transactions.md— Pay-to-id, consuming, minting, swaps, remote prover, custom transactionslibrary/transactions.md— Transaction history, statuses, output noteslibrary/notes.md— Listing, filtering, consumable noteslibrary/tags.md— Note tag management (add/remove/list, tag sources, sync behavior)library/note-transport.md— Sending/fetching private notes, pagination, complete examplelibrary/sync.md— State synchronization, when to sync, sync heightRust client docs rewritten
rust-client/index.md— Library overview (no CLI mentions)rust-client/install-and-run.md— Cargo.toml dependency (notcargo install), feature flags, version 0.14rust-client/features.md— Library capabilities with code snippetsrust-client/get-started/— All tutorials rewritten with Rust library API instead of CLI commandsrust-client/examples.md— Hub page linking to all library reference pages + prover fallback exampleOther changes
index.md): Updated SDK table, removed "and CLI" from Rust descriptionimg/get-started/sidebar-position→sidebar_positiontypos,!!! note→:::noteDocusaurus syntax, fixed broken GitHub links to relative pathsAccompanying PR