From e737d04f085f5163202ef1679e58b3d613e980fe Mon Sep 17 00:00:00 2001 From: Wyatt Barnes Date: Fri, 31 May 2024 14:18:40 -1000 Subject: [PATCH 1/2] Update required NodeJS version to 20 in README --- decrypt-api-key-in-action/README.md | 46 +++++++++++++++-------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/decrypt-api-key-in-action/README.md b/decrypt-api-key-in-action/README.md index f4d68d94..f6787854 100644 --- a/decrypt-api-key-in-action/README.md +++ b/decrypt-api-key-in-action/README.md @@ -4,10 +4,11 @@ This example shows how you can encrypt an api key on the client with specific de Before running, there are two variables to configure within `index.ts`: -**Note: ts-node-esm requires NodeJS version 19** +**Note: ts-node-esm requires NodeJS version 20** + ```js const url = ``; -const key = ''; +const key = ""; ``` ## Restricting your api key to only be used by a single Lit Action @@ -16,17 +17,17 @@ Within the code you will see the below ACC condition: ```js const accessControlConditions = [ - { - contractAddress: '', - standardContractType: '', - chain, - method: 'eth_getBalance', - parameters: [':userAddress', 'latest'], - returnValueTest: { - comparator: '>=', - value: '0', - }, + { + contractAddress: "", + standardContractType: "", + chain, + method: "eth_getBalance", + parameters: [":userAddress", "latest"], + returnValueTest: { + comparator: ">=", + value: "0", }, + }, ]; ``` @@ -34,17 +35,18 @@ You can change the above to the below to use the parameter: `:currentActionId` w ```js const accessControlConditions = [ - { - contractAddress: '', - standardContractType: '', - chain, - method: 'eth_getBalance', - parameters: [':currentActionId', 'latest'], - returnValueTest: { - comparator: '==', - value: '', - }, + { + contractAddress: "", + standardContractType: "", + chain, + method: "eth_getBalance", + parameters: [":currentActionId", "latest"], + returnValueTest: { + comparator: "==", + value: "", }, + }, ]; ``` + For easy upload of your Lit Action source code you can use the explorer [here](https://explorer.litprotocol.com/create-action) From a9558fdce5d6a7b83b006bf2a33e679367458614 Mon Sep 17 00:00:00 2001 From: Wyatt Barnes Date: Fri, 31 May 2024 14:18:51 -1000 Subject: [PATCH 2/2] Correct start script --- decrypt-api-key-in-action/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/decrypt-api-key-in-action/package.json b/decrypt-api-key-in-action/package.json index fe490752..f5a3d45f 100644 --- a/decrypt-api-key-in-action/package.json +++ b/decrypt-api-key-in-action/package.json @@ -16,6 +16,6 @@ "siwe": "^2.0.0" }, "scripts": { - "start": "ts-node-esm src/index.ts" + "start": "node --loader ts-node/esm src/index.ts" } }