@gvnrdao/dh-lit-ops 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.md +197 -0
  2. package/dist/constants/chunks/pkp-data.d.ts +28 -0
  3. package/dist/constants/chunks/pkp-data.d.ts.map +1 -0
  4. package/dist/constants/chunks/pkp-data.js +86 -0
  5. package/dist/constants/chunks/pkp-data.js.map +1 -0
  6. package/dist/constants/index.d.ts +8 -0
  7. package/dist/constants/index.d.ts.map +1 -0
  8. package/dist/constants/index.js +25 -0
  9. package/dist/constants/index.js.map +1 -0
  10. package/dist/index.d.ts +30 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +63 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/interfaces/chunks/authentication.d.ts +29 -0
  15. package/dist/interfaces/chunks/authentication.d.ts.map +1 -0
  16. package/dist/interfaces/chunks/authentication.js +7 -0
  17. package/dist/interfaces/chunks/authentication.js.map +1 -0
  18. package/dist/interfaces/chunks/config.d.ts +52 -0
  19. package/dist/interfaces/chunks/config.d.ts.map +1 -0
  20. package/dist/interfaces/chunks/config.js +7 -0
  21. package/dist/interfaces/chunks/config.js.map +1 -0
  22. package/dist/interfaces/chunks/lit-action-execution.d.ts +27 -0
  23. package/dist/interfaces/chunks/lit-action-execution.d.ts.map +1 -0
  24. package/dist/interfaces/chunks/lit-action-execution.js +7 -0
  25. package/dist/interfaces/chunks/lit-action-execution.js.map +1 -0
  26. package/dist/interfaces/chunks/pkp-operations.d.ts +143 -0
  27. package/dist/interfaces/chunks/pkp-operations.d.ts.map +1 -0
  28. package/dist/interfaces/chunks/pkp-operations.js +3 -0
  29. package/dist/interfaces/chunks/pkp-operations.js.map +1 -0
  30. package/dist/interfaces/index.d.ts +11 -0
  31. package/dist/interfaces/index.d.ts.map +1 -0
  32. package/dist/interfaces/index.js +31 -0
  33. package/dist/interfaces/index.js.map +1 -0
  34. package/dist/modules/action-executor.module.d.ts +34 -0
  35. package/dist/modules/action-executor.module.d.ts.map +1 -0
  36. package/dist/modules/action-executor.module.js +231 -0
  37. package/dist/modules/action-executor.module.js.map +1 -0
  38. package/dist/modules/auth-manager.module.d.ts +24 -0
  39. package/dist/modules/auth-manager.module.d.ts.map +1 -0
  40. package/dist/modules/auth-manager.module.js +103 -0
  41. package/dist/modules/auth-manager.module.js.map +1 -0
  42. package/dist/modules/client-manager.module.d.ts +64 -0
  43. package/dist/modules/client-manager.module.d.ts.map +1 -0
  44. package/dist/modules/client-manager.module.js +213 -0
  45. package/dist/modules/client-manager.module.js.map +1 -0
  46. package/dist/modules/lit-ops.module.d.ts +261 -0
  47. package/dist/modules/lit-ops.module.d.ts.map +1 -0
  48. package/dist/modules/lit-ops.module.js +792 -0
  49. package/dist/modules/lit-ops.module.js.map +1 -0
  50. package/dist/modules/pkp-authorizer.module.d.ts +72 -0
  51. package/dist/modules/pkp-authorizer.module.d.ts.map +1 -0
  52. package/dist/modules/pkp-authorizer.module.js +126 -0
  53. package/dist/modules/pkp-authorizer.module.js.map +1 -0
  54. package/dist/modules/pkp-macros.module.d.ts +188 -0
  55. package/dist/modules/pkp-macros.module.d.ts.map +1 -0
  56. package/dist/modules/pkp-macros.module.js +656 -0
  57. package/dist/modules/pkp-macros.module.js.map +1 -0
  58. package/dist/modules/pkp-manager.module.d.ts +56 -0
  59. package/dist/modules/pkp-manager.module.d.ts.map +1 -0
  60. package/dist/modules/pkp-manager.module.js +304 -0
  61. package/dist/modules/pkp-manager.module.js.map +1 -0
  62. package/dist/modules/pkp-minter.module.d.ts +66 -0
  63. package/dist/modules/pkp-minter.module.d.ts.map +1 -0
  64. package/dist/modules/pkp-minter.module.js +185 -0
  65. package/dist/modules/pkp-minter.module.js.map +1 -0
  66. package/dist/modules/pkp-signer.module.d.ts +56 -0
  67. package/dist/modules/pkp-signer.module.d.ts.map +1 -0
  68. package/dist/modules/pkp-signer.module.js +148 -0
  69. package/dist/modules/pkp-signer.module.js.map +1 -0
  70. package/dist/modules/session-signature-manager.module.d.ts +32 -0
  71. package/dist/modules/session-signature-manager.module.d.ts.map +1 -0
  72. package/dist/modules/session-signature-manager.module.js +123 -0
  73. package/dist/modules/session-signature-manager.module.js.map +1 -0
  74. package/package.json +61 -0
package/README.md ADDED
@@ -0,0 +1,197 @@
1
+ # LIT-OPS Package
2
+
3
+ **Diamond Hands Protocol - LIT Protocol Operations**
4
+
5
+ Decoupled LIT Protocol operations supporting both standalone and service modes.
6
+
7
+ ## 🎯 Purpose
8
+
9
+ This package provides a clean separation of LIT Protocol operations from the main SDK, enabling:
10
+
11
+ 1. **Standalone Mode**: Users pay LIT tokens directly with their private keys
12
+ 2. **Service Mode**: Backend service handles LIT token costs centrally
13
+
14
+ ## 🏗️ Architecture
15
+
16
+ ```
17
+ lit-ops/
18
+ ├── src/
19
+ │ ├── client/ # LIT client management
20
+ │ ├── auth/ # SessionSigs & authentication
21
+ │ ├── pkp/ # PKP operations (mint, validate, burn)
22
+ │ ├── actions/ # LIT Action execution
23
+ │ ├── interfaces/ # Type definitions
24
+ │ └── index.ts # Main exports
25
+ ├── package.json
26
+ └── README.md
27
+ ```
28
+
29
+ ## 🚀 Usage
30
+
31
+ ### Basic Setup
32
+
33
+ ```typescript
34
+ import { LitOps } from "@diamond-hands/lit-ops";
35
+
36
+ // Standalone mode (user pays)
37
+ const wallet = ethers.Wallet.createRandom();
38
+ const litOps = new LitOps({
39
+ mode: "standalone",
40
+ network: "datil-test",
41
+ signer: wallet,
42
+ debug: true,
43
+ });
44
+
45
+ // Service mode (backend pays) - Future
46
+ const litOps = new LitOps({
47
+ mode: "service",
48
+ signer: wallet,
49
+ network: "datil-test",
50
+ serviceEndpoint: "https://api.diamond-hands.com",
51
+ debug: false,
52
+ });
53
+ ```
54
+
55
+ ### PKP Operations
56
+
57
+ ```typescript
58
+ // Create PKP
59
+ const pkpResult = await litOps.createPKP(signer, litActionCid);
60
+
61
+ // Validate PKP
62
+ const validation = await litOps.validatePKP(pkpId, signer);
63
+
64
+ // Burn PKP
65
+ const burnResult = await litOps.burnPKP(pkpId, signer, "liquidation");
66
+ ```
67
+
68
+ ### LIT Action Execution
69
+
70
+ ```typescript
71
+ // Execute from CID (deployed LIT Action)
72
+ const result = await litOps.executeActionFromCID(
73
+ "bafkreidxcjah2ogybxm5do5yvvy6z6klr4zca6vwvcyni4qmmtj6loef4q",
74
+ pkpPublicKey,
75
+ { message: "test" },
76
+ signer
77
+ );
78
+
79
+ // Execute from code
80
+ const result = await litOps.executeActionFromCode(
81
+ litActionCode,
82
+ pkpPublicKey,
83
+ { message: "test" },
84
+ signer
85
+ );
86
+ ```
87
+
88
+ ## 🔧 Configuration
89
+
90
+ ```typescript
91
+ interface LitOpsConfig {
92
+ mode: "standalone" | "service";
93
+ network: "datil-test" | "datil";
94
+ debug?: boolean;
95
+ serviceEndpoint?: string;
96
+ domain?: string;
97
+ sessionExpirationMinutes?: number;
98
+ }
99
+ ```
100
+
101
+ ## 📦 Integration
102
+
103
+ ### In SDK
104
+
105
+ ```typescript
106
+ // sdk/src/modules/PKPManager.ts
107
+ import { LitOps } from "../../lit-ops";
108
+
109
+ export class PKPManager {
110
+ private litOps: LitOps;
111
+
112
+ constructor(config: SDKConfig) {
113
+ this.litOps = new LitOps({
114
+ mode: config.litMode || "standalone",
115
+ network: config.litNetwork,
116
+ signer: config.signer, // Add signer to SDK config
117
+ debug: config.debug,
118
+ });
119
+ }
120
+ }
121
+ ```
122
+
123
+ ### In Backend Service
124
+
125
+ ```typescript
126
+ // backend-service/routes/lit.ts
127
+ import { LitOps } from "../lit-ops";
128
+
129
+ const serviceSigner = ethers.Wallet.fromMnemonic(process.env.SERVICE_MNEMONIC);
130
+ const litOps = new LitOps({
131
+ mode: "service",
132
+ network: "datil-test",
133
+ signer: serviceSigner,
134
+ });
135
+
136
+ app.post("/api/lit/create-pkp", async (req, res) => {
137
+ const result = await litOps.createPKP();
138
+ res.json(result);
139
+ });
140
+ ```
141
+
142
+ ## 🔄 Operation Modes
143
+
144
+ ### Standalone Mode
145
+
146
+ - User provides their own signer
147
+ - User pays LIT token costs
148
+ - Direct LIT Protocol interaction
149
+ - Full decentralization
150
+
151
+ ### Service Mode (Future)
152
+
153
+ - Backend service handles LIT operations
154
+ - Centralized LIT token payment
155
+ - API-based interaction
156
+ - Simplified user experience
157
+
158
+ ## 🧪 Development
159
+
160
+ ```bash
161
+ # Install dependencies
162
+ npm install
163
+
164
+ # Build package
165
+ npm run build
166
+
167
+ # Run tests
168
+ npm test
169
+
170
+ # Watch mode
171
+ npm run dev
172
+ ```
173
+
174
+ ## 📝 Status
175
+
176
+ - ✅ **Standalone Mode**: Implemented
177
+ - ✅ **PKP Operations**: Mock implementation ready
178
+ - ✅ **LIT Action Execution**: Real execution from CID
179
+ - ✅ **SessionSigs Authentication**: Working
180
+ - ⏳ **Service Mode**: Future implementation
181
+ - ⏳ **Real PKP Minting**: Will replace mock implementation
182
+
183
+ ## 🔗 Dependencies
184
+
185
+ - `@lit-protocol/lit-node-client`
186
+ - `@lit-protocol/auth-helpers`
187
+ - `@lit-protocol/constants`
188
+ - `ethers`
189
+ - `axios`
190
+
191
+ ## 🎯 Benefits
192
+
193
+ 1. **Separation of Concerns**: LIT operations isolated from business logic
194
+ 2. **Reusability**: Same code in SDK and backend service
195
+ 3. **Cost Flexibility**: Support both payment models
196
+ 4. **Maintainability**: Single place for LIT Protocol interactions
197
+ 5. **Testing**: Isolated testing of LIT operations
@@ -0,0 +1,28 @@
1
+ /**
2
+ * PKP Data Constants
3
+ *
4
+ * Environment-agnostic PKP constants following golden source principles:
5
+ * - Pure constants only
6
+ * - No environment detection
7
+ * - No external dependencies
8
+ * - Consumer determines which constants to use
9
+ */
10
+ import type { PKPData } from "../../interfaces/chunks/pkp-operations";
11
+ /**
12
+ * DATIL-TEST PKP CONSTANTS
13
+ *
14
+ * FRESH PKP Data from production workflow test run on datil-test (2025-08-18T16:01:09)
15
+ * IMPORTANT: This PKP is IMMUTABLE via transfer to burn address (not actual burn)
16
+ */
17
+ export declare const DATIL_TEST_PKP: PKPData;
18
+ /**
19
+ * DATIL PRODUCTION PKP CONSTANTS
20
+ *
21
+ * Production PKP data - pure constants, no external dependencies
22
+ */
23
+ export declare const DATIL_PKP: PKPData;
24
+ /**
25
+ * DEFAULT PKP for testing (most commonly used)
26
+ */
27
+ export declare const DEFAULT_PKP: PKPData;
28
+ //# sourceMappingURL=pkp-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pkp-data.d.ts","sourceRoot":"","sources":["../../../src/constants/chunks/pkp-data.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAC;AAEtE;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,OAuC5B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,OAuCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,SAAiB,CAAC"}
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ /**
3
+ * PKP Data Constants
4
+ *
5
+ * Environment-agnostic PKP constants following golden source principles:
6
+ * - Pure constants only
7
+ * - No environment detection
8
+ * - No external dependencies
9
+ * - Consumer determines which constants to use
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.DEFAULT_PKP = exports.DATIL_PKP = exports.DATIL_TEST_PKP = void 0;
13
+ /**
14
+ * DATIL-TEST PKP CONSTANTS
15
+ *
16
+ * FRESH PKP Data from production workflow test run on datil-test (2025-08-18T16:01:09)
17
+ * IMPORTANT: This PKP is IMMUTABLE via transfer to burn address (not actual burn)
18
+ */
19
+ exports.DATIL_TEST_PKP = {
20
+ // PKP Identity
21
+ tokenId: "0x2b8249eb77012b22940fe3497c252cc9f1f47dac5242d89abf9c91de13173783",
22
+ publicKey: "0x048d913837828177e5ada25545327b403611bb8bebb0de7ae84d5f2af96921ee5cd9baf43f567f57a31618c5bdb66b3546368ec1045c1ab5a796f5dca18f258324",
23
+ ethAddress: "0x654C216032746b7f25A8Da269cbD7340b625fDA9",
24
+ // Authorization Details - Pure constants, no external dependencies
25
+ authorizedCid: "0x12203f11a8283b27376dd57e90a3e3d7cfb66be7756c2a7d2993c714c7cb04c53180", // Diamond Hands Action CID
26
+ authorizedCidHex: "0x12203f11a8283b27376dd57e90a3e3d7cfb66be7756c2a7d2993c714c7cb04c53180",
27
+ authorizedCidStored: "0x12203f11a8283b27376dd57e90a3e3d7cfb66be7756c2a7d2993c714c7cb04c53180",
28
+ permittedActionsCount: 1, // Only authorized for Diamond Hands Action
29
+ // Transaction Details
30
+ createTransactionHash: "0x3ca003a3bca430b1267a0b356a91a058b8132863169bf771d4a0921ddf28b9c0",
31
+ burnTransactionHash: "0xdc54c49ec95869e037c8d6b85163c9725424bc3a6e4a919727b3aa1856146e88",
32
+ burnGasUsed: 91346,
33
+ blockNumber: 5052309,
34
+ // PKP Status
35
+ exists: true,
36
+ burned: true, // "burned" means immutable in our context
37
+ verified: true,
38
+ // Workflow Info
39
+ createdAt: "2025-08-18T16:01:09.000Z",
40
+ network: "datil-test",
41
+ workflow: "create-authorize-make-immutable",
42
+ duration: 14399,
43
+ // Security Status
44
+ isImmutable: true, // PKP is immutable (owned by burn address)
45
+ isProductionReady: true, // Only authorized action can sign
46
+ creatorCanModify: false, // Creator can no longer modify or add signers
47
+ };
48
+ /**
49
+ * DATIL PRODUCTION PKP CONSTANTS
50
+ *
51
+ * Production PKP data - pure constants, no external dependencies
52
+ */
53
+ exports.DATIL_PKP = {
54
+ // PKP Identity - Production values to be updated when available
55
+ tokenId: "0xf2b9cd578dec86d928d001eb94c58735dbf30ac088dd41ba1be824475d4cb8f3",
56
+ publicKey: "0x041a4c73c35215b50fb3708e4ad8cbd0ebf67231fb25e4e095f9f1dcb70f408ab24d28a8460ef436786e66c967d7ebf1d3f3e6441fd661afd9dc7d4f2c1d416f59",
57
+ ethAddress: "0x3743da41cecF75f523daF2a81350E22D35Eb9016",
58
+ // Authorization Details - Pure constants
59
+ authorizedCid: "0x12203f11a8283b27376dd57e90a3e3d7cfb66be7756c2a7d2993c714c7cb04c53180", // PKP Validator Action CID
60
+ authorizedCidHex: "0x12203f11a8283b27376dd57e90a3e3d7cfb66be7756c2a7d2993c714c7cb04c53180",
61
+ authorizedCidStored: "0x12203f11a8283b27376dd57e90a3e3d7cfb66be7756c2a7d2993c714c7cb04c53180",
62
+ permittedActionsCount: 1,
63
+ // Transaction Details - To be updated when available
64
+ createTransactionHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
65
+ burnTransactionHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
66
+ burnGasUsed: 0,
67
+ blockNumber: 0,
68
+ // PKP Status
69
+ exists: true, // Assume exists since we have the PKP data
70
+ burned: false, // To be determined
71
+ verified: true, // Assume verified since it's in production
72
+ // Workflow Info
73
+ createdAt: "1970-01-01T00:00:00.000Z", // To be updated when available
74
+ network: "datil",
75
+ workflow: "production-pkp",
76
+ duration: 0,
77
+ // Security Status
78
+ isImmutable: false, // To be determined
79
+ isProductionReady: true, // Assume ready for production use
80
+ creatorCanModify: true, // To be determined
81
+ };
82
+ /**
83
+ * DEFAULT PKP for testing (most commonly used)
84
+ */
85
+ exports.DEFAULT_PKP = exports.DATIL_TEST_PKP;
86
+ //# sourceMappingURL=pkp-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pkp-data.js","sourceRoot":"","sources":["../../../src/constants/chunks/pkp-data.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAIH;;;;;GAKG;AACU,QAAA,cAAc,GAAY;IACrC,eAAe;IACf,OAAO,EAAE,oEAAoE;IAC7E,SAAS,EACP,sIAAsI;IACxI,UAAU,EAAE,4CAA4C;IAExD,mEAAmE;IACnE,aAAa,EACX,wEAAwE,EAAE,2BAA2B;IACvG,gBAAgB,EACd,wEAAwE;IAC1E,mBAAmB,EACjB,wEAAwE;IAC1E,qBAAqB,EAAE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AAE,IAAI,EAAE,kCAAkC;IAC3D,gBAAgB,EAAE,IAAI,EAAE,mBAAmB;CAC5C,CAAC;AAEF;;GAEG;AACU,QAAA,WAAW,GAAG,sBAAc,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * LIT-OPS Package Constants
3
+ * All constants used in the package
4
+ *
5
+ * Following the golden source pattern with organized chunks
6
+ */
7
+ export * from "./chunks/pkp-data";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ /**
3
+ * LIT-OPS Package Constants
4
+ * All constants used in the package
5
+ *
6
+ * Following the golden source pattern with organized chunks
7
+ */
8
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
+ if (k2 === undefined) k2 = k;
10
+ var desc = Object.getOwnPropertyDescriptor(m, k);
11
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
12
+ desc = { enumerable: true, get: function() { return m[k]; } };
13
+ }
14
+ Object.defineProperty(o, k2, desc);
15
+ }) : (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ o[k2] = m[k];
18
+ }));
19
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
20
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
21
+ };
22
+ Object.defineProperty(exports, "__esModule", { value: true });
23
+ // PKP Data Constants
24
+ __exportStar(require("./chunks/pkp-data"), exports);
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,qBAAqB;AACrB,oDAAkC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * lit-ops Package
3
+ * Diamond Hands Protocol - LIT Protocol Operations
4
+ *
5
+ * Provides decoupled LIT Protocol operations supporting:
6
+ * - Standalone mode: User pays LIT tokens directly
7
+ * - Service mode: Backend service handles LIT token costs
8
+ *
9
+ * PRIMARY ENTRY POINT: PKPMacros for common workflows
10
+ */
11
+ export * from "./interfaces";
12
+ export * from "./constants";
13
+ export { PKPMacros, PKPMacroUtils } from "./modules/pkp-macros.module";
14
+ export { LitOps } from "./modules/lit-ops.module";
15
+ export { LitClientManager } from "./modules/client-manager.module";
16
+ export { SessionSignatureManager } from "./modules/session-signature-manager.module";
17
+ export { LitAuthManager } from "./modules/auth-manager.module";
18
+ export { LitActionExecutor } from "./modules/action-executor.module";
19
+ export { PKPManager } from "./modules/pkp-manager.module";
20
+ export { PKPMinter, PKPMinterUtils } from "./modules/pkp-minter.module";
21
+ export { PKPAuthorizer, PKPAuthorizerUtils, } from "./modules/pkp-authorizer.module";
22
+ export { PKPSigner } from "./modules/pkp-signer.module";
23
+ export type { PKPSigningRequest, PKPSigningResult, } from "./modules/pkp-signer.module";
24
+ export type { PKPMacroConfig, PKPCompleteWorkflowResult, } from "./modules/pkp-macros.module";
25
+ export type { PKPMintResult, PKPMintOptions, } from "./modules/pkp-minter.module";
26
+ export type { PKPAuthorizationOptions, PKPAuthorizationResult, PKPPermissionCheck, } from "./modules/pkp-authorizer.module";
27
+ export type { ClientConfig } from "./modules/client-manager.module";
28
+ export type { PKPCreationAndValidationResult, BaseResult, ExtendedPKPData, PKPSecurityValidationResult, AuditStep, AuditTrail, } from "./interfaces/chunks/pkp-operations";
29
+ export { LitOps as default } from "./modules/lit-ops.module";
30
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,cAAc,cAAc,CAAC;AAG7B,cAAc,aAAa,CAAC;AAI5B,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAGvE,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAGlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAGrE,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EACL,aAAa,EACb,kBAAkB,GACnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAGxD,YAAY,EACV,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,cAAc,EACd,yBAAyB,GAC1B,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,aAAa,EACb,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,iCAAiC,CAAC;AACzC,YAAY,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAGpE,YAAY,EACV,8BAA8B,EAC9B,UAAU,EACV,eAAe,EACf,2BAA2B,EAC3B,SAAS,EACT,UAAU,GACX,MAAM,oCAAoC,CAAC;AAG5C,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,0BAA0B,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ /**
3
+ * lit-ops Package
4
+ * Diamond Hands Protocol - LIT Protocol Operations
5
+ *
6
+ * Provides decoupled LIT Protocol operations supporting:
7
+ * - Standalone mode: User pays LIT tokens directly
8
+ * - Service mode: Backend service handles LIT token costs
9
+ *
10
+ * PRIMARY ENTRY POINT: PKPMacros for common workflows
11
+ */
12
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ var desc = Object.getOwnPropertyDescriptor(m, k);
15
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
16
+ desc = { enumerable: true, get: function() { return m[k]; } };
17
+ }
18
+ Object.defineProperty(o, k2, desc);
19
+ }) : (function(o, m, k, k2) {
20
+ if (k2 === undefined) k2 = k;
21
+ o[k2] = m[k];
22
+ }));
23
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
24
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.default = exports.PKPSigner = exports.PKPAuthorizerUtils = exports.PKPAuthorizer = exports.PKPMinterUtils = exports.PKPMinter = exports.PKPManager = exports.LitActionExecutor = exports.LitAuthManager = exports.SessionSignatureManager = exports.LitClientManager = exports.LitOps = exports.PKPMacroUtils = exports.PKPMacros = void 0;
28
+ // === Export interfaces ===
29
+ __exportStar(require("./interfaces"), exports);
30
+ // === Export constants ===
31
+ __exportStar(require("./constants"), exports);
32
+ // === Export modules (Golden Source Standard) ===
33
+ // Primary Macros (Most Important)
34
+ var pkp_macros_module_1 = require("./modules/pkp-macros.module");
35
+ Object.defineProperty(exports, "PKPMacros", { enumerable: true, get: function () { return pkp_macros_module_1.PKPMacros; } });
36
+ Object.defineProperty(exports, "PKPMacroUtils", { enumerable: true, get: function () { return pkp_macros_module_1.PKPMacroUtils; } });
37
+ // Main LitOps Class
38
+ var lit_ops_module_1 = require("./modules/lit-ops.module");
39
+ Object.defineProperty(exports, "LitOps", { enumerable: true, get: function () { return lit_ops_module_1.LitOps; } });
40
+ // Core Modules
41
+ var client_manager_module_1 = require("./modules/client-manager.module");
42
+ Object.defineProperty(exports, "LitClientManager", { enumerable: true, get: function () { return client_manager_module_1.LitClientManager; } });
43
+ var session_signature_manager_module_1 = require("./modules/session-signature-manager.module");
44
+ Object.defineProperty(exports, "SessionSignatureManager", { enumerable: true, get: function () { return session_signature_manager_module_1.SessionSignatureManager; } });
45
+ var auth_manager_module_1 = require("./modules/auth-manager.module");
46
+ Object.defineProperty(exports, "LitAuthManager", { enumerable: true, get: function () { return auth_manager_module_1.LitAuthManager; } });
47
+ var action_executor_module_1 = require("./modules/action-executor.module");
48
+ Object.defineProperty(exports, "LitActionExecutor", { enumerable: true, get: function () { return action_executor_module_1.LitActionExecutor; } });
49
+ // PKP Modules
50
+ var pkp_manager_module_1 = require("./modules/pkp-manager.module");
51
+ Object.defineProperty(exports, "PKPManager", { enumerable: true, get: function () { return pkp_manager_module_1.PKPManager; } });
52
+ var pkp_minter_module_1 = require("./modules/pkp-minter.module");
53
+ Object.defineProperty(exports, "PKPMinter", { enumerable: true, get: function () { return pkp_minter_module_1.PKPMinter; } });
54
+ Object.defineProperty(exports, "PKPMinterUtils", { enumerable: true, get: function () { return pkp_minter_module_1.PKPMinterUtils; } });
55
+ var pkp_authorizer_module_1 = require("./modules/pkp-authorizer.module");
56
+ Object.defineProperty(exports, "PKPAuthorizer", { enumerable: true, get: function () { return pkp_authorizer_module_1.PKPAuthorizer; } });
57
+ Object.defineProperty(exports, "PKPAuthorizerUtils", { enumerable: true, get: function () { return pkp_authorizer_module_1.PKPAuthorizerUtils; } });
58
+ var pkp_signer_module_1 = require("./modules/pkp-signer.module");
59
+ Object.defineProperty(exports, "PKPSigner", { enumerable: true, get: function () { return pkp_signer_module_1.PKPSigner; } });
60
+ // === Default export ===
61
+ var lit_ops_module_2 = require("./modules/lit-ops.module");
62
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return lit_ops_module_2.LitOps; } });
63
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;;;;;;;;;;;;;;AAEH,4BAA4B;AAC5B,+CAA6B;AAE7B,2BAA2B;AAC3B,8CAA4B;AAE5B,kDAAkD;AAClD,kCAAkC;AAClC,iEAAuE;AAA9D,8GAAA,SAAS,OAAA;AAAE,kHAAA,aAAa,OAAA;AAEjC,oBAAoB;AACpB,2DAAkD;AAAzC,wGAAA,MAAM,OAAA;AAEf,eAAe;AACf,yEAAmE;AAA1D,yHAAA,gBAAgB,OAAA;AACzB,+FAAqF;AAA5E,2IAAA,uBAAuB,OAAA;AAChC,qEAA+D;AAAtD,qHAAA,cAAc,OAAA;AACvB,2EAAqE;AAA5D,2HAAA,iBAAiB,OAAA;AAE1B,cAAc;AACd,mEAA0D;AAAjD,gHAAA,UAAU,OAAA;AACnB,iEAAwE;AAA/D,8GAAA,SAAS,OAAA;AAAE,mHAAA,cAAc,OAAA;AAClC,yEAGyC;AAFvC,sHAAA,aAAa,OAAA;AACb,2HAAA,kBAAkB,OAAA;AAEpB,iEAAwD;AAA/C,8GAAA,SAAS,OAAA;AAgClB,yBAAyB;AACzB,2DAA6D;AAApD,yGAAA,MAAM,OAAW"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Session & Authentication Types
3
+ * Interfaces for session management and authentication
4
+ */
5
+ import { ethers as ethers5 } from "ethers";
6
+ export interface SessionSigsRequest {
7
+ signer: ethers5.Signer;
8
+ domain?: string;
9
+ expirationMinutes?: number;
10
+ }
11
+ export interface SessionSigsResult {
12
+ success: boolean;
13
+ sessionSigs?: any;
14
+ error?: string;
15
+ expiresAt?: number;
16
+ }
17
+ export interface ServiceAuthRequest {
18
+ endpoint: string;
19
+ userId: string;
20
+ operation: string;
21
+ payload: any;
22
+ }
23
+ export interface ServiceAuthResult {
24
+ success: boolean;
25
+ data?: any;
26
+ error?: string;
27
+ timestamp: number;
28
+ }
29
+ //# sourceMappingURL=authentication.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authentication.d.ts","sourceRoot":"","sources":["../../../src/interfaces/chunks/authentication.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,QAAQ,CAAC;AAE3C,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,GAAG,CAAC;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * Session & Authentication Types
4
+ * Interfaces for session management and authentication
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=authentication.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authentication.js","sourceRoot":"","sources":["../../../src/interfaces/chunks/authentication.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * LIT-OPS Configuration Types
3
+ * Core configuration interfaces for LIT Protocol operations
4
+ */
5
+ import { ethers as ethers5 } from "ethers";
6
+ import type { LitClientManager } from "../../modules/client-manager.module";
7
+ import type { PKPManager } from "../../modules/pkp-manager.module";
8
+ import type { LitActionExecutor } from "../../modules/action-executor.module";
9
+ import type { LitAuthManager } from "../../modules/auth-manager.module";
10
+ import type { PKPSigner } from "../../modules/pkp-signer.module";
11
+ import type { PKPMacroUtils } from "../../modules/pkp-macros.module";
12
+ import type { PKPMinter } from "../../modules/pkp-minter.module";
13
+ import type { PKPAuthorizer } from "../../modules/pkp-authorizer.module";
14
+ import type { SessionSignatureManager } from "../../modules/session-signature-manager.module";
15
+ export type LitOpsMode = "standalone" | "service";
16
+ export type LitNetwork = "datil-test" | "datil";
17
+ export interface LitOpsSharedDependencies {
18
+ clientManager?: LitClientManager;
19
+ pkpManager?: PKPManager;
20
+ actionExecutor?: LitActionExecutor;
21
+ authManager?: LitAuthManager;
22
+ pkpSigner?: PKPSigner;
23
+ pkpMacroUtils?: PKPMacroUtils;
24
+ pkpMinter?: PKPMinter;
25
+ pkpAuthorizer?: PKPAuthorizer;
26
+ sessionManager?: SessionSignatureManager;
27
+ }
28
+ export interface LitOpsConfig {
29
+ /** Operation mode: standalone (user pays) or service (backend pays) */
30
+ mode: LitOpsMode;
31
+ /** LIT Protocol network (required for standalone mode) */
32
+ network?: LitNetwork;
33
+ /** Wallet for PKP operations and transactions (required for standalone mode) */
34
+ signer?: ethers5.Wallet;
35
+ /** Debug logging enabled */
36
+ debug?: boolean;
37
+ /** Service endpoint for service mode (required for service mode) */
38
+ serviceEndpoint?: string;
39
+ /** Custom domain for SIWE messages */
40
+ domain?: string;
41
+ /** Session expiration in minutes */
42
+ sessionExpirationMinutes?: number;
43
+ /** Delay in milliseconds to allow PKP immutability verification across LIT Protocol network nodes */
44
+ pkpImmutabilityVerificationDelayMs?: number;
45
+ /** Shared dependencies for singleton pattern */
46
+ sharedDependencies?: LitOpsSharedDependencies;
47
+ }
48
+ export interface LitClientConfig {
49
+ network: LitNetwork;
50
+ debug?: boolean;
51
+ }
52
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceR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,UAAU,CAAC;IAErB,gFAAgF;IAChF,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC;IAExB,4BAA4B;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,oEAAoE;IACpE,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,oCAAoC;IACpC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAElC,qGAAqG;IACrG,kCAAkC,CAAC,EAAE,MAAM,CAAC;IAE5C,gDAAgD;IAChD,kBAAkB,CAAC,EAAE,wBAAwB,CAAC;CAC/C;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,UAAU,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * LIT-OPS Configuration Types
4
+ * Core configuration interfaces for LIT Protocol operations
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/interfaces/chunks/config.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * LIT Action Execution Types
3
+ * Interfaces for LIT Action execution and results
4
+ */
5
+ import { ethers as ethers5 } from "ethers";
6
+ export interface LitActionExecutionRequest {
7
+ /** LIT Action code or CID */
8
+ code?: string;
9
+ cid?: string;
10
+ /** PKP public key for signing */
11
+ pkpPublicKey: string;
12
+ /** Parameters to pass to LIT Action */
13
+ params: Record<string, any>;
14
+ /** Signer for sessionSigs (standalone mode) */
15
+ signer?: ethers5.Signer;
16
+ /** User identifier (service mode) */
17
+ userId?: string;
18
+ }
19
+ export interface LitActionExecutionResult {
20
+ success: boolean;
21
+ response?: any;
22
+ logs?: string;
23
+ signatures?: Record<string, any>;
24
+ error?: string;
25
+ timestamp: number;
26
+ }
27
+ //# sourceMappingURL=lit-action-execution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lit-action-execution.d.ts","sourceRoot":"","sources":["../../../src/interfaces/chunks/lit-action-execution.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,QAAQ,CAAC;AAE3C,MAAM,WAAW,yBAAyB;IACxC,6BAA6B;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,iCAAiC;IACjC,YAAY,EAAE,MAAM,CAAC;IAErB,uCAAuC;IACvC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE5B,+CAA+C;IAC/C,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC;IAExB,qCAAqC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * LIT Action Execution Types
4
+ * Interfaces for LIT Action execution and results
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=lit-action-execution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lit-action-execution.js","sourceRoot":"","sources":["../../../src/interfaces/chunks/lit-action-execution.ts"],"names":[],"mappings":";AAAA;;;GAGG"}