create-izi-noir 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +14 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16,10 +16,13 @@ var TEMPLATES = [
|
|
|
16
16
|
{ title: "Minimal (empty circuit)", value: "minimal" },
|
|
17
17
|
{ title: "Balance Proof only", value: "balance-proof" }
|
|
18
18
|
];
|
|
19
|
-
var
|
|
20
|
-
{ title: "
|
|
21
|
-
{ title: "
|
|
19
|
+
var NETWORKS = [
|
|
20
|
+
{ title: "Solana (recommended)", value: "solana", description: "Uses Groth16 for on-chain verification" },
|
|
21
|
+
{ title: "EVM (Ethereum, Base, etc.)", value: "evm", description: "Uses UltraHonk proofs" }
|
|
22
22
|
];
|
|
23
|
+
function networkToProvider(network) {
|
|
24
|
+
return network === "solana" ? "arkworks" : "barretenberg";
|
|
25
|
+
}
|
|
23
26
|
async function promptProjectOptions(defaults) {
|
|
24
27
|
console.log();
|
|
25
28
|
console.log(pc.bold(pc.cyan(" IZI-NOIR")) + " - Privacy-preserving toolkit for Solana");
|
|
@@ -50,10 +53,10 @@ async function promptProjectOptions(defaults) {
|
|
|
50
53
|
},
|
|
51
54
|
{
|
|
52
55
|
type: "select",
|
|
53
|
-
name: "
|
|
54
|
-
message: "
|
|
55
|
-
choices:
|
|
56
|
-
initial:
|
|
56
|
+
name: "network",
|
|
57
|
+
message: "Where will you verify proofs?",
|
|
58
|
+
choices: NETWORKS,
|
|
59
|
+
initial: 0
|
|
57
60
|
},
|
|
58
61
|
{
|
|
59
62
|
type: "confirm",
|
|
@@ -74,10 +77,11 @@ async function promptProjectOptions(defaults) {
|
|
|
74
77
|
throw new Error("Operation cancelled");
|
|
75
78
|
}
|
|
76
79
|
});
|
|
80
|
+
const network = response.network || "solana";
|
|
77
81
|
return {
|
|
78
82
|
projectName: defaults.projectName || response.projectName,
|
|
79
83
|
template: response.template || defaults.template || "default",
|
|
80
|
-
provider:
|
|
84
|
+
provider: networkToProvider(network),
|
|
81
85
|
skipInstall: response.installDeps === false,
|
|
82
86
|
skipGit: response.initGit === false
|
|
83
87
|
};
|
|
@@ -333,11 +337,11 @@ function generateTestScript(options) {
|
|
|
333
337
|
*
|
|
334
338
|
* Run with: npm test
|
|
335
339
|
*/
|
|
336
|
-
import { IziNoir, Provider, AcornParser, generateNoir } from '@izi-noir/sdk';
|
|
340
|
+
import { IziNoir, Provider, AcornParser, generateNoir, type CircuitFunction } from '@izi-noir/sdk';
|
|
337
341
|
${imports}
|
|
338
342
|
|
|
339
343
|
// Helper to convert JS circuit function to Noir code
|
|
340
|
-
function toNoir(circuitFn:
|
|
344
|
+
function toNoir(circuitFn: CircuitFunction): string {
|
|
341
345
|
const parser = new AcornParser();
|
|
342
346
|
const parsed = parser.parse(circuitFn, [], []);
|
|
343
347
|
return generateNoir(parsed);
|