Table of Contents
- Welcome
- Encryption
- Encrypt
- Decrypt
- PKP Keys
- getPrivateKey
- getLitActionPrivateKey
- getLitActionPublicKey
- getLitActionWalletAddress
- Action Utilities
- setResponse
- Runtime Globals
- LitActions
- ethers
Welcome
Welcome to the Lit Actions SDK Docs. These functions can be used inside a Lit Action. You should prefix each function with “Lit.Actions.” so to call “encrypt()” you should do “Lit.Actions.encrypt()” To understand how these functions fit together, please view the Quick Start guide and Lit Actions overviewEncryption
Encryption and decryption functions. These functions are used to encrypt and decrypt data. The data is encrypted & decrypted using a symmetric key derived from the secret key of the PKP.Lit.Actions.Encrypt
Parameters
Returns Promise<string> The ciphertextLit.Actions.Decrypt
Decrypt data using AES with a symmetric keyParameters
-
paramsObject
PKP Keys
Key management functions for PKPs. These functions are used to get keys for PKPs that can be used in javascript functions.Lit.Actions.getPrivateKey
Get the private key for a PKP walletParameters
Returns Promise<string> The private key secretLit.Actions.getLitActionPrivateKey
Get the private key for the currently executing Lit Action Returns Promise<string> The private key secretLit.Actions.getLitActionPublicKey
Get the public key for a Lit Action by IPFS IDParameters
Returns Promise<string> The public keyLit.Actions.getLitActionWalletAddress
Get the wallet address for a Lit Action by IPFS IDParameters
Returns Promise<string> The wallet addressAction Utilities
Helpers available inside actions asLit.Actions.*.
Lit.Actions.setResponse
Set the response returned to the clientParameters
-
paramsObjectparams.responseany The response to send to the client. If this is not a string, it will be JSON-encoded before being sent. A value of undefined is encoded as null.
Runtime Globals
Globals automatically available inside the Lit Action runtime.LitActions
Global reference to the Lit Actions namespace for convenience. This alias is injected in the Lit Action execution environment and mirrorsLit.Actions.