@provablehq/wasm 0.10.4 → 0.10.5

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.
@@ -303,38 +303,6 @@ function addBorrowedObject(obj) {
303
303
  heap[--stack_pointer] = obj;
304
304
  return stack_pointer;
305
305
  }
306
- /**
307
- * Verify a batch SNARK proof against multiple verifying keys and their corresponding public inputs.
308
- *
309
- * This function verifies a batch proof produced by Aleo programs that may not be deployed on chain.
310
- * Each verifying key is paired with one or more sets of public inputs (instances).
311
- *
312
- * @param {Array<string>} verifying_keys Array of verifying key strings, one per circuit
313
- * @param {Array<Array<Array<string>>>} inputs 3D array of field element strings [circuit_idx][instance_idx][field_idx]
314
- * @param {Proof} proof The batch proof to verify
315
- * @returns {boolean} True if the batch proof is valid, false otherwise
316
- * @param {Array<any>} verifying_keys
317
- * @param {Array<any>} inputs
318
- * @param {Proof} proof
319
- * @returns {boolean}
320
- */
321
- function snarkVerifyBatch(verifying_keys, inputs, proof) {
322
- try {
323
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
324
- _assertClass(proof, Proof);
325
- wasm.snarkVerifyBatch(retptr, addHeapObject(verifying_keys), addHeapObject(inputs), proof.__wbg_ptr);
326
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
327
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
328
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
329
- if (r2) {
330
- throw takeObject(r1);
331
- }
332
- return r0 !== 0;
333
- } finally {
334
- wasm.__wbindgen_add_to_stack_pointer(16);
335
- }
336
- }
337
-
338
306
  /**
339
307
  * Verify an execution. Executions with multiple transitions must have the program source code and
340
308
  * verifying keys of imported functions supplied from outside to correctly verify. Also, this does
@@ -410,6 +378,38 @@ function snarkVerify(verifying_key, inputs, proof) {
410
378
  }
411
379
  }
412
380
 
381
+ /**
382
+ * Verify a batch SNARK proof against multiple verifying keys and their corresponding public inputs.
383
+ *
384
+ * This function verifies a batch proof produced by Aleo programs that may not be deployed on chain.
385
+ * Each verifying key is paired with one or more sets of public inputs (instances).
386
+ *
387
+ * @param {Array<string>} verifying_keys Array of verifying key strings, one per circuit
388
+ * @param {Array<Array<Array<string>>>} inputs 3D array of field element strings [circuit_idx][instance_idx][field_idx]
389
+ * @param {Proof} proof The batch proof to verify
390
+ * @returns {boolean} True if the batch proof is valid, false otherwise
391
+ * @param {Array<any>} verifying_keys
392
+ * @param {Array<any>} inputs
393
+ * @param {Proof} proof
394
+ * @returns {boolean}
395
+ */
396
+ function snarkVerifyBatch(verifying_keys, inputs, proof) {
397
+ try {
398
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
399
+ _assertClass(proof, Proof);
400
+ wasm.snarkVerifyBatch(retptr, addHeapObject(verifying_keys), addHeapObject(inputs), proof.__wbg_ptr);
401
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
402
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
403
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
404
+ if (r2) {
405
+ throw takeObject(r1);
406
+ }
407
+ return r0 !== 0;
408
+ } finally {
409
+ wasm.__wbindgen_add_to_stack_pointer(16);
410
+ }
411
+ }
412
+
413
413
  /**
414
414
  * @param {string} string
415
415
  * @returns {Field}
@@ -471,16 +471,16 @@ function getArrayJsValueFromWasm0(ptr, len) {
471
471
  }
472
472
  return result;
473
473
  }
474
- function __wasm_bindgen_func_elem_8536(arg0, arg1, arg2) {
475
- wasm.__wasm_bindgen_func_elem_8536(arg0, arg1, addHeapObject(arg2));
474
+ function __wasm_bindgen_func_elem_7201(arg0, arg1) {
475
+ wasm.__wasm_bindgen_func_elem_7201(arg0, arg1);
476
476
  }
477
477
 
478
- function __wasm_bindgen_func_elem_7166(arg0, arg1) {
479
- wasm.__wasm_bindgen_func_elem_7166(arg0, arg1);
478
+ function __wasm_bindgen_func_elem_8569(arg0, arg1, arg2) {
479
+ wasm.__wasm_bindgen_func_elem_8569(arg0, arg1, addHeapObject(arg2));
480
480
  }
481
481
 
482
- function __wasm_bindgen_func_elem_7439(arg0, arg1, arg2, arg3) {
483
- wasm.__wasm_bindgen_func_elem_7439(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
482
+ function __wasm_bindgen_func_elem_7473(arg0, arg1, arg2, arg3) {
483
+ wasm.__wasm_bindgen_func_elem_7473(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
484
484
  }
485
485
 
486
486
  const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
@@ -2223,6 +2223,48 @@ class Boolean {
2223
2223
  }
2224
2224
  if (Symbol.dispose) Boolean.prototype[Symbol.dispose] = Boolean.prototype.free;
2225
2225
 
2226
+ const CallbackQueryFinalization = (typeof FinalizationRegistry === 'undefined')
2227
+ ? { register: () => {}, unregister: () => {} }
2228
+ : new FinalizationRegistry(ptr => wasm.__wbg_callbackquery_free(ptr >>> 0, 1));
2229
+ /**
2230
+ * A query implementation that delegates state fetching to JS callback functions.
2231
+ *
2232
+ * Instead of making direct HTTP calls via reqwest, each QueryTrait method
2233
+ * calls a JS function that returns a Promise. The JS side handles the actual
2234
+ * network request through the configured transport.
2235
+ */
2236
+ class CallbackQuery {
2237
+
2238
+ __destroy_into_raw() {
2239
+ const ptr = this.__wbg_ptr;
2240
+ this.__wbg_ptr = 0;
2241
+ CallbackQueryFinalization.unregister(this);
2242
+ return ptr;
2243
+ }
2244
+
2245
+ free() {
2246
+ const ptr = this.__destroy_into_raw();
2247
+ wasm.__wbg_callbackquery_free(ptr, 0);
2248
+ }
2249
+ /**
2250
+ * Create a new CallbackQuery with JS callback functions.
2251
+ *
2252
+ * @param {Function} get_state_root A function that returns Promise<string> (the state root)
2253
+ * @param {Function} get_state_paths A function that takes string[] (commitments) and returns Promise<string[]> (state paths)
2254
+ * @param {Function} get_block_height A function that returns Promise<number> (the block height)
2255
+ * @param {Function} get_state_root
2256
+ * @param {Function} get_state_paths
2257
+ * @param {Function} get_block_height
2258
+ */
2259
+ constructor(get_state_root, get_state_paths, get_block_height) {
2260
+ const ret = wasm.callbackquery_new(addHeapObject(get_state_root), addHeapObject(get_state_paths), addHeapObject(get_block_height));
2261
+ this.__wbg_ptr = ret >>> 0;
2262
+ CallbackQueryFinalization.register(this, this.__wbg_ptr, this);
2263
+ return this;
2264
+ }
2265
+ }
2266
+ if (Symbol.dispose) CallbackQuery.prototype[Symbol.dispose] = CallbackQuery.prototype.free;
2267
+
2226
2268
  const CiphertextFinalization = (typeof FinalizationRegistry === 'undefined')
2227
2269
  ? { register: () => {}, unregister: () => {} }
2228
2270
  : new FinalizationRegistry(ptr => wasm.__wbg_ciphertext_free(ptr >>> 0, 1));
@@ -10367,10 +10409,10 @@ class ProgramManager {
10367
10409
  * @param {VerifyingKey | null} [join_verifying_key]
10368
10410
  * @param {ProvingKey | null} [fee_proving_key]
10369
10411
  * @param {VerifyingKey | null} [fee_verifying_key]
10370
- * @param {OfflineQuery | null} [offline_query]
10412
+ * @param {QueryOption | null} [query]
10371
10413
  * @returns {Promise<Transaction>}
10372
10414
  */
10373
- static buildJoinTransaction(private_key, record_1, record_2, priority_fee_credits, fee_record, url, join_proving_key, join_verifying_key, fee_proving_key, fee_verifying_key, offline_query) {
10415
+ static buildJoinTransaction(private_key, record_1, record_2, priority_fee_credits, fee_record, url, join_proving_key, join_verifying_key, fee_proving_key, fee_verifying_key, query) {
10374
10416
  _assertClass(private_key, PrivateKey);
10375
10417
  _assertClass(record_1, RecordPlaintext);
10376
10418
  var ptr0 = record_1.__destroy_into_raw();
@@ -10404,9 +10446,9 @@ class ProgramManager {
10404
10446
  ptr7 = fee_verifying_key.__destroy_into_raw();
10405
10447
  }
10406
10448
  let ptr8 = 0;
10407
- if (!isLikeNone(offline_query)) {
10408
- _assertClass(offline_query, OfflineQuery);
10409
- ptr8 = offline_query.__destroy_into_raw();
10449
+ if (!isLikeNone(query)) {
10450
+ _assertClass(query, QueryOption);
10451
+ ptr8 = query.__destroy_into_raw();
10410
10452
  }
10411
10453
  const ret = wasm.programmanager_buildJoinTransaction(private_key.__wbg_ptr, ptr0, ptr1, priority_fee_credits, ptr2, ptr3, len3, ptr4, ptr5, ptr6, ptr7, ptr8);
10412
10454
  return takeObject(ret);
@@ -10428,10 +10470,10 @@ class ProgramManager {
10428
10470
  * @param {string | null} [url]
10429
10471
  * @param {ProvingKey | null} [split_proving_key]
10430
10472
  * @param {VerifyingKey | null} [split_verifying_key]
10431
- * @param {OfflineQuery | null} [offline_query]
10473
+ * @param {QueryOption | null} [query]
10432
10474
  * @returns {Promise<Transaction>}
10433
10475
  */
10434
- static buildSplitTransaction(private_key, split_amount, amount_record, url, split_proving_key, split_verifying_key, offline_query) {
10476
+ static buildSplitTransaction(private_key, split_amount, amount_record, url, split_proving_key, split_verifying_key, query) {
10435
10477
  _assertClass(private_key, PrivateKey);
10436
10478
  _assertClass(amount_record, RecordPlaintext);
10437
10479
  var ptr0 = amount_record.__destroy_into_raw();
@@ -10448,9 +10490,9 @@ class ProgramManager {
10448
10490
  ptr3 = split_verifying_key.__destroy_into_raw();
10449
10491
  }
10450
10492
  let ptr4 = 0;
10451
- if (!isLikeNone(offline_query)) {
10452
- _assertClass(offline_query, OfflineQuery);
10453
- ptr4 = offline_query.__destroy_into_raw();
10493
+ if (!isLikeNone(query)) {
10494
+ _assertClass(query, QueryOption);
10495
+ ptr4 = query.__destroy_into_raw();
10454
10496
  }
10455
10497
  const ret = wasm.programmanager_buildSplitTransaction(private_key.__wbg_ptr, split_amount, ptr0, ptr1, len1, ptr2, ptr3, ptr4);
10456
10498
  return takeObject(ret);
@@ -10803,10 +10845,10 @@ class ProgramManager {
10803
10845
  * @param {VerifyingKey | null} [fee_verifying_key]
10804
10846
  * @param {object | null} [imports]
10805
10847
  * @param {string | null} [url]
10806
- * @param {OfflineQuery | null} [offline_query]
10848
+ * @param {QueryOption | null} [query]
10807
10849
  * @returns {Promise<Transaction>}
10808
10850
  */
10809
- static executeAuthorization(authorization, fee_authorization, program, proving_key, verifying_key, fee_proving_key, fee_verifying_key, imports, url, offline_query) {
10851
+ static executeAuthorization(authorization, fee_authorization, program, proving_key, verifying_key, fee_proving_key, fee_verifying_key, imports, url, query) {
10810
10852
  _assertClass(authorization, Authorization);
10811
10853
  var ptr0 = authorization.__destroy_into_raw();
10812
10854
  let ptr1 = 0;
@@ -10839,9 +10881,9 @@ class ProgramManager {
10839
10881
  var ptr7 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
10840
10882
  var len7 = WASM_VECTOR_LEN;
10841
10883
  let ptr8 = 0;
10842
- if (!isLikeNone(offline_query)) {
10843
- _assertClass(offline_query, OfflineQuery);
10844
- ptr8 = offline_query.__destroy_into_raw();
10884
+ if (!isLikeNone(query)) {
10885
+ _assertClass(query, QueryOption);
10886
+ ptr8 = query.__destroy_into_raw();
10845
10887
  }
10846
10888
  const ret = wasm.programmanager_executeAuthorization(ptr0, ptr1, ptr2, len2, ptr3, ptr4, ptr5, ptr6, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr7, len7, ptr8);
10847
10889
  return takeObject(ret);
@@ -10912,11 +10954,11 @@ class ProgramManager {
10912
10954
  * @param {ProvingKey | null} [proving_key]
10913
10955
  * @param {VerifyingKey | null} [verifying_key]
10914
10956
  * @param {string | null} [url]
10915
- * @param {OfflineQuery | null} [offline_query]
10957
+ * @param {QueryOption | null} [query]
10916
10958
  * @param {number | null} [edition]
10917
10959
  * @returns {Promise<ExecutionResponse>}
10918
10960
  */
10919
- static executeFunctionOffline(private_key, program, _function, inputs, prove_execution, cache, imports, proving_key, verifying_key, url, offline_query, edition) {
10961
+ static executeFunctionOffline(private_key, program, _function, inputs, prove_execution, cache, imports, proving_key, verifying_key, url, query, edition) {
10920
10962
  _assertClass(private_key, PrivateKey);
10921
10963
  const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export, wasm.__wbindgen_export2);
10922
10964
  const len0 = WASM_VECTOR_LEN;
@@ -10935,13 +10977,60 @@ class ProgramManager {
10935
10977
  var ptr4 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
10936
10978
  var len4 = WASM_VECTOR_LEN;
10937
10979
  let ptr5 = 0;
10938
- if (!isLikeNone(offline_query)) {
10939
- _assertClass(offline_query, OfflineQuery);
10940
- ptr5 = offline_query.__destroy_into_raw();
10980
+ if (!isLikeNone(query)) {
10981
+ _assertClass(query, QueryOption);
10982
+ ptr5 = query.__destroy_into_raw();
10941
10983
  }
10942
10984
  const ret = wasm.programmanager_executeFunctionOffline(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), prove_execution, cache, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr2, ptr3, ptr4, len4, ptr5, isLikeNone(edition) ? 0xFFFFFF : edition);
10943
10985
  return takeObject(ret);
10944
10986
  }
10987
+ /**
10988
+ * Compute the query requirements for a function execution without making
10989
+ * any network calls. Returns the commitments that need state paths and
10990
+ * whether the function has dynamic record inputs.
10991
+ *
10992
+ * This enables the JS layer to pre-fetch state data via its configured
10993
+ * transport and construct an OfflineQuery, so that the subsequent WASM
10994
+ * execution call never makes its own network requests.
10995
+ *
10996
+ * @param {string} program The source code of the program
10997
+ * @param {string} function_name The name of the function to execute
10998
+ * @param {Array} inputs The inputs to the function
10999
+ * @param {PrivateKey} private_key The private key (used to derive the view key for commitment computation)
11000
+ * @param {RecordPlaintext | undefined} fee_record Optional fee record to include in commitment computation
11001
+ * @returns {Object} An object with { commitments: string[], hasDynamicInputs: boolean }
11002
+ * @param {string} program
11003
+ * @param {string} function_name
11004
+ * @param {Array<any>} inputs
11005
+ * @param {PrivateKey} private_key
11006
+ * @param {RecordPlaintext | null} [fee_record]
11007
+ * @returns {any}
11008
+ */
11009
+ static computeQueryRequirements(program, function_name, inputs, private_key, fee_record) {
11010
+ try {
11011
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
11012
+ const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export, wasm.__wbindgen_export2);
11013
+ const len0 = WASM_VECTOR_LEN;
11014
+ const ptr1 = passStringToWasm0(function_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
11015
+ const len1 = WASM_VECTOR_LEN;
11016
+ _assertClass(private_key, PrivateKey);
11017
+ let ptr2 = 0;
11018
+ if (!isLikeNone(fee_record)) {
11019
+ _assertClass(fee_record, RecordPlaintext);
11020
+ ptr2 = fee_record.__destroy_into_raw();
11021
+ }
11022
+ wasm.programmanager_computeQueryRequirements(retptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), private_key.__wbg_ptr, ptr2);
11023
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
11024
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
11025
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
11026
+ if (r2) {
11027
+ throw takeObject(r1);
11028
+ }
11029
+ return takeObject(r0);
11030
+ } finally {
11031
+ wasm.__wbindgen_add_to_stack_pointer(16);
11032
+ }
11033
+ }
10945
11034
  /**
10946
11035
  * Estimate Fee for an Authorization.
10947
11036
  *
@@ -11014,11 +11103,11 @@ class ProgramManager {
11014
11103
  * @param {VerifyingKey | null} [verifying_key]
11015
11104
  * @param {ProvingKey | null} [fee_proving_key]
11016
11105
  * @param {VerifyingKey | null} [fee_verifying_key]
11017
- * @param {OfflineQuery | null} [offline_query]
11106
+ * @param {QueryOption | null} [query]
11018
11107
  * @param {number | null} [edition]
11019
11108
  * @returns {Promise<Transaction>}
11020
11109
  */
11021
- static buildExecutionTransaction(private_key, program, _function, inputs, priority_fee_credits, fee_record, url, imports, proving_key, verifying_key, fee_proving_key, fee_verifying_key, offline_query, edition) {
11110
+ static buildExecutionTransaction(private_key, program, _function, inputs, priority_fee_credits, fee_record, url, imports, proving_key, verifying_key, fee_proving_key, fee_verifying_key, query, edition) {
11022
11111
  _assertClass(private_key, PrivateKey);
11023
11112
  const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export, wasm.__wbindgen_export2);
11024
11113
  const len0 = WASM_VECTOR_LEN;
@@ -11052,9 +11141,9 @@ class ProgramManager {
11052
11141
  ptr7 = fee_verifying_key.__destroy_into_raw();
11053
11142
  }
11054
11143
  let ptr8 = 0;
11055
- if (!isLikeNone(offline_query)) {
11056
- _assertClass(offline_query, OfflineQuery);
11057
- ptr8 = offline_query.__destroy_into_raw();
11144
+ if (!isLikeNone(query)) {
11145
+ _assertClass(query, QueryOption);
11146
+ ptr8 = query.__destroy_into_raw();
11058
11147
  }
11059
11148
  const ret = wasm.programmanager_buildExecutionTransaction(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), priority_fee_credits, ptr2, ptr3, len3, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr4, ptr5, ptr6, ptr7, ptr8, isLikeNone(edition) ? 0xFFFFFF : edition);
11060
11149
  return takeObject(ret);
@@ -11087,10 +11176,10 @@ class ProgramManager {
11087
11176
  * @param {VerifyingKey | null} [transfer_verifying_key]
11088
11177
  * @param {ProvingKey | null} [fee_proving_key]
11089
11178
  * @param {VerifyingKey | null} [fee_verifying_key]
11090
- * @param {OfflineQuery | null} [offline_query]
11179
+ * @param {QueryOption | null} [query]
11091
11180
  * @returns {Promise<Transaction>}
11092
11181
  */
11093
- static buildTransferTransaction(private_key, amount_credits, recipient, transfer_type, amount_record, priority_fee_credits, fee_record, url, transfer_proving_key, transfer_verifying_key, fee_proving_key, fee_verifying_key, offline_query) {
11182
+ static buildTransferTransaction(private_key, amount_credits, recipient, transfer_type, amount_record, priority_fee_credits, fee_record, url, transfer_proving_key, transfer_verifying_key, fee_proving_key, fee_verifying_key, query) {
11094
11183
  _assertClass(private_key, PrivateKey);
11095
11184
  const ptr0 = passStringToWasm0(recipient, wasm.__wbindgen_export, wasm.__wbindgen_export2);
11096
11185
  const len0 = WASM_VECTOR_LEN;
@@ -11129,9 +11218,9 @@ class ProgramManager {
11129
11218
  ptr8 = fee_verifying_key.__destroy_into_raw();
11130
11219
  }
11131
11220
  let ptr9 = 0;
11132
- if (!isLikeNone(offline_query)) {
11133
- _assertClass(offline_query, OfflineQuery);
11134
- ptr9 = offline_query.__destroy_into_raw();
11221
+ if (!isLikeNone(query)) {
11222
+ _assertClass(query, QueryOption);
11223
+ ptr9 = query.__destroy_into_raw();
11135
11224
  }
11136
11225
  const ret = wasm.programmanager_buildTransferTransaction(private_key.__wbg_ptr, amount_credits, ptr0, len0, ptr1, len1, ptr2, priority_fee_credits, ptr3, ptr4, len4, ptr5, ptr6, ptr7, ptr8, ptr9);
11137
11226
  return takeObject(ret);
@@ -11913,6 +12002,63 @@ class ProvingRequest {
11913
12002
  }
11914
12003
  if (Symbol.dispose) ProvingRequest.prototype[Symbol.dispose] = ProvingRequest.prototype.free;
11915
12004
 
12005
+ const QueryOptionFinalization = (typeof FinalizationRegistry === 'undefined')
12006
+ ? { register: () => {}, unregister: () => {} }
12007
+ : new FinalizationRegistry(ptr => wasm.__wbg_queryoption_free(ptr >>> 0, 1));
12008
+ /**
12009
+ * A unified query type that wraps either an OfflineQuery (pre-fetched state)
12010
+ * or a CallbackQuery (on-demand JS transport delegation).
12011
+ *
12012
+ * Construct from JavaScript using the static factory methods:
12013
+ * - `QueryOption.offlineQuery(offlineQuery)` for pre-fetched state
12014
+ * - `QueryOption.callbackQuery(callbackQuery)` for on-demand JS callbacks
12015
+ */
12016
+ class QueryOption {
12017
+
12018
+ static __wrap(ptr) {
12019
+ ptr = ptr >>> 0;
12020
+ const obj = Object.create(QueryOption.prototype);
12021
+ obj.__wbg_ptr = ptr;
12022
+ QueryOptionFinalization.register(obj, obj.__wbg_ptr, obj);
12023
+ return obj;
12024
+ }
12025
+
12026
+ __destroy_into_raw() {
12027
+ const ptr = this.__wbg_ptr;
12028
+ this.__wbg_ptr = 0;
12029
+ QueryOptionFinalization.unregister(this);
12030
+ return ptr;
12031
+ }
12032
+
12033
+ free() {
12034
+ const ptr = this.__destroy_into_raw();
12035
+ wasm.__wbg_queryoption_free(ptr, 0);
12036
+ }
12037
+ /**
12038
+ * Create a QueryOption from an OfflineQuery.
12039
+ * @param {OfflineQuery} query
12040
+ * @returns {QueryOption}
12041
+ */
12042
+ static offlineQuery(query) {
12043
+ _assertClass(query, OfflineQuery);
12044
+ var ptr0 = query.__destroy_into_raw();
12045
+ const ret = wasm.queryoption_offlineQuery(ptr0);
12046
+ return QueryOption.__wrap(ret);
12047
+ }
12048
+ /**
12049
+ * Create a QueryOption from a CallbackQuery.
12050
+ * @param {CallbackQuery} query
12051
+ * @returns {QueryOption}
12052
+ */
12053
+ static callbackQuery(query) {
12054
+ _assertClass(query, CallbackQuery);
12055
+ var ptr0 = query.__destroy_into_raw();
12056
+ const ret = wasm.queryoption_callbackQuery(ptr0);
12057
+ return QueryOption.__wrap(ret);
12058
+ }
12059
+ }
12060
+ if (Symbol.dispose) QueryOption.prototype[Symbol.dispose] = QueryOption.prototype.free;
12061
+
11916
12062
  const RecordCiphertextFinalization = (typeof FinalizationRegistry === 'undefined')
11917
12063
  ? { register: () => {}, unregister: () => {} }
11918
12064
  : new FinalizationRegistry(ptr => wasm.__wbg_recordciphertext_free(ptr >>> 0, 1));
@@ -18169,6 +18315,12 @@ function __wbg_get_imports(memory) {
18169
18315
  const ret = __wbg_init.__wbindgen_wasm_module;
18170
18316
  return addHeapObject(ret);
18171
18317
  };
18318
+ imports.wbg.__wbg___wbindgen_number_get_a20bf9b85341449d = function(arg0, arg1) {
18319
+ const obj = getObject(arg1);
18320
+ const ret = typeof(obj) === 'number' ? obj : undefined;
18321
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
18322
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
18323
+ };
18172
18324
  imports.wbg.__wbg___wbindgen_rethrow_ea38273dafc473e6 = function(arg0) {
18173
18325
  throw takeObject(arg0);
18174
18326
  };
@@ -18196,6 +18348,10 @@ function __wbg_get_imports(memory) {
18196
18348
  imports.wbg.__wbg_append_b577eb3a177bc0fa = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
18197
18349
  getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
18198
18350
  }, arguments) };
18351
+ imports.wbg.__wbg_apply_04097a755e1e4a1e = function() { return handleError(function (arg0, arg1, arg2) {
18352
+ const ret = getObject(arg0).apply(getObject(arg1), getObject(arg2));
18353
+ return addHeapObject(ret);
18354
+ }, arguments) };
18199
18355
  imports.wbg.__wbg_arrayBuffer_b375eccb84b4ddf3 = function() { return handleError(function (arg0) {
18200
18356
  const ret = getObject(arg0).arrayBuffer();
18201
18357
  return addHeapObject(ret);
@@ -18302,6 +18458,16 @@ function __wbg_get_imports(memory) {
18302
18458
  const ret = getObject(arg0).headers;
18303
18459
  return addHeapObject(ret);
18304
18460
  };
18461
+ imports.wbg.__wbg_instanceof_Promise_001fdd42afa1b7ef = function(arg0) {
18462
+ let result;
18463
+ try {
18464
+ result = getObject(arg0) instanceof Promise;
18465
+ } catch (_) {
18466
+ result = false;
18467
+ }
18468
+ const ret = result;
18469
+ return ret;
18470
+ };
18305
18471
  imports.wbg.__wbg_instanceof_Response_f4f3e87e07f3135c = function(arg0) {
18306
18472
  let result;
18307
18473
  try {
@@ -18346,7 +18512,7 @@ function __wbg_get_imports(memory) {
18346
18512
  const ret = getObject(arg0).length;
18347
18513
  return ret;
18348
18514
  };
18349
- imports.wbg.__wbg_log_4688d4dee83f4df4 = function(arg0, arg1) {
18515
+ imports.wbg.__wbg_log_78f898e0b3066062 = function(arg0, arg1) {
18350
18516
  console.log(getStringFromWasm0(arg0, arg1));
18351
18517
  };
18352
18518
  imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
@@ -18368,7 +18534,7 @@ function __wbg_get_imports(memory) {
18368
18534
  const a = state0.a;
18369
18535
  state0.a = 0;
18370
18536
  try {
18371
- return __wasm_bindgen_func_elem_7439(a, state0.b, arg0, arg1);
18537
+ return __wasm_bindgen_func_elem_7473(a, state0.b, arg0, arg1);
18372
18538
  } finally {
18373
18539
  state0.a = a;
18374
18540
  }
@@ -18555,7 +18721,7 @@ function __wbg_get_imports(memory) {
18555
18721
  const ret = Signature.__wrap(arg0);
18556
18722
  return addHeapObject(ret);
18557
18723
  };
18558
- imports.wbg.__wbg_spawnWorker_9ce4a98fc7b6f238 = function(arg0, arg1, arg2, arg3) {
18724
+ imports.wbg.__wbg_spawnWorker_16cedfb6613c80ac = function(arg0, arg1, arg2, arg3) {
18559
18725
  const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
18560
18726
  return addHeapObject(ret);
18561
18727
  };
@@ -18645,11 +18811,6 @@ function __wbg_get_imports(memory) {
18645
18811
  const ret = Atomics.waitAsync(getObject(arg0), arg1 >>> 0, arg2);
18646
18812
  return addHeapObject(ret);
18647
18813
  };
18648
- imports.wbg.__wbindgen_cast_0eb37dec5f5def71 = function(arg0, arg1) {
18649
- // Cast intrinsic for `Closure(Closure { dtor_idx: 358, function: Function { arguments: [], shim_idx: 465, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18650
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7165, __wasm_bindgen_func_elem_7166);
18651
- return addHeapObject(ret);
18652
- };
18653
18814
  imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
18654
18815
  // Cast intrinsic for `Ref(String) -> Externref`.
18655
18816
  const ret = getStringFromWasm0(arg0, arg1);
@@ -18665,14 +18826,9 @@ function __wbg_get_imports(memory) {
18665
18826
  const ret = BigInt.asUintN(64, arg0);
18666
18827
  return addHeapObject(ret);
18667
18828
  };
18668
- imports.wbg.__wbindgen_cast_4a64cbb5b17898c9 = function(arg0, arg1) {
18669
- // Cast intrinsic for `Closure(Closure { dtor_idx: 358, function: Function { arguments: [Externref], shim_idx: 359, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18670
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7165, __wasm_bindgen_func_elem_8536);
18671
- return addHeapObject(ret);
18672
- };
18673
- imports.wbg.__wbindgen_cast_65bbaf572cb463ed = function(arg0, arg1) {
18674
- // Cast intrinsic for `Closure(Closure { dtor_idx: 358, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 359, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18675
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7165, __wasm_bindgen_func_elem_8536);
18829
+ imports.wbg.__wbindgen_cast_711d7deea8fc39ca = function(arg0, arg1) {
18830
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 356, function: Function { arguments: [Externref], shim_idx: 357, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18831
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7200, __wasm_bindgen_func_elem_8569);
18676
18832
  return addHeapObject(ret);
18677
18833
  };
18678
18834
  imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
@@ -18680,11 +18836,21 @@ function __wbg_get_imports(memory) {
18680
18836
  const ret = arg0;
18681
18837
  return addHeapObject(ret);
18682
18838
  };
18839
+ imports.wbg.__wbindgen_cast_cada7727142cd213 = function(arg0, arg1) {
18840
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 356, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 357, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18841
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7200, __wasm_bindgen_func_elem_8569);
18842
+ return addHeapObject(ret);
18843
+ };
18683
18844
  imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
18684
18845
  // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
18685
18846
  const ret = getArrayU8FromWasm0(arg0, arg1);
18686
18847
  return addHeapObject(ret);
18687
18848
  };
18849
+ imports.wbg.__wbindgen_cast_cdf07f87b2615f8c = function(arg0, arg1) {
18850
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 356, function: Function { arguments: [], shim_idx: 462, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18851
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7200, __wasm_bindgen_func_elem_7201);
18852
+ return addHeapObject(ret);
18853
+ };
18688
18854
  imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
18689
18855
  // Cast intrinsic for `F64 -> Externref`.
18690
18856
  const ret = arg0;
@@ -18788,6 +18954,7 @@ var exports$1 = /*#__PURE__*/Object.freeze({
18788
18954
  BHP512: BHP512,
18789
18955
  BHP768: BHP768,
18790
18956
  Boolean: Boolean,
18957
+ CallbackQuery: CallbackQuery,
18791
18958
  Ciphertext: Ciphertext,
18792
18959
  ComputeKey: ComputeKey,
18793
18960
  DynamicRecord: DynamicRecord,
@@ -18819,6 +18986,7 @@ var exports$1 = /*#__PURE__*/Object.freeze({
18819
18986
  Proof: Proof,
18820
18987
  ProvingKey: ProvingKey,
18821
18988
  ProvingRequest: ProvingRequest,
18989
+ QueryOption: QueryOption,
18822
18990
  RecordCiphertext: RecordCiphertext,
18823
18991
  RecordPlaintext: RecordPlaintext,
18824
18992
  Scalar: Scalar,