-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
40 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,51 @@ | ||
[![npm](https://img.shields.io/npm/v/@solarity/zktype.svg)](https://www.npmjs.com/package/@solarity/zktype) | ||
|
||
# ZKType | ||
# ZKType | ||
|
||
## What | ||
ZKType is a package that provides a quick and easy way to generate TypeScript bindings for simplifying interaction with | ||
the SnarkJS library. | ||
|
||
## Installation | ||
|
||
To install the package, run: | ||
|
||
```bash | ||
npm install --save-dev @solarity/zktype | ||
``` | ||
|
||
## Usage | ||
|
||
If all of your circuits are in the `circuits` folder, simply run the following command to generate TypeScript bindings | ||
for the Circom circuits: | ||
|
||
```bash | ||
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: | ||
|
||
```bash | ||
npx zktype --path ./src | ||
``` | ||
|
||
or simply: | ||
|
||
```bash | ||
npx zktype -p ./src | ||
``` | ||
|
||
To learn more about available commands, run: | ||
|
||
```bash | ||
npx zktype --help | ||
``` | ||
|
||
## How it works | ||
|
||
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. | ||
|
||
## Known limitations | ||
|
||
* Currently, after each run, all circuits will be recompiled without checking if a circuit has changed or not. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
[test] | ||
coverage = true | ||
# to require 90% line-level and function-level coverage | ||
coverageThreshold = { lines = 0.95, functions = 0.95 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters