@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/mainnet/index.cjs
CHANGED
|
@@ -341,39 +341,6 @@ function snarkVerifyBatch(verifying_keys, inputs, proof) {
|
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
343
|
|
|
344
|
-
/**
|
|
345
|
-
* Verify a SNARK proof against a verifying key and public inputs.
|
|
346
|
-
*
|
|
347
|
-
* This function verifies a proof produced by an Aleo program that may not be deployed on chain.
|
|
348
|
-
* It directly invokes the Varuna proof verification from snarkVM.
|
|
349
|
-
*
|
|
350
|
-
* @param {VerifyingKey} verifying_key The verifying key for the circuit
|
|
351
|
-
* @param {Array<string>} inputs Array of field element strings representing public inputs (e.g. ["1field", "2field"])
|
|
352
|
-
* @param {Proof} proof The proof to verify
|
|
353
|
-
* @returns {boolean} True if the proof is valid, false otherwise
|
|
354
|
-
* @param {VerifyingKey} verifying_key
|
|
355
|
-
* @param {Array<any>} inputs
|
|
356
|
-
* @param {Proof} proof
|
|
357
|
-
* @returns {boolean}
|
|
358
|
-
*/
|
|
359
|
-
function snarkVerify(verifying_key, inputs, proof) {
|
|
360
|
-
try {
|
|
361
|
-
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
|
362
|
-
_assertClass(verifying_key, VerifyingKey);
|
|
363
|
-
_assertClass(proof, Proof);
|
|
364
|
-
wasm$1.snarkVerify(retptr, verifying_key.__wbg_ptr, addHeapObject(inputs), proof.__wbg_ptr);
|
|
365
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
366
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
367
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
368
|
-
if (r2) {
|
|
369
|
-
throw takeObject(r1);
|
|
370
|
-
}
|
|
371
|
-
return r0 !== 0;
|
|
372
|
-
} finally {
|
|
373
|
-
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
|
|
377
344
|
/**
|
|
378
345
|
* Verify an execution. Executions with multiple transitions must have the program source code and
|
|
379
346
|
* verifying keys of imported functions supplied from outside to correctly verify. Also, this does
|
|
@@ -416,6 +383,39 @@ function verifyFunctionExecution(execution, verifying_key, program, function_id,
|
|
|
416
383
|
}
|
|
417
384
|
}
|
|
418
385
|
|
|
386
|
+
/**
|
|
387
|
+
* Verify a SNARK proof against a verifying key and public inputs.
|
|
388
|
+
*
|
|
389
|
+
* This function verifies a proof produced by an Aleo program that may not be deployed on chain.
|
|
390
|
+
* It directly invokes the Varuna proof verification from snarkVM.
|
|
391
|
+
*
|
|
392
|
+
* @param {VerifyingKey} verifying_key The verifying key for the circuit
|
|
393
|
+
* @param {Array<string>} inputs Array of field element strings representing public inputs (e.g. ["1field", "2field"])
|
|
394
|
+
* @param {Proof} proof The proof to verify
|
|
395
|
+
* @returns {boolean} True if the proof is valid, false otherwise
|
|
396
|
+
* @param {VerifyingKey} verifying_key
|
|
397
|
+
* @param {Array<any>} inputs
|
|
398
|
+
* @param {Proof} proof
|
|
399
|
+
* @returns {boolean}
|
|
400
|
+
*/
|
|
401
|
+
function snarkVerify(verifying_key, inputs, proof) {
|
|
402
|
+
try {
|
|
403
|
+
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
|
404
|
+
_assertClass(verifying_key, VerifyingKey);
|
|
405
|
+
_assertClass(proof, Proof);
|
|
406
|
+
wasm$1.snarkVerify(retptr, verifying_key.__wbg_ptr, addHeapObject(inputs), proof.__wbg_ptr);
|
|
407
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
408
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
409
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
410
|
+
if (r2) {
|
|
411
|
+
throw takeObject(r1);
|
|
412
|
+
}
|
|
413
|
+
return r0 !== 0;
|
|
414
|
+
} finally {
|
|
415
|
+
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
|
|
419
419
|
/**
|
|
420
420
|
* @param {string} string
|
|
421
421
|
* @returns {Field}
|
|
@@ -477,16 +477,16 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
477
477
|
}
|
|
478
478
|
return result;
|
|
479
479
|
}
|
|
480
|
-
function
|
|
481
|
-
wasm$1.
|
|
480
|
+
function __wasm_bindgen_func_elem_8577(arg0, arg1, arg2) {
|
|
481
|
+
wasm$1.__wasm_bindgen_func_elem_8577(arg0, arg1, addHeapObject(arg2));
|
|
482
482
|
}
|
|
483
483
|
|
|
484
|
-
function
|
|
485
|
-
wasm$1.
|
|
484
|
+
function __wasm_bindgen_func_elem_7212(arg0, arg1) {
|
|
485
|
+
wasm$1.__wasm_bindgen_func_elem_7212(arg0, arg1);
|
|
486
486
|
}
|
|
487
487
|
|
|
488
|
-
function
|
|
489
|
-
wasm$1.
|
|
488
|
+
function __wasm_bindgen_func_elem_7484(arg0, arg1, arg2, arg3) {
|
|
489
|
+
wasm$1.__wasm_bindgen_func_elem_7484(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
490
490
|
}
|
|
491
491
|
|
|
492
492
|
const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
@@ -2229,6 +2229,48 @@ class Boolean {
|
|
|
2229
2229
|
}
|
|
2230
2230
|
if (Symbol.dispose) Boolean.prototype[Symbol.dispose] = Boolean.prototype.free;
|
|
2231
2231
|
|
|
2232
|
+
const CallbackQueryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2233
|
+
? { register: () => {}, unregister: () => {} }
|
|
2234
|
+
: new FinalizationRegistry(ptr => wasm$1.__wbg_callbackquery_free(ptr >>> 0, 1));
|
|
2235
|
+
/**
|
|
2236
|
+
* A query implementation that delegates state fetching to JS callback functions.
|
|
2237
|
+
*
|
|
2238
|
+
* Instead of making direct HTTP calls via reqwest, each QueryTrait method
|
|
2239
|
+
* calls a JS function that returns a Promise. The JS side handles the actual
|
|
2240
|
+
* network request through the configured transport.
|
|
2241
|
+
*/
|
|
2242
|
+
class CallbackQuery {
|
|
2243
|
+
|
|
2244
|
+
__destroy_into_raw() {
|
|
2245
|
+
const ptr = this.__wbg_ptr;
|
|
2246
|
+
this.__wbg_ptr = 0;
|
|
2247
|
+
CallbackQueryFinalization.unregister(this);
|
|
2248
|
+
return ptr;
|
|
2249
|
+
}
|
|
2250
|
+
|
|
2251
|
+
free() {
|
|
2252
|
+
const ptr = this.__destroy_into_raw();
|
|
2253
|
+
wasm$1.__wbg_callbackquery_free(ptr, 0);
|
|
2254
|
+
}
|
|
2255
|
+
/**
|
|
2256
|
+
* Create a new CallbackQuery with JS callback functions.
|
|
2257
|
+
*
|
|
2258
|
+
* @param {Function} get_state_root A function that returns Promise<string> (the state root)
|
|
2259
|
+
* @param {Function} get_state_paths A function that takes string[] (commitments) and returns Promise<string[]> (state paths)
|
|
2260
|
+
* @param {Function} get_block_height A function that returns Promise<number> (the block height)
|
|
2261
|
+
* @param {Function} get_state_root
|
|
2262
|
+
* @param {Function} get_state_paths
|
|
2263
|
+
* @param {Function} get_block_height
|
|
2264
|
+
*/
|
|
2265
|
+
constructor(get_state_root, get_state_paths, get_block_height) {
|
|
2266
|
+
const ret = wasm$1.callbackquery_new(addHeapObject(get_state_root), addHeapObject(get_state_paths), addHeapObject(get_block_height));
|
|
2267
|
+
this.__wbg_ptr = ret >>> 0;
|
|
2268
|
+
CallbackQueryFinalization.register(this, this.__wbg_ptr, this);
|
|
2269
|
+
return this;
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
if (Symbol.dispose) CallbackQuery.prototype[Symbol.dispose] = CallbackQuery.prototype.free;
|
|
2273
|
+
|
|
2232
2274
|
const CiphertextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2233
2275
|
? { register: () => {}, unregister: () => {} }
|
|
2234
2276
|
: new FinalizationRegistry(ptr => wasm$1.__wbg_ciphertext_free(ptr >>> 0, 1));
|
|
@@ -9876,6 +9918,16 @@ class Program {
|
|
|
9876
9918
|
const ret = wasm$1.program_getImports(this.__wbg_ptr);
|
|
9877
9919
|
return takeObject(ret);
|
|
9878
9920
|
}
|
|
9921
|
+
/**
|
|
9922
|
+
* Get the checksum of the program.
|
|
9923
|
+
*
|
|
9924
|
+
* @returns {Uint8Array} The checksum of the program as a 32-byte Uint8Array
|
|
9925
|
+
* @returns {Uint8Array}
|
|
9926
|
+
*/
|
|
9927
|
+
toChecksum() {
|
|
9928
|
+
const ret = wasm$1.program_toChecksum(this.__wbg_ptr);
|
|
9929
|
+
return takeObject(ret);
|
|
9930
|
+
}
|
|
9879
9931
|
/**
|
|
9880
9932
|
* Get a the list of a program's mappings and the names/types of their keys and values.
|
|
9881
9933
|
*
|
|
@@ -10363,10 +10415,10 @@ class ProgramManager {
|
|
|
10363
10415
|
* @param {VerifyingKey | null} [join_verifying_key]
|
|
10364
10416
|
* @param {ProvingKey | null} [fee_proving_key]
|
|
10365
10417
|
* @param {VerifyingKey | null} [fee_verifying_key]
|
|
10366
|
-
* @param {
|
|
10418
|
+
* @param {QueryOption | null} [query]
|
|
10367
10419
|
* @returns {Promise<Transaction>}
|
|
10368
10420
|
*/
|
|
10369
|
-
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,
|
|
10421
|
+
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) {
|
|
10370
10422
|
_assertClass(private_key, PrivateKey);
|
|
10371
10423
|
_assertClass(record_1, RecordPlaintext);
|
|
10372
10424
|
var ptr0 = record_1.__destroy_into_raw();
|
|
@@ -10400,9 +10452,9 @@ class ProgramManager {
|
|
|
10400
10452
|
ptr7 = fee_verifying_key.__destroy_into_raw();
|
|
10401
10453
|
}
|
|
10402
10454
|
let ptr8 = 0;
|
|
10403
|
-
if (!isLikeNone(
|
|
10404
|
-
_assertClass(
|
|
10405
|
-
ptr8 =
|
|
10455
|
+
if (!isLikeNone(query)) {
|
|
10456
|
+
_assertClass(query, QueryOption);
|
|
10457
|
+
ptr8 = query.__destroy_into_raw();
|
|
10406
10458
|
}
|
|
10407
10459
|
const ret = wasm$1.programmanager_buildJoinTransaction(private_key.__wbg_ptr, ptr0, ptr1, priority_fee_credits, ptr2, ptr3, len3, ptr4, ptr5, ptr6, ptr7, ptr8);
|
|
10408
10460
|
return takeObject(ret);
|
|
@@ -10424,10 +10476,10 @@ class ProgramManager {
|
|
|
10424
10476
|
* @param {string | null} [url]
|
|
10425
10477
|
* @param {ProvingKey | null} [split_proving_key]
|
|
10426
10478
|
* @param {VerifyingKey | null} [split_verifying_key]
|
|
10427
|
-
* @param {
|
|
10479
|
+
* @param {QueryOption | null} [query]
|
|
10428
10480
|
* @returns {Promise<Transaction>}
|
|
10429
10481
|
*/
|
|
10430
|
-
static buildSplitTransaction(private_key, split_amount, amount_record, url, split_proving_key, split_verifying_key,
|
|
10482
|
+
static buildSplitTransaction(private_key, split_amount, amount_record, url, split_proving_key, split_verifying_key, query) {
|
|
10431
10483
|
_assertClass(private_key, PrivateKey);
|
|
10432
10484
|
_assertClass(amount_record, RecordPlaintext);
|
|
10433
10485
|
var ptr0 = amount_record.__destroy_into_raw();
|
|
@@ -10444,9 +10496,9 @@ class ProgramManager {
|
|
|
10444
10496
|
ptr3 = split_verifying_key.__destroy_into_raw();
|
|
10445
10497
|
}
|
|
10446
10498
|
let ptr4 = 0;
|
|
10447
|
-
if (!isLikeNone(
|
|
10448
|
-
_assertClass(
|
|
10449
|
-
ptr4 =
|
|
10499
|
+
if (!isLikeNone(query)) {
|
|
10500
|
+
_assertClass(query, QueryOption);
|
|
10501
|
+
ptr4 = query.__destroy_into_raw();
|
|
10450
10502
|
}
|
|
10451
10503
|
const ret = wasm$1.programmanager_buildSplitTransaction(private_key.__wbg_ptr, split_amount, ptr0, ptr1, len1, ptr2, ptr3, ptr4);
|
|
10452
10504
|
return takeObject(ret);
|
|
@@ -10799,10 +10851,10 @@ class ProgramManager {
|
|
|
10799
10851
|
* @param {VerifyingKey | null} [fee_verifying_key]
|
|
10800
10852
|
* @param {object | null} [imports]
|
|
10801
10853
|
* @param {string | null} [url]
|
|
10802
|
-
* @param {
|
|
10854
|
+
* @param {QueryOption | null} [query]
|
|
10803
10855
|
* @returns {Promise<Transaction>}
|
|
10804
10856
|
*/
|
|
10805
|
-
static executeAuthorization(authorization, fee_authorization, program, proving_key, verifying_key, fee_proving_key, fee_verifying_key, imports, url,
|
|
10857
|
+
static executeAuthorization(authorization, fee_authorization, program, proving_key, verifying_key, fee_proving_key, fee_verifying_key, imports, url, query) {
|
|
10806
10858
|
_assertClass(authorization, Authorization);
|
|
10807
10859
|
var ptr0 = authorization.__destroy_into_raw();
|
|
10808
10860
|
let ptr1 = 0;
|
|
@@ -10835,9 +10887,9 @@ class ProgramManager {
|
|
|
10835
10887
|
var ptr7 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10836
10888
|
var len7 = WASM_VECTOR_LEN;
|
|
10837
10889
|
let ptr8 = 0;
|
|
10838
|
-
if (!isLikeNone(
|
|
10839
|
-
_assertClass(
|
|
10840
|
-
ptr8 =
|
|
10890
|
+
if (!isLikeNone(query)) {
|
|
10891
|
+
_assertClass(query, QueryOption);
|
|
10892
|
+
ptr8 = query.__destroy_into_raw();
|
|
10841
10893
|
}
|
|
10842
10894
|
const ret = wasm$1.programmanager_executeAuthorization(ptr0, ptr1, ptr2, len2, ptr3, ptr4, ptr5, ptr6, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr7, len7, ptr8);
|
|
10843
10895
|
return takeObject(ret);
|
|
@@ -10908,11 +10960,11 @@ class ProgramManager {
|
|
|
10908
10960
|
* @param {ProvingKey | null} [proving_key]
|
|
10909
10961
|
* @param {VerifyingKey | null} [verifying_key]
|
|
10910
10962
|
* @param {string | null} [url]
|
|
10911
|
-
* @param {
|
|
10963
|
+
* @param {QueryOption | null} [query]
|
|
10912
10964
|
* @param {number | null} [edition]
|
|
10913
10965
|
* @returns {Promise<ExecutionResponse>}
|
|
10914
10966
|
*/
|
|
10915
|
-
static executeFunctionOffline(private_key, program, _function, inputs, prove_execution, cache, imports, proving_key, verifying_key, url,
|
|
10967
|
+
static executeFunctionOffline(private_key, program, _function, inputs, prove_execution, cache, imports, proving_key, verifying_key, url, query, edition) {
|
|
10916
10968
|
_assertClass(private_key, PrivateKey);
|
|
10917
10969
|
const ptr0 = passStringToWasm0(program, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10918
10970
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -10931,13 +10983,60 @@ class ProgramManager {
|
|
|
10931
10983
|
var ptr4 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10932
10984
|
var len4 = WASM_VECTOR_LEN;
|
|
10933
10985
|
let ptr5 = 0;
|
|
10934
|
-
if (!isLikeNone(
|
|
10935
|
-
_assertClass(
|
|
10936
|
-
ptr5 =
|
|
10986
|
+
if (!isLikeNone(query)) {
|
|
10987
|
+
_assertClass(query, QueryOption);
|
|
10988
|
+
ptr5 = query.__destroy_into_raw();
|
|
10937
10989
|
}
|
|
10938
10990
|
const ret = wasm$1.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);
|
|
10939
10991
|
return takeObject(ret);
|
|
10940
10992
|
}
|
|
10993
|
+
/**
|
|
10994
|
+
* Compute the query requirements for a function execution without making
|
|
10995
|
+
* any network calls. Returns the commitments that need state paths and
|
|
10996
|
+
* whether the function has dynamic record inputs.
|
|
10997
|
+
*
|
|
10998
|
+
* This enables the JS layer to pre-fetch state data via its configured
|
|
10999
|
+
* transport and construct an OfflineQuery, so that the subsequent WASM
|
|
11000
|
+
* execution call never makes its own network requests.
|
|
11001
|
+
*
|
|
11002
|
+
* @param {string} program The source code of the program
|
|
11003
|
+
* @param {string} function_name The name of the function to execute
|
|
11004
|
+
* @param {Array} inputs The inputs to the function
|
|
11005
|
+
* @param {PrivateKey} private_key The private key (used to derive the view key for commitment computation)
|
|
11006
|
+
* @param {RecordPlaintext | undefined} fee_record Optional fee record to include in commitment computation
|
|
11007
|
+
* @returns {Object} An object with { commitments: string[], hasDynamicInputs: boolean }
|
|
11008
|
+
* @param {string} program
|
|
11009
|
+
* @param {string} function_name
|
|
11010
|
+
* @param {Array<any>} inputs
|
|
11011
|
+
* @param {PrivateKey} private_key
|
|
11012
|
+
* @param {RecordPlaintext | null} [fee_record]
|
|
11013
|
+
* @returns {any}
|
|
11014
|
+
*/
|
|
11015
|
+
static computeQueryRequirements(program, function_name, inputs, private_key, fee_record) {
|
|
11016
|
+
try {
|
|
11017
|
+
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
|
11018
|
+
const ptr0 = passStringToWasm0(program, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
11019
|
+
const len0 = WASM_VECTOR_LEN;
|
|
11020
|
+
const ptr1 = passStringToWasm0(function_name, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
11021
|
+
const len1 = WASM_VECTOR_LEN;
|
|
11022
|
+
_assertClass(private_key, PrivateKey);
|
|
11023
|
+
let ptr2 = 0;
|
|
11024
|
+
if (!isLikeNone(fee_record)) {
|
|
11025
|
+
_assertClass(fee_record, RecordPlaintext);
|
|
11026
|
+
ptr2 = fee_record.__destroy_into_raw();
|
|
11027
|
+
}
|
|
11028
|
+
wasm$1.programmanager_computeQueryRequirements(retptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), private_key.__wbg_ptr, ptr2);
|
|
11029
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
11030
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
11031
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
11032
|
+
if (r2) {
|
|
11033
|
+
throw takeObject(r1);
|
|
11034
|
+
}
|
|
11035
|
+
return takeObject(r0);
|
|
11036
|
+
} finally {
|
|
11037
|
+
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
|
11038
|
+
}
|
|
11039
|
+
}
|
|
10941
11040
|
/**
|
|
10942
11041
|
* Estimate Fee for an Authorization.
|
|
10943
11042
|
*
|
|
@@ -11010,11 +11109,11 @@ class ProgramManager {
|
|
|
11010
11109
|
* @param {VerifyingKey | null} [verifying_key]
|
|
11011
11110
|
* @param {ProvingKey | null} [fee_proving_key]
|
|
11012
11111
|
* @param {VerifyingKey | null} [fee_verifying_key]
|
|
11013
|
-
* @param {
|
|
11112
|
+
* @param {QueryOption | null} [query]
|
|
11014
11113
|
* @param {number | null} [edition]
|
|
11015
11114
|
* @returns {Promise<Transaction>}
|
|
11016
11115
|
*/
|
|
11017
|
-
static buildExecutionTransaction(private_key, program, _function, inputs, priority_fee_credits, fee_record, url, imports, proving_key, verifying_key, fee_proving_key, fee_verifying_key,
|
|
11116
|
+
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) {
|
|
11018
11117
|
_assertClass(private_key, PrivateKey);
|
|
11019
11118
|
const ptr0 = passStringToWasm0(program, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
11020
11119
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -11048,9 +11147,9 @@ class ProgramManager {
|
|
|
11048
11147
|
ptr7 = fee_verifying_key.__destroy_into_raw();
|
|
11049
11148
|
}
|
|
11050
11149
|
let ptr8 = 0;
|
|
11051
|
-
if (!isLikeNone(
|
|
11052
|
-
_assertClass(
|
|
11053
|
-
ptr8 =
|
|
11150
|
+
if (!isLikeNone(query)) {
|
|
11151
|
+
_assertClass(query, QueryOption);
|
|
11152
|
+
ptr8 = query.__destroy_into_raw();
|
|
11054
11153
|
}
|
|
11055
11154
|
const ret = wasm$1.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);
|
|
11056
11155
|
return takeObject(ret);
|
|
@@ -11083,10 +11182,10 @@ class ProgramManager {
|
|
|
11083
11182
|
* @param {VerifyingKey | null} [transfer_verifying_key]
|
|
11084
11183
|
* @param {ProvingKey | null} [fee_proving_key]
|
|
11085
11184
|
* @param {VerifyingKey | null} [fee_verifying_key]
|
|
11086
|
-
* @param {
|
|
11185
|
+
* @param {QueryOption | null} [query]
|
|
11087
11186
|
* @returns {Promise<Transaction>}
|
|
11088
11187
|
*/
|
|
11089
|
-
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,
|
|
11188
|
+
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) {
|
|
11090
11189
|
_assertClass(private_key, PrivateKey);
|
|
11091
11190
|
const ptr0 = passStringToWasm0(recipient, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
11092
11191
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -11125,9 +11224,9 @@ class ProgramManager {
|
|
|
11125
11224
|
ptr8 = fee_verifying_key.__destroy_into_raw();
|
|
11126
11225
|
}
|
|
11127
11226
|
let ptr9 = 0;
|
|
11128
|
-
if (!isLikeNone(
|
|
11129
|
-
_assertClass(
|
|
11130
|
-
ptr9 =
|
|
11227
|
+
if (!isLikeNone(query)) {
|
|
11228
|
+
_assertClass(query, QueryOption);
|
|
11229
|
+
ptr9 = query.__destroy_into_raw();
|
|
11131
11230
|
}
|
|
11132
11231
|
const ret = wasm$1.programmanager_buildTransferTransaction(private_key.__wbg_ptr, amount_credits, ptr0, len0, ptr1, len1, ptr2, priority_fee_credits, ptr3, ptr4, len4, ptr5, ptr6, ptr7, ptr8, ptr9);
|
|
11133
11232
|
return takeObject(ret);
|
|
@@ -11909,6 +12008,63 @@ class ProvingRequest {
|
|
|
11909
12008
|
}
|
|
11910
12009
|
if (Symbol.dispose) ProvingRequest.prototype[Symbol.dispose] = ProvingRequest.prototype.free;
|
|
11911
12010
|
|
|
12011
|
+
const QueryOptionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
12012
|
+
? { register: () => {}, unregister: () => {} }
|
|
12013
|
+
: new FinalizationRegistry(ptr => wasm$1.__wbg_queryoption_free(ptr >>> 0, 1));
|
|
12014
|
+
/**
|
|
12015
|
+
* A unified query type that wraps either an OfflineQuery (pre-fetched state)
|
|
12016
|
+
* or a CallbackQuery (on-demand JS transport delegation).
|
|
12017
|
+
*
|
|
12018
|
+
* Construct from JavaScript using the static factory methods:
|
|
12019
|
+
* - `QueryOption.offlineQuery(offlineQuery)` for pre-fetched state
|
|
12020
|
+
* - `QueryOption.callbackQuery(callbackQuery)` for on-demand JS callbacks
|
|
12021
|
+
*/
|
|
12022
|
+
class QueryOption {
|
|
12023
|
+
|
|
12024
|
+
static __wrap(ptr) {
|
|
12025
|
+
ptr = ptr >>> 0;
|
|
12026
|
+
const obj = Object.create(QueryOption.prototype);
|
|
12027
|
+
obj.__wbg_ptr = ptr;
|
|
12028
|
+
QueryOptionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
12029
|
+
return obj;
|
|
12030
|
+
}
|
|
12031
|
+
|
|
12032
|
+
__destroy_into_raw() {
|
|
12033
|
+
const ptr = this.__wbg_ptr;
|
|
12034
|
+
this.__wbg_ptr = 0;
|
|
12035
|
+
QueryOptionFinalization.unregister(this);
|
|
12036
|
+
return ptr;
|
|
12037
|
+
}
|
|
12038
|
+
|
|
12039
|
+
free() {
|
|
12040
|
+
const ptr = this.__destroy_into_raw();
|
|
12041
|
+
wasm$1.__wbg_queryoption_free(ptr, 0);
|
|
12042
|
+
}
|
|
12043
|
+
/**
|
|
12044
|
+
* Create a QueryOption from an OfflineQuery.
|
|
12045
|
+
* @param {OfflineQuery} query
|
|
12046
|
+
* @returns {QueryOption}
|
|
12047
|
+
*/
|
|
12048
|
+
static offlineQuery(query) {
|
|
12049
|
+
_assertClass(query, OfflineQuery);
|
|
12050
|
+
var ptr0 = query.__destroy_into_raw();
|
|
12051
|
+
const ret = wasm$1.queryoption_offlineQuery(ptr0);
|
|
12052
|
+
return QueryOption.__wrap(ret);
|
|
12053
|
+
}
|
|
12054
|
+
/**
|
|
12055
|
+
* Create a QueryOption from a CallbackQuery.
|
|
12056
|
+
* @param {CallbackQuery} query
|
|
12057
|
+
* @returns {QueryOption}
|
|
12058
|
+
*/
|
|
12059
|
+
static callbackQuery(query) {
|
|
12060
|
+
_assertClass(query, CallbackQuery);
|
|
12061
|
+
var ptr0 = query.__destroy_into_raw();
|
|
12062
|
+
const ret = wasm$1.queryoption_callbackQuery(ptr0);
|
|
12063
|
+
return QueryOption.__wrap(ret);
|
|
12064
|
+
}
|
|
12065
|
+
}
|
|
12066
|
+
if (Symbol.dispose) QueryOption.prototype[Symbol.dispose] = QueryOption.prototype.free;
|
|
12067
|
+
|
|
11912
12068
|
const RecordCiphertextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
11913
12069
|
? { register: () => {}, unregister: () => {} }
|
|
11914
12070
|
: new FinalizationRegistry(ptr => wasm$1.__wbg_recordciphertext_free(ptr >>> 0, 1));
|
|
@@ -18165,6 +18321,12 @@ function __wbg_get_imports(memory) {
|
|
|
18165
18321
|
const ret = __wbg_init.__wbindgen_wasm_module;
|
|
18166
18322
|
return addHeapObject(ret);
|
|
18167
18323
|
};
|
|
18324
|
+
imports.wbg.__wbg___wbindgen_number_get_a20bf9b85341449d = function(arg0, arg1) {
|
|
18325
|
+
const obj = getObject(arg1);
|
|
18326
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
18327
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
18328
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
18329
|
+
};
|
|
18168
18330
|
imports.wbg.__wbg___wbindgen_rethrow_ea38273dafc473e6 = function(arg0) {
|
|
18169
18331
|
throw takeObject(arg0);
|
|
18170
18332
|
};
|
|
@@ -18192,6 +18354,10 @@ function __wbg_get_imports(memory) {
|
|
|
18192
18354
|
imports.wbg.__wbg_append_b577eb3a177bc0fa = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
18193
18355
|
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
18194
18356
|
}, arguments) };
|
|
18357
|
+
imports.wbg.__wbg_apply_04097a755e1e4a1e = function() { return handleError(function (arg0, arg1, arg2) {
|
|
18358
|
+
const ret = getObject(arg0).apply(getObject(arg1), getObject(arg2));
|
|
18359
|
+
return addHeapObject(ret);
|
|
18360
|
+
}, arguments) };
|
|
18195
18361
|
imports.wbg.__wbg_arrayBuffer_b375eccb84b4ddf3 = function() { return handleError(function (arg0) {
|
|
18196
18362
|
const ret = getObject(arg0).arrayBuffer();
|
|
18197
18363
|
return addHeapObject(ret);
|
|
@@ -18298,6 +18464,16 @@ function __wbg_get_imports(memory) {
|
|
|
18298
18464
|
const ret = getObject(arg0).headers;
|
|
18299
18465
|
return addHeapObject(ret);
|
|
18300
18466
|
};
|
|
18467
|
+
imports.wbg.__wbg_instanceof_Promise_001fdd42afa1b7ef = function(arg0) {
|
|
18468
|
+
let result;
|
|
18469
|
+
try {
|
|
18470
|
+
result = getObject(arg0) instanceof Promise;
|
|
18471
|
+
} catch (_) {
|
|
18472
|
+
result = false;
|
|
18473
|
+
}
|
|
18474
|
+
const ret = result;
|
|
18475
|
+
return ret;
|
|
18476
|
+
};
|
|
18301
18477
|
imports.wbg.__wbg_instanceof_Response_f4f3e87e07f3135c = function(arg0) {
|
|
18302
18478
|
let result;
|
|
18303
18479
|
try {
|
|
@@ -18342,7 +18518,7 @@ function __wbg_get_imports(memory) {
|
|
|
18342
18518
|
const ret = getObject(arg0).length;
|
|
18343
18519
|
return ret;
|
|
18344
18520
|
};
|
|
18345
|
-
imports.wbg.
|
|
18521
|
+
imports.wbg.__wbg_log_22dee88c33d8b7ed = function(arg0, arg1) {
|
|
18346
18522
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
18347
18523
|
};
|
|
18348
18524
|
imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
|
|
@@ -18364,7 +18540,7 @@ function __wbg_get_imports(memory) {
|
|
|
18364
18540
|
const a = state0.a;
|
|
18365
18541
|
state0.a = 0;
|
|
18366
18542
|
try {
|
|
18367
|
-
return
|
|
18543
|
+
return __wasm_bindgen_func_elem_7484(a, state0.b, arg0, arg1);
|
|
18368
18544
|
} finally {
|
|
18369
18545
|
state0.a = a;
|
|
18370
18546
|
}
|
|
@@ -18551,7 +18727,7 @@ function __wbg_get_imports(memory) {
|
|
|
18551
18727
|
const ret = Signature.__wrap(arg0);
|
|
18552
18728
|
return addHeapObject(ret);
|
|
18553
18729
|
};
|
|
18554
|
-
imports.wbg.
|
|
18730
|
+
imports.wbg.__wbg_spawnWorker_33cc8ce5f9639974 = function(arg0, arg1, arg2, arg3) {
|
|
18555
18731
|
const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
|
|
18556
18732
|
return addHeapObject(ret);
|
|
18557
18733
|
};
|
|
@@ -18646,6 +18822,16 @@ function __wbg_get_imports(memory) {
|
|
|
18646
18822
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
18647
18823
|
return addHeapObject(ret);
|
|
18648
18824
|
};
|
|
18825
|
+
imports.wbg.__wbindgen_cast_28475d7a0f25a997 = function(arg0, arg1) {
|
|
18826
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 357, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 358, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
18827
|
+
const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7211, __wasm_bindgen_func_elem_8577);
|
|
18828
|
+
return addHeapObject(ret);
|
|
18829
|
+
};
|
|
18830
|
+
imports.wbg.__wbindgen_cast_2c5fc068add553f7 = function(arg0, arg1) {
|
|
18831
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 357, function: Function { arguments: [], shim_idx: 465, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
18832
|
+
const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7211, __wasm_bindgen_func_elem_7212);
|
|
18833
|
+
return addHeapObject(ret);
|
|
18834
|
+
};
|
|
18649
18835
|
imports.wbg.__wbindgen_cast_2ddd8a25ff58642a = function(arg0, arg1) {
|
|
18650
18836
|
// Cast intrinsic for `I128 -> Externref`.
|
|
18651
18837
|
const ret = (BigInt.asUintN(64, arg0) | (arg1 << BigInt(64)));
|
|
@@ -18656,24 +18842,14 @@ function __wbg_get_imports(memory) {
|
|
|
18656
18842
|
const ret = BigInt.asUintN(64, arg0);
|
|
18657
18843
|
return addHeapObject(ret);
|
|
18658
18844
|
};
|
|
18659
|
-
imports.wbg.__wbindgen_cast_711d7deea8fc39ca = function(arg0, arg1) {
|
|
18660
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 356, function: Function { arguments: [Externref], shim_idx: 357, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
18661
|
-
const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7169, __wasm_bindgen_func_elem_8534);
|
|
18662
|
-
return addHeapObject(ret);
|
|
18663
|
-
};
|
|
18664
18845
|
imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
18665
18846
|
// Cast intrinsic for `I64 -> Externref`.
|
|
18666
18847
|
const ret = arg0;
|
|
18667
18848
|
return addHeapObject(ret);
|
|
18668
18849
|
};
|
|
18669
|
-
imports.wbg.
|
|
18670
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
18671
|
-
const ret = makeMutClosure(arg0, arg1, wasm$1.
|
|
18672
|
-
return addHeapObject(ret);
|
|
18673
|
-
};
|
|
18674
|
-
imports.wbg.__wbindgen_cast_cada7727142cd213 = function(arg0, arg1) {
|
|
18675
|
-
// 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`.
|
|
18676
|
-
const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7169, __wasm_bindgen_func_elem_8534);
|
|
18850
|
+
imports.wbg.__wbindgen_cast_b1bcbba6fa3c236c = function(arg0, arg1) {
|
|
18851
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 357, function: Function { arguments: [Externref], shim_idx: 358, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
18852
|
+
const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7211, __wasm_bindgen_func_elem_8577);
|
|
18677
18853
|
return addHeapObject(ret);
|
|
18678
18854
|
};
|
|
18679
18855
|
imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
|
|
@@ -18784,6 +18960,7 @@ var exports$1$1 = /*#__PURE__*/Object.freeze({
|
|
|
18784
18960
|
BHP512: BHP512,
|
|
18785
18961
|
BHP768: BHP768,
|
|
18786
18962
|
Boolean: Boolean,
|
|
18963
|
+
CallbackQuery: CallbackQuery,
|
|
18787
18964
|
Ciphertext: Ciphertext,
|
|
18788
18965
|
ComputeKey: ComputeKey,
|
|
18789
18966
|
DynamicRecord: DynamicRecord,
|
|
@@ -18815,6 +18992,7 @@ var exports$1$1 = /*#__PURE__*/Object.freeze({
|
|
|
18815
18992
|
Proof: Proof,
|
|
18816
18993
|
ProvingKey: ProvingKey,
|
|
18817
18994
|
ProvingRequest: ProvingRequest,
|
|
18995
|
+
QueryOption: QueryOption,
|
|
18818
18996
|
RecordCiphertext: RecordCiphertext,
|
|
18819
18997
|
RecordPlaintext: RecordPlaintext,
|
|
18820
18998
|
Scalar: Scalar,
|