@gvnrdao/dh-lit-actions 0.0.226 → 0.0.279
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.
- package/README.md +423 -2
- package/dist/address-probe-signer.action.js +1 -0
- package/dist/address-probe-signer.hash +1 -0
- package/dist/address-probe-signer.meta.json +9 -0
- package/dist/address-probe.action.js +1 -0
- package/dist/address-probe.hash +1 -0
- package/dist/address-probe.meta.json +9 -0
- package/dist/admin-liquidation-validator.action.js +1 -1
- package/dist/admin-liquidation-validator.hash +1 -1
- package/dist/admin-liquidation-validator.meta.json +5 -5
- package/dist/always-signer.action.js +1 -1
- package/dist/always-signer.hash +1 -1
- package/dist/always-signer.meta.json +5 -5
- package/dist/authorization-dummy-b.action.js +1 -1
- package/dist/authorization-dummy-b.hash +1 -1
- package/dist/authorization-dummy-b.meta.json +5 -5
- package/dist/authorization-dummy.action.js +1 -1
- package/dist/authorization-dummy.hash +1 -1
- package/dist/authorization-dummy.meta.json +5 -5
- package/dist/btc-transaction-signer.action.js +1 -1
- package/dist/btc-transaction-signer.hash +1 -1
- package/dist/btc-transaction-signer.meta.json +5 -5
- package/dist/btc-withdrawal.action.js +1 -1
- package/dist/btc-withdrawal.hash +1 -1
- package/dist/btc-withdrawal.meta.json +5 -5
- package/dist/encrypt-parameter.action.js +1 -0
- package/dist/encrypt-parameter.hash +1 -0
- package/dist/encrypt-parameter.meta.json +9 -0
- package/dist/extend-position-validator.action.js +1 -1
- package/dist/extend-position-validator.hash +1 -1
- package/dist/extend-position-validator.meta.json +5 -5
- package/dist/liquidation-validator.action.js +1 -1
- package/dist/liquidation-validator.hash +1 -1
- package/dist/liquidation-validator.meta.json +5 -5
- package/dist/loan-vault-btc-balance.action.js +1 -1
- package/dist/loan-vault-btc-balance.hash +1 -1
- package/dist/loan-vault-btc-balance.meta.json +5 -5
- package/dist/pkp-validator.action.js +1 -0
- package/dist/pkp-validator.hash +1 -0
- package/dist/pkp-validator.meta.json +9 -0
- package/dist/price-oracle.action.js +1 -1
- package/dist/price-oracle.hash +1 -1
- package/dist/price-oracle.meta.json +5 -5
- package/dist/process-payment-sign-only.action.js +1 -1
- package/dist/process-payment-sign-only.hash +1 -1
- package/dist/process-payment-sign-only.meta.json +5 -5
- package/dist/process-payment-validator.action.js +1 -1
- package/dist/process-payment-validator.hash +1 -1
- package/dist/process-payment-validator.meta.json +5 -5
- package/dist/ucd-mint-validator.action.js +1 -1
- package/dist/ucd-mint-validator.hash +1 -1
- package/dist/ucd-mint-validator.meta.json +5 -5
- package/package.json +49 -18
- package/pkg-dist/pkg-src/constants/chunks/lit-actions-registry.d.ts +26 -2
- package/pkg-dist/pkg-src/constants/chunks/lit-actions-registry.d.ts.map +1 -1
- package/pkg-dist/pkg-src/constants/chunks/lit-actions-registry.js +699 -57
- package/pkg-dist/pkg-src/constants/chunks/lit-actions-registry.js.map +1 -1
- package/pkg-dist/pkg-src/executors/chunks/vault-snapshot-executor.d.ts +1 -0
- package/pkg-dist/pkg-src/executors/chunks/vault-snapshot-executor.d.ts.map +1 -1
- package/pkg-dist/pkg-src/executors/chunks/vault-snapshot-executor.js +1 -0
- package/pkg-dist/pkg-src/executors/chunks/vault-snapshot-executor.js.map +1 -1
- package/pkg-dist/pkg-src/index.d.ts +1 -1
- package/pkg-dist/pkg-src/index.d.ts.map +1 -1
- package/pkg-dist/pkg-src/index.js +3 -1
- package/pkg-dist/pkg-src/index.js.map +1 -1
- package/pkg-dist/pkg-src/interfaces/chunks/lit-action-config.i.d.ts +2 -0
- package/pkg-dist/pkg-src/interfaces/chunks/lit-action-config.i.d.ts.map +1 -1
- package/pkg-dist/pkg-src/interfaces/chunks/pkp-info.i.d.ts +10 -10
- package/pkg-dist/pkg-src/interfaces/chunks/pkp-info.i.d.ts.map +1 -1
- package/pkg-dist/pkg-src/utils/chunks/lit-action-helpers.d.ts +6 -5
- package/pkg-dist/pkg-src/utils/chunks/lit-action-helpers.d.ts.map +1 -1
- package/pkg-dist/pkg-src/utils/chunks/lit-action-helpers.js +16 -31
- package/pkg-dist/pkg-src/utils/chunks/lit-action-helpers.js.map +1 -1
- package/pkg-dist/pkg-src/utils/chunks/pkp-setup.d.ts +2 -1
- package/pkg-dist/pkg-src/utils/chunks/pkp-setup.d.ts.map +1 -1
- package/pkg-dist/pkg-src/utils/chunks/pkp-setup.js +9 -11
- package/pkg-dist/pkg-src/utils/chunks/pkp-setup.js.map +1 -1
- package/pkg-dist/src/constants/chunks/bitcoin-network-config.d.ts +12 -1
- package/pkg-dist/src/constants/chunks/bitcoin-network-config.d.ts.map +1 -1
- package/pkg-dist/src/constants/chunks/bitcoin-network-config.js +23 -31
- package/pkg-dist/src/constants/chunks/bitcoin-network-config.js.map +1 -1
- package/pkg-dist/src/constants/chunks/bitcoin.d.ts +42 -0
- package/pkg-dist/src/constants/chunks/bitcoin.d.ts.map +1 -1
- package/pkg-dist/src/constants/chunks/bitcoin.js +43 -1
- package/pkg-dist/src/constants/chunks/bitcoin.js.map +1 -1
- package/pkg-dist/src/constants/chunks/liquidation.d.ts +3 -11
- package/pkg-dist/src/constants/chunks/liquidation.d.ts.map +1 -1
- package/pkg-dist/src/constants/chunks/liquidation.js +4 -12
- package/pkg-dist/src/constants/chunks/liquidation.js.map +1 -1
- package/pkg-dist/src/constants/chunks/lit-action-runtime.d.ts +7 -0
- package/pkg-dist/src/constants/chunks/lit-action-runtime.d.ts.map +1 -0
- package/pkg-dist/src/constants/chunks/lit-action-runtime.js +10 -0
- package/pkg-dist/src/constants/chunks/lit-action-runtime.js.map +1 -0
- package/pkg-dist/src/constants/chunks/quantum-time.d.ts +16 -1
- package/pkg-dist/src/constants/chunks/quantum-time.d.ts.map +1 -1
- package/pkg-dist/src/constants/chunks/quantum-time.js +17 -2
- package/pkg-dist/src/constants/chunks/quantum-time.js.map +1 -1
- package/pkg-dist/src/constants/chunks/time.d.ts +50 -0
- package/pkg-dist/src/constants/chunks/time.d.ts.map +1 -0
- package/pkg-dist/src/constants/chunks/time.js +53 -0
- package/pkg-dist/src/constants/chunks/time.js.map +1 -0
- package/pkg-dist/src/constants/index.d.ts +7 -4
- package/pkg-dist/src/constants/index.d.ts.map +1 -1
- package/pkg-dist/src/constants/index.js +33 -2
- package/pkg-dist/src/constants/index.js.map +1 -1
- package/pkg-dist/src/constants/message-hash-domains.d.ts +36 -0
- package/pkg-dist/src/constants/message-hash-domains.d.ts.map +1 -0
- package/pkg-dist/src/constants/message-hash-domains.js +39 -0
- package/pkg-dist/src/constants/message-hash-domains.js.map +1 -0
- package/pkg-dist/src/interfaces/chunks/owner-authorization.d.ts +0 -1
- package/pkg-dist/src/interfaces/chunks/owner-authorization.d.ts.map +1 -1
- package/pkg-dist/src/interfaces/chunks/vault-snapshot.i.d.ts +9 -0
- package/pkg-dist/src/interfaces/chunks/vault-snapshot.i.d.ts.map +1 -1
- package/pkg-dist/src/modules/authorization.module.d.ts +26 -17
- package/pkg-dist/src/modules/authorization.module.d.ts.map +1 -1
- package/pkg-dist/src/modules/authorization.module.js +105 -119
- package/pkg-dist/src/modules/authorization.module.js.map +1 -1
- package/pkg-dist/src/modules/bitcoin/transaction.d.ts +31 -0
- package/pkg-dist/src/modules/bitcoin/transaction.d.ts.map +1 -1
- package/pkg-dist/src/modules/bitcoin/transaction.js +87 -0
- package/pkg-dist/src/modules/bitcoin/transaction.js.map +1 -1
- package/pkg-dist/src/modules/bitcoin-data-provider.module.d.ts.map +1 -1
- package/pkg-dist/src/modules/bitcoin-data-provider.module.js +67 -39
- package/pkg-dist/src/modules/bitcoin-data-provider.module.js.map +1 -1
- package/pkg-dist/src/modules/bitcoin-provider-registry.d.ts +67 -0
- package/pkg-dist/src/modules/bitcoin-provider-registry.d.ts.map +1 -0
- package/pkg-dist/src/modules/bitcoin-provider-registry.js +165 -0
- package/pkg-dist/src/modules/bitcoin-provider-registry.js.map +1 -0
- package/pkg-dist/src/modules/business-rules-math.module.d.ts +5 -3
- package/pkg-dist/src/modules/business-rules-math.module.d.ts.map +1 -1
- package/pkg-dist/src/modules/business-rules-math.module.js +14 -14
- package/pkg-dist/src/modules/business-rules-math.module.js.map +1 -1
- package/pkg-dist/src/modules/chain-policy.d.ts +53 -0
- package/pkg-dist/src/modules/chain-policy.d.ts.map +1 -0
- package/pkg-dist/src/modules/chain-policy.js +90 -0
- package/pkg-dist/src/modules/chain-policy.js.map +1 -0
- package/pkg-dist/src/modules/dev-action-guard.d.ts +35 -0
- package/pkg-dist/src/modules/dev-action-guard.d.ts.map +1 -0
- package/pkg-dist/src/modules/dev-action-guard.js +47 -0
- package/pkg-dist/src/modules/dev-action-guard.js.map +1 -0
- package/pkg-dist/src/modules/lit-action-debug.d.ts +27 -0
- package/pkg-dist/src/modules/lit-action-debug.d.ts.map +1 -0
- package/pkg-dist/src/modules/lit-action-debug.js +85 -0
- package/pkg-dist/src/modules/lit-action-debug.js.map +1 -0
- package/pkg-dist/src/modules/lit-action-logger.module.d.ts +1 -27
- package/pkg-dist/src/modules/lit-action-logger.module.d.ts.map +1 -1
- package/pkg-dist/src/modules/lit-action-logger.module.js +14 -8
- package/pkg-dist/src/modules/lit-action-logger.module.js.map +1 -1
- package/pkg-dist/src/modules/lit-global-bootstrap.d.ts +32 -0
- package/pkg-dist/src/modules/lit-global-bootstrap.d.ts.map +1 -0
- package/pkg-dist/src/modules/lit-global-bootstrap.js +67 -0
- package/pkg-dist/src/modules/lit-global-bootstrap.js.map +1 -0
- package/pkg-dist/src/modules/position-id.d.ts +18 -0
- package/pkg-dist/src/modules/position-id.d.ts.map +1 -0
- package/pkg-dist/src/modules/position-id.js +40 -0
- package/pkg-dist/src/modules/position-id.js.map +1 -0
- package/pkg-dist/src/modules/price-oracle.module.d.ts +73 -21
- package/pkg-dist/src/modules/price-oracle.module.d.ts.map +1 -1
- package/pkg-dist/src/modules/price-oracle.module.js +247 -182
- package/pkg-dist/src/modules/price-oracle.module.js.map +1 -1
- package/pkg-dist/src/modules/pro-rata-fee.module.d.ts +46 -0
- package/pkg-dist/src/modules/pro-rata-fee.module.d.ts.map +1 -0
- package/pkg-dist/src/modules/pro-rata-fee.module.js +66 -0
- package/pkg-dist/src/modules/pro-rata-fee.module.js.map +1 -0
- package/pkg-dist/src/modules/protocol-parameters.module.d.ts +11 -0
- package/pkg-dist/src/modules/protocol-parameters.module.d.ts.map +1 -1
- package/pkg-dist/src/modules/protocol-parameters.module.js +47 -3
- package/pkg-dist/src/modules/protocol-parameters.module.js.map +1 -1
- package/pkg-dist/src/modules/protocol-pause.module.d.ts +20 -0
- package/pkg-dist/src/modules/protocol-pause.module.d.ts.map +1 -0
- package/pkg-dist/src/modules/protocol-pause.module.js +227 -0
- package/pkg-dist/src/modules/protocol-pause.module.js.map +1 -0
- package/pkg-dist/src/modules/quantum-time.module.d.ts +22 -1
- package/pkg-dist/src/modules/quantum-time.module.d.ts.map +1 -1
- package/pkg-dist/src/modules/quantum-time.module.js +50 -5
- package/pkg-dist/src/modules/quantum-time.module.js.map +1 -1
- package/pkg-dist/src/modules/vault-balance.module.d.ts.map +1 -1
- package/pkg-dist/src/modules/vault-balance.module.js +2 -1
- package/pkg-dist/src/modules/vault-balance.module.js.map +1 -1
- package/pkg-dist/src/modules/vault-snapshot.d.ts +8 -0
- package/pkg-dist/src/modules/vault-snapshot.d.ts.map +1 -1
- package/pkg-dist/src/modules/vault-snapshot.js +71 -18
- package/pkg-dist/src/modules/vault-snapshot.js.map +1 -1
- package/dist/pkp-validator-datil.action.js +0 -1
- package/dist/pkp-validator-datil.hash +0 -1
- package/dist/pkp-validator-datil.meta.json +0 -9
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ lit-actions/
|
|
|
14
14
|
└── pkg-dist/ # Built npm package (dh-lit-actions)
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## Three-Phase System
|
|
18
18
|
|
|
19
19
|
### Phase 1: LIT Actions Development & Deployment
|
|
20
20
|
|
|
@@ -23,7 +23,19 @@ lit-actions/
|
|
|
23
23
|
- **Minify**: `dist/*.action.js` - Minified for IPFS deployment
|
|
24
24
|
- **Upload**: Deploy to IPFS via Pinata
|
|
25
25
|
|
|
26
|
-
### Phase 2:
|
|
26
|
+
### Phase 2: PKP Creation & Funding
|
|
27
|
+
|
|
28
|
+
- **Network**: Chronicle Yellowstone (175177)
|
|
29
|
+
- **Dashboard**: https://dashboard.litprotocol.com/
|
|
30
|
+
- **Purpose**: Create PKPs for LIT Action authorization
|
|
31
|
+
|
|
32
|
+
### Phase 5: CID Registration & Testing
|
|
33
|
+
|
|
34
|
+
- **Registry**: Update `pkg-src/constants/chunks/lit-actions-registry.ts`
|
|
35
|
+
- **Contracts**: Register CIDs in OperationAuthorizationRegistry
|
|
36
|
+
- **Testing**: Validate LIT Actions work with contracts
|
|
37
|
+
|
|
38
|
+
### Phase 4: NPM Package Generation
|
|
27
39
|
|
|
28
40
|
- **Package Source**: `pkg-src/` - Registry and types
|
|
29
41
|
- **Package Build**: `pkg-dist/` - Compiled npm package
|
|
@@ -41,6 +53,39 @@ npm run upload # Upload dist/ to IPFS (mock mode by default)
|
|
|
41
53
|
npm run deploy # Full deployment pipeline (clean + build + minify + upload)
|
|
42
54
|
```
|
|
43
55
|
|
|
56
|
+
### NAGA TESTNET Automation Commands
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Create PKP for single LIT Action
|
|
60
|
+
npm run naga-testnet:create-pkp <cid>
|
|
61
|
+
|
|
62
|
+
# Create PKPs for all 4 LIT Actions (automated batch)
|
|
63
|
+
npm run naga-testnet:create-all-pkps
|
|
64
|
+
|
|
65
|
+
# Update registry with PKP data
|
|
66
|
+
npm run naga-testnet:update-registry
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Stage 1.5 Commands (Naga Integration Testing)
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# Phase 1: Deploy to IPFS (Production)
|
|
73
|
+
npm run deploy # Deploy all LIT Actions to IPFS with real CIDs
|
|
74
|
+
|
|
75
|
+
# Phase 2: Fund Deployer Wallet (Manual - via LIT Bridge)
|
|
76
|
+
# Bridge 300+ LIT + 0.1+ ETH to 0x0f8f23674cc90Ef7107930a4437341fD8B460362 on Yellowstone
|
|
77
|
+
|
|
78
|
+
# Phase 3: PKP Creation (Manual - via LIT Dashboard)
|
|
79
|
+
# Go to https://dashboard.litprotocol.com/ and create 3 PKPs
|
|
80
|
+
|
|
81
|
+
# Phase 4: Registry Update
|
|
82
|
+
npm run build:package # Update registry with new CIDs
|
|
83
|
+
npm run package # Build updated package
|
|
84
|
+
|
|
85
|
+
# Phase 5: Contract Registration (Local Hardhat)
|
|
86
|
+
npx hardhat run scripts/register-naga-cids.js --network localhost
|
|
87
|
+
```
|
|
88
|
+
|
|
44
89
|
### Package Commands
|
|
45
90
|
|
|
46
91
|
```bash
|
|
@@ -118,3 +163,379 @@ The mock system generates CIDs based on content hash, so:
|
|
|
118
163
|
- Same TypeScript source → Same built JS → Same mock CID
|
|
119
164
|
- Perfect for development and testing
|
|
120
165
|
- Switch to real Pinata when ready for deployment
|
|
166
|
+
|
|
167
|
+
## Stage 1.5: Naga Integration Testing Guide
|
|
168
|
+
|
|
169
|
+
**Stage 1.5** enables safe testing of LIT Actions with Naga network while using stable local Hardhat contracts. This validates the LIT Actions ↔ Contracts ↔ SDK integration without breaking production Sepolia deployment.
|
|
170
|
+
|
|
171
|
+
### Prerequisites
|
|
172
|
+
|
|
173
|
+
1. **Pinata JWT**: ✅ **Already configured** in `.env`
|
|
174
|
+
```bash
|
|
175
|
+
PINATA_JWT=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
2. **Deployer Wallet Funding**: `0x0f8f23674cc90Ef7107930a4437341fD8B460362`
|
|
179
|
+
- **Network**: Chronicle Yellowstone (175177)
|
|
180
|
+
- **Tokens Needed**:
|
|
181
|
+
- **LIT Tokens**: 300+ LIT for PKP operations (100 per PKP × 3)
|
|
182
|
+
- **ETH**: 0.1+ ETH for gas fees
|
|
183
|
+
- **Funding Source**: Bridge from Ethereum mainnet via [LIT Protocol Bridge](https://bridge.litprotocol.com/)
|
|
184
|
+
- **Verification**:
|
|
185
|
+
```bash
|
|
186
|
+
# Check balances on Yellowstone
|
|
187
|
+
cast balance 0x0f8f23674cc90Ef7107930a4437341fD8B460362 --rpc-url https://yellowstone-rpc.litprotocol.com
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
3. **Hardhat Local**: Running localhost contracts
|
|
191
|
+
4. **LIT Dashboard Access**: https://dashboard.litprotocol.com/
|
|
192
|
+
|
|
193
|
+
### Phase 1: Deploy LIT Actions to IPFS
|
|
194
|
+
|
|
195
|
+
#### Step 1: Configure Production Environment
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
# Copy and edit environment
|
|
199
|
+
cp .env.example .env
|
|
200
|
+
|
|
201
|
+
# Edit .env for production deployment
|
|
202
|
+
PINATA_JWT=your_pinata_jwt_token_here
|
|
203
|
+
MOCK_MODE=false
|
|
204
|
+
DEBUG_BUILD=false
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
#### Step 2: Get Pinata JWT
|
|
208
|
+
|
|
209
|
+
1. Visit [Pinata Keys](https://app.pinata.cloud/keys)
|
|
210
|
+
2. Create new API key with **Admin** permissions:
|
|
211
|
+
- `pinFileToIPFS`
|
|
212
|
+
- `pinJSONToIPFS`
|
|
213
|
+
3. Copy the **JWT Token** (not API Key/Secret)
|
|
214
|
+
4. Add to `.env` as `PINATA_JWT`
|
|
215
|
+
|
|
216
|
+
#### ✅ COMPLETED: LIT Actions Deployed to IPFS
|
|
217
|
+
|
|
218
|
+
**Deployed CIDs:**
|
|
219
|
+
- ✅ `ucd-mint-validator.action.js` → `QmSggwuiQJpsn5F1qjcD9Bpe5WaRB2MgY2PiFVzpaNFvN8`
|
|
220
|
+
- ✅ `btc-withdrawal.action.js` → `QmYs2UWxfmjX3MxaSq2VoZ5A2pS2LN3JTSgaoHYSYaopy7`
|
|
221
|
+
- ✅ `process-payment-validator.action.js` → `QmPK9ViEH75JPcDcdDhUgEk9vGPvBDNSwPnQALbdSqVAjV`
|
|
222
|
+
- ✅ `extend-position-validator.action.js` → `QmYwKsf2yNSyLUeVw3KvVasPZqGCA6LPgHetFqMwqh5YKP`
|
|
223
|
+
|
|
224
|
+
**Registry Updated**: `DH_LIT_ACTIONS_NAGA_TEST` now contains real deployed CIDs.
|
|
225
|
+
|
|
226
|
+
### Phase 2: Fund Deployer Wallet
|
|
227
|
+
|
|
228
|
+
#### ✅ COMPLETED: Wallet Funding
|
|
229
|
+
- **Deployer Wallet**: `0x0f8f23674cc90Ef7107930a4437341fD8B460362`
|
|
230
|
+
- **Network**: Chronicle Yellowstone (175177) - NAGA TESTNET
|
|
231
|
+
- **Status**: ✅ **FUNDED** with ETH and LIT tokens
|
|
232
|
+
- **Verification**:
|
|
233
|
+
```bash
|
|
234
|
+
cast balance 0x0f8f23674cc90Ef7107930a4437341fD8B460362 --rpc-url https://yellowstone-rpc.litprotocol.com
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Phase 4: Create Naga Testnet PKPs
|
|
238
|
+
|
|
239
|
+
#### Step 1: Access LIT Dashboard
|
|
240
|
+
|
|
241
|
+
1. Visit https://dashboard.litprotocol.com/
|
|
242
|
+
2. Connect wallet `0x0f8f23674cc90Ef7107930a4437341fD8B460362`
|
|
243
|
+
3. Switch to **Chronicle Yellowstone** network (175177)
|
|
244
|
+
|
|
245
|
+
#### Step 2: Create PKPs for Each LIT Action
|
|
246
|
+
|
|
247
|
+
**Create 4 PKPs (one for each deployed LIT Action):**
|
|
248
|
+
|
|
249
|
+
1. **UCD Mint Validator PKP**: `QmSggwuiQJpsn5F1qjcD9Bpe5WaRB2MgY2PiFVzpaNFvN8`
|
|
250
|
+
2. **BTC Withdrawal PKP**: `QmYs2UWxfmjX3MxaSq2VoZ5A2pS2LN3JTSgaoHYSYaopy7`
|
|
251
|
+
3. **Process Payment PKP**: `QmPK9ViEH75JPcDcdDhUgEk9vGPvBDNSwPnQALbdSqVAjV`
|
|
252
|
+
4. **Extend Position PKP**: `QmYwKsf2yNSyLUeVw3KvVasPZqGCA6LPgHetFqMwqh5YKP`
|
|
253
|
+
|
|
254
|
+
**For each PKP:**
|
|
255
|
+
1. Click "Create PKP"
|
|
256
|
+
2. Choose authentication method (wallet address recommended)
|
|
257
|
+
3. **Add Authorized IPFS CID**: Paste the corresponding CID above
|
|
258
|
+
4. Wait for PKP creation and authorization
|
|
259
|
+
5. **Fund with 100+ LIT tokens** each
|
|
260
|
+
6. Verify ownership and authorization in dashboard
|
|
261
|
+
|
|
262
|
+
#### Step 3: Record PKP Details
|
|
263
|
+
|
|
264
|
+
**For each PKP, record:**
|
|
265
|
+
- Token ID
|
|
266
|
+
- ETH Address
|
|
267
|
+
- Public Key
|
|
268
|
+
- Authorized CID (should match above)
|
|
269
|
+
|
|
270
|
+
**Example PKP Structure:**
|
|
271
|
+
```json
|
|
272
|
+
{
|
|
273
|
+
"tokenId": "123456789...",
|
|
274
|
+
"ethAddress": "0x1234...",
|
|
275
|
+
"publicKey": "0x04abcd...",
|
|
276
|
+
"authorizedCid": "QmSggwuiQJpsn5F1qjcD9Bpe5WaRB2MgY2PiFVzpaNFvN8"
|
|
277
|
+
}
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Phase 3: Update Registry & Register CIDs
|
|
281
|
+
|
|
282
|
+
#### ✅ COMPLETED: Registry Updated
|
|
283
|
+
|
|
284
|
+
**File**: `pkg-src/constants/chunks/lit-actions-registry.ts`
|
|
285
|
+
|
|
286
|
+
- ✅ `DH_LIT_ACTIONS_NAGA_TEST` updated with real deployed CIDs
|
|
287
|
+
- ✅ All 4 LIT Actions have `deployed: true` status
|
|
288
|
+
- ✅ File sizes and deployment timestamps updated
|
|
289
|
+
- ✅ Package rebuilt and published
|
|
290
|
+
|
|
291
|
+
#### SDK Network Support
|
|
292
|
+
|
|
293
|
+
**File**: `../sdk/src/constants/chunks/environment.ts`
|
|
294
|
+
|
|
295
|
+
- ✅ Added `"naga-test"` to `validNetworks` array
|
|
296
|
+
- ✅ SDK can now validate `litNetwork: "naga-test"`
|
|
297
|
+
|
|
298
|
+
#### Local Contract Registration
|
|
299
|
+
|
|
300
|
+
**Next Step**: Register CIDs in local Hardhat contracts after PKPs are created.
|
|
301
|
+
|
|
302
|
+
**Registration Script**: `../contracts/scripts/register-naga-test-cids.js`
|
|
303
|
+
|
|
304
|
+
```javascript
|
|
305
|
+
const { ethers } = require('hardhat');
|
|
306
|
+
const { DH_LIT_ACTIONS_NAGA_TEST } = require('../../lit-actions/pkg-dist/constants/chunks/lit-actions-registry');
|
|
307
|
+
|
|
308
|
+
async function main() {
|
|
309
|
+
const registry = await ethers.getContractAt(
|
|
310
|
+
'OperationAuthorizationRegistry',
|
|
311
|
+
process.env.OPERATION_AUTHORIZATION_REGISTRY_ADDRESS
|
|
312
|
+
);
|
|
313
|
+
|
|
314
|
+
// Register each Naga Testnet LIT Action CID with its PKP
|
|
315
|
+
for (const [actionName, actionData] of Object.entries(DH_LIT_ACTIONS_NAGA_TEST)) {
|
|
316
|
+
const version = actionName.includes('ucdMint') ? 4 :
|
|
317
|
+
actionName.includes('btcWithdrawal') ? 2 :
|
|
318
|
+
actionName.includes('processPayment') ? 1 :
|
|
319
|
+
actionName.includes('extendPosition') ? 4 : 1;
|
|
320
|
+
|
|
321
|
+
await registry.addValidator(version, actionData.pkp.ethAddress, actionData.cid);
|
|
322
|
+
console.log(`✅ Registered ${actionName} v${version}: ${actionData.cid}`);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
main().catch(console.error);
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
**Run after PKP creation**:
|
|
330
|
+
```bash
|
|
331
|
+
cd contracts
|
|
332
|
+
npx hardhat run scripts/register-naga-test-cids.js --network localhost
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### Phase 5: Test NAGA TESTNET Integration
|
|
336
|
+
|
|
337
|
+
#### Step 1: Update Registry with PKP Details
|
|
338
|
+
|
|
339
|
+
After creating PKPs on the dashboard, update the registry with PKP information:
|
|
340
|
+
|
|
341
|
+
**File**: `pkg-src/constants/chunks/lit-actions-registry.ts`
|
|
342
|
+
|
|
343
|
+
For each LIT Action in `DH_LIT_ACTIONS_NAGA_TEST`, update the `pkp` object:
|
|
344
|
+
```typescript
|
|
345
|
+
pkp: {
|
|
346
|
+
tokenId: "YOUR_PKP_TOKEN_ID", // From dashboard
|
|
347
|
+
ethAddress: "0xYOUR_PKP_ADDRESS", // From dashboard
|
|
348
|
+
publicKey: "0x04YOUR_PKP_PUBLIC_KEY", // From dashboard
|
|
349
|
+
mintTxHash: "naga-test-mint", // Transaction hash
|
|
350
|
+
authTxHash: "confirmed", // Authorization status
|
|
351
|
+
burnTxHash: "pending", // Will be set when burned
|
|
352
|
+
immutable: false, // Test PKPs are mutable
|
|
353
|
+
authorizedCidHex: cidToHex("CID_HERE"), // Auto-calculated
|
|
354
|
+
createdAt: Date.now(),
|
|
355
|
+
}
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
#### Step 2: Register CIDs in Local Contracts
|
|
359
|
+
|
|
360
|
+
```bash
|
|
361
|
+
cd ../contracts
|
|
362
|
+
npx hardhat run scripts/register-naga-test-cids.js --network localhost
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
#### Step 3: Create SDK Test Configuration
|
|
366
|
+
|
|
367
|
+
**File**: `../sdk/tests/naga-test-config.ts`
|
|
368
|
+
|
|
369
|
+
```typescript
|
|
370
|
+
export const nagaTestConfig = {
|
|
371
|
+
mode: 'standalone' as const,
|
|
372
|
+
ethRpcUrl: 'http://127.0.0.1:8545', // Local Hardhat
|
|
373
|
+
litNetwork: 'naga-test' as const, // NAGA TESTNET
|
|
374
|
+
contractAddresses: {
|
|
375
|
+
// Local Hardhat addresses (from Stage 1)
|
|
376
|
+
positionManager: '0x...',
|
|
377
|
+
// ... other local addresses
|
|
378
|
+
},
|
|
379
|
+
bitcoinProviders: [{
|
|
380
|
+
url: 'http://127.0.0.1:18443',
|
|
381
|
+
network: 'regtest' as const,
|
|
382
|
+
}],
|
|
383
|
+
// Test PKP signers will be loaded from registry
|
|
384
|
+
};
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
#### Step 4: Run NAGA TESTNET Integration Tests
|
|
388
|
+
|
|
389
|
+
```bash
|
|
390
|
+
cd ../sdk
|
|
391
|
+
npm test -- --testPathPattern="naga-test-integration.test.ts"
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
**Expected Results:**
|
|
395
|
+
- ✅ LIT Actions execute on NAGA TESTNET
|
|
396
|
+
- ✅ PKPs authorize operations successfully
|
|
397
|
+
- ✅ Local contracts accept NAGA TESTNET LIT Actions
|
|
398
|
+
- ✅ SDK operations work end-to-end with hybrid setup
|
|
399
|
+
|
|
400
|
+
### Troubleshooting
|
|
401
|
+
|
|
402
|
+
#### IPFS Deployment Issues
|
|
403
|
+
- **403 Forbidden**: Check Pinata JWT permissions
|
|
404
|
+
- **CID Mismatch**: Ensure `MOCK_MODE=false`
|
|
405
|
+
- **Upload Timeout**: Check network connectivity
|
|
406
|
+
|
|
407
|
+
#### PKP Issues
|
|
408
|
+
- **Insufficient Funds**: Send more LIT tokens to PKP
|
|
409
|
+
- **Wrong Network**: Ensure using Chronicle Yellowstone (175177)
|
|
410
|
+
- **Auth Failed**: Verify authentication method setup
|
|
411
|
+
|
|
412
|
+
#### Contract Registration Issues
|
|
413
|
+
- **CID Not Recognized**: Verify CID format and registration
|
|
414
|
+
- **PKP Not Authorized**: Check PKP address and token balance
|
|
415
|
+
- **Version Mismatch**: Ensure correct validator versions
|
|
416
|
+
|
|
417
|
+
### Current Status
|
|
418
|
+
|
|
419
|
+
**✅ COMPLETED:**
|
|
420
|
+
- ✅ LIT Actions deployed to IPFS with permanent CIDs
|
|
421
|
+
- ✅ Registry updated with real deployed CIDs
|
|
422
|
+
- ✅ Deployer wallet funded and ready
|
|
423
|
+
- ✅ Package rebuilt with NAGA TESTNET support
|
|
424
|
+
|
|
425
|
+
**🔄 NEXT STEPS:**
|
|
426
|
+
1. **Create PKPs** on https://dashboard.litprotocol.com/ (Chronicle Yellowstone)
|
|
427
|
+
2. **Authorize each PKP** with corresponding LIT Action CID
|
|
428
|
+
3. **Fund PKPs** with 100+ LIT tokens each
|
|
429
|
+
4. **Update registry** with PKP details
|
|
430
|
+
5. **Register CIDs** in local Hardhat contracts
|
|
431
|
+
6. **Run integration tests** with NAGA TESTNET + Hardhat hybrid
|
|
432
|
+
|
|
433
|
+
### Next Steps After Completion
|
|
434
|
+
|
|
435
|
+
**After NAGA TESTNET Success:**
|
|
436
|
+
1. **Proceed to Stage 2**: Full production deployment
|
|
437
|
+
2. **Deploy Contracts**: Move from Hardhat to Sepolia/Ethereum
|
|
438
|
+
3. **Full Integration**: Complete end-to-end testing
|
|
439
|
+
|
|
440
|
+
**NAGA TESTNET Complete When:**
|
|
441
|
+
- ✅ 4 PKPs created and funded on Chronicle Yellowstone
|
|
442
|
+
- ✅ Each PKP authorized with correct LIT Action CID
|
|
443
|
+
- ✅ Registry updated with complete PKP details
|
|
444
|
+
- ✅ Local contracts accept NAGA TESTNET LIT Action CIDs
|
|
445
|
+
- ✅ SDK integration tests pass with hybrid setup
|
|
446
|
+
|
|
447
|
+
## Automated NAGA TESTNET PKP Creation
|
|
448
|
+
|
|
449
|
+
**✅ NOW AVAILABLE**: Full automation for NAGA TESTNET PKP creation using V8 SDK!
|
|
450
|
+
|
|
451
|
+
### Why Automated Now?
|
|
452
|
+
|
|
453
|
+
- **✅ SDK Dependencies**: Added `@lit-protocol/auth` and `@lit-protocol/networks`
|
|
454
|
+
- **✅ Network Support**: V8 SDK supports `naga-test` network configuration
|
|
455
|
+
- **✅ Contract Addresses**: Found Chronicle Yellowstone PKP contract addresses
|
|
456
|
+
- **✅ Scripts Created**: Automated scripts for individual and batch PKP creation
|
|
457
|
+
|
|
458
|
+
### Automated Process Overview
|
|
459
|
+
|
|
460
|
+
```
|
|
461
|
+
1. Deploy LIT Actions to IPFS ✅ (Already Done)
|
|
462
|
+
2. Create PKPs Automatically 🤖 (New!)
|
|
463
|
+
3. Update Registry Automatically 🤖 (New!)
|
|
464
|
+
4. Register CIDs in Contracts ✅ (Existing)
|
|
465
|
+
5. Run Integration Tests ✅ (Existing)
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
### Quick Start - Automated NAGA TESTNET
|
|
469
|
+
|
|
470
|
+
```bash
|
|
471
|
+
# 1. Ensure wallet is funded (Chronicle Yellowstone)
|
|
472
|
+
# Visit: https://chronicle-yellowstone-faucet.getlit.dev/
|
|
473
|
+
|
|
474
|
+
# 2. Create all PKPs automatically
|
|
475
|
+
npm run naga-testnet:create-all-pkps
|
|
476
|
+
|
|
477
|
+
# 3. Update registry with PKP data
|
|
478
|
+
npm run naga-testnet:update-registry
|
|
479
|
+
|
|
480
|
+
# 4. Rebuild package
|
|
481
|
+
npm run package
|
|
482
|
+
|
|
483
|
+
# 5. Register CIDs in local contracts (cd ../contracts)
|
|
484
|
+
# npx hardhat run scripts/register-naga-test-cids.js --network localhost
|
|
485
|
+
|
|
486
|
+
# 6. Run integration tests
|
|
487
|
+
# npm test -- --testPathPattern="naga-test-integration.test.ts"
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
### Manual Alternative Still Available
|
|
491
|
+
|
|
492
|
+
If automation fails, you can still create PKPs manually via the dashboard:
|
|
493
|
+
|
|
494
|
+
1. Visit https://dashboard.litprotocol.com/
|
|
495
|
+
2. Switch to Chronicle Yellowstone (175177)
|
|
496
|
+
3. Create PKPs and authorize CIDs manually
|
|
497
|
+
4. Use `npm run naga-testnet:update-registry` to update with your PKP data
|
|
498
|
+
|
|
499
|
+
### What the Automation Does
|
|
500
|
+
|
|
501
|
+
**Batch PKP Creation** (`create-all-naga-testnet-pkps.ts`):
|
|
502
|
+
- ✅ Uses V8 SDK with `naga-test` network
|
|
503
|
+
- ✅ Creates PKP for each of 4 LIT Actions
|
|
504
|
+
- ✅ Authorizes correct CID for each PKP
|
|
505
|
+
- ✅ Keeps PKPs mutable (testnet-friendly)
|
|
506
|
+
- ✅ Saves results to JSON file
|
|
507
|
+
|
|
508
|
+
**Registry Update** (`update-naga-testnet-registry.ts`):
|
|
509
|
+
- ✅ Reads PKP creation results
|
|
510
|
+
- ✅ Updates `DH_LIT_ACTIONS_NAGA_TEST` with real PKP data
|
|
511
|
+
- ✅ Sets `deployed: true` and timestamps
|
|
512
|
+
- ✅ Rebuilds package automatically
|
|
513
|
+
|
|
514
|
+
### Troubleshooting Automation
|
|
515
|
+
|
|
516
|
+
**Common Issues:**
|
|
517
|
+
- **"Insufficient funds"**: Get more tstLPX from faucet
|
|
518
|
+
- **"Network timeout"**: Wait and retry (testnet can be slow)
|
|
519
|
+
- **"Authorization failed"**: Check CID format and network selection
|
|
520
|
+
|
|
521
|
+
**Debug Commands:**
|
|
522
|
+
```bash
|
|
523
|
+
# Check single PKP creation
|
|
524
|
+
npm run naga-testnet:create-pkp QmSggwuiQJpsn5F1qjcD9Bpe5WaRB2MgY2PiFVzpaNFvN8
|
|
525
|
+
|
|
526
|
+
# View PKP results
|
|
527
|
+
cat naga-testnet-pkp-results.json
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
### Evolution from Manual to Automated
|
|
531
|
+
|
|
532
|
+
**Before**: Manual dashboard creation required for NAGA TESTNET
|
|
533
|
+
- **Reason**: SDK compatibility issues, missing dependencies, network differences
|
|
534
|
+
|
|
535
|
+
**Now**: Full automation available for NAGA TESTNET
|
|
536
|
+
- **Reason**: Updated dependencies, V8 SDK support for `naga-test`, proper contract addresses
|
|
537
|
+
|
|
538
|
+
**Production (DATIL/NAGA)**: Automated scripts in single pipeline
|
|
539
|
+
**Testing (NAGA TESTNET)**: **Now fully automated** with proper error handling and batch processing
|
|
540
|
+
|
|
541
|
+
**This provides the critical validation bridge between development and production deployment.**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var _LIT_ACTION_=(()=>{var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,a={};((t,r)=>{for(var n in r)e(t,n,{get:r[n],enumerable:!0})})(a,{main:()=>main});var o,s=new Set([1]);async function main(e){!function(e,t){const r=t??{};if(!0!==r.__dangerousTestOnly)throw new Error(`[${e}] refusing to run: this is a dev/test-only LIT Action. Callers must set jsParams.__dangerousTestOnly = true to acknowledge that signatures returned here are NOT protocol-authorized.`);if("number"==typeof r.chainId&&s.has(r.chainId))throw new Error(`[${e}] refusing to run against chainId=${r.chainId}: dev-only actions are banned on production chains.`)}("address-probe-signer",e);const{pkpId:t,message:r}=e;if(!t||!r)throw new Error("Missing required parameters: pkpId, message");const n=await Lit.Actions.getPrivateKey({pkpId:t}),a="string"==typeof n?n.startsWith("0x")?n:`0x${n}`:String(n),o=new ethers.Wallet(a),i=await o.signMessage(r);return{address:o.address,signature:i,message:r}}return o=a,((a,o,s,i)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let c of r(o))n.call(a,c)||c===s||e(a,c,{get:()=>o[c],enumerable:!(i=t(o,c))||i.enumerable});return a})(e({},"__esModule",{value:!0}),o)})();if("object"==typeof _LIT_ACTION_)if("function"==typeof _LIT_ACTION_.main)var main=_LIT_ACTION_.main;else"function"==typeof _LIT_ACTION_.go&&_LIT_ACTION_.go();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
b66a469b07b3ba5d753ff8726775188d32450b3e6a77b91404c8d5e8114be9e8
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"actionName": "address-probe-signer",
|
|
3
|
+
"originalSize": 2647,
|
|
4
|
+
"minifiedSize": 1418,
|
|
5
|
+
"compressionRatio": 0.4642992066490367,
|
|
6
|
+
"hash": "b66a469b07b3ba5d753ff8726775188d32450b3e6a77b91404c8d5e8114be9e8",
|
|
7
|
+
"buildTime": 1776930563835,
|
|
8
|
+
"version": "0.1.0"
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var _LIT_ACTION_=(()=>{var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={};async function main(){const e="0x"+ethers.utils.keccak256(ethers.utils.toUtf8Bytes("diamond-hands:address-probe:v1")).slice(-40),t=await Lit.Actions.getPrivateKey({pkpId:e}),r=t.startsWith("0x")?t:`0x${t}`;return{address:new ethers.Wallet(r).address}}return((e,r)=>{for(var n in r)t(e,n,{get:r[n],enumerable:!0})})(a,{main:()=>main}),e=a,((e,a,s,i)=>{if(a&&"object"==typeof a||"function"==typeof a)for(let _ of n(a))o.call(e,_)||_===s||t(e,_,{get:()=>a[_],enumerable:!(i=r(a,_))||i.enumerable});return e})(t({},"__esModule",{value:!0}),e)})();if("object"==typeof _LIT_ACTION_)if("function"==typeof _LIT_ACTION_.main)var main=_LIT_ACTION_.main;else"function"==typeof _LIT_ACTION_.go&&_LIT_ACTION_.go();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
bc0bcb38452275c93fa74c5240ae496d7a3eef9d38e7fb0dd99c5202c554d5e3
|