Skip to content
This repository has been archived by the owner on Jun 25, 2023. It is now read-only.

Latest commit

 

History

History
67 lines (39 loc) · 2.84 KB

integration.md

File metadata and controls

67 lines (39 loc) · 2.84 KB

Table of Contents

encryptAndWrite

Encrypts using Lit and then writes using Ceramic whatever the module user inputs (as long as it is a string for now)

Parameters

  • toEncrypt String what the module user wants to encrypt and store on ceramic
  • accessControlConditions Array<Object> the access control conditions that govern who is able to decrypt this data. See the docs here for examples: https://developer.litprotocol.com/docs/SDK/accessControlConditionExamples
  • accessControlConditionType String the access control condition type you are using. Pass accessControlConditions for traditional access control conditions. This is the default if you don't pass anything. Pass evmContractConditions for custom smart contract access control conditions (optional, default "accessControlConditions")

Returns Promise<String> A promise that resolves to a streamID for the encrypted data that's been stored

readAndDecrypt

Retrieves a stream and decrypts message then returns to user

Parameters

  • streamID String the streamID of the encrypted data the user wants to access

Returns Promise<String> A promise that resolves to the unencrypted string of what was stored

updateAccess

Retrieves a stream and decrypts message then returns to user

Parameters

  • streamID String the streamID of the encrypted data that you want to update the access control conditions for
  • newAccessControlConditions Array<Object>
  • accessControlConditions Array<Object> the access control conditions that govern who is able to decrypt this data. Note that you cannot change the accessControlConditionType using this method, and you must use the same condition type that was used when you ran encryptAndWrite. See the docs here for examples of accessControlConditions: https://developer.litprotocol.com/docs/SDK/accessControlConditionExamples

Returns Promise<String> A promise that resolves to the unencrypted string of what was stored