naracli 1.0.71 → 1.0.72
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/nara-cli-bundle.cjs +14 -2
- package/package.json +1 -1
- package/src/cli/index.ts +6 -1
package/dist/nara-cli-bundle.cjs
CHANGED
|
@@ -173706,6 +173706,7 @@ function registerConfigCommands(program3) {
|
|
|
173706
173706
|
|
|
173707
173707
|
// src/cli/index.ts
|
|
173708
173708
|
init_nara_sdk();
|
|
173709
|
+
var import_meta4 = {};
|
|
173709
173710
|
async function pollConfirmation2(connection, signature, timeoutMs = 15e3, intervalMs = 1e3) {
|
|
173710
173711
|
const start = Date.now();
|
|
173711
173712
|
while (Date.now() - start < timeoutMs) {
|
|
@@ -173781,9 +173782,20 @@ function registerCommands(program3) {
|
|
|
173781
173782
|
process.exit(1);
|
|
173782
173783
|
}
|
|
173783
173784
|
printInfo("Generating ZK proof...");
|
|
173785
|
+
const _getMetaUrl2 = () => {
|
|
173786
|
+
try {
|
|
173787
|
+
return import_meta4.url;
|
|
173788
|
+
} catch {
|
|
173789
|
+
return void 0;
|
|
173790
|
+
}
|
|
173791
|
+
};
|
|
173792
|
+
const zkOptions = _getMetaUrl2() ? void 0 : {
|
|
173793
|
+
circuitWasmPath: (await import("node:path")).join(__dirname, "zk", "answer_proof.wasm"),
|
|
173794
|
+
zkeyPath: (await import("node:path")).join(__dirname, "zk", "answer_proof_final.zkey")
|
|
173795
|
+
};
|
|
173784
173796
|
let proof;
|
|
173785
173797
|
try {
|
|
173786
|
-
proof = await generateProof2(answer, quest.answerHash, wallet.publicKey, quest.round);
|
|
173798
|
+
proof = await generateProof2(answer, quest.answerHash, wallet.publicKey, quest.round, zkOptions);
|
|
173787
173799
|
} catch (err) {
|
|
173788
173800
|
if (err.message?.includes("Assert Failed")) {
|
|
173789
173801
|
printError("Wrong answer. Try again with the correct answer.");
|
|
@@ -173932,7 +173944,7 @@ function registerCommands(program3) {
|
|
|
173932
173944
|
}
|
|
173933
173945
|
|
|
173934
173946
|
// bin/nara-cli.ts
|
|
173935
|
-
var version2 = true ? "1.0.
|
|
173947
|
+
var version2 = true ? "1.0.72" : "dev";
|
|
173936
173948
|
var program2 = new Command();
|
|
173937
173949
|
program2.name("naracli").description("CLI for the Nara chain. Native coin is NARA (not SOL). Mine NARA for free via PoMI quests, manage wallets, register agents, and more. Run 'naracli <command> --help' for details on any command.").version(version2);
|
|
173938
173950
|
program2.option("-r, --rpc-url <url>", "RPC endpoint (default: https://mainnet-api.nara.build/)").option("-w, --wallet <path>", "Path to wallet keypair JSON file (default: ~/.config/nara/id.json)").option("-j, --json", "Output in JSON format");
|
package/package.json
CHANGED
package/src/cli/index.ts
CHANGED
|
@@ -157,9 +157,14 @@ export function registerCommands(program: Command): void {
|
|
|
157
157
|
|
|
158
158
|
// Generate ZK proof
|
|
159
159
|
printInfo("Generating ZK proof...");
|
|
160
|
+
const _getMetaUrl = () => { try { return import.meta.url; } catch { return undefined; } };
|
|
161
|
+
const zkOptions = _getMetaUrl() ? undefined : {
|
|
162
|
+
circuitWasmPath: (await import("node:path")).join(__dirname, "zk", "answer_proof.wasm"),
|
|
163
|
+
zkeyPath: (await import("node:path")).join(__dirname, "zk", "answer_proof_final.zkey"),
|
|
164
|
+
};
|
|
160
165
|
let proof;
|
|
161
166
|
try {
|
|
162
|
-
proof = await generateProof(answer, quest.answerHash, wallet.publicKey, quest.round);
|
|
167
|
+
proof = await generateProof(answer, quest.answerHash, wallet.publicKey, quest.round, zkOptions);
|
|
163
168
|
} catch (err: any) {
|
|
164
169
|
if (err.message?.includes("Assert Failed")) {
|
|
165
170
|
printError("Wrong answer. Try again with the correct answer.");
|