ZKType - unleash TypeScript bindings for Circom circuits.
To install the package, run:
npm install --save-dev @solarity/zktype
If all of your circuits are in the circuits
folder, simply run the following command to generate TypeScript bindings
for the Circom circuits:
npx zktype
By default, the script will look for circuits inside the circuits
folder. If you wish to specify another folder
to look for circuits, you can use the following command:
npx zktype --path ./src
To learn more about available commands, run:
npx zktype --help
Under the hood, ZKType uses the @distributedlab/circom2
package, which contains a WASM-compiled Circom compiler.
It uses this compiler to extract ASTs from all the circuits, generate artifacts, and then generate types based on these artifacts.
- Currently, after each run, all circuits will be recompiled without checking if a circuit has changed or not.