nara-sdk 1.0.34 → 1.0.35
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/package.json +1 -1
- package/src/quest.ts +8 -0
package/package.json
CHANGED
package/src/quest.ts
CHANGED
|
@@ -264,11 +264,18 @@ export async function hasAnswered(
|
|
|
264
264
|
/**
|
|
265
265
|
* Generate a ZK proof for a quest answer.
|
|
266
266
|
* Throws if the answer is wrong (circuit assertion fails).
|
|
267
|
+
*
|
|
268
|
+
* @param answer - The answer string (passed directly as circuit input)
|
|
269
|
+
* @param answerHash - The on-chain answer hash bytes
|
|
270
|
+
* @param userPubkey - The user's public key (binds proof to user)
|
|
271
|
+
* @param round - The quest round number (binds proof to round, prevents replay)
|
|
272
|
+
* @param options - Optional circuit paths
|
|
267
273
|
*/
|
|
268
274
|
export async function generateProof(
|
|
269
275
|
answer: string,
|
|
270
276
|
answerHash: number[],
|
|
271
277
|
userPubkey: PublicKey,
|
|
278
|
+
round: string,
|
|
272
279
|
options?: QuestOptions
|
|
273
280
|
): Promise<{ solana: ZkProof; hex: ZkProofHex }> {
|
|
274
281
|
const wasmPath = options?.circuitWasmPath ?? process.env.QUEST_CIRCUIT_WASM ?? DEFAULT_CIRCUIT_WASM;
|
|
@@ -285,6 +292,7 @@ export async function generateProof(
|
|
|
285
292
|
answer_hash: answerHashFieldStr,
|
|
286
293
|
pubkey_lo: lo,
|
|
287
294
|
pubkey_hi: hi,
|
|
295
|
+
round: round,
|
|
288
296
|
},
|
|
289
297
|
wasmPath,
|
|
290
298
|
zkeyPath
|