pshenmic-dpp 1.0.4 → 1.0.5

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.
Files changed (81) hide show
  1. package/.github/workflows/build.yml +8 -0
  2. package/.github/workflows/publish.yml +8 -0
  3. package/Cargo.lock +79 -31
  4. package/Cargo.toml +20 -17
  5. package/README.md +66 -23
  6. package/babel.config.json +19 -0
  7. package/dist/wasm/pshenmic_dpp.js +2487 -355
  8. package/dist/wasm/pshenmic_dpp_bg.js +1 -1
  9. package/package.json +13 -6
  10. package/packages/cbor_conversation/Cargo.toml +1 -1
  11. package/packages/data_contract/Cargo.toml +2 -2
  12. package/packages/data_contract/src/lib.rs +195 -23
  13. package/packages/data_contract_transitions/Cargo.toml +1 -1
  14. package/packages/data_contract_transitions/src/create/mod.rs +23 -16
  15. package/packages/data_contract_transitions/src/update/mod.rs +21 -12
  16. package/packages/document/Cargo.toml +1 -1
  17. package/packages/document/src/lib.rs +1 -1
  18. package/packages/document/src/methods/mod.rs +370 -2
  19. package/packages/{document_batch → documents_batch}/Cargo.toml +6 -4
  20. package/packages/documents_batch/src/document_base_transition/mod.rs +92 -0
  21. package/packages/documents_batch/src/document_transition/mod.rs +166 -0
  22. package/packages/documents_batch/src/generators.rs +122 -0
  23. package/packages/documents_batch/src/lib.rs +188 -0
  24. package/packages/documents_batch/src/prefunded_voting_balance/mod.rs +45 -0
  25. package/packages/documents_batch/src/transitions/create/mod.rs +123 -0
  26. package/packages/documents_batch/src/transitions/delete/mod.rs +67 -0
  27. package/packages/documents_batch/src/transitions/mod.rs +6 -0
  28. package/packages/documents_batch/src/transitions/purchase/mod.rs +91 -0
  29. package/packages/documents_batch/src/transitions/replace/mod.rs +93 -0
  30. package/packages/documents_batch/src/transitions/transfer/mod.rs +86 -0
  31. package/packages/documents_batch/src/transitions/update_price/mod.rs +75 -0
  32. package/packages/enums/Cargo.toml +3 -3
  33. package/packages/enums/src/batch/batch_enum.rs +75 -10
  34. package/packages/enums/src/keys/key_type.rs +46 -0
  35. package/packages/enums/src/keys/purpose.rs +55 -0
  36. package/packages/enums/src/keys/security_level.rs +46 -0
  37. package/packages/enums/src/lib.rs +1 -0
  38. package/packages/enums/src/network/mod.rs +67 -0
  39. package/packages/enums/src/platform/mod.rs +66 -8
  40. package/packages/identity/Cargo.toml +3 -4
  41. package/packages/identity/src/lib.rs +25 -14
  42. package/packages/{public_key → identity_public_key}/Cargo.toml +1 -1
  43. package/packages/{public_key → identity_public_key}/src/lib.rs +74 -27
  44. package/packages/identity_transitions/Cargo.toml +2 -2
  45. package/packages/identity_transitions/src/create_transition/mod.rs +3 -1
  46. package/packages/identity_transitions/src/create_transition/public_key_in_creation/mod.rs +25 -21
  47. package/packages/mock_bls/Cargo.toml +1 -1
  48. package/packages/private_key/Cargo.toml +3 -2
  49. package/packages/private_key/src/lib.rs +44 -6
  50. package/packages/state_transition/Cargo.toml +5 -4
  51. package/packages/state_transition/src/lib.rs +101 -36
  52. package/packages/utils/Cargo.toml +1 -2
  53. package/packages/utils/src/lib.rs +17 -15
  54. package/scripts/build-js.sh +6 -5
  55. package/scripts/build.sh +22 -1
  56. package/src/lib.rs +7 -1
  57. package/tests/DataContract.spec.js +175 -0
  58. package/tests/DataContractCreateStateTransition.spec.js +109 -0
  59. package/tests/DataContractUpdateStateTransition.spec.js +109 -0
  60. package/tests/Document.spec.js +232 -0
  61. package/tests/DocumentBatchTransition.spec.js +109 -0
  62. package/tests/DocumentTransition.spec.js +97 -0
  63. package/tests/DocumentsTransitions.spec.js +705 -0
  64. package/tests/Identity.spec.js +113 -0
  65. package/tests/IdentityPublicKey.spec.js +132 -0
  66. package/tests/PrivateKey.spec.js +73 -0
  67. package/tests/mocks/DataContract/DataContract.json +153 -0
  68. package/tests/mocks/DataContract/index.js +6 -0
  69. package/tests/mocks/Document/DataContract.json +23 -0
  70. package/tests/mocks/Document/document.json +3 -0
  71. package/tests/mocks/Document/document2.json +3 -0
  72. package/tests/mocks/Document/index.js +11 -0
  73. package/tests/mocks/Identity/index.js +7 -0
  74. package/tests/mocks/PrivateKey/index.js +5 -0
  75. package/tests/mocks/PublicKey/index.js +14 -0
  76. package/tests/utils/hex.js +15 -0
  77. package/tests/utils/wasm.js +14 -0
  78. package/packages/document/src/methods/js.rs +0 -260
  79. package/packages/document/src/methods/rust.rs +0 -92
  80. package/packages/document_batch/src/generators.rs +0 -63
  81. package/packages/document_batch/src/lib.rs +0 -228
@@ -25,6 +25,18 @@ function handleError(f, args) {
25
25
  }
26
26
  }
27
27
 
28
+ function dropObject(idx) {
29
+ if (idx < 132) return;
30
+ heap[idx] = heap_next;
31
+ heap_next = idx;
32
+ }
33
+
34
+ function takeObject(idx) {
35
+ const ret = getObject(idx);
36
+ dropObject(idx);
37
+ return ret;
38
+ }
39
+
28
40
  const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
29
41
 
30
42
  if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
@@ -43,20 +55,17 @@ function getStringFromWasm0(ptr, len) {
43
55
  return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
44
56
  }
45
57
 
46
- function dropObject(idx) {
47
- if (idx < 132) return;
48
- heap[idx] = heap_next;
49
- heap_next = idx;
58
+ function isLikeNone(x) {
59
+ return x === undefined || x === null;
50
60
  }
51
61
 
52
- function takeObject(idx) {
53
- const ret = getObject(idx);
54
- dropObject(idx);
55
- return ret;
56
- }
62
+ let cachedDataViewMemory0 = null;
57
63
 
58
- function isLikeNone(x) {
59
- return x === undefined || x === null;
64
+ function getDataViewMemory0() {
65
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
66
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
67
+ }
68
+ return cachedDataViewMemory0;
60
69
  }
61
70
 
62
71
  function debugString(val) {
@@ -180,15 +189,6 @@ function passStringToWasm0(arg, malloc, realloc) {
180
189
  return ptr;
181
190
  }
182
191
 
183
- let cachedDataViewMemory0 = null;
184
-
185
- function getDataViewMemory0() {
186
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
187
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
188
- }
189
- return cachedDataViewMemory0;
190
- }
191
-
192
192
  function getArrayU8FromWasm0(ptr, len) {
193
193
  ptr = ptr >>> 0;
194
194
  return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
@@ -217,6 +217,16 @@ function getArrayJsValueFromWasm0(ptr, len) {
217
217
  return result;
218
218
  }
219
219
 
220
+ function passArrayJsValueToWasm0(array, malloc) {
221
+ const ptr = malloc(array.length * 4, 4) >>> 0;
222
+ const mem = getDataViewMemory0();
223
+ for (let i = 0; i < array.length; i++) {
224
+ mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
225
+ }
226
+ WASM_VECTOR_LEN = array.length;
227
+ return ptr;
228
+ }
229
+
220
230
  let stack_pointer = 128;
221
231
 
222
232
  function addBorrowedObject(obj) {
@@ -258,12 +268,16 @@ export function cborToObject(cbor) {
258
268
  }
259
269
 
260
270
  /**
261
- * @enum {0 | 1 | 2}
271
+ * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6}
262
272
  */
263
273
  export const BatchType = Object.freeze({
264
- CREATE: 0, "0": "CREATE",
265
- REPLACE: 1, "1": "REPLACE",
266
- DELETE: 2, "2": "DELETE",
274
+ Create: 0, "0": "Create",
275
+ Replace: 1, "1": "Replace",
276
+ Delete: 2, "2": "Delete",
277
+ Transfer: 3, "3": "Transfer",
278
+ Purchase: 4, "4": "Purchase",
279
+ UpdatePrice: 5, "5": "UpdatePrice",
280
+ IgnoreWhileBumpingRevision: 6, "6": "IgnoreWhileBumpingRevision",
267
281
  });
268
282
  /**
269
283
  * @enum {0 | 1 | 2 | 3 | 4}
@@ -275,6 +289,15 @@ export const KeyType = Object.freeze({
275
289
  BIP13_SCRIPT_HASH: 3, "3": "BIP13_SCRIPT_HASH",
276
290
  EDDSA_25519_HASH160: 4, "4": "EDDSA_25519_HASH160",
277
291
  });
292
+ /**
293
+ * @enum {0 | 1 | 2 | 3}
294
+ */
295
+ export const NetworkWASM = Object.freeze({
296
+ Mainnet: 0, "0": "Mainnet",
297
+ Testnet: 1, "1": "Testnet",
298
+ Devnet: 2, "2": "Devnet",
299
+ Regtest: 3, "3": "Regtest",
300
+ });
278
301
  /**
279
302
  * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7}
280
303
  */
@@ -338,13 +361,13 @@ export class DataContractCreateTransitionWASM {
338
361
  /**
339
362
  * @param {DataContractWASM} data_contract
340
363
  * @param {bigint} identity_nonce
341
- * @param {PlatformVersionWASM | null} [platform_version]
364
+ * @param {any} js_platform_version
342
365
  */
343
- constructor(data_contract, identity_nonce, platform_version) {
366
+ constructor(data_contract, identity_nonce, js_platform_version) {
344
367
  try {
345
368
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
346
369
  _assertClass(data_contract, DataContractWASM);
347
- wasm.datacontractcreatetransitionwasm_new(retptr, data_contract.__wbg_ptr, identity_nonce, isLikeNone(platform_version) ? 8 : platform_version);
370
+ wasm.datacontractcreatetransitionwasm_new(retptr, data_contract.__wbg_ptr, identity_nonce, addHeapObject(js_platform_version));
348
371
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
349
372
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
350
373
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -428,14 +451,13 @@ export class DataContractCreateTransitionWASM {
428
451
  }
429
452
  /**
430
453
  * @param {DataContractWASM} data_contract
431
- * @param {PlatformVersionWASM | null} [platform_version_wasm]
454
+ * @param {any} js_platform_version
432
455
  */
433
- setDataContract(data_contract, platform_version_wasm) {
456
+ setDataContract(data_contract, js_platform_version) {
434
457
  try {
435
458
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
436
459
  _assertClass(data_contract, DataContractWASM);
437
- var ptr0 = data_contract.__destroy_into_raw();
438
- wasm.datacontractcreatetransitionwasm_setDataContract(retptr, this.__wbg_ptr, ptr0, isLikeNone(platform_version_wasm) ? 8 : platform_version_wasm);
460
+ wasm.datacontractcreatetransitionwasm_setDataContract(retptr, this.__wbg_ptr, data_contract.__wbg_ptr, addHeapObject(js_platform_version));
439
461
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
440
462
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
441
463
  if (r1) {
@@ -446,14 +468,14 @@ export class DataContractCreateTransitionWASM {
446
468
  }
447
469
  }
448
470
  /**
449
- * @param {PlatformVersionWASM | null} [platform_version_wasm]
471
+ * @param {any} js_platform_version
450
472
  * @param {boolean | null} [full_validation]
451
473
  * @returns {DataContractWASM}
452
474
  */
453
- getDataContract(platform_version_wasm, full_validation) {
475
+ getDataContract(js_platform_version, full_validation) {
454
476
  try {
455
477
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
456
- wasm.datacontractcreatetransitionwasm_getDataContract(retptr, this.__wbg_ptr, isLikeNone(platform_version_wasm) ? 8 : platform_version_wasm, isLikeNone(full_validation) ? 0xFFFFFF : full_validation ? 1 : 0);
478
+ wasm.datacontractcreatetransitionwasm_getDataContract(retptr, this.__wbg_ptr, addHeapObject(js_platform_version), isLikeNone(full_validation) ? 0xFFFFFF : full_validation ? 1 : 0);
457
479
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
458
480
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
459
481
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -522,13 +544,13 @@ export class DataContractUpdateTransitionWASM {
522
544
  /**
523
545
  * @param {DataContractWASM} data_contract
524
546
  * @param {bigint} identity_nonce
525
- * @param {PlatformVersionWASM | null} [platform_version]
547
+ * @param {any} js_platform_version
526
548
  */
527
- constructor(data_contract, identity_nonce, platform_version) {
549
+ constructor(data_contract, identity_nonce, js_platform_version) {
528
550
  try {
529
551
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
530
552
  _assertClass(data_contract, DataContractWASM);
531
- wasm.datacontractupdatetransitionwasm_new(retptr, data_contract.__wbg_ptr, identity_nonce, isLikeNone(platform_version) ? 8 : platform_version);
553
+ wasm.datacontractupdatetransitionwasm_new(retptr, data_contract.__wbg_ptr, identity_nonce, addHeapObject(js_platform_version));
532
554
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
533
555
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
534
556
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -612,13 +634,13 @@ export class DataContractUpdateTransitionWASM {
612
634
  }
613
635
  /**
614
636
  * @param {DataContractWASM} data_contract
615
- * @param {PlatformVersionWASM | null} [platform_version_wasm]
637
+ * @param {any} js_platform_version
616
638
  */
617
- setDataContract(data_contract, platform_version_wasm) {
639
+ setDataContract(data_contract, js_platform_version) {
618
640
  try {
619
641
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
620
642
  _assertClass(data_contract, DataContractWASM);
621
- wasm.datacontractupdatetransitionwasm_setDataContract(retptr, this.__wbg_ptr, data_contract.__wbg_ptr, isLikeNone(platform_version_wasm) ? 8 : platform_version_wasm);
643
+ wasm.datacontractupdatetransitionwasm_setDataContract(retptr, this.__wbg_ptr, data_contract.__wbg_ptr, addHeapObject(js_platform_version));
622
644
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
623
645
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
624
646
  if (r1) {
@@ -629,14 +651,14 @@ export class DataContractUpdateTransitionWASM {
629
651
  }
630
652
  }
631
653
  /**
632
- * @param {boolean | null} [full_validation]
633
- * @param {PlatformVersionWASM | null} [platform_version_wasm]
654
+ * @param {boolean | null | undefined} full_validation
655
+ * @param {any} js_platform_version
634
656
  * @returns {DataContractWASM}
635
657
  */
636
- getDataContract(full_validation, platform_version_wasm) {
658
+ getDataContract(full_validation, js_platform_version) {
637
659
  try {
638
660
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
639
- wasm.datacontractupdatetransitionwasm_getDataContract(retptr, this.__wbg_ptr, isLikeNone(full_validation) ? 0xFFFFFF : full_validation ? 1 : 0, isLikeNone(platform_version_wasm) ? 8 : platform_version_wasm);
661
+ wasm.datacontractupdatetransitionwasm_getDataContract(retptr, this.__wbg_ptr, isLikeNone(full_validation) ? 0xFFFFFF : full_validation ? 1 : 0, addHeapObject(js_platform_version));
640
662
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
641
663
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
642
664
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -703,14 +725,17 @@ export class DataContractWASM {
703
725
  wasm.__wbg_datacontractwasm_free(ptr, 0);
704
726
  }
705
727
  /**
706
- * @param {any} js_value
728
+ * @param {any} js_owner_id
729
+ * @param {bigint} identity_nonce
730
+ * @param {any} js_schema
731
+ * @param {object | null | undefined} js_definitions
707
732
  * @param {boolean} full_validation
708
- * @param {PlatformVersionWASM} platform_version
733
+ * @param {any} js_platform_version
709
734
  */
710
- constructor(js_value, full_validation, platform_version) {
735
+ constructor(js_owner_id, identity_nonce, js_schema, js_definitions, full_validation, js_platform_version) {
711
736
  try {
712
737
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
713
- wasm.datacontractwasm_new(retptr, addHeapObject(js_value), full_validation, platform_version);
738
+ wasm.datacontractwasm_from_js_values(retptr, addHeapObject(js_owner_id), identity_nonce, addHeapObject(js_schema), isLikeNone(js_definitions) ? 0 : addHeapObject(js_definitions), full_validation, addHeapObject(js_platform_version));
714
739
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
715
740
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
716
741
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -724,18 +749,39 @@ export class DataContractWASM {
724
749
  wasm.__wbindgen_add_to_stack_pointer(16);
725
750
  }
726
751
  }
752
+ /**
753
+ * @param {any} js_value
754
+ * @param {boolean} full_validation
755
+ * @param {any} js_platform_version
756
+ * @returns {DataContractWASM}
757
+ */
758
+ static fromValue(js_value, full_validation, js_platform_version) {
759
+ try {
760
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
761
+ wasm.datacontractwasm_fromValue(retptr, addHeapObject(js_value), full_validation, addHeapObject(js_platform_version));
762
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
763
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
764
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
765
+ if (r2) {
766
+ throw takeObject(r1);
767
+ }
768
+ return DataContractWASM.__wrap(r0);
769
+ } finally {
770
+ wasm.__wbindgen_add_to_stack_pointer(16);
771
+ }
772
+ }
727
773
  /**
728
774
  * @param {Uint8Array} bytes
729
775
  * @param {boolean} full_validation
730
- * @param {PlatformVersionWASM} platform_version
776
+ * @param {any} js_platform_version
731
777
  * @returns {DataContractWASM}
732
778
  */
733
- static fromBytes(bytes, full_validation, platform_version) {
779
+ static fromBytes(bytes, full_validation, js_platform_version) {
734
780
  try {
735
781
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
736
782
  const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export_1);
737
783
  const len0 = WASM_VECTOR_LEN;
738
- wasm.datacontractwasm_fromBytes(retptr, ptr0, len0, full_validation, platform_version);
784
+ wasm.datacontractwasm_fromBytes(retptr, ptr0, len0, full_validation, addHeapObject(js_platform_version));
739
785
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
740
786
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
741
787
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -748,13 +794,13 @@ export class DataContractWASM {
748
794
  }
749
795
  }
750
796
  /**
751
- * @param {PlatformVersionWASM} platform_version
797
+ * @param {any} js_platform_version
752
798
  * @returns {Uint8Array}
753
799
  */
754
- toBytes(platform_version) {
800
+ toBytes(js_platform_version) {
755
801
  try {
756
802
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
757
- wasm.datacontractwasm_toBytes(retptr, this.__wbg_ptr, platform_version);
803
+ wasm.datacontractwasm_toBytes(retptr, this.__wbg_ptr, addHeapObject(js_platform_version));
758
804
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
759
805
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
760
806
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -770,13 +816,13 @@ export class DataContractWASM {
770
816
  }
771
817
  }
772
818
  /**
773
- * @param {PlatformVersionWASM} platform_version
819
+ * @param {any} js_platform_version
774
820
  * @returns {any}
775
821
  */
776
- toValue(platform_version) {
822
+ toValue(js_platform_version) {
777
823
  try {
778
824
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
779
- wasm.datacontractwasm_toValue(retptr, this.__wbg_ptr, platform_version);
825
+ wasm.datacontractwasm_toValue(retptr, this.__wbg_ptr, addHeapObject(js_platform_version));
780
826
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
781
827
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
782
828
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -791,10 +837,10 @@ export class DataContractWASM {
791
837
  /**
792
838
  * @returns {any}
793
839
  */
794
- getSchemas() {
840
+ getSchema() {
795
841
  try {
796
842
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
797
- wasm.datacontractwasm_getSchemas(retptr, this.__wbg_ptr);
843
+ wasm.datacontractwasm_getSchema(retptr, this.__wbg_ptr);
798
844
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
799
845
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
800
846
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -809,8 +855,8 @@ export class DataContractWASM {
809
855
  /**
810
856
  * @returns {number}
811
857
  */
812
- getDataContractVersion() {
813
- const ret = wasm.datacontractwasm_getDataContractVersion(this.__wbg_ptr);
858
+ getVersion() {
859
+ const ret = wasm.datacontractwasm_getVersion(this.__wbg_ptr);
814
860
  return ret >>> 0;
815
861
  }
816
862
  /**
@@ -864,54 +910,51 @@ export class DataContractWASM {
864
910
  }
865
911
  }
866
912
  /**
867
- * @param {PlatformVersionWASM} platform_version
868
- * @returns {any}
913
+ * @param {any} js_data_contract_id
869
914
  */
870
- toJson(platform_version) {
915
+ setId(js_data_contract_id) {
871
916
  try {
872
917
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
873
- wasm.datacontractwasm_toJson(retptr, this.__wbg_ptr, platform_version);
918
+ wasm.datacontractwasm_setId(retptr, this.__wbg_ptr, addHeapObject(js_data_contract_id));
874
919
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
875
920
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
876
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
877
- if (r2) {
878
- throw takeObject(r1);
921
+ if (r1) {
922
+ throw takeObject(r0);
879
923
  }
880
- return takeObject(r0);
881
924
  } finally {
882
925
  wasm.__wbindgen_add_to_stack_pointer(16);
883
926
  }
884
927
  }
885
928
  /**
886
929
  * @param {any} js_owner_id
887
- * @param {bigint} identity_nonce
888
- * @returns {Uint8Array}
889
930
  */
890
- static generateId(js_owner_id, identity_nonce) {
931
+ setOwnerId(js_owner_id) {
891
932
  try {
892
933
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
893
- wasm.datacontractwasm_generateId(retptr, addHeapObject(js_owner_id), identity_nonce);
934
+ wasm.datacontractwasm_setOwnerId(retptr, this.__wbg_ptr, addHeapObject(js_owner_id));
894
935
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
895
936
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
896
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
897
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
898
- if (r3) {
899
- throw takeObject(r2);
937
+ if (r1) {
938
+ throw takeObject(r0);
900
939
  }
901
- var v1 = getArrayU8FromWasm0(r0, r1).slice();
902
- wasm.__wbindgen_export_3(r0, r1 * 1, 1);
903
- return v1;
904
940
  } finally {
905
941
  wasm.__wbindgen_add_to_stack_pointer(16);
906
942
  }
907
943
  }
908
944
  /**
909
- * @param {any} js_data_contract_id
945
+ * @param {number} version
910
946
  */
911
- setId(js_data_contract_id) {
947
+ setVersion(version) {
948
+ wasm.datacontractwasm_setVersion(this.__wbg_ptr, version);
949
+ }
950
+ /**
951
+ * @param {any} js_config
952
+ * @param {any} js_platform_version
953
+ */
954
+ setConfig(js_config, js_platform_version) {
912
955
  try {
913
956
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
914
- wasm.datacontractwasm_setId(retptr, this.__wbg_ptr, addHeapObject(js_data_contract_id));
957
+ wasm.datacontractwasm_setConfig(retptr, this.__wbg_ptr, addHeapObject(js_config), addHeapObject(js_platform_version));
915
958
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
916
959
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
917
960
  if (r1) {
@@ -922,12 +965,15 @@ export class DataContractWASM {
922
965
  }
923
966
  }
924
967
  /**
925
- * @param {any} js_owner_id
968
+ * @param {any} js_schema
969
+ * @param {object | null | undefined} js_definitions
970
+ * @param {boolean} full_validation
971
+ * @param {any} js_platform_version
926
972
  */
927
- setOwnerId(js_owner_id) {
973
+ setSchema(js_schema, js_definitions, full_validation, js_platform_version) {
928
974
  try {
929
975
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
930
- wasm.datacontractwasm_setOwnerId(retptr, this.__wbg_ptr, addHeapObject(js_owner_id));
976
+ wasm.datacontractwasm_setSchema(retptr, this.__wbg_ptr, addHeapObject(js_schema), isLikeNone(js_definitions) ? 0 : addHeapObject(js_definitions), full_validation, addHeapObject(js_platform_version));
931
977
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
932
978
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
933
979
  if (r1) {
@@ -937,44 +983,87 @@ export class DataContractWASM {
937
983
  wasm.__wbindgen_add_to_stack_pointer(16);
938
984
  }
939
985
  }
986
+ /**
987
+ * @param {any} js_platform_version
988
+ * @returns {any}
989
+ */
990
+ toJson(js_platform_version) {
991
+ try {
992
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
993
+ wasm.datacontractwasm_toJson(retptr, this.__wbg_ptr, addHeapObject(js_platform_version));
994
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
995
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
996
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
997
+ if (r2) {
998
+ throw takeObject(r1);
999
+ }
1000
+ return takeObject(r0);
1001
+ } finally {
1002
+ wasm.__wbindgen_add_to_stack_pointer(16);
1003
+ }
1004
+ }
1005
+ /**
1006
+ * @param {any} js_owner_id
1007
+ * @param {bigint} identity_nonce
1008
+ * @returns {Uint8Array}
1009
+ */
1010
+ static generateId(js_owner_id, identity_nonce) {
1011
+ try {
1012
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1013
+ wasm.datacontractwasm_generateId(retptr, addHeapObject(js_owner_id), identity_nonce);
1014
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1015
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1016
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1017
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1018
+ if (r3) {
1019
+ throw takeObject(r2);
1020
+ }
1021
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
1022
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
1023
+ return v1;
1024
+ } finally {
1025
+ wasm.__wbindgen_add_to_stack_pointer(16);
1026
+ }
1027
+ }
940
1028
  }
941
1029
 
942
- const DocumentBatchWASMFinalization = (typeof FinalizationRegistry === 'undefined')
1030
+ const DocumentBaseTransitionWASMFinalization = (typeof FinalizationRegistry === 'undefined')
943
1031
  ? { register: () => {}, unregister: () => {} }
944
- : new FinalizationRegistry(ptr => wasm.__wbg_documentbatchwasm_free(ptr >>> 0, 1));
1032
+ : new FinalizationRegistry(ptr => wasm.__wbg_documentbasetransitionwasm_free(ptr >>> 0, 1));
945
1033
 
946
- export class DocumentBatchWASM {
1034
+ export class DocumentBaseTransitionWASM {
947
1035
 
948
1036
  static __wrap(ptr) {
949
1037
  ptr = ptr >>> 0;
950
- const obj = Object.create(DocumentBatchWASM.prototype);
1038
+ const obj = Object.create(DocumentBaseTransitionWASM.prototype);
951
1039
  obj.__wbg_ptr = ptr;
952
- DocumentBatchWASMFinalization.register(obj, obj.__wbg_ptr, obj);
1040
+ DocumentBaseTransitionWASMFinalization.register(obj, obj.__wbg_ptr, obj);
953
1041
  return obj;
954
1042
  }
955
1043
 
956
1044
  __destroy_into_raw() {
957
1045
  const ptr = this.__wbg_ptr;
958
1046
  this.__wbg_ptr = 0;
959
- DocumentBatchWASMFinalization.unregister(this);
1047
+ DocumentBaseTransitionWASMFinalization.unregister(this);
960
1048
  return ptr;
961
1049
  }
962
1050
 
963
1051
  free() {
964
1052
  const ptr = this.__destroy_into_raw();
965
- wasm.__wbg_documentbatchwasm_free(ptr, 0);
1053
+ wasm.__wbg_documentbasetransitionwasm_free(ptr, 0);
966
1054
  }
967
1055
  /**
968
- * @param {BatchType} batch_type
969
- * @param {DocumentWASM} document
1056
+ * @param {any} js_document_id
970
1057
  * @param {bigint} identity_contract_nonce
1058
+ * @param {string} document_type_name
1059
+ * @param {any} js_data_contract_id
971
1060
  */
972
- constructor(batch_type, document, identity_contract_nonce) {
1061
+ constructor(js_document_id, identity_contract_nonce, document_type_name, js_data_contract_id) {
973
1062
  try {
974
1063
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
975
- _assertClass(document, DocumentWASM);
976
- var ptr0 = document.__destroy_into_raw();
977
- wasm.documentbatchwasm_new(retptr, batch_type, ptr0, identity_contract_nonce);
1064
+ const ptr0 = passStringToWasm0(document_type_name, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
1065
+ const len0 = WASM_VECTOR_LEN;
1066
+ wasm.documentbasetransitionwasm_new(retptr, addHeapObject(js_document_id), identity_contract_nonce, ptr0, len0, addHeapObject(js_data_contract_id));
978
1067
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
979
1068
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
980
1069
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -982,168 +1071,1286 @@ export class DocumentBatchWASM {
982
1071
  throw takeObject(r1);
983
1072
  }
984
1073
  this.__wbg_ptr = r0 >>> 0;
985
- DocumentBatchWASMFinalization.register(this, this.__wbg_ptr, this);
1074
+ DocumentBaseTransitionWASMFinalization.register(this, this.__wbg_ptr, this);
986
1075
  return this;
987
1076
  } finally {
988
1077
  wasm.__wbindgen_add_to_stack_pointer(16);
989
1078
  }
990
1079
  }
991
1080
  /**
992
- * @returns {StateTransitionWASM}
1081
+ * @returns {Uint8Array}
993
1082
  */
994
- toStateTransition() {
995
- const ret = wasm.documentbatchwasm_toStateTransition(this.__wbg_ptr);
996
- return StateTransitionWASM.__wrap(ret);
1083
+ get id() {
1084
+ try {
1085
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1086
+ wasm.documentbasetransitionwasm_get_id(retptr, this.__wbg_ptr);
1087
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1088
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1089
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
1090
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
1091
+ return v1;
1092
+ } finally {
1093
+ wasm.__wbindgen_add_to_stack_pointer(16);
1094
+ }
997
1095
  }
998
1096
  /**
999
- * @returns {any}
1097
+ * @returns {bigint}
1000
1098
  */
1001
- toBytes() {
1099
+ get identityContractNonce() {
1100
+ const ret = wasm.documentbasetransitionwasm_get_identity_contract_nonce(this.__wbg_ptr);
1101
+ return BigInt.asUintN(64, ret);
1102
+ }
1103
+ /**
1104
+ * @returns {Uint8Array}
1105
+ */
1106
+ get dataContractId() {
1002
1107
  try {
1003
1108
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1004
- wasm.documentbatchwasm_toBytes(retptr, this.__wbg_ptr);
1109
+ wasm.documentbasetransitionwasm_get_data_contract_id(retptr, this.__wbg_ptr);
1005
1110
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1006
1111
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1007
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1008
- if (r2) {
1009
- throw takeObject(r1);
1010
- }
1011
- return takeObject(r0);
1112
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
1113
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
1114
+ return v1;
1012
1115
  } finally {
1013
1116
  wasm.__wbindgen_add_to_stack_pointer(16);
1014
1117
  }
1015
1118
  }
1016
1119
  /**
1017
- * @param {StateTransitionWASM} state_transition
1018
- * @returns {DocumentBatchWASM}
1120
+ * @returns {string}
1019
1121
  */
1020
- static fromStateTransition(state_transition) {
1122
+ get documentTypeName() {
1123
+ let deferred1_0;
1124
+ let deferred1_1;
1021
1125
  try {
1022
1126
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1023
- _assertClass(state_transition, StateTransitionWASM);
1024
- var ptr0 = state_transition.__destroy_into_raw();
1025
- wasm.documentbatchwasm_fromStateTransition(retptr, ptr0);
1127
+ wasm.documentbasetransitionwasm_get_document_type_name(retptr, this.__wbg_ptr);
1026
1128
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1027
1129
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1028
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1029
- if (r2) {
1030
- throw takeObject(r1);
1031
- }
1032
- return DocumentBatchWASM.__wrap(r0);
1130
+ deferred1_0 = r0;
1131
+ deferred1_1 = r1;
1132
+ return getStringFromWasm0(r0, r1);
1033
1133
  } finally {
1034
1134
  wasm.__wbindgen_add_to_stack_pointer(16);
1135
+ wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
1035
1136
  }
1036
1137
  }
1037
1138
  /**
1038
- * @param {Uint8Array} bytes
1039
- * @returns {DocumentBatchWASM}
1139
+ * @param {any} js_id
1040
1140
  */
1041
- static fromBytes(bytes) {
1141
+ set id(js_id) {
1042
1142
  try {
1043
1143
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1044
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export_1);
1045
- const len0 = WASM_VECTOR_LEN;
1046
- wasm.documentbatchwasm_fromBytes(retptr, ptr0, len0);
1144
+ wasm.documentbasetransitionwasm_set_id(retptr, this.__wbg_ptr, addHeapObject(js_id));
1047
1145
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1048
1146
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1049
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1050
- if (r2) {
1051
- throw takeObject(r1);
1147
+ if (r1) {
1148
+ throw takeObject(r0);
1052
1149
  }
1053
- return DocumentBatchWASM.__wrap(r0);
1054
1150
  } finally {
1055
1151
  wasm.__wbindgen_add_to_stack_pointer(16);
1056
1152
  }
1057
1153
  }
1058
1154
  /**
1059
- * @returns {DocumentWASM}
1155
+ * @param {bigint} nonce
1060
1156
  */
1061
- getDocument() {
1062
- const ret = wasm.documentbatchwasm_getDocument(this.__wbg_ptr);
1063
- return DocumentWASM.__wrap(ret);
1157
+ set identityContractNonce(nonce) {
1158
+ wasm.documentbasetransitionwasm_set_identity_contract_nonce(this.__wbg_ptr, nonce);
1064
1159
  }
1065
1160
  /**
1066
- * @returns {Uint8Array}
1161
+ * @param {any} js_data_contract_id
1067
1162
  */
1068
- getSignature() {
1163
+ set dataContractId(js_data_contract_id) {
1069
1164
  try {
1070
1165
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1071
- wasm.documentbatchwasm_getSignature(retptr, this.__wbg_ptr);
1166
+ wasm.documentbasetransitionwasm_set_data_contract_id(retptr, this.__wbg_ptr, addHeapObject(js_data_contract_id));
1072
1167
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1073
1168
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1074
- var v1 = getArrayU8FromWasm0(r0, r1).slice();
1075
- wasm.__wbindgen_export_3(r0, r1 * 1, 1);
1076
- return v1;
1169
+ if (r1) {
1170
+ throw takeObject(r0);
1171
+ }
1077
1172
  } finally {
1078
1173
  wasm.__wbindgen_add_to_stack_pointer(16);
1079
1174
  }
1080
1175
  }
1176
+ /**
1177
+ * @param {string} document_type_name
1178
+ */
1179
+ set documentTypeName(document_type_name) {
1180
+ const ptr0 = passStringToWasm0(document_type_name, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
1181
+ const len0 = WASM_VECTOR_LEN;
1182
+ wasm.documentbasetransitionwasm_set_document_type_name(this.__wbg_ptr, ptr0, len0);
1183
+ }
1081
1184
  }
1082
1185
 
1083
- const DocumentWASMFinalization = (typeof FinalizationRegistry === 'undefined')
1186
+ const DocumentCreateTransitionWASMFinalization = (typeof FinalizationRegistry === 'undefined')
1084
1187
  ? { register: () => {}, unregister: () => {} }
1085
- : new FinalizationRegistry(ptr => wasm.__wbg_documentwasm_free(ptr >>> 0, 1));
1188
+ : new FinalizationRegistry(ptr => wasm.__wbg_documentcreatetransitionwasm_free(ptr >>> 0, 1));
1086
1189
 
1087
- export class DocumentWASM {
1190
+ export class DocumentCreateTransitionWASM {
1088
1191
 
1089
1192
  static __wrap(ptr) {
1090
1193
  ptr = ptr >>> 0;
1091
- const obj = Object.create(DocumentWASM.prototype);
1194
+ const obj = Object.create(DocumentCreateTransitionWASM.prototype);
1092
1195
  obj.__wbg_ptr = ptr;
1093
- DocumentWASMFinalization.register(obj, obj.__wbg_ptr, obj);
1196
+ DocumentCreateTransitionWASMFinalization.register(obj, obj.__wbg_ptr, obj);
1094
1197
  return obj;
1095
1198
  }
1096
1199
 
1097
1200
  __destroy_into_raw() {
1098
1201
  const ptr = this.__wbg_ptr;
1099
1202
  this.__wbg_ptr = 0;
1100
- DocumentWASMFinalization.unregister(this);
1203
+ DocumentCreateTransitionWASMFinalization.unregister(this);
1101
1204
  return ptr;
1102
1205
  }
1103
1206
 
1104
1207
  free() {
1105
1208
  const ptr = this.__destroy_into_raw();
1106
- wasm.__wbg_documentwasm_free(ptr, 0);
1107
- }
1108
- /**
1109
- * @param {any} js_raw_document
1110
- * @param {string} js_document_type_name
1111
- * @param {bigint} js_revision
1112
- * @param {string} js_data_contract_id
1113
- * @param {string} js_owner_id
1114
- */
1115
- constructor(js_raw_document, js_document_type_name, js_revision, js_data_contract_id, js_owner_id) {
1116
- const ptr0 = passStringToWasm0(js_document_type_name, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
1117
- const len0 = WASM_VECTOR_LEN;
1118
- const ptr1 = passStringToWasm0(js_data_contract_id, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
1119
- const len1 = WASM_VECTOR_LEN;
1120
- const ptr2 = passStringToWasm0(js_owner_id, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
1121
- const len2 = WASM_VECTOR_LEN;
1122
- const ret = wasm.documentwasm_js_new(addHeapObject(js_raw_document), ptr0, len0, js_revision, ptr1, len1, ptr2, len2);
1123
- this.__wbg_ptr = ret >>> 0;
1124
- DocumentWASMFinalization.register(this, this.__wbg_ptr, this);
1125
- return this;
1209
+ wasm.__wbg_documentcreatetransitionwasm_free(ptr, 0);
1126
1210
  }
1127
1211
  /**
1128
- * @returns {any}
1212
+ * @param {DocumentWASM} document
1213
+ * @param {bigint} identity_contract_nonce
1214
+ * @param {string} document_type_name
1129
1215
  */
1130
- getId() {
1131
- const ret = wasm.documentwasm_getId(this.__wbg_ptr);
1132
- return takeObject(ret);
1216
+ constructor(document, identity_contract_nonce, document_type_name) {
1217
+ try {
1218
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1219
+ _assertClass(document, DocumentWASM);
1220
+ const ptr0 = passStringToWasm0(document_type_name, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
1221
+ const len0 = WASM_VECTOR_LEN;
1222
+ wasm.documentcreatetransitionwasm_new(retptr, document.__wbg_ptr, identity_contract_nonce, ptr0, len0);
1223
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1224
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1225
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1226
+ if (r2) {
1227
+ throw takeObject(r1);
1228
+ }
1229
+ this.__wbg_ptr = r0 >>> 0;
1230
+ DocumentCreateTransitionWASMFinalization.register(this, this.__wbg_ptr, this);
1231
+ return this;
1232
+ } finally {
1233
+ wasm.__wbindgen_add_to_stack_pointer(16);
1234
+ }
1133
1235
  }
1134
1236
  /**
1135
1237
  * @returns {any}
1136
1238
  */
1239
+ get data() {
1240
+ try {
1241
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1242
+ wasm.documentcreatetransitionwasm_get_data(retptr, this.__wbg_ptr);
1243
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1244
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1245
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1246
+ if (r2) {
1247
+ throw takeObject(r1);
1248
+ }
1249
+ return takeObject(r0);
1250
+ } finally {
1251
+ wasm.__wbindgen_add_to_stack_pointer(16);
1252
+ }
1253
+ }
1254
+ /**
1255
+ * @returns {DocumentBaseTransitionWASM}
1256
+ */
1257
+ get base() {
1258
+ const ret = wasm.documentcreatetransitionwasm_get_base(this.__wbg_ptr);
1259
+ return DocumentBaseTransitionWASM.__wrap(ret);
1260
+ }
1261
+ /**
1262
+ * @returns {Uint8Array}
1263
+ */
1264
+ get entropy() {
1265
+ try {
1266
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1267
+ wasm.documentcreatetransitionwasm_get_entropy(retptr, this.__wbg_ptr);
1268
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1269
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1270
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
1271
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
1272
+ return v1;
1273
+ } finally {
1274
+ wasm.__wbindgen_add_to_stack_pointer(16);
1275
+ }
1276
+ }
1277
+ /**
1278
+ * @param {any} js_data
1279
+ */
1280
+ set data(js_data) {
1281
+ try {
1282
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1283
+ wasm.documentcreatetransitionwasm_set_data(retptr, this.__wbg_ptr, addHeapObject(js_data));
1284
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1285
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1286
+ if (r1) {
1287
+ throw takeObject(r0);
1288
+ }
1289
+ } finally {
1290
+ wasm.__wbindgen_add_to_stack_pointer(16);
1291
+ }
1292
+ }
1293
+ /**
1294
+ * @param {DocumentBaseTransitionWASM} base
1295
+ */
1296
+ set base(base) {
1297
+ _assertClass(base, DocumentBaseTransitionWASM);
1298
+ wasm.documentcreatetransitionwasm_set_base(this.__wbg_ptr, base.__wbg_ptr);
1299
+ }
1300
+ /**
1301
+ * @param {Uint8Array} js_entropy
1302
+ */
1303
+ set entropy(js_entropy) {
1304
+ try {
1305
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1306
+ const ptr0 = passArray8ToWasm0(js_entropy, wasm.__wbindgen_export_1);
1307
+ const len0 = WASM_VECTOR_LEN;
1308
+ wasm.documentcreatetransitionwasm_set_entropy(retptr, this.__wbg_ptr, ptr0, len0);
1309
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1310
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1311
+ if (r1) {
1312
+ throw takeObject(r0);
1313
+ }
1314
+ } finally {
1315
+ wasm.__wbindgen_add_to_stack_pointer(16);
1316
+ }
1317
+ }
1318
+ /**
1319
+ * @returns {PrefundedVotingBalanceWASM | undefined}
1320
+ */
1321
+ get prefundedVotingBalance() {
1322
+ const ret = wasm.documentcreatetransitionwasm_get_prefunded_voting_balance(this.__wbg_ptr);
1323
+ return ret === 0 ? undefined : PrefundedVotingBalanceWASM.__wrap(ret);
1324
+ }
1325
+ /**
1326
+ * @param {PrefundedVotingBalanceWASM} prefunded_voting_balance
1327
+ */
1328
+ set prefundedVotingBalance(prefunded_voting_balance) {
1329
+ _assertClass(prefunded_voting_balance, PrefundedVotingBalanceWASM);
1330
+ wasm.documentcreatetransitionwasm_set_prefunded_voting_balance(this.__wbg_ptr, prefunded_voting_balance.__wbg_ptr);
1331
+ }
1332
+ clearPrefundedVotingBalance() {
1333
+ wasm.documentcreatetransitionwasm_clearPrefundedVotingBalance(this.__wbg_ptr);
1334
+ }
1335
+ /**
1336
+ * @returns {DocumentTransitionWASM}
1337
+ */
1338
+ toDocumentTransition() {
1339
+ const ret = wasm.documentcreatetransitionwasm_toDocumentTransition(this.__wbg_ptr);
1340
+ return DocumentTransitionWASM.__wrap(ret);
1341
+ }
1342
+ /**
1343
+ * @param {DocumentTransitionWASM} js_transition
1344
+ * @returns {DocumentCreateTransitionWASM}
1345
+ */
1346
+ static fromDocumentTransition(js_transition) {
1347
+ try {
1348
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1349
+ _assertClass(js_transition, DocumentTransitionWASM);
1350
+ var ptr0 = js_transition.__destroy_into_raw();
1351
+ wasm.documentcreatetransitionwasm_fromDocumentTransition(retptr, ptr0);
1352
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1353
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1354
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1355
+ if (r2) {
1356
+ throw takeObject(r1);
1357
+ }
1358
+ return DocumentCreateTransitionWASM.__wrap(r0);
1359
+ } finally {
1360
+ wasm.__wbindgen_add_to_stack_pointer(16);
1361
+ }
1362
+ }
1363
+ }
1364
+
1365
+ const DocumentDeleteTransitionWASMFinalization = (typeof FinalizationRegistry === 'undefined')
1366
+ ? { register: () => {}, unregister: () => {} }
1367
+ : new FinalizationRegistry(ptr => wasm.__wbg_documentdeletetransitionwasm_free(ptr >>> 0, 1));
1368
+
1369
+ export class DocumentDeleteTransitionWASM {
1370
+
1371
+ static __wrap(ptr) {
1372
+ ptr = ptr >>> 0;
1373
+ const obj = Object.create(DocumentDeleteTransitionWASM.prototype);
1374
+ obj.__wbg_ptr = ptr;
1375
+ DocumentDeleteTransitionWASMFinalization.register(obj, obj.__wbg_ptr, obj);
1376
+ return obj;
1377
+ }
1378
+
1379
+ __destroy_into_raw() {
1380
+ const ptr = this.__wbg_ptr;
1381
+ this.__wbg_ptr = 0;
1382
+ DocumentDeleteTransitionWASMFinalization.unregister(this);
1383
+ return ptr;
1384
+ }
1385
+
1386
+ free() {
1387
+ const ptr = this.__destroy_into_raw();
1388
+ wasm.__wbg_documentdeletetransitionwasm_free(ptr, 0);
1389
+ }
1390
+ /**
1391
+ * @param {DocumentWASM} document
1392
+ * @param {bigint} identity_contract_nonce
1393
+ * @param {string} document_type_name
1394
+ */
1395
+ constructor(document, identity_contract_nonce, document_type_name) {
1396
+ try {
1397
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1398
+ _assertClass(document, DocumentWASM);
1399
+ const ptr0 = passStringToWasm0(document_type_name, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
1400
+ const len0 = WASM_VECTOR_LEN;
1401
+ wasm.documentdeletetransitionwasm_new(retptr, document.__wbg_ptr, identity_contract_nonce, ptr0, len0);
1402
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1403
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1404
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1405
+ if (r2) {
1406
+ throw takeObject(r1);
1407
+ }
1408
+ this.__wbg_ptr = r0 >>> 0;
1409
+ DocumentDeleteTransitionWASMFinalization.register(this, this.__wbg_ptr, this);
1410
+ return this;
1411
+ } finally {
1412
+ wasm.__wbindgen_add_to_stack_pointer(16);
1413
+ }
1414
+ }
1415
+ /**
1416
+ * @returns {DocumentBaseTransitionWASM}
1417
+ */
1418
+ get base() {
1419
+ const ret = wasm.documentdeletetransitionwasm_get_base(this.__wbg_ptr);
1420
+ return DocumentBaseTransitionWASM.__wrap(ret);
1421
+ }
1422
+ /**
1423
+ * @param {DocumentBaseTransitionWASM} base
1424
+ */
1425
+ set base(base) {
1426
+ _assertClass(base, DocumentBaseTransitionWASM);
1427
+ wasm.documentdeletetransitionwasm_set_base(this.__wbg_ptr, base.__wbg_ptr);
1428
+ }
1429
+ /**
1430
+ * @returns {DocumentTransitionWASM}
1431
+ */
1432
+ toDocumentTransition() {
1433
+ const ret = wasm.documentdeletetransitionwasm_toDocumentTransition(this.__wbg_ptr);
1434
+ return DocumentTransitionWASM.__wrap(ret);
1435
+ }
1436
+ /**
1437
+ * @param {DocumentTransitionWASM} js_transition
1438
+ * @returns {DocumentDeleteTransitionWASM}
1439
+ */
1440
+ static fromDocumentTransition(js_transition) {
1441
+ try {
1442
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1443
+ _assertClass(js_transition, DocumentTransitionWASM);
1444
+ var ptr0 = js_transition.__destroy_into_raw();
1445
+ wasm.documentdeletetransitionwasm_fromDocumentTransition(retptr, ptr0);
1446
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1447
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1448
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1449
+ if (r2) {
1450
+ throw takeObject(r1);
1451
+ }
1452
+ return DocumentDeleteTransitionWASM.__wrap(r0);
1453
+ } finally {
1454
+ wasm.__wbindgen_add_to_stack_pointer(16);
1455
+ }
1456
+ }
1457
+ }
1458
+
1459
+ const DocumentPurchaseTransitionWASMFinalization = (typeof FinalizationRegistry === 'undefined')
1460
+ ? { register: () => {}, unregister: () => {} }
1461
+ : new FinalizationRegistry(ptr => wasm.__wbg_documentpurchasetransitionwasm_free(ptr >>> 0, 1));
1462
+
1463
+ export class DocumentPurchaseTransitionWASM {
1464
+
1465
+ static __wrap(ptr) {
1466
+ ptr = ptr >>> 0;
1467
+ const obj = Object.create(DocumentPurchaseTransitionWASM.prototype);
1468
+ obj.__wbg_ptr = ptr;
1469
+ DocumentPurchaseTransitionWASMFinalization.register(obj, obj.__wbg_ptr, obj);
1470
+ return obj;
1471
+ }
1472
+
1473
+ __destroy_into_raw() {
1474
+ const ptr = this.__wbg_ptr;
1475
+ this.__wbg_ptr = 0;
1476
+ DocumentPurchaseTransitionWASMFinalization.unregister(this);
1477
+ return ptr;
1478
+ }
1479
+
1480
+ free() {
1481
+ const ptr = this.__destroy_into_raw();
1482
+ wasm.__wbg_documentpurchasetransitionwasm_free(ptr, 0);
1483
+ }
1484
+ /**
1485
+ * @param {DocumentWASM} document
1486
+ * @param {bigint} identity_contract_nonce
1487
+ * @param {string} document_type_name
1488
+ * @param {bigint} amount
1489
+ */
1490
+ constructor(document, identity_contract_nonce, document_type_name, amount) {
1491
+ try {
1492
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1493
+ _assertClass(document, DocumentWASM);
1494
+ const ptr0 = passStringToWasm0(document_type_name, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
1495
+ const len0 = WASM_VECTOR_LEN;
1496
+ wasm.documentpurchasetransitionwasm_new(retptr, document.__wbg_ptr, identity_contract_nonce, ptr0, len0, amount);
1497
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1498
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1499
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1500
+ if (r2) {
1501
+ throw takeObject(r1);
1502
+ }
1503
+ this.__wbg_ptr = r0 >>> 0;
1504
+ DocumentPurchaseTransitionWASMFinalization.register(this, this.__wbg_ptr, this);
1505
+ return this;
1506
+ } finally {
1507
+ wasm.__wbindgen_add_to_stack_pointer(16);
1508
+ }
1509
+ }
1510
+ /**
1511
+ * @returns {DocumentBaseTransitionWASM}
1512
+ */
1513
+ get base() {
1514
+ const ret = wasm.documentpurchasetransitionwasm_get_base(this.__wbg_ptr);
1515
+ return DocumentBaseTransitionWASM.__wrap(ret);
1516
+ }
1517
+ /**
1518
+ * @returns {bigint}
1519
+ */
1520
+ get price() {
1521
+ const ret = wasm.documentpurchasetransitionwasm_get_price(this.__wbg_ptr);
1522
+ return BigInt.asUintN(64, ret);
1523
+ }
1524
+ /**
1525
+ * @returns {bigint}
1526
+ */
1527
+ get revision() {
1528
+ const ret = wasm.documentpurchasetransitionwasm_get_revision(this.__wbg_ptr);
1529
+ return BigInt.asUintN(64, ret);
1530
+ }
1531
+ /**
1532
+ * @param {DocumentBaseTransitionWASM} base
1533
+ */
1534
+ set base(base) {
1535
+ _assertClass(base, DocumentBaseTransitionWASM);
1536
+ wasm.documentpurchasetransitionwasm_set_base(this.__wbg_ptr, base.__wbg_ptr);
1537
+ }
1538
+ /**
1539
+ * @param {bigint} price
1540
+ */
1541
+ set price(price) {
1542
+ wasm.documentpurchasetransitionwasm_set_price(this.__wbg_ptr, price);
1543
+ }
1544
+ /**
1545
+ * @param {bigint} revision
1546
+ */
1547
+ set revision(revision) {
1548
+ wasm.documentpurchasetransitionwasm_set_revision(this.__wbg_ptr, revision);
1549
+ }
1550
+ /**
1551
+ * @returns {DocumentTransitionWASM}
1552
+ */
1553
+ toDocumentTransition() {
1554
+ const ret = wasm.documentpurchasetransitionwasm_toDocumentTransition(this.__wbg_ptr);
1555
+ return DocumentTransitionWASM.__wrap(ret);
1556
+ }
1557
+ /**
1558
+ * @param {DocumentTransitionWASM} js_transition
1559
+ * @returns {DocumentPurchaseTransitionWASM}
1560
+ */
1561
+ static fromDocumentTransition(js_transition) {
1562
+ try {
1563
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1564
+ _assertClass(js_transition, DocumentTransitionWASM);
1565
+ var ptr0 = js_transition.__destroy_into_raw();
1566
+ wasm.documentpurchasetransitionwasm_fromDocumentTransition(retptr, ptr0);
1567
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1568
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1569
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1570
+ if (r2) {
1571
+ throw takeObject(r1);
1572
+ }
1573
+ return DocumentPurchaseTransitionWASM.__wrap(r0);
1574
+ } finally {
1575
+ wasm.__wbindgen_add_to_stack_pointer(16);
1576
+ }
1577
+ }
1578
+ }
1579
+
1580
+ const DocumentReplaceTransitionWASMFinalization = (typeof FinalizationRegistry === 'undefined')
1581
+ ? { register: () => {}, unregister: () => {} }
1582
+ : new FinalizationRegistry(ptr => wasm.__wbg_documentreplacetransitionwasm_free(ptr >>> 0, 1));
1583
+
1584
+ export class DocumentReplaceTransitionWASM {
1585
+
1586
+ static __wrap(ptr) {
1587
+ ptr = ptr >>> 0;
1588
+ const obj = Object.create(DocumentReplaceTransitionWASM.prototype);
1589
+ obj.__wbg_ptr = ptr;
1590
+ DocumentReplaceTransitionWASMFinalization.register(obj, obj.__wbg_ptr, obj);
1591
+ return obj;
1592
+ }
1593
+
1594
+ __destroy_into_raw() {
1595
+ const ptr = this.__wbg_ptr;
1596
+ this.__wbg_ptr = 0;
1597
+ DocumentReplaceTransitionWASMFinalization.unregister(this);
1598
+ return ptr;
1599
+ }
1600
+
1601
+ free() {
1602
+ const ptr = this.__destroy_into_raw();
1603
+ wasm.__wbg_documentreplacetransitionwasm_free(ptr, 0);
1604
+ }
1605
+ /**
1606
+ * @param {DocumentWASM} document
1607
+ * @param {bigint} identity_contract_nonce
1608
+ * @param {string} document_type_name
1609
+ */
1610
+ constructor(document, identity_contract_nonce, document_type_name) {
1611
+ try {
1612
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1613
+ _assertClass(document, DocumentWASM);
1614
+ const ptr0 = passStringToWasm0(document_type_name, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
1615
+ const len0 = WASM_VECTOR_LEN;
1616
+ wasm.documentreplacetransitionwasm_new(retptr, document.__wbg_ptr, identity_contract_nonce, ptr0, len0);
1617
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1618
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1619
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1620
+ if (r2) {
1621
+ throw takeObject(r1);
1622
+ }
1623
+ this.__wbg_ptr = r0 >>> 0;
1624
+ DocumentReplaceTransitionWASMFinalization.register(this, this.__wbg_ptr, this);
1625
+ return this;
1626
+ } finally {
1627
+ wasm.__wbindgen_add_to_stack_pointer(16);
1628
+ }
1629
+ }
1630
+ /**
1631
+ * @returns {any}
1632
+ */
1633
+ get data() {
1634
+ try {
1635
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1636
+ wasm.documentreplacetransitionwasm_get_data(retptr, this.__wbg_ptr);
1637
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1638
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1639
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1640
+ if (r2) {
1641
+ throw takeObject(r1);
1642
+ }
1643
+ return takeObject(r0);
1644
+ } finally {
1645
+ wasm.__wbindgen_add_to_stack_pointer(16);
1646
+ }
1647
+ }
1648
+ /**
1649
+ * @returns {DocumentBaseTransitionWASM}
1650
+ */
1651
+ get base() {
1652
+ const ret = wasm.documentreplacetransitionwasm_get_base(this.__wbg_ptr);
1653
+ return DocumentBaseTransitionWASM.__wrap(ret);
1654
+ }
1655
+ /**
1656
+ * @returns {bigint}
1657
+ */
1658
+ get revision() {
1659
+ const ret = wasm.documentreplacetransitionwasm_get_revision(this.__wbg_ptr);
1660
+ return BigInt.asUintN(64, ret);
1661
+ }
1662
+ /**
1663
+ * @param {any} js_data
1664
+ */
1665
+ set data(js_data) {
1666
+ try {
1667
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1668
+ wasm.documentreplacetransitionwasm_set_data(retptr, this.__wbg_ptr, addHeapObject(js_data));
1669
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1670
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1671
+ if (r1) {
1672
+ throw takeObject(r0);
1673
+ }
1674
+ } finally {
1675
+ wasm.__wbindgen_add_to_stack_pointer(16);
1676
+ }
1677
+ }
1678
+ /**
1679
+ * @param {DocumentBaseTransitionWASM} base
1680
+ */
1681
+ set base(base) {
1682
+ _assertClass(base, DocumentBaseTransitionWASM);
1683
+ wasm.documentreplacetransitionwasm_set_base(this.__wbg_ptr, base.__wbg_ptr);
1684
+ }
1685
+ /**
1686
+ * @param {bigint} revision
1687
+ */
1688
+ set revision(revision) {
1689
+ wasm.documentreplacetransitionwasm_set_revision(this.__wbg_ptr, revision);
1690
+ }
1691
+ /**
1692
+ * @returns {DocumentTransitionWASM}
1693
+ */
1694
+ toDocumentTransition() {
1695
+ const ret = wasm.documentreplacetransitionwasm_toDocumentTransition(this.__wbg_ptr);
1696
+ return DocumentTransitionWASM.__wrap(ret);
1697
+ }
1698
+ /**
1699
+ * @param {DocumentTransitionWASM} js_transition
1700
+ * @returns {DocumentReplaceTransitionWASM}
1701
+ */
1702
+ static fromDocumentTransition(js_transition) {
1703
+ try {
1704
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1705
+ _assertClass(js_transition, DocumentTransitionWASM);
1706
+ var ptr0 = js_transition.__destroy_into_raw();
1707
+ wasm.documentreplacetransitionwasm_fromDocumentTransition(retptr, ptr0);
1708
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1709
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1710
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1711
+ if (r2) {
1712
+ throw takeObject(r1);
1713
+ }
1714
+ return DocumentReplaceTransitionWASM.__wrap(r0);
1715
+ } finally {
1716
+ wasm.__wbindgen_add_to_stack_pointer(16);
1717
+ }
1718
+ }
1719
+ }
1720
+
1721
+ const DocumentTransferTransitionWASMFinalization = (typeof FinalizationRegistry === 'undefined')
1722
+ ? { register: () => {}, unregister: () => {} }
1723
+ : new FinalizationRegistry(ptr => wasm.__wbg_documenttransfertransitionwasm_free(ptr >>> 0, 1));
1724
+
1725
+ export class DocumentTransferTransitionWASM {
1726
+
1727
+ static __wrap(ptr) {
1728
+ ptr = ptr >>> 0;
1729
+ const obj = Object.create(DocumentTransferTransitionWASM.prototype);
1730
+ obj.__wbg_ptr = ptr;
1731
+ DocumentTransferTransitionWASMFinalization.register(obj, obj.__wbg_ptr, obj);
1732
+ return obj;
1733
+ }
1734
+
1735
+ __destroy_into_raw() {
1736
+ const ptr = this.__wbg_ptr;
1737
+ this.__wbg_ptr = 0;
1738
+ DocumentTransferTransitionWASMFinalization.unregister(this);
1739
+ return ptr;
1740
+ }
1741
+
1742
+ free() {
1743
+ const ptr = this.__destroy_into_raw();
1744
+ wasm.__wbg_documenttransfertransitionwasm_free(ptr, 0);
1745
+ }
1746
+ /**
1747
+ * @param {DocumentWASM} document
1748
+ * @param {bigint} identity_contract_nonce
1749
+ * @param {string} document_type_name
1750
+ * @param {any} js_recipient_owner_id
1751
+ */
1752
+ constructor(document, identity_contract_nonce, document_type_name, js_recipient_owner_id) {
1753
+ try {
1754
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1755
+ _assertClass(document, DocumentWASM);
1756
+ const ptr0 = passStringToWasm0(document_type_name, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
1757
+ const len0 = WASM_VECTOR_LEN;
1758
+ wasm.documenttransfertransitionwasm_new(retptr, document.__wbg_ptr, identity_contract_nonce, ptr0, len0, addHeapObject(js_recipient_owner_id));
1759
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1760
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1761
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1762
+ if (r2) {
1763
+ throw takeObject(r1);
1764
+ }
1765
+ this.__wbg_ptr = r0 >>> 0;
1766
+ DocumentTransferTransitionWASMFinalization.register(this, this.__wbg_ptr, this);
1767
+ return this;
1768
+ } finally {
1769
+ wasm.__wbindgen_add_to_stack_pointer(16);
1770
+ }
1771
+ }
1772
+ /**
1773
+ * @returns {DocumentBaseTransitionWASM}
1774
+ */
1775
+ get base() {
1776
+ const ret = wasm.documenttransfertransitionwasm_get_base(this.__wbg_ptr);
1777
+ return DocumentBaseTransitionWASM.__wrap(ret);
1778
+ }
1779
+ /**
1780
+ * @returns {Uint8Array}
1781
+ */
1782
+ get recipientId() {
1783
+ try {
1784
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1785
+ wasm.documenttransfertransitionwasm_get_recipient_owner_id(retptr, this.__wbg_ptr);
1786
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1787
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1788
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
1789
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
1790
+ return v1;
1791
+ } finally {
1792
+ wasm.__wbindgen_add_to_stack_pointer(16);
1793
+ }
1794
+ }
1795
+ /**
1796
+ * @param {DocumentBaseTransitionWASM} base
1797
+ */
1798
+ set base(base) {
1799
+ _assertClass(base, DocumentBaseTransitionWASM);
1800
+ wasm.documenttransfertransitionwasm_set_base(this.__wbg_ptr, base.__wbg_ptr);
1801
+ }
1802
+ /**
1803
+ * @param {any} js_recipient_owner_id
1804
+ */
1805
+ set recipientId(js_recipient_owner_id) {
1806
+ try {
1807
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1808
+ wasm.documenttransfertransitionwasm_set_recipient_owner_id(retptr, this.__wbg_ptr, addHeapObject(js_recipient_owner_id));
1809
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1810
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1811
+ if (r1) {
1812
+ throw takeObject(r0);
1813
+ }
1814
+ } finally {
1815
+ wasm.__wbindgen_add_to_stack_pointer(16);
1816
+ }
1817
+ }
1818
+ /**
1819
+ * @returns {DocumentTransitionWASM}
1820
+ */
1821
+ toDocumentTransition() {
1822
+ const ret = wasm.documenttransfertransitionwasm_toDocumentTransition(this.__wbg_ptr);
1823
+ return DocumentTransitionWASM.__wrap(ret);
1824
+ }
1825
+ /**
1826
+ * @param {DocumentTransitionWASM} js_transition
1827
+ * @returns {DocumentTransferTransitionWASM}
1828
+ */
1829
+ static fromDocumentTransition(js_transition) {
1830
+ try {
1831
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1832
+ _assertClass(js_transition, DocumentTransitionWASM);
1833
+ var ptr0 = js_transition.__destroy_into_raw();
1834
+ wasm.documenttransfertransitionwasm_fromDocumentTransition(retptr, ptr0);
1835
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1836
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1837
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1838
+ if (r2) {
1839
+ throw takeObject(r1);
1840
+ }
1841
+ return DocumentTransferTransitionWASM.__wrap(r0);
1842
+ } finally {
1843
+ wasm.__wbindgen_add_to_stack_pointer(16);
1844
+ }
1845
+ }
1846
+ }
1847
+
1848
+ const DocumentTransitionWASMFinalization = (typeof FinalizationRegistry === 'undefined')
1849
+ ? { register: () => {}, unregister: () => {} }
1850
+ : new FinalizationRegistry(ptr => wasm.__wbg_documenttransitionwasm_free(ptr >>> 0, 1));
1851
+
1852
+ export class DocumentTransitionWASM {
1853
+
1854
+ static __wrap(ptr) {
1855
+ ptr = ptr >>> 0;
1856
+ const obj = Object.create(DocumentTransitionWASM.prototype);
1857
+ obj.__wbg_ptr = ptr;
1858
+ DocumentTransitionWASMFinalization.register(obj, obj.__wbg_ptr, obj);
1859
+ return obj;
1860
+ }
1861
+
1862
+ static __unwrap(jsValue) {
1863
+ if (!(jsValue instanceof DocumentTransitionWASM)) {
1864
+ return 0;
1865
+ }
1866
+ return jsValue.__destroy_into_raw();
1867
+ }
1868
+
1869
+ __destroy_into_raw() {
1870
+ const ptr = this.__wbg_ptr;
1871
+ this.__wbg_ptr = 0;
1872
+ DocumentTransitionWASMFinalization.unregister(this);
1873
+ return ptr;
1874
+ }
1875
+
1876
+ free() {
1877
+ const ptr = this.__destroy_into_raw();
1878
+ wasm.__wbg_documenttransitionwasm_free(ptr, 0);
1879
+ }
1880
+ /**
1881
+ * @returns {string}
1882
+ */
1883
+ get actionType() {
1884
+ let deferred1_0;
1885
+ let deferred1_1;
1886
+ try {
1887
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1888
+ wasm.documenttransitionwasm_get_action_type(retptr, this.__wbg_ptr);
1889
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1890
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1891
+ deferred1_0 = r0;
1892
+ deferred1_1 = r1;
1893
+ return getStringFromWasm0(r0, r1);
1894
+ } finally {
1895
+ wasm.__wbindgen_add_to_stack_pointer(16);
1896
+ wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
1897
+ }
1898
+ }
1899
+ /**
1900
+ * @returns {Uint8Array}
1901
+ */
1902
+ get dataContractId() {
1903
+ try {
1904
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1905
+ wasm.documenttransitionwasm_get_data_contract_id(retptr, this.__wbg_ptr);
1906
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1907
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1908
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
1909
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
1910
+ return v1;
1911
+ } finally {
1912
+ wasm.__wbindgen_add_to_stack_pointer(16);
1913
+ }
1914
+ }
1915
+ /**
1916
+ * @returns {Uint8Array}
1917
+ */
1918
+ get id() {
1919
+ try {
1920
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1921
+ wasm.documenttransitionwasm_get_id(retptr, this.__wbg_ptr);
1922
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1923
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1924
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
1925
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
1926
+ return v1;
1927
+ } finally {
1928
+ wasm.__wbindgen_add_to_stack_pointer(16);
1929
+ }
1930
+ }
1931
+ /**
1932
+ * @returns {string}
1933
+ */
1934
+ get documentTypeName() {
1935
+ let deferred1_0;
1936
+ let deferred1_1;
1937
+ try {
1938
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1939
+ wasm.documenttransitionwasm_get_document_type_name(retptr, this.__wbg_ptr);
1940
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1941
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1942
+ deferred1_0 = r0;
1943
+ deferred1_1 = r1;
1944
+ return getStringFromWasm0(r0, r1);
1945
+ } finally {
1946
+ wasm.__wbindgen_add_to_stack_pointer(16);
1947
+ wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
1948
+ }
1949
+ }
1950
+ /**
1951
+ * @returns {bigint}
1952
+ */
1953
+ get identityContractNonce() {
1954
+ const ret = wasm.documenttransitionwasm_get_identity_contract_nonce(this.__wbg_ptr);
1955
+ return BigInt.asUintN(64, ret);
1956
+ }
1957
+ /**
1958
+ * @returns {bigint | undefined}
1959
+ */
1960
+ get revision() {
1961
+ try {
1962
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1963
+ wasm.documenttransitionwasm_get_revision(retptr, this.__wbg_ptr);
1964
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1965
+ var r2 = getDataViewMemory0().getBigInt64(retptr + 8 * 1, true);
1966
+ return r0 === 0 ? undefined : BigInt.asUintN(64, r2);
1967
+ } finally {
1968
+ wasm.__wbindgen_add_to_stack_pointer(16);
1969
+ }
1970
+ }
1971
+ /**
1972
+ * @returns {Uint8Array | undefined}
1973
+ */
1974
+ get entropy() {
1975
+ try {
1976
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1977
+ wasm.documenttransitionwasm_get_entropy(retptr, this.__wbg_ptr);
1978
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1979
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1980
+ let v1;
1981
+ if (r0 !== 0) {
1982
+ v1 = getArrayU8FromWasm0(r0, r1).slice();
1983
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
1984
+ }
1985
+ return v1;
1986
+ } finally {
1987
+ wasm.__wbindgen_add_to_stack_pointer(16);
1988
+ }
1989
+ }
1990
+ /**
1991
+ * @returns {DocumentCreateTransitionWASM}
1992
+ */
1993
+ get createTransition() {
1994
+ try {
1995
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1996
+ wasm.documenttransitionwasm_get_create_transition(retptr, this.__wbg_ptr);
1997
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1998
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1999
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2000
+ if (r2) {
2001
+ throw takeObject(r1);
2002
+ }
2003
+ return DocumentCreateTransitionWASM.__wrap(r0);
2004
+ } finally {
2005
+ wasm.__wbindgen_add_to_stack_pointer(16);
2006
+ }
2007
+ }
2008
+ /**
2009
+ * @returns {DocumentReplaceTransitionWASM}
2010
+ */
2011
+ get replaceTransition() {
2012
+ try {
2013
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2014
+ wasm.documenttransitionwasm_get_replace_transition(retptr, this.__wbg_ptr);
2015
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2016
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2017
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2018
+ if (r2) {
2019
+ throw takeObject(r1);
2020
+ }
2021
+ return DocumentReplaceTransitionWASM.__wrap(r0);
2022
+ } finally {
2023
+ wasm.__wbindgen_add_to_stack_pointer(16);
2024
+ }
2025
+ }
2026
+ /**
2027
+ * @returns {DocumentDeleteTransitionWASM}
2028
+ */
2029
+ get deleteTransition() {
2030
+ try {
2031
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2032
+ wasm.documenttransitionwasm_get_delete_transition(retptr, this.__wbg_ptr);
2033
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2034
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2035
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2036
+ if (r2) {
2037
+ throw takeObject(r1);
2038
+ }
2039
+ return DocumentDeleteTransitionWASM.__wrap(r0);
2040
+ } finally {
2041
+ wasm.__wbindgen_add_to_stack_pointer(16);
2042
+ }
2043
+ }
2044
+ /**
2045
+ * @returns {DocumentPurchaseTransitionWASM}
2046
+ */
2047
+ get purchaseTransition() {
2048
+ try {
2049
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2050
+ wasm.documenttransitionwasm_get_purchase_transition(retptr, this.__wbg_ptr);
2051
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2052
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2053
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2054
+ if (r2) {
2055
+ throw takeObject(r1);
2056
+ }
2057
+ return DocumentPurchaseTransitionWASM.__wrap(r0);
2058
+ } finally {
2059
+ wasm.__wbindgen_add_to_stack_pointer(16);
2060
+ }
2061
+ }
2062
+ /**
2063
+ * @returns {DocumentTransferTransitionWASM}
2064
+ */
2065
+ get transferTransition() {
2066
+ try {
2067
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2068
+ wasm.documenttransitionwasm_get_transfer_transition(retptr, this.__wbg_ptr);
2069
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2070
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2071
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2072
+ if (r2) {
2073
+ throw takeObject(r1);
2074
+ }
2075
+ return DocumentTransferTransitionWASM.__wrap(r0);
2076
+ } finally {
2077
+ wasm.__wbindgen_add_to_stack_pointer(16);
2078
+ }
2079
+ }
2080
+ /**
2081
+ * @returns {DocumentUpdatePriceTransitionWASM}
2082
+ */
2083
+ get updatePriceTransition() {
2084
+ try {
2085
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2086
+ wasm.documenttransitionwasm_get_update_price_transition(retptr, this.__wbg_ptr);
2087
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2088
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2089
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2090
+ if (r2) {
2091
+ throw takeObject(r1);
2092
+ }
2093
+ return DocumentUpdatePriceTransitionWASM.__wrap(r0);
2094
+ } finally {
2095
+ wasm.__wbindgen_add_to_stack_pointer(16);
2096
+ }
2097
+ }
2098
+ /**
2099
+ * @param {any} js_data_contract_id
2100
+ */
2101
+ set dataContractId(js_data_contract_id) {
2102
+ try {
2103
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2104
+ wasm.documenttransitionwasm_set_data_contract_id(retptr, this.__wbg_ptr, addHeapObject(js_data_contract_id));
2105
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2106
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2107
+ if (r1) {
2108
+ throw takeObject(r0);
2109
+ }
2110
+ } finally {
2111
+ wasm.__wbindgen_add_to_stack_pointer(16);
2112
+ }
2113
+ }
2114
+ /**
2115
+ * @param {bigint} revision
2116
+ */
2117
+ set revision(revision) {
2118
+ wasm.documenttransitionwasm_set_revision(this.__wbg_ptr, revision);
2119
+ }
2120
+ /**
2121
+ * @param {bigint} identity_contract_nonce
2122
+ */
2123
+ set identityContractNonce(identity_contract_nonce) {
2124
+ wasm.documenttransitionwasm_set_identity_contract_nonce(this.__wbg_ptr, identity_contract_nonce);
2125
+ }
2126
+ }
2127
+
2128
+ const DocumentUpdatePriceTransitionWASMFinalization = (typeof FinalizationRegistry === 'undefined')
2129
+ ? { register: () => {}, unregister: () => {} }
2130
+ : new FinalizationRegistry(ptr => wasm.__wbg_documentupdatepricetransitionwasm_free(ptr >>> 0, 1));
2131
+
2132
+ export class DocumentUpdatePriceTransitionWASM {
2133
+
2134
+ static __wrap(ptr) {
2135
+ ptr = ptr >>> 0;
2136
+ const obj = Object.create(DocumentUpdatePriceTransitionWASM.prototype);
2137
+ obj.__wbg_ptr = ptr;
2138
+ DocumentUpdatePriceTransitionWASMFinalization.register(obj, obj.__wbg_ptr, obj);
2139
+ return obj;
2140
+ }
2141
+
2142
+ __destroy_into_raw() {
2143
+ const ptr = this.__wbg_ptr;
2144
+ this.__wbg_ptr = 0;
2145
+ DocumentUpdatePriceTransitionWASMFinalization.unregister(this);
2146
+ return ptr;
2147
+ }
2148
+
2149
+ free() {
2150
+ const ptr = this.__destroy_into_raw();
2151
+ wasm.__wbg_documentupdatepricetransitionwasm_free(ptr, 0);
2152
+ }
2153
+ /**
2154
+ * @param {DocumentWASM} document
2155
+ * @param {bigint} identity_contract_nonce
2156
+ * @param {string} document_type_name
2157
+ * @param {bigint} price
2158
+ */
2159
+ constructor(document, identity_contract_nonce, document_type_name, price) {
2160
+ try {
2161
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2162
+ _assertClass(document, DocumentWASM);
2163
+ const ptr0 = passStringToWasm0(document_type_name, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
2164
+ const len0 = WASM_VECTOR_LEN;
2165
+ wasm.documentupdatepricetransitionwasm_new(retptr, document.__wbg_ptr, identity_contract_nonce, ptr0, len0, price);
2166
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2167
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2168
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2169
+ if (r2) {
2170
+ throw takeObject(r1);
2171
+ }
2172
+ this.__wbg_ptr = r0 >>> 0;
2173
+ DocumentUpdatePriceTransitionWASMFinalization.register(this, this.__wbg_ptr, this);
2174
+ return this;
2175
+ } finally {
2176
+ wasm.__wbindgen_add_to_stack_pointer(16);
2177
+ }
2178
+ }
2179
+ /**
2180
+ * @returns {DocumentBaseTransitionWASM}
2181
+ */
2182
+ get base() {
2183
+ const ret = wasm.documentpurchasetransitionwasm_get_base(this.__wbg_ptr);
2184
+ return DocumentBaseTransitionWASM.__wrap(ret);
2185
+ }
2186
+ /**
2187
+ * @returns {bigint}
2188
+ */
2189
+ get price() {
2190
+ const ret = wasm.documentpurchasetransitionwasm_get_price(this.__wbg_ptr);
2191
+ return BigInt.asUintN(64, ret);
2192
+ }
2193
+ /**
2194
+ * @param {DocumentBaseTransitionWASM} base
2195
+ */
2196
+ set base(base) {
2197
+ _assertClass(base, DocumentBaseTransitionWASM);
2198
+ wasm.documentupdatepricetransitionwasm_set_base(this.__wbg_ptr, base.__wbg_ptr);
2199
+ }
2200
+ /**
2201
+ * @param {bigint} price
2202
+ */
2203
+ set price(price) {
2204
+ wasm.documentpurchasetransitionwasm_set_price(this.__wbg_ptr, price);
2205
+ }
2206
+ /**
2207
+ * @returns {DocumentTransitionWASM}
2208
+ */
2209
+ toDocumentTransition() {
2210
+ const ret = wasm.documentupdatepricetransitionwasm_toDocumentTransition(this.__wbg_ptr);
2211
+ return DocumentTransitionWASM.__wrap(ret);
2212
+ }
2213
+ /**
2214
+ * @param {DocumentTransitionWASM} js_transition
2215
+ * @returns {DocumentUpdatePriceTransitionWASM}
2216
+ */
2217
+ static fromDocumentTransition(js_transition) {
2218
+ try {
2219
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2220
+ _assertClass(js_transition, DocumentTransitionWASM);
2221
+ var ptr0 = js_transition.__destroy_into_raw();
2222
+ wasm.documentupdatepricetransitionwasm_fromDocumentTransition(retptr, ptr0);
2223
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2224
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2225
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2226
+ if (r2) {
2227
+ throw takeObject(r1);
2228
+ }
2229
+ return DocumentUpdatePriceTransitionWASM.__wrap(r0);
2230
+ } finally {
2231
+ wasm.__wbindgen_add_to_stack_pointer(16);
2232
+ }
2233
+ }
2234
+ }
2235
+
2236
+ const DocumentWASMFinalization = (typeof FinalizationRegistry === 'undefined')
2237
+ ? { register: () => {}, unregister: () => {} }
2238
+ : new FinalizationRegistry(ptr => wasm.__wbg_documentwasm_free(ptr >>> 0, 1));
2239
+
2240
+ export class DocumentWASM {
2241
+
2242
+ static __wrap(ptr) {
2243
+ ptr = ptr >>> 0;
2244
+ const obj = Object.create(DocumentWASM.prototype);
2245
+ obj.__wbg_ptr = ptr;
2246
+ DocumentWASMFinalization.register(obj, obj.__wbg_ptr, obj);
2247
+ return obj;
2248
+ }
2249
+
2250
+ __destroy_into_raw() {
2251
+ const ptr = this.__wbg_ptr;
2252
+ this.__wbg_ptr = 0;
2253
+ DocumentWASMFinalization.unregister(this);
2254
+ return ptr;
2255
+ }
2256
+
2257
+ free() {
2258
+ const ptr = this.__destroy_into_raw();
2259
+ wasm.__wbg_documentwasm_free(ptr, 0);
2260
+ }
2261
+ /**
2262
+ * @param {any} js_raw_document
2263
+ * @param {string} js_document_type_name
2264
+ * @param {bigint} js_revision
2265
+ * @param {any} js_data_contract_id
2266
+ * @param {any} js_owner_id
2267
+ * @param {any} js_document_id
2268
+ */
2269
+ constructor(js_raw_document, js_document_type_name, js_revision, js_data_contract_id, js_owner_id, js_document_id) {
2270
+ try {
2271
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2272
+ const ptr0 = passStringToWasm0(js_document_type_name, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
2273
+ const len0 = WASM_VECTOR_LEN;
2274
+ wasm.documentwasm_new(retptr, addHeapObject(js_raw_document), ptr0, len0, js_revision, addHeapObject(js_data_contract_id), addHeapObject(js_owner_id), addHeapObject(js_document_id));
2275
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2276
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2277
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2278
+ if (r2) {
2279
+ throw takeObject(r1);
2280
+ }
2281
+ this.__wbg_ptr = r0 >>> 0;
2282
+ DocumentWASMFinalization.register(this, this.__wbg_ptr, this);
2283
+ return this;
2284
+ } finally {
2285
+ wasm.__wbindgen_add_to_stack_pointer(16);
2286
+ }
2287
+ }
2288
+ /**
2289
+ * @returns {Uint8Array}
2290
+ */
2291
+ getId() {
2292
+ try {
2293
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2294
+ wasm.documentwasm_getId(retptr, this.__wbg_ptr);
2295
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2296
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2297
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
2298
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
2299
+ return v1;
2300
+ } finally {
2301
+ wasm.__wbindgen_add_to_stack_pointer(16);
2302
+ }
2303
+ }
2304
+ /**
2305
+ * @returns {Uint8Array | undefined}
2306
+ */
1137
2307
  getEntropy() {
1138
- const ret = wasm.documentwasm_getEntropy(this.__wbg_ptr);
1139
- return takeObject(ret);
2308
+ try {
2309
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2310
+ wasm.documentwasm_getEntropy(retptr, this.__wbg_ptr);
2311
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2312
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2313
+ let v1;
2314
+ if (r0 !== 0) {
2315
+ v1 = getArrayU8FromWasm0(r0, r1).slice();
2316
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
2317
+ }
2318
+ return v1;
2319
+ } finally {
2320
+ wasm.__wbindgen_add_to_stack_pointer(16);
2321
+ }
1140
2322
  }
1141
2323
  /**
1142
- * @returns {any}
2324
+ * @returns {Uint8Array}
2325
+ */
2326
+ getDataContractId() {
2327
+ try {
2328
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2329
+ wasm.documentwasm_getDataContractId(retptr, this.__wbg_ptr);
2330
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2331
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2332
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
2333
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
2334
+ return v1;
2335
+ } finally {
2336
+ wasm.__wbindgen_add_to_stack_pointer(16);
2337
+ }
2338
+ }
2339
+ /**
2340
+ * @returns {Uint8Array}
1143
2341
  */
1144
2342
  getOwnerId() {
1145
- const ret = wasm.documentwasm_getOwnerId(this.__wbg_ptr);
1146
- return takeObject(ret);
2343
+ try {
2344
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2345
+ wasm.documentwasm_getOwnerId(retptr, this.__wbg_ptr);
2346
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2347
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2348
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
2349
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
2350
+ return v1;
2351
+ } finally {
2352
+ wasm.__wbindgen_add_to_stack_pointer(16);
2353
+ }
1147
2354
  }
1148
2355
  /**
1149
2356
  * @returns {any}
@@ -1320,129 +2527,416 @@ export class DocumentWASM {
1320
2527
  wasm.documentwasm_setOwnerId(this.__wbg_ptr, addHeapObject(id));
1321
2528
  }
1322
2529
  /**
1323
- * @param {any} properties
2530
+ * @param {any} properties
2531
+ */
2532
+ setProperties(properties) {
2533
+ wasm.documentwasm_setProperties(this.__wbg_ptr, addHeapObject(properties));
2534
+ }
2535
+ /**
2536
+ * @param {bigint | null} [revision]
2537
+ */
2538
+ setRevision(revision) {
2539
+ wasm.documentwasm_setRevision(this.__wbg_ptr, !isLikeNone(revision), isLikeNone(revision) ? BigInt(0) : revision);
2540
+ }
2541
+ /**
2542
+ * @param {bigint | null} [created_at]
2543
+ */
2544
+ setCreatedAt(created_at) {
2545
+ wasm.documentwasm_setCreatedAt(this.__wbg_ptr, !isLikeNone(created_at), isLikeNone(created_at) ? BigInt(0) : created_at);
2546
+ }
2547
+ /**
2548
+ * @param {bigint | null} [updated_at]
2549
+ */
2550
+ setUpdatedAt(updated_at) {
2551
+ wasm.documentwasm_setUpdatedAt(this.__wbg_ptr, !isLikeNone(updated_at), isLikeNone(updated_at) ? BigInt(0) : updated_at);
2552
+ }
2553
+ /**
2554
+ * @param {bigint | null} [transferred_at]
2555
+ */
2556
+ setTransferredAt(transferred_at) {
2557
+ wasm.documentwasm_setTransferredAt(this.__wbg_ptr, !isLikeNone(transferred_at), isLikeNone(transferred_at) ? BigInt(0) : transferred_at);
2558
+ }
2559
+ /**
2560
+ * @param {bigint | null} [created_at_block_height]
2561
+ */
2562
+ setCreatedAtBlockHeight(created_at_block_height) {
2563
+ wasm.documentwasm_setCreatedAtBlockHeight(this.__wbg_ptr, !isLikeNone(created_at_block_height), isLikeNone(created_at_block_height) ? BigInt(0) : created_at_block_height);
2564
+ }
2565
+ /**
2566
+ * @param {bigint | null} [updated_at_block_height]
2567
+ */
2568
+ setUpdatedAtBlockHeight(updated_at_block_height) {
2569
+ wasm.documentwasm_setUpdatedAtBlockHeight(this.__wbg_ptr, !isLikeNone(updated_at_block_height), isLikeNone(updated_at_block_height) ? BigInt(0) : updated_at_block_height);
2570
+ }
2571
+ /**
2572
+ * @param {bigint | null} [transferred_at_block_height]
2573
+ */
2574
+ setTransferredAtBlockHeight(transferred_at_block_height) {
2575
+ wasm.documentwasm_setTransferredAtBlockHeight(this.__wbg_ptr, !isLikeNone(transferred_at_block_height), isLikeNone(transferred_at_block_height) ? BigInt(0) : transferred_at_block_height);
2576
+ }
2577
+ /**
2578
+ * @param {number | null} [created_at_core_block_height]
2579
+ */
2580
+ setCreatedAtCoreBlockHeight(created_at_core_block_height) {
2581
+ wasm.documentwasm_setCreatedAtCoreBlockHeight(this.__wbg_ptr, isLikeNone(created_at_core_block_height) ? 0x100000001 : (created_at_core_block_height) >>> 0);
2582
+ }
2583
+ /**
2584
+ * @param {number | null} [updated_at_core_block_height]
2585
+ */
2586
+ setUpdatedAtCoreBlockHeight(updated_at_core_block_height) {
2587
+ wasm.documentwasm_setUpdatedAtCoreBlockHeight(this.__wbg_ptr, isLikeNone(updated_at_core_block_height) ? 0x100000001 : (updated_at_core_block_height) >>> 0);
2588
+ }
2589
+ /**
2590
+ * @param {number | null} [transferred_at_core_block_height]
2591
+ */
2592
+ setTransferredAtCoreBlockHeight(transferred_at_core_block_height) {
2593
+ wasm.documentwasm_setTransferredAtCoreBlockHeight(this.__wbg_ptr, isLikeNone(transferred_at_core_block_height) ? 0x100000001 : (transferred_at_core_block_height) >>> 0);
2594
+ }
2595
+ /**
2596
+ * @param {string} document_type_name
2597
+ */
2598
+ setDocumentTypeName(document_type_name) {
2599
+ const ptr0 = passStringToWasm0(document_type_name, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
2600
+ const len0 = WASM_VECTOR_LEN;
2601
+ wasm.documentwasm_setDocumentTypeName(this.__wbg_ptr, ptr0, len0);
2602
+ }
2603
+ /**
2604
+ * @param {DataContractWASM} data_contract
2605
+ * @param {string} type_name
2606
+ * @param {any} js_platform_version
2607
+ * @returns {Uint8Array}
2608
+ */
2609
+ toBytes(data_contract, type_name, js_platform_version) {
2610
+ try {
2611
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2612
+ _assertClass(data_contract, DataContractWASM);
2613
+ const ptr0 = passStringToWasm0(type_name, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
2614
+ const len0 = WASM_VECTOR_LEN;
2615
+ wasm.documentwasm_toBytes(retptr, this.__wbg_ptr, data_contract.__wbg_ptr, ptr0, len0, addHeapObject(js_platform_version));
2616
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2617
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2618
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2619
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2620
+ if (r3) {
2621
+ throw takeObject(r2);
2622
+ }
2623
+ var v2 = getArrayU8FromWasm0(r0, r1).slice();
2624
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
2625
+ return v2;
2626
+ } finally {
2627
+ wasm.__wbindgen_add_to_stack_pointer(16);
2628
+ }
2629
+ }
2630
+ /**
2631
+ * @param {Uint8Array} bytes
2632
+ * @param {DataContractWASM} data_contract
2633
+ * @param {string} type_name
2634
+ * @param {any} js_platform_version
2635
+ * @returns {DocumentWASM}
2636
+ */
2637
+ static fromBytes(bytes, data_contract, type_name, js_platform_version) {
2638
+ try {
2639
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2640
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export_1);
2641
+ const len0 = WASM_VECTOR_LEN;
2642
+ _assertClass(data_contract, DataContractWASM);
2643
+ const ptr1 = passStringToWasm0(type_name, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
2644
+ const len1 = WASM_VECTOR_LEN;
2645
+ wasm.documentwasm_fromBytes(retptr, ptr0, len0, data_contract.__wbg_ptr, ptr1, len1, addHeapObject(js_platform_version));
2646
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2647
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2648
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2649
+ if (r2) {
2650
+ throw takeObject(r1);
2651
+ }
2652
+ return DocumentWASM.__wrap(r0);
2653
+ } finally {
2654
+ wasm.__wbindgen_add_to_stack_pointer(16);
2655
+ }
2656
+ }
2657
+ /**
2658
+ * @param {string} js_document_type_name
2659
+ * @param {any} js_owner_id
2660
+ * @param {any} js_data_contract_id
2661
+ * @param {Uint8Array | null} [opt_entropy]
2662
+ * @returns {Uint8Array}
2663
+ */
2664
+ static generateId(js_document_type_name, js_owner_id, js_data_contract_id, opt_entropy) {
2665
+ try {
2666
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2667
+ const ptr0 = passStringToWasm0(js_document_type_name, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
2668
+ const len0 = WASM_VECTOR_LEN;
2669
+ var ptr1 = isLikeNone(opt_entropy) ? 0 : passArray8ToWasm0(opt_entropy, wasm.__wbindgen_export_1);
2670
+ var len1 = WASM_VECTOR_LEN;
2671
+ wasm.documentwasm_generateId(retptr, ptr0, len0, addHeapObject(js_owner_id), addHeapObject(js_data_contract_id), ptr1, len1);
2672
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2673
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2674
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2675
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2676
+ if (r3) {
2677
+ throw takeObject(r2);
2678
+ }
2679
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2680
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
2681
+ return v3;
2682
+ } finally {
2683
+ wasm.__wbindgen_add_to_stack_pointer(16);
2684
+ }
2685
+ }
2686
+ }
2687
+
2688
+ const DocumentsBatchWASMFinalization = (typeof FinalizationRegistry === 'undefined')
2689
+ ? { register: () => {}, unregister: () => {} }
2690
+ : new FinalizationRegistry(ptr => wasm.__wbg_documentsbatchwasm_free(ptr >>> 0, 1));
2691
+
2692
+ export class DocumentsBatchWASM {
2693
+
2694
+ static __wrap(ptr) {
2695
+ ptr = ptr >>> 0;
2696
+ const obj = Object.create(DocumentsBatchWASM.prototype);
2697
+ obj.__wbg_ptr = ptr;
2698
+ DocumentsBatchWASMFinalization.register(obj, obj.__wbg_ptr, obj);
2699
+ return obj;
2700
+ }
2701
+
2702
+ __destroy_into_raw() {
2703
+ const ptr = this.__wbg_ptr;
2704
+ this.__wbg_ptr = 0;
2705
+ DocumentsBatchWASMFinalization.unregister(this);
2706
+ return ptr;
2707
+ }
2708
+
2709
+ free() {
2710
+ const ptr = this.__destroy_into_raw();
2711
+ wasm.__wbg_documentsbatchwasm_free(ptr, 0);
2712
+ }
2713
+ /**
2714
+ * @param {Array<any>} document_transitions
2715
+ * @param {any} js_owner_id
2716
+ * @param {number | null} [user_fee_increase]
2717
+ * @param {number | null} [signature_public_key_id]
2718
+ * @param {Uint8Array | null} [signature]
2719
+ */
2720
+ constructor(document_transitions, js_owner_id, user_fee_increase, signature_public_key_id, signature) {
2721
+ try {
2722
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2723
+ var ptr0 = isLikeNone(signature) ? 0 : passArray8ToWasm0(signature, wasm.__wbindgen_export_1);
2724
+ var len0 = WASM_VECTOR_LEN;
2725
+ wasm.documentsbatchwasm_new(retptr, addHeapObject(document_transitions), addHeapObject(js_owner_id), isLikeNone(user_fee_increase) ? 0xFFFFFF : user_fee_increase, isLikeNone(signature_public_key_id) ? 0x100000001 : (signature_public_key_id) >>> 0, ptr0, len0);
2726
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2727
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2728
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2729
+ if (r2) {
2730
+ throw takeObject(r1);
2731
+ }
2732
+ this.__wbg_ptr = r0 >>> 0;
2733
+ DocumentsBatchWASMFinalization.register(this, this.__wbg_ptr, this);
2734
+ return this;
2735
+ } finally {
2736
+ wasm.__wbindgen_add_to_stack_pointer(16);
2737
+ }
2738
+ }
2739
+ /**
2740
+ * @returns {DocumentTransitionWASM[]}
2741
+ */
2742
+ get transitions() {
2743
+ try {
2744
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2745
+ wasm.documentsbatchwasm_get_transitions(retptr, this.__wbg_ptr);
2746
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2747
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2748
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
2749
+ wasm.__wbindgen_export_3(r0, r1 * 4, 4);
2750
+ return v1;
2751
+ } finally {
2752
+ wasm.__wbindgen_add_to_stack_pointer(16);
2753
+ }
2754
+ }
2755
+ /**
2756
+ * @returns {Uint8Array}
1324
2757
  */
1325
- setProperties(properties) {
1326
- wasm.documentwasm_setProperties(this.__wbg_ptr, addHeapObject(properties));
2758
+ get signature() {
2759
+ try {
2760
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2761
+ wasm.documentsbatchwasm_get_signature(retptr, this.__wbg_ptr);
2762
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2763
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2764
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
2765
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
2766
+ return v1;
2767
+ } finally {
2768
+ wasm.__wbindgen_add_to_stack_pointer(16);
2769
+ }
1327
2770
  }
1328
2771
  /**
1329
- * @param {bigint | null} [revision]
2772
+ * @returns {number}
1330
2773
  */
1331
- setRevision(revision) {
1332
- wasm.documentwasm_setRevision(this.__wbg_ptr, !isLikeNone(revision), isLikeNone(revision) ? BigInt(0) : revision);
2774
+ get signaturePublicKeyId() {
2775
+ const ret = wasm.documentsbatchwasm_get_signature_public_key_id(this.__wbg_ptr);
2776
+ return ret >>> 0;
1333
2777
  }
1334
2778
  /**
1335
- * @param {bigint | null} [created_at]
2779
+ * @returns {bigint | undefined}
1336
2780
  */
1337
- setCreatedAt(created_at) {
1338
- wasm.documentwasm_setCreatedAt(this.__wbg_ptr, !isLikeNone(created_at), isLikeNone(created_at) ? BigInt(0) : created_at);
2781
+ get allPurchasesAmount() {
2782
+ try {
2783
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-32);
2784
+ wasm.documentsbatchwasm_get_all_purchases_amount(retptr, this.__wbg_ptr);
2785
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2786
+ var r2 = getDataViewMemory0().getBigInt64(retptr + 8 * 1, true);
2787
+ var r4 = getDataViewMemory0().getInt32(retptr + 4 * 4, true);
2788
+ var r5 = getDataViewMemory0().getInt32(retptr + 4 * 5, true);
2789
+ if (r5) {
2790
+ throw takeObject(r4);
2791
+ }
2792
+ return r0 === 0 ? undefined : BigInt.asUintN(64, r2);
2793
+ } finally {
2794
+ wasm.__wbindgen_add_to_stack_pointer(32);
2795
+ }
1339
2796
  }
1340
2797
  /**
1341
- * @param {bigint | null} [updated_at]
2798
+ * @returns {Uint8Array}
1342
2799
  */
1343
- setUpdatedAt(updated_at) {
1344
- wasm.documentwasm_setUpdatedAt(this.__wbg_ptr, !isLikeNone(updated_at), isLikeNone(updated_at) ? BigInt(0) : updated_at);
2800
+ get ownerId() {
2801
+ try {
2802
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2803
+ wasm.documentsbatchwasm_get_owner_id(retptr, this.__wbg_ptr);
2804
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2805
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2806
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
2807
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
2808
+ return v1;
2809
+ } finally {
2810
+ wasm.__wbindgen_add_to_stack_pointer(16);
2811
+ }
1345
2812
  }
1346
2813
  /**
1347
- * @param {bigint | null} [transferred_at]
2814
+ * @returns {any}
1348
2815
  */
1349
- setTransferredAt(transferred_at) {
1350
- wasm.documentwasm_setTransferredAt(this.__wbg_ptr, !isLikeNone(transferred_at), isLikeNone(transferred_at) ? BigInt(0) : transferred_at);
2816
+ get modifiedDataIds() {
2817
+ try {
2818
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2819
+ wasm.documentsbatchwasm_get_modified_data_ids(retptr, this.__wbg_ptr);
2820
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2821
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2822
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2823
+ if (r2) {
2824
+ throw takeObject(r1);
2825
+ }
2826
+ return takeObject(r0);
2827
+ } finally {
2828
+ wasm.__wbindgen_add_to_stack_pointer(16);
2829
+ }
1351
2830
  }
1352
2831
  /**
1353
- * @param {bigint | null} [created_at_block_height]
2832
+ * @returns {bigint | undefined}
1354
2833
  */
1355
- setCreatedAtBlockHeight(created_at_block_height) {
1356
- wasm.documentwasm_setCreatedAtBlockHeight(this.__wbg_ptr, !isLikeNone(created_at_block_height), isLikeNone(created_at_block_height) ? BigInt(0) : created_at_block_height);
2834
+ get allConflictingIndexCollateralVotingFunds() {
2835
+ try {
2836
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-32);
2837
+ wasm.documentsbatchwasm_get_all_conflicting_index_collateral_voting_funds(retptr, this.__wbg_ptr);
2838
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2839
+ var r2 = getDataViewMemory0().getBigInt64(retptr + 8 * 1, true);
2840
+ var r4 = getDataViewMemory0().getInt32(retptr + 4 * 4, true);
2841
+ var r5 = getDataViewMemory0().getInt32(retptr + 4 * 5, true);
2842
+ if (r5) {
2843
+ throw takeObject(r4);
2844
+ }
2845
+ return r0 === 0 ? undefined : BigInt.asUintN(64, r2);
2846
+ } finally {
2847
+ wasm.__wbindgen_add_to_stack_pointer(32);
2848
+ }
1357
2849
  }
1358
2850
  /**
1359
- * @param {bigint | null} [updated_at_block_height]
2851
+ * @param {DocumentTransitionWASM[]} transitions
1360
2852
  */
1361
- setUpdatedAtBlockHeight(updated_at_block_height) {
1362
- wasm.documentwasm_setUpdatedAtBlockHeight(this.__wbg_ptr, !isLikeNone(updated_at_block_height), isLikeNone(updated_at_block_height) ? BigInt(0) : updated_at_block_height);
2853
+ set transitions(transitions) {
2854
+ const ptr0 = passArrayJsValueToWasm0(transitions, wasm.__wbindgen_export_1);
2855
+ const len0 = WASM_VECTOR_LEN;
2856
+ wasm.documentsbatchwasm_set_transitions(this.__wbg_ptr, ptr0, len0);
1363
2857
  }
1364
2858
  /**
1365
- * @param {bigint | null} [transferred_at_block_height]
2859
+ * @param {Uint8Array} js_signature
1366
2860
  */
1367
- setTransferredAtBlockHeight(transferred_at_block_height) {
1368
- wasm.documentwasm_setTransferredAtBlockHeight(this.__wbg_ptr, !isLikeNone(transferred_at_block_height), isLikeNone(transferred_at_block_height) ? BigInt(0) : transferred_at_block_height);
2861
+ set signature(js_signature) {
2862
+ const ptr0 = passArray8ToWasm0(js_signature, wasm.__wbindgen_export_1);
2863
+ const len0 = WASM_VECTOR_LEN;
2864
+ wasm.documentsbatchwasm_set_signature(this.__wbg_ptr, ptr0, len0);
1369
2865
  }
1370
2866
  /**
1371
- * @param {number | null} [created_at_core_block_height]
2867
+ * @param {number} key_id
1372
2868
  */
1373
- setCreatedAtCoreBlockHeight(created_at_core_block_height) {
1374
- wasm.documentwasm_setCreatedAtCoreBlockHeight(this.__wbg_ptr, isLikeNone(created_at_core_block_height) ? 0x100000001 : (created_at_core_block_height) >>> 0);
2869
+ set signaturePublicKeyId(key_id) {
2870
+ wasm.documentsbatchwasm_set_signature_public_key_id(this.__wbg_ptr, key_id);
1375
2871
  }
1376
2872
  /**
1377
- * @param {number | null} [updated_at_core_block_height]
2873
+ * @param {bigint} nonce
1378
2874
  */
1379
- setUpdatedAtCoreBlockHeight(updated_at_core_block_height) {
1380
- wasm.documentwasm_setUpdatedAtCoreBlockHeight(this.__wbg_ptr, isLikeNone(updated_at_core_block_height) ? 0x100000001 : (updated_at_core_block_height) >>> 0);
2875
+ setIdentityContractNonce(nonce) {
2876
+ wasm.documentsbatchwasm_setIdentityContractNonce(this.__wbg_ptr, nonce);
1381
2877
  }
1382
2878
  /**
1383
- * @param {number | null} [transferred_at_core_block_height]
2879
+ * @returns {StateTransitionWASM}
1384
2880
  */
1385
- setTransferredAtCoreBlockHeight(transferred_at_core_block_height) {
1386
- wasm.documentwasm_setTransferredAtCoreBlockHeight(this.__wbg_ptr, isLikeNone(transferred_at_core_block_height) ? 0x100000001 : (transferred_at_core_block_height) >>> 0);
2881
+ toStateTransition() {
2882
+ const ret = wasm.documentsbatchwasm_toStateTransition(this.__wbg_ptr);
2883
+ return StateTransitionWASM.__wrap(ret);
1387
2884
  }
1388
2885
  /**
1389
- * @param {string} document_type_name
2886
+ * @param {StateTransitionWASM} state_transition
2887
+ * @returns {DocumentsBatchWASM}
1390
2888
  */
1391
- setDocumentTypeName(document_type_name) {
1392
- const ptr0 = passStringToWasm0(document_type_name, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
1393
- const len0 = WASM_VECTOR_LEN;
1394
- wasm.documentwasm_setDocumentTypeName(this.__wbg_ptr, ptr0, len0);
2889
+ static fromStateTransition(state_transition) {
2890
+ try {
2891
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2892
+ _assertClass(state_transition, StateTransitionWASM);
2893
+ wasm.documentsbatchwasm_fromStateTransition(retptr, state_transition.__wbg_ptr);
2894
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2895
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2896
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2897
+ if (r2) {
2898
+ throw takeObject(r1);
2899
+ }
2900
+ return DocumentsBatchWASM.__wrap(r0);
2901
+ } finally {
2902
+ wasm.__wbindgen_add_to_stack_pointer(16);
2903
+ }
1395
2904
  }
1396
2905
  /**
1397
- * @param {DataContractWASM} data_contract
1398
- * @param {string} type_name
1399
- * @param {PlatformVersionWASM} platform_version
1400
- * @returns {Uint8Array}
2906
+ * @returns {any}
1401
2907
  */
1402
- toBytes(data_contract, type_name, platform_version) {
2908
+ toBytes() {
1403
2909
  try {
1404
2910
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1405
- _assertClass(data_contract, DataContractWASM);
1406
- const ptr0 = passStringToWasm0(type_name, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
1407
- const len0 = WASM_VECTOR_LEN;
1408
- wasm.documentwasm_toBytes(retptr, this.__wbg_ptr, data_contract.__wbg_ptr, ptr0, len0, platform_version);
2911
+ wasm.documentsbatchwasm_toBytes(retptr, this.__wbg_ptr);
1409
2912
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1410
2913
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1411
2914
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1412
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1413
- if (r3) {
1414
- throw takeObject(r2);
2915
+ if (r2) {
2916
+ throw takeObject(r1);
1415
2917
  }
1416
- var v2 = getArrayU8FromWasm0(r0, r1).slice();
1417
- wasm.__wbindgen_export_3(r0, r1 * 1, 1);
1418
- return v2;
2918
+ return takeObject(r0);
1419
2919
  } finally {
1420
2920
  wasm.__wbindgen_add_to_stack_pointer(16);
1421
2921
  }
1422
2922
  }
1423
2923
  /**
1424
2924
  * @param {Uint8Array} bytes
1425
- * @param {DataContractWASM} data_contract
1426
- * @param {string} type_name
1427
- * @param {PlatformVersionWASM} platform_version
1428
- * @returns {DocumentWASM}
2925
+ * @returns {DocumentsBatchWASM}
1429
2926
  */
1430
- static fromBytes(bytes, data_contract, type_name, platform_version) {
2927
+ static fromBytes(bytes) {
1431
2928
  try {
1432
2929
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1433
2930
  const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export_1);
1434
2931
  const len0 = WASM_VECTOR_LEN;
1435
- _assertClass(data_contract, DataContractWASM);
1436
- const ptr1 = passStringToWasm0(type_name, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
1437
- const len1 = WASM_VECTOR_LEN;
1438
- wasm.documentwasm_fromBytes(retptr, ptr0, len0, data_contract.__wbg_ptr, ptr1, len1, platform_version);
2932
+ wasm.documentsbatchwasm_fromBytes(retptr, ptr0, len0);
1439
2933
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1440
2934
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1441
2935
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1442
2936
  if (r2) {
1443
2937
  throw takeObject(r1);
1444
2938
  }
1445
- return DocumentWASM.__wrap(r0);
2939
+ return DocumentsBatchWASM.__wrap(r0);
1446
2940
  } finally {
1447
2941
  wasm.__wbindgen_add_to_stack_pointer(16);
1448
2942
  }
@@ -1635,13 +3129,13 @@ export class IdentityPublicKeyInCreationWASM {
1635
3129
  * @param {SecurityLevel} security_level
1636
3130
  * @param {KeyType} key_type
1637
3131
  * @param {boolean} read_only
1638
- * @param {string} binary_data
1639
- * @param {string} signature
3132
+ * @param {Uint8Array} binary_data
3133
+ * @param {Uint8Array} signature
1640
3134
  */
1641
3135
  constructor(id, purpose, security_level, key_type, read_only, binary_data, signature) {
1642
- const ptr0 = passStringToWasm0(binary_data, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
3136
+ const ptr0 = passArray8ToWasm0(binary_data, wasm.__wbindgen_export_1);
1643
3137
  const len0 = WASM_VECTOR_LEN;
1644
- const ptr1 = passStringToWasm0(signature, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
3138
+ const ptr1 = passArray8ToWasm0(signature, wasm.__wbindgen_export_1);
1645
3139
  const len1 = WASM_VECTOR_LEN;
1646
3140
  const ret = wasm.identitypublickeyincreationwasm_new(id, purpose, security_level, key_type, read_only, ptr0, len0, ptr1, len1);
1647
3141
  this.__wbg_ptr = ret >>> 0;
@@ -1652,8 +3146,19 @@ export class IdentityPublicKeyInCreationWASM {
1652
3146
  * @returns {IdentityPublicKeyWASM}
1653
3147
  */
1654
3148
  toIdentityPublicKey() {
1655
- const ret = wasm.identitypublickeyincreationwasm_toIdentityPublicKey(this.__wbg_ptr);
1656
- return IdentityPublicKeyWASM.__wrap(ret);
3149
+ try {
3150
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3151
+ wasm.identitypublickeyincreationwasm_toIdentityPublicKey(retptr, this.__wbg_ptr);
3152
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3153
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3154
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3155
+ if (r2) {
3156
+ throw takeObject(r1);
3157
+ }
3158
+ return IdentityPublicKeyWASM.__wrap(r0);
3159
+ } finally {
3160
+ wasm.__wbindgen_add_to_stack_pointer(16);
3161
+ }
1657
3162
  }
1658
3163
  /**
1659
3164
  * @returns {number}
@@ -1663,25 +3168,61 @@ export class IdentityPublicKeyInCreationWASM {
1663
3168
  return ret >>> 0;
1664
3169
  }
1665
3170
  /**
1666
- * @returns {Purpose}
3171
+ * @returns {string}
1667
3172
  */
1668
3173
  getPurpose() {
1669
- const ret = wasm.identitypublickeyincreationwasm_getPurpose(this.__wbg_ptr);
1670
- return ret;
3174
+ let deferred1_0;
3175
+ let deferred1_1;
3176
+ try {
3177
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3178
+ wasm.identitypublickeyincreationwasm_getPurpose(retptr, this.__wbg_ptr);
3179
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3180
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3181
+ deferred1_0 = r0;
3182
+ deferred1_1 = r1;
3183
+ return getStringFromWasm0(r0, r1);
3184
+ } finally {
3185
+ wasm.__wbindgen_add_to_stack_pointer(16);
3186
+ wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
3187
+ }
1671
3188
  }
1672
3189
  /**
1673
- * @returns {SecurityLevel}
3190
+ * @returns {string}
1674
3191
  */
1675
3192
  getSecurityLevel() {
1676
- const ret = wasm.identitypublickeyincreationwasm_getSecurityLevel(this.__wbg_ptr);
1677
- return ret;
3193
+ let deferred1_0;
3194
+ let deferred1_1;
3195
+ try {
3196
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3197
+ wasm.identitypublickeyincreationwasm_getSecurityLevel(retptr, this.__wbg_ptr);
3198
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3199
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3200
+ deferred1_0 = r0;
3201
+ deferred1_1 = r1;
3202
+ return getStringFromWasm0(r0, r1);
3203
+ } finally {
3204
+ wasm.__wbindgen_add_to_stack_pointer(16);
3205
+ wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
3206
+ }
1678
3207
  }
1679
3208
  /**
1680
- * @returns {KeyType}
3209
+ * @returns {string}
1681
3210
  */
1682
3211
  getKeyType() {
1683
- const ret = wasm.identitypublickeyincreationwasm_getKeyType(this.__wbg_ptr);
1684
- return ret;
3212
+ let deferred1_0;
3213
+ let deferred1_1;
3214
+ try {
3215
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3216
+ wasm.identitypublickeyincreationwasm_getKeyType(retptr, this.__wbg_ptr);
3217
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3218
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3219
+ deferred1_0 = r0;
3220
+ deferred1_1 = r1;
3221
+ return getStringFromWasm0(r0, r1);
3222
+ } finally {
3223
+ wasm.__wbindgen_add_to_stack_pointer(16);
3224
+ wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
3225
+ }
1685
3226
  }
1686
3227
  /**
1687
3228
  * @returns {boolean}
@@ -1716,16 +3257,36 @@ export class IdentityPublicKeyInCreationWASM {
1716
3257
  wasm.identitypublickeyincreationwasm_setKeyId(this.__wbg_ptr, key_id);
1717
3258
  }
1718
3259
  /**
1719
- * @param {Purpose} purpose
3260
+ * @param {any} js_purpose
1720
3261
  */
1721
- setPurpose(purpose) {
1722
- wasm.identitypublickeyincreationwasm_setPurpose(this.__wbg_ptr, purpose);
3262
+ setPurpose(js_purpose) {
3263
+ try {
3264
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3265
+ wasm.identitypublickeyincreationwasm_setPurpose(retptr, this.__wbg_ptr, addHeapObject(js_purpose));
3266
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3267
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3268
+ if (r1) {
3269
+ throw takeObject(r0);
3270
+ }
3271
+ } finally {
3272
+ wasm.__wbindgen_add_to_stack_pointer(16);
3273
+ }
1723
3274
  }
1724
3275
  /**
1725
- * @param {SecurityLevel} security_level
3276
+ * @param {any} js_security_level
1726
3277
  */
1727
- setSecurityLevel(security_level) {
1728
- wasm.identitypublickeyincreationwasm_setSecurityLevel(this.__wbg_ptr, security_level);
3278
+ setSecurityLevel(js_security_level) {
3279
+ try {
3280
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3281
+ wasm.identitypublickeyincreationwasm_setSecurityLevel(retptr, this.__wbg_ptr, addHeapObject(js_security_level));
3282
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3283
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3284
+ if (r1) {
3285
+ throw takeObject(r0);
3286
+ }
3287
+ } finally {
3288
+ wasm.__wbindgen_add_to_stack_pointer(16);
3289
+ }
1729
3290
  }
1730
3291
  /**
1731
3292
  * @param {boolean} read_only
@@ -1734,10 +3295,10 @@ export class IdentityPublicKeyInCreationWASM {
1734
3295
  wasm.identitypublickeyincreationwasm_setReadOnly(this.__wbg_ptr, read_only);
1735
3296
  }
1736
3297
  /**
1737
- * @param {string} binary_data
3298
+ * @param {Uint8Array} binary_data
1738
3299
  */
1739
3300
  setData(binary_data) {
1740
- const ptr0 = passStringToWasm0(binary_data, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
3301
+ const ptr0 = passArray8ToWasm0(binary_data, wasm.__wbindgen_export_1);
1741
3302
  const len0 = WASM_VECTOR_LEN;
1742
3303
  wasm.identitypublickeyincreationwasm_setData(this.__wbg_ptr, ptr0, len0);
1743
3304
  }
@@ -1770,20 +3331,53 @@ export class IdentityPublicKeyWASM {
1770
3331
  }
1771
3332
  /**
1772
3333
  * @param {number} id
1773
- * @param {Purpose} purpose
1774
- * @param {SecurityLevel} security_level
1775
- * @param {KeyType} key_type
3334
+ * @param {any} js_purpose
3335
+ * @param {any} js_security_level
3336
+ * @param {any} js_key_type
1776
3337
  * @param {boolean} read_only
1777
3338
  * @param {string} binary_data
1778
3339
  * @param {bigint | null} [disabled_at]
1779
3340
  */
1780
- constructor(id, purpose, security_level, key_type, read_only, binary_data, disabled_at) {
1781
- const ptr0 = passStringToWasm0(binary_data, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
1782
- const len0 = WASM_VECTOR_LEN;
1783
- const ret = wasm.identitypublickeywasm_new(id, purpose, security_level, key_type, read_only, ptr0, len0, !isLikeNone(disabled_at), isLikeNone(disabled_at) ? BigInt(0) : disabled_at);
1784
- this.__wbg_ptr = ret >>> 0;
1785
- IdentityPublicKeyWASMFinalization.register(this, this.__wbg_ptr, this);
1786
- return this;
3341
+ constructor(id, js_purpose, js_security_level, js_key_type, read_only, binary_data, disabled_at) {
3342
+ try {
3343
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3344
+ const ptr0 = passStringToWasm0(binary_data, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
3345
+ const len0 = WASM_VECTOR_LEN;
3346
+ wasm.identitypublickeywasm_new(retptr, id, addHeapObject(js_purpose), addHeapObject(js_security_level), addHeapObject(js_key_type), read_only, ptr0, len0, !isLikeNone(disabled_at), isLikeNone(disabled_at) ? BigInt(0) : disabled_at);
3347
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3348
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3349
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3350
+ if (r2) {
3351
+ throw takeObject(r1);
3352
+ }
3353
+ this.__wbg_ptr = r0 >>> 0;
3354
+ IdentityPublicKeyWASMFinalization.register(this, this.__wbg_ptr, this);
3355
+ return this;
3356
+ } finally {
3357
+ wasm.__wbindgen_add_to_stack_pointer(16);
3358
+ }
3359
+ }
3360
+ /**
3361
+ * @param {Uint8Array} js_private_key_bytes
3362
+ * @param {any} js_network
3363
+ * @returns {boolean}
3364
+ */
3365
+ validatePrivateKey(js_private_key_bytes, js_network) {
3366
+ try {
3367
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3368
+ const ptr0 = passArray8ToWasm0(js_private_key_bytes, wasm.__wbindgen_export_1);
3369
+ const len0 = WASM_VECTOR_LEN;
3370
+ wasm.identitypublickeywasm_validatePrivateKey(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(js_network));
3371
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3372
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3373
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3374
+ if (r2) {
3375
+ throw takeObject(r1);
3376
+ }
3377
+ return r0 !== 0;
3378
+ } finally {
3379
+ wasm.__wbindgen_add_to_stack_pointer(16);
3380
+ }
1787
3381
  }
1788
3382
  /**
1789
3383
  * @returns {number}
@@ -1793,25 +3387,61 @@ export class IdentityPublicKeyWASM {
1793
3387
  return ret >>> 0;
1794
3388
  }
1795
3389
  /**
1796
- * @returns {Purpose}
3390
+ * @returns {string}
1797
3391
  */
1798
3392
  getPurpose() {
1799
- const ret = wasm.identitypublickeywasm_getPurpose(this.__wbg_ptr);
1800
- return ret;
3393
+ let deferred1_0;
3394
+ let deferred1_1;
3395
+ try {
3396
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3397
+ wasm.identitypublickeywasm_getPurpose(retptr, this.__wbg_ptr);
3398
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3399
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3400
+ deferred1_0 = r0;
3401
+ deferred1_1 = r1;
3402
+ return getStringFromWasm0(r0, r1);
3403
+ } finally {
3404
+ wasm.__wbindgen_add_to_stack_pointer(16);
3405
+ wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
3406
+ }
1801
3407
  }
1802
3408
  /**
1803
- * @returns {SecurityLevel}
3409
+ * @returns {string}
1804
3410
  */
1805
3411
  getSecurityLevel() {
1806
- const ret = wasm.identitypublickeywasm_getSecurityLevel(this.__wbg_ptr);
1807
- return ret;
3412
+ let deferred1_0;
3413
+ let deferred1_1;
3414
+ try {
3415
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3416
+ wasm.identitypublickeywasm_getSecurityLevel(retptr, this.__wbg_ptr);
3417
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3418
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3419
+ deferred1_0 = r0;
3420
+ deferred1_1 = r1;
3421
+ return getStringFromWasm0(r0, r1);
3422
+ } finally {
3423
+ wasm.__wbindgen_add_to_stack_pointer(16);
3424
+ wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
3425
+ }
1808
3426
  }
1809
3427
  /**
1810
- * @returns {KeyType}
3428
+ * @returns {string}
1811
3429
  */
1812
3430
  getKeyType() {
1813
- const ret = wasm.identitypublickeywasm_getKeyType(this.__wbg_ptr);
1814
- return ret;
3431
+ let deferred1_0;
3432
+ let deferred1_1;
3433
+ try {
3434
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3435
+ wasm.identitypublickeywasm_getKeyType(retptr, this.__wbg_ptr);
3436
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3437
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3438
+ deferred1_0 = r0;
3439
+ deferred1_1 = r1;
3440
+ return getStringFromWasm0(r0, r1);
3441
+ } finally {
3442
+ wasm.__wbindgen_add_to_stack_pointer(16);
3443
+ wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
3444
+ }
1815
3445
  }
1816
3446
  /**
1817
3447
  * @returns {boolean}
@@ -1860,22 +3490,52 @@ export class IdentityPublicKeyWASM {
1860
3490
  wasm.identitypublickeywasm_setKeyId(this.__wbg_ptr, key_id);
1861
3491
  }
1862
3492
  /**
1863
- * @param {Purpose} purpose
3493
+ * @param {any} purpose
1864
3494
  */
1865
3495
  setPurpose(purpose) {
1866
- wasm.identitypublickeywasm_setPurpose(this.__wbg_ptr, purpose);
3496
+ try {
3497
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3498
+ wasm.identitypublickeywasm_setPurpose(retptr, this.__wbg_ptr, addHeapObject(purpose));
3499
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3500
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3501
+ if (r1) {
3502
+ throw takeObject(r0);
3503
+ }
3504
+ } finally {
3505
+ wasm.__wbindgen_add_to_stack_pointer(16);
3506
+ }
1867
3507
  }
1868
3508
  /**
1869
- * @param {SecurityLevel} security_level
3509
+ * @param {any} security_level
1870
3510
  */
1871
3511
  setSecurityLevel(security_level) {
1872
- wasm.identitypublickeywasm_setSecurityLevel(this.__wbg_ptr, security_level);
3512
+ try {
3513
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3514
+ wasm.identitypublickeywasm_setSecurityLevel(retptr, this.__wbg_ptr, addHeapObject(security_level));
3515
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3516
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3517
+ if (r1) {
3518
+ throw takeObject(r0);
3519
+ }
3520
+ } finally {
3521
+ wasm.__wbindgen_add_to_stack_pointer(16);
3522
+ }
1873
3523
  }
1874
3524
  /**
1875
- * @param {KeyType} key_type
3525
+ * @param {any} key_type
1876
3526
  */
1877
3527
  setKeyType(key_type) {
1878
- wasm.identitypublickeywasm_setKeyType(this.__wbg_ptr, key_type);
3528
+ try {
3529
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3530
+ wasm.identitypublickeywasm_setKeyType(retptr, this.__wbg_ptr, addHeapObject(key_type));
3531
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3532
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3533
+ if (r1) {
3534
+ throw takeObject(r0);
3535
+ }
3536
+ } finally {
3537
+ wasm.__wbindgen_add_to_stack_pointer(16);
3538
+ }
1879
3539
  }
1880
3540
  /**
1881
3541
  * @param {boolean} read_only
@@ -1897,6 +3557,33 @@ export class IdentityPublicKeyWASM {
1897
3557
  setDisabledAt(disabled_at) {
1898
3558
  wasm.identitypublickeywasm_setDisabledAt(this.__wbg_ptr, disabled_at);
1899
3559
  }
3560
+ /**
3561
+ * @returns {string}
3562
+ */
3563
+ getPublicKeyHash() {
3564
+ let deferred2_0;
3565
+ let deferred2_1;
3566
+ try {
3567
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3568
+ wasm.identitypublickeywasm_getPublicKeyHash(retptr, this.__wbg_ptr);
3569
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3570
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3571
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3572
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
3573
+ var ptr1 = r0;
3574
+ var len1 = r1;
3575
+ if (r3) {
3576
+ ptr1 = 0; len1 = 0;
3577
+ throw takeObject(r2);
3578
+ }
3579
+ deferred2_0 = ptr1;
3580
+ deferred2_1 = len1;
3581
+ return getStringFromWasm0(ptr1, len1);
3582
+ } finally {
3583
+ wasm.__wbindgen_add_to_stack_pointer(16);
3584
+ wasm.__wbindgen_export_3(deferred2_0, deferred2_1, 1);
3585
+ }
3586
+ }
1900
3587
  /**
1901
3588
  * @returns {Uint8Array}
1902
3589
  */
@@ -1989,12 +3676,20 @@ export class IdentityWASM {
1989
3676
  }
1990
3677
  }
1991
3678
  /**
1992
- * @param {string} js_identifier
3679
+ * @param {any} js_identifier
1993
3680
  */
1994
3681
  setId(js_identifier) {
1995
- const ptr0 = passStringToWasm0(js_identifier, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
1996
- const len0 = WASM_VECTOR_LEN;
1997
- wasm.identitywasm_setId(this.__wbg_ptr, ptr0, len0);
3682
+ try {
3683
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3684
+ wasm.identitywasm_setId(retptr, this.__wbg_ptr, addHeapObject(js_identifier));
3685
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3686
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3687
+ if (r1) {
3688
+ throw takeObject(r0);
3689
+ }
3690
+ } finally {
3691
+ wasm.__wbindgen_add_to_stack_pointer(16);
3692
+ }
1998
3693
  }
1999
3694
  /**
2000
3695
  * @param {bigint} balance
@@ -2013,26 +3708,22 @@ export class IdentityWASM {
2013
3708
  */
2014
3709
  addPublicKey(public_key) {
2015
3710
  _assertClass(public_key, IdentityPublicKeyWASM);
2016
- var ptr0 = public_key.__destroy_into_raw();
2017
- wasm.identitywasm_addPublicKey(this.__wbg_ptr, ptr0);
3711
+ wasm.identitywasm_addPublicKey(this.__wbg_ptr, public_key.__wbg_ptr);
2018
3712
  }
2019
3713
  /**
2020
- * @returns {string}
3714
+ * @returns {Uint8Array}
2021
3715
  */
2022
3716
  getId() {
2023
- let deferred1_0;
2024
- let deferred1_1;
2025
3717
  try {
2026
3718
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2027
3719
  wasm.identitywasm_getId(retptr, this.__wbg_ptr);
2028
3720
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2029
3721
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2030
- deferred1_0 = r0;
2031
- deferred1_1 = r1;
2032
- return getStringFromWasm0(r0, r1);
3722
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
3723
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
3724
+ return v1;
2033
3725
  } finally {
2034
3726
  wasm.__wbindgen_add_to_stack_pointer(16);
2035
- wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
2036
3727
  }
2037
3728
  }
2038
3729
  /**
@@ -2058,11 +3749,20 @@ export class IdentityWASM {
2058
3749
  return IdentityPublicKeyWASM.__wrap(ret);
2059
3750
  }
2060
3751
  /**
2061
- * @returns {any}
3752
+ * @returns {IdentityPublicKeyWASM[]}
2062
3753
  */
2063
3754
  getPublicKeys() {
2064
- const ret = wasm.identitywasm_getPublicKeys(this.__wbg_ptr);
2065
- return takeObject(ret);
3755
+ try {
3756
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3757
+ wasm.identitywasm_getPublicKeys(retptr, this.__wbg_ptr);
3758
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3759
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3760
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
3761
+ wasm.__wbindgen_export_3(r0, r1 * 4, 4);
3762
+ return v1;
3763
+ } finally {
3764
+ wasm.__wbindgen_add_to_stack_pointer(16);
3765
+ }
2066
3766
  }
2067
3767
  /**
2068
3768
  * @returns {Uint8Array}
@@ -2074,75 +3774,191 @@ export class IdentityWASM {
2074
3774
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2075
3775
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2076
3776
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2077
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2078
- if (r3) {
2079
- throw takeObject(r2);
3777
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
3778
+ if (r3) {
3779
+ throw takeObject(r2);
3780
+ }
3781
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
3782
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
3783
+ return v1;
3784
+ } finally {
3785
+ wasm.__wbindgen_add_to_stack_pointer(16);
3786
+ }
3787
+ }
3788
+ /**
3789
+ * @param {Uint8Array} bytes
3790
+ * @returns {IdentityWASM}
3791
+ */
3792
+ static fromBytes(bytes) {
3793
+ try {
3794
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3795
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export_1);
3796
+ const len0 = WASM_VECTOR_LEN;
3797
+ wasm.identitywasm_fromBytes(retptr, ptr0, len0);
3798
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3799
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3800
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3801
+ if (r2) {
3802
+ throw takeObject(r1);
3803
+ }
3804
+ return IdentityWASM.__wrap(r0);
3805
+ } finally {
3806
+ wasm.__wbindgen_add_to_stack_pointer(16);
3807
+ }
3808
+ }
3809
+ }
3810
+
3811
+ const PrefundedVotingBalanceWASMFinalization = (typeof FinalizationRegistry === 'undefined')
3812
+ ? { register: () => {}, unregister: () => {} }
3813
+ : new FinalizationRegistry(ptr => wasm.__wbg_prefundedvotingbalancewasm_free(ptr >>> 0, 1));
3814
+
3815
+ export class PrefundedVotingBalanceWASM {
3816
+
3817
+ static __wrap(ptr) {
3818
+ ptr = ptr >>> 0;
3819
+ const obj = Object.create(PrefundedVotingBalanceWASM.prototype);
3820
+ obj.__wbg_ptr = ptr;
3821
+ PrefundedVotingBalanceWASMFinalization.register(obj, obj.__wbg_ptr, obj);
3822
+ return obj;
3823
+ }
3824
+
3825
+ __destroy_into_raw() {
3826
+ const ptr = this.__wbg_ptr;
3827
+ this.__wbg_ptr = 0;
3828
+ PrefundedVotingBalanceWASMFinalization.unregister(this);
3829
+ return ptr;
3830
+ }
3831
+
3832
+ free() {
3833
+ const ptr = this.__destroy_into_raw();
3834
+ wasm.__wbg_prefundedvotingbalancewasm_free(ptr, 0);
3835
+ }
3836
+ /**
3837
+ * @param {string} index_name
3838
+ * @param {bigint} credits
3839
+ */
3840
+ constructor(index_name, credits) {
3841
+ const ptr0 = passStringToWasm0(index_name, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
3842
+ const len0 = WASM_VECTOR_LEN;
3843
+ const ret = wasm.prefundedvotingbalancewasm_new(ptr0, len0, credits);
3844
+ this.__wbg_ptr = ret >>> 0;
3845
+ PrefundedVotingBalanceWASMFinalization.register(this, this.__wbg_ptr, this);
3846
+ return this;
3847
+ }
3848
+ /**
3849
+ * @returns {string}
3850
+ */
3851
+ get indexName() {
3852
+ let deferred1_0;
3853
+ let deferred1_1;
3854
+ try {
3855
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3856
+ wasm.prefundedvotingbalancewasm_indexName(retptr, this.__wbg_ptr);
3857
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3858
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3859
+ deferred1_0 = r0;
3860
+ deferred1_1 = r1;
3861
+ return getStringFromWasm0(r0, r1);
3862
+ } finally {
3863
+ wasm.__wbindgen_add_to_stack_pointer(16);
3864
+ wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
3865
+ }
3866
+ }
3867
+ /**
3868
+ * @returns {bigint}
3869
+ */
3870
+ get credits() {
3871
+ const ret = wasm.prefundedvotingbalancewasm_credits(this.__wbg_ptr);
3872
+ return BigInt.asUintN(64, ret);
3873
+ }
3874
+ }
3875
+
3876
+ const PrivateKeyWASMFinalization = (typeof FinalizationRegistry === 'undefined')
3877
+ ? { register: () => {}, unregister: () => {} }
3878
+ : new FinalizationRegistry(ptr => wasm.__wbg_privatekeywasm_free(ptr >>> 0, 1));
3879
+
3880
+ export class PrivateKeyWASM {
3881
+
3882
+ static __wrap(ptr) {
3883
+ ptr = ptr >>> 0;
3884
+ const obj = Object.create(PrivateKeyWASM.prototype);
3885
+ obj.__wbg_ptr = ptr;
3886
+ PrivateKeyWASMFinalization.register(obj, obj.__wbg_ptr, obj);
3887
+ return obj;
3888
+ }
3889
+
3890
+ __destroy_into_raw() {
3891
+ const ptr = this.__wbg_ptr;
3892
+ this.__wbg_ptr = 0;
3893
+ PrivateKeyWASMFinalization.unregister(this);
3894
+ return ptr;
3895
+ }
3896
+
3897
+ free() {
3898
+ const ptr = this.__destroy_into_raw();
3899
+ wasm.__wbg_privatekeywasm_free(ptr, 0);
3900
+ }
3901
+ /**
3902
+ * @param {string} wif
3903
+ * @returns {PrivateKeyWASM}
3904
+ */
3905
+ static fromWIF(wif) {
3906
+ try {
3907
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3908
+ const ptr0 = passStringToWasm0(wif, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
3909
+ const len0 = WASM_VECTOR_LEN;
3910
+ wasm.privatekeywasm_fromWIF(retptr, ptr0, len0);
3911
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3912
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3913
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3914
+ if (r2) {
3915
+ throw takeObject(r1);
2080
3916
  }
2081
- var v1 = getArrayU8FromWasm0(r0, r1).slice();
2082
- wasm.__wbindgen_export_3(r0, r1 * 1, 1);
2083
- return v1;
3917
+ return PrivateKeyWASM.__wrap(r0);
2084
3918
  } finally {
2085
3919
  wasm.__wbindgen_add_to_stack_pointer(16);
2086
3920
  }
2087
3921
  }
2088
3922
  /**
2089
3923
  * @param {Uint8Array} bytes
2090
- * @returns {IdentityWASM}
3924
+ * @param {any} js_network
3925
+ * @returns {PrivateKeyWASM}
2091
3926
  */
2092
- static fromBytes(bytes) {
3927
+ static fromBytes(bytes, js_network) {
2093
3928
  try {
2094
3929
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2095
3930
  const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export_1);
2096
3931
  const len0 = WASM_VECTOR_LEN;
2097
- wasm.identitywasm_fromBytes(retptr, ptr0, len0);
3932
+ wasm.privatekeywasm_fromBytes(retptr, ptr0, len0, addHeapObject(js_network));
2098
3933
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2099
3934
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2100
3935
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2101
3936
  if (r2) {
2102
3937
  throw takeObject(r1);
2103
3938
  }
2104
- return IdentityWASM.__wrap(r0);
3939
+ return PrivateKeyWASM.__wrap(r0);
2105
3940
  } finally {
2106
3941
  wasm.__wbindgen_add_to_stack_pointer(16);
2107
3942
  }
2108
3943
  }
2109
- }
2110
-
2111
- const PrivateKeyWASMFinalization = (typeof FinalizationRegistry === 'undefined')
2112
- ? { register: () => {}, unregister: () => {} }
2113
- : new FinalizationRegistry(ptr => wasm.__wbg_privatekeywasm_free(ptr >>> 0, 1));
2114
-
2115
- export class PrivateKeyWASM {
2116
-
2117
- __destroy_into_raw() {
2118
- const ptr = this.__wbg_ptr;
2119
- this.__wbg_ptr = 0;
2120
- PrivateKeyWASMFinalization.unregister(this);
2121
- return ptr;
2122
- }
2123
-
2124
- free() {
2125
- const ptr = this.__destroy_into_raw();
2126
- wasm.__wbg_privatekeywasm_free(ptr, 0);
2127
- }
2128
3944
  /**
2129
- * @param {string} wif
3945
+ * @param {string} hex_key
3946
+ * @param {any} js_network
3947
+ * @returns {PrivateKeyWASM}
2130
3948
  */
2131
- constructor(wif) {
3949
+ static fromHex(hex_key, js_network) {
2132
3950
  try {
2133
3951
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2134
- const ptr0 = passStringToWasm0(wif, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
3952
+ const ptr0 = passStringToWasm0(hex_key, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
2135
3953
  const len0 = WASM_VECTOR_LEN;
2136
- wasm.privatekeywasm_new(retptr, ptr0, len0);
3954
+ wasm.privatekeywasm_fromHex(retptr, ptr0, len0, addHeapObject(js_network));
2137
3955
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2138
3956
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2139
3957
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2140
3958
  if (r2) {
2141
3959
  throw takeObject(r1);
2142
3960
  }
2143
- this.__wbg_ptr = r0 >>> 0;
2144
- PrivateKeyWASMFinalization.register(this, this.__wbg_ptr, this);
2145
- return this;
3961
+ return PrivateKeyWASM.__wrap(r0);
2146
3962
  } finally {
2147
3963
  wasm.__wbindgen_add_to_stack_pointer(16);
2148
3964
  }
@@ -2150,12 +3966,12 @@ export class PrivateKeyWASM {
2150
3966
  /**
2151
3967
  * @returns {string}
2152
3968
  */
2153
- getKeyWIF() {
3969
+ getWIF() {
2154
3970
  let deferred1_0;
2155
3971
  let deferred1_1;
2156
3972
  try {
2157
3973
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2158
- wasm.privatekeywasm_getKeyWIF(retptr, this.__wbg_ptr);
3974
+ wasm.privatekeywasm_getWIF(retptr, this.__wbg_ptr);
2159
3975
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2160
3976
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2161
3977
  deferred1_0 = r0;
@@ -2169,10 +3985,10 @@ export class PrivateKeyWASM {
2169
3985
  /**
2170
3986
  * @returns {Uint8Array}
2171
3987
  */
2172
- getKeyBytes() {
3988
+ getBytes() {
2173
3989
  try {
2174
3990
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2175
- wasm.privatekeywasm_getKeyBytes(retptr, this.__wbg_ptr);
3991
+ wasm.privatekeywasm_getBytes(retptr, this.__wbg_ptr);
2176
3992
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2177
3993
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2178
3994
  var v1 = getArrayU8FromWasm0(r0, r1).slice();
@@ -2182,6 +3998,44 @@ export class PrivateKeyWASM {
2182
3998
  wasm.__wbindgen_add_to_stack_pointer(16);
2183
3999
  }
2184
4000
  }
4001
+ /**
4002
+ * @returns {string}
4003
+ */
4004
+ getHex() {
4005
+ let deferred1_0;
4006
+ let deferred1_1;
4007
+ try {
4008
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4009
+ wasm.privatekeywasm_getHex(retptr, this.__wbg_ptr);
4010
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4011
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4012
+ deferred1_0 = r0;
4013
+ deferred1_1 = r1;
4014
+ return getStringFromWasm0(r0, r1);
4015
+ } finally {
4016
+ wasm.__wbindgen_add_to_stack_pointer(16);
4017
+ wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
4018
+ }
4019
+ }
4020
+ /**
4021
+ * @returns {string}
4022
+ */
4023
+ getPublicKeyHash() {
4024
+ let deferred1_0;
4025
+ let deferred1_1;
4026
+ try {
4027
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4028
+ wasm.privatekeywasm_getPublicKeyHash(retptr, this.__wbg_ptr);
4029
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4030
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4031
+ deferred1_0 = r0;
4032
+ deferred1_1 = r1;
4033
+ return getStringFromWasm0(r0, r1);
4034
+ } finally {
4035
+ wasm.__wbindgen_add_to_stack_pointer(16);
4036
+ wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
4037
+ }
4038
+ }
2185
4039
  }
2186
4040
 
2187
4041
  const StateTransitionWASMFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -2212,7 +4066,7 @@ export class StateTransitionWASM {
2212
4066
  /**
2213
4067
  * @param {PrivateKeyWASM} private_key
2214
4068
  * @param {IdentityPublicKeyWASM} public_key
2215
- * @returns {any}
4069
+ * @returns {Uint8Array}
2216
4070
  */
2217
4071
  sign(private_key, public_key) {
2218
4072
  try {
@@ -2223,23 +4077,40 @@ export class StateTransitionWASM {
2223
4077
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2224
4078
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2225
4079
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2226
- if (r2) {
2227
- throw takeObject(r1);
4080
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
4081
+ if (r3) {
4082
+ throw takeObject(r2);
2228
4083
  }
2229
- return takeObject(r0);
4084
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
4085
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
4086
+ return v1;
2230
4087
  } finally {
2231
4088
  wasm.__wbindgen_add_to_stack_pointer(16);
2232
4089
  }
2233
4090
  }
2234
4091
  /**
2235
4092
  * @param {PrivateKeyWASM} private_key
2236
- * @param {KeyType} key_type
2237
- * @returns {any}
4093
+ * @param {any} js_key_type
4094
+ * @returns {Uint8Array}
2238
4095
  */
2239
- signByPrivateKey(private_key, key_type) {
2240
- _assertClass(private_key, PrivateKeyWASM);
2241
- const ret = wasm.statetransitionwasm_signByPrivateKey(this.__wbg_ptr, private_key.__wbg_ptr, key_type);
2242
- return takeObject(ret);
4096
+ signByPrivateKey(private_key, js_key_type) {
4097
+ try {
4098
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4099
+ _assertClass(private_key, PrivateKeyWASM);
4100
+ wasm.statetransitionwasm_signByPrivateKey(retptr, this.__wbg_ptr, private_key.__wbg_ptr, addHeapObject(js_key_type));
4101
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4102
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4103
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
4104
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
4105
+ if (r3) {
4106
+ throw takeObject(r2);
4107
+ }
4108
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
4109
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
4110
+ return v1;
4111
+ } finally {
4112
+ wasm.__wbindgen_add_to_stack_pointer(16);
4113
+ }
2243
4114
  }
2244
4115
  /**
2245
4116
  * @returns {any}
@@ -2280,6 +4151,138 @@ export class StateTransitionWASM {
2280
4151
  wasm.__wbindgen_add_to_stack_pointer(16);
2281
4152
  }
2282
4153
  }
4154
+ /**
4155
+ * @param {boolean} skip_signature
4156
+ * @returns {string}
4157
+ */
4158
+ hash(skip_signature) {
4159
+ let deferred2_0;
4160
+ let deferred2_1;
4161
+ try {
4162
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4163
+ wasm.statetransitionwasm_hash(retptr, this.__wbg_ptr, skip_signature);
4164
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4165
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4166
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
4167
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
4168
+ var ptr1 = r0;
4169
+ var len1 = r1;
4170
+ if (r3) {
4171
+ ptr1 = 0; len1 = 0;
4172
+ throw takeObject(r2);
4173
+ }
4174
+ deferred2_0 = ptr1;
4175
+ deferred2_1 = len1;
4176
+ return getStringFromWasm0(ptr1, len1);
4177
+ } finally {
4178
+ wasm.__wbindgen_add_to_stack_pointer(16);
4179
+ wasm.__wbindgen_export_3(deferred2_0, deferred2_1, 1);
4180
+ }
4181
+ }
4182
+ /**
4183
+ * @returns {string}
4184
+ */
4185
+ getActionType() {
4186
+ let deferred1_0;
4187
+ let deferred1_1;
4188
+ try {
4189
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4190
+ wasm.statetransitionwasm_getActionType(retptr, this.__wbg_ptr);
4191
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4192
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4193
+ deferred1_0 = r0;
4194
+ deferred1_1 = r1;
4195
+ return getStringFromWasm0(r0, r1);
4196
+ } finally {
4197
+ wasm.__wbindgen_add_to_stack_pointer(16);
4198
+ wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
4199
+ }
4200
+ }
4201
+ /**
4202
+ * @returns {Uint8Array}
4203
+ */
4204
+ getOwnerId() {
4205
+ try {
4206
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4207
+ wasm.statetransitionwasm_getOwnerId(retptr, this.__wbg_ptr);
4208
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4209
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4210
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
4211
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
4212
+ return v1;
4213
+ } finally {
4214
+ wasm.__wbindgen_add_to_stack_pointer(16);
4215
+ }
4216
+ }
4217
+ /**
4218
+ * @returns {Uint8Array}
4219
+ */
4220
+ get signature() {
4221
+ try {
4222
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4223
+ wasm.statetransitionwasm_get_signature(retptr, this.__wbg_ptr);
4224
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4225
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4226
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
4227
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
4228
+ return v1;
4229
+ } finally {
4230
+ wasm.__wbindgen_add_to_stack_pointer(16);
4231
+ }
4232
+ }
4233
+ /**
4234
+ * @returns {number | undefined}
4235
+ */
4236
+ get signaturePublicKeyId() {
4237
+ const ret = wasm.statetransitionwasm_get_signature_public_key_id(this.__wbg_ptr);
4238
+ return ret === 0x100000001 ? undefined : ret;
4239
+ }
4240
+ /**
4241
+ * @returns {number}
4242
+ */
4243
+ get userFeeIncrease() {
4244
+ const ret = wasm.statetransitionwasm_get_user_fee_increase(this.__wbg_ptr);
4245
+ return ret;
4246
+ }
4247
+ /**
4248
+ * @returns {string[] | undefined}
4249
+ */
4250
+ getPurposeRequirement() {
4251
+ try {
4252
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4253
+ wasm.statetransitionwasm_getPurposeRequirement(retptr, this.__wbg_ptr);
4254
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4255
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4256
+ let v1;
4257
+ if (r0 !== 0) {
4258
+ v1 = getArrayJsValueFromWasm0(r0, r1).slice();
4259
+ wasm.__wbindgen_export_3(r0, r1 * 4, 4);
4260
+ }
4261
+ return v1;
4262
+ } finally {
4263
+ wasm.__wbindgen_add_to_stack_pointer(16);
4264
+ }
4265
+ }
4266
+ /**
4267
+ * @param {Uint8Array} signature
4268
+ */
4269
+ set signature(signature) {
4270
+ const ptr0 = passArray8ToWasm0(signature, wasm.__wbindgen_export_1);
4271
+ const len0 = WASM_VECTOR_LEN;
4272
+ wasm.statetransitionwasm_set_signature(this.__wbg_ptr, ptr0, len0);
4273
+ }
4274
+ /**
4275
+ * @param {number} key_id
4276
+ */
4277
+ set signaturePublicKeyId(key_id) {
4278
+ wasm.statetransitionwasm_set_signature_public_key_id(this.__wbg_ptr, key_id);
4279
+ }
4280
+ /**
4281
+ * @param {number} user_fee_increase
4282
+ */
4283
+ set userFeeIncrease(user_fee_increase) {
4284
+ wasm.statetransitionwasm_set_user_fee_increase(this.__wbg_ptr, user_fee_increase);
4285
+ }
2283
4286
  }
2284
4287
 
2285
4288
  async function __wbg_load(module, imports) {
@@ -2328,25 +4331,105 @@ function __wbg_get_imports() {
2328
4331
  const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
2329
4332
  return addHeapObject(ret);
2330
4333
  }, arguments) };
4334
+ imports.wbg.__wbg_constructor_9fd96f589d65d4e5 = function(arg0) {
4335
+ const ret = getObject(arg0).constructor;
4336
+ return addHeapObject(ret);
4337
+ };
2331
4338
  imports.wbg.__wbg_crypto_ed58b8e10a292839 = function(arg0) {
2332
4339
  const ret = getObject(arg0).crypto;
2333
4340
  return addHeapObject(ret);
2334
4341
  };
4342
+ imports.wbg.__wbg_documenttransitionwasm_new = function(arg0) {
4343
+ const ret = DocumentTransitionWASM.__wrap(arg0);
4344
+ return addHeapObject(ret);
4345
+ };
4346
+ imports.wbg.__wbg_documenttransitionwasm_unwrap = function(arg0) {
4347
+ const ret = DocumentTransitionWASM.__unwrap(takeObject(arg0));
4348
+ return ret;
4349
+ };
4350
+ imports.wbg.__wbg_done_769e5ede4b31c67b = function(arg0) {
4351
+ const ret = getObject(arg0).done;
4352
+ return ret;
4353
+ };
4354
+ imports.wbg.__wbg_entries_3265d4158b33e5dc = function(arg0) {
4355
+ const ret = Object.entries(getObject(arg0));
4356
+ return addHeapObject(ret);
4357
+ };
2335
4358
  imports.wbg.__wbg_from_2a5d3e218e67aa85 = function(arg0) {
2336
4359
  const ret = Array.from(getObject(arg0));
2337
4360
  return addHeapObject(ret);
2338
4361
  };
4362
+ imports.wbg.__wbg_getPrototypeOf_64af13611bceb86e = function(arg0) {
4363
+ const ret = Object.getPrototypeOf(getObject(arg0));
4364
+ return addHeapObject(ret);
4365
+ };
2339
4366
  imports.wbg.__wbg_getRandomValues_bcb4912f16000dc4 = function() { return handleError(function (arg0, arg1) {
2340
4367
  getObject(arg0).getRandomValues(getObject(arg1));
2341
4368
  }, arguments) };
4369
+ imports.wbg.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
4370
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
4371
+ return addHeapObject(ret);
4372
+ }, arguments) };
4373
+ imports.wbg.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
4374
+ const ret = getObject(arg0)[arg1 >>> 0];
4375
+ return addHeapObject(ret);
4376
+ };
2342
4377
  imports.wbg.__wbg_identitypublickeyincreationwasm_new = function(arg0) {
2343
4378
  const ret = IdentityPublicKeyInCreationWASM.__wrap(arg0);
2344
4379
  return addHeapObject(ret);
2345
4380
  };
4381
+ imports.wbg.__wbg_identitypublickeywasm_new = function(arg0) {
4382
+ const ret = IdentityPublicKeyWASM.__wrap(arg0);
4383
+ return addHeapObject(ret);
4384
+ };
4385
+ imports.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
4386
+ let result;
4387
+ try {
4388
+ result = getObject(arg0) instanceof ArrayBuffer;
4389
+ } catch (_) {
4390
+ result = false;
4391
+ }
4392
+ const ret = result;
4393
+ return ret;
4394
+ };
4395
+ imports.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
4396
+ let result;
4397
+ try {
4398
+ result = getObject(arg0) instanceof Uint8Array;
4399
+ } catch (_) {
4400
+ result = false;
4401
+ }
4402
+ const ret = result;
4403
+ return ret;
4404
+ };
4405
+ imports.wbg.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
4406
+ const ret = Array.isArray(getObject(arg0));
4407
+ return ret;
4408
+ };
4409
+ imports.wbg.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
4410
+ const ret = Number.isSafeInteger(getObject(arg0));
4411
+ return ret;
4412
+ };
4413
+ imports.wbg.__wbg_iterator_9a24c88df860dc65 = function() {
4414
+ const ret = Symbol.iterator;
4415
+ return addHeapObject(ret);
4416
+ };
4417
+ imports.wbg.__wbg_length_a446193dc22c12f8 = function(arg0) {
4418
+ const ret = getObject(arg0).length;
4419
+ return ret;
4420
+ };
4421
+ imports.wbg.__wbg_length_e2d2a49132c1b256 = function(arg0) {
4422
+ const ret = getObject(arg0).length;
4423
+ return ret;
4424
+ };
2346
4425
  imports.wbg.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
2347
4426
  const ret = getObject(arg0).msCrypto;
2348
4427
  return addHeapObject(ret);
2349
4428
  };
4429
+ imports.wbg.__wbg_name_16617c8e9d4188ac = function(arg0) {
4430
+ const ret = getObject(arg0).name;
4431
+ return addHeapObject(ret);
4432
+ };
2350
4433
  imports.wbg.__wbg_new_405e22f390576ce2 = function() {
2351
4434
  const ret = new Object();
2352
4435
  return addHeapObject(ret);
@@ -2379,6 +4462,14 @@ function __wbg_get_imports() {
2379
4462
  const ret = new Uint8Array(arg0 >>> 0);
2380
4463
  return addHeapObject(ret);
2381
4464
  };
4465
+ imports.wbg.__wbg_next_25feadfc0913fea9 = function(arg0) {
4466
+ const ret = getObject(arg0).next;
4467
+ return addHeapObject(ret);
4468
+ };
4469
+ imports.wbg.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
4470
+ const ret = getObject(arg0).next();
4471
+ return addHeapObject(ret);
4472
+ }, arguments) };
2382
4473
  imports.wbg.__wbg_node_02999533c4ea02e3 = function(arg0) {
2383
4474
  const ret = getObject(arg0).node;
2384
4475
  return addHeapObject(ret);
@@ -2431,6 +4522,10 @@ function __wbg_get_imports() {
2431
4522
  const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
2432
4523
  return addHeapObject(ret);
2433
4524
  };
4525
+ imports.wbg.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
4526
+ const ret = getObject(arg0).value;
4527
+ return addHeapObject(ret);
4528
+ };
2434
4529
  imports.wbg.__wbg_versions_c71aa1626a93e0a1 = function(arg0) {
2435
4530
  const ret = getObject(arg0).versions;
2436
4531
  return addHeapObject(ret);
@@ -2451,6 +4546,17 @@ function __wbg_get_imports() {
2451
4546
  const ret = BigInt.asUintN(64, arg0);
2452
4547
  return addHeapObject(ret);
2453
4548
  };
4549
+ imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
4550
+ const v = getObject(arg1);
4551
+ const ret = typeof(v) === 'bigint' ? v : undefined;
4552
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
4553
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
4554
+ };
4555
+ imports.wbg.__wbindgen_boolean_get = function(arg0) {
4556
+ const v = getObject(arg0);
4557
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
4558
+ return ret;
4559
+ };
2454
4560
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
2455
4561
  const ret = debugString(getObject(arg1));
2456
4562
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
@@ -2462,6 +4568,18 @@ function __wbg_get_imports() {
2462
4568
  const ret = new Error(getStringFromWasm0(arg0, arg1));
2463
4569
  return addHeapObject(ret);
2464
4570
  };
4571
+ imports.wbg.__wbindgen_in = function(arg0, arg1) {
4572
+ const ret = getObject(arg0) in getObject(arg1);
4573
+ return ret;
4574
+ };
4575
+ imports.wbg.__wbindgen_is_array = function(arg0) {
4576
+ const ret = Array.isArray(getObject(arg0));
4577
+ return ret;
4578
+ };
4579
+ imports.wbg.__wbindgen_is_bigint = function(arg0) {
4580
+ const ret = typeof(getObject(arg0)) === 'bigint';
4581
+ return ret;
4582
+ };
2465
4583
  imports.wbg.__wbindgen_is_function = function(arg0) {
2466
4584
  const ret = typeof(getObject(arg0)) === 'function';
2467
4585
  return ret;
@@ -2483,10 +4601,24 @@ function __wbg_get_imports() {
2483
4601
  const ret = getObject(arg0) === undefined;
2484
4602
  return ret;
2485
4603
  };
4604
+ imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) {
4605
+ const ret = getObject(arg0) === getObject(arg1);
4606
+ return ret;
4607
+ };
4608
+ imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
4609
+ const ret = getObject(arg0) == getObject(arg1);
4610
+ return ret;
4611
+ };
2486
4612
  imports.wbg.__wbindgen_memory = function() {
2487
4613
  const ret = wasm.memory;
2488
4614
  return addHeapObject(ret);
2489
4615
  };
4616
+ imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
4617
+ const obj = getObject(arg1);
4618
+ const ret = typeof(obj) === 'number' ? obj : undefined;
4619
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
4620
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
4621
+ };
2490
4622
  imports.wbg.__wbindgen_number_new = function(arg0) {
2491
4623
  const ret = arg0;
2492
4624
  return addHeapObject(ret);