npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gvnrdao/dh-lit-ops

v0.0.193

Published

Diamond Hands Protocol - LIT Protocol Operations Package

Readme

LIT-OPS Package

Diamond Hands Protocol - LIT Protocol Operations

Decoupled LIT Protocol operations supporting both standalone and service modes.

🎯 Purpose

This package provides a clean separation of LIT Protocol operations from the main SDK, enabling:

  1. Standalone Mode: Users pay LIT tokens directly with their private keys
  2. Service Mode: Backend service handles LIT token costs centrally

🏗️ Architecture

lit-ops/
├── src/
│   ├── client/          # LIT client management
│   ├── auth/            # SessionSigs & authentication
│   ├── pkp/             # PKP operations (mint, validate, burn)
│   ├── actions/         # LIT Action execution
│   ├── interfaces/      # Type definitions
│   └── index.ts         # Main exports
├── package.json
└── README.md

🚀 Usage

Basic Setup

import { LitOps } from "@diamond-hands/lit-ops";

// Standalone mode (user pays)
const wallet = ethers.Wallet.createRandom();
const litOps = new LitOps({
  mode: "standalone",
  network: "datil-test",
  signer: wallet,
  debug: true,
});

// Service mode (backend pays) - Future
const litOps = new LitOps({
  mode: "service",
  signer: wallet,
  network: "datil-test",
  serviceEndpoint: "https://api.diamond-hands.com",
  debug: false,
});

PKP Operations

// Create PKP
const pkpResult = await litOps.createPKP(signer, litActionCid);

// Validate PKP
const validation = await litOps.validatePKP(pkpId, signer);

// Burn PKP
const burnResult = await litOps.burnPKP(pkpId, signer, "liquidation");

LIT Action Execution

// Execute from CID (deployed LIT Action)
const result = await litOps.executeActionFromCID(
  "bafkreidxcjah2ogybxm5do5yvvy6z6klr4zca6vwvcyni4qmmtj6loef4q",
  pkpPublicKey,
  { message: "test" },
  signer
);

// Execute from code
const result = await litOps.executeActionFromCode(
  litActionCode,
  pkpPublicKey,
  { message: "test" },
  signer
);

🔧 Configuration

interface LitOpsConfig {
  mode: "standalone" | "service";
  network: "datil-test" | "datil";
  debug?: boolean;
  serviceEndpoint?: string;
  domain?: string;
  sessionExpirationMinutes?: number;
}

📦 Integration

In SDK

// sdk/src/modules/PKPManager.ts
import { LitOps } from "../../lit-ops";

export class PKPManager {
  private litOps: LitOps;

  constructor(config: SDKConfig) {
    this.litOps = new LitOps({
      mode: config.litMode || "standalone",
      network: config.litNetwork,
      signer: config.signer, // Add signer to SDK config
      debug: config.debug,
    });
  }
}

In Backend Service

// backend-service/routes/lit.ts
import { LitOps } from "../lit-ops";

const serviceSigner = ethers.Wallet.fromMnemonic(process.env.SERVICE_MNEMONIC);
const litOps = new LitOps({
  mode: "service",
  network: "datil-test",
  signer: serviceSigner,
});

app.post("/api/lit/create-pkp", async (req, res) => {
  const result = await litOps.createPKP();
  res.json(result);
});

🔄 Operation Modes

Standalone Mode

  • User provides their own signer
  • User pays LIT token costs
  • Direct LIT Protocol interaction
  • Full decentralization

Service Mode (Future)

  • Backend service handles LIT operations
  • Centralized LIT token payment
  • API-based interaction
  • Simplified user experience

🧪 Development

# Install dependencies
npm install

# Build package
npm run build

# Run tests
npm test

# Watch mode
npm run dev

📝 Status

  • Standalone Mode: Implemented
  • PKP Operations: Mock implementation ready
  • LIT Action Execution: Real execution from CID
  • SessionSigs Authentication: Working
  • Service Mode: Future implementation
  • Real PKP Minting: Will replace mock implementation

🔗 Dependencies

  • @lit-protocol/lit-node-client
  • @lit-protocol/auth-helpers
  • @lit-protocol/constants
  • ethers
  • axios

🎯 Benefits

  1. Separation of Concerns: LIT operations isolated from business logic
  2. Reusability: Same code in SDK and backend service
  3. Cost Flexibility: Support both payment models
  4. Maintainability: Single place for LIT Protocol interactions
  5. Testing: Isolated testing of LIT operations