@provablehq/wasm 0.10.5 → 0.10.6-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 +241 -51
- package/dist/mainnet/aleo_wasm.wasm +0 -0
- package/dist/mainnet/index.cjs +672 -102
- package/dist/mainnet/index.cjs.map +1 -1
- package/dist/mainnet/index.js +672 -103
- package/dist/mainnet/index.js.map +1 -1
- package/dist/mainnet/worker.js +672 -102
- package/dist/mainnet/worker.js.map +1 -1
- package/dist/testnet/aleo_wasm.d.ts +248 -58
- package/dist/testnet/aleo_wasm.wasm +0 -0
- package/dist/testnet/index.cjs +675 -105
- package/dist/testnet/index.cjs.map +1 -1
- package/dist/testnet/index.js +675 -106
- package/dist/testnet/index.js.map +1 -1
- package/dist/testnet/worker.js +675 -105
- package/dist/testnet/worker.js.map +1 -1
- package/package.json +1 -1
package/dist/mainnet/index.cjs
CHANGED
|
@@ -309,39 +309,6 @@ function addBorrowedObject(obj) {
|
|
|
309
309
|
heap[--stack_pointer] = obj;
|
|
310
310
|
return stack_pointer;
|
|
311
311
|
}
|
|
312
|
-
/**
|
|
313
|
-
* Verify a SNARK proof against a verifying key and public inputs.
|
|
314
|
-
*
|
|
315
|
-
* This function verifies a proof produced by an Aleo program that may not be deployed on chain.
|
|
316
|
-
* It directly invokes the Varuna proof verification from snarkVM.
|
|
317
|
-
*
|
|
318
|
-
* @param {VerifyingKey} verifying_key The verifying key for the circuit
|
|
319
|
-
* @param {Array<string>} inputs Array of field element strings representing public inputs (e.g. ["1field", "2field"])
|
|
320
|
-
* @param {Proof} proof The proof to verify
|
|
321
|
-
* @returns {boolean} True if the proof is valid, false otherwise
|
|
322
|
-
* @param {VerifyingKey} verifying_key
|
|
323
|
-
* @param {Array<any>} inputs
|
|
324
|
-
* @param {Proof} proof
|
|
325
|
-
* @returns {boolean}
|
|
326
|
-
*/
|
|
327
|
-
function snarkVerify(verifying_key, inputs, proof) {
|
|
328
|
-
try {
|
|
329
|
-
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
|
330
|
-
_assertClass(verifying_key, VerifyingKey);
|
|
331
|
-
_assertClass(proof, Proof);
|
|
332
|
-
wasm$1.snarkVerify(retptr, verifying_key.__wbg_ptr, addHeapObject(inputs), proof.__wbg_ptr);
|
|
333
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
334
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
335
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
336
|
-
if (r2) {
|
|
337
|
-
throw takeObject(r1);
|
|
338
|
-
}
|
|
339
|
-
return r0 !== 0;
|
|
340
|
-
} finally {
|
|
341
|
-
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
|
|
345
312
|
/**
|
|
346
313
|
* Verify an execution. Executions with multiple transitions must have the program source code and
|
|
347
314
|
* verifying keys of imported functions supplied from outside to correctly verify. Also, this does
|
|
@@ -361,9 +328,10 @@ function snarkVerify(verifying_key, inputs, proof) {
|
|
|
361
328
|
* @param {object | null | undefined} imports
|
|
362
329
|
* @param {object | null | undefined} imported_verifying_keys
|
|
363
330
|
* @param {number} block_height
|
|
331
|
+
* @param {ProgramImports | null} [program_imports]
|
|
364
332
|
* @returns {boolean}
|
|
365
333
|
*/
|
|
366
|
-
function verifyFunctionExecution(execution, verifying_key, program, function_id, imports, imported_verifying_keys, block_height) {
|
|
334
|
+
function verifyFunctionExecution(execution, verifying_key, program, function_id, imports, imported_verifying_keys, block_height, program_imports) {
|
|
367
335
|
try {
|
|
368
336
|
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
|
369
337
|
_assertClass(execution, Execution);
|
|
@@ -371,7 +339,12 @@ function verifyFunctionExecution(execution, verifying_key, program, function_id,
|
|
|
371
339
|
_assertClass(program, Program);
|
|
372
340
|
const ptr0 = passStringToWasm0(function_id, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
373
341
|
const len0 = WASM_VECTOR_LEN;
|
|
374
|
-
|
|
342
|
+
let ptr1 = 0;
|
|
343
|
+
if (!isLikeNone(program_imports)) {
|
|
344
|
+
_assertClass(program_imports, ProgramImports);
|
|
345
|
+
ptr1 = program_imports.__destroy_into_raw();
|
|
346
|
+
}
|
|
347
|
+
wasm$1.verifyFunctionExecution(retptr, execution.__wbg_ptr, verifying_key.__wbg_ptr, program.__wbg_ptr, ptr0, len0, isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(imported_verifying_keys) ? 0 : addHeapObject(imported_verifying_keys), block_height, ptr1);
|
|
375
348
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
376
349
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
377
350
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -416,6 +389,39 @@ function snarkVerifyBatch(verifying_keys, inputs, proof) {
|
|
|
416
389
|
}
|
|
417
390
|
}
|
|
418
391
|
|
|
392
|
+
/**
|
|
393
|
+
* Verify a SNARK proof against a verifying key and public inputs.
|
|
394
|
+
*
|
|
395
|
+
* This function verifies a proof produced by an Aleo program that may not be deployed on chain.
|
|
396
|
+
* It directly invokes the Varuna proof verification from snarkVM.
|
|
397
|
+
*
|
|
398
|
+
* @param {VerifyingKey} verifying_key The verifying key for the circuit
|
|
399
|
+
* @param {Array<string>} inputs Array of field element strings representing public inputs (e.g. ["1field", "2field"])
|
|
400
|
+
* @param {Proof} proof The proof to verify
|
|
401
|
+
* @returns {boolean} True if the proof is valid, false otherwise
|
|
402
|
+
* @param {VerifyingKey} verifying_key
|
|
403
|
+
* @param {Array<any>} inputs
|
|
404
|
+
* @param {Proof} proof
|
|
405
|
+
* @returns {boolean}
|
|
406
|
+
*/
|
|
407
|
+
function snarkVerify(verifying_key, inputs, proof) {
|
|
408
|
+
try {
|
|
409
|
+
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
|
410
|
+
_assertClass(verifying_key, VerifyingKey);
|
|
411
|
+
_assertClass(proof, Proof);
|
|
412
|
+
wasm$1.snarkVerify(retptr, verifying_key.__wbg_ptr, addHeapObject(inputs), proof.__wbg_ptr);
|
|
413
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
414
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
415
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
416
|
+
if (r2) {
|
|
417
|
+
throw takeObject(r1);
|
|
418
|
+
}
|
|
419
|
+
return r0 !== 0;
|
|
420
|
+
} finally {
|
|
421
|
+
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
|
|
419
425
|
/**
|
|
420
426
|
* @param {string} string
|
|
421
427
|
* @returns {Field}
|
|
@@ -477,16 +483,16 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
477
483
|
}
|
|
478
484
|
return result;
|
|
479
485
|
}
|
|
480
|
-
function
|
|
481
|
-
wasm$1.
|
|
486
|
+
function __wasm_bindgen_func_elem_8618(arg0, arg1, arg2) {
|
|
487
|
+
wasm$1.__wasm_bindgen_func_elem_8618(arg0, arg1, addHeapObject(arg2));
|
|
482
488
|
}
|
|
483
489
|
|
|
484
|
-
function
|
|
485
|
-
wasm$1.
|
|
490
|
+
function __wasm_bindgen_func_elem_7256(arg0, arg1) {
|
|
491
|
+
wasm$1.__wasm_bindgen_func_elem_7256(arg0, arg1);
|
|
486
492
|
}
|
|
487
493
|
|
|
488
|
-
function
|
|
489
|
-
wasm$1.
|
|
494
|
+
function __wasm_bindgen_func_elem_7529(arg0, arg1, arg2, arg3) {
|
|
495
|
+
wasm$1.__wasm_bindgen_func_elem_7529(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
490
496
|
}
|
|
491
497
|
|
|
492
498
|
const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
@@ -10003,6 +10009,36 @@ class Program {
|
|
|
10003
10009
|
const ret = wasm$1.program_getFunctions(this.__wbg_ptr);
|
|
10004
10010
|
return takeObject(ret);
|
|
10005
10011
|
}
|
|
10012
|
+
/**
|
|
10013
|
+
* Get the external call graph reachable from a specific entry function.
|
|
10014
|
+
*
|
|
10015
|
+
* Starting from `entry_function`, traces all reachable functions and closures
|
|
10016
|
+
* within this program (via local calls) and collects external calls
|
|
10017
|
+
* (`call program.aleo/function`). Returns a JS object mapping program names
|
|
10018
|
+
* to arrays of called function names.
|
|
10019
|
+
*
|
|
10020
|
+
* @param {string} entry_function The name of the entry function to trace from
|
|
10021
|
+
* @returns {object} An object like `{ "program.aleo": ["fn1", "fn2"] }`
|
|
10022
|
+
* @param {string} entry_function
|
|
10023
|
+
* @returns {any}
|
|
10024
|
+
*/
|
|
10025
|
+
getCallGraph(entry_function) {
|
|
10026
|
+
try {
|
|
10027
|
+
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
|
10028
|
+
const ptr0 = passStringToWasm0(entry_function, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10029
|
+
const len0 = WASM_VECTOR_LEN;
|
|
10030
|
+
wasm$1.program_getCallGraph(retptr, this.__wbg_ptr, ptr0, len0);
|
|
10031
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
10032
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
10033
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
10034
|
+
if (r2) {
|
|
10035
|
+
throw takeObject(r1);
|
|
10036
|
+
}
|
|
10037
|
+
return takeObject(r0);
|
|
10038
|
+
} finally {
|
|
10039
|
+
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
|
10040
|
+
}
|
|
10041
|
+
}
|
|
10006
10042
|
/**
|
|
10007
10043
|
* Get a javascript object representation of a program record and its types
|
|
10008
10044
|
*
|
|
@@ -10266,6 +10302,436 @@ class Program {
|
|
|
10266
10302
|
}
|
|
10267
10303
|
if (Symbol.dispose) Program.prototype[Symbol.dispose] = Program.prototype.free;
|
|
10268
10304
|
|
|
10305
|
+
const ProgramImportsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
10306
|
+
? { register: () => {}, unregister: () => {} }
|
|
10307
|
+
: new FinalizationRegistry(ptr => wasm$1.__wbg_programimports_free(ptr >>> 0, 1));
|
|
10308
|
+
/**
|
|
10309
|
+
* Backed by `Rc<RefCell<>>` for interior mutability — cloning produces a cheap
|
|
10310
|
+
* reference-counted copy that shares the same underlying data. This allows
|
|
10311
|
+
* execution functions to clone the builder internally while the caller's
|
|
10312
|
+
* original reference automatically sees any mutations (e.g. synthesized keys).
|
|
10313
|
+
*/
|
|
10314
|
+
class ProgramImports {
|
|
10315
|
+
|
|
10316
|
+
static __wrap(ptr) {
|
|
10317
|
+
ptr = ptr >>> 0;
|
|
10318
|
+
const obj = Object.create(ProgramImports.prototype);
|
|
10319
|
+
obj.__wbg_ptr = ptr;
|
|
10320
|
+
ProgramImportsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
10321
|
+
return obj;
|
|
10322
|
+
}
|
|
10323
|
+
|
|
10324
|
+
__destroy_into_raw() {
|
|
10325
|
+
const ptr = this.__wbg_ptr;
|
|
10326
|
+
this.__wbg_ptr = 0;
|
|
10327
|
+
ProgramImportsFinalization.unregister(this);
|
|
10328
|
+
return ptr;
|
|
10329
|
+
}
|
|
10330
|
+
|
|
10331
|
+
free() {
|
|
10332
|
+
const ptr = this.__destroy_into_raw();
|
|
10333
|
+
wasm$1.__wbg_programimports_free(ptr, 0);
|
|
10334
|
+
}
|
|
10335
|
+
/**
|
|
10336
|
+
* Add a program's source code to the imports.
|
|
10337
|
+
*
|
|
10338
|
+
* The source is parsed, validated, and added to the internal Process.
|
|
10339
|
+
* Static imports of the program are resolved depth-first from programs
|
|
10340
|
+
* already present in this builder.
|
|
10341
|
+
*
|
|
10342
|
+
* @param {string} name The program name (e.g., "my_program.aleo").
|
|
10343
|
+
* @param {string} source The program source code.
|
|
10344
|
+
* @param {number | undefined} edition The program edition (defaults to 1).
|
|
10345
|
+
* @param {string} name
|
|
10346
|
+
* @param {string} source
|
|
10347
|
+
* @param {number | null} [edition]
|
|
10348
|
+
*/
|
|
10349
|
+
addProgram(name, source, edition) {
|
|
10350
|
+
try {
|
|
10351
|
+
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
|
10352
|
+
const ptr0 = passStringToWasm0(name, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10353
|
+
const len0 = WASM_VECTOR_LEN;
|
|
10354
|
+
const ptr1 = passStringToWasm0(source, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10355
|
+
const len1 = WASM_VECTOR_LEN;
|
|
10356
|
+
wasm$1.programimports_addProgram(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(edition) ? 0xFFFFFF : edition);
|
|
10357
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
10358
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
10359
|
+
if (r1) {
|
|
10360
|
+
throw takeObject(r0);
|
|
10361
|
+
}
|
|
10362
|
+
} finally {
|
|
10363
|
+
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
|
10364
|
+
}
|
|
10365
|
+
}
|
|
10366
|
+
/**
|
|
10367
|
+
* Create a ProgramImports from a plain JavaScript object.
|
|
10368
|
+
*
|
|
10369
|
+
* Accepts three formats:
|
|
10370
|
+
* ```js
|
|
10371
|
+
* // 1. Plain string — source code only.
|
|
10372
|
+
* { "my_program.aleo": "program source..." }
|
|
10373
|
+
*
|
|
10374
|
+
* // 2. Structured — program source with optional edition.
|
|
10375
|
+
* { "my_program.aleo": { program: "program source..." } }
|
|
10376
|
+
*
|
|
10377
|
+
* // 3. Structured with keys — program source plus proving/verifying keys per function.
|
|
10378
|
+
* {
|
|
10379
|
+
* "my_program.aleo": {
|
|
10380
|
+
* program: "program source...",
|
|
10381
|
+
* keys: {
|
|
10382
|
+
* "my_function": {
|
|
10383
|
+
* provingKey: Uint8Array,
|
|
10384
|
+
* verifyingKey: Uint8Array
|
|
10385
|
+
* }
|
|
10386
|
+
* }
|
|
10387
|
+
* }
|
|
10388
|
+
* }
|
|
10389
|
+
* ```
|
|
10390
|
+
*
|
|
10391
|
+
* Programs created via this method default to edition 1.
|
|
10392
|
+
*
|
|
10393
|
+
* @param {Object} object A plain JavaScript object mapping program names to source code
|
|
10394
|
+
* and optional keys.
|
|
10395
|
+
* @returns {ProgramImports}
|
|
10396
|
+
* @param {object} object
|
|
10397
|
+
* @returns {ProgramImports}
|
|
10398
|
+
*/
|
|
10399
|
+
static fromObject(object) {
|
|
10400
|
+
try {
|
|
10401
|
+
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
|
10402
|
+
wasm$1.programimports_fromObject(retptr, addHeapObject(object));
|
|
10403
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
10404
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
10405
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
10406
|
+
if (r2) {
|
|
10407
|
+
throw takeObject(r1);
|
|
10408
|
+
}
|
|
10409
|
+
return ProgramImports.__wrap(r0);
|
|
10410
|
+
} finally {
|
|
10411
|
+
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
|
10412
|
+
}
|
|
10413
|
+
}
|
|
10414
|
+
/**
|
|
10415
|
+
* Return the source code of a program by name, without serializing keys.
|
|
10416
|
+
*
|
|
10417
|
+
* @param {string} name The program name (e.g., "my_program.aleo").
|
|
10418
|
+
* @returns {string | undefined}
|
|
10419
|
+
* @param {string} name
|
|
10420
|
+
* @returns {string | undefined}
|
|
10421
|
+
*/
|
|
10422
|
+
getProgram(name) {
|
|
10423
|
+
try {
|
|
10424
|
+
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
|
10425
|
+
const ptr0 = passStringToWasm0(name, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10426
|
+
const len0 = WASM_VECTOR_LEN;
|
|
10427
|
+
wasm$1.programimports_getProgram(retptr, this.__wbg_ptr, ptr0, len0);
|
|
10428
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
10429
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
10430
|
+
let v2;
|
|
10431
|
+
if (r0 !== 0) {
|
|
10432
|
+
v2 = getStringFromWasm0(r0, r1).slice();
|
|
10433
|
+
wasm$1.__wbindgen_export4(r0, r1 * 1, 1);
|
|
10434
|
+
}
|
|
10435
|
+
return v2;
|
|
10436
|
+
} finally {
|
|
10437
|
+
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
|
10438
|
+
}
|
|
10439
|
+
}
|
|
10440
|
+
/**
|
|
10441
|
+
* Return the names of all programs in this builder as a JS `Array<string>`.
|
|
10442
|
+
*
|
|
10443
|
+
* This is a lightweight alternative to `toObject()` when you only need to
|
|
10444
|
+
* enumerate program names without serializing keys.
|
|
10445
|
+
*
|
|
10446
|
+
* @returns {Array<string>}
|
|
10447
|
+
* @returns {Array<any>}
|
|
10448
|
+
*/
|
|
10449
|
+
programNames() {
|
|
10450
|
+
const ret = wasm$1.programimports_programNames(this.__wbg_ptr);
|
|
10451
|
+
return takeObject(ret);
|
|
10452
|
+
}
|
|
10453
|
+
/**
|
|
10454
|
+
* Add a proving key for a function or record within an imported program.
|
|
10455
|
+
*
|
|
10456
|
+
* The key is transferred directly from the WASM `ProvingKey` type with no
|
|
10457
|
+
* serialization overhead.
|
|
10458
|
+
*
|
|
10459
|
+
* @param {string} program_name The program name (e.g., "my_program.aleo").
|
|
10460
|
+
* @param {string} identifier The function name or record name the key belongs to.
|
|
10461
|
+
* @param {ProvingKey} key The proving key.
|
|
10462
|
+
* @param {string} program_name
|
|
10463
|
+
* @param {string} identifier
|
|
10464
|
+
* @param {ProvingKey} key
|
|
10465
|
+
*/
|
|
10466
|
+
addProvingKey(program_name, identifier, key) {
|
|
10467
|
+
try {
|
|
10468
|
+
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
|
10469
|
+
const ptr0 = passStringToWasm0(program_name, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10470
|
+
const len0 = WASM_VECTOR_LEN;
|
|
10471
|
+
const ptr1 = passStringToWasm0(identifier, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10472
|
+
const len1 = WASM_VECTOR_LEN;
|
|
10473
|
+
_assertClass(key, ProvingKey);
|
|
10474
|
+
var ptr2 = key.__destroy_into_raw();
|
|
10475
|
+
wasm$1.programimports_addProvingKey(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2);
|
|
10476
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
10477
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
10478
|
+
if (r1) {
|
|
10479
|
+
throw takeObject(r0);
|
|
10480
|
+
}
|
|
10481
|
+
} finally {
|
|
10482
|
+
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
|
10483
|
+
}
|
|
10484
|
+
}
|
|
10485
|
+
/**
|
|
10486
|
+
* Get a proving key for a specific program and identifier (function or record name).
|
|
10487
|
+
* Returns a clone of the key from the internal Process. Non-destructive — the key
|
|
10488
|
+
* remains available for future calls.
|
|
10489
|
+
*
|
|
10490
|
+
* @param {string} program_name The program name (e.g., "my_program.aleo").
|
|
10491
|
+
* @param {string} identifier The function or record name.
|
|
10492
|
+
* @returns {ProvingKey | undefined}
|
|
10493
|
+
* @param {string} program_name
|
|
10494
|
+
* @param {string} identifier
|
|
10495
|
+
* @returns {ProvingKey | undefined}
|
|
10496
|
+
*/
|
|
10497
|
+
getProvingKey(program_name, identifier) {
|
|
10498
|
+
const ptr0 = passStringToWasm0(program_name, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10499
|
+
const len0 = WASM_VECTOR_LEN;
|
|
10500
|
+
const ptr1 = passStringToWasm0(identifier, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10501
|
+
const len1 = WASM_VECTOR_LEN;
|
|
10502
|
+
const ret = wasm$1.programimports_getProvingKey(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
10503
|
+
return ret === 0 ? undefined : ProvingKey.__wrap(ret);
|
|
10504
|
+
}
|
|
10505
|
+
/**
|
|
10506
|
+
* Add a verifying key for a function or record within an imported program.
|
|
10507
|
+
*
|
|
10508
|
+
* The key is transferred directly from the WASM `VerifyingKey` type with no
|
|
10509
|
+
* serialization overhead.
|
|
10510
|
+
*
|
|
10511
|
+
* @param {string} program_name The program name (e.g., "my_program.aleo").
|
|
10512
|
+
* @param {string} identifier The function name or record name the key belongs to.
|
|
10513
|
+
* @param {VerifyingKey} key The verifying key.
|
|
10514
|
+
* @param {string} program_name
|
|
10515
|
+
* @param {string} identifier
|
|
10516
|
+
* @param {VerifyingKey} key
|
|
10517
|
+
*/
|
|
10518
|
+
addVerifyingKey(program_name, identifier, key) {
|
|
10519
|
+
try {
|
|
10520
|
+
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
|
10521
|
+
const ptr0 = passStringToWasm0(program_name, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10522
|
+
const len0 = WASM_VECTOR_LEN;
|
|
10523
|
+
const ptr1 = passStringToWasm0(identifier, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10524
|
+
const len1 = WASM_VECTOR_LEN;
|
|
10525
|
+
_assertClass(key, VerifyingKey);
|
|
10526
|
+
var ptr2 = key.__destroy_into_raw();
|
|
10527
|
+
wasm$1.programimports_addVerifyingKey(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2);
|
|
10528
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
10529
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
10530
|
+
if (r1) {
|
|
10531
|
+
throw takeObject(r0);
|
|
10532
|
+
}
|
|
10533
|
+
} finally {
|
|
10534
|
+
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
|
10535
|
+
}
|
|
10536
|
+
}
|
|
10537
|
+
/**
|
|
10538
|
+
* Get a verifying key for a specific program and identifier (function or record name).
|
|
10539
|
+
* Returns a clone of the key from the internal Process. Non-destructive — the key
|
|
10540
|
+
* remains available for future calls.
|
|
10541
|
+
*
|
|
10542
|
+
* @param {string} program_name The program name (e.g., "my_program.aleo").
|
|
10543
|
+
* @param {string} identifier The function or record name.
|
|
10544
|
+
* @returns {VerifyingKey | undefined}
|
|
10545
|
+
* @param {string} program_name
|
|
10546
|
+
* @param {string} identifier
|
|
10547
|
+
* @returns {VerifyingKey | undefined}
|
|
10548
|
+
*/
|
|
10549
|
+
getVerifyingKey(program_name, identifier) {
|
|
10550
|
+
const ptr0 = passStringToWasm0(program_name, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10551
|
+
const len0 = WASM_VECTOR_LEN;
|
|
10552
|
+
const ptr1 = passStringToWasm0(identifier, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10553
|
+
const len1 = WASM_VECTOR_LEN;
|
|
10554
|
+
const ret = wasm$1.programimports_getVerifyingKey(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
10555
|
+
return ret === 0 ? undefined : VerifyingKey.__wrap(ret);
|
|
10556
|
+
}
|
|
10557
|
+
/**
|
|
10558
|
+
* Add a proving key from its byte representation.
|
|
10559
|
+
*
|
|
10560
|
+
* Deserializes the bytes into a native proving key and stores it. The program
|
|
10561
|
+
* must already have been added via `addProgram`.
|
|
10562
|
+
*
|
|
10563
|
+
* @param {string} program_name The program name (e.g., "my_program.aleo").
|
|
10564
|
+
* @param {string} identifier The function name or record name the key belongs to.
|
|
10565
|
+
* @param {Uint8Array} bytes The proving key bytes.
|
|
10566
|
+
* @param {string} program_name
|
|
10567
|
+
* @param {string} identifier
|
|
10568
|
+
* @param {Uint8Array} bytes
|
|
10569
|
+
*/
|
|
10570
|
+
addProvingKeyBytes(program_name, identifier, bytes) {
|
|
10571
|
+
try {
|
|
10572
|
+
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
|
10573
|
+
const ptr0 = passStringToWasm0(program_name, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10574
|
+
const len0 = WASM_VECTOR_LEN;
|
|
10575
|
+
const ptr1 = passStringToWasm0(identifier, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10576
|
+
const len1 = WASM_VECTOR_LEN;
|
|
10577
|
+
const ptr2 = passArray8ToWasm0(bytes, wasm$1.__wbindgen_export);
|
|
10578
|
+
const len2 = WASM_VECTOR_LEN;
|
|
10579
|
+
wasm$1.programimports_addProvingKeyBytes(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
10580
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
10581
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
10582
|
+
if (r1) {
|
|
10583
|
+
throw takeObject(r0);
|
|
10584
|
+
}
|
|
10585
|
+
} finally {
|
|
10586
|
+
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
|
10587
|
+
}
|
|
10588
|
+
}
|
|
10589
|
+
/**
|
|
10590
|
+
* Add a verifying key from its byte representation.
|
|
10591
|
+
*
|
|
10592
|
+
* Deserializes the bytes into a native verifying key and stores it. The program
|
|
10593
|
+
* must already have been added via `addProgram`.
|
|
10594
|
+
*
|
|
10595
|
+
* @param {string} program_name The program name (e.g., "my_program.aleo").
|
|
10596
|
+
* @param {string} identifier The function name or record name the key belongs to.
|
|
10597
|
+
* @param {Uint8Array} bytes The verifying key bytes.
|
|
10598
|
+
* @param {string} program_name
|
|
10599
|
+
* @param {string} identifier
|
|
10600
|
+
* @param {Uint8Array} bytes
|
|
10601
|
+
*/
|
|
10602
|
+
addVerifyingKeyBytes(program_name, identifier, bytes) {
|
|
10603
|
+
try {
|
|
10604
|
+
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
|
10605
|
+
const ptr0 = passStringToWasm0(program_name, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10606
|
+
const len0 = WASM_VECTOR_LEN;
|
|
10607
|
+
const ptr1 = passStringToWasm0(identifier, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10608
|
+
const len1 = WASM_VECTOR_LEN;
|
|
10609
|
+
const ptr2 = passArray8ToWasm0(bytes, wasm$1.__wbindgen_export);
|
|
10610
|
+
const len2 = WASM_VECTOR_LEN;
|
|
10611
|
+
wasm$1.programimports_addVerifyingKeyBytes(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
10612
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
10613
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
10614
|
+
if (r1) {
|
|
10615
|
+
throw takeObject(r0);
|
|
10616
|
+
}
|
|
10617
|
+
} finally {
|
|
10618
|
+
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
|
10619
|
+
}
|
|
10620
|
+
}
|
|
10621
|
+
/**
|
|
10622
|
+
* Return the names of functions that have both a proving key and a verifying key
|
|
10623
|
+
* stored for the given program.
|
|
10624
|
+
*
|
|
10625
|
+
* @param {string} program_name The program name (e.g., "my_program.aleo").
|
|
10626
|
+
* @returns {Array<string>}
|
|
10627
|
+
* @param {string} program_name
|
|
10628
|
+
* @returns {Array<any>}
|
|
10629
|
+
*/
|
|
10630
|
+
functionKeysAvailable(program_name) {
|
|
10631
|
+
try {
|
|
10632
|
+
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
|
10633
|
+
const ptr0 = passStringToWasm0(program_name, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10634
|
+
const len0 = WASM_VECTOR_LEN;
|
|
10635
|
+
wasm$1.programimports_functionKeysAvailable(retptr, this.__wbg_ptr, ptr0, len0);
|
|
10636
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
10637
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
10638
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
10639
|
+
if (r2) {
|
|
10640
|
+
throw takeObject(r1);
|
|
10641
|
+
}
|
|
10642
|
+
return takeObject(r0);
|
|
10643
|
+
} finally {
|
|
10644
|
+
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
|
10645
|
+
}
|
|
10646
|
+
}
|
|
10647
|
+
/**
|
|
10648
|
+
* Create a new empty ProgramImports builder.
|
|
10649
|
+
*
|
|
10650
|
+
* Initializes an internal snarkVM Process. This is the same cost as a
|
|
10651
|
+
* single execution call, but is paid once and reused across all operations.
|
|
10652
|
+
*/
|
|
10653
|
+
constructor() {
|
|
10654
|
+
try {
|
|
10655
|
+
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
|
10656
|
+
wasm$1.programimports_new(retptr);
|
|
10657
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
10658
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
10659
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
10660
|
+
if (r2) {
|
|
10661
|
+
throw takeObject(r1);
|
|
10662
|
+
}
|
|
10663
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
10664
|
+
ProgramImportsFinalization.register(this, this.__wbg_ptr, this);
|
|
10665
|
+
return this;
|
|
10666
|
+
} finally {
|
|
10667
|
+
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
|
10668
|
+
}
|
|
10669
|
+
}
|
|
10670
|
+
/**
|
|
10671
|
+
* Create a cheap clone that shares the same underlying data.
|
|
10672
|
+
*
|
|
10673
|
+
* Useful for passing to WASM execution functions which consume ownership:
|
|
10674
|
+
* the caller keeps the original, and both copies see any mutations
|
|
10675
|
+
* (e.g. synthesized keys) through the shared interior state.
|
|
10676
|
+
* @returns {ProgramImports}
|
|
10677
|
+
*/
|
|
10678
|
+
clone() {
|
|
10679
|
+
const ret = wasm$1.programimports_clone(this.__wbg_ptr);
|
|
10680
|
+
return ProgramImports.__wrap(ret);
|
|
10681
|
+
}
|
|
10682
|
+
/**
|
|
10683
|
+
* Check whether a specific program has been added.
|
|
10684
|
+
*
|
|
10685
|
+
* @param {string} name The program name.
|
|
10686
|
+
* @returns {boolean}
|
|
10687
|
+
* @param {string} name
|
|
10688
|
+
* @returns {boolean}
|
|
10689
|
+
*/
|
|
10690
|
+
contains(name) {
|
|
10691
|
+
const ptr0 = passStringToWasm0(name, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10692
|
+
const len0 = WASM_VECTOR_LEN;
|
|
10693
|
+
const ret = wasm$1.programimports_contains(this.__wbg_ptr, ptr0, len0);
|
|
10694
|
+
return ret !== 0;
|
|
10695
|
+
}
|
|
10696
|
+
/**
|
|
10697
|
+
* Check whether any programs have been added to this builder.
|
|
10698
|
+
*
|
|
10699
|
+
* @returns {boolean}
|
|
10700
|
+
* @returns {boolean}
|
|
10701
|
+
*/
|
|
10702
|
+
isEmpty() {
|
|
10703
|
+
const ret = wasm$1.programimports_isEmpty(this.__wbg_ptr);
|
|
10704
|
+
return ret !== 0;
|
|
10705
|
+
}
|
|
10706
|
+
/**
|
|
10707
|
+
* Convert this ProgramImports to a plain JavaScript object.
|
|
10708
|
+
*
|
|
10709
|
+
* Entries without keys use the simple `{ "name.aleo": "source" }` format.
|
|
10710
|
+
* Entries with keys use the structured format:
|
|
10711
|
+
* ```js
|
|
10712
|
+
* {
|
|
10713
|
+
* "name.aleo": {
|
|
10714
|
+
* program: "program source...",
|
|
10715
|
+
* keys: {
|
|
10716
|
+
* "function_name": {
|
|
10717
|
+
* provingKey: Uint8Array,
|
|
10718
|
+
* verifyingKey: Uint8Array
|
|
10719
|
+
* }
|
|
10720
|
+
* }
|
|
10721
|
+
* }
|
|
10722
|
+
* }
|
|
10723
|
+
* ```
|
|
10724
|
+
*
|
|
10725
|
+
* @returns {Object}
|
|
10726
|
+
* @returns {object}
|
|
10727
|
+
*/
|
|
10728
|
+
toObject() {
|
|
10729
|
+
const ret = wasm$1.programimports_toObject(this.__wbg_ptr);
|
|
10730
|
+
return takeObject(ret);
|
|
10731
|
+
}
|
|
10732
|
+
}
|
|
10733
|
+
if (Symbol.dispose) ProgramImports.prototype[Symbol.dispose] = ProgramImports.prototype.free;
|
|
10734
|
+
|
|
10269
10735
|
const ProgramManagerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
10270
10736
|
? { register: () => {}, unregister: () => {} }
|
|
10271
10737
|
: new FinalizationRegistry(ptr => wasm$1.__wbg_programmanager_free(ptr >>> 0, 1));
|
|
@@ -10296,15 +10762,21 @@ class ProgramManager {
|
|
|
10296
10762
|
* @param {Array<any>} inputs
|
|
10297
10763
|
* @param {object | null} [imports]
|
|
10298
10764
|
* @param {number | null} [edition]
|
|
10765
|
+
* @param {ProgramImports | null} [program_imports]
|
|
10299
10766
|
* @returns {Promise<KeyPair>}
|
|
10300
10767
|
*/
|
|
10301
|
-
static synthesizeKeyPair(private_key, program, function_id, inputs, imports, edition) {
|
|
10768
|
+
static synthesizeKeyPair(private_key, program, function_id, inputs, imports, edition, program_imports) {
|
|
10302
10769
|
_assertClass(private_key, PrivateKey);
|
|
10303
10770
|
const ptr0 = passStringToWasm0(program, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10304
10771
|
const len0 = WASM_VECTOR_LEN;
|
|
10305
10772
|
const ptr1 = passStringToWasm0(function_id, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10306
10773
|
const len1 = WASM_VECTOR_LEN;
|
|
10307
|
-
|
|
10774
|
+
let ptr2 = 0;
|
|
10775
|
+
if (!isLikeNone(program_imports)) {
|
|
10776
|
+
_assertClass(program_imports, ProgramImports);
|
|
10777
|
+
ptr2 = program_imports.__destroy_into_raw();
|
|
10778
|
+
}
|
|
10779
|
+
const ret = wasm$1.programmanager_synthesizeKeyPair(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(edition) ? 0xFFFFFF : edition, ptr2);
|
|
10308
10780
|
return takeObject(ret);
|
|
10309
10781
|
}
|
|
10310
10782
|
/**
|
|
@@ -10343,9 +10815,10 @@ class ProgramManager {
|
|
|
10343
10815
|
* @param {boolean} unchecked
|
|
10344
10816
|
* @param {number | null | undefined} edition
|
|
10345
10817
|
* @param {boolean} use_fee_master
|
|
10818
|
+
* @param {ProgramImports | null} [program_imports]
|
|
10346
10819
|
* @returns {Promise<ProvingRequest>}
|
|
10347
10820
|
*/
|
|
10348
|
-
static buildProvingRequest(private_key, program, function_name, inputs, base_fee_credits, priority_fee_credits, fee_record, imports, broadcast, unchecked, edition, use_fee_master) {
|
|
10821
|
+
static buildProvingRequest(private_key, program, function_name, inputs, base_fee_credits, priority_fee_credits, fee_record, imports, broadcast, unchecked, edition, use_fee_master, program_imports) {
|
|
10349
10822
|
_assertClass(private_key, PrivateKey);
|
|
10350
10823
|
const ptr0 = passStringToWasm0(program, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10351
10824
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -10356,7 +10829,12 @@ class ProgramManager {
|
|
|
10356
10829
|
_assertClass(fee_record, RecordPlaintext);
|
|
10357
10830
|
ptr2 = fee_record.__destroy_into_raw();
|
|
10358
10831
|
}
|
|
10359
|
-
|
|
10832
|
+
let ptr3 = 0;
|
|
10833
|
+
if (!isLikeNone(program_imports)) {
|
|
10834
|
+
_assertClass(program_imports, ProgramImports);
|
|
10835
|
+
ptr3 = program_imports.__destroy_into_raw();
|
|
10836
|
+
}
|
|
10837
|
+
const ret = wasm$1.programmanager_buildProvingRequest(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), base_fee_credits, priority_fee_credits, ptr2, isLikeNone(imports) ? 0 : addHeapObject(imports), broadcast, unchecked, isLikeNone(edition) ? 0xFFFFFF : edition, use_fee_master, ptr3);
|
|
10360
10838
|
return takeObject(ret);
|
|
10361
10839
|
}
|
|
10362
10840
|
/**
|
|
@@ -10376,9 +10854,10 @@ class ProgramManager {
|
|
|
10376
10854
|
* @param {number | null} [edition]
|
|
10377
10855
|
* @param {object | null} [imports]
|
|
10378
10856
|
* @param {PrivateKey | null} [private_key]
|
|
10857
|
+
* @param {ProgramImports | null} [program_imports]
|
|
10379
10858
|
* @returns {Promise<ProvingRequest>}
|
|
10380
10859
|
*/
|
|
10381
|
-
static buildProvingRequestFromExecutionRequest(request, program, unchecked, broadcast, edition, imports, private_key) {
|
|
10860
|
+
static buildProvingRequestFromExecutionRequest(request, program, unchecked, broadcast, edition, imports, private_key, program_imports) {
|
|
10382
10861
|
_assertClass(request, ExecutionRequest);
|
|
10383
10862
|
const ptr0 = passStringToWasm0(program, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10384
10863
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -10387,7 +10866,12 @@ class ProgramManager {
|
|
|
10387
10866
|
_assertClass(private_key, PrivateKey);
|
|
10388
10867
|
ptr1 = private_key.__destroy_into_raw();
|
|
10389
10868
|
}
|
|
10390
|
-
|
|
10869
|
+
let ptr2 = 0;
|
|
10870
|
+
if (!isLikeNone(program_imports)) {
|
|
10871
|
+
_assertClass(program_imports, ProgramImports);
|
|
10872
|
+
ptr2 = program_imports.__destroy_into_raw();
|
|
10873
|
+
}
|
|
10874
|
+
const ret = wasm$1.programmanager_buildProvingRequestFromExecutionRequest(request.__wbg_ptr, ptr0, len0, unchecked, broadcast, isLikeNone(edition) ? 0xFFFFFF : edition, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr1, ptr2);
|
|
10391
10875
|
return takeObject(ret);
|
|
10392
10876
|
}
|
|
10393
10877
|
/**
|
|
@@ -10528,9 +11012,10 @@ class ProgramManager {
|
|
|
10528
11012
|
* @param {RecordPlaintext | null} [fee_record]
|
|
10529
11013
|
* @param {string | null} [url]
|
|
10530
11014
|
* @param {object | null} [imports]
|
|
11015
|
+
* @param {ProgramImports | null} [program_imports]
|
|
10531
11016
|
* @returns {Promise<Transaction>}
|
|
10532
11017
|
*/
|
|
10533
|
-
static buildDevnodeDeploymentTransaction(private_key, program, priority_fee_credits, fee_record, url, imports) {
|
|
11018
|
+
static buildDevnodeDeploymentTransaction(private_key, program, priority_fee_credits, fee_record, url, imports, program_imports) {
|
|
10534
11019
|
_assertClass(private_key, PrivateKey);
|
|
10535
11020
|
const ptr0 = passStringToWasm0(program, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10536
11021
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -10541,7 +11026,12 @@ class ProgramManager {
|
|
|
10541
11026
|
}
|
|
10542
11027
|
var ptr2 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10543
11028
|
var len2 = WASM_VECTOR_LEN;
|
|
10544
|
-
|
|
11029
|
+
let ptr3 = 0;
|
|
11030
|
+
if (!isLikeNone(program_imports)) {
|
|
11031
|
+
_assertClass(program_imports, ProgramImports);
|
|
11032
|
+
ptr3 = program_imports.__destroy_into_raw();
|
|
11033
|
+
}
|
|
11034
|
+
const ret = wasm$1.programmanager_buildDevnodeDeploymentTransaction(private_key.__wbg_ptr, ptr0, len0, priority_fee_credits, ptr1, ptr2, len2, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr3);
|
|
10545
11035
|
return takeObject(ret);
|
|
10546
11036
|
}
|
|
10547
11037
|
/**
|
|
@@ -10569,9 +11059,10 @@ class ProgramManager {
|
|
|
10569
11059
|
* @param {RecordPlaintext | null} [fee_record]
|
|
10570
11060
|
* @param {string | null} [url]
|
|
10571
11061
|
* @param {object | null} [imports]
|
|
11062
|
+
* @param {ProgramImports | null} [program_imports]
|
|
10572
11063
|
* @returns {Promise<Transaction>}
|
|
10573
11064
|
*/
|
|
10574
|
-
static buildDevnodeUpgradeTransaction(private_key, program, priority_fee_credits, fee_record, url, imports) {
|
|
11065
|
+
static buildDevnodeUpgradeTransaction(private_key, program, priority_fee_credits, fee_record, url, imports, program_imports) {
|
|
10575
11066
|
_assertClass(private_key, PrivateKey);
|
|
10576
11067
|
const ptr0 = passStringToWasm0(program, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10577
11068
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -10582,7 +11073,12 @@ class ProgramManager {
|
|
|
10582
11073
|
}
|
|
10583
11074
|
var ptr2 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10584
11075
|
var len2 = WASM_VECTOR_LEN;
|
|
10585
|
-
|
|
11076
|
+
let ptr3 = 0;
|
|
11077
|
+
if (!isLikeNone(program_imports)) {
|
|
11078
|
+
_assertClass(program_imports, ProgramImports);
|
|
11079
|
+
ptr3 = program_imports.__destroy_into_raw();
|
|
11080
|
+
}
|
|
11081
|
+
const ret = wasm$1.programmanager_buildDevnodeUpgradeTransaction(private_key.__wbg_ptr, ptr0, len0, priority_fee_credits, ptr1, ptr2, len2, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr3);
|
|
10586
11082
|
return takeObject(ret);
|
|
10587
11083
|
}
|
|
10588
11084
|
/**
|
|
@@ -10626,12 +11122,18 @@ class ProgramManager {
|
|
|
10626
11122
|
* @returns {u64}
|
|
10627
11123
|
* @param {string} program
|
|
10628
11124
|
* @param {object | null} [imports]
|
|
11125
|
+
* @param {ProgramImports | null} [program_imports]
|
|
10629
11126
|
* @returns {Promise<bigint>}
|
|
10630
11127
|
*/
|
|
10631
|
-
static estimateDeploymentFee(program, imports) {
|
|
11128
|
+
static estimateDeploymentFee(program, imports, program_imports) {
|
|
10632
11129
|
const ptr0 = passStringToWasm0(program, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10633
11130
|
const len0 = WASM_VECTOR_LEN;
|
|
10634
|
-
|
|
11131
|
+
let ptr1 = 0;
|
|
11132
|
+
if (!isLikeNone(program_imports)) {
|
|
11133
|
+
_assertClass(program_imports, ProgramImports);
|
|
11134
|
+
ptr1 = program_imports.__destroy_into_raw();
|
|
11135
|
+
}
|
|
11136
|
+
const ret = wasm$1.programmanager_estimateDeploymentFee(ptr0, len0, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr1);
|
|
10635
11137
|
return takeObject(ret);
|
|
10636
11138
|
}
|
|
10637
11139
|
/**
|
|
@@ -10661,9 +11163,10 @@ class ProgramManager {
|
|
|
10661
11163
|
* @param {ProvingKey | null} [fee_proving_key]
|
|
10662
11164
|
* @param {VerifyingKey | null} [fee_verifying_key]
|
|
10663
11165
|
* @param {OfflineQuery | null} [offline_query]
|
|
11166
|
+
* @param {ProgramImports | null} [program_imports]
|
|
10664
11167
|
* @returns {Promise<Transaction>}
|
|
10665
11168
|
*/
|
|
10666
|
-
static buildDeploymentTransaction(private_key, program, priority_fee_credits, fee_record, url, imports, fee_proving_key, fee_verifying_key, offline_query) {
|
|
11169
|
+
static buildDeploymentTransaction(private_key, program, priority_fee_credits, fee_record, url, imports, fee_proving_key, fee_verifying_key, offline_query, program_imports) {
|
|
10667
11170
|
_assertClass(private_key, PrivateKey);
|
|
10668
11171
|
const ptr0 = passStringToWasm0(program, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10669
11172
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -10689,7 +11192,12 @@ class ProgramManager {
|
|
|
10689
11192
|
_assertClass(offline_query, OfflineQuery);
|
|
10690
11193
|
ptr5 = offline_query.__destroy_into_raw();
|
|
10691
11194
|
}
|
|
10692
|
-
|
|
11195
|
+
let ptr6 = 0;
|
|
11196
|
+
if (!isLikeNone(program_imports)) {
|
|
11197
|
+
_assertClass(program_imports, ProgramImports);
|
|
11198
|
+
ptr6 = program_imports.__destroy_into_raw();
|
|
11199
|
+
}
|
|
11200
|
+
const ret = wasm$1.programmanager_buildDeploymentTransaction(private_key.__wbg_ptr, ptr0, len0, priority_fee_credits, ptr1, ptr2, len2, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr3, ptr4, ptr5, ptr6);
|
|
10693
11201
|
return takeObject(ret);
|
|
10694
11202
|
}
|
|
10695
11203
|
/**
|
|
@@ -10717,9 +11225,10 @@ class ProgramManager {
|
|
|
10717
11225
|
* @param {ProvingKey | null} [fee_proving_key]
|
|
10718
11226
|
* @param {VerifyingKey | null} [fee_verifying_key]
|
|
10719
11227
|
* @param {OfflineQuery | null} [offline_query]
|
|
11228
|
+
* @param {ProgramImports | null} [program_imports]
|
|
10720
11229
|
* @returns {Promise<Transaction>}
|
|
10721
11230
|
*/
|
|
10722
|
-
static buildUpgradeTransaction(private_key, program, priority_fee_credits, fee_record, url, imports, fee_proving_key, fee_verifying_key, offline_query) {
|
|
11231
|
+
static buildUpgradeTransaction(private_key, program, priority_fee_credits, fee_record, url, imports, fee_proving_key, fee_verifying_key, offline_query, program_imports) {
|
|
10723
11232
|
_assertClass(private_key, PrivateKey);
|
|
10724
11233
|
const ptr0 = passStringToWasm0(program, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10725
11234
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -10745,7 +11254,12 @@ class ProgramManager {
|
|
|
10745
11254
|
_assertClass(offline_query, OfflineQuery);
|
|
10746
11255
|
ptr5 = offline_query.__destroy_into_raw();
|
|
10747
11256
|
}
|
|
10748
|
-
|
|
11257
|
+
let ptr6 = 0;
|
|
11258
|
+
if (!isLikeNone(program_imports)) {
|
|
11259
|
+
_assertClass(program_imports, ProgramImports);
|
|
11260
|
+
ptr6 = program_imports.__destroy_into_raw();
|
|
11261
|
+
}
|
|
11262
|
+
const ret = wasm$1.programmanager_buildUpgradeTransaction(private_key.__wbg_ptr, ptr0, len0, priority_fee_credits, ptr1, ptr2, len2, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr3, ptr4, ptr5, ptr6);
|
|
10749
11263
|
return takeObject(ret);
|
|
10750
11264
|
}
|
|
10751
11265
|
/**
|
|
@@ -10759,19 +11273,10 @@ class ProgramManager {
|
|
|
10759
11273
|
* @param priority_fee_credits The optional priority fee to be paid for the transaction
|
|
10760
11274
|
* @param fee_record The record to spend the fee from
|
|
10761
11275
|
* @param url The url of the Aleo network node to send the transaction to
|
|
10762
|
-
* If this is set to 'true' the keys synthesized (or passed in as optional parameters via the
|
|
10763
|
-
* `proving_key` and `verifying_key` arguments) will be stored in the ProgramManager's memory
|
|
10764
|
-
* and used for subsequent transactions. If this is set to 'false' the proving and verifying
|
|
10765
|
-
* keys will be deallocated from memory after the transaction is executed.
|
|
10766
11276
|
* @param imports (optional) Provide a list of imports to use for the function execution in the
|
|
10767
11277
|
* form of a javascript object where the keys are a string of the program name and the values
|
|
10768
11278
|
* are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
|
|
10769
|
-
* @param
|
|
10770
|
-
* @param verifying_key (optional) Provide a verifying key to use for the function execution
|
|
10771
|
-
* @param fee_proving_key (optional) Provide a proving key to use for the fee execution
|
|
10772
|
-
* @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
|
|
10773
|
-
* @param offline_query An offline query object to use if building a transaction without an internet connection.
|
|
10774
|
-
* @param edition The edition of the program to execute. Defaults to the latest found on the network, or 1 if the program does not exist on the network.
|
|
11279
|
+
* @param edition The edition of the program to execute. Defaults to 1.
|
|
10775
11280
|
* @returns {Transaction}
|
|
10776
11281
|
* @param {PrivateKey} private_key
|
|
10777
11282
|
* @param {string} program
|
|
@@ -10782,9 +11287,10 @@ class ProgramManager {
|
|
|
10782
11287
|
* @param {string | null} [url]
|
|
10783
11288
|
* @param {object | null} [imports]
|
|
10784
11289
|
* @param {number | null} [edition]
|
|
11290
|
+
* @param {ProgramImports | null} [program_imports]
|
|
10785
11291
|
* @returns {Promise<Transaction>}
|
|
10786
11292
|
*/
|
|
10787
|
-
static buildDevnodeExecutionTransaction(private_key, program, _function, inputs, priority_fee_credits, fee_record, url, imports, edition) {
|
|
11293
|
+
static buildDevnodeExecutionTransaction(private_key, program, _function, inputs, priority_fee_credits, fee_record, url, imports, edition, program_imports) {
|
|
10788
11294
|
_assertClass(private_key, PrivateKey);
|
|
10789
11295
|
const ptr0 = passStringToWasm0(program, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10790
11296
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -10797,7 +11303,12 @@ class ProgramManager {
|
|
|
10797
11303
|
}
|
|
10798
11304
|
var ptr3 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10799
11305
|
var len3 = WASM_VECTOR_LEN;
|
|
10800
|
-
|
|
11306
|
+
let ptr4 = 0;
|
|
11307
|
+
if (!isLikeNone(program_imports)) {
|
|
11308
|
+
_assertClass(program_imports, ProgramImports);
|
|
11309
|
+
ptr4 = program_imports.__destroy_into_raw();
|
|
11310
|
+
}
|
|
11311
|
+
const ret = wasm$1.programmanager_buildDevnodeExecutionTransaction(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), priority_fee_credits, ptr2, ptr3, len3, isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(edition) ? 0xFFFFFF : edition, ptr4);
|
|
10801
11312
|
return takeObject(ret);
|
|
10802
11313
|
}
|
|
10803
11314
|
/**
|
|
@@ -10842,6 +11353,7 @@ class ProgramManager {
|
|
|
10842
11353
|
* @param imports The imports of the program being executed.
|
|
10843
11354
|
* @param url The url to get the inclusion proving information from.
|
|
10844
11355
|
* @param offline_query Optional offline query object if building a Transaction offline.
|
|
11356
|
+
* @param edition The program edition (defaults to 1).
|
|
10845
11357
|
* @param {Authorization} authorization
|
|
10846
11358
|
* @param {Authorization | null | undefined} fee_authorization
|
|
10847
11359
|
* @param {string} program
|
|
@@ -10852,9 +11364,11 @@ class ProgramManager {
|
|
|
10852
11364
|
* @param {object | null} [imports]
|
|
10853
11365
|
* @param {string | null} [url]
|
|
10854
11366
|
* @param {QueryOption | null} [query]
|
|
11367
|
+
* @param {ProgramImports | null} [program_imports]
|
|
11368
|
+
* @param {number | null} [edition]
|
|
10855
11369
|
* @returns {Promise<Transaction>}
|
|
10856
11370
|
*/
|
|
10857
|
-
static executeAuthorization(authorization, fee_authorization, program, proving_key, verifying_key, fee_proving_key, fee_verifying_key, imports, url, query) {
|
|
11371
|
+
static executeAuthorization(authorization, fee_authorization, program, proving_key, verifying_key, fee_proving_key, fee_verifying_key, imports, url, query, program_imports, edition) {
|
|
10858
11372
|
_assertClass(authorization, Authorization);
|
|
10859
11373
|
var ptr0 = authorization.__destroy_into_raw();
|
|
10860
11374
|
let ptr1 = 0;
|
|
@@ -10891,35 +11405,44 @@ class ProgramManager {
|
|
|
10891
11405
|
_assertClass(query, QueryOption);
|
|
10892
11406
|
ptr8 = query.__destroy_into_raw();
|
|
10893
11407
|
}
|
|
10894
|
-
|
|
11408
|
+
let ptr9 = 0;
|
|
11409
|
+
if (!isLikeNone(program_imports)) {
|
|
11410
|
+
_assertClass(program_imports, ProgramImports);
|
|
11411
|
+
ptr9 = program_imports.__destroy_into_raw();
|
|
11412
|
+
}
|
|
11413
|
+
const ret = wasm$1.programmanager_executeAuthorization(ptr0, ptr1, ptr2, len2, ptr3, ptr4, ptr5, ptr6, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr7, len7, ptr8, ptr9, isLikeNone(edition) ? 0xFFFFFF : edition);
|
|
10895
11414
|
return takeObject(ret);
|
|
10896
11415
|
}
|
|
10897
11416
|
/**
|
|
10898
|
-
* Estimate Fee for Aleo function execution.
|
|
10899
|
-
* verifying keys will be stored in the ProgramManager's memory and used for subsequent
|
|
10900
|
-
* program executions.
|
|
11417
|
+
* Estimate Fee for Aleo function execution.
|
|
10901
11418
|
*
|
|
10902
11419
|
* @param program The source code of the program to estimate the execution fee for.
|
|
10903
11420
|
* @param function The name of the function to estimate the execution fee for.
|
|
10904
11421
|
* @param imports (optional) Provide a list of imports to use for the fee estimation in the
|
|
10905
11422
|
* form of a javascript object where the keys are a string of the program name and the values
|
|
10906
11423
|
* are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
|
|
10907
|
-
* @param edition
|
|
11424
|
+
* @param edition The edition of the program. Defaults to 1.
|
|
10908
11425
|
* @returns {u64} Fee in microcredits
|
|
10909
11426
|
* @param {string} program
|
|
10910
11427
|
* @param {string} _function
|
|
10911
11428
|
* @param {object | null} [imports]
|
|
10912
11429
|
* @param {number | null} [edition]
|
|
11430
|
+
* @param {ProgramImports | null} [program_imports]
|
|
10913
11431
|
* @returns {bigint}
|
|
10914
11432
|
*/
|
|
10915
|
-
static estimateExecutionFee(program, _function, imports, edition) {
|
|
11433
|
+
static estimateExecutionFee(program, _function, imports, edition, program_imports) {
|
|
10916
11434
|
try {
|
|
10917
11435
|
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
|
10918
11436
|
const ptr0 = passStringToWasm0(program, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10919
11437
|
const len0 = WASM_VECTOR_LEN;
|
|
10920
11438
|
const ptr1 = passStringToWasm0(_function, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10921
11439
|
const len1 = WASM_VECTOR_LEN;
|
|
10922
|
-
|
|
11440
|
+
let ptr2 = 0;
|
|
11441
|
+
if (!isLikeNone(program_imports)) {
|
|
11442
|
+
_assertClass(program_imports, ProgramImports);
|
|
11443
|
+
ptr2 = program_imports.__destroy_into_raw();
|
|
11444
|
+
}
|
|
11445
|
+
wasm$1.programmanager_estimateExecutionFee(retptr, ptr0, len0, ptr1, len1, isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(edition) ? 0xFFFFFF : edition, ptr2);
|
|
10923
11446
|
var r0 = getDataViewMemory0().getBigInt64(retptr + 8 * 0, true);
|
|
10924
11447
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
10925
11448
|
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
@@ -10948,7 +11471,7 @@ class ProgramManager {
|
|
|
10948
11471
|
* @param {Object | undefined} imports (optional) Provide a list of imports to use for the function execution in the
|
|
10949
11472
|
* form of a javascript object where the keys are a string of the program name and the values
|
|
10950
11473
|
* are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
|
|
10951
|
-
* @param {ProvingKey | undefined} proving_key (optional) Provide a
|
|
11474
|
+
* @param {ProvingKey | undefined} proving_key (optional) Provide a proving key to use for the function execution
|
|
10952
11475
|
* @param {VerifyingKey | undefined} verifying_key (optional) Provide a verifying key to use for the function execution
|
|
10953
11476
|
* @param {PrivateKey} private_key
|
|
10954
11477
|
* @param {string} program
|
|
@@ -10962,9 +11485,10 @@ class ProgramManager {
|
|
|
10962
11485
|
* @param {string | null} [url]
|
|
10963
11486
|
* @param {QueryOption | null} [query]
|
|
10964
11487
|
* @param {number | null} [edition]
|
|
11488
|
+
* @param {ProgramImports | null} [program_imports]
|
|
10965
11489
|
* @returns {Promise<ExecutionResponse>}
|
|
10966
11490
|
*/
|
|
10967
|
-
static executeFunctionOffline(private_key, program, _function, inputs, prove_execution, cache, imports, proving_key, verifying_key, url, query, edition) {
|
|
11491
|
+
static executeFunctionOffline(private_key, program, _function, inputs, prove_execution, cache, imports, proving_key, verifying_key, url, query, edition, program_imports) {
|
|
10968
11492
|
_assertClass(private_key, PrivateKey);
|
|
10969
11493
|
const ptr0 = passStringToWasm0(program, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
10970
11494
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -10987,7 +11511,12 @@ class ProgramManager {
|
|
|
10987
11511
|
_assertClass(query, QueryOption);
|
|
10988
11512
|
ptr5 = query.__destroy_into_raw();
|
|
10989
11513
|
}
|
|
10990
|
-
|
|
11514
|
+
let ptr6 = 0;
|
|
11515
|
+
if (!isLikeNone(program_imports)) {
|
|
11516
|
+
_assertClass(program_imports, ProgramImports);
|
|
11517
|
+
ptr6 = program_imports.__destroy_into_raw();
|
|
11518
|
+
}
|
|
11519
|
+
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, ptr6);
|
|
10991
11520
|
return takeObject(ret);
|
|
10992
11521
|
}
|
|
10993
11522
|
/**
|
|
@@ -11053,15 +11582,21 @@ class ProgramManager {
|
|
|
11053
11582
|
* @param {string} program
|
|
11054
11583
|
* @param {object | null} [imports]
|
|
11055
11584
|
* @param {number | null} [edition]
|
|
11585
|
+
* @param {ProgramImports | null} [program_imports]
|
|
11056
11586
|
* @returns {bigint}
|
|
11057
11587
|
*/
|
|
11058
|
-
static estimateFeeForAuthorization(authorization, program, imports, edition) {
|
|
11588
|
+
static estimateFeeForAuthorization(authorization, program, imports, edition, program_imports) {
|
|
11059
11589
|
try {
|
|
11060
11590
|
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
|
11061
11591
|
_assertClass(authorization, Authorization);
|
|
11062
11592
|
const ptr0 = passStringToWasm0(program, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
11063
11593
|
const len0 = WASM_VECTOR_LEN;
|
|
11064
|
-
|
|
11594
|
+
let ptr1 = 0;
|
|
11595
|
+
if (!isLikeNone(program_imports)) {
|
|
11596
|
+
_assertClass(program_imports, ProgramImports);
|
|
11597
|
+
ptr1 = program_imports.__destroy_into_raw();
|
|
11598
|
+
}
|
|
11599
|
+
wasm$1.programmanager_estimateFeeForAuthorization(retptr, authorization.__wbg_ptr, ptr0, len0, isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(edition) ? 0xFFFFFF : edition, ptr1);
|
|
11065
11600
|
var r0 = getDataViewMemory0().getBigInt64(retptr + 8 * 0, true);
|
|
11066
11601
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
11067
11602
|
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
@@ -11083,19 +11618,15 @@ class ProgramManager {
|
|
|
11083
11618
|
* @param priority_fee_credits The optional priority fee to be paid for the transaction
|
|
11084
11619
|
* @param fee_record The record to spend the fee from
|
|
11085
11620
|
* @param url The url of the Aleo network node to send the transaction to
|
|
11086
|
-
* If this is set to 'true' the keys synthesized (or passed in as optional parameters via the
|
|
11087
|
-
* `proving_key` and `verifying_key` arguments) will be stored in the ProgramManager's memory
|
|
11088
|
-
* and used for subsequent transactions. If this is set to 'false' the proving and verifying
|
|
11089
|
-
* keys will be deallocated from memory after the transaction is executed.
|
|
11090
11621
|
* @param imports (optional) Provide a list of imports to use for the function execution in the
|
|
11091
11622
|
* form of a javascript object where the keys are a string of the program name and the values
|
|
11092
11623
|
* are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
|
|
11093
|
-
* @param proving_key (optional) Provide a
|
|
11624
|
+
* @param proving_key (optional) Provide a proving key to use for the function execution
|
|
11094
11625
|
* @param verifying_key (optional) Provide a verifying key to use for the function execution
|
|
11095
11626
|
* @param fee_proving_key (optional) Provide a proving key to use for the fee execution
|
|
11096
11627
|
* @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
|
|
11097
11628
|
* @param offline_query An offline query object to use if building a transaction without an internet connection.
|
|
11098
|
-
* @param edition The edition of the program to execute. Defaults to
|
|
11629
|
+
* @param edition The edition of the program to execute. Defaults to 1.
|
|
11099
11630
|
* @returns {Transaction}
|
|
11100
11631
|
* @param {PrivateKey} private_key
|
|
11101
11632
|
* @param {string} program
|
|
@@ -11111,9 +11642,10 @@ class ProgramManager {
|
|
|
11111
11642
|
* @param {VerifyingKey | null} [fee_verifying_key]
|
|
11112
11643
|
* @param {QueryOption | null} [query]
|
|
11113
11644
|
* @param {number | null} [edition]
|
|
11645
|
+
* @param {ProgramImports | null} [program_imports]
|
|
11114
11646
|
* @returns {Promise<Transaction>}
|
|
11115
11647
|
*/
|
|
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) {
|
|
11648
|
+
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, program_imports) {
|
|
11117
11649
|
_assertClass(private_key, PrivateKey);
|
|
11118
11650
|
const ptr0 = passStringToWasm0(program, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
11119
11651
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -11151,7 +11683,12 @@ class ProgramManager {
|
|
|
11151
11683
|
_assertClass(query, QueryOption);
|
|
11152
11684
|
ptr8 = query.__destroy_into_raw();
|
|
11153
11685
|
}
|
|
11154
|
-
|
|
11686
|
+
let ptr9 = 0;
|
|
11687
|
+
if (!isLikeNone(program_imports)) {
|
|
11688
|
+
_assertClass(program_imports, ProgramImports);
|
|
11689
|
+
ptr9 = program_imports.__destroy_into_raw();
|
|
11690
|
+
}
|
|
11691
|
+
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, ptr9);
|
|
11155
11692
|
return takeObject(ret);
|
|
11156
11693
|
}
|
|
11157
11694
|
/**
|
|
@@ -11276,9 +11813,10 @@ class ProgramManager {
|
|
|
11276
11813
|
* @param {number | null} [edition]
|
|
11277
11814
|
* @param {object | null} [imports]
|
|
11278
11815
|
* @param {PrivateKey | null} [private_key]
|
|
11816
|
+
* @param {ProgramImports | null} [program_imports]
|
|
11279
11817
|
* @returns {Promise<Authorization>}
|
|
11280
11818
|
*/
|
|
11281
|
-
static buildAuthorizationFromExecutionRequest(request, program, unchecked, edition, imports, private_key) {
|
|
11819
|
+
static buildAuthorizationFromExecutionRequest(request, program, unchecked, edition, imports, private_key, program_imports) {
|
|
11282
11820
|
_assertClass(request, ExecutionRequest);
|
|
11283
11821
|
const ptr0 = passStringToWasm0(program, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
11284
11822
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -11287,7 +11825,12 @@ class ProgramManager {
|
|
|
11287
11825
|
_assertClass(private_key, PrivateKey);
|
|
11288
11826
|
ptr1 = private_key.__destroy_into_raw();
|
|
11289
11827
|
}
|
|
11290
|
-
|
|
11828
|
+
let ptr2 = 0;
|
|
11829
|
+
if (!isLikeNone(program_imports)) {
|
|
11830
|
+
_assertClass(program_imports, ProgramImports);
|
|
11831
|
+
ptr2 = program_imports.__destroy_into_raw();
|
|
11832
|
+
}
|
|
11833
|
+
const ret = wasm$1.programmanager_buildAuthorizationFromExecutionRequest(request.__wbg_ptr, ptr0, len0, unchecked, isLikeNone(edition) ? 0xFFFFFF : edition, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr1, ptr2);
|
|
11291
11834
|
return takeObject(ret);
|
|
11292
11835
|
}
|
|
11293
11836
|
/**
|
|
@@ -11305,15 +11848,21 @@ class ProgramManager {
|
|
|
11305
11848
|
* @param {Array<any>} inputs
|
|
11306
11849
|
* @param {object | null} [imports]
|
|
11307
11850
|
* @param {number | null} [edition]
|
|
11851
|
+
* @param {ProgramImports | null} [program_imports]
|
|
11308
11852
|
* @returns {Promise<Authorization>}
|
|
11309
11853
|
*/
|
|
11310
|
-
static buildAuthorizationUnchecked(private_key, program, function_name, inputs, imports, edition) {
|
|
11854
|
+
static buildAuthorizationUnchecked(private_key, program, function_name, inputs, imports, edition, program_imports) {
|
|
11311
11855
|
_assertClass(private_key, PrivateKey);
|
|
11312
11856
|
const ptr0 = passStringToWasm0(program, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
11313
11857
|
const len0 = WASM_VECTOR_LEN;
|
|
11314
11858
|
const ptr1 = passStringToWasm0(function_name, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
11315
11859
|
const len1 = WASM_VECTOR_LEN;
|
|
11316
|
-
|
|
11860
|
+
let ptr2 = 0;
|
|
11861
|
+
if (!isLikeNone(program_imports)) {
|
|
11862
|
+
_assertClass(program_imports, ProgramImports);
|
|
11863
|
+
ptr2 = program_imports.__destroy_into_raw();
|
|
11864
|
+
}
|
|
11865
|
+
const ret = wasm$1.programmanager_buildAuthorizationUnchecked(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(edition) ? 0xFFFFFF : edition, ptr2);
|
|
11317
11866
|
return takeObject(ret);
|
|
11318
11867
|
}
|
|
11319
11868
|
/**
|
|
@@ -11330,15 +11879,21 @@ class ProgramManager {
|
|
|
11330
11879
|
* @param {Array<any>} inputs
|
|
11331
11880
|
* @param {object | null} [imports]
|
|
11332
11881
|
* @param {number | null} [edition]
|
|
11882
|
+
* @param {ProgramImports | null} [program_imports]
|
|
11333
11883
|
* @returns {Promise<Authorization>}
|
|
11334
11884
|
*/
|
|
11335
|
-
static authorize(private_key, program, function_name, inputs, imports, edition) {
|
|
11885
|
+
static authorize(private_key, program, function_name, inputs, imports, edition, program_imports) {
|
|
11336
11886
|
_assertClass(private_key, PrivateKey);
|
|
11337
11887
|
const ptr0 = passStringToWasm0(program, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
11338
11888
|
const len0 = WASM_VECTOR_LEN;
|
|
11339
11889
|
const ptr1 = passStringToWasm0(function_name, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
|
|
11340
11890
|
const len1 = WASM_VECTOR_LEN;
|
|
11341
|
-
|
|
11891
|
+
let ptr2 = 0;
|
|
11892
|
+
if (!isLikeNone(program_imports)) {
|
|
11893
|
+
_assertClass(program_imports, ProgramImports);
|
|
11894
|
+
ptr2 = program_imports.__destroy_into_raw();
|
|
11895
|
+
}
|
|
11896
|
+
const ret = wasm$1.programmanager_authorize(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(edition) ? 0xFFFFFF : edition, ptr2);
|
|
11342
11897
|
return takeObject(ret);
|
|
11343
11898
|
}
|
|
11344
11899
|
}
|
|
@@ -18300,6 +18855,10 @@ function __wbg_get_imports(memory) {
|
|
|
18300
18855
|
const ret = typeof(getObject(arg0)) === 'function';
|
|
18301
18856
|
return ret;
|
|
18302
18857
|
};
|
|
18858
|
+
imports.wbg.__wbg___wbindgen_is_null_5e69f72e906cc57c = function(arg0) {
|
|
18859
|
+
const ret = getObject(arg0) === null;
|
|
18860
|
+
return ret;
|
|
18861
|
+
};
|
|
18303
18862
|
imports.wbg.__wbg___wbindgen_is_object_c818261d21f283a4 = function(arg0) {
|
|
18304
18863
|
const val = getObject(arg0);
|
|
18305
18864
|
const ret = typeof(val) === 'object' && val !== null;
|
|
@@ -18464,6 +19023,16 @@ function __wbg_get_imports(memory) {
|
|
|
18464
19023
|
const ret = getObject(arg0).headers;
|
|
18465
19024
|
return addHeapObject(ret);
|
|
18466
19025
|
};
|
|
19026
|
+
imports.wbg.__wbg_instanceof_Object_10bb762262230c68 = function(arg0) {
|
|
19027
|
+
let result;
|
|
19028
|
+
try {
|
|
19029
|
+
result = getObject(arg0) instanceof Object;
|
|
19030
|
+
} catch (_) {
|
|
19031
|
+
result = false;
|
|
19032
|
+
}
|
|
19033
|
+
const ret = result;
|
|
19034
|
+
return ret;
|
|
19035
|
+
};
|
|
18467
19036
|
imports.wbg.__wbg_instanceof_Promise_001fdd42afa1b7ef = function(arg0) {
|
|
18468
19037
|
let result;
|
|
18469
19038
|
try {
|
|
@@ -18518,7 +19087,7 @@ function __wbg_get_imports(memory) {
|
|
|
18518
19087
|
const ret = getObject(arg0).length;
|
|
18519
19088
|
return ret;
|
|
18520
19089
|
};
|
|
18521
|
-
imports.wbg.
|
|
19090
|
+
imports.wbg.__wbg_log_2c81ec274d38c9bb = function(arg0, arg1) {
|
|
18522
19091
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
18523
19092
|
};
|
|
18524
19093
|
imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
|
|
@@ -18540,7 +19109,7 @@ function __wbg_get_imports(memory) {
|
|
|
18540
19109
|
const a = state0.a;
|
|
18541
19110
|
state0.a = 0;
|
|
18542
19111
|
try {
|
|
18543
|
-
return
|
|
19112
|
+
return __wasm_bindgen_func_elem_7529(a, state0.b, arg0, arg1);
|
|
18544
19113
|
} finally {
|
|
18545
19114
|
state0.a = a;
|
|
18546
19115
|
}
|
|
@@ -18727,7 +19296,7 @@ function __wbg_get_imports(memory) {
|
|
|
18727
19296
|
const ret = Signature.__wrap(arg0);
|
|
18728
19297
|
return addHeapObject(ret);
|
|
18729
19298
|
};
|
|
18730
|
-
imports.wbg.
|
|
19299
|
+
imports.wbg.__wbg_spawnWorker_c5c00ae0c7b9fe56 = function(arg0, arg1, arg2, arg3) {
|
|
18731
19300
|
const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
|
|
18732
19301
|
return addHeapObject(ret);
|
|
18733
19302
|
};
|
|
@@ -18829,7 +19398,7 @@ function __wbg_get_imports(memory) {
|
|
|
18829
19398
|
};
|
|
18830
19399
|
imports.wbg.__wbindgen_cast_3ebebf8ee554379e = function(arg0, arg1) {
|
|
18831
19400
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 354, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 355, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
18832
|
-
const ret = makeMutClosure(arg0, arg1, wasm$1.
|
|
19401
|
+
const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7255, __wasm_bindgen_func_elem_8618);
|
|
18833
19402
|
return addHeapObject(ret);
|
|
18834
19403
|
};
|
|
18835
19404
|
imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
@@ -18839,12 +19408,12 @@ function __wbg_get_imports(memory) {
|
|
|
18839
19408
|
};
|
|
18840
19409
|
imports.wbg.__wbindgen_cast_5e9bcb6388942484 = function(arg0, arg1) {
|
|
18841
19410
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 354, function: Function { arguments: [], shim_idx: 462, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
18842
|
-
const ret = makeMutClosure(arg0, arg1, wasm$1.
|
|
19411
|
+
const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7255, __wasm_bindgen_func_elem_7256);
|
|
18843
19412
|
return addHeapObject(ret);
|
|
18844
19413
|
};
|
|
18845
19414
|
imports.wbg.__wbindgen_cast_74f3a90a349943d1 = function(arg0, arg1) {
|
|
18846
19415
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 354, function: Function { arguments: [Externref], shim_idx: 355, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
18847
|
-
const ret = makeMutClosure(arg0, arg1, wasm$1.
|
|
19416
|
+
const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7255, __wasm_bindgen_func_elem_8618);
|
|
18848
19417
|
return addHeapObject(ret);
|
|
18849
19418
|
};
|
|
18850
19419
|
imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
@@ -18988,6 +19557,7 @@ var exports$1$1 = /*#__PURE__*/Object.freeze({
|
|
|
18988
19557
|
PrivateKey: PrivateKey,
|
|
18989
19558
|
PrivateKeyCiphertext: PrivateKeyCiphertext,
|
|
18990
19559
|
Program: Program,
|
|
19560
|
+
ProgramImports: ProgramImports,
|
|
18991
19561
|
ProgramManager: ProgramManager,
|
|
18992
19562
|
Proof: Proof,
|
|
18993
19563
|
ProvingKey: ProvingKey,
|