Modern TypeScript/Rust development toolchain for building, testing, and deploying Pact smart contracts on Kadena
β οΈ Work in Progress: This project is currently under active development. APIs and features may change. We welcome feedback and contributions!
Pact Toolbox is a comprehensive development ecosystem that revolutionizes Kadena blockchain development. It combines the performance of Rust with the flexibility of TypeScript to provide a modern, type-safe development experience for Pact smart contracts. With support for 10+ bundlers, automatic TypeScript type generation, and seamless wallet integration, it's the complete toolchain for professional Kadena development.
Get started in under a minute:
# Create a new Pact dApp
pnpm create pact-toolbox-app my-dapp
# Navigate to your project
cd my-dapp
# Start developing with hot reload
pnpm dev
That's it! You now have a fully configured Pact development environment with:
- β TypeScript types auto-generated from your Pact contracts
- β Hot module replacement for instant feedback
- β Local blockchain running in the background
- β Example todo-list smart contract
- β Production-ready build setup
// Import your Pact contract like any TypeScript module
import { todos } from "./pact/todos.pact";
// Enjoy full type safety and IntelliSense
const result = await todos
.createTodo({
id: "todo-1",
title: "Build amazing dApps",
completed: false,
})
.sign()
.submitAndListen();
- π₯ Hot Module Replacement - See contract changes instantly without restarting
- π Automatic TypeScript Types - Full type safety from Pact to TypeScript with framework-specific code generation
- π¦ Rust-Powered Performance - Lightning-fast parsing with tree-sitter and WebAssembly support
- π Universal Plugin - Works with Vite, Webpack, Next.js, Nuxt, Rollup, esbuild, RSpack, Rsbuild, Farm, and Jest
- π§ͺ Modern Testing - REPL-based testing with Vitest integration and multiple test frameworks support
- πΌ Multi-Wallet Support - Unified API for Chainweaver, Ecko, Zelcore, Magic, and WalletConnect
- π Network Management - Seamless local DevNet, testnet, and mainnet development with Docker orchestration
- π Visual Tools - Admin dashboard, interactive playground, and real-time monitoring
- π Comprehensive Security - Built-in cryptography (Ed25519, Blake2b), key management, and signing
- π¦ Zero Dependencies - Core packages like chainweb-client have zero runtime dependencies
@pact-toolbox/unplugin
- Universal bundler plugin supporting 10+ build tools@pact-toolbox/runtime
- Runtime execution environment for Pact code@pact-toolbox/test
- Testing framework with REPL support and Vitest integration@pact-toolbox/script
- Script execution and deployment utilities
@pact-toolbox/chainweb-client
- Fast, zero-dependency Chainweb API client@pact-toolbox/transaction
- High-level transaction builder with fluent API@pact-toolbox/network
- Network configuration and management@pact-toolbox/docker
- Docker orchestration for local DevNet@pact-toolbox/kda
- Kadena-specific services (coin, marmalade, namespace)
@pact-toolbox/crypto
- Ed25519, Blake2b, and cryptographic utilities@pact-toolbox/signers
- Transaction signing abstractions@pact-toolbox/wallet-core
- Base wallet functionality@pact-toolbox/wallet-adapters
- Unified interface for all Kadena wallets@pact-toolbox/dev-wallet
- Built-in development wallet with UI
@pact-toolbox/fabricator
- Smart contract and module generators@pact-toolbox/prelude
- Prelude management and deploymentpact-transformer
- Rust-powered parser with TypeScript type generation
pact-toolbox
CLI - Command-line interface with commands for init, start, test, run, generate, and moredocs
- Comprehensive documentation site built with Rspress
- Write Pact contracts with syntax highlighting and validation
- Import directly into TypeScript with full type inference
- Test contracts using familiar testing patterns
- Deploy to any Kadena network with one command
Pact Toolbox is built as a polyglot monorepo combining TypeScript and Rust for optimal performance and developer experience:
pact-toolbox/
βββ packages/ # Core TypeScript packages
β βββ unplugin/ # Universal bundler plugin (10+ bundlers)
β βββ transaction/ # Transaction builder with fluent API
β βββ chainweb-client/ # Zero-dependency Chainweb client
β βββ test/ # REPL-based testing framework
β βββ crypto/ # Cryptographic utilities
β βββ wallet-*/ # Wallet ecosystem packages
β βββ ... # 20+ specialized packages
βββ apps/ # Applications
β βββ cli/ # pact-toolbox CLI
β βββ docs/ # Documentation site
βββ crates/ # Rust components
β βββ pact-transformer/ # Tree-sitter parser & TypeScript generator
β βββ mining-trigger/ # Mining service for DevNet
βββ examples/ # Example projects
β βββ todo-mvc-vite/ # Vite example
β βββ todo-mvc-nextjs/ # Next.js example
βββ tooling/ # Shared configurations
βββ oxlint/ # Linting (not ESLint)
βββ prettier/ # Code formatting
βββ tsconfig/ # TypeScript configs
βββ vitest/ # Testing configs
- TypeScript - Primary language for all packages and tools
- Rust - Performance-critical components (parser, mining trigger)
- Tree-sitter - Advanced parsing for Pact contracts
- NAPI-RS - Rust-TypeScript bridge for native performance
- Vitest - Modern testing framework
- Turbo - Build orchestration and caching
- pnpm - Fast, efficient package management
Build production-ready decentralized applications with the same tools and workflows you already know and love.
Test and deploy Pact contracts with confidence using modern testing practices and deployment automation.
Standardize on a single toolchain that works across your entire stack, from smart contracts to frontend.
Visit our documentation at https://kadena-community.github.io/pact-toolbox/
- Introduction - Learn what makes Pact Toolbox special
- First Project - Build your first Kadena app
- API Reference - Complete API documentation for all packages
- Examples - Full example applications
# Start documentation dev server
pnpm docs:dev
# Build documentation
pnpm docs:build
# Preview production build
pnpm docs:preview
We welcome contributions! Please see our Contributing Guide for details.
# Prerequisites
# - Node.js >= 22.0.0
# - pnpm >= 9.0.0
# - Rust (for building crates)
# Clone the repository
git clone https://github.com/kadena-community/pact-toolbox.git
cd pact-toolbox
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Run tests
pnpm test
# Development mode (watch)
pnpm dev
# Lint and format
pnpm lint
pnpm format:fix
- Packages follow
@pact-toolbox/*
naming convention - Apps are standalone applications
- Crates are Rust components exposed to TypeScript
- Examples demonstrate real-world usage patterns
- Tooling contains shared development configurations
MIT - see LICENSE for details
Made with β€οΈ by @salamaashoush and the Kadena community
Special thanks to:
- The Kadena team for creating Pact and Chainweb
- The Rust community for excellent tooling
- All contributors who have helped shape this project