Skip to content

Commit

Permalink
Added simple README
Browse files Browse the repository at this point in the history
  • Loading branch information
KyrylR committed Apr 12, 2024
1 parent b0fd436 commit 9c5c622
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 4 deletions.
41 changes: 39 additions & 2 deletions README.md
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.
1 change: 0 additions & 1 deletion bunfig.toml
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 }
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export async function runCLI() {

program.addOption(
new Option(
"-c, --config <path>",
"-p, --path <path>",
"The path to the directory within the project root where the processor will search for circuits.",
).default("circuits"),
);
Expand Down

0 comments on commit 9c5c622

Please sign in to comment.