Official documentation for the Tongo Protocol and TypeScript SDK. Built with mdbook.
# Install via cargo (Rust package manager)
cargo install mdbook
# Or on Arch Linux
sudo pacman -S mdbook# Navigate to this directory
cd /home/john/fatsolutions/tongo-v1/tongo-docs
# Option A: Build static HTML
mdbook build
# Output in: book/index.html
# Option B: Serve with live reload (RECOMMENDED)
mdbook serve
# Opens at: http://localhost:3000
# Auto-reloads when you edit files!
# Option C: Serve and auto-open browser
mdbook serve --openThat's it! The docs are now viewable at http://localhost:3000 π
All documentation is written in Markdown and lives in the src/ directory:
src/
βββ SUMMARY.md # Table of contents (navigation)
βββ README.md # Landing page
β
βββ protocol/ # Protocol Documentation
β βββ introduction.md
β βββ encryption.md
β βββ transfer.md
β βββ auditor.md
β βββ contracts.md
β
βββ sdk/ # SDK Documentation
βββ README.md # SDK overview
βββ installation.md
βββ quick-start.md
β
βββ concepts/ # Core concepts
β βββ accounts.md
β βββ operations.md
β βββ encrypted-state.md
β βββ key-management.md
β
βββ guides/ # Step-by-step guides
β βββ funding.md
β βββ transfers.md
β βββ withdrawals.md
β βββ rollover.md
β βββ wallet-integration.md
β βββ transaction-history.md
β
βββ api/ # API reference
β βββ account.md
β βββ operations.md
β βββ types.md
β
βββ examples/ # Real-world examples
βββ complete-workflow.md
βββ react-integration.md
- Edit any
.mdfile in thesrc/directory - With
mdbook serverunning: Changes appear instantly in browser! - Without serve: Run
mdbook buildto rebuild
- Create a new
.mdfile in the appropriatesrc/subdirectory - Add an entry to
src/SUMMARY.mdto include it in navigation:
- [My New Page](path/to/new-page.md)tongo-docs/
βββ book.toml # mdbook configuration
βββ src/ # Markdown source files (EDIT THESE)
β βββ SUMMARY.md # Navigation structure
β βββ README.md # Landing page
β βββ protocol/ # Protocol docs
β βββ sdk/ # SDK docs
βββ theme/ # Custom styling
β βββ custom.css # Cyberpunk theme
βββ book/ # Generated HTML (gitignored)
βββ README.md # This file
Important: Only edit files in src/. The book/ directory is auto-generated.
The docs use a custom cyberpunk theme matching the Tongo landing page:
- Jet Black:
#0d0d0d- Background - Deep Orange:
#ff4d00- Primary accent, headers - Warm Coral:
#ff693a- Secondary accent - Ice Blue:
#b9d3d7- Links, subtle text - Soft Gray:
#d1d1cf- Body text
- Primary: JetBrains Mono
- Monospace: IBM Plex Mono
Edit theme/custom.css to modify:
- Colors and styling
- Fonts and typography
- Layout and spacing
- Animations and effects
After changes, rebuild with mdbook build or wait for auto-reload.
# Build the docs
mdbook build
# Push the book/ directory to gh-pages branch
git subtree push --prefix book origin gh-pages- Connect your repository
- Set build command:
mdbook build - Set publish directory:
book
FROM rust:latest as builder
RUN cargo install mdbook
COPY . /docs
WORKDIR /docs
RUN mdbook build
FROM nginx:alpine
COPY --from=builder /docs/book /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]Build and run:
docker build -t tongo-docs .
docker run -p 8080:80 tongo-docsProtocol Documentation:
- Introduction to Tongo confidential payments
- Encryption system (ElGamal, homomorphic encryption)
- Transfer protocol and ZK proofs
- Auditing and compliance features
- Cairo contracts overview
SDK Documentation:
- Installation and quick start
- Core concepts (Accounts, Operations, Encrypted State, Key Management)
- Step-by-step guides (Funding, Transfers, Withdrawals, Rollover)
- Wallet integration patterns
- Complete API reference
- Real-world examples (React integration, complete workflows)
All code examples are:
- β Verified against actual SDK source code
- β Tested for correctness
- β Based on working patterns from production apps
- β TypeScript with full type annotations
# Make sure cargo bin is in PATH
export PATH="$HOME/.cargo/bin:$PATH"
# Or reinstall
cargo install mdbook# Use a different port
mdbook serve --port 3001# Hard rebuild
mdbook clean
mdbook build- GitHub: https://github.com/fatlabsxyz/tongo
- npm Package: @fatsolutions/tongo-sdk
- Website: https://tongo.cash