JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 860
  • Score
    100M100P100Q110304F
  • License MIT

Diamond Hands Protocol LIT Actions - Deterministic, Auditable Builds

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

  1. Copy the example configuration:

    cp .env.example .env
  2. Configure for your needs:

Mock Mode (Development - Default)

MOCK_MODE=true
DEBUG_BUILD=false

Production Mode (Real Pinata Upload)

PINATA_JWT=your_pinata_jwt_token_here
MOCK_MODE=false
DEBUG_BUILD=false

Getting Pinata JWT

  1. Go to Pinata Keys
  2. Create a new API key
  3. Select Admin permissions or at minimum:
    • pinFileToIPFS
    • pinJSONToIPFS
  4. Copy the JWT Token (not API Key/Secret)
  5. Add to your .env file as PINATA_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 deploy

Mock 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