@provablehq/wasm 0.9.2 → 0.9.4-offline

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.
@@ -209,11 +209,12 @@ function passArray8ToWasm0(arg, malloc) {
209
209
  * @param {VerifyingKey} verifying_key
210
210
  * @param {Program} program
211
211
  * @param {string} function_id
212
- * @param {object | null} [imports]
213
- * @param {object | null} [imported_verifying_keys]
212
+ * @param {object | null | undefined} imports
213
+ * @param {object | null | undefined} imported_verifying_keys
214
+ * @param {number} block_height
214
215
  * @returns {boolean}
215
216
  */
216
- function verifyFunctionExecution(execution, verifying_key, program, function_id, imports, imported_verifying_keys) {
217
+ function verifyFunctionExecution(execution, verifying_key, program, function_id, imports, imported_verifying_keys, block_height) {
217
218
  try {
218
219
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
219
220
  _assertClass(execution, Execution);
@@ -221,7 +222,7 @@ function verifyFunctionExecution(execution, verifying_key, program, function_id,
221
222
  _assertClass(program, Program);
222
223
  const ptr0 = passStringToWasm0(function_id, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
223
224
  const len0 = WASM_VECTOR_LEN;
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));
225
+ 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);
225
226
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
226
227
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
227
228
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -263,12 +264,16 @@ function initThreadPool(url, num_threads) {
263
264
  return takeObject(ret);
264
265
  }
265
266
 
266
- function __wbg_adapter_40(arg0, arg1, arg2) {
267
- wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2));
267
+ function __wbg_adapter_40(arg0, arg1) {
268
+ wasm.__wbindgen_export_6(arg0, arg1);
268
269
  }
269
270
 
270
- function __wbg_adapter_526(arg0, arg1, arg2, arg3) {
271
- wasm.__wbindgen_export_7(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
271
+ function __wbg_adapter_43(arg0, arg1, arg2) {
272
+ wasm.__wbindgen_export_7(arg0, arg1, addHeapObject(arg2));
273
+ }
274
+
275
+ function __wbg_adapter_606(arg0, arg1, arg2, arg3) {
276
+ wasm.__wbindgen_export_8(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
272
277
  }
273
278
 
274
279
  const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
@@ -544,6 +549,256 @@ class Address {
544
549
  }
545
550
  }
546
551
 
552
+ const AuthorizationFinalization = (typeof FinalizationRegistry === 'undefined')
553
+ ? { register: () => {}, unregister: () => {} }
554
+ : new FinalizationRegistry(ptr => wasm.__wbg_authorization_free(ptr >>> 0, 1));
555
+ /**
556
+ * Authorization object containing the authorization for a transaction.
557
+ */
558
+ class Authorization {
559
+
560
+ static __wrap(ptr) {
561
+ ptr = ptr >>> 0;
562
+ const obj = Object.create(Authorization.prototype);
563
+ obj.__wbg_ptr = ptr;
564
+ AuthorizationFinalization.register(obj, obj.__wbg_ptr, obj);
565
+ return obj;
566
+ }
567
+
568
+ __destroy_into_raw() {
569
+ const ptr = this.__wbg_ptr;
570
+ this.__wbg_ptr = 0;
571
+ AuthorizationFinalization.unregister(this);
572
+ return ptr;
573
+ }
574
+
575
+ free() {
576
+ const ptr = this.__destroy_into_raw();
577
+ wasm.__wbg_authorization_free(ptr, 0);
578
+ }
579
+ /**
580
+ * Create a new authorization from a request object.
581
+ *
582
+ * @param {ExecutionRequest} request The ExecutionRequest to build the authorization from.
583
+ * @param {ExecutionRequest} request
584
+ * @returns {Authorization}
585
+ */
586
+ static new(request) {
587
+ try {
588
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
589
+ _assertClass(request, ExecutionRequest);
590
+ var ptr0 = request.__destroy_into_raw();
591
+ wasm.authorization_new(retptr, ptr0);
592
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
593
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
594
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
595
+ if (r2) {
596
+ throw takeObject(r1);
597
+ }
598
+ return Authorization.__wrap(r0);
599
+ } finally {
600
+ wasm.__wbindgen_add_to_stack_pointer(16);
601
+ }
602
+ }
603
+ /**
604
+ * Returns a new and independent replica of the Authorization.
605
+ * @returns {Authorization}
606
+ */
607
+ replicate() {
608
+ const ret = wasm.authorization_replicate(this.__wbg_ptr);
609
+ return Authorization.__wrap(ret);
610
+ }
611
+ /**
612
+ * Returns the string representation of the Authorization.
613
+ * @returns {string}
614
+ */
615
+ toString() {
616
+ let deferred1_0;
617
+ let deferred1_1;
618
+ try {
619
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
620
+ wasm.authorization_toString(retptr, this.__wbg_ptr);
621
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
622
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
623
+ deferred1_0 = r0;
624
+ deferred1_1 = r1;
625
+ return getStringFromWasm0(r0, r1);
626
+ } finally {
627
+ wasm.__wbindgen_add_to_stack_pointer(16);
628
+ wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
629
+ }
630
+ }
631
+ /**
632
+ * Reconstructs an Authorization object from its string representation.
633
+ *
634
+ * @param {String} authorization The string representation of the Authorization.
635
+ * @param {string} authorization
636
+ * @returns {Authorization}
637
+ */
638
+ static fromString(authorization) {
639
+ try {
640
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
641
+ const ptr0 = passStringToWasm0(authorization, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
642
+ const len0 = WASM_VECTOR_LEN;
643
+ wasm.authorization_fromString(retptr, ptr0, len0);
644
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
645
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
646
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
647
+ if (r2) {
648
+ throw takeObject(r1);
649
+ }
650
+ return Authorization.__wrap(r0);
651
+ } finally {
652
+ wasm.__wbindgen_add_to_stack_pointer(16);
653
+ }
654
+ }
655
+ /**
656
+ * Returns the left-endian byte representation of the Authorization.
657
+ * @returns {Uint8Array}
658
+ */
659
+ toBytesLe() {
660
+ try {
661
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
662
+ wasm.authorization_toBytesLe(retptr, this.__wbg_ptr);
663
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
664
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
665
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
666
+ if (r2) {
667
+ throw takeObject(r1);
668
+ }
669
+ return takeObject(r0);
670
+ } finally {
671
+ wasm.__wbindgen_add_to_stack_pointer(16);
672
+ }
673
+ }
674
+ /**
675
+ * Creates an authorization object from a left-endian byte representation of an Authorization.
676
+ *
677
+ * @param {Uint8Array} bytes Left-endian bytes representing the Authorization.
678
+ * @param {Uint8Array} bytes
679
+ * @returns {Authorization}
680
+ */
681
+ static fromBytesLe(bytes) {
682
+ try {
683
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
684
+ wasm.authorization_fromBytesLe(retptr, addHeapObject(bytes));
685
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
686
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
687
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
688
+ if (r2) {
689
+ throw takeObject(r1);
690
+ }
691
+ return Authorization.__wrap(r0);
692
+ } finally {
693
+ wasm.__wbindgen_add_to_stack_pointer(16);
694
+ }
695
+ }
696
+ /**
697
+ * Check if an Authorization object is the same as another.
698
+ *
699
+ * @param {Authorization} other The Authorization object to determine equality with.
700
+ * @param {Authorization} other
701
+ * @returns {boolean}
702
+ */
703
+ equals(other) {
704
+ _assertClass(other, Authorization);
705
+ const ret = wasm.authorization_equals(this.__wbg_ptr, other.__wbg_ptr);
706
+ return ret !== 0;
707
+ }
708
+ /**
709
+ * Returns the number of `Request`s in the Authorization.
710
+ * @returns {number}
711
+ */
712
+ len() {
713
+ const ret = wasm.authorization_len(this.__wbg_ptr);
714
+ return ret >>> 0;
715
+ }
716
+ /**
717
+ * Return `true` if the Authorization is empty.
718
+ * @returns {boolean}
719
+ */
720
+ isEmpty() {
721
+ const ret = wasm.authorization_isEmpty(this.__wbg_ptr);
722
+ return ret !== 0;
723
+ }
724
+ /**
725
+ * Returns `true` if the Authorization is for `credits.aleo/fee_private`.
726
+ * @returns {boolean}
727
+ */
728
+ isFeePrivate() {
729
+ const ret = wasm.authorization_isFeePrivate(this.__wbg_ptr);
730
+ return ret !== 0;
731
+ }
732
+ /**
733
+ * Returns `true` if the Authorization is for `credits.aleo/fee_public`.
734
+ * @returns {boolean}
735
+ */
736
+ isFeePublic() {
737
+ const ret = wasm.authorization_isFeePublic(this.__wbg_ptr);
738
+ return ret !== 0;
739
+ }
740
+ /**
741
+ * Returns `true` if the Authorization is for `credits.aleo/split`.
742
+ * @returns {boolean}
743
+ */
744
+ isSplit() {
745
+ const ret = wasm.authorization_isSplit(this.__wbg_ptr);
746
+ return ret !== 0;
747
+ }
748
+ /**
749
+ * Insert a transition into the Authorization.
750
+ *
751
+ * @param {Transition} transition The transition object to insert into the Authorization.
752
+ * @param {Transition} transition
753
+ */
754
+ insertTransition(transition) {
755
+ try {
756
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
757
+ _assertClass(transition, Transition);
758
+ var ptr0 = transition.__destroy_into_raw();
759
+ wasm.authorization_insertTransition(retptr, this.__wbg_ptr, ptr0);
760
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
761
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
762
+ if (r1) {
763
+ throw takeObject(r0);
764
+ }
765
+ } finally {
766
+ wasm.__wbindgen_add_to_stack_pointer(16);
767
+ }
768
+ }
769
+ /**
770
+ * Get the transitions in an Authorization.
771
+ *
772
+ * @returns {Array<Transition>} Array of transition objects
773
+ * @returns {Array<any>}
774
+ */
775
+ transitions() {
776
+ const ret = wasm.authorization_transitions(this.__wbg_ptr);
777
+ return takeObject(ret);
778
+ }
779
+ /**
780
+ * Returns the execution ID for the Authorization.
781
+ *
782
+ * @returns {Field} The execution ID for the Authorization, call toString() after this result to get the string representation.
783
+ * @returns {Field}
784
+ */
785
+ toExecutionId() {
786
+ try {
787
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
788
+ wasm.authorization_toExecutionId(retptr, this.__wbg_ptr);
789
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
790
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
791
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
792
+ if (r2) {
793
+ throw takeObject(r1);
794
+ }
795
+ return Field.__wrap(r0);
796
+ } finally {
797
+ wasm.__wbindgen_add_to_stack_pointer(16);
798
+ }
799
+ }
800
+ }
801
+
547
802
  const BHP1024Finalization = (typeof FinalizationRegistry === 'undefined')
548
803
  ? { register: () => {}, unregister: () => {} }
549
804
  : new FinalizationRegistry(ptr => wasm.__wbg_bhp1024_free(ptr >>> 0, 1));
@@ -1120,105 +1375,360 @@ class BHP768 {
1120
1375
  }
1121
1376
  }
1122
1377
 
1123
- const CiphertextFinalization = (typeof FinalizationRegistry === 'undefined')
1378
+ const BooleanFinalization = (typeof FinalizationRegistry === 'undefined')
1124
1379
  ? { register: () => {}, unregister: () => {} }
1125
- : new FinalizationRegistry(ptr => wasm.__wbg_ciphertext_free(ptr >>> 0, 1));
1380
+ : new FinalizationRegistry(ptr => wasm.__wbg_boolean_free(ptr >>> 0, 1));
1126
1381
  /**
1127
- * SnarkVM Ciphertext object. A Ciphertext represents an symmetrically encrypted plaintext. This
1128
- * object provides decryption methods to recover the plaintext from the ciphertext (given the
1129
- * api consumer has the proper decryption materials).
1130
- *
1131
- * @example
1382
+ * Boolean element.
1132
1383
  */
1133
- class Ciphertext {
1384
+ class Boolean {
1134
1385
 
1135
1386
  static __wrap(ptr) {
1136
1387
  ptr = ptr >>> 0;
1137
- const obj = Object.create(Ciphertext.prototype);
1388
+ const obj = Object.create(Boolean.prototype);
1138
1389
  obj.__wbg_ptr = ptr;
1139
- CiphertextFinalization.register(obj, obj.__wbg_ptr, obj);
1390
+ BooleanFinalization.register(obj, obj.__wbg_ptr, obj);
1140
1391
  return obj;
1141
1392
  }
1142
1393
 
1143
1394
  __destroy_into_raw() {
1144
1395
  const ptr = this.__wbg_ptr;
1145
1396
  this.__wbg_ptr = 0;
1146
- CiphertextFinalization.unregister(this);
1397
+ BooleanFinalization.unregister(this);
1147
1398
  return ptr;
1148
1399
  }
1149
1400
 
1150
1401
  free() {
1151
1402
  const ptr = this.__destroy_into_raw();
1152
- wasm.__wbg_ciphertext_free(ptr, 0);
1403
+ wasm.__wbg_boolean_free(ptr, 0);
1153
1404
  }
1154
1405
  /**
1155
- * Decrypt the ciphertext using the given view key.
1156
- *
1157
- * @param {ViewKey} viewKey The view key of the account that encrypted the ciphertext.
1158
- * @param {Group} nonce The nonce used to encrypt the ciphertext.
1159
- *
1160
- * @returns {Plaintext} The decrypted plaintext.
1161
- * @param {ViewKey} view_key
1162
- * @param {Group} nonce
1163
- * @returns {Plaintext}
1406
+ * Creates a Boolean from a native JS bool.
1407
+ * @param {boolean} value
1164
1408
  */
1165
- decrypt(view_key, nonce) {
1409
+ constructor(value) {
1410
+ const ret = wasm.boolean_new(value);
1411
+ this.__wbg_ptr = ret >>> 0;
1412
+ BooleanFinalization.register(this, this.__wbg_ptr, this);
1413
+ return this;
1414
+ }
1415
+ /**
1416
+ * Creates a boolean object from a string representation ("true"/"false").
1417
+ * @param {string} boolean
1418
+ * @returns {Boolean}
1419
+ */
1420
+ static fromString(boolean) {
1166
1421
  try {
1167
1422
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1168
- _assertClass(view_key, ViewKey);
1169
- var ptr0 = view_key.__destroy_into_raw();
1170
- _assertClass(nonce, Group);
1171
- var ptr1 = nonce.__destroy_into_raw();
1172
- wasm.ciphertext_decrypt(retptr, this.__wbg_ptr, ptr0, ptr1);
1423
+ const ptr0 = passStringToWasm0(boolean, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
1424
+ const len0 = WASM_VECTOR_LEN;
1425
+ wasm.boolean_fromString(retptr, ptr0, len0);
1173
1426
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1174
1427
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1175
1428
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1176
1429
  if (r2) {
1177
1430
  throw takeObject(r1);
1178
1431
  }
1179
- return Plaintext.__wrap(r0);
1432
+ return Boolean.__wrap(r0);
1180
1433
  } finally {
1181
1434
  wasm.__wbindgen_add_to_stack_pointer(16);
1182
1435
  }
1183
1436
  }
1184
1437
  /**
1185
- * Decrypt a ciphertext using the view key of the transition signer, transition public key, and
1186
- * (program, function, index) tuple.
1187
- * @param {ViewKey} view_key
1188
- * @param {Group} transition_public_key
1189
- * @param {string} program
1190
- * @param {string} function_name
1191
- * @param {number} index
1192
- * @returns {Plaintext}
1438
+ * Returns the string representation of the boolean element.
1439
+ * @returns {string}
1193
1440
  */
1194
- decryptWithTransitionInfo(view_key, transition_public_key, program, function_name, index) {
1441
+ toString() {
1442
+ let deferred1_0;
1443
+ let deferred1_1;
1195
1444
  try {
1196
1445
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1197
- _assertClass(view_key, ViewKey);
1198
- var ptr0 = view_key.__destroy_into_raw();
1199
- _assertClass(transition_public_key, Group);
1200
- var ptr1 = transition_public_key.__destroy_into_raw();
1201
- const ptr2 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
1202
- const len2 = WASM_VECTOR_LEN;
1203
- const ptr3 = passStringToWasm0(function_name, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
1204
- const len3 = WASM_VECTOR_LEN;
1205
- wasm.ciphertext_decryptWithTransitionInfo(retptr, this.__wbg_ptr, ptr0, ptr1, ptr2, len2, ptr3, len3, index);
1446
+ wasm.boolean_toString(retptr, this.__wbg_ptr);
1447
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1448
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1449
+ deferred1_0 = r0;
1450
+ deferred1_1 = r1;
1451
+ return getStringFromWasm0(r0, r1);
1452
+ } finally {
1453
+ wasm.__wbindgen_add_to_stack_pointer(16);
1454
+ wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
1455
+ }
1456
+ }
1457
+ /**
1458
+ * Create a boolean element from a Uint8Array of left endian bytes.
1459
+ * @param {Uint8Array} bytes
1460
+ * @returns {Boolean}
1461
+ */
1462
+ static fromBytesLe(bytes) {
1463
+ try {
1464
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1465
+ wasm.boolean_fromBytesLe(retptr, addBorrowedObject(bytes));
1206
1466
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1207
1467
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1208
1468
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1209
1469
  if (r2) {
1210
1470
  throw takeObject(r1);
1211
1471
  }
1212
- return Plaintext.__wrap(r0);
1472
+ return Boolean.__wrap(r0);
1213
1473
  } finally {
1214
1474
  wasm.__wbindgen_add_to_stack_pointer(16);
1475
+ heap[stack_pointer++] = undefined;
1215
1476
  }
1216
1477
  }
1217
1478
  /**
1218
- * Decrypt a ciphertext using the transition view key and a (program, function, index) tuple.
1219
- * @param {Field} transition_view_key
1220
- * @param {string} program
1221
- * @param {string} function_name
1479
+ * Encode the boolean element as a Uint8Array of left endian bytes.
1480
+ * @returns {Uint8Array}
1481
+ */
1482
+ toBytesLe() {
1483
+ try {
1484
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1485
+ wasm.boolean_toBytesLe(retptr, this.__wbg_ptr);
1486
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1487
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1488
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1489
+ if (r2) {
1490
+ throw takeObject(r1);
1491
+ }
1492
+ return takeObject(r0);
1493
+ } finally {
1494
+ wasm.__wbindgen_add_to_stack_pointer(16);
1495
+ }
1496
+ }
1497
+ /**
1498
+ * Reconstruct a boolean element from a boolean array representation.
1499
+ * @param {Array<any>} bits
1500
+ * @returns {Boolean}
1501
+ */
1502
+ static fromBitsLe(bits) {
1503
+ try {
1504
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1505
+ wasm.boolean_fromBitsLe(retptr, addBorrowedObject(bits));
1506
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1507
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1508
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1509
+ if (r2) {
1510
+ throw takeObject(r1);
1511
+ }
1512
+ return Boolean.__wrap(r0);
1513
+ } finally {
1514
+ wasm.__wbindgen_add_to_stack_pointer(16);
1515
+ heap[stack_pointer++] = undefined;
1516
+ }
1517
+ }
1518
+ /**
1519
+ * Get the left endian boolean array representation of the boolean element.
1520
+ * @returns {Array<any>}
1521
+ */
1522
+ toBitsLe() {
1523
+ const ret = wasm.boolean_toBitsLe(this.__wbg_ptr);
1524
+ return takeObject(ret);
1525
+ }
1526
+ /**
1527
+ * Create a plaintext from the boolean element.
1528
+ * @returns {Plaintext}
1529
+ */
1530
+ toPlaintext() {
1531
+ const ret = wasm.boolean_toPlaintext(this.__wbg_ptr);
1532
+ return Plaintext.__wrap(ret);
1533
+ }
1534
+ /**
1535
+ * Clone the boolean element.
1536
+ * @returns {Boolean}
1537
+ */
1538
+ clone() {
1539
+ const ret = wasm.boolean_clone(this.__wbg_ptr);
1540
+ return Boolean.__wrap(ret);
1541
+ }
1542
+ /**
1543
+ * Generate a random boolean element.
1544
+ * @returns {Boolean}
1545
+ */
1546
+ static random() {
1547
+ const ret = wasm.boolean_random();
1548
+ return Boolean.__wrap(ret);
1549
+ }
1550
+ /**
1551
+ * Logical NOT.
1552
+ * @returns {Boolean}
1553
+ */
1554
+ not() {
1555
+ const ret = wasm.boolean_not(this.__wbg_ptr);
1556
+ return Boolean.__wrap(ret);
1557
+ }
1558
+ /**
1559
+ * Logical AND.
1560
+ * @param {Boolean} other
1561
+ * @returns {Boolean}
1562
+ */
1563
+ and(other) {
1564
+ _assertClass(other, Boolean);
1565
+ const ret = wasm.boolean_and(this.__wbg_ptr, other.__wbg_ptr);
1566
+ return Boolean.__wrap(ret);
1567
+ }
1568
+ /**
1569
+ * Logical OR.
1570
+ * @param {Boolean} other
1571
+ * @returns {Boolean}
1572
+ */
1573
+ or(other) {
1574
+ _assertClass(other, Boolean);
1575
+ const ret = wasm.boolean_or(this.__wbg_ptr, other.__wbg_ptr);
1576
+ return Boolean.__wrap(ret);
1577
+ }
1578
+ /**
1579
+ * Logical XOR.
1580
+ * @param {Boolean} other
1581
+ * @returns {Boolean}
1582
+ */
1583
+ xor(other) {
1584
+ _assertClass(other, Boolean);
1585
+ const ret = wasm.boolean_xor(this.__wbg_ptr, other.__wbg_ptr);
1586
+ return Boolean.__wrap(ret);
1587
+ }
1588
+ /**
1589
+ * Logical NAND.
1590
+ * @param {Boolean} other
1591
+ * @returns {Boolean}
1592
+ */
1593
+ nand(other) {
1594
+ _assertClass(other, Boolean);
1595
+ const ret = wasm.boolean_nand(this.__wbg_ptr, other.__wbg_ptr);
1596
+ return Boolean.__wrap(ret);
1597
+ }
1598
+ /**
1599
+ * Logical NOR.
1600
+ * @param {Boolean} other
1601
+ * @returns {Boolean}
1602
+ */
1603
+ nor(other) {
1604
+ _assertClass(other, Boolean);
1605
+ const ret = wasm.boolean_nor(this.__wbg_ptr, other.__wbg_ptr);
1606
+ return Boolean.__wrap(ret);
1607
+ }
1608
+ /**
1609
+ * Check if one boolean element equals another.
1610
+ * @param {Boolean} other
1611
+ * @returns {boolean}
1612
+ */
1613
+ equals(other) {
1614
+ _assertClass(other, Boolean);
1615
+ const ret = wasm.boolean_equals(this.__wbg_ptr, other.__wbg_ptr);
1616
+ return ret !== 0;
1617
+ }
1618
+ }
1619
+
1620
+ const CiphertextFinalization = (typeof FinalizationRegistry === 'undefined')
1621
+ ? { register: () => {}, unregister: () => {} }
1622
+ : new FinalizationRegistry(ptr => wasm.__wbg_ciphertext_free(ptr >>> 0, 1));
1623
+ /**
1624
+ * SnarkVM Ciphertext object. A Ciphertext represents an symmetrically encrypted plaintext. This
1625
+ * object provides decryption methods to recover the plaintext from the ciphertext (given the
1626
+ * api consumer has the proper decryption materials).
1627
+ */
1628
+ class Ciphertext {
1629
+
1630
+ static __wrap(ptr) {
1631
+ ptr = ptr >>> 0;
1632
+ const obj = Object.create(Ciphertext.prototype);
1633
+ obj.__wbg_ptr = ptr;
1634
+ CiphertextFinalization.register(obj, obj.__wbg_ptr, obj);
1635
+ return obj;
1636
+ }
1637
+
1638
+ __destroy_into_raw() {
1639
+ const ptr = this.__wbg_ptr;
1640
+ this.__wbg_ptr = 0;
1641
+ CiphertextFinalization.unregister(this);
1642
+ return ptr;
1643
+ }
1644
+
1645
+ free() {
1646
+ const ptr = this.__destroy_into_raw();
1647
+ wasm.__wbg_ciphertext_free(ptr, 0);
1648
+ }
1649
+ /**
1650
+ * Decrypt the ciphertext using the given view key.
1651
+ *
1652
+ * @param {ViewKey} viewKey The view key of the account that encrypted the ciphertext.
1653
+ * @param {Group} nonce The nonce used to encrypt the ciphertext.
1654
+ *
1655
+ * @returns {Plaintext} The decrypted plaintext.
1656
+ * @param {ViewKey} view_key
1657
+ * @param {Group} nonce
1658
+ * @returns {Plaintext}
1659
+ */
1660
+ decrypt(view_key, nonce) {
1661
+ try {
1662
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1663
+ _assertClass(view_key, ViewKey);
1664
+ var ptr0 = view_key.__destroy_into_raw();
1665
+ _assertClass(nonce, Group);
1666
+ var ptr1 = nonce.__destroy_into_raw();
1667
+ wasm.ciphertext_decrypt(retptr, this.__wbg_ptr, ptr0, ptr1);
1668
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1669
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1670
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1671
+ if (r2) {
1672
+ throw takeObject(r1);
1673
+ }
1674
+ return Plaintext.__wrap(r0);
1675
+ } finally {
1676
+ wasm.__wbindgen_add_to_stack_pointer(16);
1677
+ }
1678
+ }
1679
+ /**
1680
+ * Decrypt a ciphertext using the view key of the transition signer, transition public key, and
1681
+ * (program, function, index) tuple.
1682
+ *
1683
+ * @param {ViewKey} view_key The view key of the transition signer.
1684
+ * @param {Group} transition_public_key The transition public key used to encrypt the ciphertext.
1685
+ * @param {string} program The program ID associated with the ciphertext.
1686
+ * @param {string} function_name The name of the function associated with the encrypted inputs and outputs.
1687
+ * @param {u16} index The index of the input or output parameter that was encrypted.
1688
+ *
1689
+ * @returns {Plaintext} The decrypted plaintext.
1690
+ * @param {ViewKey} view_key
1691
+ * @param {Group} transition_public_key
1692
+ * @param {string} program
1693
+ * @param {string} function_name
1694
+ * @param {number} index
1695
+ * @returns {Plaintext}
1696
+ */
1697
+ decryptWithTransitionInfo(view_key, transition_public_key, program, function_name, index) {
1698
+ try {
1699
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1700
+ _assertClass(view_key, ViewKey);
1701
+ var ptr0 = view_key.__destroy_into_raw();
1702
+ _assertClass(transition_public_key, Group);
1703
+ var ptr1 = transition_public_key.__destroy_into_raw();
1704
+ const ptr2 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
1705
+ const len2 = WASM_VECTOR_LEN;
1706
+ const ptr3 = passStringToWasm0(function_name, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
1707
+ const len3 = WASM_VECTOR_LEN;
1708
+ wasm.ciphertext_decryptWithTransitionInfo(retptr, this.__wbg_ptr, ptr0, ptr1, ptr2, len2, ptr3, len3, index);
1709
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1710
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1711
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1712
+ if (r2) {
1713
+ throw takeObject(r1);
1714
+ }
1715
+ return Plaintext.__wrap(r0);
1716
+ } finally {
1717
+ wasm.__wbindgen_add_to_stack_pointer(16);
1718
+ }
1719
+ }
1720
+ /**
1721
+ * Decrypt a ciphertext using the transition view key and a (program, function, index) tuple.
1722
+ *
1723
+ * @param {Field} transition_view_key The transition view key that was used to encrypt the ciphertext.
1724
+ * @param {string} program The program ID associated with the ciphertext.
1725
+ * @param {string} function_name The name of the function associated with the encrypted inputs and outputs.
1726
+ * @param {u16} index The index of the input or output parameter that was encrypted.
1727
+ *
1728
+ * @returns {Plaintext} The decrypted plaintext.
1729
+ * @param {Field} transition_view_key
1730
+ * @param {string} program
1731
+ * @param {string} function_name
1222
1732
  * @param {number} index
1223
1733
  * @returns {Plaintext}
1224
1734
  */
@@ -1518,58 +2028,307 @@ class ComputeKey {
1518
2028
  return Scalar.__wrap(ret);
1519
2029
  }
1520
2030
  /**
1521
- * Get the pr_tag of the compute key.
2031
+ * Get the pr_tag of the compute key.
2032
+ *
2033
+ * @returns {Group} pr_tag
2034
+ * @returns {Group}
2035
+ */
2036
+ pk_sig() {
2037
+ const ret = wasm.address_toGroup(this.__wbg_ptr);
2038
+ return Group.__wrap(ret);
2039
+ }
2040
+ /**
2041
+ * Get the pr_sig of the compute key.
2042
+ *
2043
+ * @returns {Group} pr_sig
2044
+ * @returns {Group}
2045
+ */
2046
+ pr_sig() {
2047
+ const ret = wasm.computekey_pr_sig(this.__wbg_ptr);
2048
+ return Group.__wrap(ret);
2049
+ }
2050
+ }
2051
+
2052
+ const EncryptionToolkitFinalization = (typeof FinalizationRegistry === 'undefined')
2053
+ ? { register: () => {}, unregister: () => {} }
2054
+ : new FinalizationRegistry(ptr => wasm.__wbg_encryptiontoolkit_free(ptr >>> 0, 1));
2055
+
2056
+ class EncryptionToolkit {
2057
+
2058
+ __destroy_into_raw() {
2059
+ const ptr = this.__wbg_ptr;
2060
+ this.__wbg_ptr = 0;
2061
+ EncryptionToolkitFinalization.unregister(this);
2062
+ return ptr;
2063
+ }
2064
+
2065
+ free() {
2066
+ const ptr = this.__destroy_into_raw();
2067
+ wasm.__wbg_encryptiontoolkit_free(ptr, 0);
2068
+ }
2069
+ /**
2070
+ * Generates a transition view key from the view key and the transition public key.
2071
+ *
2072
+ * @param {ViewKey} view_key The view key of the account that generated the transition.
2073
+ * @param {Group} tpk The transition public key.
2074
+ *
2075
+ * @returns {Field} The transition view key.
2076
+ * @param {ViewKey} view_key
2077
+ * @param {Group} tpk
2078
+ * @returns {Field}
2079
+ */
2080
+ static generateTvk(view_key, tpk) {
2081
+ _assertClass(view_key, ViewKey);
2082
+ _assertClass(tpk, Group);
2083
+ const ret = wasm.encryptiontoolkit_generateTvk(view_key.__wbg_ptr, tpk.__wbg_ptr);
2084
+ return Field.__wrap(ret);
2085
+ }
2086
+ /**
2087
+ * Creates a record view key from the view key. This can be later be used to decrypt a
2088
+ *
2089
+ * @param {ViewKey} view_key The view key of the owner of the record.
2090
+ * @param {RecordCiphertext} record_ciphertext The record ciphertext used to derive the record view key.
2091
+ *
2092
+ * @returns {Field} The record view key.
2093
+ * @param {ViewKey} view_key
2094
+ * @param {RecordCiphertext} record_ciphertext
2095
+ * @returns {Field}
2096
+ */
2097
+ static generateRecordViewKey(view_key, record_ciphertext) {
2098
+ try {
2099
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2100
+ _assertClass(view_key, ViewKey);
2101
+ _assertClass(record_ciphertext, RecordCiphertext);
2102
+ wasm.encryptiontoolkit_generateRecordViewKey(retptr, view_key.__wbg_ptr, record_ciphertext.__wbg_ptr);
2103
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2104
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2105
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2106
+ if (r2) {
2107
+ throw takeObject(r1);
2108
+ }
2109
+ return Field.__wrap(r0);
2110
+ } finally {
2111
+ wasm.__wbindgen_add_to_stack_pointer(16);
2112
+ }
2113
+ }
2114
+ /**
2115
+ * Decrypts a record ciphertext using the record view key. Decryption only succeeds
2116
+ * if the record view key was generated from the view key of the record owner.
2117
+ *
2118
+ * @param {Field} record_vk The record view key.
2119
+ * @param {RecordCiphertext} record_ciphertext The record ciphertext to decrypt.
2120
+ *
2121
+ * @returns {RecordPlaintext} The decrypted record plaintext.
2122
+ * @param {Field} record_vk
2123
+ * @param {RecordCiphertext} record_ciphertext
2124
+ * @returns {RecordPlaintext}
2125
+ */
2126
+ static decryptRecordWithRVk(record_vk, record_ciphertext) {
2127
+ try {
2128
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2129
+ _assertClass(record_vk, Field);
2130
+ _assertClass(record_ciphertext, RecordCiphertext);
2131
+ wasm.encryptiontoolkit_decryptRecordWithRVk(retptr, record_vk.__wbg_ptr, record_ciphertext.__wbg_ptr);
2132
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2133
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2134
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2135
+ if (r2) {
2136
+ throw takeObject(r1);
2137
+ }
2138
+ return RecordPlaintext.__wrap(r0);
2139
+ } finally {
2140
+ wasm.__wbindgen_add_to_stack_pointer(16);
2141
+ }
2142
+ }
2143
+ /**
2144
+ * Decrypts a transition using the transition view key. The ciphertext inputs and outputs
2145
+ * can only be decrypted if the transition view key was generated by the transaction signer.
2146
+ *
2147
+ * @param {Transition} transition The transition to decrypt.
2148
+ * @param {Field} transition_vk The transition view key.
2149
+ *
2150
+ * @returns {Transition} The decrypted transition.
2151
+ * @param {Transition} transition
2152
+ * @param {Field} transition_vk
2153
+ * @returns {Transition}
2154
+ */
2155
+ static decryptTransitionWithVk(transition, transition_vk) {
2156
+ try {
2157
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2158
+ _assertClass(transition, Transition);
2159
+ _assertClass(transition_vk, Field);
2160
+ wasm.encryptiontoolkit_decryptTransitionWithVk(retptr, transition.__wbg_ptr, transition_vk.__wbg_ptr);
2161
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2162
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2163
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2164
+ if (r2) {
2165
+ throw takeObject(r1);
2166
+ }
2167
+ return Transition.__wrap(r0);
2168
+ } finally {
2169
+ wasm.__wbindgen_add_to_stack_pointer(16);
2170
+ }
2171
+ }
2172
+ }
2173
+
2174
+ const ExecutionFinalization = (typeof FinalizationRegistry === 'undefined')
2175
+ ? { register: () => {}, unregister: () => {} }
2176
+ : new FinalizationRegistry(ptr => wasm.__wbg_execution_free(ptr >>> 0, 1));
2177
+ /**
2178
+ * Execution of an Aleo program.
2179
+ */
2180
+ class Execution {
2181
+
2182
+ static __wrap(ptr) {
2183
+ ptr = ptr >>> 0;
2184
+ const obj = Object.create(Execution.prototype);
2185
+ obj.__wbg_ptr = ptr;
2186
+ ExecutionFinalization.register(obj, obj.__wbg_ptr, obj);
2187
+ return obj;
2188
+ }
2189
+
2190
+ __destroy_into_raw() {
2191
+ const ptr = this.__wbg_ptr;
2192
+ this.__wbg_ptr = 0;
2193
+ ExecutionFinalization.unregister(this);
2194
+ return ptr;
2195
+ }
2196
+
2197
+ free() {
2198
+ const ptr = this.__destroy_into_raw();
2199
+ wasm.__wbg_execution_free(ptr, 0);
2200
+ }
2201
+ /**
2202
+ * Returns the string representation of the execution.
2203
+ *
2204
+ * @returns {string} The string representation of the execution.
2205
+ * @returns {string}
2206
+ */
2207
+ toString() {
2208
+ let deferred1_0;
2209
+ let deferred1_1;
2210
+ try {
2211
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2212
+ wasm.execution_toString(retptr, this.__wbg_ptr);
2213
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2214
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2215
+ deferred1_0 = r0;
2216
+ deferred1_1 = r1;
2217
+ return getStringFromWasm0(r0, r1);
2218
+ } finally {
2219
+ wasm.__wbindgen_add_to_stack_pointer(16);
2220
+ wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
2221
+ }
2222
+ }
2223
+ /**
2224
+ * Creates an execution object from a string representation of an execution.
2225
+ *
2226
+ * @returns {Execution | Error} The wasm representation of an execution object.
2227
+ * @param {string} execution
2228
+ * @returns {Execution}
2229
+ */
2230
+ static fromString(execution) {
2231
+ try {
2232
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2233
+ const ptr0 = passStringToWasm0(execution, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
2234
+ const len0 = WASM_VECTOR_LEN;
2235
+ wasm.execution_fromString(retptr, ptr0, len0);
2236
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2237
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2238
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2239
+ if (r2) {
2240
+ throw takeObject(r1);
2241
+ }
2242
+ return Execution.__wrap(r0);
2243
+ } finally {
2244
+ wasm.__wbindgen_add_to_stack_pointer(16);
2245
+ }
2246
+ }
2247
+ /**
2248
+ * Returns the global state root of the execution.
2249
+ *
2250
+ * @returns {Execution | Error} The global state root used in the execution.
2251
+ * @returns {string}
2252
+ */
2253
+ globalStateRoot() {
2254
+ let deferred1_0;
2255
+ let deferred1_1;
2256
+ try {
2257
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2258
+ wasm.execution_globalStateRoot(retptr, this.__wbg_ptr);
2259
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2260
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2261
+ deferred1_0 = r0;
2262
+ deferred1_1 = r1;
2263
+ return getStringFromWasm0(r0, r1);
2264
+ } finally {
2265
+ wasm.__wbindgen_add_to_stack_pointer(16);
2266
+ wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
2267
+ }
2268
+ }
2269
+ /**
2270
+ * Returns the proof of the execution.
1522
2271
  *
1523
- * @returns {Group} pr_tag
1524
- * @returns {Group}
2272
+ * @returns {string} The execution proof.
2273
+ * @returns {string}
1525
2274
  */
1526
- pk_sig() {
1527
- const ret = wasm.address_toGroup(this.__wbg_ptr);
1528
- return Group.__wrap(ret);
2275
+ proof() {
2276
+ let deferred1_0;
2277
+ let deferred1_1;
2278
+ try {
2279
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2280
+ wasm.execution_proof(retptr, this.__wbg_ptr);
2281
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2282
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2283
+ deferred1_0 = r0;
2284
+ deferred1_1 = r1;
2285
+ return getStringFromWasm0(r0, r1);
2286
+ } finally {
2287
+ wasm.__wbindgen_add_to_stack_pointer(16);
2288
+ wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
2289
+ }
1529
2290
  }
1530
2291
  /**
1531
- * Get the pr_sig of the compute key.
2292
+ * Returns the transitions present in the execution.
1532
2293
  *
1533
- * @returns {Group} pr_sig
1534
- * @returns {Group}
2294
+ * @returns Array<Transition> the array of transitions present in the execution.
2295
+ * @returns {Array<any>}
1535
2296
  */
1536
- pr_sig() {
1537
- const ret = wasm.computekey_pr_sig(this.__wbg_ptr);
1538
- return Group.__wrap(ret);
2297
+ transitions() {
2298
+ const ret = wasm.execution_transitions(this.__wbg_ptr);
2299
+ return takeObject(ret);
1539
2300
  }
1540
2301
  }
1541
2302
 
1542
- const ExecutionFinalization = (typeof FinalizationRegistry === 'undefined')
2303
+ const ExecutionRequestFinalization = (typeof FinalizationRegistry === 'undefined')
1543
2304
  ? { register: () => {}, unregister: () => {} }
1544
- : new FinalizationRegistry(ptr => wasm.__wbg_execution_free(ptr >>> 0, 1));
1545
- /**
1546
- * Execution of an Aleo program.
1547
- */
1548
- class Execution {
2305
+ : new FinalizationRegistry(ptr => wasm.__wbg_executionrequest_free(ptr >>> 0, 1));
2306
+
2307
+ class ExecutionRequest {
1549
2308
 
1550
2309
  static __wrap(ptr) {
1551
2310
  ptr = ptr >>> 0;
1552
- const obj = Object.create(Execution.prototype);
2311
+ const obj = Object.create(ExecutionRequest.prototype);
1553
2312
  obj.__wbg_ptr = ptr;
1554
- ExecutionFinalization.register(obj, obj.__wbg_ptr, obj);
2313
+ ExecutionRequestFinalization.register(obj, obj.__wbg_ptr, obj);
1555
2314
  return obj;
1556
2315
  }
1557
2316
 
1558
2317
  __destroy_into_raw() {
1559
2318
  const ptr = this.__wbg_ptr;
1560
2319
  this.__wbg_ptr = 0;
1561
- ExecutionFinalization.unregister(this);
2320
+ ExecutionRequestFinalization.unregister(this);
1562
2321
  return ptr;
1563
2322
  }
1564
2323
 
1565
2324
  free() {
1566
2325
  const ptr = this.__destroy_into_raw();
1567
- wasm.__wbg_execution_free(ptr, 0);
2326
+ wasm.__wbg_executionrequest_free(ptr, 0);
1568
2327
  }
1569
2328
  /**
1570
- * Returns the string representation of the execution.
2329
+ * Returns the request as a string.
1571
2330
  *
1572
- * @returns {string} The string representation of the execution.
2331
+ * @returns {string} String representation of the request.
1573
2332
  * @returns {string}
1574
2333
  */
1575
2334
  toString() {
@@ -1577,7 +2336,7 @@ class Execution {
1577
2336
  let deferred1_1;
1578
2337
  try {
1579
2338
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1580
- wasm.execution_toString(retptr, this.__wbg_ptr);
2339
+ wasm.executionrequest_toString(retptr, this.__wbg_ptr);
1581
2340
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1582
2341
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1583
2342
  deferred1_0 = r0;
@@ -1589,41 +2348,94 @@ class Execution {
1589
2348
  }
1590
2349
  }
1591
2350
  /**
1592
- * Creates an execution object from a string representation of an execution.
2351
+ * Builds a request object from a string representation of a request.
1593
2352
  *
1594
- * @returns {Execution | Error} The wasm representation of an execution object.
1595
- * @param {string} execution
1596
- * @returns {Execution}
2353
+ * @param {string} request String representation of the request.
2354
+ * @param {string} request
2355
+ * @returns {ExecutionRequest}
1597
2356
  */
1598
- static fromString(execution) {
2357
+ static fromString(request) {
1599
2358
  try {
1600
2359
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1601
- const ptr0 = passStringToWasm0(execution, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
2360
+ const ptr0 = passStringToWasm0(request, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
1602
2361
  const len0 = WASM_VECTOR_LEN;
1603
- wasm.execution_fromString(retptr, ptr0, len0);
2362
+ wasm.executionrequest_fromString(retptr, ptr0, len0);
1604
2363
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1605
2364
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1606
2365
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1607
2366
  if (r2) {
1608
2367
  throw takeObject(r1);
1609
2368
  }
1610
- return Execution.__wrap(r0);
2369
+ return ExecutionRequest.__wrap(r0);
1611
2370
  } finally {
1612
2371
  wasm.__wbindgen_add_to_stack_pointer(16);
1613
2372
  }
1614
2373
  }
1615
2374
  /**
1616
- * Returns the global state root of the execution.
1617
- *
1618
- * @returns {Execution | Error} The global state root used in the execution.
2375
+ * Returns the bytes representation of the request.
2376
+ * @returns {Uint8Array}
2377
+ */
2378
+ toBytesLe() {
2379
+ try {
2380
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2381
+ wasm.executionrequest_toBytesLe(retptr, this.__wbg_ptr);
2382
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2383
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2384
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2385
+ if (r2) {
2386
+ throw takeObject(r1);
2387
+ }
2388
+ return takeObject(r0);
2389
+ } finally {
2390
+ wasm.__wbindgen_add_to_stack_pointer(16);
2391
+ }
2392
+ }
2393
+ /**
2394
+ * Creates an request object from a bytes representation of an request.
2395
+ * @param {Uint8Array} bytes
2396
+ * @returns {ExecutionRequest}
2397
+ */
2398
+ static fromBytesLe(bytes) {
2399
+ try {
2400
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2401
+ wasm.executionrequest_fromBytesLe(retptr, addHeapObject(bytes));
2402
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2403
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2404
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2405
+ if (r2) {
2406
+ throw takeObject(r1);
2407
+ }
2408
+ return ExecutionRequest.__wrap(r0);
2409
+ } finally {
2410
+ wasm.__wbindgen_add_to_stack_pointer(16);
2411
+ }
2412
+ }
2413
+ /**
2414
+ * Returns the request signer.
2415
+ * @returns {Address}
2416
+ */
2417
+ signer() {
2418
+ const ret = wasm.address_toGroup(this.__wbg_ptr);
2419
+ return Address.__wrap(ret);
2420
+ }
2421
+ /**
2422
+ * Returns the network ID.
2423
+ * @returns {number}
2424
+ */
2425
+ network_id() {
2426
+ const ret = wasm.executionrequest_network_id(this.__wbg_ptr);
2427
+ return ret;
2428
+ }
2429
+ /**
2430
+ * Returns the program ID.
1619
2431
  * @returns {string}
1620
2432
  */
1621
- globalStateRoot() {
2433
+ program_id() {
1622
2434
  let deferred1_0;
1623
2435
  let deferred1_1;
1624
2436
  try {
1625
2437
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1626
- wasm.execution_globalStateRoot(retptr, this.__wbg_ptr);
2438
+ wasm.executionrequest_program_id(retptr, this.__wbg_ptr);
1627
2439
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1628
2440
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1629
2441
  deferred1_0 = r0;
@@ -1635,17 +2447,15 @@ class Execution {
1635
2447
  }
1636
2448
  }
1637
2449
  /**
1638
- * Returns the proof of the execution.
1639
- *
1640
- * @returns {string} The execution proof.
2450
+ * Returns the function name.
1641
2451
  * @returns {string}
1642
2452
  */
1643
- proof() {
2453
+ function_name() {
1644
2454
  let deferred1_0;
1645
2455
  let deferred1_1;
1646
2456
  try {
1647
2457
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1648
- wasm.execution_proof(retptr, this.__wbg_ptr);
2458
+ wasm.executionrequest_function_name(retptr, this.__wbg_ptr);
1649
2459
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1650
2460
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1651
2461
  deferred1_0 = r0;
@@ -1657,15 +2467,127 @@ class Execution {
1657
2467
  }
1658
2468
  }
1659
2469
  /**
1660
- * Returns the transitions present in the execution.
1661
- *
1662
- * @returns Array<Transition> the array of transitions present in the execution.
2470
+ * Returns the input IDs for the transition.
1663
2471
  * @returns {Array<any>}
1664
2472
  */
1665
- transitions() {
1666
- const ret = wasm.execution_transitions(this.__wbg_ptr);
2473
+ input_ids() {
2474
+ const ret = wasm.executionrequest_input_ids(this.__wbg_ptr);
2475
+ return takeObject(ret);
2476
+ }
2477
+ /**
2478
+ * Returns the function inputs as an array of strings.
2479
+ * @returns {Array<any>}
2480
+ */
2481
+ inputs() {
2482
+ const ret = wasm.executionrequest_inputs(this.__wbg_ptr);
1667
2483
  return takeObject(ret);
1668
2484
  }
2485
+ /**
2486
+ * Returns the signature for the transition.
2487
+ * @returns {Signature}
2488
+ */
2489
+ signature() {
2490
+ const ret = wasm.executionrequest_signature(this.__wbg_ptr);
2491
+ return Signature.__wrap(ret);
2492
+ }
2493
+ /**
2494
+ * Returns the tag secret key `sk_tag`.
2495
+ * @returns {Field}
2496
+ */
2497
+ sk_tag() {
2498
+ const ret = wasm.executionrequest_sk_tag(this.__wbg_ptr);
2499
+ return Field.__wrap(ret);
2500
+ }
2501
+ /**
2502
+ * Returns the transition view key `tvk`.
2503
+ * @returns {Field}
2504
+ */
2505
+ tvk() {
2506
+ const ret = wasm.executionrequest_tvk(this.__wbg_ptr);
2507
+ return Field.__wrap(ret);
2508
+ }
2509
+ /**
2510
+ * Returns the transition public key `tpk`.
2511
+ * @returns {Group}
2512
+ */
2513
+ to_tpk() {
2514
+ const ret = wasm.executionrequest_to_tpk(this.__wbg_ptr);
2515
+ return Group.__wrap(ret);
2516
+ }
2517
+ /**
2518
+ * Returns the transition commitment `tcm`.
2519
+ * @returns {Field}
2520
+ */
2521
+ tcm() {
2522
+ const ret = wasm.executionrequest_tcm(this.__wbg_ptr);
2523
+ return Field.__wrap(ret);
2524
+ }
2525
+ /**
2526
+ * Returns the signer commitment `scm`.
2527
+ * @returns {Field}
2528
+ */
2529
+ scm() {
2530
+ const ret = wasm.executionrequest_scm(this.__wbg_ptr);
2531
+ return Field.__wrap(ret);
2532
+ }
2533
+ /**
2534
+ * Create a new request by signing over a program ID and set of inputs.
2535
+ *
2536
+ * @param {PrivateKey} private_key The private key of the signer.
2537
+ * @param {string} program_id The id of the program to create the signature for.
2538
+ * @param {string} function_name The function name to create the signature for.
2539
+ * @param {string[]} inputs The inputs to the function.
2540
+ * @param {string[]} input_types The input types of the function.
2541
+ * @param {Field | undefined} root_tvk The tvk of the function at the top of the call graph. This is undefined if this request is built for the top-level call or if there is only one function in the call graph.
2542
+ * @param {boolean} is_root Flag to indicate if this is the top level function in the call graph.
2543
+ * @param {PrivateKey} private_key
2544
+ * @param {string} program_id
2545
+ * @param {string} function_name
2546
+ * @param {Array<any>} inputs
2547
+ * @param {Array<any>} input_types
2548
+ * @param {Field | null | undefined} root_tvk
2549
+ * @param {boolean} is_root
2550
+ * @returns {ExecutionRequest}
2551
+ */
2552
+ static sign(private_key, program_id, function_name, inputs, input_types, root_tvk, is_root) {
2553
+ try {
2554
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2555
+ _assertClass(private_key, PrivateKey);
2556
+ var ptr0 = private_key.__destroy_into_raw();
2557
+ const ptr1 = passStringToWasm0(program_id, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
2558
+ const len1 = WASM_VECTOR_LEN;
2559
+ const ptr2 = passStringToWasm0(function_name, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
2560
+ const len2 = WASM_VECTOR_LEN;
2561
+ let ptr3 = 0;
2562
+ if (!isLikeNone(root_tvk)) {
2563
+ _assertClass(root_tvk, Field);
2564
+ ptr3 = root_tvk.__destroy_into_raw();
2565
+ }
2566
+ wasm.executionrequest_sign(retptr, ptr0, ptr1, len1, ptr2, len2, addHeapObject(inputs), addHeapObject(input_types), ptr3, is_root);
2567
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2568
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2569
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2570
+ if (r2) {
2571
+ throw takeObject(r1);
2572
+ }
2573
+ return ExecutionRequest.__wrap(r0);
2574
+ } finally {
2575
+ wasm.__wbindgen_add_to_stack_pointer(16);
2576
+ }
2577
+ }
2578
+ /**
2579
+ * Verify the input types within a request.
2580
+ *
2581
+ * @param {string[]} The input_types within the request.
2582
+ * @param {boolean} Flag to indicate whether this request is the first function in the call graph.
2583
+ * @param {Array<any>} input_types
2584
+ * @param {boolean} is_root
2585
+ * @returns {boolean}
2586
+ */
2587
+ verify(input_types, is_root) {
2588
+ const ret = wasm.executionrequest_verify(this.__wbg_ptr, addHeapObject(input_types), is_root);
2589
+ return ret !== 0;
2590
+ }
1669
2591
  }
1670
2592
 
1671
2593
  const ExecutionResponseFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -2281,7 +3203,7 @@ class Group {
2281
3203
  toFields() {
2282
3204
  try {
2283
3205
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2284
- wasm.group_toFields(retptr, this.__wbg_ptr);
3206
+ wasm.address_toFields(retptr, this.__wbg_ptr);
2285
3207
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2286
3208
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2287
3209
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -2314,7 +3236,7 @@ class Group {
2314
3236
  * @returns {Group}
2315
3237
  */
2316
3238
  clone() {
2317
- const ret = wasm.group_clone(this.__wbg_ptr);
3239
+ const ret = wasm.address_toGroup(this.__wbg_ptr);
2318
3240
  return Group.__wrap(ret);
2319
3241
  }
2320
3242
  /**
@@ -2806,6 +3728,11 @@ class OfflineQuery {
2806
3728
  }
2807
3729
  /**
2808
3730
  * Creates a new offline query object. The state root is required to be passed in as a string
3731
+ *
3732
+ * @param {u32} block_height The block height.
3733
+ * @param {string} state_root The state root of the current network.
3734
+ *
3735
+ * @returns {OfflineQuery} The newly created offline query object.
2809
3736
  * @param {number} block_height
2810
3737
  * @param {string} state_root
2811
3738
  */
@@ -2830,6 +3757,8 @@ class OfflineQuery {
2830
3757
  }
2831
3758
  /**
2832
3759
  * Add a new block height to the offline query object.
3760
+ *
3761
+ * @param {u32} block_height The block height to add.
2833
3762
  * @param {number} block_height
2834
3763
  */
2835
3764
  addBlockHeight(block_height) {
@@ -2838,8 +3767,8 @@ class OfflineQuery {
2838
3767
  /**
2839
3768
  * Add a new state path to the offline query object.
2840
3769
  *
2841
- * @param {string} commitment: The commitment corresponding to a record inpout
2842
- * @param {string} state_path: The state path corresponding to the commitment
3770
+ * @param {string} commitment: The commitment corresponding to a record input.
3771
+ * @param {string} state_path: The state path corresponding to the commitment.
2843
3772
  * @param {string} commitment
2844
3773
  * @param {string} state_path
2845
3774
  */
@@ -2861,7 +3790,9 @@ class OfflineQuery {
2861
3790
  }
2862
3791
  }
2863
3792
  /**
2864
- * Get a json string representation of the offline query object
3793
+ * Get a json string representation of the offline query object.
3794
+ *
3795
+ * @returns {string} JSON string representation of the offline query object.
2865
3796
  * @returns {string}
2866
3797
  */
2867
3798
  toString() {
@@ -2881,7 +3812,9 @@ class OfflineQuery {
2881
3812
  }
2882
3813
  }
2883
3814
  /**
2884
- * Create an offline query object from a json string representation
3815
+ * Create an offline query object from a json string representation.
3816
+ *
3817
+ * @param {string} JSON string representation of the offline query object.
2885
3818
  * @param {string} s
2886
3819
  * @returns {OfflineQuery}
2887
3820
  */
@@ -3203,6 +4136,11 @@ class Plaintext {
3203
4136
  }
3204
4137
  /**
3205
4138
  * Encrypt a plaintext with an address and randomizer.
4139
+ *
4140
+ * @param {Address} address The address to encrypt the plaintext for.
4141
+ * @param {Scalar} randomizer The randomizer to use for encryption.
4142
+ *
4143
+ * @returns {Ciphertext} The encrypted ciphertext.
3206
4144
  * @param {Address} address
3207
4145
  * @param {Scalar} randomizer
3208
4146
  * @returns {Ciphertext}
@@ -3226,6 +4164,11 @@ class Plaintext {
3226
4164
  }
3227
4165
  /**
3228
4166
  * Encrypt a plaintext with a transition view key.
4167
+ *
4168
+ * @param {Field} transition_view_key The transition view key of the transition
4169
+ * associated with the plaintext.
4170
+ *
4171
+ * @returns {Ciphertext} The encrypted ciphertext.
3229
4172
  * @param {Field} transition_view_key
3230
4173
  * @returns {Ciphertext}
3231
4174
  */
@@ -3297,6 +4240,8 @@ class Plaintext {
3297
4240
  }
3298
4241
  /**
3299
4242
  * Get the left endian byte array representation of the plaintext.
4243
+ *
4244
+ * @returns {Uint8Array} The left endian byte array representation of the plaintext.
3300
4245
  * @returns {Uint8Array}
3301
4246
  */
3302
4247
  toBytesLe() {
@@ -3340,6 +4285,8 @@ class Plaintext {
3340
4285
  }
3341
4286
  /**
3342
4287
  * Get the left endian boolean array representation of the bits of the plaintext.
4288
+ *
4289
+ * @returns {Array} The left endian boolean array representation of the bits of the plaintext.
3343
4290
  * @returns {Array<any>}
3344
4291
  */
3345
4292
  toBitsLe() {
@@ -3372,6 +4319,8 @@ class Plaintext {
3372
4319
  }
3373
4320
  /**
3374
4321
  * Get the field array representation of the plaintext.
4322
+ *
4323
+ * @returns {Array} The field array representation of the plaintext.
3375
4324
  * @returns {Array<any>}
3376
4325
  */
3377
4326
  toFields() {
@@ -4632,29 +5581,108 @@ class Program {
4632
5581
  * console.log(imports === expected_imports); // Output should be "true"
4633
5582
  * @returns {Array<any>}
4634
5583
  */
4635
- getImports() {
4636
- const ret = wasm.program_getImports(this.__wbg_ptr);
5584
+ getImports() {
5585
+ const ret = wasm.program_getImports(this.__wbg_ptr);
5586
+ return takeObject(ret);
5587
+ }
5588
+ }
5589
+
5590
+ const ProgramManagerFinalization = (typeof FinalizationRegistry === 'undefined')
5591
+ ? { register: () => {}, unregister: () => {} }
5592
+ : new FinalizationRegistry(ptr => wasm.__wbg_programmanager_free(ptr >>> 0, 1));
5593
+
5594
+ class ProgramManager {
5595
+
5596
+ __destroy_into_raw() {
5597
+ const ptr = this.__wbg_ptr;
5598
+ this.__wbg_ptr = 0;
5599
+ ProgramManagerFinalization.unregister(this);
5600
+ return ptr;
5601
+ }
5602
+
5603
+ free() {
5604
+ const ptr = this.__destroy_into_raw();
5605
+ wasm.__wbg_programmanager_free(ptr, 0);
5606
+ }
5607
+ /**
5608
+ * Create an execution `Authorization` for a given program:function tuple with specified inputs.
5609
+ *
5610
+ * @param private_key The private key of the signer.
5611
+ * @param program The program source code containing the function to authorize.
5612
+ * @param function_name The function to authorize.
5613
+ * @param inputs A javascript array of inputs to the function.
5614
+ * @param imports The imports to the program in the format {"programname.aleo":"aleo instructions source code"}.
5615
+ * @param {PrivateKey} private_key
5616
+ * @param {string} program
5617
+ * @param {string} function_name
5618
+ * @param {Array<any>} inputs
5619
+ * @param {object | null} [imports]
5620
+ * @returns {Promise<Authorization>}
5621
+ */
5622
+ static authorize(private_key, program, function_name, inputs, imports) {
5623
+ _assertClass(private_key, PrivateKey);
5624
+ const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
5625
+ const len0 = WASM_VECTOR_LEN;
5626
+ const ptr1 = passStringToWasm0(function_name, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
5627
+ const len1 = WASM_VECTOR_LEN;
5628
+ const ret = wasm.programmanager_authorize(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), isLikeNone(imports) ? 0 : addHeapObject(imports));
5629
+ return takeObject(ret);
5630
+ }
5631
+ /**
5632
+ * Create an execution `Authorization` without generating a circuit. Use this function when
5633
+ * fast delegated proving is needed.
5634
+ *
5635
+ * @param private_key The private key of the signer.
5636
+ * @param program The program source code containing the function to authorize.
5637
+ * @param function_name The function to authorize.
5638
+ * @param inputs A javascript array of inputs to the function.
5639
+ * @param imports The imports to the program in the format {"programname.aleo":"aleo instructions source code"}.
5640
+ * @param {PrivateKey} private_key
5641
+ * @param {string} program
5642
+ * @param {string} function_name
5643
+ * @param {Array<any>} inputs
5644
+ * @param {object | null} [imports]
5645
+ * @returns {Promise<Authorization>}
5646
+ */
5647
+ static buildAuthorizationUnchecked(private_key, program, function_name, inputs, imports) {
5648
+ _assertClass(private_key, PrivateKey);
5649
+ const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
5650
+ const len0 = WASM_VECTOR_LEN;
5651
+ const ptr1 = passStringToWasm0(function_name, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
5652
+ const len1 = WASM_VECTOR_LEN;
5653
+ const ret = wasm.programmanager_buildAuthorizationUnchecked(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), isLikeNone(imports) ? 0 : addHeapObject(imports));
5654
+ return takeObject(ret);
5655
+ }
5656
+ /**
5657
+ * Create an `Authorization` for `credits.aleo/fee_public` or `credits.aleo/fee_private`.
5658
+ * This object requires an associated execution or deployment ID. This can be gained from
5659
+ * any previously created authorization by calling (authorization.toExecutionId()).
5660
+ *
5661
+ * @param private_key The private key of the signer.
5662
+ * @param deployment_or_execution_id The id of the deployment or execution to authorize the fee program for.
5663
+ * @param base_fee_credits The base fee to be paid for the authorization
5664
+ * @param priority_fee_credits The optional priority fee to be paid for the transaction
5665
+ * @param fee_record The record to spend the fee from
5666
+ * @returns {Authorization}
5667
+ * @param {PrivateKey} private_key
5668
+ * @param {string} deployment_or_execution_id
5669
+ * @param {number} base_fee_credits
5670
+ * @param {number} priority_fee_credits
5671
+ * @param {RecordPlaintext | null} [fee_record]
5672
+ * @returns {Promise<Authorization>}
5673
+ */
5674
+ static authorizeFee(private_key, deployment_or_execution_id, base_fee_credits, priority_fee_credits, fee_record) {
5675
+ _assertClass(private_key, PrivateKey);
5676
+ const ptr0 = passStringToWasm0(deployment_or_execution_id, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
5677
+ const len0 = WASM_VECTOR_LEN;
5678
+ let ptr1 = 0;
5679
+ if (!isLikeNone(fee_record)) {
5680
+ _assertClass(fee_record, RecordPlaintext);
5681
+ ptr1 = fee_record.__destroy_into_raw();
5682
+ }
5683
+ const ret = wasm.programmanager_authorizeFee(private_key.__wbg_ptr, ptr0, len0, base_fee_credits, priority_fee_credits, ptr1);
4637
5684
  return takeObject(ret);
4638
5685
  }
4639
- }
4640
-
4641
- const ProgramManagerFinalization = (typeof FinalizationRegistry === 'undefined')
4642
- ? { register: () => {}, unregister: () => {} }
4643
- : new FinalizationRegistry(ptr => wasm.__wbg_programmanager_free(ptr >>> 0, 1));
4644
-
4645
- class ProgramManager {
4646
-
4647
- __destroy_into_raw() {
4648
- const ptr = this.__wbg_ptr;
4649
- this.__wbg_ptr = 0;
4650
- ProgramManagerFinalization.unregister(this);
4651
- return ptr;
4652
- }
4653
-
4654
- free() {
4655
- const ptr = this.__destroy_into_raw();
4656
- wasm.__wbg_programmanager_free(ptr, 0);
4657
- }
4658
5686
  /**
4659
5687
  * Deploy an Aleo program
4660
5688
  *
@@ -5055,6 +6083,48 @@ class ProgramManager {
5055
6083
  const ret = wasm.programmanager_buildJoinTransaction(private_key.__wbg_ptr, ptr0, ptr1, priority_fee_credits, ptr2, ptr3, len3, ptr4, ptr5, ptr6, ptr7, ptr8);
5056
6084
  return takeObject(ret);
5057
6085
  }
6086
+ /**
6087
+ * Create a `ProvingRequest` object. This object creates authorizations for the top level
6088
+ * function and associated fee function. This object can be sent directly to a remote prover
6089
+ * OR used to extract both execution and fee authorizations.
6090
+ *
6091
+ * @param private_key The private key of the signer.
6092
+ * @param program The program source code containing the function to authorize.
6093
+ * @param function_name The function to authorize.
6094
+ * @param inputs A javascript array of inputs to the function.
6095
+ * @param base_fee_credits The base fee to be paid for the authorization
6096
+ * @param priority_fee_credits The optional priority fee to be paid for the transaction
6097
+ * @param fee_record The record to spend the fee from
6098
+ * @param imports The imports to the program in the format {"programname.aleo":"aleo instructions source code"}.
6099
+ * @param url The url of the Aleo network node to send the transaction to
6100
+ * @param broadcast (optional) Flag to indicate if the transaction should be broadcast
6101
+ * @returns {Authorization}
6102
+ * @param {PrivateKey} private_key
6103
+ * @param {string} program
6104
+ * @param {string} function_name
6105
+ * @param {Array<any>} inputs
6106
+ * @param {number} base_fee_credits
6107
+ * @param {number} priority_fee_credits
6108
+ * @param {RecordPlaintext | null | undefined} fee_record
6109
+ * @param {object | null | undefined} imports
6110
+ * @param {boolean} broadcast
6111
+ * @param {boolean} unchecked
6112
+ * @returns {Promise<ProvingRequest>}
6113
+ */
6114
+ static buildProvingRequest(private_key, program, function_name, inputs, base_fee_credits, priority_fee_credits, fee_record, imports, broadcast, unchecked) {
6115
+ _assertClass(private_key, PrivateKey);
6116
+ const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
6117
+ const len0 = WASM_VECTOR_LEN;
6118
+ const ptr1 = passStringToWasm0(function_name, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
6119
+ const len1 = WASM_VECTOR_LEN;
6120
+ let ptr2 = 0;
6121
+ if (!isLikeNone(fee_record)) {
6122
+ _assertClass(fee_record, RecordPlaintext);
6123
+ ptr2 = fee_record.__destroy_into_raw();
6124
+ }
6125
+ 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);
6126
+ return takeObject(ret);
6127
+ }
5058
6128
  /**
5059
6129
  * Split an Aleo credits record into two separate records. This function does not require a fee.
5060
6130
  *
@@ -5179,10 +6249,10 @@ class ProgramManager {
5179
6249
  /**
5180
6250
  * Synthesize proving and verifying keys for a program
5181
6251
  *
5182
- * @param program {string} The program source code of the program to synthesize keys for
5183
- * @param function_id {string} The function to synthesize keys for
5184
- * @param inputs {Array} The inputs to the function
5185
- * @param imports {Object | undefined} The imports for the program
6252
+ * @param {string} program The program source code of the program to synthesize keys for
6253
+ * @param {string} function_id The function to synthesize keys for
6254
+ * @param {Array} inputs The inputs to the function
6255
+ * @param {Object | undefined} imports The imports for the program
5186
6256
  * @param {PrivateKey} private_key
5187
6257
  * @param {string} program
5188
6258
  * @param {string} function_id
@@ -5199,6 +6269,14 @@ class ProgramManager {
5199
6269
  const ret = wasm.programmanager_synthesizeKeyPair(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), isLikeNone(imports) ? 0 : addHeapObject(imports));
5200
6270
  return takeObject(ret);
5201
6271
  }
6272
+ /**
6273
+ * @param {ProvingKey} proving_key
6274
+ */
6275
+ static loadInclusionProver(proving_key) {
6276
+ _assertClass(proving_key, ProvingKey);
6277
+ var ptr0 = proving_key.__destroy_into_raw();
6278
+ wasm.programmanager_loadInclusionProver(ptr0);
6279
+ }
5202
6280
  }
5203
6281
 
5204
6282
  const ProvingKeyFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -5567,6 +6645,176 @@ class ProvingKey {
5567
6645
  }
5568
6646
  }
5569
6647
 
6648
+ const ProvingRequestFinalization = (typeof FinalizationRegistry === 'undefined')
6649
+ ? { register: () => {}, unregister: () => {} }
6650
+ : new FinalizationRegistry(ptr => wasm.__wbg_provingrequest_free(ptr >>> 0, 1));
6651
+ /**
6652
+ * Represents a proving request to a prover.
6653
+ */
6654
+ class ProvingRequest {
6655
+
6656
+ static __wrap(ptr) {
6657
+ ptr = ptr >>> 0;
6658
+ const obj = Object.create(ProvingRequest.prototype);
6659
+ obj.__wbg_ptr = ptr;
6660
+ ProvingRequestFinalization.register(obj, obj.__wbg_ptr, obj);
6661
+ return obj;
6662
+ }
6663
+
6664
+ __destroy_into_raw() {
6665
+ const ptr = this.__wbg_ptr;
6666
+ this.__wbg_ptr = 0;
6667
+ ProvingRequestFinalization.unregister(this);
6668
+ return ptr;
6669
+ }
6670
+
6671
+ free() {
6672
+ const ptr = this.__destroy_into_raw();
6673
+ wasm.__wbg_provingrequest_free(ptr, 0);
6674
+ }
6675
+ /**
6676
+ * Creates a new ProvingRequest from a function Authorization and an optional fee Authorization.
6677
+ *
6678
+ * @param {Authorization} authorization An Authorization for a function.
6679
+ * @param {Authorization} fee_authorization The authorization for the `credits.aleo/fee_public` or `credits.aleo/fee_private` function that pays the fee for the execution of the main function.
6680
+ * @param {boolean} broadcast Flag that indicates whether the remote proving service should attempt to submit the transaction on the caller's behalf.
6681
+ * @param {Authorization} authorization
6682
+ * @param {Authorization | null | undefined} fee_authorization
6683
+ * @param {boolean} broadcast
6684
+ * @returns {ProvingRequest}
6685
+ */
6686
+ static new(authorization, fee_authorization, broadcast) {
6687
+ _assertClass(authorization, Authorization);
6688
+ var ptr0 = authorization.__destroy_into_raw();
6689
+ let ptr1 = 0;
6690
+ if (!isLikeNone(fee_authorization)) {
6691
+ _assertClass(fee_authorization, Authorization);
6692
+ ptr1 = fee_authorization.__destroy_into_raw();
6693
+ }
6694
+ const ret = wasm.provingrequest_new(ptr0, ptr1, broadcast);
6695
+ return ProvingRequest.__wrap(ret);
6696
+ }
6697
+ /**
6698
+ * Creates a ProvingRequest from a string representation.
6699
+ *
6700
+ * @param {Uint8Array} request String representation of the ProvingRequest.
6701
+ * @param {string} request
6702
+ * @returns {ProvingRequest}
6703
+ */
6704
+ static fromString(request) {
6705
+ try {
6706
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
6707
+ const ptr0 = passStringToWasm0(request, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
6708
+ const len0 = WASM_VECTOR_LEN;
6709
+ wasm.provingrequest_fromString(retptr, ptr0, len0);
6710
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
6711
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
6712
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
6713
+ if (r2) {
6714
+ throw takeObject(r1);
6715
+ }
6716
+ return ProvingRequest.__wrap(r0);
6717
+ } finally {
6718
+ wasm.__wbindgen_add_to_stack_pointer(16);
6719
+ }
6720
+ }
6721
+ /**
6722
+ * Creates a string representation of the ProvingRequest.
6723
+ * @returns {string}
6724
+ */
6725
+ toString() {
6726
+ let deferred1_0;
6727
+ let deferred1_1;
6728
+ try {
6729
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
6730
+ wasm.provingrequest_toString(retptr, this.__wbg_ptr);
6731
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
6732
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
6733
+ deferred1_0 = r0;
6734
+ deferred1_1 = r1;
6735
+ return getStringFromWasm0(r0, r1);
6736
+ } finally {
6737
+ wasm.__wbindgen_add_to_stack_pointer(16);
6738
+ wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
6739
+ }
6740
+ }
6741
+ /**
6742
+ * Creates a ProvingRequest from a left-endian byte representation of the ProvingRequest.
6743
+ *
6744
+ * @param {Uint8Array} bytes Left-endian bytes representing the proving request.
6745
+ * @param {Uint8Array} bytes
6746
+ * @returns {ProvingRequest}
6747
+ */
6748
+ static fromBytesLe(bytes) {
6749
+ try {
6750
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
6751
+ wasm.provingrequest_fromBytesLe(retptr, addHeapObject(bytes));
6752
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
6753
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
6754
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
6755
+ if (r2) {
6756
+ throw takeObject(r1);
6757
+ }
6758
+ return ProvingRequest.__wrap(r0);
6759
+ } finally {
6760
+ wasm.__wbindgen_add_to_stack_pointer(16);
6761
+ }
6762
+ }
6763
+ /**
6764
+ * Creates a left-endian byte representation of the ProvingRequest.
6765
+ * @returns {Uint8Array}
6766
+ */
6767
+ toBytesLe() {
6768
+ try {
6769
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
6770
+ wasm.provingrequest_toBytesLe(retptr, this.__wbg_ptr);
6771
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
6772
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
6773
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
6774
+ if (r2) {
6775
+ throw takeObject(r1);
6776
+ }
6777
+ return takeObject(r0);
6778
+ } finally {
6779
+ wasm.__wbindgen_add_to_stack_pointer(16);
6780
+ }
6781
+ }
6782
+ /**
6783
+ * Get the Authorization of the main function in the ProvingRequest.
6784
+ * @returns {Authorization}
6785
+ */
6786
+ authorization() {
6787
+ const ret = wasm.provingrequest_authorization(this.__wbg_ptr);
6788
+ return Authorization.__wrap(ret);
6789
+ }
6790
+ /**
6791
+ * Get the fee Authorization in the ProvingRequest.
6792
+ * @returns {Authorization | undefined}
6793
+ */
6794
+ feeAuthorization() {
6795
+ const ret = wasm.provingrequest_feeAuthorization(this.__wbg_ptr);
6796
+ return ret === 0 ? undefined : Authorization.__wrap(ret);
6797
+ }
6798
+ /**
6799
+ * Get the broadcast flag set in the ProvingRequest.
6800
+ * @returns {boolean}
6801
+ */
6802
+ broadcast() {
6803
+ const ret = wasm.provingrequest_broadcast(this.__wbg_ptr);
6804
+ return ret !== 0;
6805
+ }
6806
+ /**
6807
+ * Check if a ProvingRequest is the same as another ProvingRequest.
6808
+ * @param {ProvingRequest} other
6809
+ * @returns {boolean}
6810
+ */
6811
+ equals(other) {
6812
+ _assertClass(other, ProvingRequest);
6813
+ const ret = wasm.provingrequest_equals(this.__wbg_ptr, other.__wbg_ptr);
6814
+ return ret !== 0;
6815
+ }
6816
+ }
6817
+
5570
6818
  const RecordCiphertextFinalization = (typeof FinalizationRegistry === 'undefined')
5571
6819
  ? { register: () => {}, unregister: () => {} }
5572
6820
  : new FinalizationRegistry(ptr => wasm.__wbg_recordciphertext_free(ptr >>> 0, 1));
@@ -5620,7 +6868,7 @@ class RecordCiphertext {
5620
6868
  }
5621
6869
  }
5622
6870
  /**
5623
- * Return the string reprensentation of the record ciphertext
6871
+ * Return the string representation of the record ciphertext
5624
6872
  *
5625
6873
  * @returns {string} String representation of the record ciphertext
5626
6874
  * @returns {string}
@@ -5666,6 +6914,21 @@ class RecordCiphertext {
5666
6914
  wasm.__wbindgen_add_to_stack_pointer(16);
5667
6915
  }
5668
6916
  }
6917
+ /**
6918
+ * Generate the record view key. The record view key can only decrypt record if the
6919
+ * supplied view key belongs to the record owner.
6920
+ *
6921
+ * @param {ViewKey} view_key View key used to generate the record view key
6922
+ *
6923
+ * @returns {Group} record view key
6924
+ * @param {ViewKey} view_key
6925
+ * @returns {Field}
6926
+ */
6927
+ recordViewKey(view_key) {
6928
+ _assertClass(view_key, ViewKey);
6929
+ const ret = wasm.recordciphertext_recordViewKey(this.__wbg_ptr, view_key.__wbg_ptr);
6930
+ return Field.__wrap(ret);
6931
+ }
5669
6932
  /**
5670
6933
  * Determines if the account corresponding to the view key is the owner of the record
5671
6934
  *
@@ -5734,6 +6997,8 @@ class RecordCiphertext {
5734
6997
  }
5735
6998
  /**
5736
6999
  * Get the left endian byte array representation of the record ciphertext.
7000
+ *
7001
+ * @returns {Uint8Array} Left endian byte array representation of the record ciphertext.
5737
7002
  * @returns {Uint8Array}
5738
7003
  */
5739
7004
  toBytesLe() {
@@ -5753,6 +7018,8 @@ class RecordCiphertext {
5753
7018
  }
5754
7019
  /**
5755
7020
  * Get the left endian boolean array representation of the record ciphertext bits.
7021
+ *
7022
+ * returns {Array} Left endian boolean array representation of the bits of the record ciphertext.
5756
7023
  * @returns {Array<any>}
5757
7024
  */
5758
7025
  toBitsLe() {
@@ -5761,6 +7028,8 @@ class RecordCiphertext {
5761
7028
  }
5762
7029
  /**
5763
7030
  * Get the field array representation of the record ciphertext.
7031
+ *
7032
+ * @returns {Array} Field array representation of the record ciphertext.
5764
7033
  * @returns {Array<any>}
5765
7034
  */
5766
7035
  toFields() {
@@ -5778,6 +7047,42 @@ class RecordCiphertext {
5778
7047
  wasm.__wbindgen_add_to_stack_pointer(16);
5779
7048
  }
5780
7049
  }
7050
+ /**
7051
+ * Decrypt the record ciphertext into plaintext using a record view key.
7052
+ *
7053
+ * @param {Field} record_vk Record view key used to decrypt the record.
7054
+ *
7055
+ * @returns {RecordPlaintext}
7056
+ * @param {Field} record_vk
7057
+ * @returns {RecordPlaintext}
7058
+ */
7059
+ decryptWithRecordViewKey(record_vk) {
7060
+ try {
7061
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
7062
+ _assertClass(record_vk, Field);
7063
+ var ptr0 = record_vk.__destroy_into_raw();
7064
+ wasm.recordciphertext_decryptWithRecordViewKey(retptr, this.__wbg_ptr, ptr0);
7065
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
7066
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
7067
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
7068
+ if (r2) {
7069
+ throw takeObject(r1);
7070
+ }
7071
+ return RecordPlaintext.__wrap(r0);
7072
+ } finally {
7073
+ wasm.__wbindgen_add_to_stack_pointer(16);
7074
+ }
7075
+ }
7076
+ /**
7077
+ * Get the record nonce.
7078
+ *
7079
+ * @returns {Group} The record nonce.
7080
+ * @returns {Group}
7081
+ */
7082
+ nonce() {
7083
+ const ret = wasm.recordciphertext_nonce(this.__wbg_ptr);
7084
+ return Group.__wrap(ret);
7085
+ }
5781
7086
  }
5782
7087
 
5783
7088
  const RecordPlaintextFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -5810,16 +7115,19 @@ class RecordPlaintext {
5810
7115
  /**
5811
7116
  * @param {string} program_id
5812
7117
  * @param {string} record_name
7118
+ * @param {string} record_view_key
5813
7119
  * @returns {Field}
5814
7120
  */
5815
- commitment(program_id, record_name) {
7121
+ commitment(program_id, record_name, record_view_key) {
5816
7122
  try {
5817
7123
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
5818
7124
  const ptr0 = passStringToWasm0(program_id, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
5819
7125
  const len0 = WASM_VECTOR_LEN;
5820
7126
  const ptr1 = passStringToWasm0(record_name, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
5821
7127
  const len1 = WASM_VECTOR_LEN;
5822
- wasm.recordplaintext_commitment(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
7128
+ const ptr2 = passStringToWasm0(record_view_key, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
7129
+ const len2 = WASM_VECTOR_LEN;
7130
+ wasm.recordplaintext_commitment(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
5823
7131
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
5824
7132
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
5825
7133
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -5834,7 +7142,8 @@ class RecordPlaintext {
5834
7142
  /**
5835
7143
  * Return a record plaintext from a string.
5836
7144
  *
5837
- * @param {string} record String representation of a plaintext representation of an Aleo record
7145
+ * @param {string} record String representation of a plaintext representation of an Aleo record.
7146
+ *
5838
7147
  * @returns {RecordPlaintext} Record plaintext
5839
7148
  * @param {string} record
5840
7149
  * @returns {RecordPlaintext}
@@ -5857,6 +7166,11 @@ class RecordPlaintext {
5857
7166
  }
5858
7167
  }
5859
7168
  /**
7169
+ * Get the record entry matching a key.
7170
+ *
7171
+ * @param {string} input The key to retrieve the value in the record data field.
7172
+ *
7173
+ * @returns {Plaintext} The plaintext value corresponding to the key.
5860
7174
  * @param {string} input
5861
7175
  * @returns {Plaintext}
5862
7176
  */
@@ -5879,6 +7193,8 @@ class RecordPlaintext {
5879
7193
  }
5880
7194
  /**
5881
7195
  * Get the owner of the record.
7196
+ *
7197
+ * @returns {Address} Address of the owner of the record.
5882
7198
  * @returns {Address}
5883
7199
  */
5884
7200
  owner() {
@@ -6097,16 +7413,18 @@ class RecordPlaintext {
6097
7413
  * @param {PrivateKey} private_key Private key of the account that owns the record
6098
7414
  * @param {string} program_id Program ID of the program that the record is associated with
6099
7415
  * @param {string} record_name Name of the record
7416
+ * @param {string} record_view_key The string representation of the record view key.
6100
7417
  *
6101
7418
  * @returns {string} Serial number of the record
6102
7419
  * @param {PrivateKey} private_key
6103
7420
  * @param {string} program_id
6104
7421
  * @param {string} record_name
7422
+ * @param {string} record_view_key
6105
7423
  * @returns {string}
6106
7424
  */
6107
- serialNumberString(private_key, program_id, record_name) {
6108
- let deferred4_0;
6109
- let deferred4_1;
7425
+ serialNumberString(private_key, program_id, record_name, record_view_key) {
7426
+ let deferred5_0;
7427
+ let deferred5_1;
6110
7428
  try {
6111
7429
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
6112
7430
  _assertClass(private_key, PrivateKey);
@@ -6114,23 +7432,25 @@ class RecordPlaintext {
6114
7432
  const len0 = WASM_VECTOR_LEN;
6115
7433
  const ptr1 = passStringToWasm0(record_name, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
6116
7434
  const len1 = WASM_VECTOR_LEN;
6117
- wasm.recordplaintext_serialNumberString(retptr, this.__wbg_ptr, private_key.__wbg_ptr, ptr0, len0, ptr1, len1);
7435
+ const ptr2 = passStringToWasm0(record_view_key, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
7436
+ const len2 = WASM_VECTOR_LEN;
7437
+ wasm.recordplaintext_serialNumberString(retptr, this.__wbg_ptr, private_key.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
6118
7438
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
6119
7439
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
6120
7440
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
6121
7441
  var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
6122
- var ptr3 = r0;
6123
- var len3 = r1;
7442
+ var ptr4 = r0;
7443
+ var len4 = r1;
6124
7444
  if (r3) {
6125
- ptr3 = 0; len3 = 0;
7445
+ ptr4 = 0; len4 = 0;
6126
7446
  throw takeObject(r2);
6127
7447
  }
6128
- deferred4_0 = ptr3;
6129
- deferred4_1 = len3;
6130
- return getStringFromWasm0(ptr3, len3);
7448
+ deferred5_0 = ptr4;
7449
+ deferred5_1 = len4;
7450
+ return getStringFromWasm0(ptr4, len4);
6131
7451
  } finally {
6132
7452
  wasm.__wbindgen_add_to_stack_pointer(16);
6133
- wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
7453
+ wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
6134
7454
  }
6135
7455
  }
6136
7456
  /**
@@ -6157,6 +7477,21 @@ class RecordPlaintext {
6157
7477
  wasm.__wbindgen_add_to_stack_pointer(16);
6158
7478
  }
6159
7479
  }
7480
+ /**
7481
+ * Generate the record view key. The record view key can only decrypt record if the
7482
+ * supplied view key belongs to the record owner.
7483
+ *
7484
+ * @param {ViewKey} view_key View key used to generate the record view key
7485
+ *
7486
+ * @returns {Group} record view key
7487
+ * @param {ViewKey} view_key
7488
+ * @returns {Field}
7489
+ */
7490
+ recordViewKey(view_key) {
7491
+ _assertClass(view_key, ViewKey);
7492
+ const ret = wasm.recordplaintext_recordViewKey(this.__wbg_ptr, view_key.__wbg_ptr);
7493
+ return Field.__wrap(ret);
7494
+ }
6160
7495
  }
6161
7496
 
6162
7497
  const ScalarFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -6456,7 +7791,7 @@ class Signature {
6456
7791
  _assertClass(private_key, PrivateKey);
6457
7792
  const ptr0 = passArray8ToWasm0(message, wasm.__wbindgen_export_3);
6458
7793
  const len0 = WASM_VECTOR_LEN;
6459
- const ret = wasm.privatekey_sign(private_key.__wbg_ptr, ptr0, len0);
7794
+ const ret = wasm.signature_sign(private_key.__wbg_ptr, ptr0, len0);
6460
7795
  return Signature.__wrap(ret);
6461
7796
  }
6462
7797
  /**
@@ -6946,7 +8281,6 @@ class Transaction {
6946
8281
  }
6947
8282
  }
6948
8283
  /**
6949
- * Get the
6950
8284
  * Get the type of the transaction (will return "deploy" or "execute")
6951
8285
  *
6952
8286
  * @returns {string} Transaction type
@@ -7259,6 +8593,8 @@ class Transition {
7259
8593
  }
7260
8594
  /**
7261
8595
  * Get the transition public key of the transition.
8596
+ *
8597
+ * @returns {Group} Transition public key
7262
8598
  * @returns {Group}
7263
8599
  */
7264
8600
  tpk() {
@@ -7267,6 +8603,10 @@ class Transition {
7267
8603
  }
7268
8604
  /**
7269
8605
  * Get the transition view key of the transition.
8606
+ *
8607
+ * @param {ViewKey} view_key The view key of the transition signer.
8608
+ *
8609
+ * @returns {Field} Transition view key
7270
8610
  * @param {ViewKey} view_key
7271
8611
  * @returns {Field}
7272
8612
  */
@@ -7277,6 +8617,8 @@ class Transition {
7277
8617
  }
7278
8618
  /**
7279
8619
  * Get the transition commitment of the transition.
8620
+ *
8621
+ * @returns {Field} Transition commitment
7280
8622
  * @returns {Field}
7281
8623
  */
7282
8624
  tcm() {
@@ -7285,12 +8627,39 @@ class Transition {
7285
8627
  }
7286
8628
  /**
7287
8629
  * Get the transition signer commitment of the transition.
8630
+ *
8631
+ * @returns {Field} Transition signer commitment
7288
8632
  * @returns {Field}
7289
8633
  */
7290
8634
  scm() {
7291
8635
  const ret = wasm.transition_scm(this.__wbg_ptr);
7292
8636
  return Field.__wrap(ret);
7293
8637
  }
8638
+ /**
8639
+ * Decrypt the transition using the transition view key.
8640
+ *
8641
+ * @param {Field} tvk The transition view key.
8642
+ *
8643
+ * @returns {Transition} The transition with public values for inputs and outputs.
8644
+ * @param {Field} tvk
8645
+ * @returns {Transition}
8646
+ */
8647
+ decryptTransition(tvk) {
8648
+ try {
8649
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
8650
+ _assertClass(tvk, Field);
8651
+ wasm.transition_decryptTransition(retptr, this.__wbg_ptr, tvk.__wbg_ptr);
8652
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
8653
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
8654
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
8655
+ if (r2) {
8656
+ throw takeObject(r1);
8657
+ }
8658
+ return Transition.__wrap(r0);
8659
+ } finally {
8660
+ wasm.__wbindgen_add_to_stack_pointer(16);
8661
+ }
8662
+ }
7294
8663
  }
7295
8664
 
7296
8665
  const VerifyingKeyFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -7785,7 +9154,7 @@ class ViewKey {
7785
9154
  */
7786
9155
  static from_private_key(private_key) {
7787
9156
  _assertClass(private_key, PrivateKey);
7788
- const ret = wasm.privatekey_to_view_key(private_key.__wbg_ptr);
9157
+ const ret = wasm.viewkey_from_private_key(private_key.__wbg_ptr);
7789
9158
  return ViewKey.__wrap(ret);
7790
9159
  }
7791
9160
  /**
@@ -7912,6 +9281,9 @@ async function __wbg_load(module, imports) {
7912
9281
  function __wbg_get_imports() {
7913
9282
  const imports = {};
7914
9283
  imports.wbg = {};
9284
+ imports.wbg.__wbg_abort_410ec47a64ac6117 = function(arg0, arg1) {
9285
+ getObject(arg0).abort(getObject(arg1));
9286
+ };
7915
9287
  imports.wbg.__wbg_abort_775ef1d17fc65868 = function(arg0) {
7916
9288
  getObject(arg0).abort();
7917
9289
  };
@@ -7930,6 +9302,10 @@ function __wbg_get_imports() {
7930
9302
  const ret = getObject(arg0).async;
7931
9303
  return ret;
7932
9304
  };
9305
+ imports.wbg.__wbg_authorization_new = function(arg0) {
9306
+ const ret = Authorization.__wrap(arg0);
9307
+ return addHeapObject(ret);
9308
+ };
7933
9309
  imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
7934
9310
  const ret = getObject(arg0).buffer;
7935
9311
  return addHeapObject(ret);
@@ -7946,6 +9322,10 @@ function __wbg_get_imports() {
7946
9322
  const ret = Ciphertext.__wrap(arg0);
7947
9323
  return addHeapObject(ret);
7948
9324
  };
9325
+ imports.wbg.__wbg_clearTimeout_86721db0036bea98 = function(arg0) {
9326
+ const ret = clearTimeout(takeObject(arg0));
9327
+ return addHeapObject(ret);
9328
+ };
7949
9329
  imports.wbg.__wbg_crypto_ed58b8e10a292839 = function(arg0) {
7950
9330
  const ret = getObject(arg0).crypto;
7951
9331
  return addHeapObject(ret);
@@ -7977,7 +9357,7 @@ function __wbg_get_imports() {
7977
9357
  const ret = getObject(arg0).fetch(getObject(arg1));
7978
9358
  return addHeapObject(ret);
7979
9359
  };
7980
- imports.wbg.__wbg_fetch_f1856afdb49415d1 = function(arg0) {
9360
+ imports.wbg.__wbg_fetch_d36a73832f0a45e8 = function(arg0) {
7981
9361
  const ret = fetch(getObject(arg0));
7982
9362
  return addHeapObject(ret);
7983
9363
  };
@@ -8042,7 +9422,7 @@ function __wbg_get_imports() {
8042
9422
  const ret = getObject(arg0).length;
8043
9423
  return ret;
8044
9424
  };
8045
- imports.wbg.__wbg_log_c2efb44aadd442a1 = function(arg0, arg1) {
9425
+ imports.wbg.__wbg_log_b1cdcca99372fe6e = function(arg0, arg1) {
8046
9426
  console.log(getStringFromWasm0(arg0, arg1));
8047
9427
  };
8048
9428
  imports.wbg.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
@@ -8060,7 +9440,7 @@ function __wbg_get_imports() {
8060
9440
  const a = state0.a;
8061
9441
  state0.a = 0;
8062
9442
  try {
8063
- return __wbg_adapter_526(a, state0.b, arg0, arg1);
9443
+ return __wbg_adapter_606(a, state0.b, arg0, arg1);
8064
9444
  } finally {
8065
9445
  state0.a = a;
8066
9446
  }
@@ -8156,6 +9536,10 @@ function __wbg_get_imports() {
8156
9536
  const ret = getObject(arg0).process;
8157
9537
  return addHeapObject(ret);
8158
9538
  };
9539
+ imports.wbg.__wbg_provingrequest_new = function(arg0) {
9540
+ const ret = ProvingRequest.__wrap(arg0);
9541
+ return addHeapObject(ret);
9542
+ };
8159
9543
  imports.wbg.__wbg_push_737cfc8c1432c2c6 = function(arg0, arg1) {
8160
9544
  const ret = getObject(arg0).push(getObject(arg1));
8161
9545
  return ret;
@@ -8200,6 +9584,10 @@ function __wbg_get_imports() {
8200
9584
  imports.wbg.__wbg_send_40a47636ff90f64d = function() { return handleError(function (arg0) {
8201
9585
  getObject(arg0).send();
8202
9586
  }, arguments) };
9587
+ imports.wbg.__wbg_setTimeout_2e707715f8cc9497 = function(arg0, arg1) {
9588
+ const ret = setTimeout(getObject(arg0), arg1);
9589
+ return addHeapObject(ret);
9590
+ };
8203
9591
  imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
8204
9592
  getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
8205
9593
  };
@@ -8239,7 +9627,7 @@ function __wbg_get_imports() {
8239
9627
  const ret = Signature.__wrap(arg0);
8240
9628
  return addHeapObject(ret);
8241
9629
  };
8242
- imports.wbg.__wbg_spawnWorker_901bb736b5f301e9 = function(arg0, arg1, arg2, arg3) {
9630
+ imports.wbg.__wbg_spawnWorker_41e51220404b3348 = function(arg0, arg1, arg2, arg3) {
8243
9631
  const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
8244
9632
  return addHeapObject(ret);
8245
9633
  };
@@ -8359,12 +9747,16 @@ function __wbg_get_imports() {
8359
9747
  const ret = false;
8360
9748
  return ret;
8361
9749
  };
8362
- imports.wbg.__wbindgen_closure_wrapper6083 = function(arg0, arg1, arg2) {
8363
- const ret = makeMutClosure(arg0, arg1, 519, __wbg_adapter_40);
9750
+ imports.wbg.__wbindgen_closure_wrapper6193 = function(arg0, arg1, arg2) {
9751
+ const ret = makeMutClosure(arg0, arg1, 470, __wbg_adapter_40);
9752
+ return addHeapObject(ret);
9753
+ };
9754
+ imports.wbg.__wbindgen_closure_wrapper6795 = function(arg0, arg1, arg2) {
9755
+ const ret = makeMutClosure(arg0, arg1, 470, __wbg_adapter_43);
8364
9756
  return addHeapObject(ret);
8365
9757
  };
8366
- imports.wbg.__wbindgen_closure_wrapper6089 = function(arg0, arg1, arg2) {
8367
- const ret = makeMutClosure(arg0, arg1, 519, __wbg_adapter_40);
9758
+ imports.wbg.__wbindgen_closure_wrapper6799 = function(arg0, arg1, arg2) {
9759
+ const ret = makeMutClosure(arg0, arg1, 470, __wbg_adapter_43);
8368
9760
  return addHeapObject(ret);
8369
9761
  };
8370
9762
  imports.wbg.__wbindgen_is_function = function(arg0) {
@@ -8440,7 +9832,7 @@ function __wbg_get_imports() {
8440
9832
  }
8441
9833
 
8442
9834
  function __wbg_init_memory(imports, memory) {
8443
- imports.wbg.memory = memory || new WebAssembly.Memory({initial:22,maximum:65536,shared:true});
9835
+ imports.wbg.memory = memory || new WebAssembly.Memory({initial:119,maximum:65536,shared:true});
8444
9836
  }
8445
9837
 
8446
9838
  function __wbg_finalize_init(instance, module, thread_stack_size) {
@@ -8508,13 +9900,17 @@ async function __wbg_init(module_or_path, memory) {
8508
9900
  var exports = /*#__PURE__*/Object.freeze({
8509
9901
  __proto__: null,
8510
9902
  Address: Address,
9903
+ Authorization: Authorization,
8511
9904
  BHP1024: BHP1024,
8512
9905
  BHP256: BHP256,
8513
9906
  BHP512: BHP512,
8514
9907
  BHP768: BHP768,
9908
+ Boolean: Boolean,
8515
9909
  Ciphertext: Ciphertext,
8516
9910
  ComputeKey: ComputeKey,
9911
+ EncryptionToolkit: EncryptionToolkit,
8517
9912
  Execution: Execution,
9913
+ ExecutionRequest: ExecutionRequest,
8518
9914
  ExecutionResponse: ExecutionResponse,
8519
9915
  Field: Field,
8520
9916
  GraphKey: GraphKey,
@@ -8533,6 +9929,7 @@ var exports = /*#__PURE__*/Object.freeze({
8533
9929
  Program: Program,
8534
9930
  ProgramManager: ProgramManager,
8535
9931
  ProvingKey: ProvingKey,
9932
+ ProvingRequest: ProvingRequest,
8536
9933
  RecordCiphertext: RecordCiphertext,
8537
9934
  RecordPlaintext: RecordPlaintext,
8538
9935
  Scalar: Scalar,