@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/testnet/index.js
CHANGED
|
@@ -304,35 +304,25 @@ function addBorrowedObject(obj) {
|
|
|
304
304
|
return stack_pointer;
|
|
305
305
|
}
|
|
306
306
|
/**
|
|
307
|
-
* Verify
|
|
308
|
-
* verifying keys of imported functions supplied from outside to correctly verify. Also, this does
|
|
309
|
-
* not verify that the state root of the execution is included in the Aleo Network ledger.
|
|
307
|
+
* Verify a batch SNARK proof against multiple verifying keys and their corresponding public inputs.
|
|
310
308
|
*
|
|
311
|
-
*
|
|
312
|
-
*
|
|
313
|
-
*
|
|
314
|
-
* @param {
|
|
315
|
-
* @param {
|
|
316
|
-
* @param {
|
|
317
|
-
* @returns {boolean} True if the
|
|
318
|
-
* @param {
|
|
319
|
-
* @param {
|
|
320
|
-
* @param {
|
|
321
|
-
* @param {string} function_id
|
|
322
|
-
* @param {object | null | undefined} imports
|
|
323
|
-
* @param {object | null | undefined} imported_verifying_keys
|
|
324
|
-
* @param {number} block_height
|
|
309
|
+
* This function verifies a batch proof produced by Aleo programs that may not be deployed on chain.
|
|
310
|
+
* Each verifying key is paired with one or more sets of public inputs (instances).
|
|
311
|
+
*
|
|
312
|
+
* @param {Array<string>} verifying_keys Array of verifying key strings, one per circuit
|
|
313
|
+
* @param {Array<Array<Array<string>>>} inputs 3D array of field element strings [circuit_idx][instance_idx][field_idx]
|
|
314
|
+
* @param {Proof} proof The batch proof to verify
|
|
315
|
+
* @returns {boolean} True if the batch proof is valid, false otherwise
|
|
316
|
+
* @param {Array<any>} verifying_keys
|
|
317
|
+
* @param {Array<any>} inputs
|
|
318
|
+
* @param {Proof} proof
|
|
325
319
|
* @returns {boolean}
|
|
326
320
|
*/
|
|
327
|
-
function
|
|
321
|
+
function snarkVerifyBatch(verifying_keys, inputs, proof) {
|
|
328
322
|
try {
|
|
329
323
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
330
|
-
_assertClass(
|
|
331
|
-
|
|
332
|
-
_assertClass(program, Program);
|
|
333
|
-
const ptr0 = passStringToWasm0(function_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
334
|
-
const len0 = WASM_VECTOR_LEN;
|
|
335
|
-
wasm.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);
|
|
324
|
+
_assertClass(proof, Proof);
|
|
325
|
+
wasm.snarkVerifyBatch(retptr, addHeapObject(verifying_keys), addHeapObject(inputs), proof.__wbg_ptr);
|
|
336
326
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
337
327
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
338
328
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -379,25 +369,41 @@ function snarkVerify(verifying_key, inputs, proof) {
|
|
|
379
369
|
}
|
|
380
370
|
|
|
381
371
|
/**
|
|
382
|
-
* Verify
|
|
383
|
-
*
|
|
384
|
-
*
|
|
385
|
-
* Each verifying key is paired with one or more sets of public inputs (instances).
|
|
372
|
+
* Verify an execution. Executions with multiple transitions must have the program source code and
|
|
373
|
+
* verifying keys of imported functions supplied from outside to correctly verify. Also, this does
|
|
374
|
+
* not verify that the state root of the execution is included in the Aleo Network ledger.
|
|
386
375
|
*
|
|
387
|
-
* @param {
|
|
388
|
-
* @param {
|
|
389
|
-
* @param {
|
|
390
|
-
* @
|
|
391
|
-
* @param {
|
|
392
|
-
* @param {
|
|
393
|
-
* @
|
|
376
|
+
* @param {Execution} execution The function execution to verify
|
|
377
|
+
* @param {VerifyingKey} verifying_key The verifying key for the function
|
|
378
|
+
* @param {Program} program The program that the function execution belongs to
|
|
379
|
+
* @param {String} function_id The name of the function that was executed
|
|
380
|
+
* @param {Object} imports The imports for the program in the form of { "program_id.aleo":"source code", ... }
|
|
381
|
+
* @param {Object} import_verifying_keys The verifying keys for the imports in the form of { "program_id.aleo": [["function, "verifying_key"], ...], ...}
|
|
382
|
+
* @returns {boolean} True if the execution is valid, false otherwise
|
|
383
|
+
* @param {Execution} execution
|
|
384
|
+
* @param {VerifyingKey} verifying_key
|
|
385
|
+
* @param {Program} program
|
|
386
|
+
* @param {string} function_id
|
|
387
|
+
* @param {object | null | undefined} imports
|
|
388
|
+
* @param {object | null | undefined} imported_verifying_keys
|
|
389
|
+
* @param {number} block_height
|
|
390
|
+
* @param {ProgramImports | null} [program_imports]
|
|
394
391
|
* @returns {boolean}
|
|
395
392
|
*/
|
|
396
|
-
function
|
|
393
|
+
function verifyFunctionExecution(execution, verifying_key, program, function_id, imports, imported_verifying_keys, block_height, program_imports) {
|
|
397
394
|
try {
|
|
398
395
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
399
|
-
_assertClass(
|
|
400
|
-
|
|
396
|
+
_assertClass(execution, Execution);
|
|
397
|
+
_assertClass(verifying_key, VerifyingKey);
|
|
398
|
+
_assertClass(program, Program);
|
|
399
|
+
const ptr0 = passStringToWasm0(function_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
400
|
+
const len0 = WASM_VECTOR_LEN;
|
|
401
|
+
let ptr1 = 0;
|
|
402
|
+
if (!isLikeNone(program_imports)) {
|
|
403
|
+
_assertClass(program_imports, ProgramImports);
|
|
404
|
+
ptr1 = program_imports.__destroy_into_raw();
|
|
405
|
+
}
|
|
406
|
+
wasm.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);
|
|
401
407
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
402
408
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
403
409
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -471,16 +477,16 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
471
477
|
}
|
|
472
478
|
return result;
|
|
473
479
|
}
|
|
474
|
-
function
|
|
475
|
-
wasm.
|
|
480
|
+
function __wasm_bindgen_func_elem_8618(arg0, arg1, arg2) {
|
|
481
|
+
wasm.__wasm_bindgen_func_elem_8618(arg0, arg1, addHeapObject(arg2));
|
|
476
482
|
}
|
|
477
483
|
|
|
478
|
-
function
|
|
479
|
-
wasm.
|
|
484
|
+
function __wasm_bindgen_func_elem_7257(arg0, arg1) {
|
|
485
|
+
wasm.__wasm_bindgen_func_elem_7257(arg0, arg1);
|
|
480
486
|
}
|
|
481
487
|
|
|
482
|
-
function
|
|
483
|
-
wasm.
|
|
488
|
+
function __wasm_bindgen_func_elem_7529(arg0, arg1, arg2, arg3) {
|
|
489
|
+
wasm.__wasm_bindgen_func_elem_7529(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
484
490
|
}
|
|
485
491
|
|
|
486
492
|
const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
@@ -9997,6 +10003,36 @@ class Program {
|
|
|
9997
10003
|
const ret = wasm.program_getFunctions(this.__wbg_ptr);
|
|
9998
10004
|
return takeObject(ret);
|
|
9999
10005
|
}
|
|
10006
|
+
/**
|
|
10007
|
+
* Get the external call graph reachable from a specific entry function.
|
|
10008
|
+
*
|
|
10009
|
+
* Starting from `entry_function`, traces all reachable functions and closures
|
|
10010
|
+
* within this program (via local calls) and collects external calls
|
|
10011
|
+
* (`call program.aleo/function`). Returns a JS object mapping program names
|
|
10012
|
+
* to arrays of called function names.
|
|
10013
|
+
*
|
|
10014
|
+
* @param {string} entry_function The name of the entry function to trace from
|
|
10015
|
+
* @returns {object} An object like `{ "program.aleo": ["fn1", "fn2"] }`
|
|
10016
|
+
* @param {string} entry_function
|
|
10017
|
+
* @returns {any}
|
|
10018
|
+
*/
|
|
10019
|
+
getCallGraph(entry_function) {
|
|
10020
|
+
try {
|
|
10021
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
10022
|
+
const ptr0 = passStringToWasm0(entry_function, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10023
|
+
const len0 = WASM_VECTOR_LEN;
|
|
10024
|
+
wasm.program_getCallGraph(retptr, this.__wbg_ptr, ptr0, len0);
|
|
10025
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
10026
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
10027
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
10028
|
+
if (r2) {
|
|
10029
|
+
throw takeObject(r1);
|
|
10030
|
+
}
|
|
10031
|
+
return takeObject(r0);
|
|
10032
|
+
} finally {
|
|
10033
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
10034
|
+
}
|
|
10035
|
+
}
|
|
10000
10036
|
/**
|
|
10001
10037
|
* Get a javascript object representation of a program record and its types
|
|
10002
10038
|
*
|
|
@@ -10260,6 +10296,436 @@ class Program {
|
|
|
10260
10296
|
}
|
|
10261
10297
|
if (Symbol.dispose) Program.prototype[Symbol.dispose] = Program.prototype.free;
|
|
10262
10298
|
|
|
10299
|
+
const ProgramImportsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
10300
|
+
? { register: () => {}, unregister: () => {} }
|
|
10301
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_programimports_free(ptr >>> 0, 1));
|
|
10302
|
+
/**
|
|
10303
|
+
* Backed by `Rc<RefCell<>>` for interior mutability — cloning produces a cheap
|
|
10304
|
+
* reference-counted copy that shares the same underlying data. This allows
|
|
10305
|
+
* execution functions to clone the builder internally while the caller's
|
|
10306
|
+
* original reference automatically sees any mutations (e.g. synthesized keys).
|
|
10307
|
+
*/
|
|
10308
|
+
class ProgramImports {
|
|
10309
|
+
|
|
10310
|
+
static __wrap(ptr) {
|
|
10311
|
+
ptr = ptr >>> 0;
|
|
10312
|
+
const obj = Object.create(ProgramImports.prototype);
|
|
10313
|
+
obj.__wbg_ptr = ptr;
|
|
10314
|
+
ProgramImportsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
10315
|
+
return obj;
|
|
10316
|
+
}
|
|
10317
|
+
|
|
10318
|
+
__destroy_into_raw() {
|
|
10319
|
+
const ptr = this.__wbg_ptr;
|
|
10320
|
+
this.__wbg_ptr = 0;
|
|
10321
|
+
ProgramImportsFinalization.unregister(this);
|
|
10322
|
+
return ptr;
|
|
10323
|
+
}
|
|
10324
|
+
|
|
10325
|
+
free() {
|
|
10326
|
+
const ptr = this.__destroy_into_raw();
|
|
10327
|
+
wasm.__wbg_programimports_free(ptr, 0);
|
|
10328
|
+
}
|
|
10329
|
+
/**
|
|
10330
|
+
* Add a program's source code to the imports.
|
|
10331
|
+
*
|
|
10332
|
+
* The source is parsed, validated, and added to the internal Process.
|
|
10333
|
+
* Static imports of the program are resolved depth-first from programs
|
|
10334
|
+
* already present in this builder.
|
|
10335
|
+
*
|
|
10336
|
+
* @param {string} name The program name (e.g., "my_program.aleo").
|
|
10337
|
+
* @param {string} source The program source code.
|
|
10338
|
+
* @param {number | undefined} edition The program edition (defaults to 1).
|
|
10339
|
+
* @param {string} name
|
|
10340
|
+
* @param {string} source
|
|
10341
|
+
* @param {number | null} [edition]
|
|
10342
|
+
*/
|
|
10343
|
+
addProgram(name, source, edition) {
|
|
10344
|
+
try {
|
|
10345
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
10346
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10347
|
+
const len0 = WASM_VECTOR_LEN;
|
|
10348
|
+
const ptr1 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10349
|
+
const len1 = WASM_VECTOR_LEN;
|
|
10350
|
+
wasm.programimports_addProgram(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(edition) ? 0xFFFFFF : edition);
|
|
10351
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
10352
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
10353
|
+
if (r1) {
|
|
10354
|
+
throw takeObject(r0);
|
|
10355
|
+
}
|
|
10356
|
+
} finally {
|
|
10357
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
10358
|
+
}
|
|
10359
|
+
}
|
|
10360
|
+
/**
|
|
10361
|
+
* Create a ProgramImports from a plain JavaScript object.
|
|
10362
|
+
*
|
|
10363
|
+
* Accepts three formats:
|
|
10364
|
+
* ```js
|
|
10365
|
+
* // 1. Plain string — source code only.
|
|
10366
|
+
* { "my_program.aleo": "program source..." }
|
|
10367
|
+
*
|
|
10368
|
+
* // 2. Structured — program source with optional edition.
|
|
10369
|
+
* { "my_program.aleo": { program: "program source..." } }
|
|
10370
|
+
*
|
|
10371
|
+
* // 3. Structured with keys — program source plus proving/verifying keys per function.
|
|
10372
|
+
* {
|
|
10373
|
+
* "my_program.aleo": {
|
|
10374
|
+
* program: "program source...",
|
|
10375
|
+
* keys: {
|
|
10376
|
+
* "my_function": {
|
|
10377
|
+
* provingKey: Uint8Array,
|
|
10378
|
+
* verifyingKey: Uint8Array
|
|
10379
|
+
* }
|
|
10380
|
+
* }
|
|
10381
|
+
* }
|
|
10382
|
+
* }
|
|
10383
|
+
* ```
|
|
10384
|
+
*
|
|
10385
|
+
* Programs created via this method default to edition 1.
|
|
10386
|
+
*
|
|
10387
|
+
* @param {Object} object A plain JavaScript object mapping program names to source code
|
|
10388
|
+
* and optional keys.
|
|
10389
|
+
* @returns {ProgramImports}
|
|
10390
|
+
* @param {object} object
|
|
10391
|
+
* @returns {ProgramImports}
|
|
10392
|
+
*/
|
|
10393
|
+
static fromObject(object) {
|
|
10394
|
+
try {
|
|
10395
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
10396
|
+
wasm.programimports_fromObject(retptr, addHeapObject(object));
|
|
10397
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
10398
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
10399
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
10400
|
+
if (r2) {
|
|
10401
|
+
throw takeObject(r1);
|
|
10402
|
+
}
|
|
10403
|
+
return ProgramImports.__wrap(r0);
|
|
10404
|
+
} finally {
|
|
10405
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
10406
|
+
}
|
|
10407
|
+
}
|
|
10408
|
+
/**
|
|
10409
|
+
* Return the source code of a program by name, without serializing keys.
|
|
10410
|
+
*
|
|
10411
|
+
* @param {string} name The program name (e.g., "my_program.aleo").
|
|
10412
|
+
* @returns {string | undefined}
|
|
10413
|
+
* @param {string} name
|
|
10414
|
+
* @returns {string | undefined}
|
|
10415
|
+
*/
|
|
10416
|
+
getProgram(name) {
|
|
10417
|
+
try {
|
|
10418
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
10419
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10420
|
+
const len0 = WASM_VECTOR_LEN;
|
|
10421
|
+
wasm.programimports_getProgram(retptr, this.__wbg_ptr, ptr0, len0);
|
|
10422
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
10423
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
10424
|
+
let v2;
|
|
10425
|
+
if (r0 !== 0) {
|
|
10426
|
+
v2 = getStringFromWasm0(r0, r1).slice();
|
|
10427
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
10428
|
+
}
|
|
10429
|
+
return v2;
|
|
10430
|
+
} finally {
|
|
10431
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
10432
|
+
}
|
|
10433
|
+
}
|
|
10434
|
+
/**
|
|
10435
|
+
* Return the names of all programs in this builder as a JS `Array<string>`.
|
|
10436
|
+
*
|
|
10437
|
+
* This is a lightweight alternative to `toObject()` when you only need to
|
|
10438
|
+
* enumerate program names without serializing keys.
|
|
10439
|
+
*
|
|
10440
|
+
* @returns {Array<string>}
|
|
10441
|
+
* @returns {Array<any>}
|
|
10442
|
+
*/
|
|
10443
|
+
programNames() {
|
|
10444
|
+
const ret = wasm.programimports_programNames(this.__wbg_ptr);
|
|
10445
|
+
return takeObject(ret);
|
|
10446
|
+
}
|
|
10447
|
+
/**
|
|
10448
|
+
* Add a proving key for a function or record within an imported program.
|
|
10449
|
+
*
|
|
10450
|
+
* The key is transferred directly from the WASM `ProvingKey` type with no
|
|
10451
|
+
* serialization overhead.
|
|
10452
|
+
*
|
|
10453
|
+
* @param {string} program_name The program name (e.g., "my_program.aleo").
|
|
10454
|
+
* @param {string} identifier The function name or record name the key belongs to.
|
|
10455
|
+
* @param {ProvingKey} key The proving key.
|
|
10456
|
+
* @param {string} program_name
|
|
10457
|
+
* @param {string} identifier
|
|
10458
|
+
* @param {ProvingKey} key
|
|
10459
|
+
*/
|
|
10460
|
+
addProvingKey(program_name, identifier, key) {
|
|
10461
|
+
try {
|
|
10462
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
10463
|
+
const ptr0 = passStringToWasm0(program_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10464
|
+
const len0 = WASM_VECTOR_LEN;
|
|
10465
|
+
const ptr1 = passStringToWasm0(identifier, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10466
|
+
const len1 = WASM_VECTOR_LEN;
|
|
10467
|
+
_assertClass(key, ProvingKey);
|
|
10468
|
+
var ptr2 = key.__destroy_into_raw();
|
|
10469
|
+
wasm.programimports_addProvingKey(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2);
|
|
10470
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
10471
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
10472
|
+
if (r1) {
|
|
10473
|
+
throw takeObject(r0);
|
|
10474
|
+
}
|
|
10475
|
+
} finally {
|
|
10476
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
10477
|
+
}
|
|
10478
|
+
}
|
|
10479
|
+
/**
|
|
10480
|
+
* Get a proving key for a specific program and identifier (function or record name).
|
|
10481
|
+
* Returns a clone of the key from the internal Process. Non-destructive — the key
|
|
10482
|
+
* remains available for future calls.
|
|
10483
|
+
*
|
|
10484
|
+
* @param {string} program_name The program name (e.g., "my_program.aleo").
|
|
10485
|
+
* @param {string} identifier The function or record name.
|
|
10486
|
+
* @returns {ProvingKey | undefined}
|
|
10487
|
+
* @param {string} program_name
|
|
10488
|
+
* @param {string} identifier
|
|
10489
|
+
* @returns {ProvingKey | undefined}
|
|
10490
|
+
*/
|
|
10491
|
+
getProvingKey(program_name, identifier) {
|
|
10492
|
+
const ptr0 = passStringToWasm0(program_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10493
|
+
const len0 = WASM_VECTOR_LEN;
|
|
10494
|
+
const ptr1 = passStringToWasm0(identifier, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10495
|
+
const len1 = WASM_VECTOR_LEN;
|
|
10496
|
+
const ret = wasm.programimports_getProvingKey(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
10497
|
+
return ret === 0 ? undefined : ProvingKey.__wrap(ret);
|
|
10498
|
+
}
|
|
10499
|
+
/**
|
|
10500
|
+
* Add a verifying key for a function or record within an imported program.
|
|
10501
|
+
*
|
|
10502
|
+
* The key is transferred directly from the WASM `VerifyingKey` type with no
|
|
10503
|
+
* serialization overhead.
|
|
10504
|
+
*
|
|
10505
|
+
* @param {string} program_name The program name (e.g., "my_program.aleo").
|
|
10506
|
+
* @param {string} identifier The function name or record name the key belongs to.
|
|
10507
|
+
* @param {VerifyingKey} key The verifying key.
|
|
10508
|
+
* @param {string} program_name
|
|
10509
|
+
* @param {string} identifier
|
|
10510
|
+
* @param {VerifyingKey} key
|
|
10511
|
+
*/
|
|
10512
|
+
addVerifyingKey(program_name, identifier, key) {
|
|
10513
|
+
try {
|
|
10514
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
10515
|
+
const ptr0 = passStringToWasm0(program_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10516
|
+
const len0 = WASM_VECTOR_LEN;
|
|
10517
|
+
const ptr1 = passStringToWasm0(identifier, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10518
|
+
const len1 = WASM_VECTOR_LEN;
|
|
10519
|
+
_assertClass(key, VerifyingKey);
|
|
10520
|
+
var ptr2 = key.__destroy_into_raw();
|
|
10521
|
+
wasm.programimports_addVerifyingKey(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2);
|
|
10522
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
10523
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
10524
|
+
if (r1) {
|
|
10525
|
+
throw takeObject(r0);
|
|
10526
|
+
}
|
|
10527
|
+
} finally {
|
|
10528
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
10529
|
+
}
|
|
10530
|
+
}
|
|
10531
|
+
/**
|
|
10532
|
+
* Get a verifying key for a specific program and identifier (function or record name).
|
|
10533
|
+
* Returns a clone of the key from the internal Process. Non-destructive — the key
|
|
10534
|
+
* remains available for future calls.
|
|
10535
|
+
*
|
|
10536
|
+
* @param {string} program_name The program name (e.g., "my_program.aleo").
|
|
10537
|
+
* @param {string} identifier The function or record name.
|
|
10538
|
+
* @returns {VerifyingKey | undefined}
|
|
10539
|
+
* @param {string} program_name
|
|
10540
|
+
* @param {string} identifier
|
|
10541
|
+
* @returns {VerifyingKey | undefined}
|
|
10542
|
+
*/
|
|
10543
|
+
getVerifyingKey(program_name, identifier) {
|
|
10544
|
+
const ptr0 = passStringToWasm0(program_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10545
|
+
const len0 = WASM_VECTOR_LEN;
|
|
10546
|
+
const ptr1 = passStringToWasm0(identifier, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10547
|
+
const len1 = WASM_VECTOR_LEN;
|
|
10548
|
+
const ret = wasm.programimports_getVerifyingKey(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
10549
|
+
return ret === 0 ? undefined : VerifyingKey.__wrap(ret);
|
|
10550
|
+
}
|
|
10551
|
+
/**
|
|
10552
|
+
* Add a proving key from its byte representation.
|
|
10553
|
+
*
|
|
10554
|
+
* Deserializes the bytes into a native proving key and stores it. The program
|
|
10555
|
+
* must already have been added via `addProgram`.
|
|
10556
|
+
*
|
|
10557
|
+
* @param {string} program_name The program name (e.g., "my_program.aleo").
|
|
10558
|
+
* @param {string} identifier The function name or record name the key belongs to.
|
|
10559
|
+
* @param {Uint8Array} bytes The proving key bytes.
|
|
10560
|
+
* @param {string} program_name
|
|
10561
|
+
* @param {string} identifier
|
|
10562
|
+
* @param {Uint8Array} bytes
|
|
10563
|
+
*/
|
|
10564
|
+
addProvingKeyBytes(program_name, identifier, bytes) {
|
|
10565
|
+
try {
|
|
10566
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
10567
|
+
const ptr0 = passStringToWasm0(program_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10568
|
+
const len0 = WASM_VECTOR_LEN;
|
|
10569
|
+
const ptr1 = passStringToWasm0(identifier, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10570
|
+
const len1 = WASM_VECTOR_LEN;
|
|
10571
|
+
const ptr2 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
|
|
10572
|
+
const len2 = WASM_VECTOR_LEN;
|
|
10573
|
+
wasm.programimports_addProvingKeyBytes(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
10574
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
10575
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
10576
|
+
if (r1) {
|
|
10577
|
+
throw takeObject(r0);
|
|
10578
|
+
}
|
|
10579
|
+
} finally {
|
|
10580
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
10581
|
+
}
|
|
10582
|
+
}
|
|
10583
|
+
/**
|
|
10584
|
+
* Add a verifying key from its byte representation.
|
|
10585
|
+
*
|
|
10586
|
+
* Deserializes the bytes into a native verifying key and stores it. The program
|
|
10587
|
+
* must already have been added via `addProgram`.
|
|
10588
|
+
*
|
|
10589
|
+
* @param {string} program_name The program name (e.g., "my_program.aleo").
|
|
10590
|
+
* @param {string} identifier The function name or record name the key belongs to.
|
|
10591
|
+
* @param {Uint8Array} bytes The verifying key bytes.
|
|
10592
|
+
* @param {string} program_name
|
|
10593
|
+
* @param {string} identifier
|
|
10594
|
+
* @param {Uint8Array} bytes
|
|
10595
|
+
*/
|
|
10596
|
+
addVerifyingKeyBytes(program_name, identifier, bytes) {
|
|
10597
|
+
try {
|
|
10598
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
10599
|
+
const ptr0 = passStringToWasm0(program_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10600
|
+
const len0 = WASM_VECTOR_LEN;
|
|
10601
|
+
const ptr1 = passStringToWasm0(identifier, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10602
|
+
const len1 = WASM_VECTOR_LEN;
|
|
10603
|
+
const ptr2 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
|
|
10604
|
+
const len2 = WASM_VECTOR_LEN;
|
|
10605
|
+
wasm.programimports_addVerifyingKeyBytes(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
10606
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
10607
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
10608
|
+
if (r1) {
|
|
10609
|
+
throw takeObject(r0);
|
|
10610
|
+
}
|
|
10611
|
+
} finally {
|
|
10612
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
10613
|
+
}
|
|
10614
|
+
}
|
|
10615
|
+
/**
|
|
10616
|
+
* Return the names of functions that have both a proving key and a verifying key
|
|
10617
|
+
* stored for the given program.
|
|
10618
|
+
*
|
|
10619
|
+
* @param {string} program_name The program name (e.g., "my_program.aleo").
|
|
10620
|
+
* @returns {Array<string>}
|
|
10621
|
+
* @param {string} program_name
|
|
10622
|
+
* @returns {Array<any>}
|
|
10623
|
+
*/
|
|
10624
|
+
functionKeysAvailable(program_name) {
|
|
10625
|
+
try {
|
|
10626
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
10627
|
+
const ptr0 = passStringToWasm0(program_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10628
|
+
const len0 = WASM_VECTOR_LEN;
|
|
10629
|
+
wasm.programimports_functionKeysAvailable(retptr, this.__wbg_ptr, ptr0, len0);
|
|
10630
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
10631
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
10632
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
10633
|
+
if (r2) {
|
|
10634
|
+
throw takeObject(r1);
|
|
10635
|
+
}
|
|
10636
|
+
return takeObject(r0);
|
|
10637
|
+
} finally {
|
|
10638
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
10639
|
+
}
|
|
10640
|
+
}
|
|
10641
|
+
/**
|
|
10642
|
+
* Create a new empty ProgramImports builder.
|
|
10643
|
+
*
|
|
10644
|
+
* Initializes an internal snarkVM Process. This is the same cost as a
|
|
10645
|
+
* single execution call, but is paid once and reused across all operations.
|
|
10646
|
+
*/
|
|
10647
|
+
constructor() {
|
|
10648
|
+
try {
|
|
10649
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
10650
|
+
wasm.programimports_new(retptr);
|
|
10651
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
10652
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
10653
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
10654
|
+
if (r2) {
|
|
10655
|
+
throw takeObject(r1);
|
|
10656
|
+
}
|
|
10657
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
10658
|
+
ProgramImportsFinalization.register(this, this.__wbg_ptr, this);
|
|
10659
|
+
return this;
|
|
10660
|
+
} finally {
|
|
10661
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
10662
|
+
}
|
|
10663
|
+
}
|
|
10664
|
+
/**
|
|
10665
|
+
* Create a cheap clone that shares the same underlying data.
|
|
10666
|
+
*
|
|
10667
|
+
* Useful for passing to WASM execution functions which consume ownership:
|
|
10668
|
+
* the caller keeps the original, and both copies see any mutations
|
|
10669
|
+
* (e.g. synthesized keys) through the shared interior state.
|
|
10670
|
+
* @returns {ProgramImports}
|
|
10671
|
+
*/
|
|
10672
|
+
clone() {
|
|
10673
|
+
const ret = wasm.programimports_clone(this.__wbg_ptr);
|
|
10674
|
+
return ProgramImports.__wrap(ret);
|
|
10675
|
+
}
|
|
10676
|
+
/**
|
|
10677
|
+
* Check whether a specific program has been added.
|
|
10678
|
+
*
|
|
10679
|
+
* @param {string} name The program name.
|
|
10680
|
+
* @returns {boolean}
|
|
10681
|
+
* @param {string} name
|
|
10682
|
+
* @returns {boolean}
|
|
10683
|
+
*/
|
|
10684
|
+
contains(name) {
|
|
10685
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10686
|
+
const len0 = WASM_VECTOR_LEN;
|
|
10687
|
+
const ret = wasm.programimports_contains(this.__wbg_ptr, ptr0, len0);
|
|
10688
|
+
return ret !== 0;
|
|
10689
|
+
}
|
|
10690
|
+
/**
|
|
10691
|
+
* Check whether any programs have been added to this builder.
|
|
10692
|
+
*
|
|
10693
|
+
* @returns {boolean}
|
|
10694
|
+
* @returns {boolean}
|
|
10695
|
+
*/
|
|
10696
|
+
isEmpty() {
|
|
10697
|
+
const ret = wasm.programimports_isEmpty(this.__wbg_ptr);
|
|
10698
|
+
return ret !== 0;
|
|
10699
|
+
}
|
|
10700
|
+
/**
|
|
10701
|
+
* Convert this ProgramImports to a plain JavaScript object.
|
|
10702
|
+
*
|
|
10703
|
+
* Entries without keys use the simple `{ "name.aleo": "source" }` format.
|
|
10704
|
+
* Entries with keys use the structured format:
|
|
10705
|
+
* ```js
|
|
10706
|
+
* {
|
|
10707
|
+
* "name.aleo": {
|
|
10708
|
+
* program: "program source...",
|
|
10709
|
+
* keys: {
|
|
10710
|
+
* "function_name": {
|
|
10711
|
+
* provingKey: Uint8Array,
|
|
10712
|
+
* verifyingKey: Uint8Array
|
|
10713
|
+
* }
|
|
10714
|
+
* }
|
|
10715
|
+
* }
|
|
10716
|
+
* }
|
|
10717
|
+
* ```
|
|
10718
|
+
*
|
|
10719
|
+
* @returns {Object}
|
|
10720
|
+
* @returns {object}
|
|
10721
|
+
*/
|
|
10722
|
+
toObject() {
|
|
10723
|
+
const ret = wasm.programimports_toObject(this.__wbg_ptr);
|
|
10724
|
+
return takeObject(ret);
|
|
10725
|
+
}
|
|
10726
|
+
}
|
|
10727
|
+
if (Symbol.dispose) ProgramImports.prototype[Symbol.dispose] = ProgramImports.prototype.free;
|
|
10728
|
+
|
|
10263
10729
|
const ProgramManagerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
10264
10730
|
? { register: () => {}, unregister: () => {} }
|
|
10265
10731
|
: new FinalizationRegistry(ptr => wasm.__wbg_programmanager_free(ptr >>> 0, 1));
|
|
@@ -10290,15 +10756,21 @@ class ProgramManager {
|
|
|
10290
10756
|
* @param {Array<any>} inputs
|
|
10291
10757
|
* @param {object | null} [imports]
|
|
10292
10758
|
* @param {number | null} [edition]
|
|
10759
|
+
* @param {ProgramImports | null} [program_imports]
|
|
10293
10760
|
* @returns {Promise<KeyPair>}
|
|
10294
10761
|
*/
|
|
10295
|
-
static synthesizeKeyPair(private_key, program, function_id, inputs, imports, edition) {
|
|
10762
|
+
static synthesizeKeyPair(private_key, program, function_id, inputs, imports, edition, program_imports) {
|
|
10296
10763
|
_assertClass(private_key, PrivateKey);
|
|
10297
10764
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10298
10765
|
const len0 = WASM_VECTOR_LEN;
|
|
10299
10766
|
const ptr1 = passStringToWasm0(function_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10300
10767
|
const len1 = WASM_VECTOR_LEN;
|
|
10301
|
-
|
|
10768
|
+
let ptr2 = 0;
|
|
10769
|
+
if (!isLikeNone(program_imports)) {
|
|
10770
|
+
_assertClass(program_imports, ProgramImports);
|
|
10771
|
+
ptr2 = program_imports.__destroy_into_raw();
|
|
10772
|
+
}
|
|
10773
|
+
const ret = wasm.programmanager_synthesizeKeyPair(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(edition) ? 0xFFFFFF : edition, ptr2);
|
|
10302
10774
|
return takeObject(ret);
|
|
10303
10775
|
}
|
|
10304
10776
|
/**
|
|
@@ -10337,9 +10809,10 @@ class ProgramManager {
|
|
|
10337
10809
|
* @param {boolean} unchecked
|
|
10338
10810
|
* @param {number | null | undefined} edition
|
|
10339
10811
|
* @param {boolean} use_fee_master
|
|
10812
|
+
* @param {ProgramImports | null} [program_imports]
|
|
10340
10813
|
* @returns {Promise<ProvingRequest>}
|
|
10341
10814
|
*/
|
|
10342
|
-
static buildProvingRequest(private_key, program, function_name, inputs, base_fee_credits, priority_fee_credits, fee_record, imports, broadcast, unchecked, edition, use_fee_master) {
|
|
10815
|
+
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) {
|
|
10343
10816
|
_assertClass(private_key, PrivateKey);
|
|
10344
10817
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10345
10818
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -10350,7 +10823,12 @@ class ProgramManager {
|
|
|
10350
10823
|
_assertClass(fee_record, RecordPlaintext);
|
|
10351
10824
|
ptr2 = fee_record.__destroy_into_raw();
|
|
10352
10825
|
}
|
|
10353
|
-
|
|
10826
|
+
let ptr3 = 0;
|
|
10827
|
+
if (!isLikeNone(program_imports)) {
|
|
10828
|
+
_assertClass(program_imports, ProgramImports);
|
|
10829
|
+
ptr3 = program_imports.__destroy_into_raw();
|
|
10830
|
+
}
|
|
10831
|
+
const ret = wasm.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);
|
|
10354
10832
|
return takeObject(ret);
|
|
10355
10833
|
}
|
|
10356
10834
|
/**
|
|
@@ -10370,9 +10848,10 @@ class ProgramManager {
|
|
|
10370
10848
|
* @param {number | null} [edition]
|
|
10371
10849
|
* @param {object | null} [imports]
|
|
10372
10850
|
* @param {PrivateKey | null} [private_key]
|
|
10851
|
+
* @param {ProgramImports | null} [program_imports]
|
|
10373
10852
|
* @returns {Promise<ProvingRequest>}
|
|
10374
10853
|
*/
|
|
10375
|
-
static buildProvingRequestFromExecutionRequest(request, program, unchecked, broadcast, edition, imports, private_key) {
|
|
10854
|
+
static buildProvingRequestFromExecutionRequest(request, program, unchecked, broadcast, edition, imports, private_key, program_imports) {
|
|
10376
10855
|
_assertClass(request, ExecutionRequest);
|
|
10377
10856
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10378
10857
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -10381,7 +10860,12 @@ class ProgramManager {
|
|
|
10381
10860
|
_assertClass(private_key, PrivateKey);
|
|
10382
10861
|
ptr1 = private_key.__destroy_into_raw();
|
|
10383
10862
|
}
|
|
10384
|
-
|
|
10863
|
+
let ptr2 = 0;
|
|
10864
|
+
if (!isLikeNone(program_imports)) {
|
|
10865
|
+
_assertClass(program_imports, ProgramImports);
|
|
10866
|
+
ptr2 = program_imports.__destroy_into_raw();
|
|
10867
|
+
}
|
|
10868
|
+
const ret = wasm.programmanager_buildProvingRequestFromExecutionRequest(request.__wbg_ptr, ptr0, len0, unchecked, broadcast, isLikeNone(edition) ? 0xFFFFFF : edition, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr1, ptr2);
|
|
10385
10869
|
return takeObject(ret);
|
|
10386
10870
|
}
|
|
10387
10871
|
/**
|
|
@@ -10522,9 +11006,10 @@ class ProgramManager {
|
|
|
10522
11006
|
* @param {RecordPlaintext | null} [fee_record]
|
|
10523
11007
|
* @param {string | null} [url]
|
|
10524
11008
|
* @param {object | null} [imports]
|
|
11009
|
+
* @param {ProgramImports | null} [program_imports]
|
|
10525
11010
|
* @returns {Promise<Transaction>}
|
|
10526
11011
|
*/
|
|
10527
|
-
static buildDevnodeDeploymentTransaction(private_key, program, priority_fee_credits, fee_record, url, imports) {
|
|
11012
|
+
static buildDevnodeDeploymentTransaction(private_key, program, priority_fee_credits, fee_record, url, imports, program_imports) {
|
|
10528
11013
|
_assertClass(private_key, PrivateKey);
|
|
10529
11014
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10530
11015
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -10535,7 +11020,12 @@ class ProgramManager {
|
|
|
10535
11020
|
}
|
|
10536
11021
|
var ptr2 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10537
11022
|
var len2 = WASM_VECTOR_LEN;
|
|
10538
|
-
|
|
11023
|
+
let ptr3 = 0;
|
|
11024
|
+
if (!isLikeNone(program_imports)) {
|
|
11025
|
+
_assertClass(program_imports, ProgramImports);
|
|
11026
|
+
ptr3 = program_imports.__destroy_into_raw();
|
|
11027
|
+
}
|
|
11028
|
+
const ret = wasm.programmanager_buildDevnodeDeploymentTransaction(private_key.__wbg_ptr, ptr0, len0, priority_fee_credits, ptr1, ptr2, len2, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr3);
|
|
10539
11029
|
return takeObject(ret);
|
|
10540
11030
|
}
|
|
10541
11031
|
/**
|
|
@@ -10563,9 +11053,10 @@ class ProgramManager {
|
|
|
10563
11053
|
* @param {RecordPlaintext | null} [fee_record]
|
|
10564
11054
|
* @param {string | null} [url]
|
|
10565
11055
|
* @param {object | null} [imports]
|
|
11056
|
+
* @param {ProgramImports | null} [program_imports]
|
|
10566
11057
|
* @returns {Promise<Transaction>}
|
|
10567
11058
|
*/
|
|
10568
|
-
static buildDevnodeUpgradeTransaction(private_key, program, priority_fee_credits, fee_record, url, imports) {
|
|
11059
|
+
static buildDevnodeUpgradeTransaction(private_key, program, priority_fee_credits, fee_record, url, imports, program_imports) {
|
|
10569
11060
|
_assertClass(private_key, PrivateKey);
|
|
10570
11061
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10571
11062
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -10576,7 +11067,12 @@ class ProgramManager {
|
|
|
10576
11067
|
}
|
|
10577
11068
|
var ptr2 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10578
11069
|
var len2 = WASM_VECTOR_LEN;
|
|
10579
|
-
|
|
11070
|
+
let ptr3 = 0;
|
|
11071
|
+
if (!isLikeNone(program_imports)) {
|
|
11072
|
+
_assertClass(program_imports, ProgramImports);
|
|
11073
|
+
ptr3 = program_imports.__destroy_into_raw();
|
|
11074
|
+
}
|
|
11075
|
+
const ret = wasm.programmanager_buildDevnodeUpgradeTransaction(private_key.__wbg_ptr, ptr0, len0, priority_fee_credits, ptr1, ptr2, len2, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr3);
|
|
10580
11076
|
return takeObject(ret);
|
|
10581
11077
|
}
|
|
10582
11078
|
/**
|
|
@@ -10620,12 +11116,18 @@ class ProgramManager {
|
|
|
10620
11116
|
* @returns {u64}
|
|
10621
11117
|
* @param {string} program
|
|
10622
11118
|
* @param {object | null} [imports]
|
|
11119
|
+
* @param {ProgramImports | null} [program_imports]
|
|
10623
11120
|
* @returns {Promise<bigint>}
|
|
10624
11121
|
*/
|
|
10625
|
-
static estimateDeploymentFee(program, imports) {
|
|
11122
|
+
static estimateDeploymentFee(program, imports, program_imports) {
|
|
10626
11123
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10627
11124
|
const len0 = WASM_VECTOR_LEN;
|
|
10628
|
-
|
|
11125
|
+
let ptr1 = 0;
|
|
11126
|
+
if (!isLikeNone(program_imports)) {
|
|
11127
|
+
_assertClass(program_imports, ProgramImports);
|
|
11128
|
+
ptr1 = program_imports.__destroy_into_raw();
|
|
11129
|
+
}
|
|
11130
|
+
const ret = wasm.programmanager_estimateDeploymentFee(ptr0, len0, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr1);
|
|
10629
11131
|
return takeObject(ret);
|
|
10630
11132
|
}
|
|
10631
11133
|
/**
|
|
@@ -10655,9 +11157,10 @@ class ProgramManager {
|
|
|
10655
11157
|
* @param {ProvingKey | null} [fee_proving_key]
|
|
10656
11158
|
* @param {VerifyingKey | null} [fee_verifying_key]
|
|
10657
11159
|
* @param {OfflineQuery | null} [offline_query]
|
|
11160
|
+
* @param {ProgramImports | null} [program_imports]
|
|
10658
11161
|
* @returns {Promise<Transaction>}
|
|
10659
11162
|
*/
|
|
10660
|
-
static buildDeploymentTransaction(private_key, program, priority_fee_credits, fee_record, url, imports, fee_proving_key, fee_verifying_key, offline_query) {
|
|
11163
|
+
static buildDeploymentTransaction(private_key, program, priority_fee_credits, fee_record, url, imports, fee_proving_key, fee_verifying_key, offline_query, program_imports) {
|
|
10661
11164
|
_assertClass(private_key, PrivateKey);
|
|
10662
11165
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10663
11166
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -10683,7 +11186,12 @@ class ProgramManager {
|
|
|
10683
11186
|
_assertClass(offline_query, OfflineQuery);
|
|
10684
11187
|
ptr5 = offline_query.__destroy_into_raw();
|
|
10685
11188
|
}
|
|
10686
|
-
|
|
11189
|
+
let ptr6 = 0;
|
|
11190
|
+
if (!isLikeNone(program_imports)) {
|
|
11191
|
+
_assertClass(program_imports, ProgramImports);
|
|
11192
|
+
ptr6 = program_imports.__destroy_into_raw();
|
|
11193
|
+
}
|
|
11194
|
+
const ret = wasm.programmanager_buildDeploymentTransaction(private_key.__wbg_ptr, ptr0, len0, priority_fee_credits, ptr1, ptr2, len2, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr3, ptr4, ptr5, ptr6);
|
|
10687
11195
|
return takeObject(ret);
|
|
10688
11196
|
}
|
|
10689
11197
|
/**
|
|
@@ -10711,9 +11219,10 @@ class ProgramManager {
|
|
|
10711
11219
|
* @param {ProvingKey | null} [fee_proving_key]
|
|
10712
11220
|
* @param {VerifyingKey | null} [fee_verifying_key]
|
|
10713
11221
|
* @param {OfflineQuery | null} [offline_query]
|
|
11222
|
+
* @param {ProgramImports | null} [program_imports]
|
|
10714
11223
|
* @returns {Promise<Transaction>}
|
|
10715
11224
|
*/
|
|
10716
|
-
static buildUpgradeTransaction(private_key, program, priority_fee_credits, fee_record, url, imports, fee_proving_key, fee_verifying_key, offline_query) {
|
|
11225
|
+
static buildUpgradeTransaction(private_key, program, priority_fee_credits, fee_record, url, imports, fee_proving_key, fee_verifying_key, offline_query, program_imports) {
|
|
10717
11226
|
_assertClass(private_key, PrivateKey);
|
|
10718
11227
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10719
11228
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -10739,7 +11248,12 @@ class ProgramManager {
|
|
|
10739
11248
|
_assertClass(offline_query, OfflineQuery);
|
|
10740
11249
|
ptr5 = offline_query.__destroy_into_raw();
|
|
10741
11250
|
}
|
|
10742
|
-
|
|
11251
|
+
let ptr6 = 0;
|
|
11252
|
+
if (!isLikeNone(program_imports)) {
|
|
11253
|
+
_assertClass(program_imports, ProgramImports);
|
|
11254
|
+
ptr6 = program_imports.__destroy_into_raw();
|
|
11255
|
+
}
|
|
11256
|
+
const ret = wasm.programmanager_buildUpgradeTransaction(private_key.__wbg_ptr, ptr0, len0, priority_fee_credits, ptr1, ptr2, len2, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr3, ptr4, ptr5, ptr6);
|
|
10743
11257
|
return takeObject(ret);
|
|
10744
11258
|
}
|
|
10745
11259
|
/**
|
|
@@ -10753,19 +11267,10 @@ class ProgramManager {
|
|
|
10753
11267
|
* @param priority_fee_credits The optional priority fee to be paid for the transaction
|
|
10754
11268
|
* @param fee_record The record to spend the fee from
|
|
10755
11269
|
* @param url The url of the Aleo network node to send the transaction to
|
|
10756
|
-
* If this is set to 'true' the keys synthesized (or passed in as optional parameters via the
|
|
10757
|
-
* `proving_key` and `verifying_key` arguments) will be stored in the ProgramManager's memory
|
|
10758
|
-
* and used for subsequent transactions. If this is set to 'false' the proving and verifying
|
|
10759
|
-
* keys will be deallocated from memory after the transaction is executed.
|
|
10760
11270
|
* @param imports (optional) Provide a list of imports to use for the function execution in the
|
|
10761
11271
|
* form of a javascript object where the keys are a string of the program name and the values
|
|
10762
11272
|
* are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
|
|
10763
|
-
* @param
|
|
10764
|
-
* @param verifying_key (optional) Provide a verifying key to use for the function execution
|
|
10765
|
-
* @param fee_proving_key (optional) Provide a proving key to use for the fee execution
|
|
10766
|
-
* @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
|
|
10767
|
-
* @param offline_query An offline query object to use if building a transaction without an internet connection.
|
|
10768
|
-
* @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.
|
|
11273
|
+
* @param edition The edition of the program to execute. Defaults to 1.
|
|
10769
11274
|
* @returns {Transaction}
|
|
10770
11275
|
* @param {PrivateKey} private_key
|
|
10771
11276
|
* @param {string} program
|
|
@@ -10776,9 +11281,10 @@ class ProgramManager {
|
|
|
10776
11281
|
* @param {string | null} [url]
|
|
10777
11282
|
* @param {object | null} [imports]
|
|
10778
11283
|
* @param {number | null} [edition]
|
|
11284
|
+
* @param {ProgramImports | null} [program_imports]
|
|
10779
11285
|
* @returns {Promise<Transaction>}
|
|
10780
11286
|
*/
|
|
10781
|
-
static buildDevnodeExecutionTransaction(private_key, program, _function, inputs, priority_fee_credits, fee_record, url, imports, edition) {
|
|
11287
|
+
static buildDevnodeExecutionTransaction(private_key, program, _function, inputs, priority_fee_credits, fee_record, url, imports, edition, program_imports) {
|
|
10782
11288
|
_assertClass(private_key, PrivateKey);
|
|
10783
11289
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10784
11290
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -10791,7 +11297,12 @@ class ProgramManager {
|
|
|
10791
11297
|
}
|
|
10792
11298
|
var ptr3 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10793
11299
|
var len3 = WASM_VECTOR_LEN;
|
|
10794
|
-
|
|
11300
|
+
let ptr4 = 0;
|
|
11301
|
+
if (!isLikeNone(program_imports)) {
|
|
11302
|
+
_assertClass(program_imports, ProgramImports);
|
|
11303
|
+
ptr4 = program_imports.__destroy_into_raw();
|
|
11304
|
+
}
|
|
11305
|
+
const ret = wasm.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);
|
|
10795
11306
|
return takeObject(ret);
|
|
10796
11307
|
}
|
|
10797
11308
|
/**
|
|
@@ -10836,6 +11347,7 @@ class ProgramManager {
|
|
|
10836
11347
|
* @param imports The imports of the program being executed.
|
|
10837
11348
|
* @param url The url to get the inclusion proving information from.
|
|
10838
11349
|
* @param offline_query Optional offline query object if building a Transaction offline.
|
|
11350
|
+
* @param edition The program edition (defaults to 1).
|
|
10839
11351
|
* @param {Authorization} authorization
|
|
10840
11352
|
* @param {Authorization | null | undefined} fee_authorization
|
|
10841
11353
|
* @param {string} program
|
|
@@ -10846,9 +11358,11 @@ class ProgramManager {
|
|
|
10846
11358
|
* @param {object | null} [imports]
|
|
10847
11359
|
* @param {string | null} [url]
|
|
10848
11360
|
* @param {QueryOption | null} [query]
|
|
11361
|
+
* @param {ProgramImports | null} [program_imports]
|
|
11362
|
+
* @param {number | null} [edition]
|
|
10849
11363
|
* @returns {Promise<Transaction>}
|
|
10850
11364
|
*/
|
|
10851
|
-
static executeAuthorization(authorization, fee_authorization, program, proving_key, verifying_key, fee_proving_key, fee_verifying_key, imports, url, query) {
|
|
11365
|
+
static executeAuthorization(authorization, fee_authorization, program, proving_key, verifying_key, fee_proving_key, fee_verifying_key, imports, url, query, program_imports, edition) {
|
|
10852
11366
|
_assertClass(authorization, Authorization);
|
|
10853
11367
|
var ptr0 = authorization.__destroy_into_raw();
|
|
10854
11368
|
let ptr1 = 0;
|
|
@@ -10885,35 +11399,44 @@ class ProgramManager {
|
|
|
10885
11399
|
_assertClass(query, QueryOption);
|
|
10886
11400
|
ptr8 = query.__destroy_into_raw();
|
|
10887
11401
|
}
|
|
10888
|
-
|
|
11402
|
+
let ptr9 = 0;
|
|
11403
|
+
if (!isLikeNone(program_imports)) {
|
|
11404
|
+
_assertClass(program_imports, ProgramImports);
|
|
11405
|
+
ptr9 = program_imports.__destroy_into_raw();
|
|
11406
|
+
}
|
|
11407
|
+
const ret = wasm.programmanager_executeAuthorization(ptr0, ptr1, ptr2, len2, ptr3, ptr4, ptr5, ptr6, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr7, len7, ptr8, ptr9, isLikeNone(edition) ? 0xFFFFFF : edition);
|
|
10889
11408
|
return takeObject(ret);
|
|
10890
11409
|
}
|
|
10891
11410
|
/**
|
|
10892
|
-
* Estimate Fee for Aleo function execution.
|
|
10893
|
-
* verifying keys will be stored in the ProgramManager's memory and used for subsequent
|
|
10894
|
-
* program executions.
|
|
11411
|
+
* Estimate Fee for Aleo function execution.
|
|
10895
11412
|
*
|
|
10896
11413
|
* @param program The source code of the program to estimate the execution fee for.
|
|
10897
11414
|
* @param function The name of the function to estimate the execution fee for.
|
|
10898
11415
|
* @param imports (optional) Provide a list of imports to use for the fee estimation in the
|
|
10899
11416
|
* form of a javascript object where the keys are a string of the program name and the values
|
|
10900
11417
|
* are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
|
|
10901
|
-
* @param edition
|
|
11418
|
+
* @param edition The edition of the program. Defaults to 1.
|
|
10902
11419
|
* @returns {u64} Fee in microcredits
|
|
10903
11420
|
* @param {string} program
|
|
10904
11421
|
* @param {string} _function
|
|
10905
11422
|
* @param {object | null} [imports]
|
|
10906
11423
|
* @param {number | null} [edition]
|
|
11424
|
+
* @param {ProgramImports | null} [program_imports]
|
|
10907
11425
|
* @returns {bigint}
|
|
10908
11426
|
*/
|
|
10909
|
-
static estimateExecutionFee(program, _function, imports, edition) {
|
|
11427
|
+
static estimateExecutionFee(program, _function, imports, edition, program_imports) {
|
|
10910
11428
|
try {
|
|
10911
11429
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
10912
11430
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10913
11431
|
const len0 = WASM_VECTOR_LEN;
|
|
10914
11432
|
const ptr1 = passStringToWasm0(_function, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10915
11433
|
const len1 = WASM_VECTOR_LEN;
|
|
10916
|
-
|
|
11434
|
+
let ptr2 = 0;
|
|
11435
|
+
if (!isLikeNone(program_imports)) {
|
|
11436
|
+
_assertClass(program_imports, ProgramImports);
|
|
11437
|
+
ptr2 = program_imports.__destroy_into_raw();
|
|
11438
|
+
}
|
|
11439
|
+
wasm.programmanager_estimateExecutionFee(retptr, ptr0, len0, ptr1, len1, isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(edition) ? 0xFFFFFF : edition, ptr2);
|
|
10917
11440
|
var r0 = getDataViewMemory0().getBigInt64(retptr + 8 * 0, true);
|
|
10918
11441
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
10919
11442
|
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
@@ -10942,7 +11465,7 @@ class ProgramManager {
|
|
|
10942
11465
|
* @param {Object | undefined} imports (optional) Provide a list of imports to use for the function execution in the
|
|
10943
11466
|
* form of a javascript object where the keys are a string of the program name and the values
|
|
10944
11467
|
* are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
|
|
10945
|
-
* @param {ProvingKey | undefined} proving_key (optional) Provide a
|
|
11468
|
+
* @param {ProvingKey | undefined} proving_key (optional) Provide a proving key to use for the function execution
|
|
10946
11469
|
* @param {VerifyingKey | undefined} verifying_key (optional) Provide a verifying key to use for the function execution
|
|
10947
11470
|
* @param {PrivateKey} private_key
|
|
10948
11471
|
* @param {string} program
|
|
@@ -10956,9 +11479,10 @@ class ProgramManager {
|
|
|
10956
11479
|
* @param {string | null} [url]
|
|
10957
11480
|
* @param {QueryOption | null} [query]
|
|
10958
11481
|
* @param {number | null} [edition]
|
|
11482
|
+
* @param {ProgramImports | null} [program_imports]
|
|
10959
11483
|
* @returns {Promise<ExecutionResponse>}
|
|
10960
11484
|
*/
|
|
10961
|
-
static executeFunctionOffline(private_key, program, _function, inputs, prove_execution, cache, imports, proving_key, verifying_key, url, query, edition) {
|
|
11485
|
+
static executeFunctionOffline(private_key, program, _function, inputs, prove_execution, cache, imports, proving_key, verifying_key, url, query, edition, program_imports) {
|
|
10962
11486
|
_assertClass(private_key, PrivateKey);
|
|
10963
11487
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
10964
11488
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -10981,7 +11505,12 @@ class ProgramManager {
|
|
|
10981
11505
|
_assertClass(query, QueryOption);
|
|
10982
11506
|
ptr5 = query.__destroy_into_raw();
|
|
10983
11507
|
}
|
|
10984
|
-
|
|
11508
|
+
let ptr6 = 0;
|
|
11509
|
+
if (!isLikeNone(program_imports)) {
|
|
11510
|
+
_assertClass(program_imports, ProgramImports);
|
|
11511
|
+
ptr6 = program_imports.__destroy_into_raw();
|
|
11512
|
+
}
|
|
11513
|
+
const ret = wasm.programmanager_executeFunctionOffline(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), prove_execution, cache, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr2, ptr3, ptr4, len4, ptr5, isLikeNone(edition) ? 0xFFFFFF : edition, ptr6);
|
|
10985
11514
|
return takeObject(ret);
|
|
10986
11515
|
}
|
|
10987
11516
|
/**
|
|
@@ -11047,15 +11576,21 @@ class ProgramManager {
|
|
|
11047
11576
|
* @param {string} program
|
|
11048
11577
|
* @param {object | null} [imports]
|
|
11049
11578
|
* @param {number | null} [edition]
|
|
11579
|
+
* @param {ProgramImports | null} [program_imports]
|
|
11050
11580
|
* @returns {bigint}
|
|
11051
11581
|
*/
|
|
11052
|
-
static estimateFeeForAuthorization(authorization, program, imports, edition) {
|
|
11582
|
+
static estimateFeeForAuthorization(authorization, program, imports, edition, program_imports) {
|
|
11053
11583
|
try {
|
|
11054
11584
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
11055
11585
|
_assertClass(authorization, Authorization);
|
|
11056
11586
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
11057
11587
|
const len0 = WASM_VECTOR_LEN;
|
|
11058
|
-
|
|
11588
|
+
let ptr1 = 0;
|
|
11589
|
+
if (!isLikeNone(program_imports)) {
|
|
11590
|
+
_assertClass(program_imports, ProgramImports);
|
|
11591
|
+
ptr1 = program_imports.__destroy_into_raw();
|
|
11592
|
+
}
|
|
11593
|
+
wasm.programmanager_estimateFeeForAuthorization(retptr, authorization.__wbg_ptr, ptr0, len0, isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(edition) ? 0xFFFFFF : edition, ptr1);
|
|
11059
11594
|
var r0 = getDataViewMemory0().getBigInt64(retptr + 8 * 0, true);
|
|
11060
11595
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
11061
11596
|
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
@@ -11077,19 +11612,15 @@ class ProgramManager {
|
|
|
11077
11612
|
* @param priority_fee_credits The optional priority fee to be paid for the transaction
|
|
11078
11613
|
* @param fee_record The record to spend the fee from
|
|
11079
11614
|
* @param url The url of the Aleo network node to send the transaction to
|
|
11080
|
-
* If this is set to 'true' the keys synthesized (or passed in as optional parameters via the
|
|
11081
|
-
* `proving_key` and `verifying_key` arguments) will be stored in the ProgramManager's memory
|
|
11082
|
-
* and used for subsequent transactions. If this is set to 'false' the proving and verifying
|
|
11083
|
-
* keys will be deallocated from memory after the transaction is executed.
|
|
11084
11615
|
* @param imports (optional) Provide a list of imports to use for the function execution in the
|
|
11085
11616
|
* form of a javascript object where the keys are a string of the program name and the values
|
|
11086
11617
|
* are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
|
|
11087
|
-
* @param proving_key (optional) Provide a
|
|
11618
|
+
* @param proving_key (optional) Provide a proving key to use for the function execution
|
|
11088
11619
|
* @param verifying_key (optional) Provide a verifying key to use for the function execution
|
|
11089
11620
|
* @param fee_proving_key (optional) Provide a proving key to use for the fee execution
|
|
11090
11621
|
* @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
|
|
11091
11622
|
* @param offline_query An offline query object to use if building a transaction without an internet connection.
|
|
11092
|
-
* @param edition The edition of the program to execute. Defaults to
|
|
11623
|
+
* @param edition The edition of the program to execute. Defaults to 1.
|
|
11093
11624
|
* @returns {Transaction}
|
|
11094
11625
|
* @param {PrivateKey} private_key
|
|
11095
11626
|
* @param {string} program
|
|
@@ -11105,9 +11636,10 @@ class ProgramManager {
|
|
|
11105
11636
|
* @param {VerifyingKey | null} [fee_verifying_key]
|
|
11106
11637
|
* @param {QueryOption | null} [query]
|
|
11107
11638
|
* @param {number | null} [edition]
|
|
11639
|
+
* @param {ProgramImports | null} [program_imports]
|
|
11108
11640
|
* @returns {Promise<Transaction>}
|
|
11109
11641
|
*/
|
|
11110
|
-
static buildExecutionTransaction(private_key, program, _function, inputs, priority_fee_credits, fee_record, url, imports, proving_key, verifying_key, fee_proving_key, fee_verifying_key, query, edition) {
|
|
11642
|
+
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) {
|
|
11111
11643
|
_assertClass(private_key, PrivateKey);
|
|
11112
11644
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
11113
11645
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -11145,7 +11677,12 @@ class ProgramManager {
|
|
|
11145
11677
|
_assertClass(query, QueryOption);
|
|
11146
11678
|
ptr8 = query.__destroy_into_raw();
|
|
11147
11679
|
}
|
|
11148
|
-
|
|
11680
|
+
let ptr9 = 0;
|
|
11681
|
+
if (!isLikeNone(program_imports)) {
|
|
11682
|
+
_assertClass(program_imports, ProgramImports);
|
|
11683
|
+
ptr9 = program_imports.__destroy_into_raw();
|
|
11684
|
+
}
|
|
11685
|
+
const ret = wasm.programmanager_buildExecutionTransaction(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), priority_fee_credits, ptr2, ptr3, len3, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr4, ptr5, ptr6, ptr7, ptr8, isLikeNone(edition) ? 0xFFFFFF : edition, ptr9);
|
|
11149
11686
|
return takeObject(ret);
|
|
11150
11687
|
}
|
|
11151
11688
|
/**
|
|
@@ -11270,9 +11807,10 @@ class ProgramManager {
|
|
|
11270
11807
|
* @param {number | null} [edition]
|
|
11271
11808
|
* @param {object | null} [imports]
|
|
11272
11809
|
* @param {PrivateKey | null} [private_key]
|
|
11810
|
+
* @param {ProgramImports | null} [program_imports]
|
|
11273
11811
|
* @returns {Promise<Authorization>}
|
|
11274
11812
|
*/
|
|
11275
|
-
static buildAuthorizationFromExecutionRequest(request, program, unchecked, edition, imports, private_key) {
|
|
11813
|
+
static buildAuthorizationFromExecutionRequest(request, program, unchecked, edition, imports, private_key, program_imports) {
|
|
11276
11814
|
_assertClass(request, ExecutionRequest);
|
|
11277
11815
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
11278
11816
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -11281,7 +11819,12 @@ class ProgramManager {
|
|
|
11281
11819
|
_assertClass(private_key, PrivateKey);
|
|
11282
11820
|
ptr1 = private_key.__destroy_into_raw();
|
|
11283
11821
|
}
|
|
11284
|
-
|
|
11822
|
+
let ptr2 = 0;
|
|
11823
|
+
if (!isLikeNone(program_imports)) {
|
|
11824
|
+
_assertClass(program_imports, ProgramImports);
|
|
11825
|
+
ptr2 = program_imports.__destroy_into_raw();
|
|
11826
|
+
}
|
|
11827
|
+
const ret = wasm.programmanager_buildAuthorizationFromExecutionRequest(request.__wbg_ptr, ptr0, len0, unchecked, isLikeNone(edition) ? 0xFFFFFF : edition, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr1, ptr2);
|
|
11285
11828
|
return takeObject(ret);
|
|
11286
11829
|
}
|
|
11287
11830
|
/**
|
|
@@ -11299,15 +11842,21 @@ class ProgramManager {
|
|
|
11299
11842
|
* @param {Array<any>} inputs
|
|
11300
11843
|
* @param {object | null} [imports]
|
|
11301
11844
|
* @param {number | null} [edition]
|
|
11845
|
+
* @param {ProgramImports | null} [program_imports]
|
|
11302
11846
|
* @returns {Promise<Authorization>}
|
|
11303
11847
|
*/
|
|
11304
|
-
static buildAuthorizationUnchecked(private_key, program, function_name, inputs, imports, edition) {
|
|
11848
|
+
static buildAuthorizationUnchecked(private_key, program, function_name, inputs, imports, edition, program_imports) {
|
|
11305
11849
|
_assertClass(private_key, PrivateKey);
|
|
11306
11850
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
11307
11851
|
const len0 = WASM_VECTOR_LEN;
|
|
11308
11852
|
const ptr1 = passStringToWasm0(function_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
11309
11853
|
const len1 = WASM_VECTOR_LEN;
|
|
11310
|
-
|
|
11854
|
+
let ptr2 = 0;
|
|
11855
|
+
if (!isLikeNone(program_imports)) {
|
|
11856
|
+
_assertClass(program_imports, ProgramImports);
|
|
11857
|
+
ptr2 = program_imports.__destroy_into_raw();
|
|
11858
|
+
}
|
|
11859
|
+
const ret = wasm.programmanager_buildAuthorizationUnchecked(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(edition) ? 0xFFFFFF : edition, ptr2);
|
|
11311
11860
|
return takeObject(ret);
|
|
11312
11861
|
}
|
|
11313
11862
|
/**
|
|
@@ -11324,15 +11873,21 @@ class ProgramManager {
|
|
|
11324
11873
|
* @param {Array<any>} inputs
|
|
11325
11874
|
* @param {object | null} [imports]
|
|
11326
11875
|
* @param {number | null} [edition]
|
|
11876
|
+
* @param {ProgramImports | null} [program_imports]
|
|
11327
11877
|
* @returns {Promise<Authorization>}
|
|
11328
11878
|
*/
|
|
11329
|
-
static authorize(private_key, program, function_name, inputs, imports, edition) {
|
|
11879
|
+
static authorize(private_key, program, function_name, inputs, imports, edition, program_imports) {
|
|
11330
11880
|
_assertClass(private_key, PrivateKey);
|
|
11331
11881
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
11332
11882
|
const len0 = WASM_VECTOR_LEN;
|
|
11333
11883
|
const ptr1 = passStringToWasm0(function_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
11334
11884
|
const len1 = WASM_VECTOR_LEN;
|
|
11335
|
-
|
|
11885
|
+
let ptr2 = 0;
|
|
11886
|
+
if (!isLikeNone(program_imports)) {
|
|
11887
|
+
_assertClass(program_imports, ProgramImports);
|
|
11888
|
+
ptr2 = program_imports.__destroy_into_raw();
|
|
11889
|
+
}
|
|
11890
|
+
const ret = wasm.programmanager_authorize(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(edition) ? 0xFFFFFF : edition, ptr2);
|
|
11336
11891
|
return takeObject(ret);
|
|
11337
11892
|
}
|
|
11338
11893
|
}
|
|
@@ -18294,6 +18849,10 @@ function __wbg_get_imports(memory) {
|
|
|
18294
18849
|
const ret = typeof(getObject(arg0)) === 'function';
|
|
18295
18850
|
return ret;
|
|
18296
18851
|
};
|
|
18852
|
+
imports.wbg.__wbg___wbindgen_is_null_5e69f72e906cc57c = function(arg0) {
|
|
18853
|
+
const ret = getObject(arg0) === null;
|
|
18854
|
+
return ret;
|
|
18855
|
+
};
|
|
18297
18856
|
imports.wbg.__wbg___wbindgen_is_object_c818261d21f283a4 = function(arg0) {
|
|
18298
18857
|
const val = getObject(arg0);
|
|
18299
18858
|
const ret = typeof(val) === 'object' && val !== null;
|
|
@@ -18458,6 +19017,16 @@ function __wbg_get_imports(memory) {
|
|
|
18458
19017
|
const ret = getObject(arg0).headers;
|
|
18459
19018
|
return addHeapObject(ret);
|
|
18460
19019
|
};
|
|
19020
|
+
imports.wbg.__wbg_instanceof_Object_10bb762262230c68 = function(arg0) {
|
|
19021
|
+
let result;
|
|
19022
|
+
try {
|
|
19023
|
+
result = getObject(arg0) instanceof Object;
|
|
19024
|
+
} catch (_) {
|
|
19025
|
+
result = false;
|
|
19026
|
+
}
|
|
19027
|
+
const ret = result;
|
|
19028
|
+
return ret;
|
|
19029
|
+
};
|
|
18461
19030
|
imports.wbg.__wbg_instanceof_Promise_001fdd42afa1b7ef = function(arg0) {
|
|
18462
19031
|
let result;
|
|
18463
19032
|
try {
|
|
@@ -18512,7 +19081,7 @@ function __wbg_get_imports(memory) {
|
|
|
18512
19081
|
const ret = getObject(arg0).length;
|
|
18513
19082
|
return ret;
|
|
18514
19083
|
};
|
|
18515
|
-
imports.wbg.
|
|
19084
|
+
imports.wbg.__wbg_log_2c81ec274d38c9bb = function(arg0, arg1) {
|
|
18516
19085
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
18517
19086
|
};
|
|
18518
19087
|
imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
|
|
@@ -18534,7 +19103,7 @@ function __wbg_get_imports(memory) {
|
|
|
18534
19103
|
const a = state0.a;
|
|
18535
19104
|
state0.a = 0;
|
|
18536
19105
|
try {
|
|
18537
|
-
return
|
|
19106
|
+
return __wasm_bindgen_func_elem_7529(a, state0.b, arg0, arg1);
|
|
18538
19107
|
} finally {
|
|
18539
19108
|
state0.a = a;
|
|
18540
19109
|
}
|
|
@@ -18721,7 +19290,7 @@ function __wbg_get_imports(memory) {
|
|
|
18721
19290
|
const ret = Signature.__wrap(arg0);
|
|
18722
19291
|
return addHeapObject(ret);
|
|
18723
19292
|
};
|
|
18724
|
-
imports.wbg.
|
|
19293
|
+
imports.wbg.__wbg_spawnWorker_c5c00ae0c7b9fe56 = function(arg0, arg1, arg2, arg3) {
|
|
18725
19294
|
const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
|
|
18726
19295
|
return addHeapObject(ret);
|
|
18727
19296
|
};
|
|
@@ -18828,7 +19397,7 @@ function __wbg_get_imports(memory) {
|
|
|
18828
19397
|
};
|
|
18829
19398
|
imports.wbg.__wbindgen_cast_711d7deea8fc39ca = function(arg0, arg1) {
|
|
18830
19399
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 356, function: Function { arguments: [Externref], shim_idx: 357, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
18831
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
19400
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7256, __wasm_bindgen_func_elem_8618);
|
|
18832
19401
|
return addHeapObject(ret);
|
|
18833
19402
|
};
|
|
18834
19403
|
imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
@@ -18838,7 +19407,7 @@ function __wbg_get_imports(memory) {
|
|
|
18838
19407
|
};
|
|
18839
19408
|
imports.wbg.__wbindgen_cast_cada7727142cd213 = function(arg0, arg1) {
|
|
18840
19409
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 356, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 357, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
18841
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
19410
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7256, __wasm_bindgen_func_elem_8618);
|
|
18842
19411
|
return addHeapObject(ret);
|
|
18843
19412
|
};
|
|
18844
19413
|
imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
|
|
@@ -18848,7 +19417,7 @@ function __wbg_get_imports(memory) {
|
|
|
18848
19417
|
};
|
|
18849
19418
|
imports.wbg.__wbindgen_cast_cdf07f87b2615f8c = function(arg0, arg1) {
|
|
18850
19419
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 356, function: Function { arguments: [], shim_idx: 462, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
18851
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
19420
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7256, __wasm_bindgen_func_elem_7257);
|
|
18852
19421
|
return addHeapObject(ret);
|
|
18853
19422
|
};
|
|
18854
19423
|
imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|
|
@@ -18959,5 +19528,5 @@ async function initThreadPool(threads) {
|
|
|
18959
19528
|
await initThreadPool$1(new URL("worker.js", import.meta.url), threads);
|
|
18960
19529
|
}
|
|
18961
19530
|
|
|
18962
|
-
export { Address, Authorization, BHP1024, BHP256, BHP512, BHP768, Boolean, CallbackQuery, Ciphertext, ComputeKey, DynamicRecord, EncryptionToolkit, Execution, ExecutionRequest, ExecutionResponse, Field, GraphKey, Group, I128, I16, I32, I64, I8, KeyPair, Metadata, OfflineQuery, Pedersen128, Pedersen64, Plaintext, Poseidon2, Poseidon4, Poseidon8, PrivateKey, PrivateKeyCiphertext, Program, ProgramManager, Proof, ProvingKey, ProvingRequest, QueryOption, RecordCiphertext, RecordPlaintext, Scalar, Signature, Transaction, Transition, U128, U16, U32, U64, U8, Value, VerifyingKey, ViewKey, getOrInitConsensusVersionTestHeights, initSync, initThreadPool, runRayonThread, snarkVerify, snarkVerifyBatch, stringToField, verifyFunctionExecution };
|
|
19531
|
+
export { Address, Authorization, BHP1024, BHP256, BHP512, BHP768, Boolean, CallbackQuery, Ciphertext, ComputeKey, DynamicRecord, EncryptionToolkit, Execution, ExecutionRequest, ExecutionResponse, Field, GraphKey, Group, I128, I16, I32, I64, I8, KeyPair, Metadata, OfflineQuery, Pedersen128, Pedersen64, Plaintext, Poseidon2, Poseidon4, Poseidon8, PrivateKey, PrivateKeyCiphertext, Program, ProgramImports, ProgramManager, Proof, ProvingKey, ProvingRequest, QueryOption, RecordCiphertext, RecordPlaintext, Scalar, Signature, Transaction, Transition, U128, U16, U32, U64, U8, Value, VerifyingKey, ViewKey, getOrInitConsensusVersionTestHeights, initSync, initThreadPool, runRayonThread, snarkVerify, snarkVerifyBatch, stringToField, verifyFunctionExecution };
|
|
18963
19532
|
//# sourceMappingURL=index.js.map
|