Optional
defaultPrivate
_authOptional
authPrivate
_decryptPrivate
_getRetrieves the fallback IPFS code for a given IPFS ID.
The base64-encoded fallback IPFS code.
An error if the code retrieval fails.
the gateway url.
The IPFS ID.
Private
_getPrivate
_isCheck if a session key needs to be resigned. These are the scenarios where a session key needs to be resigned:
Authenticates an Auth Method for claiming a Programmable Key Pair (PKP). A MintCallback can be defined for custom on chain interactions by default the callback will forward to a relay server for minting on chain.
an Auth Method and MintCallback
Combine Shares from network public key set and signature shares
final JWT (convert the sig to base64 and append to the jwt)
Decrypt ciphertext with the LIT network.
Encrypt data using the LIT network public key.
The encrypted ciphertext and the hash of the data
if the LIT node client is not ready
if the subnetPubKey is null
Execute JS on the nodes and combine and return any resulting signatures
Private
executeGenerates a promise by sending a command to the Lit node
A promise that resolves with the response from the server.
The URL to send the command to.
The parameters to include in the command.
The ID of the request.
Generates a session capability object
A Promise resolving to an ISessionCapabilityObject.
An array of ILitResource to be processed.
Optional
debug?: booleanRetrieves session signatures specifically for Lit Actions.
Unlike getPkpSessionSigs
, this function requires either litActionCode
or litActionIpfsId
, and jsParams
must be provided.
A promise that resolves with the session signatures.
The parameters required for retrieving the session signatures.
Retrieves the PKP sessionSigs.
A promise that resolves to the PKP sessionSigs.
An error if any of the required parameters are missing or if litActionCode
and ipfsId
exist at the same time.
The parameters for retrieving the PKP sessionSigs.
Try to get the session key in the local storage, if not, generates one.
session key pair
Retrieves or generates sessionSigs (think access token) for accessing Lit Network resources.
How this function works on a high level:
AuthSig
that specifies the session abilitiesThe process follows these steps:
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.sessionSigs
) by including the device-generated signature and the original message. The sessionSigs
provide access to Lit Network features such as executeJs
and pkpSign
.Note: When generating session signatures for different PKPs or auth methods, be sure to call disconnectWeb3 to clear auth signatures stored in local storage
An example of how this function is used can be found in the Lit developer-guides-code repository here.
Request a signed JWT from the LIT network. Before calling this function, you must know the access control conditions for the item you wish to gain authorization for.
final JWT
Get the signature from local storage, if not, generates one
Check if a given object is of type SessionKeyPair.
True if the object is of type SessionKeyPair.
The object to check.
Use PKP to sign
Run lit action on a single deterministicly selected node. It's important that the nodes use the same deterministic selection algorithm.
Lit Action: dataToHash -> IPFS CID QmUjX8MW6StQ7NKNdaS6g4RMkvN5hcgtKmEi8Mca6oX4t3
Sign a session public key using a PKP, which generates an authSig.
An object containing the resulting signature.
Static
generateGenerates wildcard capability for each of the LIT resources specified.
is an array of LIT resources
Optional
addAllCapabilities: booleanis a boolean that specifies whether to add all capabilities for each resource
Static
getGenerated using TypeDoc
========== PKP ==========