@lit-protocol/lit-node-client-nodejs
Advanced tools
Comparing version
@@ -27,3 +27,3 @@ { | ||
], | ||
"version": "6.10.0", | ||
"version": "6.11.0", | ||
"dependencies": { | ||
@@ -38,2 +38,3 @@ "@cosmjs/amino": "0.30.1", | ||
"@ethersproject/transactions": "5.7.0", | ||
"@lit-protocol/accs-schemas": "^0.0.15", | ||
"@lit-protocol/contracts": "^0.0.63", | ||
@@ -55,20 +56,20 @@ "ajv": "^8.12.0", | ||
"util": "0.12.5", | ||
"@lit-protocol/access-control-conditions": "6.10.0", | ||
"@lit-protocol/auth-helpers": "6.10.0", | ||
"@lit-protocol/bls-sdk": "6.10.0", | ||
"@lit-protocol/constants": "6.10.0", | ||
"@lit-protocol/contracts-sdk": "6.10.0", | ||
"@lit-protocol/core": "6.10.0", | ||
"@lit-protocol/crypto": "6.10.0", | ||
"@lit-protocol/ecdsa-sdk": "6.10.0", | ||
"@lit-protocol/encryption": "6.10.0", | ||
"@lit-protocol/logger": "6.10.0", | ||
"@lit-protocol/misc": "6.10.0", | ||
"@lit-protocol/misc-browser": "6.10.0", | ||
"@lit-protocol/nacl": "6.10.0", | ||
"@lit-protocol/sev-snp-utils-sdk": "6.10.0", | ||
"@lit-protocol/types": "6.10.0", | ||
"@lit-protocol/uint8arrays": "6.10.0" | ||
"@lit-protocol/access-control-conditions": "6.11.0", | ||
"@lit-protocol/auth-helpers": "6.11.0", | ||
"@lit-protocol/bls-sdk": "6.11.0", | ||
"@lit-protocol/constants": "6.11.0", | ||
"@lit-protocol/contracts-sdk": "6.11.0", | ||
"@lit-protocol/core": "6.11.0", | ||
"@lit-protocol/crypto": "6.11.0", | ||
"@lit-protocol/ecdsa-sdk": "6.11.0", | ||
"@lit-protocol/encryption": "6.11.0", | ||
"@lit-protocol/logger": "6.11.0", | ||
"@lit-protocol/misc": "6.11.0", | ||
"@lit-protocol/misc-browser": "6.11.0", | ||
"@lit-protocol/nacl": "6.11.0", | ||
"@lit-protocol/sev-snp-utils-sdk": "6.11.0", | ||
"@lit-protocol/types": "6.11.0", | ||
"@lit-protocol/uint8arrays": "6.11.0" | ||
}, | ||
"main": "./src/index.js" | ||
} |
@@ -197,4 +197,5 @@ import { ILitResource, ISessionCapabilityObject, LitAccessControlConditionResource, LitResourceAbilityRequest } from '@lit-protocol/auth-helpers'; | ||
/** | ||
* Get session signatures for a set of [Lit resources](https://v6-api-doc-lit-js-sdk.vercel.app/interfaces/types_src.ILitResource.html#resource). | ||
* | ||
* Retrieves or generates sessionSigs (think access token) for accessing Lit Network resources. | ||
* | ||
* How this function works on a high level: | ||
@@ -205,7 +206,13 @@ * 1. Generate or retrieve [session keys](https://v6-api-doc-lit-js-sdk.vercel.app/interfaces/types_src.SessionKeyPair.html) (a public and private key pair) | ||
* | ||
* The process follows these steps: | ||
* 1. Retrieves or generates a session key pair (Ed25519) for the user's device. The session key is either fetched from local storage or newly created if not found. The key does not expire. | ||
* 2. Generates an authentication signature (`authSig`) by signing an ERC-5573 “Sign-in with Ethereum” message, which includes resource ability requests, capabilities, expiration, the user's device session public key, and a nonce. The `authSig` is retrieved from local storage, and if it has expired, the user will be prompted to re-sign. | ||
* 3. Uses the session private key to sign the session public key along with the resource ability requests, capabilities, issuedAt, and expiration details. This creates a device-generated signature. | ||
* 4. Constructs the session signatures (`sessionSigs`) by including the device-generated signature and the original message. The `sessionSigs` provide access to Lit Network features such as `executeJs` and `pkpSign`. | ||
* | ||
* See Sequence Diagram: https://www.plantuml.com/plantuml/uml/VPH1RnCn48Nl_XLFlT1Av00eGkm15QKLWY8K9K9SO-rEar4sjcLFalBl6NjJAuaMRl5utfjlPjQvJsAZx7UziQtuY5-9eWaQufQ3TOAR77cJy407Rka6zlNdHTRouUbIzSEtjiTIBUswg5v_NwMnuAVlA9KKFPN3I0x9qSSj7bqNF3iPykl9c4o9oUSJMuElv2XQ8IHAYRt3bluWM8wuVUpUJwVlFjsP8JUh5B_1DyV2AYdD6DjhLsTQTaYd3W3ad28SGWqM997fG5ZrB9DJqOaALuRwH1TMpik8tIYze-E8OrPKU5I6cMqtem2kCqOhr4vdaRAvtSjcoMkTo68scKu_Vi1EPMfrP_xVtj7sFMaHNg-6GVqk0MW0z18uKdVULTvDWtdqko28b7KktvUB2hKOBd1asU2QgDfTzrj7T4bLPdv6TR0zLwPQKkkZpIRTY4CTMbrBpg_VKuXyi49beUAHqIlirOUrL2zq9JPPdpRR5OMLVQGoGlLcjyRyQNv6MHz4W_fG42W--xWhUfNyOxiLL1USS6lRLeyAkYLNjrkVJuClm_qp5I8Lq0krUw7lwIt2DgY9oiozrjA_Yhy0 | ||
* | ||
* Note: When generating session signatures for different PKPs or auth methods, | ||
* be sure to call disconnectWeb3 to clear auth signatures stored in local storage | ||
* | ||
* | ||
* @param { GetSessionSigsProps } params | ||
@@ -212,0 +219,0 @@ * |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
206780
1.64%2670
0.75%41
2.5%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated
Updated
Updated
Updated
Updated