pshenmic-dpp 1.0.3 → 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 (83) hide show
  1. package/.github/workflows/build.yml +8 -0
  2. package/.github/workflows/publish.yml +8 -0
  3. package/Cargo.lock +89 -28
  4. package/Cargo.toml +22 -18
  5. package/README.md +66 -23
  6. package/babel.config.json +19 -0
  7. package/dist/wasm/pshenmic_dpp.js +2992 -402
  8. package/dist/wasm/pshenmic_dpp_bg.js +1 -1
  9. package/package.json +13 -6
  10. package/packages/{cbor-conversation → cbor_conversation}/Cargo.toml +1 -5
  11. package/packages/data_contract/Cargo.toml +3 -7
  12. package/packages/data_contract/src/lib.rs +234 -47
  13. package/packages/{document_batch → data_contract_transitions}/Cargo.toml +6 -14
  14. package/packages/data_contract_transitions/src/create/mod.rs +161 -0
  15. package/packages/data_contract_transitions/src/lib.rs +2 -0
  16. package/packages/data_contract_transitions/src/update/mod.rs +144 -0
  17. package/packages/document/Cargo.toml +2 -7
  18. package/packages/document/src/lib.rs +1 -1
  19. package/packages/document/src/methods/mod.rs +370 -2
  20. package/packages/documents_batch/Cargo.toml +19 -0
  21. package/packages/documents_batch/src/document_base_transition/mod.rs +92 -0
  22. package/packages/documents_batch/src/document_transition/mod.rs +166 -0
  23. package/packages/documents_batch/src/generators.rs +122 -0
  24. package/packages/documents_batch/src/lib.rs +188 -0
  25. package/packages/documents_batch/src/prefunded_voting_balance/mod.rs +45 -0
  26. package/packages/documents_batch/src/transitions/create/mod.rs +123 -0
  27. package/packages/documents_batch/src/transitions/delete/mod.rs +67 -0
  28. package/packages/documents_batch/src/transitions/mod.rs +6 -0
  29. package/packages/documents_batch/src/transitions/purchase/mod.rs +91 -0
  30. package/packages/documents_batch/src/transitions/replace/mod.rs +93 -0
  31. package/packages/documents_batch/src/transitions/transfer/mod.rs +86 -0
  32. package/packages/documents_batch/src/transitions/update_price/mod.rs +75 -0
  33. package/packages/enums/Cargo.toml +2 -5
  34. package/packages/enums/src/batch/batch_enum.rs +75 -10
  35. package/packages/enums/src/keys/key_type.rs +46 -0
  36. package/packages/enums/src/keys/purpose.rs +55 -0
  37. package/packages/enums/src/keys/security_level.rs +46 -0
  38. package/packages/enums/src/lib.rs +1 -0
  39. package/packages/enums/src/network/mod.rs +67 -0
  40. package/packages/enums/src/platform/mod.rs +66 -8
  41. package/packages/identity/Cargo.toml +2 -7
  42. package/packages/identity/src/lib.rs +25 -14
  43. package/packages/{public_key → identity_public_key}/Cargo.toml +2 -6
  44. package/packages/{public_key → identity_public_key}/src/lib.rs +74 -27
  45. package/packages/identity_transitions/Cargo.toml +3 -7
  46. package/packages/identity_transitions/src/create_transition/mod.rs +5 -3
  47. package/packages/identity_transitions/src/create_transition/public_key_in_creation/mod.rs +25 -21
  48. package/packages/mock_bls/Cargo.toml +2 -6
  49. package/packages/private_key/Cargo.toml +2 -5
  50. package/packages/private_key/src/lib.rs +44 -6
  51. package/packages/state_transition/Cargo.toml +4 -7
  52. package/packages/state_transition/src/lib.rs +106 -40
  53. package/packages/utils/Cargo.toml +1 -6
  54. package/packages/utils/src/lib.rs +17 -15
  55. package/scripts/build-js.sh +8 -6
  56. package/scripts/build.sh +22 -1
  57. package/src/lib.rs +8 -1
  58. package/tests/DataContract.spec.js +175 -0
  59. package/tests/DataContractCreateStateTransition.spec.js +109 -0
  60. package/tests/DataContractUpdateStateTransition.spec.js +109 -0
  61. package/tests/Document.spec.js +232 -0
  62. package/tests/DocumentBatchTransition.spec.js +109 -0
  63. package/tests/DocumentTransition.spec.js +97 -0
  64. package/tests/DocumentsTransitions.spec.js +705 -0
  65. package/tests/Identity.spec.js +113 -0
  66. package/tests/IdentityPublicKey.spec.js +132 -0
  67. package/tests/PrivateKey.spec.js +73 -0
  68. package/tests/mocks/DataContract/DataContract.json +153 -0
  69. package/tests/mocks/DataContract/index.js +6 -0
  70. package/tests/mocks/Document/DataContract.json +23 -0
  71. package/tests/mocks/Document/document.json +3 -0
  72. package/tests/mocks/Document/document2.json +3 -0
  73. package/tests/mocks/Document/index.js +11 -0
  74. package/tests/mocks/Identity/index.js +7 -0
  75. package/tests/mocks/PrivateKey/index.js +5 -0
  76. package/tests/mocks/PublicKey/index.js +14 -0
  77. package/tests/utils/hex.js +15 -0
  78. package/tests/utils/wasm.js +14 -0
  79. package/packages/document/src/methods/js.rs +0 -260
  80. package/packages/document/src/methods/rust.rs +0 -92
  81. package/packages/document_batch/src/generators.rs +0 -63
  82. package/packages/document_batch/src/lib.rs +0 -228
  83. /package/packages/{cbor-conversation → cbor_conversation}/src/lib.rs +0 -0
@@ -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
  */
@@ -310,40 +333,41 @@ export const SecurityLevel = Object.freeze({
310
333
  MEDIUM: 3, "3": "MEDIUM",
311
334
  });
312
335
 
313
- const DataContractWASMFinalization = (typeof FinalizationRegistry === 'undefined')
336
+ const DataContractCreateTransitionWASMFinalization = (typeof FinalizationRegistry === 'undefined')
314
337
  ? { register: () => {}, unregister: () => {} }
315
- : new FinalizationRegistry(ptr => wasm.__wbg_datacontractwasm_free(ptr >>> 0, 1));
338
+ : new FinalizationRegistry(ptr => wasm.__wbg_datacontractcreatetransitionwasm_free(ptr >>> 0, 1));
316
339
 
317
- export class DataContractWASM {
340
+ export class DataContractCreateTransitionWASM {
318
341
 
319
342
  static __wrap(ptr) {
320
343
  ptr = ptr >>> 0;
321
- const obj = Object.create(DataContractWASM.prototype);
344
+ const obj = Object.create(DataContractCreateTransitionWASM.prototype);
322
345
  obj.__wbg_ptr = ptr;
323
- DataContractWASMFinalization.register(obj, obj.__wbg_ptr, obj);
346
+ DataContractCreateTransitionWASMFinalization.register(obj, obj.__wbg_ptr, obj);
324
347
  return obj;
325
348
  }
326
349
 
327
350
  __destroy_into_raw() {
328
351
  const ptr = this.__wbg_ptr;
329
352
  this.__wbg_ptr = 0;
330
- DataContractWASMFinalization.unregister(this);
353
+ DataContractCreateTransitionWASMFinalization.unregister(this);
331
354
  return ptr;
332
355
  }
333
356
 
334
357
  free() {
335
358
  const ptr = this.__destroy_into_raw();
336
- wasm.__wbg_datacontractwasm_free(ptr, 0);
359
+ wasm.__wbg_datacontractcreatetransitionwasm_free(ptr, 0);
337
360
  }
338
361
  /**
339
- * @param {any} js_value
340
- * @param {boolean} full_validation
341
- * @param {PlatformVersionWASM} platform_version
362
+ * @param {DataContractWASM} data_contract
363
+ * @param {bigint} identity_nonce
364
+ * @param {any} js_platform_version
342
365
  */
343
- constructor(js_value, full_validation, 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
- wasm.datacontractwasm_new(retptr, addHeapObject(js_value), full_validation, platform_version);
369
+ _assertClass(data_contract, DataContractWASM);
370
+ wasm.datacontractcreatetransitionwasm_new(retptr, data_contract.__wbg_ptr, identity_nonce, addHeapObject(js_platform_version));
347
371
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
348
372
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
349
373
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -351,7 +375,7 @@ export class DataContractWASM {
351
375
  throw takeObject(r1);
352
376
  }
353
377
  this.__wbg_ptr = r0 >>> 0;
354
- DataContractWASMFinalization.register(this, this.__wbg_ptr, this);
378
+ DataContractCreateTransitionWASMFinalization.register(this, this.__wbg_ptr, this);
355
379
  return this;
356
380
  } finally {
357
381
  wasm.__wbindgen_add_to_stack_pointer(16);
@@ -359,35 +383,32 @@ export class DataContractWASM {
359
383
  }
360
384
  /**
361
385
  * @param {Uint8Array} bytes
362
- * @param {boolean} full_validation
363
- * @param {PlatformVersionWASM} platform_version
364
- * @returns {DataContractWASM}
386
+ * @returns {DataContractCreateTransitionWASM}
365
387
  */
366
- static fromBytes(bytes, full_validation, platform_version) {
388
+ static fromBytes(bytes) {
367
389
  try {
368
390
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
369
391
  const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export_1);
370
392
  const len0 = WASM_VECTOR_LEN;
371
- wasm.datacontractwasm_fromBytes(retptr, ptr0, len0, full_validation, platform_version);
393
+ wasm.datacontractcreatetransitionwasm_fromBytes(retptr, ptr0, len0);
372
394
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
373
395
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
374
396
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
375
397
  if (r2) {
376
398
  throw takeObject(r1);
377
399
  }
378
- return DataContractWASM.__wrap(r0);
400
+ return DataContractCreateTransitionWASM.__wrap(r0);
379
401
  } finally {
380
402
  wasm.__wbindgen_add_to_stack_pointer(16);
381
403
  }
382
404
  }
383
405
  /**
384
- * @param {PlatformVersionWASM} platform_version
385
406
  * @returns {Uint8Array}
386
407
  */
387
- toBytes(platform_version) {
408
+ toBytes() {
388
409
  try {
389
410
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
390
- wasm.datacontractwasm_toBytes(retptr, this.__wbg_ptr, platform_version);
411
+ wasm.datacontractcreatetransitionwasm_toBytes(retptr, this.__wbg_ptr);
391
412
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
392
413
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
393
414
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -403,116 +424,133 @@ export class DataContractWASM {
403
424
  }
404
425
  }
405
426
  /**
406
- * @param {PlatformVersionWASM} platform_version
407
- * @returns {any}
427
+ * @returns {number}
428
+ */
429
+ getFeatureVersion() {
430
+ const ret = wasm.datacontractcreatetransitionwasm_getFeatureVersion(this.__wbg_ptr);
431
+ return ret;
432
+ }
433
+ /**
434
+ * @param {number} protocol_version
435
+ * @returns {boolean}
408
436
  */
409
- toValue(platform_version) {
437
+ verifyProtocolVersion(protocol_version) {
410
438
  try {
411
439
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
412
- wasm.datacontractwasm_toValue(retptr, this.__wbg_ptr, platform_version);
440
+ wasm.datacontractcreatetransitionwasm_verifyProtocolVersion(retptr, this.__wbg_ptr, protocol_version);
413
441
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
414
442
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
415
443
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
416
444
  if (r2) {
417
445
  throw takeObject(r1);
418
446
  }
419
- return takeObject(r0);
447
+ return r0 !== 0;
420
448
  } finally {
421
449
  wasm.__wbindgen_add_to_stack_pointer(16);
422
450
  }
423
451
  }
424
452
  /**
425
- * @returns {any}
426
- */
427
- getSchema() {
428
- const ret = wasm.datacontractwasm_getSchema(this.__wbg_ptr);
429
- return takeObject(ret);
430
- }
431
- /**
432
- * @returns {number}
433
- */
434
- getDataContractVersion() {
435
- const ret = wasm.datacontractwasm_getDataContractVersion(this.__wbg_ptr);
436
- return ret >>> 0;
437
- }
438
- /**
439
- * @returns {any}
453
+ * @param {DataContractWASM} data_contract
454
+ * @param {any} js_platform_version
440
455
  */
441
- getDataContractIdentifier() {
442
- const ret = wasm.datacontractwasm_getDataContractIdentifier(this.__wbg_ptr);
443
- return takeObject(ret);
456
+ setDataContract(data_contract, js_platform_version) {
457
+ try {
458
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
459
+ _assertClass(data_contract, DataContractWASM);
460
+ wasm.datacontractcreatetransitionwasm_setDataContract(retptr, this.__wbg_ptr, data_contract.__wbg_ptr, addHeapObject(js_platform_version));
461
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
462
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
463
+ if (r1) {
464
+ throw takeObject(r0);
465
+ }
466
+ } finally {
467
+ wasm.__wbindgen_add_to_stack_pointer(16);
468
+ }
444
469
  }
445
470
  /**
446
- * @returns {any}
471
+ * @param {any} js_platform_version
472
+ * @param {boolean | null} [full_validation]
473
+ * @returns {DataContractWASM}
447
474
  */
448
- getOwnerId() {
449
- const ret = wasm.datacontractwasm_getOwnerId(this.__wbg_ptr);
450
- return takeObject(ret);
475
+ getDataContract(js_platform_version, full_validation) {
476
+ try {
477
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
478
+ wasm.datacontractcreatetransitionwasm_getDataContract(retptr, this.__wbg_ptr, addHeapObject(js_platform_version), isLikeNone(full_validation) ? 0xFFFFFF : full_validation ? 1 : 0);
479
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
480
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
481
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
482
+ if (r2) {
483
+ throw takeObject(r1);
484
+ }
485
+ return DataContractWASM.__wrap(r0);
486
+ } finally {
487
+ wasm.__wbindgen_add_to_stack_pointer(16);
488
+ }
451
489
  }
452
490
  /**
453
- * @returns {any}
491
+ * @returns {StateTransitionWASM}
454
492
  */
455
- getConfig() {
456
- const ret = wasm.datacontractwasm_getConfig(this.__wbg_ptr);
457
- return takeObject(ret);
493
+ toStateTransition() {
494
+ const ret = wasm.datacontractcreatetransitionwasm_toStateTransition(this.__wbg_ptr);
495
+ return StateTransitionWASM.__wrap(ret);
458
496
  }
459
497
  /**
460
- * @param {PlatformVersionWASM} platform_version
461
- * @returns {any}
498
+ * @param {StateTransitionWASM} state_transition
499
+ * @returns {DataContractCreateTransitionWASM}
462
500
  */
463
- toJson(platform_version) {
501
+ static fromStateTransition(state_transition) {
464
502
  try {
465
503
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
466
- wasm.datacontractwasm_toJson(retptr, this.__wbg_ptr, platform_version);
504
+ _assertClass(state_transition, StateTransitionWASM);
505
+ wasm.datacontractcreatetransitionwasm_fromStateTransition(retptr, state_transition.__wbg_ptr);
467
506
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
468
507
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
469
508
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
470
509
  if (r2) {
471
510
  throw takeObject(r1);
472
511
  }
473
- return takeObject(r0);
512
+ return DataContractCreateTransitionWASM.__wrap(r0);
474
513
  } finally {
475
514
  wasm.__wbindgen_add_to_stack_pointer(16);
476
515
  }
477
516
  }
478
517
  }
479
518
 
480
- const DocumentBatchWASMFinalization = (typeof FinalizationRegistry === 'undefined')
519
+ const DataContractUpdateTransitionWASMFinalization = (typeof FinalizationRegistry === 'undefined')
481
520
  ? { register: () => {}, unregister: () => {} }
482
- : new FinalizationRegistry(ptr => wasm.__wbg_documentbatchwasm_free(ptr >>> 0, 1));
521
+ : new FinalizationRegistry(ptr => wasm.__wbg_datacontractupdatetransitionwasm_free(ptr >>> 0, 1));
483
522
 
484
- export class DocumentBatchWASM {
523
+ export class DataContractUpdateTransitionWASM {
485
524
 
486
525
  static __wrap(ptr) {
487
526
  ptr = ptr >>> 0;
488
- const obj = Object.create(DocumentBatchWASM.prototype);
527
+ const obj = Object.create(DataContractUpdateTransitionWASM.prototype);
489
528
  obj.__wbg_ptr = ptr;
490
- DocumentBatchWASMFinalization.register(obj, obj.__wbg_ptr, obj);
529
+ DataContractUpdateTransitionWASMFinalization.register(obj, obj.__wbg_ptr, obj);
491
530
  return obj;
492
531
  }
493
532
 
494
533
  __destroy_into_raw() {
495
534
  const ptr = this.__wbg_ptr;
496
535
  this.__wbg_ptr = 0;
497
- DocumentBatchWASMFinalization.unregister(this);
536
+ DataContractUpdateTransitionWASMFinalization.unregister(this);
498
537
  return ptr;
499
538
  }
500
539
 
501
540
  free() {
502
541
  const ptr = this.__destroy_into_raw();
503
- wasm.__wbg_documentbatchwasm_free(ptr, 0);
542
+ wasm.__wbg_datacontractupdatetransitionwasm_free(ptr, 0);
504
543
  }
505
544
  /**
506
- * @param {BatchType} batch_type
507
- * @param {DocumentWASM} document
508
- * @param {bigint} identity_contract_nonce
545
+ * @param {DataContractWASM} data_contract
546
+ * @param {bigint} identity_nonce
547
+ * @param {any} js_platform_version
509
548
  */
510
- constructor(batch_type, document, identity_contract_nonce) {
549
+ constructor(data_contract, identity_nonce, js_platform_version) {
511
550
  try {
512
551
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
513
- _assertClass(document, DocumentWASM);
514
- var ptr0 = document.__destroy_into_raw();
515
- wasm.documentbatchwasm_new(retptr, batch_type, ptr0, identity_contract_nonce);
552
+ _assertClass(data_contract, DataContractWASM);
553
+ wasm.datacontractupdatetransitionwasm_new(retptr, data_contract.__wbg_ptr, identity_nonce, addHeapObject(js_platform_version));
516
554
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
517
555
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
518
556
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -520,200 +558,1831 @@ export class DocumentBatchWASM {
520
558
  throw takeObject(r1);
521
559
  }
522
560
  this.__wbg_ptr = r0 >>> 0;
523
- DocumentBatchWASMFinalization.register(this, this.__wbg_ptr, this);
561
+ DataContractUpdateTransitionWASMFinalization.register(this, this.__wbg_ptr, this);
524
562
  return this;
525
563
  } finally {
526
564
  wasm.__wbindgen_add_to_stack_pointer(16);
527
565
  }
528
566
  }
529
567
  /**
530
- * @returns {StateTransitionWASM}
568
+ * @param {Uint8Array} bytes
569
+ * @returns {DataContractUpdateTransitionWASM}
531
570
  */
532
- toStateTransition() {
533
- const ret = wasm.documentbatchwasm_toStateTransition(this.__wbg_ptr);
534
- return StateTransitionWASM.__wrap(ret);
571
+ static fromBytes(bytes) {
572
+ try {
573
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
574
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export_1);
575
+ const len0 = WASM_VECTOR_LEN;
576
+ wasm.datacontractupdatetransitionwasm_fromBytes(retptr, ptr0, len0);
577
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
578
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
579
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
580
+ if (r2) {
581
+ throw takeObject(r1);
582
+ }
583
+ return DataContractUpdateTransitionWASM.__wrap(r0);
584
+ } finally {
585
+ wasm.__wbindgen_add_to_stack_pointer(16);
586
+ }
535
587
  }
536
588
  /**
537
- * @returns {any}
589
+ * @returns {Uint8Array}
538
590
  */
539
591
  toBytes() {
540
592
  try {
541
593
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
542
- wasm.documentbatchwasm_toBytes(retptr, this.__wbg_ptr);
594
+ wasm.datacontractupdatetransitionwasm_toBytes(retptr, this.__wbg_ptr);
543
595
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
544
596
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
545
597
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
546
- if (r2) {
547
- throw takeObject(r1);
598
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
599
+ if (r3) {
600
+ throw takeObject(r2);
548
601
  }
549
- return takeObject(r0);
602
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
603
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
604
+ return v1;
550
605
  } finally {
551
606
  wasm.__wbindgen_add_to_stack_pointer(16);
552
607
  }
553
608
  }
554
609
  /**
555
- * @param {StateTransitionWASM} state_transition
556
- * @returns {DocumentBatchWASM}
610
+ * @returns {number}
557
611
  */
558
- static fromStateTransition(state_transition) {
612
+ getFeatureVersion() {
613
+ const ret = wasm.datacontractcreatetransitionwasm_getFeatureVersion(this.__wbg_ptr);
614
+ return ret;
615
+ }
616
+ /**
617
+ * @param {number} protocol_version
618
+ * @returns {boolean}
619
+ */
620
+ verifyProtocolVersion(protocol_version) {
559
621
  try {
560
622
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
561
- _assertClass(state_transition, StateTransitionWASM);
562
- var ptr0 = state_transition.__destroy_into_raw();
563
- wasm.documentbatchwasm_fromStateTransition(retptr, ptr0);
623
+ wasm.datacontractupdatetransitionwasm_verifyProtocolVersion(retptr, this.__wbg_ptr, protocol_version);
564
624
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
565
625
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
566
626
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
567
627
  if (r2) {
568
628
  throw takeObject(r1);
569
629
  }
570
- return DocumentBatchWASM.__wrap(r0);
630
+ return r0 !== 0;
571
631
  } finally {
572
632
  wasm.__wbindgen_add_to_stack_pointer(16);
573
633
  }
574
634
  }
575
635
  /**
576
- * @param {Uint8Array} bytes
577
- * @returns {DocumentBatchWASM}
636
+ * @param {DataContractWASM} data_contract
637
+ * @param {any} js_platform_version
578
638
  */
579
- static fromBytes(bytes) {
639
+ setDataContract(data_contract, js_platform_version) {
580
640
  try {
581
641
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
582
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export_1);
583
- const len0 = WASM_VECTOR_LEN;
584
- wasm.documentbatchwasm_fromBytes(retptr, ptr0, len0);
642
+ _assertClass(data_contract, DataContractWASM);
643
+ wasm.datacontractupdatetransitionwasm_setDataContract(retptr, this.__wbg_ptr, data_contract.__wbg_ptr, addHeapObject(js_platform_version));
644
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
645
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
646
+ if (r1) {
647
+ throw takeObject(r0);
648
+ }
649
+ } finally {
650
+ wasm.__wbindgen_add_to_stack_pointer(16);
651
+ }
652
+ }
653
+ /**
654
+ * @param {boolean | null | undefined} full_validation
655
+ * @param {any} js_platform_version
656
+ * @returns {DataContractWASM}
657
+ */
658
+ getDataContract(full_validation, js_platform_version) {
659
+ try {
660
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
661
+ wasm.datacontractupdatetransitionwasm_getDataContract(retptr, this.__wbg_ptr, isLikeNone(full_validation) ? 0xFFFFFF : full_validation ? 1 : 0, addHeapObject(js_platform_version));
585
662
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
586
663
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
587
664
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
588
665
  if (r2) {
589
666
  throw takeObject(r1);
590
667
  }
591
- return DocumentBatchWASM.__wrap(r0);
668
+ return DataContractWASM.__wrap(r0);
592
669
  } finally {
593
670
  wasm.__wbindgen_add_to_stack_pointer(16);
594
671
  }
595
672
  }
596
673
  /**
597
- * @returns {DocumentWASM}
674
+ * @returns {StateTransitionWASM}
598
675
  */
599
- getDocument() {
600
- const ret = wasm.documentbatchwasm_getDocument(this.__wbg_ptr);
601
- return DocumentWASM.__wrap(ret);
676
+ toStateTransition() {
677
+ const ret = wasm.datacontractupdatetransitionwasm_toStateTransition(this.__wbg_ptr);
678
+ return StateTransitionWASM.__wrap(ret);
602
679
  }
603
680
  /**
604
- * @returns {Uint8Array}
681
+ * @param {StateTransitionWASM} state_transition
682
+ * @returns {DataContractUpdateTransitionWASM}
605
683
  */
606
- getSignature() {
684
+ static fromStateTransition(state_transition) {
607
685
  try {
608
686
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
609
- wasm.documentbatchwasm_getSignature(retptr, this.__wbg_ptr);
687
+ _assertClass(state_transition, StateTransitionWASM);
688
+ wasm.datacontractupdatetransitionwasm_fromStateTransition(retptr, state_transition.__wbg_ptr);
610
689
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
611
690
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
612
- var v1 = getArrayU8FromWasm0(r0, r1).slice();
613
- wasm.__wbindgen_export_3(r0, r1 * 1, 1);
614
- return v1;
691
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
692
+ if (r2) {
693
+ throw takeObject(r1);
694
+ }
695
+ return DataContractUpdateTransitionWASM.__wrap(r0);
615
696
  } finally {
616
697
  wasm.__wbindgen_add_to_stack_pointer(16);
617
698
  }
618
699
  }
619
700
  }
620
701
 
621
- const DocumentWASMFinalization = (typeof FinalizationRegistry === 'undefined')
702
+ const DataContractWASMFinalization = (typeof FinalizationRegistry === 'undefined')
622
703
  ? { register: () => {}, unregister: () => {} }
623
- : new FinalizationRegistry(ptr => wasm.__wbg_documentwasm_free(ptr >>> 0, 1));
704
+ : new FinalizationRegistry(ptr => wasm.__wbg_datacontractwasm_free(ptr >>> 0, 1));
624
705
 
625
- export class DocumentWASM {
706
+ export class DataContractWASM {
626
707
 
627
708
  static __wrap(ptr) {
628
709
  ptr = ptr >>> 0;
629
- const obj = Object.create(DocumentWASM.prototype);
710
+ const obj = Object.create(DataContractWASM.prototype);
630
711
  obj.__wbg_ptr = ptr;
631
- DocumentWASMFinalization.register(obj, obj.__wbg_ptr, obj);
712
+ DataContractWASMFinalization.register(obj, obj.__wbg_ptr, obj);
632
713
  return obj;
633
714
  }
634
715
 
635
716
  __destroy_into_raw() {
636
717
  const ptr = this.__wbg_ptr;
637
718
  this.__wbg_ptr = 0;
638
- DocumentWASMFinalization.unregister(this);
719
+ DataContractWASMFinalization.unregister(this);
639
720
  return ptr;
640
721
  }
641
722
 
642
723
  free() {
643
724
  const ptr = this.__destroy_into_raw();
644
- wasm.__wbg_documentwasm_free(ptr, 0);
645
- }
646
- /**
647
- * @param {any} js_raw_document
648
- * @param {string} js_document_type_name
649
- * @param {bigint} js_revision
650
- * @param {string} js_data_contract_id
651
- * @param {string} js_owner_id
652
- */
653
- constructor(js_raw_document, js_document_type_name, js_revision, js_data_contract_id, js_owner_id) {
654
- const ptr0 = passStringToWasm0(js_document_type_name, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
655
- const len0 = WASM_VECTOR_LEN;
656
- const ptr1 = passStringToWasm0(js_data_contract_id, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
657
- const len1 = WASM_VECTOR_LEN;
658
- const ptr2 = passStringToWasm0(js_owner_id, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
659
- const len2 = WASM_VECTOR_LEN;
660
- const ret = wasm.documentwasm_js_new(addHeapObject(js_raw_document), ptr0, len0, js_revision, ptr1, len1, ptr2, len2);
661
- this.__wbg_ptr = ret >>> 0;
662
- DocumentWASMFinalization.register(this, this.__wbg_ptr, this);
663
- return this;
664
- }
665
- /**
666
- * @returns {any}
667
- */
668
- getId() {
669
- const ret = wasm.documentwasm_getId(this.__wbg_ptr);
670
- return takeObject(ret);
671
- }
672
- /**
673
- * @returns {any}
674
- */
675
- getEntropy() {
676
- const ret = wasm.documentwasm_getEntropy(this.__wbg_ptr);
677
- return takeObject(ret);
678
- }
679
- /**
680
- * @returns {any}
681
- */
682
- getOwnerId() {
683
- const ret = wasm.documentwasm_getOwnerId(this.__wbg_ptr);
684
- return takeObject(ret);
725
+ wasm.__wbg_datacontractwasm_free(ptr, 0);
685
726
  }
686
727
  /**
687
- * @returns {any}
728
+ * @param {any} js_owner_id
729
+ * @param {bigint} identity_nonce
730
+ * @param {any} js_schema
731
+ * @param {object | null | undefined} js_definitions
732
+ * @param {boolean} full_validation
733
+ * @param {any} js_platform_version
688
734
  */
689
- getProperties() {
735
+ constructor(js_owner_id, identity_nonce, js_schema, js_definitions, full_validation, js_platform_version) {
690
736
  try {
691
737
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
692
- wasm.documentwasm_getProperties(retptr, this.__wbg_ptr);
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));
693
739
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
694
740
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
695
741
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
696
742
  if (r2) {
697
743
  throw takeObject(r1);
698
744
  }
699
- return takeObject(r0);
745
+ this.__wbg_ptr = r0 >>> 0;
746
+ DataContractWASMFinalization.register(this, this.__wbg_ptr, this);
747
+ return this;
700
748
  } finally {
701
749
  wasm.__wbindgen_add_to_stack_pointer(16);
702
750
  }
703
751
  }
704
752
  /**
705
- * @returns {bigint | undefined}
753
+ * @param {any} js_value
754
+ * @param {boolean} full_validation
755
+ * @param {any} js_platform_version
756
+ * @returns {DataContractWASM}
706
757
  */
707
- getRevision() {
758
+ static fromValue(js_value, full_validation, js_platform_version) {
708
759
  try {
709
760
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
710
- wasm.documentwasm_getRevision(retptr, this.__wbg_ptr);
761
+ wasm.datacontractwasm_fromValue(retptr, addHeapObject(js_value), full_validation, addHeapObject(js_platform_version));
711
762
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
712
- var r2 = getDataViewMemory0().getBigInt64(retptr + 8 * 1, true);
713
- return r0 === 0 ? undefined : BigInt.asUintN(64, r2);
714
- } finally {
715
- wasm.__wbindgen_add_to_stack_pointer(16);
716
- }
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
+ }
773
+ /**
774
+ * @param {Uint8Array} bytes
775
+ * @param {boolean} full_validation
776
+ * @param {any} js_platform_version
777
+ * @returns {DataContractWASM}
778
+ */
779
+ static fromBytes(bytes, full_validation, js_platform_version) {
780
+ try {
781
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
782
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export_1);
783
+ const len0 = WASM_VECTOR_LEN;
784
+ wasm.datacontractwasm_fromBytes(retptr, ptr0, len0, full_validation, addHeapObject(js_platform_version));
785
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
786
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
787
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
788
+ if (r2) {
789
+ throw takeObject(r1);
790
+ }
791
+ return DataContractWASM.__wrap(r0);
792
+ } finally {
793
+ wasm.__wbindgen_add_to_stack_pointer(16);
794
+ }
795
+ }
796
+ /**
797
+ * @param {any} js_platform_version
798
+ * @returns {Uint8Array}
799
+ */
800
+ toBytes(js_platform_version) {
801
+ try {
802
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
803
+ wasm.datacontractwasm_toBytes(retptr, this.__wbg_ptr, addHeapObject(js_platform_version));
804
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
805
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
806
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
807
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
808
+ if (r3) {
809
+ throw takeObject(r2);
810
+ }
811
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
812
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
813
+ return v1;
814
+ } finally {
815
+ wasm.__wbindgen_add_to_stack_pointer(16);
816
+ }
817
+ }
818
+ /**
819
+ * @param {any} js_platform_version
820
+ * @returns {any}
821
+ */
822
+ toValue(js_platform_version) {
823
+ try {
824
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
825
+ wasm.datacontractwasm_toValue(retptr, this.__wbg_ptr, addHeapObject(js_platform_version));
826
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
827
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
828
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
829
+ if (r2) {
830
+ throw takeObject(r1);
831
+ }
832
+ return takeObject(r0);
833
+ } finally {
834
+ wasm.__wbindgen_add_to_stack_pointer(16);
835
+ }
836
+ }
837
+ /**
838
+ * @returns {any}
839
+ */
840
+ getSchema() {
841
+ try {
842
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
843
+ wasm.datacontractwasm_getSchema(retptr, this.__wbg_ptr);
844
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
845
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
846
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
847
+ if (r2) {
848
+ throw takeObject(r1);
849
+ }
850
+ return takeObject(r0);
851
+ } finally {
852
+ wasm.__wbindgen_add_to_stack_pointer(16);
853
+ }
854
+ }
855
+ /**
856
+ * @returns {number}
857
+ */
858
+ getVersion() {
859
+ const ret = wasm.datacontractwasm_getVersion(this.__wbg_ptr);
860
+ return ret >>> 0;
861
+ }
862
+ /**
863
+ * @returns {Uint8Array}
864
+ */
865
+ getId() {
866
+ try {
867
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
868
+ wasm.datacontractwasm_getId(retptr, this.__wbg_ptr);
869
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
870
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
871
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
872
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
873
+ return v1;
874
+ } finally {
875
+ wasm.__wbindgen_add_to_stack_pointer(16);
876
+ }
877
+ }
878
+ /**
879
+ * @returns {Uint8Array}
880
+ */
881
+ getOwnerId() {
882
+ try {
883
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
884
+ wasm.datacontractwasm_getOwnerId(retptr, this.__wbg_ptr);
885
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
886
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
887
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
888
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
889
+ return v1;
890
+ } finally {
891
+ wasm.__wbindgen_add_to_stack_pointer(16);
892
+ }
893
+ }
894
+ /**
895
+ * @returns {any}
896
+ */
897
+ getConfig() {
898
+ try {
899
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
900
+ wasm.datacontractwasm_getConfig(retptr, this.__wbg_ptr);
901
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
902
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
903
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
904
+ if (r2) {
905
+ throw takeObject(r1);
906
+ }
907
+ return takeObject(r0);
908
+ } finally {
909
+ wasm.__wbindgen_add_to_stack_pointer(16);
910
+ }
911
+ }
912
+ /**
913
+ * @param {any} js_data_contract_id
914
+ */
915
+ setId(js_data_contract_id) {
916
+ try {
917
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
918
+ wasm.datacontractwasm_setId(retptr, this.__wbg_ptr, addHeapObject(js_data_contract_id));
919
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
920
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
921
+ if (r1) {
922
+ throw takeObject(r0);
923
+ }
924
+ } finally {
925
+ wasm.__wbindgen_add_to_stack_pointer(16);
926
+ }
927
+ }
928
+ /**
929
+ * @param {any} js_owner_id
930
+ */
931
+ setOwnerId(js_owner_id) {
932
+ try {
933
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
934
+ wasm.datacontractwasm_setOwnerId(retptr, this.__wbg_ptr, addHeapObject(js_owner_id));
935
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
936
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
937
+ if (r1) {
938
+ throw takeObject(r0);
939
+ }
940
+ } finally {
941
+ wasm.__wbindgen_add_to_stack_pointer(16);
942
+ }
943
+ }
944
+ /**
945
+ * @param {number} version
946
+ */
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) {
955
+ try {
956
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
957
+ wasm.datacontractwasm_setConfig(retptr, this.__wbg_ptr, addHeapObject(js_config), addHeapObject(js_platform_version));
958
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
959
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
960
+ if (r1) {
961
+ throw takeObject(r0);
962
+ }
963
+ } finally {
964
+ wasm.__wbindgen_add_to_stack_pointer(16);
965
+ }
966
+ }
967
+ /**
968
+ * @param {any} js_schema
969
+ * @param {object | null | undefined} js_definitions
970
+ * @param {boolean} full_validation
971
+ * @param {any} js_platform_version
972
+ */
973
+ setSchema(js_schema, js_definitions, full_validation, js_platform_version) {
974
+ try {
975
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
976
+ wasm.datacontractwasm_setSchema(retptr, this.__wbg_ptr, addHeapObject(js_schema), isLikeNone(js_definitions) ? 0 : addHeapObject(js_definitions), full_validation, addHeapObject(js_platform_version));
977
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
978
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
979
+ if (r1) {
980
+ throw takeObject(r0);
981
+ }
982
+ } finally {
983
+ wasm.__wbindgen_add_to_stack_pointer(16);
984
+ }
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
+ }
1028
+ }
1029
+
1030
+ const DocumentBaseTransitionWASMFinalization = (typeof FinalizationRegistry === 'undefined')
1031
+ ? { register: () => {}, unregister: () => {} }
1032
+ : new FinalizationRegistry(ptr => wasm.__wbg_documentbasetransitionwasm_free(ptr >>> 0, 1));
1033
+
1034
+ export class DocumentBaseTransitionWASM {
1035
+
1036
+ static __wrap(ptr) {
1037
+ ptr = ptr >>> 0;
1038
+ const obj = Object.create(DocumentBaseTransitionWASM.prototype);
1039
+ obj.__wbg_ptr = ptr;
1040
+ DocumentBaseTransitionWASMFinalization.register(obj, obj.__wbg_ptr, obj);
1041
+ return obj;
1042
+ }
1043
+
1044
+ __destroy_into_raw() {
1045
+ const ptr = this.__wbg_ptr;
1046
+ this.__wbg_ptr = 0;
1047
+ DocumentBaseTransitionWASMFinalization.unregister(this);
1048
+ return ptr;
1049
+ }
1050
+
1051
+ free() {
1052
+ const ptr = this.__destroy_into_raw();
1053
+ wasm.__wbg_documentbasetransitionwasm_free(ptr, 0);
1054
+ }
1055
+ /**
1056
+ * @param {any} js_document_id
1057
+ * @param {bigint} identity_contract_nonce
1058
+ * @param {string} document_type_name
1059
+ * @param {any} js_data_contract_id
1060
+ */
1061
+ constructor(js_document_id, identity_contract_nonce, document_type_name, js_data_contract_id) {
1062
+ try {
1063
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
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));
1067
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1068
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1069
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1070
+ if (r2) {
1071
+ throw takeObject(r1);
1072
+ }
1073
+ this.__wbg_ptr = r0 >>> 0;
1074
+ DocumentBaseTransitionWASMFinalization.register(this, this.__wbg_ptr, this);
1075
+ return this;
1076
+ } finally {
1077
+ wasm.__wbindgen_add_to_stack_pointer(16);
1078
+ }
1079
+ }
1080
+ /**
1081
+ * @returns {Uint8Array}
1082
+ */
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
+ }
1095
+ }
1096
+ /**
1097
+ * @returns {bigint}
1098
+ */
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() {
1107
+ try {
1108
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1109
+ wasm.documentbasetransitionwasm_get_data_contract_id(retptr, this.__wbg_ptr);
1110
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1111
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1112
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
1113
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
1114
+ return v1;
1115
+ } finally {
1116
+ wasm.__wbindgen_add_to_stack_pointer(16);
1117
+ }
1118
+ }
1119
+ /**
1120
+ * @returns {string}
1121
+ */
1122
+ get documentTypeName() {
1123
+ let deferred1_0;
1124
+ let deferred1_1;
1125
+ try {
1126
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1127
+ wasm.documentbasetransitionwasm_get_document_type_name(retptr, this.__wbg_ptr);
1128
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1129
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1130
+ deferred1_0 = r0;
1131
+ deferred1_1 = r1;
1132
+ return getStringFromWasm0(r0, r1);
1133
+ } finally {
1134
+ wasm.__wbindgen_add_to_stack_pointer(16);
1135
+ wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
1136
+ }
1137
+ }
1138
+ /**
1139
+ * @param {any} js_id
1140
+ */
1141
+ set id(js_id) {
1142
+ try {
1143
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1144
+ wasm.documentbasetransitionwasm_set_id(retptr, this.__wbg_ptr, addHeapObject(js_id));
1145
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1146
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1147
+ if (r1) {
1148
+ throw takeObject(r0);
1149
+ }
1150
+ } finally {
1151
+ wasm.__wbindgen_add_to_stack_pointer(16);
1152
+ }
1153
+ }
1154
+ /**
1155
+ * @param {bigint} nonce
1156
+ */
1157
+ set identityContractNonce(nonce) {
1158
+ wasm.documentbasetransitionwasm_set_identity_contract_nonce(this.__wbg_ptr, nonce);
1159
+ }
1160
+ /**
1161
+ * @param {any} js_data_contract_id
1162
+ */
1163
+ set dataContractId(js_data_contract_id) {
1164
+ try {
1165
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1166
+ wasm.documentbasetransitionwasm_set_data_contract_id(retptr, this.__wbg_ptr, addHeapObject(js_data_contract_id));
1167
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1168
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1169
+ if (r1) {
1170
+ throw takeObject(r0);
1171
+ }
1172
+ } finally {
1173
+ wasm.__wbindgen_add_to_stack_pointer(16);
1174
+ }
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
+ }
1184
+ }
1185
+
1186
+ const DocumentCreateTransitionWASMFinalization = (typeof FinalizationRegistry === 'undefined')
1187
+ ? { register: () => {}, unregister: () => {} }
1188
+ : new FinalizationRegistry(ptr => wasm.__wbg_documentcreatetransitionwasm_free(ptr >>> 0, 1));
1189
+
1190
+ export class DocumentCreateTransitionWASM {
1191
+
1192
+ static __wrap(ptr) {
1193
+ ptr = ptr >>> 0;
1194
+ const obj = Object.create(DocumentCreateTransitionWASM.prototype);
1195
+ obj.__wbg_ptr = ptr;
1196
+ DocumentCreateTransitionWASMFinalization.register(obj, obj.__wbg_ptr, obj);
1197
+ return obj;
1198
+ }
1199
+
1200
+ __destroy_into_raw() {
1201
+ const ptr = this.__wbg_ptr;
1202
+ this.__wbg_ptr = 0;
1203
+ DocumentCreateTransitionWASMFinalization.unregister(this);
1204
+ return ptr;
1205
+ }
1206
+
1207
+ free() {
1208
+ const ptr = this.__destroy_into_raw();
1209
+ wasm.__wbg_documentcreatetransitionwasm_free(ptr, 0);
1210
+ }
1211
+ /**
1212
+ * @param {DocumentWASM} document
1213
+ * @param {bigint} identity_contract_nonce
1214
+ * @param {string} document_type_name
1215
+ */
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
+ }
1235
+ }
1236
+ /**
1237
+ * @returns {any}
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
+ */
2307
+ getEntropy() {
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
+ }
2322
+ }
2323
+ /**
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}
2341
+ */
2342
+ getOwnerId() {
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
+ }
2354
+ }
2355
+ /**
2356
+ * @returns {any}
2357
+ */
2358
+ getProperties() {
2359
+ try {
2360
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2361
+ wasm.documentwasm_getProperties(retptr, this.__wbg_ptr);
2362
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2363
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2364
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2365
+ if (r2) {
2366
+ throw takeObject(r1);
2367
+ }
2368
+ return takeObject(r0);
2369
+ } finally {
2370
+ wasm.__wbindgen_add_to_stack_pointer(16);
2371
+ }
2372
+ }
2373
+ /**
2374
+ * @returns {bigint | undefined}
2375
+ */
2376
+ getRevision() {
2377
+ try {
2378
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2379
+ wasm.documentwasm_getRevision(retptr, this.__wbg_ptr);
2380
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2381
+ var r2 = getDataViewMemory0().getBigInt64(retptr + 8 * 1, true);
2382
+ return r0 === 0 ? undefined : BigInt.asUintN(64, r2);
2383
+ } finally {
2384
+ wasm.__wbindgen_add_to_stack_pointer(16);
2385
+ }
717
2386
  }
718
2387
  /**
719
2388
  * @returns {bigint | undefined}
@@ -821,166 +2490,453 @@ export class DocumentWASM {
821
2490
  return ret === 0x100000001 ? undefined : ret;
822
2491
  }
823
2492
  /**
824
- * @returns {string}
2493
+ * @returns {string}
2494
+ */
2495
+ getDocumentTypeName() {
2496
+ let deferred1_0;
2497
+ let deferred1_1;
2498
+ try {
2499
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2500
+ wasm.documentwasm_getDocumentTypeName(retptr, this.__wbg_ptr);
2501
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2502
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2503
+ deferred1_0 = r0;
2504
+ deferred1_1 = r1;
2505
+ return getStringFromWasm0(r0, r1);
2506
+ } finally {
2507
+ wasm.__wbindgen_add_to_stack_pointer(16);
2508
+ wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
2509
+ }
2510
+ }
2511
+ /**
2512
+ * @param {any} id
2513
+ */
2514
+ setId(id) {
2515
+ wasm.documentwasm_setId(this.__wbg_ptr, addHeapObject(id));
2516
+ }
2517
+ /**
2518
+ * @param {any} entropy
2519
+ */
2520
+ setEntropy(entropy) {
2521
+ wasm.documentwasm_setEntropy(this.__wbg_ptr, addHeapObject(entropy));
2522
+ }
2523
+ /**
2524
+ * @param {any} id
2525
+ */
2526
+ setOwnerId(id) {
2527
+ wasm.documentwasm_setOwnerId(this.__wbg_ptr, addHeapObject(id));
2528
+ }
2529
+ /**
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}
825
2757
  */
826
- getDocumentTypeName() {
827
- let deferred1_0;
828
- let deferred1_1;
2758
+ get signature() {
829
2759
  try {
830
2760
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
831
- wasm.documentwasm_getDocumentTypeName(retptr, this.__wbg_ptr);
2761
+ wasm.documentsbatchwasm_get_signature(retptr, this.__wbg_ptr);
832
2762
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
833
2763
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
834
- deferred1_0 = r0;
835
- deferred1_1 = r1;
836
- return getStringFromWasm0(r0, r1);
2764
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
2765
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
2766
+ return v1;
837
2767
  } finally {
838
2768
  wasm.__wbindgen_add_to_stack_pointer(16);
839
- wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
840
2769
  }
841
2770
  }
842
2771
  /**
843
- * @param {any} id
844
- */
845
- setId(id) {
846
- wasm.documentwasm_setId(this.__wbg_ptr, addHeapObject(id));
847
- }
848
- /**
849
- * @param {any} entropy
850
- */
851
- setEntropy(entropy) {
852
- wasm.documentwasm_setEntropy(this.__wbg_ptr, addHeapObject(entropy));
853
- }
854
- /**
855
- * @param {any} id
856
- */
857
- setOwnerId(id) {
858
- wasm.documentwasm_setOwnerId(this.__wbg_ptr, addHeapObject(id));
859
- }
860
- /**
861
- * @param {any} properties
862
- */
863
- setProperties(properties) {
864
- wasm.documentwasm_setProperties(this.__wbg_ptr, addHeapObject(properties));
865
- }
866
- /**
867
- * @param {bigint | null} [revision]
2772
+ * @returns {number}
868
2773
  */
869
- setRevision(revision) {
870
- 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;
871
2777
  }
872
2778
  /**
873
- * @param {bigint | null} [created_at]
2779
+ * @returns {bigint | undefined}
874
2780
  */
875
- setCreatedAt(created_at) {
876
- 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
+ }
877
2796
  }
878
2797
  /**
879
- * @param {bigint | null} [updated_at]
2798
+ * @returns {Uint8Array}
880
2799
  */
881
- setUpdatedAt(updated_at) {
882
- 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
+ }
883
2812
  }
884
2813
  /**
885
- * @param {bigint | null} [transferred_at]
2814
+ * @returns {any}
886
2815
  */
887
- setTransferredAt(transferred_at) {
888
- 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
+ }
889
2830
  }
890
2831
  /**
891
- * @param {bigint | null} [created_at_block_height]
2832
+ * @returns {bigint | undefined}
892
2833
  */
893
- setCreatedAtBlockHeight(created_at_block_height) {
894
- 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
+ }
895
2849
  }
896
2850
  /**
897
- * @param {bigint | null} [updated_at_block_height]
2851
+ * @param {DocumentTransitionWASM[]} transitions
898
2852
  */
899
- setUpdatedAtBlockHeight(updated_at_block_height) {
900
- 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);
901
2857
  }
902
2858
  /**
903
- * @param {bigint | null} [transferred_at_block_height]
2859
+ * @param {Uint8Array} js_signature
904
2860
  */
905
- setTransferredAtBlockHeight(transferred_at_block_height) {
906
- 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);
907
2865
  }
908
2866
  /**
909
- * @param {number | null} [created_at_core_block_height]
2867
+ * @param {number} key_id
910
2868
  */
911
- setCreatedAtCoreBlockHeight(created_at_core_block_height) {
912
- 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);
913
2871
  }
914
2872
  /**
915
- * @param {number | null} [updated_at_core_block_height]
2873
+ * @param {bigint} nonce
916
2874
  */
917
- setUpdatedAtCoreBlockHeight(updated_at_core_block_height) {
918
- 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);
919
2877
  }
920
2878
  /**
921
- * @param {number | null} [transferred_at_core_block_height]
2879
+ * @returns {StateTransitionWASM}
922
2880
  */
923
- setTransferredAtCoreBlockHeight(transferred_at_core_block_height) {
924
- 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);
925
2884
  }
926
2885
  /**
927
- * @param {string} document_type_name
2886
+ * @param {StateTransitionWASM} state_transition
2887
+ * @returns {DocumentsBatchWASM}
928
2888
  */
929
- setDocumentTypeName(document_type_name) {
930
- const ptr0 = passStringToWasm0(document_type_name, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
931
- const len0 = WASM_VECTOR_LEN;
932
- 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
+ }
933
2904
  }
934
2905
  /**
935
- * @param {DataContractWASM} data_contract
936
- * @param {string} type_name
937
- * @param {PlatformVersionWASM} platform_version
938
- * @returns {Uint8Array}
2906
+ * @returns {any}
939
2907
  */
940
- toBytes(data_contract, type_name, platform_version) {
2908
+ toBytes() {
941
2909
  try {
942
2910
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
943
- _assertClass(data_contract, DataContractWASM);
944
- const ptr0 = passStringToWasm0(type_name, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
945
- const len0 = WASM_VECTOR_LEN;
946
- wasm.documentwasm_toBytes(retptr, this.__wbg_ptr, data_contract.__wbg_ptr, ptr0, len0, platform_version);
2911
+ wasm.documentsbatchwasm_toBytes(retptr, this.__wbg_ptr);
947
2912
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
948
2913
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
949
2914
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
950
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
951
- if (r3) {
952
- throw takeObject(r2);
2915
+ if (r2) {
2916
+ throw takeObject(r1);
953
2917
  }
954
- var v2 = getArrayU8FromWasm0(r0, r1).slice();
955
- wasm.__wbindgen_export_3(r0, r1 * 1, 1);
956
- return v2;
2918
+ return takeObject(r0);
957
2919
  } finally {
958
2920
  wasm.__wbindgen_add_to_stack_pointer(16);
959
2921
  }
960
2922
  }
961
2923
  /**
962
2924
  * @param {Uint8Array} bytes
963
- * @param {DataContractWASM} data_contract
964
- * @param {string} type_name
965
- * @param {PlatformVersionWASM} platform_version
966
- * @returns {DocumentWASM}
2925
+ * @returns {DocumentsBatchWASM}
967
2926
  */
968
- static fromBytes(bytes, data_contract, type_name, platform_version) {
2927
+ static fromBytes(bytes) {
969
2928
  try {
970
2929
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
971
2930
  const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export_1);
972
2931
  const len0 = WASM_VECTOR_LEN;
973
- _assertClass(data_contract, DataContractWASM);
974
- const ptr1 = passStringToWasm0(type_name, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
975
- const len1 = WASM_VECTOR_LEN;
976
- wasm.documentwasm_fromBytes(retptr, ptr0, len0, data_contract.__wbg_ptr, ptr1, len1, platform_version);
2932
+ wasm.documentsbatchwasm_fromBytes(retptr, ptr0, len0);
977
2933
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
978
2934
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
979
2935
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
980
2936
  if (r2) {
981
2937
  throw takeObject(r1);
982
2938
  }
983
- return DocumentWASM.__wrap(r0);
2939
+ return DocumentsBatchWASM.__wrap(r0);
984
2940
  } finally {
985
2941
  wasm.__wbindgen_add_to_stack_pointer(16);
986
2942
  }
@@ -1107,8 +3063,7 @@ export class IdentityCreateTransitionWASM {
1107
3063
  try {
1108
3064
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1109
3065
  _assertClass(st, StateTransitionWASM);
1110
- var ptr0 = st.__destroy_into_raw();
1111
- wasm.identitycreatetransitionwasm_fromStateTransition(retptr, ptr0);
3066
+ wasm.identitycreatetransitionwasm_fromStateTransition(retptr, st.__wbg_ptr);
1112
3067
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1113
3068
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1114
3069
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -1174,13 +3129,13 @@ export class IdentityPublicKeyInCreationWASM {
1174
3129
  * @param {SecurityLevel} security_level
1175
3130
  * @param {KeyType} key_type
1176
3131
  * @param {boolean} read_only
1177
- * @param {string} binary_data
1178
- * @param {string} signature
3132
+ * @param {Uint8Array} binary_data
3133
+ * @param {Uint8Array} signature
1179
3134
  */
1180
3135
  constructor(id, purpose, security_level, key_type, read_only, binary_data, signature) {
1181
- const ptr0 = passStringToWasm0(binary_data, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
3136
+ const ptr0 = passArray8ToWasm0(binary_data, wasm.__wbindgen_export_1);
1182
3137
  const len0 = WASM_VECTOR_LEN;
1183
- const ptr1 = passStringToWasm0(signature, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
3138
+ const ptr1 = passArray8ToWasm0(signature, wasm.__wbindgen_export_1);
1184
3139
  const len1 = WASM_VECTOR_LEN;
1185
3140
  const ret = wasm.identitypublickeyincreationwasm_new(id, purpose, security_level, key_type, read_only, ptr0, len0, ptr1, len1);
1186
3141
  this.__wbg_ptr = ret >>> 0;
@@ -1191,8 +3146,19 @@ export class IdentityPublicKeyInCreationWASM {
1191
3146
  * @returns {IdentityPublicKeyWASM}
1192
3147
  */
1193
3148
  toIdentityPublicKey() {
1194
- const ret = wasm.identitypublickeyincreationwasm_toIdentityPublicKey(this.__wbg_ptr);
1195
- 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
+ }
1196
3162
  }
1197
3163
  /**
1198
3164
  * @returns {number}
@@ -1202,25 +3168,61 @@ export class IdentityPublicKeyInCreationWASM {
1202
3168
  return ret >>> 0;
1203
3169
  }
1204
3170
  /**
1205
- * @returns {Purpose}
3171
+ * @returns {string}
1206
3172
  */
1207
3173
  getPurpose() {
1208
- const ret = wasm.identitypublickeyincreationwasm_getPurpose(this.__wbg_ptr);
1209
- 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
+ }
1210
3188
  }
1211
3189
  /**
1212
- * @returns {SecurityLevel}
3190
+ * @returns {string}
1213
3191
  */
1214
3192
  getSecurityLevel() {
1215
- const ret = wasm.identitypublickeyincreationwasm_getSecurityLevel(this.__wbg_ptr);
1216
- 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
+ }
1217
3207
  }
1218
3208
  /**
1219
- * @returns {KeyType}
3209
+ * @returns {string}
1220
3210
  */
1221
3211
  getKeyType() {
1222
- const ret = wasm.identitypublickeyincreationwasm_getKeyType(this.__wbg_ptr);
1223
- 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
+ }
1224
3226
  }
1225
3227
  /**
1226
3228
  * @returns {boolean}
@@ -1255,16 +3257,36 @@ export class IdentityPublicKeyInCreationWASM {
1255
3257
  wasm.identitypublickeyincreationwasm_setKeyId(this.__wbg_ptr, key_id);
1256
3258
  }
1257
3259
  /**
1258
- * @param {Purpose} purpose
3260
+ * @param {any} js_purpose
1259
3261
  */
1260
- setPurpose(purpose) {
1261
- 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
+ }
1262
3274
  }
1263
3275
  /**
1264
- * @param {SecurityLevel} security_level
3276
+ * @param {any} js_security_level
1265
3277
  */
1266
- setSecurityLevel(security_level) {
1267
- 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
+ }
1268
3290
  }
1269
3291
  /**
1270
3292
  * @param {boolean} read_only
@@ -1273,10 +3295,10 @@ export class IdentityPublicKeyInCreationWASM {
1273
3295
  wasm.identitypublickeyincreationwasm_setReadOnly(this.__wbg_ptr, read_only);
1274
3296
  }
1275
3297
  /**
1276
- * @param {string} binary_data
3298
+ * @param {Uint8Array} binary_data
1277
3299
  */
1278
3300
  setData(binary_data) {
1279
- const ptr0 = passStringToWasm0(binary_data, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
3301
+ const ptr0 = passArray8ToWasm0(binary_data, wasm.__wbindgen_export_1);
1280
3302
  const len0 = WASM_VECTOR_LEN;
1281
3303
  wasm.identitypublickeyincreationwasm_setData(this.__wbg_ptr, ptr0, len0);
1282
3304
  }
@@ -1309,20 +3331,53 @@ export class IdentityPublicKeyWASM {
1309
3331
  }
1310
3332
  /**
1311
3333
  * @param {number} id
1312
- * @param {Purpose} purpose
1313
- * @param {SecurityLevel} security_level
1314
- * @param {KeyType} key_type
3334
+ * @param {any} js_purpose
3335
+ * @param {any} js_security_level
3336
+ * @param {any} js_key_type
1315
3337
  * @param {boolean} read_only
1316
3338
  * @param {string} binary_data
1317
3339
  * @param {bigint | null} [disabled_at]
1318
3340
  */
1319
- constructor(id, purpose, security_level, key_type, read_only, binary_data, disabled_at) {
1320
- const ptr0 = passStringToWasm0(binary_data, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
1321
- const len0 = WASM_VECTOR_LEN;
1322
- 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);
1323
- this.__wbg_ptr = ret >>> 0;
1324
- IdentityPublicKeyWASMFinalization.register(this, this.__wbg_ptr, this);
1325
- 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
+ }
1326
3381
  }
1327
3382
  /**
1328
3383
  * @returns {number}
@@ -1332,25 +3387,61 @@ export class IdentityPublicKeyWASM {
1332
3387
  return ret >>> 0;
1333
3388
  }
1334
3389
  /**
1335
- * @returns {Purpose}
3390
+ * @returns {string}
1336
3391
  */
1337
3392
  getPurpose() {
1338
- const ret = wasm.identitypublickeywasm_getPurpose(this.__wbg_ptr);
1339
- 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
+ }
1340
3407
  }
1341
3408
  /**
1342
- * @returns {SecurityLevel}
3409
+ * @returns {string}
1343
3410
  */
1344
3411
  getSecurityLevel() {
1345
- const ret = wasm.identitypublickeywasm_getSecurityLevel(this.__wbg_ptr);
1346
- 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
+ }
1347
3426
  }
1348
3427
  /**
1349
- * @returns {KeyType}
3428
+ * @returns {string}
1350
3429
  */
1351
3430
  getKeyType() {
1352
- const ret = wasm.identitypublickeywasm_getKeyType(this.__wbg_ptr);
1353
- 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
+ }
1354
3445
  }
1355
3446
  /**
1356
3447
  * @returns {boolean}
@@ -1399,22 +3490,52 @@ export class IdentityPublicKeyWASM {
1399
3490
  wasm.identitypublickeywasm_setKeyId(this.__wbg_ptr, key_id);
1400
3491
  }
1401
3492
  /**
1402
- * @param {Purpose} purpose
3493
+ * @param {any} purpose
1403
3494
  */
1404
3495
  setPurpose(purpose) {
1405
- 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
+ }
1406
3507
  }
1407
3508
  /**
1408
- * @param {SecurityLevel} security_level
3509
+ * @param {any} security_level
1409
3510
  */
1410
3511
  setSecurityLevel(security_level) {
1411
- 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
+ }
1412
3523
  }
1413
3524
  /**
1414
- * @param {KeyType} key_type
3525
+ * @param {any} key_type
1415
3526
  */
1416
3527
  setKeyType(key_type) {
1417
- 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
+ }
1418
3539
  }
1419
3540
  /**
1420
3541
  * @param {boolean} read_only
@@ -1436,6 +3557,33 @@ export class IdentityPublicKeyWASM {
1436
3557
  setDisabledAt(disabled_at) {
1437
3558
  wasm.identitypublickeywasm_setDisabledAt(this.__wbg_ptr, disabled_at);
1438
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
+ }
1439
3587
  /**
1440
3588
  * @returns {Uint8Array}
1441
3589
  */
@@ -1528,12 +3676,20 @@ export class IdentityWASM {
1528
3676
  }
1529
3677
  }
1530
3678
  /**
1531
- * @param {string} js_identifier
3679
+ * @param {any} js_identifier
1532
3680
  */
1533
3681
  setId(js_identifier) {
1534
- const ptr0 = passStringToWasm0(js_identifier, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
1535
- const len0 = WASM_VECTOR_LEN;
1536
- 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
+ }
1537
3693
  }
1538
3694
  /**
1539
3695
  * @param {bigint} balance
@@ -1552,26 +3708,22 @@ export class IdentityWASM {
1552
3708
  */
1553
3709
  addPublicKey(public_key) {
1554
3710
  _assertClass(public_key, IdentityPublicKeyWASM);
1555
- var ptr0 = public_key.__destroy_into_raw();
1556
- wasm.identitywasm_addPublicKey(this.__wbg_ptr, ptr0);
3711
+ wasm.identitywasm_addPublicKey(this.__wbg_ptr, public_key.__wbg_ptr);
1557
3712
  }
1558
3713
  /**
1559
- * @returns {string}
3714
+ * @returns {Uint8Array}
1560
3715
  */
1561
3716
  getId() {
1562
- let deferred1_0;
1563
- let deferred1_1;
1564
3717
  try {
1565
3718
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1566
3719
  wasm.identitywasm_getId(retptr, this.__wbg_ptr);
1567
3720
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1568
3721
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1569
- deferred1_0 = r0;
1570
- deferred1_1 = r1;
1571
- return getStringFromWasm0(r0, r1);
3722
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
3723
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
3724
+ return v1;
1572
3725
  } finally {
1573
3726
  wasm.__wbindgen_add_to_stack_pointer(16);
1574
- wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
1575
3727
  }
1576
3728
  }
1577
3729
  /**
@@ -1597,11 +3749,20 @@ export class IdentityWASM {
1597
3749
  return IdentityPublicKeyWASM.__wrap(ret);
1598
3750
  }
1599
3751
  /**
1600
- * @returns {any}
3752
+ * @returns {IdentityPublicKeyWASM[]}
1601
3753
  */
1602
3754
  getPublicKeys() {
1603
- const ret = wasm.identitywasm_getPublicKeys(this.__wbg_ptr);
1604
- 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
+ }
1605
3766
  }
1606
3767
  /**
1607
3768
  * @returns {Uint8Array}
@@ -1613,75 +3774,191 @@ export class IdentityWASM {
1613
3774
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1614
3775
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1615
3776
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1616
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1617
- if (r3) {
1618
- 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);
1619
3916
  }
1620
- var v1 = getArrayU8FromWasm0(r0, r1).slice();
1621
- wasm.__wbindgen_export_3(r0, r1 * 1, 1);
1622
- return v1;
3917
+ return PrivateKeyWASM.__wrap(r0);
1623
3918
  } finally {
1624
3919
  wasm.__wbindgen_add_to_stack_pointer(16);
1625
3920
  }
1626
3921
  }
1627
3922
  /**
1628
3923
  * @param {Uint8Array} bytes
1629
- * @returns {IdentityWASM}
3924
+ * @param {any} js_network
3925
+ * @returns {PrivateKeyWASM}
1630
3926
  */
1631
- static fromBytes(bytes) {
3927
+ static fromBytes(bytes, js_network) {
1632
3928
  try {
1633
3929
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1634
3930
  const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export_1);
1635
3931
  const len0 = WASM_VECTOR_LEN;
1636
- wasm.identitywasm_fromBytes(retptr, ptr0, len0);
3932
+ wasm.privatekeywasm_fromBytes(retptr, ptr0, len0, addHeapObject(js_network));
1637
3933
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1638
3934
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1639
3935
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1640
3936
  if (r2) {
1641
3937
  throw takeObject(r1);
1642
3938
  }
1643
- return IdentityWASM.__wrap(r0);
3939
+ return PrivateKeyWASM.__wrap(r0);
1644
3940
  } finally {
1645
3941
  wasm.__wbindgen_add_to_stack_pointer(16);
1646
3942
  }
1647
3943
  }
1648
- }
1649
-
1650
- const PrivateKeyWASMFinalization = (typeof FinalizationRegistry === 'undefined')
1651
- ? { register: () => {}, unregister: () => {} }
1652
- : new FinalizationRegistry(ptr => wasm.__wbg_privatekeywasm_free(ptr >>> 0, 1));
1653
-
1654
- export class PrivateKeyWASM {
1655
-
1656
- __destroy_into_raw() {
1657
- const ptr = this.__wbg_ptr;
1658
- this.__wbg_ptr = 0;
1659
- PrivateKeyWASMFinalization.unregister(this);
1660
- return ptr;
1661
- }
1662
-
1663
- free() {
1664
- const ptr = this.__destroy_into_raw();
1665
- wasm.__wbg_privatekeywasm_free(ptr, 0);
1666
- }
1667
3944
  /**
1668
- * @param {string} wif
3945
+ * @param {string} hex_key
3946
+ * @param {any} js_network
3947
+ * @returns {PrivateKeyWASM}
1669
3948
  */
1670
- constructor(wif) {
3949
+ static fromHex(hex_key, js_network) {
1671
3950
  try {
1672
3951
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1673
- 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);
1674
3953
  const len0 = WASM_VECTOR_LEN;
1675
- wasm.privatekeywasm_new(retptr, ptr0, len0);
3954
+ wasm.privatekeywasm_fromHex(retptr, ptr0, len0, addHeapObject(js_network));
1676
3955
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1677
3956
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1678
3957
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1679
3958
  if (r2) {
1680
3959
  throw takeObject(r1);
1681
3960
  }
1682
- this.__wbg_ptr = r0 >>> 0;
1683
- PrivateKeyWASMFinalization.register(this, this.__wbg_ptr, this);
1684
- return this;
3961
+ return PrivateKeyWASM.__wrap(r0);
1685
3962
  } finally {
1686
3963
  wasm.__wbindgen_add_to_stack_pointer(16);
1687
3964
  }
@@ -1689,12 +3966,12 @@ export class PrivateKeyWASM {
1689
3966
  /**
1690
3967
  * @returns {string}
1691
3968
  */
1692
- getKeyWIF() {
3969
+ getWIF() {
1693
3970
  let deferred1_0;
1694
3971
  let deferred1_1;
1695
3972
  try {
1696
3973
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1697
- wasm.privatekeywasm_getKeyWIF(retptr, this.__wbg_ptr);
3974
+ wasm.privatekeywasm_getWIF(retptr, this.__wbg_ptr);
1698
3975
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1699
3976
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1700
3977
  deferred1_0 = r0;
@@ -1708,10 +3985,10 @@ export class PrivateKeyWASM {
1708
3985
  /**
1709
3986
  * @returns {Uint8Array}
1710
3987
  */
1711
- getKeyBytes() {
3988
+ getBytes() {
1712
3989
  try {
1713
3990
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1714
- wasm.privatekeywasm_getKeyBytes(retptr, this.__wbg_ptr);
3991
+ wasm.privatekeywasm_getBytes(retptr, this.__wbg_ptr);
1715
3992
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1716
3993
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1717
3994
  var v1 = getArrayU8FromWasm0(r0, r1).slice();
@@ -1721,6 +3998,44 @@ export class PrivateKeyWASM {
1721
3998
  wasm.__wbindgen_add_to_stack_pointer(16);
1722
3999
  }
1723
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
+ }
1724
4039
  }
1725
4040
 
1726
4041
  const StateTransitionWASMFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -1751,37 +4066,51 @@ export class StateTransitionWASM {
1751
4066
  /**
1752
4067
  * @param {PrivateKeyWASM} private_key
1753
4068
  * @param {IdentityPublicKeyWASM} public_key
1754
- * @returns {any}
4069
+ * @returns {Uint8Array}
1755
4070
  */
1756
4071
  sign(private_key, public_key) {
1757
4072
  try {
1758
4073
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1759
4074
  _assertClass(private_key, PrivateKeyWASM);
1760
- var ptr0 = private_key.__destroy_into_raw();
1761
4075
  _assertClass(public_key, IdentityPublicKeyWASM);
1762
- var ptr1 = public_key.__destroy_into_raw();
1763
- wasm.statetransitionwasm_sign(retptr, this.__wbg_ptr, ptr0, ptr1);
4076
+ wasm.statetransitionwasm_sign(retptr, this.__wbg_ptr, private_key.__wbg_ptr, public_key.__wbg_ptr);
1764
4077
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1765
4078
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1766
4079
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1767
- if (r2) {
1768
- throw takeObject(r1);
4080
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
4081
+ if (r3) {
4082
+ throw takeObject(r2);
1769
4083
  }
1770
- return takeObject(r0);
4084
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
4085
+ wasm.__wbindgen_export_3(r0, r1 * 1, 1);
4086
+ return v1;
1771
4087
  } finally {
1772
4088
  wasm.__wbindgen_add_to_stack_pointer(16);
1773
4089
  }
1774
4090
  }
1775
4091
  /**
1776
4092
  * @param {PrivateKeyWASM} private_key
1777
- * @param {KeyType} key_type
1778
- * @returns {any}
4093
+ * @param {any} js_key_type
4094
+ * @returns {Uint8Array}
1779
4095
  */
1780
- signByPrivateKey(private_key, key_type) {
1781
- _assertClass(private_key, PrivateKeyWASM);
1782
- var ptr0 = private_key.__destroy_into_raw();
1783
- const ret = wasm.statetransitionwasm_signByPrivateKey(this.__wbg_ptr, ptr0, key_type);
1784
- 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
+ }
1785
4114
  }
1786
4115
  /**
1787
4116
  * @returns {any}
@@ -1822,6 +4151,138 @@ export class StateTransitionWASM {
1822
4151
  wasm.__wbindgen_add_to_stack_pointer(16);
1823
4152
  }
1824
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
+ }
1825
4286
  }
1826
4287
 
1827
4288
  async function __wbg_load(module, imports) {
@@ -1870,25 +4331,105 @@ function __wbg_get_imports() {
1870
4331
  const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
1871
4332
  return addHeapObject(ret);
1872
4333
  }, arguments) };
4334
+ imports.wbg.__wbg_constructor_9fd96f589d65d4e5 = function(arg0) {
4335
+ const ret = getObject(arg0).constructor;
4336
+ return addHeapObject(ret);
4337
+ };
1873
4338
  imports.wbg.__wbg_crypto_ed58b8e10a292839 = function(arg0) {
1874
4339
  const ret = getObject(arg0).crypto;
1875
4340
  return addHeapObject(ret);
1876
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
+ };
1877
4358
  imports.wbg.__wbg_from_2a5d3e218e67aa85 = function(arg0) {
1878
4359
  const ret = Array.from(getObject(arg0));
1879
4360
  return addHeapObject(ret);
1880
4361
  };
4362
+ imports.wbg.__wbg_getPrototypeOf_64af13611bceb86e = function(arg0) {
4363
+ const ret = Object.getPrototypeOf(getObject(arg0));
4364
+ return addHeapObject(ret);
4365
+ };
1881
4366
  imports.wbg.__wbg_getRandomValues_bcb4912f16000dc4 = function() { return handleError(function (arg0, arg1) {
1882
4367
  getObject(arg0).getRandomValues(getObject(arg1));
1883
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
+ };
1884
4377
  imports.wbg.__wbg_identitypublickeyincreationwasm_new = function(arg0) {
1885
4378
  const ret = IdentityPublicKeyInCreationWASM.__wrap(arg0);
1886
4379
  return addHeapObject(ret);
1887
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
+ };
1888
4425
  imports.wbg.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
1889
4426
  const ret = getObject(arg0).msCrypto;
1890
4427
  return addHeapObject(ret);
1891
4428
  };
4429
+ imports.wbg.__wbg_name_16617c8e9d4188ac = function(arg0) {
4430
+ const ret = getObject(arg0).name;
4431
+ return addHeapObject(ret);
4432
+ };
1892
4433
  imports.wbg.__wbg_new_405e22f390576ce2 = function() {
1893
4434
  const ret = new Object();
1894
4435
  return addHeapObject(ret);
@@ -1921,6 +4462,14 @@ function __wbg_get_imports() {
1921
4462
  const ret = new Uint8Array(arg0 >>> 0);
1922
4463
  return addHeapObject(ret);
1923
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) };
1924
4473
  imports.wbg.__wbg_node_02999533c4ea02e3 = function(arg0) {
1925
4474
  const ret = getObject(arg0).node;
1926
4475
  return addHeapObject(ret);
@@ -1973,6 +4522,10 @@ function __wbg_get_imports() {
1973
4522
  const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
1974
4523
  return addHeapObject(ret);
1975
4524
  };
4525
+ imports.wbg.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
4526
+ const ret = getObject(arg0).value;
4527
+ return addHeapObject(ret);
4528
+ };
1976
4529
  imports.wbg.__wbg_versions_c71aa1626a93e0a1 = function(arg0) {
1977
4530
  const ret = getObject(arg0).versions;
1978
4531
  return addHeapObject(ret);
@@ -1993,6 +4546,17 @@ function __wbg_get_imports() {
1993
4546
  const ret = BigInt.asUintN(64, arg0);
1994
4547
  return addHeapObject(ret);
1995
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
+ };
1996
4560
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
1997
4561
  const ret = debugString(getObject(arg1));
1998
4562
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
@@ -2004,6 +4568,18 @@ function __wbg_get_imports() {
2004
4568
  const ret = new Error(getStringFromWasm0(arg0, arg1));
2005
4569
  return addHeapObject(ret);
2006
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
+ };
2007
4583
  imports.wbg.__wbindgen_is_function = function(arg0) {
2008
4584
  const ret = typeof(getObject(arg0)) === 'function';
2009
4585
  return ret;
@@ -2025,10 +4601,24 @@ function __wbg_get_imports() {
2025
4601
  const ret = getObject(arg0) === undefined;
2026
4602
  return ret;
2027
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
+ };
2028
4612
  imports.wbg.__wbindgen_memory = function() {
2029
4613
  const ret = wasm.memory;
2030
4614
  return addHeapObject(ret);
2031
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
+ };
2032
4622
  imports.wbg.__wbindgen_number_new = function(arg0) {
2033
4623
  const ret = arg0;
2034
4624
  return addHeapObject(ret);