Skip to content

docs: restructure client docs, expand Rust library, add React/TS SDKs#1881

Open
WiktorStarczewski wants to merge 17 commits intonextfrom
wiktor-newdocs
Open

docs: restructure client docs, expand Rust library, add React/TS SDKs#1881
WiktorStarczewski wants to merge 17 commits intonextfrom
wiktor-newdocs

Conversation

@WiktorStarczewski
Copy link
Copy Markdown
Contributor

@WiktorStarczewski WiktorStarczewski commented Mar 10, 2026

Summary

Major restructure of the client documentation in docs/external/src/:

Structural changes

  • CLI docs moved from rust-client/cli/ to top-level cli/ — these are now synced to Tools/CLI in miden-docs (no longer nested under the Rust client)
  • CLI Getting Started restored under cli/get-started/ with full tutorials (create account, public P2P, private P2P)
  • CLI Config moved into cli/get-started/ as the first subsection
  • Rust client rewritten to focus exclusively on the Rust library (no CLI references)
  • Rust library expanded from a single library.md to a multi-page library/ directory with 11 pages
  • Client index renamed to "Design" — serves as the architectural overview

New Rust library pages

  • library/index.md — Client initialization, API overview, dependencies
  • library/accounts.md — Retrieving accounts, checking balance
  • library/new-accounts.md — Creating wallets (private/public/mutable), faucets
  • library/compile.md — CodeBuilder API: compile account components, transaction scripts, note scripts, library linking
  • library/import.md — Importing accounts by ID, from objects, importing notes from NoteFile variants
  • library/export.md — Exporting notes and accounts
  • library/new-transactions.md — Pay-to-id, consuming, minting, swaps, remote prover, custom transactions
  • library/transactions.md — Transaction history, statuses, output notes
  • library/notes.md — Listing, filtering, consumable notes
  • library/tags.md — Note tag management (add/remove/list, tag sources, sync behavior)
  • library/note-transport.md — Sending/fetching private notes, pagination, complete example
  • library/sync.md — State synchronization, when to sync, sync height

Rust client docs rewritten

  • rust-client/index.md — Library overview (no CLI mentions)
  • rust-client/install-and-run.md — Cargo.toml dependency (not cargo install), feature flags, version 0.14
  • rust-client/features.md — Library capabilities with code snippets
  • rust-client/get-started/ — All tutorials rewritten with Rust library API instead of CLI commands
  • rust-client/examples.md — Hub page linking to all library reference pages + prover fallback example

Other changes

  • Client index (index.md): Updated SDK table, removed "and CLI" from Rust description
  • Common errors: Documented 9 additional errors, capitalized "Miden Client"
  • Orphaned PNGs deleted: Removed 10 unused screenshots from img/get-started/
  • CLI fixes: Fixed sidebar-positionsidebar_position typos, !!! note:::note Docusaurus syntax, fixed broken GitHub links to relative paths
  • Capitalization: "Miden Client" consistently capitalized across all docs

Accompanying PR

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
- @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
@WiktorStarczewski WiktorStarczewski added the no changelog This PR does not require an entry in the `CHANGELOG.md` file label Mar 10, 2026
…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
@WiktorStarczewski WiktorStarczewski changed the title docs: restructure web-client docs, add React SDK documentation docs: restructure client docs, expand Rust library, add React/TS SDKs Mar 10, 2026
# 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.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

@igamigo igamigo Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread docs/external/src/rust-client/get-started/create-account-use-faucet.md Outdated
Address PR review feedback from igamigo.
Copy link
Copy Markdown

@BrianSeong99 BrianSeong99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — docs restructure aligns with our miden-docs CI changes (tools/clients + tools/cli split). All checks pass.

Copy link
Copy Markdown
Collaborator

@Keinberger Keinberger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Comment thread docs/external/src/rust-client/library/new-transactions.md Outdated
Comment thread docs/external/src/rust-client/library/new-transactions.md Outdated
Comment thread docs/external/src/rust-client/library/new-transactions.md Outdated
Comment thread docs/external/src/rust-client/library/import.md Outdated
Comment thread docs/external/src/rust-client/library/export.md Outdated
Comment thread docs/external/src/rust-client/library/compile.md Outdated
Comment thread docs/external/src/rust-client/library/accounts.md Outdated
Comment thread docs/external/src/react-client/install.md Outdated
Comment thread docs/external/src/web-client/install.md Outdated
Comment thread docs/external/src/react-client/library/signers.md Outdated
- 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
Copy link
Copy Markdown
Collaborator

@Keinberger Keinberger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();
Copy link
Copy Markdown
Collaborator

@Keinberger Keinberger Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Copy Markdown
Collaborator

@Keinberger Keinberger Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three issues here:

  1. use miden_client::note::NoteExportType: NoteExportType is not exported from the note module. The correct import is use miden_client::store::NoteExportType.
  2. Line 20: NoteExportType::Full doesn't exist. The correct variant is NoteExportType::NoteWithProof.
  3. Lines 26-29: The table lists Id, Details, Full -- these should be NoteId, NoteDetails, NoteWithProof to match the actual enum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog This PR does not require an entry in the `CHANGELOG.md` file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants