From 080991e8cce66ce666ed64dd948657b88ce01749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?= Date: Fri, 30 Aug 2024 21:48:57 +0200 Subject: [PATCH] docs: fixed typos for encrypt docs: fixed typos docs: fixed typo --- docs/fundamentals/inputs.md | 14 +++++++++++--- docs/references/fhevmjs.md | 18 +++++++++++++----- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/docs/fundamentals/inputs.md b/docs/fundamentals/inputs.md index 3d543b5e..dcd3b7b4 100644 --- a/docs/fundamentals/inputs.md +++ b/docs/fundamentals/inputs.md @@ -27,9 +27,17 @@ On client side for the previous function, using [fhevmjs](https://github.com/zam const instance = await createInstance({ networkUrl: "http://localhost:8545" }); const input = instance.createEncryptedInput(contractAddress, userAddress); -const { inputs, data } = input.add64(64).addBool(true).add8(4).encrypt(); // Encrypt the three parameters - -contract.myExample("0xa5e1defb98EFe38EBb2D958CEe052410247F4c80", inputs[0], 32, inputs[1], inputs[2], data); +const inputs = input.add64(64).addBool(true).add8(4).encrypt(); // Encrypt the three parameters + +contract.myExample( + "0xa5e1defb98EFe38EBb2D958CEe052410247F4c80", + inputs.handles[0], + 32, + inputs.handles[1], + inputs.handles[2], + true, + inputs.inputProof, +); ``` ### Validate input diff --git a/docs/references/fhevmjs.md b/docs/references/fhevmjs.md index 7118cbe0..e3b4c49e 100644 --- a/docs/references/fhevmjs.md +++ b/docs/references/fhevmjs.md @@ -59,7 +59,7 @@ An input can include **multiple values of various types**, resulting in a single const userAddress = "0xa5e1defb98EFe38EBb2D958CEe052410247F4c80"; const contractAddress = "0xfCefe53c7012a075b8a711df391100d9c431c468"; -const input = instance.createEncryptedInput(userAddress, contractAddress); +const input = instance.createEncryptedInput(contractAddress, userAddress); ``` ### input.addBool, input.add8, ... @@ -75,7 +75,7 @@ Input object has different method to add values: - `addAddress` ```javascript -const input = instance.createEncryptedInput(userAddress, contractAddress); +const input = instance.createEncryptedInput(contractAddress, userAddress); input.addBool(true); input.add16(239); @@ -91,9 +91,17 @@ These methods process values and return the necessary data for use on the blockc input.addBool(true); input.addBool(true); input.add8(4); -const { inputs, data } = input.encrypt(); // or input.send() if using a coprocessor - -contract.myExample("0xa5e1defb98EFe38EBb2D958CEe052410247F4c80", inputs[0], 32, inputs[1], inputs[2], data); +const inputs = input.encrypt(); // or input.send() if using a coprocessor + +contract.myExample( + "0xa5e1defb98EFe38EBb2D958CEe052410247F4c80", + inputs.handles[0], + 32, + inputs.handles[1], + inputs.handles[2], + true, + inputs.inputProof, +); ``` ## Reencryption