Tongo TypeScript SDK
The Tongo TypeScript SDK provides a comprehensive interface for building confidential payment applications on Starknet. It handles key management, encryption, proof generation, and transaction serialization.
Features
- Simple API: High-level methods for all Tongo operations
- Type Safety: Full TypeScript support with complete type definitions
- Proof Generation: Automatic ZK proof creation for all operations
- Encryption Handling: Transparent management of encrypted balances
- Starknet Integration: Seamless integration with Starknet wallets and providers
Architecture
The SDK consists of two main layers:
1. SHE (Starknet Homomorphic Encryption)
Low-level cryptographic primitives for:
- ElGamal encryption over the Stark curve
- Zero-knowledge proof generation (POE, PED, RAN)
- Homomorphic balance operations
2. Tongo SDK
High-level application interface providing:
Accountclass for managing Tongo accounts- Operation objects for transactions (
FundOperation,TransferOperation, etc.) - State management and decryption utilities
- Event querying and transaction history
Package Information
- Package:
@fatsolutions/tongo-sdk - Current Version: 1.2.0
- License: Apache-2.0
- Repository: github.com/fatlabsxyz/tongo
Quick Links
- Installation - Install the SDK
- Quick Start - Your first Tongo transaction
- Core Concepts - Understand the fundamentals
- API Reference - Complete API documentation
- Examples - Real-world code examples
Supported Networks
The SDK works on:
- Starknet Mainnet - Production deployments
- Starknet Sepolia - Testnet for development
Deployed Tongo Contracts:
- Mainnet:
0x0415f2c3b16cc43856a0434ed151888a5797b6a22492ea6fd41c62dbb4df4e6c(USDC wrapper) - Sepolia:
0x00b4cca30f0f641e01140c1c388f55641f1c3fe5515484e622b6cb91d8cee585(STRK wrapper, 1:1 rate)
Prerequisites
- Node.js: v18 or higher
- Starknet.js: v8.0.0 or higher (peer dependency)
- TypeScript: v5.0 or higher (recommended)