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