Package Exports
- @gvnrdao/dh-lit-actions
Readme
dh-lit-actions: Diamond Hands LIT Actions Package System
A comprehensive, deterministic, and auditable build system for LIT Protocol Actions used in the Diamond Hands Protocol.
Architecture
lit-actions/
├── src/ # LIT Action TypeScript sources
├── scripts/ # Build, minify, upload scripts (TypeScript)
├── out/ # Compiled .js files from src/
├── dist/ # Minified, deployment-ready .action.js files
├── pkg-src/ # Package source (registry + types)
└── pkg-dist/ # Built npm package (dh-lit-actions)Two-Phase System
Phase 1: LIT Actions Development & Deployment
- Source:
src/*.ts- TypeScript LIT Actions - Build:
out/*.js- Compiled JavaScript - Minify:
dist/*.action.js- Minified for IPFS deployment - Upload: Deploy to IPFS via Pinata
Phase 2: NPM Package Generation
- Package Source:
pkg-src/- Registry and types - Package Build:
pkg-dist/- Compiled npm package - Package Name:
dh-lit-actions- Published to npm
Commands
Development Commands
npm run clean # Clean out/ and dist/
npm run build # Build src/ → out/ (TypeScript compilation)
npm run minify # Minify out/ → dist/ (deployment-ready)
npm run upload # Upload dist/ to IPFS (mock mode by default)
npm run deploy # Full deployment pipeline (clean + build + minify + upload)Package Commands
npm run clean:pkg # Clean pkg-dist/
npm run build:package # Update registry + build pkg-src/ → pkg-dist/
npm run package # Full package build (clean:pkg + build:package)
npm run release # Complete release (deploy + package)Environment Setup
Copy the example configuration:
cp .env.example .envConfigure for your needs:
Mock Mode (Development - Default)
MOCK_MODE=true
DEBUG_BUILD=falseProduction Mode (Real Pinata Upload)
PINATA_JWT=your_pinata_jwt_token_here
MOCK_MODE=false
DEBUG_BUILD=falseGetting Pinata JWT
- Go to Pinata Keys
- Create a new API key
- Select Admin permissions or at minimum:
pinFileToIPFSpinJSONToIPFS
- Copy the JWT Token (not API Key/Secret)
- Add to your
.envfile asPINATA_JWT
Build Commands
# Clean build
npm run clean
# Build LIT Actions (with debug)
DEBUG_BUILD=true npm run build
# Upload to IPFS (mock mode)
npm run upload
# Build + Upload
npm run deployMock Mode Quality
Our mock mode is very good for development:
- ✅ Deterministic: Same content = same CID
- ✅ Realistic Format: Proper IPFS CID format (
Qm...) - ✅ Reproducible: Perfect for testing
- ✅ Hash-based: Content integrity guaranteed
- ✅ Offline Ready: No network dependencies
Mock CID Example: Qmd75a736b6ea15647bc551d8c55c6481acba3b2bcbc63
The mock system generates CIDs based on content hash, so:
- Same TypeScript source → Same built JS → Same mock CID
- Perfect for development and testing
- Switch to real Pinata when ready for deployment