@provablehq/wasm 0.8.7 → 0.9.0
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 +199 -15
- package/dist/mainnet/aleo_wasm.wasm +0 -0
- package/dist/mainnet/index.js +624 -35
- package/dist/mainnet/index.js.map +1 -1
- package/dist/mainnet/worker.js +624 -35
- package/dist/mainnet/worker.js.map +1 -1
- package/dist/testnet/aleo_wasm.d.ts +199 -15
- package/dist/testnet/aleo_wasm.wasm +0 -0
- package/dist/testnet/index.js +624 -35
- package/dist/testnet/index.js.map +1 -1
- package/dist/testnet/worker.js +624 -35
- package/dist/testnet/worker.js.map +1 -1
- package/package.json +2 -2
package/dist/testnet/index.js
CHANGED
|
@@ -194,22 +194,26 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
194
194
|
return ptr;
|
|
195
195
|
}
|
|
196
196
|
/**
|
|
197
|
-
* Verify an execution with
|
|
198
|
-
*
|
|
199
|
-
* the execution is included in the Aleo Network ledger.
|
|
197
|
+
* Verify an execution. Executions with multiple transitions must have the program source code and
|
|
198
|
+
* verifying keys of imported functions supplied from outside to correctly verify. Also, this does
|
|
199
|
+
* not verify that the state root of the execution is included in the Aleo Network ledger.
|
|
200
200
|
*
|
|
201
201
|
* @param {Execution} execution The function execution to verify
|
|
202
202
|
* @param {VerifyingKey} verifying_key The verifying key for the function
|
|
203
203
|
* @param {Program} program The program that the function execution belongs to
|
|
204
204
|
* @param {String} function_id The name of the function that was executed
|
|
205
|
+
* @param {Object} imports The imports for the program in the form of { "program_id.aleo":"source code", ... }
|
|
206
|
+
* @param {Object} import_verifying_keys The verifying keys for the imports in the form of { "program_id.aleo": [["function, "verifying_key"], ...], ...}
|
|
205
207
|
* @returns {boolean} True if the execution is valid, false otherwise
|
|
206
208
|
* @param {Execution} execution
|
|
207
209
|
* @param {VerifyingKey} verifying_key
|
|
208
210
|
* @param {Program} program
|
|
209
211
|
* @param {string} function_id
|
|
212
|
+
* @param {object | null} [imports]
|
|
213
|
+
* @param {object | null} [imported_verifying_keys]
|
|
210
214
|
* @returns {boolean}
|
|
211
215
|
*/
|
|
212
|
-
function verifyFunctionExecution(execution, verifying_key, program, function_id) {
|
|
216
|
+
function verifyFunctionExecution(execution, verifying_key, program, function_id, imports, imported_verifying_keys) {
|
|
213
217
|
try {
|
|
214
218
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
215
219
|
_assertClass(execution, Execution);
|
|
@@ -217,7 +221,7 @@ function verifyFunctionExecution(execution, verifying_key, program, function_id)
|
|
|
217
221
|
_assertClass(program, Program);
|
|
218
222
|
const ptr0 = passStringToWasm0(function_id, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
219
223
|
const len0 = WASM_VECTOR_LEN;
|
|
220
|
-
wasm.verifyFunctionExecution(retptr, execution.__wbg_ptr, verifying_key.__wbg_ptr, program.__wbg_ptr, ptr0, len0);
|
|
224
|
+
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));
|
|
221
225
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
222
226
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
223
227
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -263,7 +267,7 @@ function __wbg_adapter_40(arg0, arg1, arg2) {
|
|
|
263
267
|
wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2));
|
|
264
268
|
}
|
|
265
269
|
|
|
266
|
-
function
|
|
270
|
+
function __wbg_adapter_526(arg0, arg1, arg2, arg3) {
|
|
267
271
|
wasm.__wbindgen_export_7(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
268
272
|
}
|
|
269
273
|
|
|
@@ -336,6 +340,147 @@ class Address {
|
|
|
336
340
|
const ret = wasm.address_from_compute_key(compute_key.__wbg_ptr);
|
|
337
341
|
return Address.__wrap(ret);
|
|
338
342
|
}
|
|
343
|
+
/**
|
|
344
|
+
* Get an address from a series of bytes.
|
|
345
|
+
*
|
|
346
|
+
* @param {Uint8Array} bytes A left endian byte array representing the address.
|
|
347
|
+
*
|
|
348
|
+
* @returns {Address} The address object.
|
|
349
|
+
* @param {Uint8Array} bytes
|
|
350
|
+
* @returns {Address}
|
|
351
|
+
*/
|
|
352
|
+
static fromBytesLe(bytes) {
|
|
353
|
+
try {
|
|
354
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
355
|
+
wasm.address_fromBytesLe(retptr, addHeapObject(bytes));
|
|
356
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
357
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
358
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
359
|
+
if (r2) {
|
|
360
|
+
throw takeObject(r1);
|
|
361
|
+
}
|
|
362
|
+
return Address.__wrap(r0);
|
|
363
|
+
} finally {
|
|
364
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Get the left endian byte array representation of the address.
|
|
369
|
+
* @returns {Uint8Array}
|
|
370
|
+
*/
|
|
371
|
+
toBytesLe() {
|
|
372
|
+
try {
|
|
373
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
374
|
+
wasm.address_toBytesLe(retptr, this.__wbg_ptr);
|
|
375
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
376
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
377
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
378
|
+
if (r2) {
|
|
379
|
+
throw takeObject(r1);
|
|
380
|
+
}
|
|
381
|
+
return takeObject(r0);
|
|
382
|
+
} finally {
|
|
383
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Get an address from a series of bits represented as a boolean array.
|
|
388
|
+
*
|
|
389
|
+
* @param {Array} bits A left endian boolean array representing the bits of the address.
|
|
390
|
+
*
|
|
391
|
+
* @returns {Address} The address object.
|
|
392
|
+
* @param {Array<any>} bits
|
|
393
|
+
* @returns {Address}
|
|
394
|
+
*/
|
|
395
|
+
static fromBitsLe(bits) {
|
|
396
|
+
try {
|
|
397
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
398
|
+
wasm.address_fromBitsLe(retptr, addHeapObject(bits));
|
|
399
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
400
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
401
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
402
|
+
if (r2) {
|
|
403
|
+
throw takeObject(r1);
|
|
404
|
+
}
|
|
405
|
+
return Address.__wrap(r0);
|
|
406
|
+
} finally {
|
|
407
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Get the left endian boolean array representation of the bits of the address.
|
|
412
|
+
* @returns {Array<any>}
|
|
413
|
+
*/
|
|
414
|
+
toBitsLe() {
|
|
415
|
+
const ret = wasm.address_toBitsLe(this.__wbg_ptr);
|
|
416
|
+
return takeObject(ret);
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Get an address object from an array of fields.
|
|
420
|
+
*
|
|
421
|
+
* @param {Array} fields An array of fields.
|
|
422
|
+
*
|
|
423
|
+
* @returns {Plaintext} The address object.
|
|
424
|
+
* @param {Array<any>} fields
|
|
425
|
+
* @returns {Address}
|
|
426
|
+
*/
|
|
427
|
+
static fromFields(fields) {
|
|
428
|
+
try {
|
|
429
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
430
|
+
wasm.address_fromFields(retptr, addHeapObject(fields));
|
|
431
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
432
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
433
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
434
|
+
if (r2) {
|
|
435
|
+
throw takeObject(r1);
|
|
436
|
+
}
|
|
437
|
+
return Address.__wrap(r0);
|
|
438
|
+
} finally {
|
|
439
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Get the field array representation of the address.
|
|
444
|
+
* @returns {Array<any>}
|
|
445
|
+
*/
|
|
446
|
+
toFields() {
|
|
447
|
+
try {
|
|
448
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
449
|
+
wasm.address_toFields(retptr, this.__wbg_ptr);
|
|
450
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
451
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
452
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
453
|
+
if (r2) {
|
|
454
|
+
throw takeObject(r1);
|
|
455
|
+
}
|
|
456
|
+
return takeObject(r0);
|
|
457
|
+
} finally {
|
|
458
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Get an address object from a group.
|
|
463
|
+
*
|
|
464
|
+
* @param {Group} group The group object.
|
|
465
|
+
*
|
|
466
|
+
* @returns {Address} The address object.
|
|
467
|
+
* @param {Group} group
|
|
468
|
+
* @returns {Address}
|
|
469
|
+
*/
|
|
470
|
+
static fromGroup(group) {
|
|
471
|
+
_assertClass(group, Group);
|
|
472
|
+
var ptr0 = group.__destroy_into_raw();
|
|
473
|
+
const ret = wasm.address_fromGroup(ptr0);
|
|
474
|
+
return Address.__wrap(ret);
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Get the group representation of the address object.
|
|
478
|
+
* @returns {Group}
|
|
479
|
+
*/
|
|
480
|
+
toGroup() {
|
|
481
|
+
const ret = wasm.address_toGroup(this.__wbg_ptr);
|
|
482
|
+
return Group.__wrap(ret);
|
|
483
|
+
}
|
|
339
484
|
/**
|
|
340
485
|
* Create an aleo address object from a string representation of an address
|
|
341
486
|
*
|
|
@@ -373,6 +518,14 @@ class Address {
|
|
|
373
518
|
wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
|
|
374
519
|
}
|
|
375
520
|
}
|
|
521
|
+
/**
|
|
522
|
+
* Get the plaintext representation of the address.
|
|
523
|
+
* @returns {Plaintext}
|
|
524
|
+
*/
|
|
525
|
+
toPlaintext() {
|
|
526
|
+
const ret = wasm.address_toPlaintext(this.__wbg_ptr);
|
|
527
|
+
return Plaintext.__wrap(ret);
|
|
528
|
+
}
|
|
376
529
|
/**
|
|
377
530
|
* Verify a signature for a message signed by the address
|
|
378
531
|
*
|
|
@@ -1140,6 +1293,100 @@ class Ciphertext {
|
|
|
1140
1293
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1141
1294
|
}
|
|
1142
1295
|
}
|
|
1296
|
+
/**
|
|
1297
|
+
* Get the left endian byte array representation of the ciphertext.
|
|
1298
|
+
* @returns {Uint8Array}
|
|
1299
|
+
*/
|
|
1300
|
+
toBytesLe() {
|
|
1301
|
+
try {
|
|
1302
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1303
|
+
wasm.ciphertext_toBytes(retptr, this.__wbg_ptr);
|
|
1304
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1305
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1306
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1307
|
+
if (r2) {
|
|
1308
|
+
throw takeObject(r1);
|
|
1309
|
+
}
|
|
1310
|
+
return takeObject(r0);
|
|
1311
|
+
} finally {
|
|
1312
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1315
|
+
/**
|
|
1316
|
+
* Get a ciphertext object from a series of bits represented as a boolean array.
|
|
1317
|
+
*
|
|
1318
|
+
* @param {Array} bits A left endian boolean array representing the bits of the ciphertext.
|
|
1319
|
+
*
|
|
1320
|
+
* @returns {Ciphertext} The ciphertext object.
|
|
1321
|
+
* @param {Array<any>} bits
|
|
1322
|
+
* @returns {Ciphertext}
|
|
1323
|
+
*/
|
|
1324
|
+
static fromBitsLe(bits) {
|
|
1325
|
+
try {
|
|
1326
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1327
|
+
wasm.ciphertext_fromBitsLe(retptr, addHeapObject(bits));
|
|
1328
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1329
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1330
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1331
|
+
if (r2) {
|
|
1332
|
+
throw takeObject(r1);
|
|
1333
|
+
}
|
|
1334
|
+
return Ciphertext.__wrap(r0);
|
|
1335
|
+
} finally {
|
|
1336
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
/**
|
|
1340
|
+
* Get the left endian boolean array representation of the bits of the ciphertext.
|
|
1341
|
+
* @returns {Array<any>}
|
|
1342
|
+
*/
|
|
1343
|
+
toBitsLe() {
|
|
1344
|
+
const ret = wasm.ciphertext_toBitsLe(this.__wbg_ptr);
|
|
1345
|
+
return takeObject(ret);
|
|
1346
|
+
}
|
|
1347
|
+
/**
|
|
1348
|
+
* Get a ciphertext object from an array of fields.
|
|
1349
|
+
*
|
|
1350
|
+
* @param {Array} fields An array of fields.
|
|
1351
|
+
*
|
|
1352
|
+
* @returns {Ciphertext} The ciphertext object.
|
|
1353
|
+
* @param {Array<any>} fields
|
|
1354
|
+
* @returns {Ciphertext}
|
|
1355
|
+
*/
|
|
1356
|
+
static fromFields(fields) {
|
|
1357
|
+
try {
|
|
1358
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1359
|
+
wasm.ciphertext_fromFields(retptr, addHeapObject(fields));
|
|
1360
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1361
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1362
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1363
|
+
if (r2) {
|
|
1364
|
+
throw takeObject(r1);
|
|
1365
|
+
}
|
|
1366
|
+
return Ciphertext.__wrap(r0);
|
|
1367
|
+
} finally {
|
|
1368
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
/**
|
|
1372
|
+
* Get the field array representation of the ciphertext.
|
|
1373
|
+
* @returns {Array<any>}
|
|
1374
|
+
*/
|
|
1375
|
+
toFields() {
|
|
1376
|
+
try {
|
|
1377
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1378
|
+
wasm.ciphertext_toFields(retptr, this.__wbg_ptr);
|
|
1379
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1380
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1381
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1382
|
+
if (r2) {
|
|
1383
|
+
throw takeObject(r1);
|
|
1384
|
+
}
|
|
1385
|
+
return takeObject(r0);
|
|
1386
|
+
} finally {
|
|
1387
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1143
1390
|
/**
|
|
1144
1391
|
* Deserialize a Ciphertext string into a Ciphertext object.
|
|
1145
1392
|
*
|
|
@@ -1277,7 +1524,7 @@ class ComputeKey {
|
|
|
1277
1524
|
* @returns {Group}
|
|
1278
1525
|
*/
|
|
1279
1526
|
pk_sig() {
|
|
1280
|
-
const ret = wasm.
|
|
1527
|
+
const ret = wasm.address_toGroup(this.__wbg_ptr);
|
|
1281
1528
|
return Group.__wrap(ret);
|
|
1282
1529
|
}
|
|
1283
1530
|
/**
|
|
@@ -2024,9 +2271,28 @@ class Group {
|
|
|
2024
2271
|
* @returns {Array<any>}
|
|
2025
2272
|
*/
|
|
2026
2273
|
toBitsLe() {
|
|
2027
|
-
const ret = wasm.
|
|
2274
|
+
const ret = wasm.address_toBitsLe(this.__wbg_ptr);
|
|
2028
2275
|
return takeObject(ret);
|
|
2029
2276
|
}
|
|
2277
|
+
/**
|
|
2278
|
+
* Get the field array representation of the group.
|
|
2279
|
+
* @returns {Array<any>}
|
|
2280
|
+
*/
|
|
2281
|
+
toFields() {
|
|
2282
|
+
try {
|
|
2283
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2284
|
+
wasm.group_toFields(retptr, this.__wbg_ptr);
|
|
2285
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2286
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2287
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2288
|
+
if (r2) {
|
|
2289
|
+
throw takeObject(r1);
|
|
2290
|
+
}
|
|
2291
|
+
return takeObject(r0);
|
|
2292
|
+
} finally {
|
|
2293
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2294
|
+
}
|
|
2295
|
+
}
|
|
2030
2296
|
/**
|
|
2031
2297
|
* Get the x-coordinate of the group element.
|
|
2032
2298
|
* @returns {Field}
|
|
@@ -3030,9 +3296,7 @@ class Plaintext {
|
|
|
3030
3296
|
}
|
|
3031
3297
|
}
|
|
3032
3298
|
/**
|
|
3033
|
-
*
|
|
3034
|
-
*
|
|
3035
|
-
* @param {Uint8Array} bytes A left endian byte array representing the plaintext.
|
|
3299
|
+
* Get the left endian byte array representation of the plaintext.
|
|
3036
3300
|
* @returns {Uint8Array}
|
|
3037
3301
|
*/
|
|
3038
3302
|
toBytesLe() {
|
|
@@ -3050,6 +3314,81 @@ class Plaintext {
|
|
|
3050
3314
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3051
3315
|
}
|
|
3052
3316
|
}
|
|
3317
|
+
/**
|
|
3318
|
+
* Get a plaintext object from a series of bits represented as a boolean array.
|
|
3319
|
+
*
|
|
3320
|
+
* @param {Array} bits A left endian boolean array representing the bits plaintext.
|
|
3321
|
+
*
|
|
3322
|
+
* @returns {Plaintext} The plaintext object.
|
|
3323
|
+
* @param {Array<any>} bits
|
|
3324
|
+
* @returns {Plaintext}
|
|
3325
|
+
*/
|
|
3326
|
+
static fromBitsLe(bits) {
|
|
3327
|
+
try {
|
|
3328
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3329
|
+
wasm.plaintext_fromBitsLe(retptr, addHeapObject(bits));
|
|
3330
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3331
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3332
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3333
|
+
if (r2) {
|
|
3334
|
+
throw takeObject(r1);
|
|
3335
|
+
}
|
|
3336
|
+
return Plaintext.__wrap(r0);
|
|
3337
|
+
} finally {
|
|
3338
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3339
|
+
}
|
|
3340
|
+
}
|
|
3341
|
+
/**
|
|
3342
|
+
* Get the left endian boolean array representation of the bits of the plaintext.
|
|
3343
|
+
* @returns {Array<any>}
|
|
3344
|
+
*/
|
|
3345
|
+
toBitsLe() {
|
|
3346
|
+
const ret = wasm.plaintext_toBitsLe(this.__wbg_ptr);
|
|
3347
|
+
return takeObject(ret);
|
|
3348
|
+
}
|
|
3349
|
+
/**
|
|
3350
|
+
* Get a plaintext object from an array of fields.
|
|
3351
|
+
*
|
|
3352
|
+
* @param {Array} fields An array of fields.
|
|
3353
|
+
*
|
|
3354
|
+
* @returns {Plaintext} The plaintext object.
|
|
3355
|
+
* @param {Array<any>} fields
|
|
3356
|
+
* @returns {Plaintext}
|
|
3357
|
+
*/
|
|
3358
|
+
static fromFields(fields) {
|
|
3359
|
+
try {
|
|
3360
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3361
|
+
wasm.plaintext_fromFields(retptr, addHeapObject(fields));
|
|
3362
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3363
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3364
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3365
|
+
if (r2) {
|
|
3366
|
+
throw takeObject(r1);
|
|
3367
|
+
}
|
|
3368
|
+
return Plaintext.__wrap(r0);
|
|
3369
|
+
} finally {
|
|
3370
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3371
|
+
}
|
|
3372
|
+
}
|
|
3373
|
+
/**
|
|
3374
|
+
* Get the field array representation of the plaintext.
|
|
3375
|
+
* @returns {Array<any>}
|
|
3376
|
+
*/
|
|
3377
|
+
toFields() {
|
|
3378
|
+
try {
|
|
3379
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3380
|
+
wasm.plaintext_toFields(retptr, this.__wbg_ptr);
|
|
3381
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3382
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3383
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3384
|
+
if (r2) {
|
|
3385
|
+
throw takeObject(r1);
|
|
3386
|
+
}
|
|
3387
|
+
return takeObject(r0);
|
|
3388
|
+
} finally {
|
|
3389
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3390
|
+
}
|
|
3391
|
+
}
|
|
3053
3392
|
/**
|
|
3054
3393
|
* Returns the string representation of the plaintext.
|
|
3055
3394
|
*
|
|
@@ -4325,7 +4664,7 @@ class ProgramManager {
|
|
|
4325
4664
|
* form \{"program_name1": "program_source_code", "program_name2": "program_source_code", ..\}.
|
|
4326
4665
|
* Note that all imported programs must be deployed on chain before the main program in order
|
|
4327
4666
|
* for the deployment to succeed
|
|
4328
|
-
* @param
|
|
4667
|
+
* @param priority_fee_credits The optional priority fee to be paid for the transaction
|
|
4329
4668
|
* @param fee_record The record to spend the fee from
|
|
4330
4669
|
* @param url The url of the Aleo network node to send the transaction to
|
|
4331
4670
|
* @param imports (optional) Provide a list of imports to use for the program deployment in the
|
|
@@ -4336,7 +4675,7 @@ class ProgramManager {
|
|
|
4336
4675
|
* @returns {Transaction}
|
|
4337
4676
|
* @param {PrivateKey} private_key
|
|
4338
4677
|
* @param {string} program
|
|
4339
|
-
* @param {number}
|
|
4678
|
+
* @param {number} priority_fee_credits
|
|
4340
4679
|
* @param {RecordPlaintext | null} [fee_record]
|
|
4341
4680
|
* @param {string | null} [url]
|
|
4342
4681
|
* @param {object | null} [imports]
|
|
@@ -4345,7 +4684,7 @@ class ProgramManager {
|
|
|
4345
4684
|
* @param {OfflineQuery | null} [offline_query]
|
|
4346
4685
|
* @returns {Promise<Transaction>}
|
|
4347
4686
|
*/
|
|
4348
|
-
static buildDeploymentTransaction(private_key, program,
|
|
4687
|
+
static buildDeploymentTransaction(private_key, program, priority_fee_credits, fee_record, url, imports, fee_proving_key, fee_verifying_key, offline_query) {
|
|
4349
4688
|
_assertClass(private_key, PrivateKey);
|
|
4350
4689
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
4351
4690
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -4371,7 +4710,7 @@ class ProgramManager {
|
|
|
4371
4710
|
_assertClass(offline_query, OfflineQuery);
|
|
4372
4711
|
ptr5 = offline_query.__destroy_into_raw();
|
|
4373
4712
|
}
|
|
4374
|
-
const ret = wasm.programmanager_buildDeploymentTransaction(private_key.__wbg_ptr, ptr0, len0,
|
|
4713
|
+
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);
|
|
4375
4714
|
return takeObject(ret);
|
|
4376
4715
|
}
|
|
4377
4716
|
/**
|
|
@@ -4488,7 +4827,7 @@ class ProgramManager {
|
|
|
4488
4827
|
* @param program The source code of the program being executed
|
|
4489
4828
|
* @param function The name of the function to execute
|
|
4490
4829
|
* @param inputs A javascript array of inputs to the function
|
|
4491
|
-
* @param
|
|
4830
|
+
* @param priority_fee_credits The optional priority fee to be paid for the transaction
|
|
4492
4831
|
* @param fee_record The record to spend the fee from
|
|
4493
4832
|
* @param url The url of the Aleo network node to send the transaction to
|
|
4494
4833
|
* If this is set to 'true' the keys synthesized (or passed in as optional parameters via the
|
|
@@ -4507,7 +4846,7 @@ class ProgramManager {
|
|
|
4507
4846
|
* @param {string} program
|
|
4508
4847
|
* @param {string} _function
|
|
4509
4848
|
* @param {Array<any>} inputs
|
|
4510
|
-
* @param {number}
|
|
4849
|
+
* @param {number} priority_fee_credits
|
|
4511
4850
|
* @param {RecordPlaintext | null} [fee_record]
|
|
4512
4851
|
* @param {string | null} [url]
|
|
4513
4852
|
* @param {object | null} [imports]
|
|
@@ -4518,7 +4857,7 @@ class ProgramManager {
|
|
|
4518
4857
|
* @param {OfflineQuery | null} [offline_query]
|
|
4519
4858
|
* @returns {Promise<Transaction>}
|
|
4520
4859
|
*/
|
|
4521
|
-
static buildExecutionTransaction(private_key, program, _function, inputs,
|
|
4860
|
+
static buildExecutionTransaction(private_key, program, _function, inputs, priority_fee_credits, fee_record, url, imports, proving_key, verifying_key, fee_proving_key, fee_verifying_key, offline_query) {
|
|
4522
4861
|
_assertClass(private_key, PrivateKey);
|
|
4523
4862
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
4524
4863
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -4556,7 +4895,7 @@ class ProgramManager {
|
|
|
4556
4895
|
_assertClass(offline_query, OfflineQuery);
|
|
4557
4896
|
ptr8 = offline_query.__destroy_into_raw();
|
|
4558
4897
|
}
|
|
4559
|
-
const ret = wasm.programmanager_buildExecutionTransaction(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs),
|
|
4898
|
+
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);
|
|
4560
4899
|
return takeObject(ret);
|
|
4561
4900
|
}
|
|
4562
4901
|
/**
|
|
@@ -4654,7 +4993,7 @@ class ProgramManager {
|
|
|
4654
4993
|
* @param private_key The private key of the sender
|
|
4655
4994
|
* @param record_1 The first record to combine
|
|
4656
4995
|
* @param record_2 The second record to combine
|
|
4657
|
-
* @param
|
|
4996
|
+
* @param priority_fee_credits The opptional priority fee to be paid for the transaction
|
|
4658
4997
|
* @param fee_record The record to spend the fee from
|
|
4659
4998
|
* @param url The url of the Aleo network node to send the transaction to
|
|
4660
4999
|
* @param join_proving_key (optional) Provide a proving key to use for the join function
|
|
@@ -4665,7 +5004,7 @@ class ProgramManager {
|
|
|
4665
5004
|
* @param {PrivateKey} private_key
|
|
4666
5005
|
* @param {RecordPlaintext} record_1
|
|
4667
5006
|
* @param {RecordPlaintext} record_2
|
|
4668
|
-
* @param {number}
|
|
5007
|
+
* @param {number} priority_fee_credits
|
|
4669
5008
|
* @param {RecordPlaintext | null} [fee_record]
|
|
4670
5009
|
* @param {string | null} [url]
|
|
4671
5010
|
* @param {ProvingKey | null} [join_proving_key]
|
|
@@ -4675,7 +5014,7 @@ class ProgramManager {
|
|
|
4675
5014
|
* @param {OfflineQuery | null} [offline_query]
|
|
4676
5015
|
* @returns {Promise<Transaction>}
|
|
4677
5016
|
*/
|
|
4678
|
-
static buildJoinTransaction(private_key, record_1, record_2,
|
|
5017
|
+
static buildJoinTransaction(private_key, record_1, record_2, priority_fee_credits, fee_record, url, join_proving_key, join_verifying_key, fee_proving_key, fee_verifying_key, offline_query) {
|
|
4679
5018
|
_assertClass(private_key, PrivateKey);
|
|
4680
5019
|
_assertClass(record_1, RecordPlaintext);
|
|
4681
5020
|
var ptr0 = record_1.__destroy_into_raw();
|
|
@@ -4713,7 +5052,7 @@ class ProgramManager {
|
|
|
4713
5052
|
_assertClass(offline_query, OfflineQuery);
|
|
4714
5053
|
ptr8 = offline_query.__destroy_into_raw();
|
|
4715
5054
|
}
|
|
4716
|
-
const ret = wasm.programmanager_buildJoinTransaction(private_key.__wbg_ptr, ptr0, ptr1,
|
|
5055
|
+
const ret = wasm.programmanager_buildJoinTransaction(private_key.__wbg_ptr, ptr0, ptr1, priority_fee_credits, ptr2, ptr3, len3, ptr4, ptr5, ptr6, ptr7, ptr8);
|
|
4717
5056
|
return takeObject(ret);
|
|
4718
5057
|
}
|
|
4719
5058
|
/**
|
|
@@ -4768,7 +5107,7 @@ class ProgramManager {
|
|
|
4768
5107
|
* @param recipient The recipient of the transaction
|
|
4769
5108
|
* @param transfer_type The type of the transfer (options: "private", "public", "private_to_public", "public_to_private")
|
|
4770
5109
|
* @param amount_record The record to fund the amount from
|
|
4771
|
-
* @param
|
|
5110
|
+
* @param priority_fee_credits The optional priority fee to be paid for the transaction
|
|
4772
5111
|
* @param fee_record The record to spend the fee from
|
|
4773
5112
|
* @param url The url of the Aleo network node to send the transaction to
|
|
4774
5113
|
* @param transfer_verifying_key (optional) Provide a verifying key to use for the transfer
|
|
@@ -4781,7 +5120,7 @@ class ProgramManager {
|
|
|
4781
5120
|
* @param {string} recipient
|
|
4782
5121
|
* @param {string} transfer_type
|
|
4783
5122
|
* @param {RecordPlaintext | null | undefined} amount_record
|
|
4784
|
-
* @param {number}
|
|
5123
|
+
* @param {number} priority_fee_credits
|
|
4785
5124
|
* @param {RecordPlaintext | null} [fee_record]
|
|
4786
5125
|
* @param {string | null} [url]
|
|
4787
5126
|
* @param {ProvingKey | null} [transfer_proving_key]
|
|
@@ -4791,7 +5130,7 @@ class ProgramManager {
|
|
|
4791
5130
|
* @param {OfflineQuery | null} [offline_query]
|
|
4792
5131
|
* @returns {Promise<Transaction>}
|
|
4793
5132
|
*/
|
|
4794
|
-
static buildTransferTransaction(private_key, amount_credits, recipient, transfer_type, amount_record,
|
|
5133
|
+
static buildTransferTransaction(private_key, amount_credits, recipient, transfer_type, amount_record, priority_fee_credits, fee_record, url, transfer_proving_key, transfer_verifying_key, fee_proving_key, fee_verifying_key, offline_query) {
|
|
4795
5134
|
_assertClass(private_key, PrivateKey);
|
|
4796
5135
|
const ptr0 = passStringToWasm0(recipient, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
4797
5136
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -4834,7 +5173,7 @@ class ProgramManager {
|
|
|
4834
5173
|
_assertClass(offline_query, OfflineQuery);
|
|
4835
5174
|
ptr9 = offline_query.__destroy_into_raw();
|
|
4836
5175
|
}
|
|
4837
|
-
const ret = wasm.programmanager_buildTransferTransaction(private_key.__wbg_ptr, amount_credits, ptr0, len0, ptr1, len1, ptr2,
|
|
5176
|
+
const ret = wasm.programmanager_buildTransferTransaction(private_key.__wbg_ptr, amount_credits, ptr0, len0, ptr1, len1, ptr2, priority_fee_credits, ptr3, ptr4, len4, ptr5, ptr6, ptr7, ptr8, ptr9);
|
|
4838
5177
|
return takeObject(ret);
|
|
4839
5178
|
}
|
|
4840
5179
|
/**
|
|
@@ -5369,6 +5708,76 @@ class RecordCiphertext {
|
|
|
5369
5708
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5370
5709
|
}
|
|
5371
5710
|
}
|
|
5711
|
+
/**
|
|
5712
|
+
* Get a record ciphertext object from a series of bytes.
|
|
5713
|
+
*
|
|
5714
|
+
* @param {Uint8Array} bytes A left endian byte array representing the record ciphertext.
|
|
5715
|
+
*
|
|
5716
|
+
* @returns {RecordCiphertext}
|
|
5717
|
+
* @param {Uint8Array} bytes
|
|
5718
|
+
* @returns {RecordCiphertext}
|
|
5719
|
+
*/
|
|
5720
|
+
static fromBytesLe(bytes) {
|
|
5721
|
+
try {
|
|
5722
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5723
|
+
wasm.recordciphertext_fromBytesLe(retptr, addHeapObject(bytes));
|
|
5724
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5725
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5726
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
5727
|
+
if (r2) {
|
|
5728
|
+
throw takeObject(r1);
|
|
5729
|
+
}
|
|
5730
|
+
return RecordCiphertext.__wrap(r0);
|
|
5731
|
+
} finally {
|
|
5732
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5733
|
+
}
|
|
5734
|
+
}
|
|
5735
|
+
/**
|
|
5736
|
+
* Get the left endian byte array representation of the record ciphertext.
|
|
5737
|
+
* @returns {Uint8Array}
|
|
5738
|
+
*/
|
|
5739
|
+
toBytesLe() {
|
|
5740
|
+
try {
|
|
5741
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5742
|
+
wasm.recordciphertext_toBytesLe(retptr, this.__wbg_ptr);
|
|
5743
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5744
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5745
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
5746
|
+
if (r2) {
|
|
5747
|
+
throw takeObject(r1);
|
|
5748
|
+
}
|
|
5749
|
+
return takeObject(r0);
|
|
5750
|
+
} finally {
|
|
5751
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5752
|
+
}
|
|
5753
|
+
}
|
|
5754
|
+
/**
|
|
5755
|
+
* Get the left endian boolean array representation of the record ciphertext bits.
|
|
5756
|
+
* @returns {Array<any>}
|
|
5757
|
+
*/
|
|
5758
|
+
toBitsLe() {
|
|
5759
|
+
const ret = wasm.recordciphertext_toBitsLe(this.__wbg_ptr);
|
|
5760
|
+
return takeObject(ret);
|
|
5761
|
+
}
|
|
5762
|
+
/**
|
|
5763
|
+
* Get the field array representation of the record ciphertext.
|
|
5764
|
+
* @returns {Array<any>}
|
|
5765
|
+
*/
|
|
5766
|
+
toFields() {
|
|
5767
|
+
try {
|
|
5768
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5769
|
+
wasm.recordciphertext_toFields(retptr, this.__wbg_ptr);
|
|
5770
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5771
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5772
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
5773
|
+
if (r2) {
|
|
5774
|
+
throw takeObject(r1);
|
|
5775
|
+
}
|
|
5776
|
+
return takeObject(r0);
|
|
5777
|
+
} finally {
|
|
5778
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5779
|
+
}
|
|
5780
|
+
}
|
|
5372
5781
|
}
|
|
5373
5782
|
|
|
5374
5783
|
const RecordPlaintextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -5576,6 +5985,80 @@ class RecordPlaintext {
|
|
|
5576
5985
|
wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
|
|
5577
5986
|
}
|
|
5578
5987
|
}
|
|
5988
|
+
/**
|
|
5989
|
+
* Get a record plaintext object from a series of bytes.
|
|
5990
|
+
*
|
|
5991
|
+
* @param {Uint8Array} bytes A left endian byte array representing the record plaintext.
|
|
5992
|
+
*
|
|
5993
|
+
* @returns {RecordPlaintext} The record plaintext.
|
|
5994
|
+
* @param {Uint8Array} bytes
|
|
5995
|
+
* @returns {RecordPlaintext}
|
|
5996
|
+
*/
|
|
5997
|
+
static fromBytesLe(bytes) {
|
|
5998
|
+
try {
|
|
5999
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
6000
|
+
wasm.recordplaintext_fromBytesLe(retptr, addHeapObject(bytes));
|
|
6001
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
6002
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
6003
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
6004
|
+
if (r2) {
|
|
6005
|
+
throw takeObject(r1);
|
|
6006
|
+
}
|
|
6007
|
+
return RecordPlaintext.__wrap(r0);
|
|
6008
|
+
} finally {
|
|
6009
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
6010
|
+
}
|
|
6011
|
+
}
|
|
6012
|
+
/**
|
|
6013
|
+
* Returns the left endian byte array representation of the record plaintext.
|
|
6014
|
+
*
|
|
6015
|
+
* @returns {Uint8Array} Byte array representation of the record plaintext.
|
|
6016
|
+
* @returns {Uint8Array}
|
|
6017
|
+
*/
|
|
6018
|
+
toBytesLe() {
|
|
6019
|
+
try {
|
|
6020
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
6021
|
+
wasm.recordplaintext_toBytesLe(retptr, this.__wbg_ptr);
|
|
6022
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
6023
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
6024
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
6025
|
+
if (r2) {
|
|
6026
|
+
throw takeObject(r1);
|
|
6027
|
+
}
|
|
6028
|
+
return takeObject(r0);
|
|
6029
|
+
} finally {
|
|
6030
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
6031
|
+
}
|
|
6032
|
+
}
|
|
6033
|
+
/**
|
|
6034
|
+
* Returns the left endian boolean array representation of the record plaintext bits.
|
|
6035
|
+
*
|
|
6036
|
+
* @returns {Array} Boolean array representation of the record plaintext bits.
|
|
6037
|
+
* @returns {Array<any>}
|
|
6038
|
+
*/
|
|
6039
|
+
toBitsLe() {
|
|
6040
|
+
const ret = wasm.recordplaintext_toBitsLe(this.__wbg_ptr);
|
|
6041
|
+
return takeObject(ret);
|
|
6042
|
+
}
|
|
6043
|
+
/**
|
|
6044
|
+
* Get the field array representation of the record plaintext.
|
|
6045
|
+
* @returns {Array<any>}
|
|
6046
|
+
*/
|
|
6047
|
+
toFields() {
|
|
6048
|
+
try {
|
|
6049
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
6050
|
+
wasm.recordplaintext_toFields(retptr, this.__wbg_ptr);
|
|
6051
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
6052
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
6053
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
6054
|
+
if (r2) {
|
|
6055
|
+
throw takeObject(r1);
|
|
6056
|
+
}
|
|
6057
|
+
return takeObject(r0);
|
|
6058
|
+
} finally {
|
|
6059
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
6060
|
+
}
|
|
6061
|
+
}
|
|
5579
6062
|
/**
|
|
5580
6063
|
* Returns the amount of microcredits in the record
|
|
5581
6064
|
*
|
|
@@ -6019,6 +6502,100 @@ class Signature {
|
|
|
6019
6502
|
const ret = wasm.signature_verify(this.__wbg_ptr, address.__wbg_ptr, ptr0, len0);
|
|
6020
6503
|
return ret !== 0;
|
|
6021
6504
|
}
|
|
6505
|
+
/**
|
|
6506
|
+
* Get a signature from a series of bytes.
|
|
6507
|
+
*
|
|
6508
|
+
* @param {Uint8Array} bytes A left endian byte array representing the signature.
|
|
6509
|
+
*
|
|
6510
|
+
* @returns {Signature} The signature object.
|
|
6511
|
+
* @param {Uint8Array} bytes
|
|
6512
|
+
* @returns {Signature}
|
|
6513
|
+
*/
|
|
6514
|
+
static fromBytesLe(bytes) {
|
|
6515
|
+
try {
|
|
6516
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
6517
|
+
wasm.signature_fromBytesLe(retptr, addHeapObject(bytes));
|
|
6518
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
6519
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
6520
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
6521
|
+
if (r2) {
|
|
6522
|
+
throw takeObject(r1);
|
|
6523
|
+
}
|
|
6524
|
+
return Signature.__wrap(r0);
|
|
6525
|
+
} finally {
|
|
6526
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
6527
|
+
}
|
|
6528
|
+
}
|
|
6529
|
+
/**
|
|
6530
|
+
* Get the left endian byte array representation of the signature.
|
|
6531
|
+
* @returns {Uint8Array}
|
|
6532
|
+
*/
|
|
6533
|
+
toBytesLe() {
|
|
6534
|
+
try {
|
|
6535
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
6536
|
+
wasm.signature_toBytesLe(retptr, this.__wbg_ptr);
|
|
6537
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
6538
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
6539
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
6540
|
+
if (r2) {
|
|
6541
|
+
throw takeObject(r1);
|
|
6542
|
+
}
|
|
6543
|
+
return takeObject(r0);
|
|
6544
|
+
} finally {
|
|
6545
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
6546
|
+
}
|
|
6547
|
+
}
|
|
6548
|
+
/**
|
|
6549
|
+
* Get a signature from a series of bits represented as a boolean array.
|
|
6550
|
+
*
|
|
6551
|
+
* @param {Array} bits A left endian boolean array representing the bits of the signature.
|
|
6552
|
+
*
|
|
6553
|
+
* @returns {Signature} The signature object.
|
|
6554
|
+
* @param {Array<any>} bits
|
|
6555
|
+
* @returns {Signature}
|
|
6556
|
+
*/
|
|
6557
|
+
static fromBitsLe(bits) {
|
|
6558
|
+
try {
|
|
6559
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
6560
|
+
wasm.signature_fromBitsLe(retptr, addHeapObject(bits));
|
|
6561
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
6562
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
6563
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
6564
|
+
if (r2) {
|
|
6565
|
+
throw takeObject(r1);
|
|
6566
|
+
}
|
|
6567
|
+
return Signature.__wrap(r0);
|
|
6568
|
+
} finally {
|
|
6569
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
6570
|
+
}
|
|
6571
|
+
}
|
|
6572
|
+
/**
|
|
6573
|
+
* Get the left endian boolean array representation of the bits of the signature.
|
|
6574
|
+
* @returns {Array<any>}
|
|
6575
|
+
*/
|
|
6576
|
+
toBitsLe() {
|
|
6577
|
+
const ret = wasm.signature_toBitsLe(this.__wbg_ptr);
|
|
6578
|
+
return takeObject(ret);
|
|
6579
|
+
}
|
|
6580
|
+
/**
|
|
6581
|
+
* Get the field array representation of the signature.
|
|
6582
|
+
* @returns {Array<any>}
|
|
6583
|
+
*/
|
|
6584
|
+
toFields() {
|
|
6585
|
+
try {
|
|
6586
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
6587
|
+
wasm.signature_toFields(retptr, this.__wbg_ptr);
|
|
6588
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
6589
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
6590
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
6591
|
+
if (r2) {
|
|
6592
|
+
throw takeObject(r1);
|
|
6593
|
+
}
|
|
6594
|
+
return takeObject(r0);
|
|
6595
|
+
} finally {
|
|
6596
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
6597
|
+
}
|
|
6598
|
+
}
|
|
6022
6599
|
/**
|
|
6023
6600
|
* Get a signature from a string representation of a signature
|
|
6024
6601
|
*
|
|
@@ -6055,6 +6632,14 @@ class Signature {
|
|
|
6055
6632
|
wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
|
|
6056
6633
|
}
|
|
6057
6634
|
}
|
|
6635
|
+
/**
|
|
6636
|
+
* Get the plaintext representation of the signature.
|
|
6637
|
+
* @returns {Plaintext}
|
|
6638
|
+
*/
|
|
6639
|
+
toPlaintext() {
|
|
6640
|
+
const ret = wasm.signature_toPlaintext(this.__wbg_ptr);
|
|
6641
|
+
return Plaintext.__wrap(ret);
|
|
6642
|
+
}
|
|
6058
6643
|
}
|
|
6059
6644
|
|
|
6060
6645
|
const TransactionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -6677,7 +7262,7 @@ class Transition {
|
|
|
6677
7262
|
* @returns {Group}
|
|
6678
7263
|
*/
|
|
6679
7264
|
tpk() {
|
|
6680
|
-
const ret = wasm.
|
|
7265
|
+
const ret = wasm.address_toGroup(this.__wbg_ptr);
|
|
6681
7266
|
return Group.__wrap(ret);
|
|
6682
7267
|
}
|
|
6683
7268
|
/**
|
|
@@ -7445,6 +8030,10 @@ function __wbg_get_imports() {
|
|
|
7445
8030
|
const ret = KeyPair.__wrap(arg0);
|
|
7446
8031
|
return addHeapObject(ret);
|
|
7447
8032
|
};
|
|
8033
|
+
imports.wbg.__wbg_keys_5c77a08ddc2fb8a6 = function(arg0) {
|
|
8034
|
+
const ret = Object.keys(getObject(arg0));
|
|
8035
|
+
return addHeapObject(ret);
|
|
8036
|
+
};
|
|
7448
8037
|
imports.wbg.__wbg_length_a446193dc22c12f8 = function(arg0) {
|
|
7449
8038
|
const ret = getObject(arg0).length;
|
|
7450
8039
|
return ret;
|
|
@@ -7453,7 +8042,7 @@ function __wbg_get_imports() {
|
|
|
7453
8042
|
const ret = getObject(arg0).length;
|
|
7454
8043
|
return ret;
|
|
7455
8044
|
};
|
|
7456
|
-
imports.wbg.
|
|
8045
|
+
imports.wbg.__wbg_log_4a8c9f48971e8bbe = function(arg0, arg1) {
|
|
7457
8046
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
7458
8047
|
};
|
|
7459
8048
|
imports.wbg.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
|
|
@@ -7471,7 +8060,7 @@ function __wbg_get_imports() {
|
|
|
7471
8060
|
const a = state0.a;
|
|
7472
8061
|
state0.a = 0;
|
|
7473
8062
|
try {
|
|
7474
|
-
return
|
|
8063
|
+
return __wbg_adapter_526(a, state0.b, arg0, arg1);
|
|
7475
8064
|
} finally {
|
|
7476
8065
|
state0.a = a;
|
|
7477
8066
|
}
|
|
@@ -7650,7 +8239,7 @@ function __wbg_get_imports() {
|
|
|
7650
8239
|
const ret = Signature.__wrap(arg0);
|
|
7651
8240
|
return addHeapObject(ret);
|
|
7652
8241
|
};
|
|
7653
|
-
imports.wbg.
|
|
8242
|
+
imports.wbg.__wbg_spawnWorker_ea0d99567d890697 = function(arg0, arg1, arg2, arg3) {
|
|
7654
8243
|
const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
|
|
7655
8244
|
return addHeapObject(ret);
|
|
7656
8245
|
};
|
|
@@ -7770,12 +8359,12 @@ function __wbg_get_imports() {
|
|
|
7770
8359
|
const ret = false;
|
|
7771
8360
|
return ret;
|
|
7772
8361
|
};
|
|
7773
|
-
imports.wbg.
|
|
7774
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
8362
|
+
imports.wbg.__wbindgen_closure_wrapper6083 = function(arg0, arg1, arg2) {
|
|
8363
|
+
const ret = makeMutClosure(arg0, arg1, 519, __wbg_adapter_40);
|
|
7775
8364
|
return addHeapObject(ret);
|
|
7776
8365
|
};
|
|
7777
|
-
imports.wbg.
|
|
7778
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
8366
|
+
imports.wbg.__wbindgen_closure_wrapper6089 = function(arg0, arg1, arg2) {
|
|
8367
|
+
const ret = makeMutClosure(arg0, arg1, 519, __wbg_adapter_40);
|
|
7779
8368
|
return addHeapObject(ret);
|
|
7780
8369
|
};
|
|
7781
8370
|
imports.wbg.__wbindgen_is_function = function(arg0) {
|