From e66b3c8c5c715c0766ad37187fdc1ed090054cea Mon Sep 17 00:00:00 2001 From: dark64 Date: Mon, 23 Jan 2023 13:21:39 +0100 Subject: [PATCH] update book --- zokrates_book/src/toolbox/zokrates_js.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/zokrates_book/src/toolbox/zokrates_js.md b/zokrates_book/src/toolbox/zokrates_js.md index 953e662e..6296db61 100644 --- a/zokrates_book/src/toolbox/zokrates_js.md +++ b/zokrates_book/src/toolbox/zokrates_js.md @@ -8,17 +8,14 @@ npm install zokrates-js ## Importing -##### Bundlers -**Note:** As this library uses a model where the wasm module itself is natively an ES module, you will need a bundler of some form. -Currently the only known bundler known to be fully compatible with `zokrates-js` is [Webpack](https://webpack.js.org/) (`experiments.syncWebAssembly` must be enabled). -The choice of this default was done to reflect the trends of the JS ecosystem. +##### ES modules ```js import { initialize } from 'zokrates-js'; ``` -##### Node +##### CommonJS ```js -const { initialize } = require('zokrates-js') +let { initialize } = await import('zokrates-js'); ``` ## Example @@ -201,3 +198,11 @@ Parameters: * `verificationKey` - Verification key from the setup keypair Returns: `string` + +##### utils.formatProof(proof) +Formats the proof into an array of field elements that are compatible as input to the generated solidity contract + +Parameters: +* `proof` - Generated proof + +Returns: `array` \ No newline at end of file