@provablehq/wasm 0.10.3 → 0.10.5-rc.1
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/mainnet/aleo_wasm.d.ts +81 -18
- package/dist/mainnet/aleo_wasm.wasm +0 -0
- package/dist/mainnet/index.cjs +263 -85
- package/dist/mainnet/index.cjs.map +1 -1
- package/dist/mainnet/index.js +262 -86
- package/dist/mainnet/index.js.map +1 -1
- package/dist/mainnet/worker.js +263 -85
- package/dist/mainnet/worker.js.map +1 -1
- package/dist/testnet/aleo_wasm.d.ts +69 -6
- package/dist/testnet/aleo_wasm.wasm +0 -0
- package/dist/testnet/index.cjs +230 -52
- package/dist/testnet/index.cjs.map +1 -1
- package/dist/testnet/index.js +229 -53
- package/dist/testnet/index.js.map +1 -1
- package/dist/testnet/worker.js +230 -52
- package/dist/testnet/worker.js.map +1 -1
- package/package.json +1 -1
package/dist/testnet/worker.js
CHANGED
|
@@ -471,16 +471,16 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
471
471
|
}
|
|
472
472
|
return result;
|
|
473
473
|
}
|
|
474
|
-
function
|
|
475
|
-
wasm.
|
|
474
|
+
function __wasm_bindgen_func_elem_8577(arg0, arg1, arg2) {
|
|
475
|
+
wasm.__wasm_bindgen_func_elem_8577(arg0, arg1, addHeapObject(arg2));
|
|
476
476
|
}
|
|
477
477
|
|
|
478
|
-
function
|
|
479
|
-
wasm.
|
|
478
|
+
function __wasm_bindgen_func_elem_7220(arg0, arg1) {
|
|
479
|
+
wasm.__wasm_bindgen_func_elem_7220(arg0, arg1);
|
|
480
480
|
}
|
|
481
481
|
|
|
482
|
-
function
|
|
483
|
-
wasm.
|
|
482
|
+
function __wasm_bindgen_func_elem_7492(arg0, arg1, arg2, arg3) {
|
|
483
|
+
wasm.__wasm_bindgen_func_elem_7492(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));
|
|
@@ -9870,6 +9912,16 @@ class Program {
|
|
|
9870
9912
|
const ret = wasm.program_getImports(this.__wbg_ptr);
|
|
9871
9913
|
return takeObject(ret);
|
|
9872
9914
|
}
|
|
9915
|
+
/**
|
|
9916
|
+
* Get the checksum of the program.
|
|
9917
|
+
*
|
|
9918
|
+
* @returns {Uint8Array} The checksum of the program as a 32-byte Uint8Array
|
|
9919
|
+
* @returns {Uint8Array}
|
|
9920
|
+
*/
|
|
9921
|
+
toChecksum() {
|
|
9922
|
+
const ret = wasm.program_toChecksum(this.__wbg_ptr);
|
|
9923
|
+
return takeObject(ret);
|
|
9924
|
+
}
|
|
9873
9925
|
/**
|
|
9874
9926
|
* Get a the list of a program's mappings and the names/types of their keys and values.
|
|
9875
9927
|
*
|
|
@@ -10357,10 +10409,10 @@ class ProgramManager {
|
|
|
10357
10409
|
* @param {VerifyingKey | null} [join_verifying_key]
|
|
10358
10410
|
* @param {ProvingKey | null} [fee_proving_key]
|
|
10359
10411
|
* @param {VerifyingKey | null} [fee_verifying_key]
|
|
10360
|
-
* @param {
|
|
10412
|
+
* @param {QueryOption | null} [query]
|
|
10361
10413
|
* @returns {Promise<Transaction>}
|
|
10362
10414
|
*/
|
|
10363
|
-
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,
|
|
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) {
|
|
10364
10416
|
_assertClass(private_key, PrivateKey);
|
|
10365
10417
|
_assertClass(record_1, RecordPlaintext);
|
|
10366
10418
|
var ptr0 = record_1.__destroy_into_raw();
|
|
@@ -10394,9 +10446,9 @@ class ProgramManager {
|
|
|
10394
10446
|
ptr7 = fee_verifying_key.__destroy_into_raw();
|
|
10395
10447
|
}
|
|
10396
10448
|
let ptr8 = 0;
|
|
10397
|
-
if (!isLikeNone(
|
|
10398
|
-
_assertClass(
|
|
10399
|
-
ptr8 =
|
|
10449
|
+
if (!isLikeNone(query)) {
|
|
10450
|
+
_assertClass(query, QueryOption);
|
|
10451
|
+
ptr8 = query.__destroy_into_raw();
|
|
10400
10452
|
}
|
|
10401
10453
|
const ret = wasm.programmanager_buildJoinTransaction(private_key.__wbg_ptr, ptr0, ptr1, priority_fee_credits, ptr2, ptr3, len3, ptr4, ptr5, ptr6, ptr7, ptr8);
|
|
10402
10454
|
return takeObject(ret);
|
|
@@ -10418,10 +10470,10 @@ class ProgramManager {
|
|
|
10418
10470
|
* @param {string | null} [url]
|
|
10419
10471
|
* @param {ProvingKey | null} [split_proving_key]
|
|
10420
10472
|
* @param {VerifyingKey | null} [split_verifying_key]
|
|
10421
|
-
* @param {
|
|
10473
|
+
* @param {QueryOption | null} [query]
|
|
10422
10474
|
* @returns {Promise<Transaction>}
|
|
10423
10475
|
*/
|
|
10424
|
-
static buildSplitTransaction(private_key, split_amount, amount_record, url, split_proving_key, split_verifying_key,
|
|
10476
|
+
static buildSplitTransaction(private_key, split_amount, amount_record, url, split_proving_key, split_verifying_key, query) {
|
|
10425
10477
|
_assertClass(private_key, PrivateKey);
|
|
10426
10478
|
_assertClass(amount_record, RecordPlaintext);
|
|
10427
10479
|
var ptr0 = amount_record.__destroy_into_raw();
|
|
@@ -10438,9 +10490,9 @@ class ProgramManager {
|
|
|
10438
10490
|
ptr3 = split_verifying_key.__destroy_into_raw();
|
|
10439
10491
|
}
|
|
10440
10492
|
let ptr4 = 0;
|
|
10441
|
-
if (!isLikeNone(
|
|
10442
|
-
_assertClass(
|
|
10443
|
-
ptr4 =
|
|
10493
|
+
if (!isLikeNone(query)) {
|
|
10494
|
+
_assertClass(query, QueryOption);
|
|
10495
|
+
ptr4 = query.__destroy_into_raw();
|
|
10444
10496
|
}
|
|
10445
10497
|
const ret = wasm.programmanager_buildSplitTransaction(private_key.__wbg_ptr, split_amount, ptr0, ptr1, len1, ptr2, ptr3, ptr4);
|
|
10446
10498
|
return takeObject(ret);
|
|
@@ -10793,10 +10845,10 @@ class ProgramManager {
|
|
|
10793
10845
|
* @param {VerifyingKey | null} [fee_verifying_key]
|
|
10794
10846
|
* @param {object | null} [imports]
|
|
10795
10847
|
* @param {string | null} [url]
|
|
10796
|
-
* @param {
|
|
10848
|
+
* @param {QueryOption | null} [query]
|
|
10797
10849
|
* @returns {Promise<Transaction>}
|
|
10798
10850
|
*/
|
|
10799
|
-
static executeAuthorization(authorization, fee_authorization, program, proving_key, verifying_key, fee_proving_key, fee_verifying_key, imports, url,
|
|
10851
|
+
static executeAuthorization(authorization, fee_authorization, program, proving_key, verifying_key, fee_proving_key, fee_verifying_key, imports, url, query) {
|
|
10800
10852
|
_assertClass(authorization, Authorization);
|
|
10801
10853
|
var ptr0 = authorization.__destroy_into_raw();
|
|
10802
10854
|
let ptr1 = 0;
|
|
@@ -10829,9 +10881,9 @@ class ProgramManager {
|
|
|
10829
10881
|
var ptr7 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10830
10882
|
var len7 = WASM_VECTOR_LEN;
|
|
10831
10883
|
let ptr8 = 0;
|
|
10832
|
-
if (!isLikeNone(
|
|
10833
|
-
_assertClass(
|
|
10834
|
-
ptr8 =
|
|
10884
|
+
if (!isLikeNone(query)) {
|
|
10885
|
+
_assertClass(query, QueryOption);
|
|
10886
|
+
ptr8 = query.__destroy_into_raw();
|
|
10835
10887
|
}
|
|
10836
10888
|
const ret = wasm.programmanager_executeAuthorization(ptr0, ptr1, ptr2, len2, ptr3, ptr4, ptr5, ptr6, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr7, len7, ptr8);
|
|
10837
10889
|
return takeObject(ret);
|
|
@@ -10902,11 +10954,11 @@ class ProgramManager {
|
|
|
10902
10954
|
* @param {ProvingKey | null} [proving_key]
|
|
10903
10955
|
* @param {VerifyingKey | null} [verifying_key]
|
|
10904
10956
|
* @param {string | null} [url]
|
|
10905
|
-
* @param {
|
|
10957
|
+
* @param {QueryOption | null} [query]
|
|
10906
10958
|
* @param {number | null} [edition]
|
|
10907
10959
|
* @returns {Promise<ExecutionResponse>}
|
|
10908
10960
|
*/
|
|
10909
|
-
static executeFunctionOffline(private_key, program, _function, inputs, prove_execution, cache, imports, proving_key, verifying_key, url,
|
|
10961
|
+
static executeFunctionOffline(private_key, program, _function, inputs, prove_execution, cache, imports, proving_key, verifying_key, url, query, edition) {
|
|
10910
10962
|
_assertClass(private_key, PrivateKey);
|
|
10911
10963
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10912
10964
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -10925,13 +10977,60 @@ class ProgramManager {
|
|
|
10925
10977
|
var ptr4 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10926
10978
|
var len4 = WASM_VECTOR_LEN;
|
|
10927
10979
|
let ptr5 = 0;
|
|
10928
|
-
if (!isLikeNone(
|
|
10929
|
-
_assertClass(
|
|
10930
|
-
ptr5 =
|
|
10980
|
+
if (!isLikeNone(query)) {
|
|
10981
|
+
_assertClass(query, QueryOption);
|
|
10982
|
+
ptr5 = query.__destroy_into_raw();
|
|
10931
10983
|
}
|
|
10932
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);
|
|
10933
10985
|
return takeObject(ret);
|
|
10934
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
|
+
}
|
|
10935
11034
|
/**
|
|
10936
11035
|
* Estimate Fee for an Authorization.
|
|
10937
11036
|
*
|
|
@@ -11004,11 +11103,11 @@ class ProgramManager {
|
|
|
11004
11103
|
* @param {VerifyingKey | null} [verifying_key]
|
|
11005
11104
|
* @param {ProvingKey | null} [fee_proving_key]
|
|
11006
11105
|
* @param {VerifyingKey | null} [fee_verifying_key]
|
|
11007
|
-
* @param {
|
|
11106
|
+
* @param {QueryOption | null} [query]
|
|
11008
11107
|
* @param {number | null} [edition]
|
|
11009
11108
|
* @returns {Promise<Transaction>}
|
|
11010
11109
|
*/
|
|
11011
|
-
static buildExecutionTransaction(private_key, program, _function, inputs, priority_fee_credits, fee_record, url, imports, proving_key, verifying_key, fee_proving_key, fee_verifying_key,
|
|
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) {
|
|
11012
11111
|
_assertClass(private_key, PrivateKey);
|
|
11013
11112
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
11014
11113
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -11042,9 +11141,9 @@ class ProgramManager {
|
|
|
11042
11141
|
ptr7 = fee_verifying_key.__destroy_into_raw();
|
|
11043
11142
|
}
|
|
11044
11143
|
let ptr8 = 0;
|
|
11045
|
-
if (!isLikeNone(
|
|
11046
|
-
_assertClass(
|
|
11047
|
-
ptr8 =
|
|
11144
|
+
if (!isLikeNone(query)) {
|
|
11145
|
+
_assertClass(query, QueryOption);
|
|
11146
|
+
ptr8 = query.__destroy_into_raw();
|
|
11048
11147
|
}
|
|
11049
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);
|
|
11050
11149
|
return takeObject(ret);
|
|
@@ -11077,10 +11176,10 @@ class ProgramManager {
|
|
|
11077
11176
|
* @param {VerifyingKey | null} [transfer_verifying_key]
|
|
11078
11177
|
* @param {ProvingKey | null} [fee_proving_key]
|
|
11079
11178
|
* @param {VerifyingKey | null} [fee_verifying_key]
|
|
11080
|
-
* @param {
|
|
11179
|
+
* @param {QueryOption | null} [query]
|
|
11081
11180
|
* @returns {Promise<Transaction>}
|
|
11082
11181
|
*/
|
|
11083
|
-
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,
|
|
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) {
|
|
11084
11183
|
_assertClass(private_key, PrivateKey);
|
|
11085
11184
|
const ptr0 = passStringToWasm0(recipient, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
11086
11185
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -11119,9 +11218,9 @@ class ProgramManager {
|
|
|
11119
11218
|
ptr8 = fee_verifying_key.__destroy_into_raw();
|
|
11120
11219
|
}
|
|
11121
11220
|
let ptr9 = 0;
|
|
11122
|
-
if (!isLikeNone(
|
|
11123
|
-
_assertClass(
|
|
11124
|
-
ptr9 =
|
|
11221
|
+
if (!isLikeNone(query)) {
|
|
11222
|
+
_assertClass(query, QueryOption);
|
|
11223
|
+
ptr9 = query.__destroy_into_raw();
|
|
11125
11224
|
}
|
|
11126
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);
|
|
11127
11226
|
return takeObject(ret);
|
|
@@ -11903,6 +12002,63 @@ class ProvingRequest {
|
|
|
11903
12002
|
}
|
|
11904
12003
|
if (Symbol.dispose) ProvingRequest.prototype[Symbol.dispose] = ProvingRequest.prototype.free;
|
|
11905
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
|
+
|
|
11906
12062
|
const RecordCiphertextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
11907
12063
|
? { register: () => {}, unregister: () => {} }
|
|
11908
12064
|
: new FinalizationRegistry(ptr => wasm.__wbg_recordciphertext_free(ptr >>> 0, 1));
|
|
@@ -18159,6 +18315,12 @@ function __wbg_get_imports(memory) {
|
|
|
18159
18315
|
const ret = __wbg_init.__wbindgen_wasm_module;
|
|
18160
18316
|
return addHeapObject(ret);
|
|
18161
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
|
+
};
|
|
18162
18324
|
imports.wbg.__wbg___wbindgen_rethrow_ea38273dafc473e6 = function(arg0) {
|
|
18163
18325
|
throw takeObject(arg0);
|
|
18164
18326
|
};
|
|
@@ -18186,6 +18348,10 @@ function __wbg_get_imports(memory) {
|
|
|
18186
18348
|
imports.wbg.__wbg_append_b577eb3a177bc0fa = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
18187
18349
|
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
18188
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) };
|
|
18189
18355
|
imports.wbg.__wbg_arrayBuffer_b375eccb84b4ddf3 = function() { return handleError(function (arg0) {
|
|
18190
18356
|
const ret = getObject(arg0).arrayBuffer();
|
|
18191
18357
|
return addHeapObject(ret);
|
|
@@ -18292,6 +18458,16 @@ function __wbg_get_imports(memory) {
|
|
|
18292
18458
|
const ret = getObject(arg0).headers;
|
|
18293
18459
|
return addHeapObject(ret);
|
|
18294
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
|
+
};
|
|
18295
18471
|
imports.wbg.__wbg_instanceof_Response_f4f3e87e07f3135c = function(arg0) {
|
|
18296
18472
|
let result;
|
|
18297
18473
|
try {
|
|
@@ -18336,7 +18512,7 @@ function __wbg_get_imports(memory) {
|
|
|
18336
18512
|
const ret = getObject(arg0).length;
|
|
18337
18513
|
return ret;
|
|
18338
18514
|
};
|
|
18339
|
-
imports.wbg.
|
|
18515
|
+
imports.wbg.__wbg_log_22dee88c33d8b7ed = function(arg0, arg1) {
|
|
18340
18516
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
18341
18517
|
};
|
|
18342
18518
|
imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
|
|
@@ -18358,7 +18534,7 @@ function __wbg_get_imports(memory) {
|
|
|
18358
18534
|
const a = state0.a;
|
|
18359
18535
|
state0.a = 0;
|
|
18360
18536
|
try {
|
|
18361
|
-
return
|
|
18537
|
+
return __wasm_bindgen_func_elem_7492(a, state0.b, arg0, arg1);
|
|
18362
18538
|
} finally {
|
|
18363
18539
|
state0.a = a;
|
|
18364
18540
|
}
|
|
@@ -18545,7 +18721,7 @@ function __wbg_get_imports(memory) {
|
|
|
18545
18721
|
const ret = Signature.__wrap(arg0);
|
|
18546
18722
|
return addHeapObject(ret);
|
|
18547
18723
|
};
|
|
18548
|
-
imports.wbg.
|
|
18724
|
+
imports.wbg.__wbg_spawnWorker_33cc8ce5f9639974 = function(arg0, arg1, arg2, arg3) {
|
|
18549
18725
|
const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
|
|
18550
18726
|
return addHeapObject(ret);
|
|
18551
18727
|
};
|
|
@@ -18635,11 +18811,6 @@ function __wbg_get_imports(memory) {
|
|
|
18635
18811
|
const ret = Atomics.waitAsync(getObject(arg0), arg1 >>> 0, arg2);
|
|
18636
18812
|
return addHeapObject(ret);
|
|
18637
18813
|
};
|
|
18638
|
-
imports.wbg.__wbindgen_cast_0eb37dec5f5def71 = function(arg0, arg1) {
|
|
18639
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 358, function: Function { arguments: [], shim_idx: 465, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
18640
|
-
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7172, __wasm_bindgen_func_elem_7173);
|
|
18641
|
-
return addHeapObject(ret);
|
|
18642
|
-
};
|
|
18643
18814
|
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
18644
18815
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
18645
18816
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
@@ -18650,19 +18821,19 @@ function __wbg_get_imports(memory) {
|
|
|
18650
18821
|
const ret = (BigInt.asUintN(64, arg0) | (arg1 << BigInt(64)));
|
|
18651
18822
|
return addHeapObject(ret);
|
|
18652
18823
|
};
|
|
18824
|
+
imports.wbg.__wbindgen_cast_32a97a33ade320ff = function(arg0, arg1) {
|
|
18825
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 359, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 360, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
18826
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7219, __wasm_bindgen_func_elem_8577);
|
|
18827
|
+
return addHeapObject(ret);
|
|
18828
|
+
};
|
|
18653
18829
|
imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
18654
18830
|
// Cast intrinsic for `U64 -> Externref`.
|
|
18655
18831
|
const ret = BigInt.asUintN(64, arg0);
|
|
18656
18832
|
return addHeapObject(ret);
|
|
18657
18833
|
};
|
|
18658
|
-
imports.wbg.
|
|
18659
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
18660
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
18661
|
-
return addHeapObject(ret);
|
|
18662
|
-
};
|
|
18663
|
-
imports.wbg.__wbindgen_cast_65bbaf572cb463ed = function(arg0, arg1) {
|
|
18664
|
-
// 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`.
|
|
18665
|
-
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7172, __wasm_bindgen_func_elem_8534);
|
|
18834
|
+
imports.wbg.__wbindgen_cast_54fdaf61e7a5e679 = function(arg0, arg1) {
|
|
18835
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 359, function: Function { arguments: [], shim_idx: 465, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
18836
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7219, __wasm_bindgen_func_elem_7220);
|
|
18666
18837
|
return addHeapObject(ret);
|
|
18667
18838
|
};
|
|
18668
18839
|
imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
@@ -18680,6 +18851,11 @@ function __wbg_get_imports(memory) {
|
|
|
18680
18851
|
const ret = arg0;
|
|
18681
18852
|
return addHeapObject(ret);
|
|
18682
18853
|
};
|
|
18854
|
+
imports.wbg.__wbindgen_cast_e424aac48c10ba33 = function(arg0, arg1) {
|
|
18855
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 359, function: Function { arguments: [Externref], shim_idx: 360, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
18856
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7219, __wasm_bindgen_func_elem_8577);
|
|
18857
|
+
return addHeapObject(ret);
|
|
18858
|
+
};
|
|
18683
18859
|
imports.wbg.__wbindgen_cast_e7b45dd881f38ce3 = function(arg0, arg1) {
|
|
18684
18860
|
// Cast intrinsic for `U128 -> Externref`.
|
|
18685
18861
|
const ret = (BigInt.asUintN(64, arg0) | (BigInt.asUintN(64, arg1) << BigInt(64)));
|
|
@@ -18778,6 +18954,7 @@ var exports$1 = /*#__PURE__*/Object.freeze({
|
|
|
18778
18954
|
BHP512: BHP512,
|
|
18779
18955
|
BHP768: BHP768,
|
|
18780
18956
|
Boolean: Boolean,
|
|
18957
|
+
CallbackQuery: CallbackQuery,
|
|
18781
18958
|
Ciphertext: Ciphertext,
|
|
18782
18959
|
ComputeKey: ComputeKey,
|
|
18783
18960
|
DynamicRecord: DynamicRecord,
|
|
@@ -18809,6 +18986,7 @@ var exports$1 = /*#__PURE__*/Object.freeze({
|
|
|
18809
18986
|
Proof: Proof,
|
|
18810
18987
|
ProvingKey: ProvingKey,
|
|
18811
18988
|
ProvingRequest: ProvingRequest,
|
|
18989
|
+
QueryOption: QueryOption,
|
|
18812
18990
|
RecordCiphertext: RecordCiphertext,
|
|
18813
18991
|
RecordPlaintext: RecordPlaintext,
|
|
18814
18992
|
Scalar: Scalar,
|