Skip to content

Commit 29d011a

Browse files
committed
Merge branch 'feature/jss-36-naga-sdk-add-a-make-a-request-function-to-take' of github.com:LIT-Protocol/js-sdk into feature/jss-36-naga-sdk-add-a-make-a-request-function-to-take
2 parents 83cf3cf + a9381e8 commit 29d011a

File tree

6 files changed

+167
-4
lines changed

6 files changed

+167
-4
lines changed

docs/docs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@
122122
{
123123
"group": "Resources",
124124
"pages": [
125-
"sdk/resources/supported-evm-chains"
125+
"sdk/resources/supported-evm-chains",
126+
"sdk/resources/network-status"
126127
]
127128
}
128129
]

docs/governance/overview.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ The purpose of Lit’s initial governance structure is to coordinate and oversee
1616

1717
4. Metagovernance: Defining and evolving the structures, roles, and processes that govern Lit itself.
1818

19-
2019
By establishing clear decision-making and implementation workflows around these areas, governance ensures that protocol development remains coherent, auditable, and extensible.
2120

21+
[Governance forum](https://litprotocol.discourse.group/categories).
22+
2223
## Governance Composition
2324

2425
At launch, governance is managed by the Lit Association, a Swiss non-profit organization dedicated to stewarding the long-term growth of the protocol. In collaboration with the core development company behind Lit, the Association is responsible for maintaining key infrastructure, initiating governance processes, and coordinating core protocol operations.

docs/index.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ title: "What is Lit Protocol"
33
description: "Decentralized key management and private compute"
44
---
55

6+
<Tip>
7+
We're excited to announce that Vincent is now live! Vincent is a powerful toolkit that enables secure web3 capabilities for AI agents through:
8+
9+
- Secure Delegation: Safely delegate wallet operations to AI agents while maintaining full control
10+
- Customizable Tools: Define and manage specific web3 actions your agents can perform
11+
- Policy Controls: Set granular rules and restrictions for how agents interact with web3
12+
13+
Check out the [Vincent documentation](https://docs.heyvincent.ai/) to get started!
14+
</Tip>
15+
616
# Overview
717

818
Lit Protocol is a decentralized key management and private compute network. Lit provides developers building in Web3 with three core primitives:

docs/sdk/auth-context-consumption/execute-js.mdx

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ description: "Execute custom Lit Actions using your authenticated context. Choos
2020

2121
<Tip>
2222
[📚 View Full LitActions API Documentation
23-
](https://actions-docs.litprotocol.com/)
23+
](https://naga.actions-docs.litprotocol.com/)
2424
</Tip>
2525

2626
<CodeGroup>
@@ -233,6 +233,38 @@ Unlike traditional client-side decryption, this approach ensures that sensitive
233233
</Step>
234234
</Steps>
235235

236+
#### Important Considerations
237+
238+
When using `decryptAndCombine` within your Lit Actions, there are several critical requirements and potential issues to be aware of:
239+
240+
#### Unified Access Control Conditions Required
241+
242+
<Warning>
243+
The `decryptAndCombine` function **only accepts unified access control conditions**. Standard or legacy access control condition formats are not supported.
244+
</Warning>
245+
246+
When encrypting data that you plan to decrypt within a Lit Action, ensure you use the unified access control conditions format. EVM contract conditions are supported, but they must be specified as unified access control conditions with `conditionType: "evmContract"` in the JSON structure.
247+
248+
#### Timeout Issues and Determinism
249+
250+
<Warning>
251+
**Common Cause of Timeouts**: If you experience timeouts when using `decryptAndCombine`, the most likely cause is nondeterminism in your Lit Action.
252+
</Warning>
253+
254+
For decryption to succeed, all Lit nodes must reach consensus on:
255+
- The access control conditions being evaluated
256+
- The ciphertext being decrypted
257+
- The dataToEncryptHash being validated
258+
259+
If nodes receive different values for any of these parameters, they cannot reach consensus and the operation will timeout. Common sources of nondeterminism include:
260+
261+
- **Dynamic Construction**: Building access control conditions dynamically within the Lit Action
262+
- **Variable Data**: Using timestamps, random values, or other changing data in your conditions
263+
- **External Data**: Fetching data that may differ between nodes (e.g., latest block numbers, API responses)
264+
- **Conditional Logic**: Logic that produces different results on different nodes
265+
266+
To avoid timeouts, ensure all parameters passed to `decryptAndCombine` are static and deterministic across all nodes. Pass these values via `jsParams` from the client rather than generating them within the Lit Action.
267+
236268
---
237269

238270
### ⚡️ Getting Chain RPC URLs Example

docs/sdk/introduction.mdx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ title: "Introduction"
33
description: "Explore our JS SDK for building applications with Lit Protocol"
44
---
55

6+
<Tip>
7+
Lit V1 ("Naga") is currently live on [testnet](https://spark.litprotocol.com/naga-test/).
8+
9+
If you're a builder looking to deploy your application in production, you can use Lit's V0 Mainnet Beta ("Datil"), already live today ([Link](https://developer.litprotocol.com/)).
10+
</Tip>
11+
612
# SDK Reference
713

814
The Lit JS SDK provides a comprehensive toolkit for integrating Lit Protocol's decentralised authentication and cryptographic capabilities into your applications. This reference documentation covers all the methods, classes, and configuration options available in the SDK.
@@ -30,4 +36,8 @@ The Lit JS SDK provides a comprehensive toolkit for integrating Lit Protocol's d
3036

3137
- **[PKP Permissions](/sdk/sdk-reference/lit-client/functions/createLitClient/pkp-permissions)**: - Manage PKP permissions
3238
- **[PKP Viem Account](/sdk/sdk-reference/lit-client/functions/createLitClient/pkp-viem-account)**: - Manage PKP Viem account
33-
- **[PKP View Helpers](/sdk/sdk-reference/lit-client/functions/createLitClient/pkp-view-helpers)**: - View PKP permissions
39+
- **[PKP View Helpers](/sdk/sdk-reference/lit-client/functions/createLitClient/pkp-view-helpers)**: - View PKP permissions
40+
41+
### 5. Network Status & Monitoring
42+
43+
- **[Network Status](/sdk/resources/network-status)**: - Monitor real-time uptime and performance of Lit Protocol networks
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
---
2+
title: Network Status & Health Monitoring
3+
---
4+
5+
# Network Status
6+
7+
Monitor the real-time health and uptime of Lit Protocol's core network endpoints across different environments.
8+
9+
## Status Pages
10+
11+
### Development Network
12+
13+
**[Naga Dev Network Status](https://uptime.getlit.dev/naga-dev)**
14+
15+
Live monitoring dashboard for the development network, tracking real-time metrics for all core SDK operations.
16+
17+
### Test Network
18+
19+
**[Naga Test Network Status](https://uptime.getlit.dev/naga-test)**
20+
21+
Live monitoring dashboard for the test network, providing visibility into network health and performance.
22+
23+
## Monitored Operations
24+
25+
These dashboards track the uptime and performance of core SDK methods:
26+
27+
| Operation | Description |
28+
| ------------------ | ---------------------------------------------------- |
29+
| **decrypt** | Decryption operations for encrypted data |
30+
| **executeJs** | JavaScript execution in Lit Actions |
31+
| **handshake** | Node handshake and connection establishment |
32+
| **pkpSign** | PKP signing operations for transactions and messages |
33+
| **signSessionKey** | Session key signing for authentication |
34+
35+
## Programmatic Access
36+
37+
<Warning>
38+
**Experimental Feature**: The Lit Status SDK is currently in active development and should be considered experimental. APIs and features may change without notice.
39+
</Warning>
40+
41+
You can access network metrics programmatically using the [Lit Status SDK](https://uptime-docs.vercel.app/docs/sdk) for read-only monitoring and analytics.
42+
43+
### Prerequisites
44+
45+
To access the Status API, you'll need a read-only API key. Request access by filling out the [Lit Protocol Contact Form](https://docs.google.com/forms/d/e/1FAIpQLScBVsg-NhdMIC1H1mozh2zaVX0V4WtmEPSPrtmqVtnj_3qqNw/viewform).
46+
47+
### Installation
48+
49+
```bash
50+
npm install @lit-protocol/lit-status-sdk
51+
```
52+
53+
### Example Usage
54+
55+
```typescript
56+
import { createLitStatusClient } from '@lit-protocol/lit-status-sdk';
57+
58+
(async () => {
59+
const client = createLitStatusClient({
60+
url: process.env.API_URL,
61+
apiKey: process.env.READ_KEY,
62+
});
63+
64+
// Get available filter options
65+
const filterOptions = await client.getFilterOptions();
66+
console.log('Available networks:', filterOptions.networks);
67+
console.log('Available functions:', filterOptions.functions);
68+
69+
// Register and retrieve function references
70+
const functions = await client.getOrRegisterFunctions({
71+
network: 'naga-dev',
72+
product: 'js-sdk/naga',
73+
functions: ['executeJs', 'pkpSign', 'decrypt'],
74+
});
75+
76+
// Get recent metrics for a specific function
77+
const executeJsMetrics = await client.getFunctionMetrics(
78+
functions['executeJs'].id,
79+
{
80+
startDate: new Date(Date.now() - 24 * 60 * 60 * 1000), // Last 24 hours
81+
endDate: new Date(),
82+
}
83+
);
84+
85+
console.log('ExecuteJs Metrics:', {
86+
uptime: `${executeJsMetrics.uptime}%`,
87+
successRate: `${executeJsMetrics.successRate}%`,
88+
avgResponseTime: `${executeJsMetrics.averageResponseTime}ms`,
89+
totalExecutions: executeJsMetrics.totalExecutions,
90+
});
91+
92+
// Get time-series data for charting
93+
const timeSeries = await client.getFunctionMetricsTimeSeries(
94+
functions['executeJs'].id,
95+
{
96+
startDate: new Date(Date.now() - 24 * 60 * 60 * 1000),
97+
endDate: new Date(),
98+
},
99+
'hour'
100+
);
101+
102+
timeSeries.buckets.forEach((bucket) => {
103+
console.log(
104+
`${bucket.timestamp}: ${bucket.successRate}% success, ` +
105+
`${bucket.averageResponseTime}ms avg`
106+
);
107+
});
108+
})();
109+
```

0 commit comments

Comments
 (0)