Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
KyrylR committed Nov 4, 2024
1 parent 9735c9c commit 4a6286d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ This config contains all the information required to generate TypeScript binding

- `basePath` - Path to the root directory of the project where circuits are stored.
- `projectRoot` - Absolute path to the root directory of the project.
- `circuitsArtifactsPaths` - Array of paths to the circuits' Artifact files.
- `circuitsArtifactsPaths` - Array of paths to the circuits' artifact files.
- `outputTypesDir` - Path to the directory where the generated types will be stored.
- Optional. Default: `generated-types/circuits`.

Expand All @@ -53,18 +53,21 @@ const generator = new CircuitTypesGenerator(config);
await generator.generateTypes();
```

Also, this function generates the `hardhat.d.ts` file, where you can find all of the possible objects that can be retrieved by the function below.
Also, this function generates the `hardhat.d.ts` file, where you can find all the possible objects that can be retrieved by the function below.

#### getCircuitObject(circuitName: string): Promise<any>
#### getCircuitObject(circuitName: string, protocolType?: string): Promise<any>

Returns the constructible object for the given circuit.

```typescript
const generator = new CircuitTypesGenerator(config);
await generator.generateTypes();
const circuitObject = await generator.getCircuitObject("MyCircuit");
const circuitObject = await generator.getCircuitObject("MyCircuit", "groth16");
```

The package supports generation of circuits by the `groth16` and `plonk` protocols at the same time.
In this case, you will have to specify the protocol type when retrieving the object.

After the `circuitObject` is retrieved, check out the [zkit](https://github.com/dl-solarity/zkit) documentation to see how to work with it.

To ensure that the object can be imported, check the `hardhat.d.ts` file.

0 comments on commit 4a6286d

Please sign in to comment.