@puzzlehq/aleo-wasm-web 0.6.16 → 0.6.18

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.
@@ -1,4 +1,33 @@
1
- import { spawnWorker } from './snippets/aleo-wasm-917a63011190b7ca/inline0.js';
1
+ function spawnWorker(url, module, memory, address) {
2
+ return new Promise((resolve) => {
3
+ const worker = new Worker(url, {
4
+ type: "module",
5
+ });
6
+
7
+ worker.addEventListener("message", (event) => {
8
+ // This is needed in Node to wait one extra tick, so that way
9
+ // the Worker can fully initialize before we return.
10
+ setTimeout(() => {
11
+ resolve(worker);
12
+
13
+ // When running in Node, this allows the process to exit
14
+ // even though the Worker is still running.
15
+ if (worker.unref) {
16
+ worker.unref();
17
+ }
18
+ }, 0);
19
+ }, {
20
+ capture: true,
21
+ once: true,
22
+ });
23
+
24
+ worker.postMessage({
25
+ module,
26
+ memory,
27
+ address,
28
+ });
29
+ });
30
+ }
2
31
 
3
32
  let wasm;
4
33
 
@@ -22,56 +51,34 @@ function takeObject(idx) {
22
51
  return ret;
23
52
  }
24
53
 
25
- const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
26
-
27
- if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
54
+ let WASM_VECTOR_LEN = 0;
28
55
 
29
- let cachedUint8Memory0 = null;
56
+ let cachedUint8ArrayMemory0 = null;
30
57
 
31
- function getUint8Memory0() {
32
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
33
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
58
+ function getUint8ArrayMemory0() {
59
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.buffer !== wasm.memory.buffer) {
60
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
34
61
  }
35
- return cachedUint8Memory0;
36
- }
37
-
38
- function getStringFromWasm0(ptr, len) {
39
- ptr = ptr >>> 0;
40
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
41
- }
42
-
43
- function addHeapObject(obj) {
44
- if (heap_next === heap.length) heap.push(heap.length + 1);
45
- const idx = heap_next;
46
- heap_next = heap[idx];
47
-
48
- heap[idx] = obj;
49
- return idx;
62
+ return cachedUint8ArrayMemory0;
50
63
  }
51
64
 
52
- let WASM_VECTOR_LEN = 0;
53
-
54
65
  const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
55
66
 
56
- const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
57
- ? function (arg, view) {
58
- return cachedTextEncoder.encodeInto(arg, view);
59
- }
60
- : function (arg, view) {
67
+ const encodeString = function (arg, view) {
61
68
  const buf = cachedTextEncoder.encode(arg);
62
69
  view.set(buf);
63
70
  return {
64
71
  read: arg.length,
65
72
  written: buf.length
66
73
  };
67
- });
74
+ };
68
75
 
69
76
  function passStringToWasm0(arg, malloc, realloc) {
70
77
 
71
78
  if (realloc === undefined) {
72
79
  const buf = cachedTextEncoder.encode(arg);
73
80
  const ptr = malloc(buf.length, 1) >>> 0;
74
- getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
81
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
75
82
  WASM_VECTOR_LEN = buf.length;
76
83
  return ptr;
77
84
  }
@@ -79,7 +86,7 @@ function passStringToWasm0(arg, malloc, realloc) {
79
86
  let len = arg.length;
80
87
  let ptr = malloc(len, 1) >>> 0;
81
88
 
82
- const mem = getUint8Memory0();
89
+ const mem = getUint8ArrayMemory0();
83
90
 
84
91
  let offset = 0;
85
92
 
@@ -94,7 +101,7 @@ function passStringToWasm0(arg, malloc, realloc) {
94
101
  arg = arg.slice(offset);
95
102
  }
96
103
  ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
97
- const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
104
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
98
105
  const ret = encodeString(arg, view);
99
106
 
100
107
  offset += ret.written;
@@ -109,13 +116,30 @@ function isLikeNone(x) {
109
116
  return x === undefined || x === null;
110
117
  }
111
118
 
112
- let cachedInt32Memory0 = null;
119
+ let cachedDataViewMemory0 = null;
113
120
 
114
- function getInt32Memory0() {
115
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
116
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
121
+ function getDataViewMemory0() {
122
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
123
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
117
124
  }
118
- return cachedInt32Memory0;
125
+ return cachedDataViewMemory0;
126
+ }
127
+
128
+ const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
129
+
130
+ if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }
131
+ function getStringFromWasm0(ptr, len) {
132
+ ptr = ptr >>> 0;
133
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().slice(ptr, ptr + len));
134
+ }
135
+
136
+ function addHeapObject(obj) {
137
+ if (heap_next === heap.length) heap.push(heap.length + 1);
138
+ const idx = heap_next;
139
+ heap_next = heap[idx];
140
+
141
+ heap[idx] = obj;
142
+ return idx;
119
143
  }
120
144
 
121
145
  function debugString(val) {
@@ -186,7 +210,7 @@ function debugString(val) {
186
210
  const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
187
211
  ? { register: () => {}, unregister: () => {} }
188
212
  : new FinalizationRegistry(state => {
189
- wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b)
213
+ wasm.__wbindgen_export_3.get(state.dtor)(state.a, state.b);
190
214
  });
191
215
 
192
216
  function makeMutClosure(arg0, arg1, dtor, f) {
@@ -202,7 +226,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
202
226
  return f(a, state.b, ...args);
203
227
  } finally {
204
228
  if (--state.cnt === 0) {
205
- wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
229
+ wasm.__wbindgen_export_3.get(state.dtor)(a, state.b);
206
230
  CLOSURE_DTORS.unregister(state);
207
231
  } else {
208
232
  state.a = a;
@@ -213,15 +237,8 @@ function makeMutClosure(arg0, arg1, dtor, f) {
213
237
  CLOSURE_DTORS.register(real, state, state);
214
238
  return real;
215
239
  }
216
- function __wbg_adapter_32(arg0, arg1, arg2) {
217
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hdf1d9b89567002b9(arg0, arg1, addHeapObject(arg2));
218
- }
219
-
220
- function passArray8ToWasm0(arg, malloc) {
221
- const ptr = malloc(arg.length * 1, 1) >>> 0;
222
- getUint8Memory0().set(arg, ptr / 1);
223
- WASM_VECTOR_LEN = arg.length;
224
- return ptr;
240
+ function __wbg_adapter_34(arg0, arg1, arg2) {
241
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h8350945ceba1c17e(arg0, arg1, addHeapObject(arg2));
225
242
  }
226
243
 
227
244
  function _assertClass(instance, klass) {
@@ -231,33 +248,12 @@ function _assertClass(instance, klass) {
231
248
  return instance.ptr;
232
249
  }
233
250
 
234
- function getArrayU8FromWasm0(ptr, len) {
235
- ptr = ptr >>> 0;
236
- return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
237
- }
238
- /**
239
- * @param {number} receiver
240
- */
241
- export function runRayonThread(receiver) {
242
- wasm.runRayonThread(receiver);
243
- }
244
-
245
- /**
246
- */
247
- export function init_panic_hook() {
248
- wasm.init_panic_hook();
249
- }
250
-
251
- /**
252
- * @param {URL} url
253
- * @param {number} num_threads
254
- * @returns {Promise<void>}
255
- */
256
- export function initThreadPool(url, num_threads) {
257
- const ret = wasm.initThreadPool(addHeapObject(url), num_threads);
258
- return takeObject(ret);
251
+ function passArray8ToWasm0(arg, malloc) {
252
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
253
+ getUint8ArrayMemory0().set(arg, ptr / 1);
254
+ WASM_VECTOR_LEN = arg.length;
255
+ return ptr;
259
256
  }
260
-
261
257
  /**
262
258
  * Verify an execution with a single function and a single transition. Executions with multiple
263
259
  * transitions or functions will fail to verify. Also, this does not verify that the state root of
@@ -274,7 +270,7 @@ export function initThreadPool(url, num_threads) {
274
270
  * @param {string} function_id
275
271
  * @returns {boolean}
276
272
  */
277
- export function verifyFunctionExecution(execution, verifying_key, program, function_id) {
273
+ function verifyFunctionExecution(execution, verifying_key, program, function_id) {
278
274
  try {
279
275
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
280
276
  _assertClass(execution, Execution);
@@ -283,9 +279,9 @@ export function verifyFunctionExecution(execution, verifying_key, program, funct
283
279
  const ptr0 = passStringToWasm0(function_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
284
280
  const len0 = WASM_VECTOR_LEN;
285
281
  wasm.verifyFunctionExecution(retptr, execution.__wbg_ptr, verifying_key.__wbg_ptr, program.__wbg_ptr, ptr0, len0);
286
- var r0 = getInt32Memory0()[retptr / 4 + 0];
287
- var r1 = getInt32Memory0()[retptr / 4 + 1];
288
- var r2 = getInt32Memory0()[retptr / 4 + 2];
282
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
283
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
284
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
289
285
  if (r2) {
290
286
  throw takeObject(r1);
291
287
  }
@@ -295,13 +291,31 @@ export function verifyFunctionExecution(execution, verifying_key, program, funct
295
291
  }
296
292
  }
297
293
 
298
- let cachedBigInt64Memory0 = null;
294
+ function getArrayU8FromWasm0(ptr, len) {
295
+ ptr = ptr >>> 0;
296
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
297
+ }
298
+ /**
299
+ * @param {number} receiver
300
+ */
301
+ function runRayonThread(receiver) {
302
+ wasm.runRayonThread(receiver);
303
+ }
299
304
 
300
- function getBigInt64Memory0() {
301
- if (cachedBigInt64Memory0 === null || cachedBigInt64Memory0.byteLength === 0) {
302
- cachedBigInt64Memory0 = new BigInt64Array(wasm.memory.buffer);
303
- }
304
- return cachedBigInt64Memory0;
305
+ /**
306
+ */
307
+ function init_panic_hook() {
308
+ wasm.init_panic_hook();
309
+ }
310
+
311
+ /**
312
+ * @param {URL} url
313
+ * @param {number} num_threads
314
+ * @returns {Promise<void>}
315
+ */
316
+ function initThreadPool(url, num_threads) {
317
+ const ret = wasm.initThreadPool(addHeapObject(url), num_threads);
318
+ return takeObject(ret);
305
319
  }
306
320
 
307
321
  function handleError(f, args) {
@@ -311,17 +325,17 @@ function handleError(f, args) {
311
325
  wasm.__wbindgen_exn_store(addHeapObject(e));
312
326
  }
313
327
  }
314
- function __wbg_adapter_327(arg0, arg1, arg2, arg3) {
315
- wasm.wasm_bindgen__convert__closures__invoke2_mut__h69b3d6b389ddc7fb(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
328
+ function __wbg_adapter_292(arg0, arg1, arg2, arg3) {
329
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__h943edac385d9f50b(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
316
330
  }
317
331
 
318
332
  const AddressFinalization = (typeof FinalizationRegistry === 'undefined')
319
333
  ? { register: () => {}, unregister: () => {} }
320
- : new FinalizationRegistry(ptr => wasm.__wbg_address_free(ptr >>> 0));
334
+ : new FinalizationRegistry(ptr => wasm.__wbg_address_free(ptr >>> 0, 1));
321
335
  /**
322
336
  * Public address of an Aleo account
323
337
  */
324
- export class Address {
338
+ class Address {
325
339
 
326
340
  static __wrap(ptr) {
327
341
  ptr = ptr >>> 0;
@@ -340,7 +354,7 @@ export class Address {
340
354
 
341
355
  free() {
342
356
  const ptr = this.__destroy_into_raw();
343
- wasm.__wbg_address_free(ptr);
357
+ wasm.__wbg_address_free(ptr, 0);
344
358
  }
345
359
  /**
346
360
  * Derive an Aleo address from a private key
@@ -395,8 +409,8 @@ export class Address {
395
409
  try {
396
410
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
397
411
  wasm.address_to_string(retptr, this.__wbg_ptr);
398
- var r0 = getInt32Memory0()[retptr / 4 + 0];
399
- var r1 = getInt32Memory0()[retptr / 4 + 1];
412
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
413
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
400
414
  deferred1_0 = r0;
401
415
  deferred1_1 = r1;
402
416
  return getStringFromWasm0(r0, r1);
@@ -425,10 +439,10 @@ export class Address {
425
439
 
426
440
  const AuthorizationResponseFinalization = (typeof FinalizationRegistry === 'undefined')
427
441
  ? { register: () => {}, unregister: () => {} }
428
- : new FinalizationRegistry(ptr => wasm.__wbg_authorizationresponse_free(ptr >>> 0));
442
+ : new FinalizationRegistry(ptr => wasm.__wbg_authorizationresponse_free(ptr >>> 0, 1));
429
443
  /**
430
444
  */
431
- export class AuthorizationResponse {
445
+ class AuthorizationResponse {
432
446
 
433
447
  static __wrap(ptr) {
434
448
  ptr = ptr >>> 0;
@@ -447,7 +461,7 @@ export class AuthorizationResponse {
447
461
 
448
462
  free() {
449
463
  const ptr = this.__destroy_into_raw();
450
- wasm.__wbg_authorizationresponse_free(ptr);
464
+ wasm.__wbg_authorizationresponse_free(ptr, 0);
451
465
  }
452
466
  /**
453
467
  * @returns {string}
@@ -458,8 +472,8 @@ export class AuthorizationResponse {
458
472
  try {
459
473
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
460
474
  wasm.authorizationresponse_authorization(retptr, this.__wbg_ptr);
461
- var r0 = getInt32Memory0()[retptr / 4 + 0];
462
- var r1 = getInt32Memory0()[retptr / 4 + 1];
475
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
476
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
463
477
  deferred1_0 = r0;
464
478
  deferred1_1 = r1;
465
479
  return getStringFromWasm0(r0, r1);
@@ -477,8 +491,8 @@ export class AuthorizationResponse {
477
491
  try {
478
492
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
479
493
  wasm.authorizationresponse_fee_authorization(retptr, this.__wbg_ptr);
480
- var r0 = getInt32Memory0()[retptr / 4 + 0];
481
- var r1 = getInt32Memory0()[retptr / 4 + 1];
494
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
495
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
482
496
  deferred1_0 = r0;
483
497
  deferred1_1 = r1;
484
498
  return getStringFromWasm0(r0, r1);
@@ -491,11 +505,11 @@ export class AuthorizationResponse {
491
505
 
492
506
  const ExecutionFinalization = (typeof FinalizationRegistry === 'undefined')
493
507
  ? { register: () => {}, unregister: () => {} }
494
- : new FinalizationRegistry(ptr => wasm.__wbg_execution_free(ptr >>> 0));
508
+ : new FinalizationRegistry(ptr => wasm.__wbg_execution_free(ptr >>> 0, 1));
495
509
  /**
496
510
  * Execution of an Aleo program.
497
511
  */
498
- export class Execution {
512
+ class Execution {
499
513
 
500
514
  static __wrap(ptr) {
501
515
  ptr = ptr >>> 0;
@@ -514,7 +528,7 @@ export class Execution {
514
528
 
515
529
  free() {
516
530
  const ptr = this.__destroy_into_raw();
517
- wasm.__wbg_execution_free(ptr);
531
+ wasm.__wbg_execution_free(ptr, 0);
518
532
  }
519
533
  /**
520
534
  * Returns the string representation of the execution.
@@ -526,8 +540,8 @@ export class Execution {
526
540
  try {
527
541
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
528
542
  wasm.execution_toString(retptr, this.__wbg_ptr);
529
- var r0 = getInt32Memory0()[retptr / 4 + 0];
530
- var r1 = getInt32Memory0()[retptr / 4 + 1];
543
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
544
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
531
545
  deferred1_0 = r0;
532
546
  deferred1_1 = r1;
533
547
  return getStringFromWasm0(r0, r1);
@@ -547,9 +561,9 @@ export class Execution {
547
561
  const ptr0 = passStringToWasm0(execution, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
548
562
  const len0 = WASM_VECTOR_LEN;
549
563
  wasm.execution_fromString(retptr, ptr0, len0);
550
- var r0 = getInt32Memory0()[retptr / 4 + 0];
551
- var r1 = getInt32Memory0()[retptr / 4 + 1];
552
- var r2 = getInt32Memory0()[retptr / 4 + 2];
564
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
565
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
566
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
553
567
  if (r2) {
554
568
  throw takeObject(r1);
555
569
  }
@@ -562,14 +576,14 @@ export class Execution {
562
576
 
563
577
  const ExecutionResponseFinalization = (typeof FinalizationRegistry === 'undefined')
564
578
  ? { register: () => {}, unregister: () => {} }
565
- : new FinalizationRegistry(ptr => wasm.__wbg_executionresponse_free(ptr >>> 0));
579
+ : new FinalizationRegistry(ptr => wasm.__wbg_executionresponse_free(ptr >>> 0, 1));
566
580
  /**
567
581
  * Webassembly Representation of an Aleo function execution response
568
582
  *
569
583
  * This object is returned by the execution of an Aleo function off-chain. It provides methods for
570
584
  * retrieving the outputs of the function execution.
571
585
  */
572
- export class ExecutionResponse {
586
+ class ExecutionResponse {
573
587
 
574
588
  static __wrap(ptr) {
575
589
  ptr = ptr >>> 0;
@@ -588,7 +602,7 @@ export class ExecutionResponse {
588
602
 
589
603
  free() {
590
604
  const ptr = this.__destroy_into_raw();
591
- wasm.__wbg_executionresponse_free(ptr);
605
+ wasm.__wbg_executionresponse_free(ptr, 0);
592
606
  }
593
607
  /**
594
608
  * Get the outputs of the executed function
@@ -618,9 +632,9 @@ export class ExecutionResponse {
618
632
  try {
619
633
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
620
634
  wasm.executionresponse_getKeys(retptr, this.__wbg_ptr);
621
- var r0 = getInt32Memory0()[retptr / 4 + 0];
622
- var r1 = getInt32Memory0()[retptr / 4 + 1];
623
- var r2 = getInt32Memory0()[retptr / 4 + 2];
635
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
636
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
637
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
624
638
  if (r2) {
625
639
  throw takeObject(r1);
626
640
  }
@@ -661,8 +675,8 @@ export class ExecutionResponse {
661
675
  try {
662
676
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
663
677
  wasm.executionresponse_getFunctionId(retptr, this.__wbg_ptr);
664
- var r0 = getInt32Memory0()[retptr / 4 + 0];
665
- var r1 = getInt32Memory0()[retptr / 4 + 1];
678
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
679
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
666
680
  deferred1_0 = r0;
667
681
  deferred1_1 = r1;
668
682
  return getStringFromWasm0(r0, r1);
@@ -683,10 +697,10 @@ export class ExecutionResponse {
683
697
 
684
698
  const FieldFinalization = (typeof FinalizationRegistry === 'undefined')
685
699
  ? { register: () => {}, unregister: () => {} }
686
- : new FinalizationRegistry(ptr => wasm.__wbg_field_free(ptr >>> 0));
700
+ : new FinalizationRegistry(ptr => wasm.__wbg_field_free(ptr >>> 0, 1));
687
701
  /**
688
702
  */
689
- export class Field {
703
+ class Field {
690
704
 
691
705
  static __wrap(ptr) {
692
706
  ptr = ptr >>> 0;
@@ -705,7 +719,7 @@ export class Field {
705
719
 
706
720
  free() {
707
721
  const ptr = this.__destroy_into_raw();
708
- wasm.__wbg_field_free(ptr);
722
+ wasm.__wbg_field_free(ptr, 0);
709
723
  }
710
724
  /**
711
725
  * @returns {string}
@@ -716,8 +730,8 @@ export class Field {
716
730
  try {
717
731
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
718
732
  wasm.field_toString(retptr, this.__wbg_ptr);
719
- var r0 = getInt32Memory0()[retptr / 4 + 0];
720
- var r1 = getInt32Memory0()[retptr / 4 + 1];
733
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
734
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
721
735
  deferred1_0 = r0;
722
736
  deferred1_1 = r1;
723
737
  return getStringFromWasm0(r0, r1);
@@ -736,9 +750,9 @@ export class Field {
736
750
  const ptr0 = passStringToWasm0(field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
737
751
  const len0 = WASM_VECTOR_LEN;
738
752
  wasm.field_fromString(retptr, ptr0, len0);
739
- var r0 = getInt32Memory0()[retptr / 4 + 0];
740
- var r1 = getInt32Memory0()[retptr / 4 + 1];
741
- var r2 = getInt32Memory0()[retptr / 4 + 2];
753
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
754
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
755
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
742
756
  if (r2) {
743
757
  throw takeObject(r1);
744
758
  }
@@ -749,87 +763,13 @@ export class Field {
749
763
  }
750
764
  }
751
765
 
752
- const JsFieldFinalization = (typeof FinalizationRegistry === 'undefined')
753
- ? { register: () => {}, unregister: () => {} }
754
- : new FinalizationRegistry(ptr => wasm.__wbg_jsfield_free(ptr >>> 0));
755
- /**
756
- */
757
- export class JsField {
758
-
759
- __destroy_into_raw() {
760
- const ptr = this.__wbg_ptr;
761
- this.__wbg_ptr = 0;
762
- JsFieldFinalization.unregister(this);
763
- return ptr;
764
- }
765
-
766
- free() {
767
- const ptr = this.__destroy_into_raw();
768
- wasm.__wbg_jsfield_free(ptr);
769
- }
770
- /**
771
- * @param {PrivateKey} private_key
772
- * @param {Uint8Array} message
773
- * @param {Uint8Array} seed
774
- * @returns {string}
775
- */
776
- static generate_message_leo(private_key, message, seed) {
777
- let deferred3_0;
778
- let deferred3_1;
779
- try {
780
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
781
- _assertClass(private_key, PrivateKey);
782
- const ptr0 = passArray8ToWasm0(message, wasm.__wbindgen_malloc);
783
- const len0 = WASM_VECTOR_LEN;
784
- const ptr1 = passArray8ToWasm0(seed, wasm.__wbindgen_malloc);
785
- const len1 = WASM_VECTOR_LEN;
786
- wasm.jsfield_generate_message_leo(retptr, private_key.__wbg_ptr, ptr0, len0, ptr1, len1);
787
- var r0 = getInt32Memory0()[retptr / 4 + 0];
788
- var r1 = getInt32Memory0()[retptr / 4 + 1];
789
- deferred3_0 = r0;
790
- deferred3_1 = r1;
791
- return getStringFromWasm0(r0, r1);
792
- } finally {
793
- wasm.__wbindgen_add_to_stack_pointer(16);
794
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
795
- }
796
- }
797
- /**
798
- * @param {PrivateKey} private_key
799
- * @param {Uint8Array} message
800
- * @param {Uint8Array} seed
801
- * @returns {string}
802
- */
803
- static generate_message_clients(private_key, message, seed) {
804
- let deferred3_0;
805
- let deferred3_1;
806
- try {
807
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
808
- _assertClass(private_key, PrivateKey);
809
- const ptr0 = passArray8ToWasm0(message, wasm.__wbindgen_malloc);
810
- const len0 = WASM_VECTOR_LEN;
811
- const ptr1 = passArray8ToWasm0(seed, wasm.__wbindgen_malloc);
812
- const len1 = WASM_VECTOR_LEN;
813
- wasm.jsfield_generate_message_clients(retptr, private_key.__wbg_ptr, ptr0, len0, ptr1, len1);
814
- var r0 = getInt32Memory0()[retptr / 4 + 0];
815
- var r1 = getInt32Memory0()[retptr / 4 + 1];
816
- deferred3_0 = r0;
817
- deferred3_1 = r1;
818
- return getStringFromWasm0(r0, r1);
819
- } finally {
820
- wasm.__wbindgen_add_to_stack_pointer(16);
821
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
822
- }
823
- }
824
- }
825
-
826
766
  const KeyPairFinalization = (typeof FinalizationRegistry === 'undefined')
827
767
  ? { register: () => {}, unregister: () => {} }
828
- : new FinalizationRegistry(ptr => wasm.__wbg_keypair_free(ptr >>> 0));
768
+ : new FinalizationRegistry(ptr => wasm.__wbg_keypair_free(ptr >>> 0, 1));
829
769
  /**
830
770
  * Key pair object containing both the function proving and verifying keys
831
771
  */
832
- export class KeyPair {
772
+ class KeyPair {
833
773
 
834
774
  static __wrap(ptr) {
835
775
  ptr = ptr >>> 0;
@@ -848,7 +788,7 @@ export class KeyPair {
848
788
 
849
789
  free() {
850
790
  const ptr = this.__destroy_into_raw();
851
- wasm.__wbg_keypair_free(ptr);
791
+ wasm.__wbg_keypair_free(ptr, 0);
852
792
  }
853
793
  /**
854
794
  * Create new key pair from proving and verifying keys
@@ -866,6 +806,7 @@ export class KeyPair {
866
806
  var ptr1 = verifying_key.__destroy_into_raw();
867
807
  const ret = wasm.keypair_new(ptr0, ptr1);
868
808
  this.__wbg_ptr = ret >>> 0;
809
+ KeyPairFinalization.register(this, this.__wbg_ptr, this);
869
810
  return this;
870
811
  }
871
812
  /**
@@ -878,9 +819,9 @@ export class KeyPair {
878
819
  try {
879
820
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
880
821
  wasm.keypair_provingKey(retptr, this.__wbg_ptr);
881
- var r0 = getInt32Memory0()[retptr / 4 + 0];
882
- var r1 = getInt32Memory0()[retptr / 4 + 1];
883
- var r2 = getInt32Memory0()[retptr / 4 + 2];
822
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
823
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
824
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
884
825
  if (r2) {
885
826
  throw takeObject(r1);
886
827
  }
@@ -899,9 +840,9 @@ export class KeyPair {
899
840
  try {
900
841
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
901
842
  wasm.keypair_verifyingKey(retptr, this.__wbg_ptr);
902
- var r0 = getInt32Memory0()[retptr / 4 + 0];
903
- var r1 = getInt32Memory0()[retptr / 4 + 1];
904
- var r2 = getInt32Memory0()[retptr / 4 + 2];
843
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
844
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
845
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
905
846
  if (r2) {
906
847
  throw takeObject(r1);
907
848
  }
@@ -914,10 +855,10 @@ export class KeyPair {
914
855
 
915
856
  const MetadataFinalization = (typeof FinalizationRegistry === 'undefined')
916
857
  ? { register: () => {}, unregister: () => {} }
917
- : new FinalizationRegistry(ptr => wasm.__wbg_metadata_free(ptr >>> 0));
858
+ : new FinalizationRegistry(ptr => wasm.__wbg_metadata_free(ptr >>> 0, 1));
918
859
  /**
919
860
  */
920
- export class Metadata {
861
+ class Metadata {
921
862
 
922
863
  static __wrap(ptr) {
923
864
  ptr = ptr >>> 0;
@@ -936,7 +877,7 @@ export class Metadata {
936
877
 
937
878
  free() {
938
879
  const ptr = this.__destroy_into_raw();
939
- wasm.__wbg_metadata_free(ptr);
880
+ wasm.__wbg_metadata_free(ptr, 0);
940
881
  }
941
882
  /**
942
883
  * @returns {string}
@@ -947,8 +888,8 @@ export class Metadata {
947
888
  try {
948
889
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
949
890
  wasm.__wbg_get_metadata_name(retptr, this.__wbg_ptr);
950
- var r0 = getInt32Memory0()[retptr / 4 + 0];
951
- var r1 = getInt32Memory0()[retptr / 4 + 1];
891
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
892
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
952
893
  deferred1_0 = r0;
953
894
  deferred1_1 = r1;
954
895
  return getStringFromWasm0(r0, r1);
@@ -974,8 +915,8 @@ export class Metadata {
974
915
  try {
975
916
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
976
917
  wasm.__wbg_get_metadata_locator(retptr, this.__wbg_ptr);
977
- var r0 = getInt32Memory0()[retptr / 4 + 0];
978
- var r1 = getInt32Memory0()[retptr / 4 + 1];
918
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
919
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
979
920
  deferred1_0 = r0;
980
921
  deferred1_1 = r1;
981
922
  return getStringFromWasm0(r0, r1);
@@ -1001,8 +942,8 @@ export class Metadata {
1001
942
  try {
1002
943
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1003
944
  wasm.__wbg_get_metadata_prover(retptr, this.__wbg_ptr);
1004
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1005
- var r1 = getInt32Memory0()[retptr / 4 + 1];
945
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
946
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1006
947
  deferred1_0 = r0;
1007
948
  deferred1_1 = r1;
1008
949
  return getStringFromWasm0(r0, r1);
@@ -1028,8 +969,8 @@ export class Metadata {
1028
969
  try {
1029
970
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1030
971
  wasm.__wbg_get_metadata_verifier(retptr, this.__wbg_ptr);
1031
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1032
- var r1 = getInt32Memory0()[retptr / 4 + 1];
972
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
973
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1033
974
  deferred1_0 = r0;
1034
975
  deferred1_1 = r1;
1035
976
  return getStringFromWasm0(r0, r1);
@@ -1055,8 +996,8 @@ export class Metadata {
1055
996
  try {
1056
997
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1057
998
  wasm.__wbg_get_metadata_verifyingKey(retptr, this.__wbg_ptr);
1058
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1059
- var r1 = getInt32Memory0()[retptr / 4 + 1];
999
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1000
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1060
1001
  deferred1_0 = r0;
1061
1002
  deferred1_1 = r1;
1062
1003
  return getStringFromWasm0(r0, r1);
@@ -1082,8 +1023,8 @@ export class Metadata {
1082
1023
  try {
1083
1024
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1084
1025
  wasm.metadata_baseUrl(retptr);
1085
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1086
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1026
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1027
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1087
1028
  deferred1_0 = r0;
1088
1029
  deferred1_1 = r1;
1089
1030
  return getStringFromWasm0(r0, r1);
@@ -1201,12 +1142,12 @@ export class Metadata {
1201
1142
 
1202
1143
  const OfflineQueryFinalization = (typeof FinalizationRegistry === 'undefined')
1203
1144
  ? { register: () => {}, unregister: () => {} }
1204
- : new FinalizationRegistry(ptr => wasm.__wbg_offlinequery_free(ptr >>> 0));
1145
+ : new FinalizationRegistry(ptr => wasm.__wbg_offlinequery_free(ptr >>> 0, 1));
1205
1146
  /**
1206
1147
  * An offline query object used to insert the global state root and state paths needed to create
1207
1148
  * a valid inclusion proof offline.
1208
1149
  */
1209
- export class OfflineQuery {
1150
+ class OfflineQuery {
1210
1151
 
1211
1152
  static __wrap(ptr) {
1212
1153
  ptr = ptr >>> 0;
@@ -1225,7 +1166,7 @@ export class OfflineQuery {
1225
1166
 
1226
1167
  free() {
1227
1168
  const ptr = this.__destroy_into_raw();
1228
- wasm.__wbg_offlinequery_free(ptr);
1169
+ wasm.__wbg_offlinequery_free(ptr, 0);
1229
1170
  }
1230
1171
  /**
1231
1172
  * Creates a new offline query object. The state root is required to be passed in as a string
@@ -1237,13 +1178,14 @@ export class OfflineQuery {
1237
1178
  const ptr0 = passStringToWasm0(state_root, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1238
1179
  const len0 = WASM_VECTOR_LEN;
1239
1180
  wasm.offlinequery_new(retptr, ptr0, len0);
1240
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1241
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1242
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1181
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1182
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1183
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1243
1184
  if (r2) {
1244
1185
  throw takeObject(r1);
1245
1186
  }
1246
1187
  this.__wbg_ptr = r0 >>> 0;
1188
+ OfflineQueryFinalization.register(this, this.__wbg_ptr, this);
1247
1189
  return this;
1248
1190
  } finally {
1249
1191
  wasm.__wbindgen_add_to_stack_pointer(16);
@@ -1265,8 +1207,8 @@ export class OfflineQuery {
1265
1207
  const ptr1 = passStringToWasm0(state_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1266
1208
  const len1 = WASM_VECTOR_LEN;
1267
1209
  wasm.offlinequery_addStatePath(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
1268
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1269
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1210
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1211
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1270
1212
  if (r1) {
1271
1213
  throw takeObject(r0);
1272
1214
  }
@@ -1284,8 +1226,8 @@ export class OfflineQuery {
1284
1226
  try {
1285
1227
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1286
1228
  wasm.offlinequery_toString(retptr, this.__wbg_ptr);
1287
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1288
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1229
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1230
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1289
1231
  deferred1_0 = r0;
1290
1232
  deferred1_1 = r1;
1291
1233
  return getStringFromWasm0(r0, r1);
@@ -1305,9 +1247,9 @@ export class OfflineQuery {
1305
1247
  const ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1306
1248
  const len0 = WASM_VECTOR_LEN;
1307
1249
  wasm.offlinequery_fromString(retptr, ptr0, len0);
1308
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1309
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1310
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1250
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1251
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1252
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1311
1253
  if (r2) {
1312
1254
  throw takeObject(r1);
1313
1255
  }
@@ -1320,10 +1262,10 @@ export class OfflineQuery {
1320
1262
 
1321
1263
  const PlaintextFinalization = (typeof FinalizationRegistry === 'undefined')
1322
1264
  ? { register: () => {}, unregister: () => {} }
1323
- : new FinalizationRegistry(ptr => wasm.__wbg_plaintext_free(ptr >>> 0));
1265
+ : new FinalizationRegistry(ptr => wasm.__wbg_plaintext_free(ptr >>> 0, 1));
1324
1266
  /**
1325
1267
  */
1326
- export class Plaintext {
1268
+ class Plaintext {
1327
1269
 
1328
1270
  static __wrap(ptr) {
1329
1271
  ptr = ptr >>> 0;
@@ -1342,7 +1284,7 @@ export class Plaintext {
1342
1284
 
1343
1285
  free() {
1344
1286
  const ptr = this.__destroy_into_raw();
1345
- wasm.__wbg_plaintext_free(ptr);
1287
+ wasm.__wbg_plaintext_free(ptr, 0);
1346
1288
  }
1347
1289
  /**
1348
1290
  * @returns {string}
@@ -1352,9 +1294,9 @@ export class Plaintext {
1352
1294
  let deferred1_1;
1353
1295
  try {
1354
1296
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1355
- wasm.plaintext_toString(retptr, this.__wbg_ptr);
1356
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1357
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1297
+ wasm.authorizationresponse_fee_authorization(retptr, this.__wbg_ptr);
1298
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1299
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1358
1300
  deferred1_0 = r0;
1359
1301
  deferred1_1 = r1;
1360
1302
  return getStringFromWasm0(r0, r1);
@@ -1373,9 +1315,9 @@ export class Plaintext {
1373
1315
  const ptr0 = passStringToWasm0(plaintext, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1374
1316
  const len0 = WASM_VECTOR_LEN;
1375
1317
  wasm.plaintext_fromString(retptr, ptr0, len0);
1376
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1377
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1378
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1318
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1319
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1320
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1379
1321
  if (r2) {
1380
1322
  throw takeObject(r1);
1381
1323
  }
@@ -1393,10 +1335,10 @@ export class Plaintext {
1393
1335
  try {
1394
1336
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1395
1337
  wasm.plaintext_hashBhp256(retptr, this.__wbg_ptr);
1396
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1397
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1398
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1399
- var r3 = getInt32Memory0()[retptr / 4 + 3];
1338
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1339
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1340
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1341
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1400
1342
  var ptr1 = r0;
1401
1343
  var len1 = r1;
1402
1344
  if (r3) {
@@ -1415,11 +1357,11 @@ export class Plaintext {
1415
1357
 
1416
1358
  const PrivateKeyFinalization = (typeof FinalizationRegistry === 'undefined')
1417
1359
  ? { register: () => {}, unregister: () => {} }
1418
- : new FinalizationRegistry(ptr => wasm.__wbg_privatekey_free(ptr >>> 0));
1360
+ : new FinalizationRegistry(ptr => wasm.__wbg_privatekey_free(ptr >>> 0, 1));
1419
1361
  /**
1420
1362
  * Private key of an Aleo account
1421
1363
  */
1422
- export class PrivateKey {
1364
+ class PrivateKey {
1423
1365
 
1424
1366
  static __wrap(ptr) {
1425
1367
  ptr = ptr >>> 0;
@@ -1438,7 +1380,7 @@ export class PrivateKey {
1438
1380
 
1439
1381
  free() {
1440
1382
  const ptr = this.__destroy_into_raw();
1441
- wasm.__wbg_privatekey_free(ptr);
1383
+ wasm.__wbg_privatekey_free(ptr, 0);
1442
1384
  }
1443
1385
  /**
1444
1386
  * Generate a new private key using a cryptographically secure random number generator
@@ -1448,6 +1390,7 @@ export class PrivateKey {
1448
1390
  constructor() {
1449
1391
  const ret = wasm.privatekey_new();
1450
1392
  this.__wbg_ptr = ret >>> 0;
1393
+ PrivateKeyFinalization.register(this, this.__wbg_ptr, this);
1451
1394
  return this;
1452
1395
  }
1453
1396
  /**
@@ -1478,9 +1421,9 @@ export class PrivateKey {
1478
1421
  const ptr0 = passStringToWasm0(private_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1479
1422
  const len0 = WASM_VECTOR_LEN;
1480
1423
  wasm.privatekey_from_string(retptr, ptr0, len0);
1481
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1482
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1483
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1424
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1425
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1426
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1484
1427
  if (r2) {
1485
1428
  throw takeObject(r1);
1486
1429
  }
@@ -1502,8 +1445,8 @@ export class PrivateKey {
1502
1445
  try {
1503
1446
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1504
1447
  wasm.privatekey_to_string(retptr, this.__wbg_ptr);
1505
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1506
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1448
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1449
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1507
1450
  deferred1_0 = r0;
1508
1451
  deferred1_1 = r1;
1509
1452
  return getStringFromWasm0(r0, r1);
@@ -1525,8 +1468,8 @@ export class PrivateKey {
1525
1468
  try {
1526
1469
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1527
1470
  wasm.privatekey_to_seed(retptr, this.__wbg_ptr);
1528
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1529
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1471
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1472
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1530
1473
  deferred1_0 = r0;
1531
1474
  deferred1_1 = r1;
1532
1475
  return getStringFromWasm0(r0, r1);
@@ -1584,9 +1527,9 @@ export class PrivateKey {
1584
1527
  const ptr0 = passStringToWasm0(secret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1585
1528
  const len0 = WASM_VECTOR_LEN;
1586
1529
  wasm.privatekey_newEncrypted(retptr, ptr0, len0);
1587
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1588
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1589
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1530
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1531
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1532
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1590
1533
  if (r2) {
1591
1534
  throw takeObject(r1);
1592
1535
  }
@@ -1610,9 +1553,9 @@ export class PrivateKey {
1610
1553
  const ptr0 = passStringToWasm0(secret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1611
1554
  const len0 = WASM_VECTOR_LEN;
1612
1555
  wasm.privatekey_toCiphertext(retptr, this.__wbg_ptr, ptr0, len0);
1613
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1614
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1615
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1556
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1557
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1558
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1616
1559
  if (r2) {
1617
1560
  throw takeObject(r1);
1618
1561
  }
@@ -1638,9 +1581,9 @@ export class PrivateKey {
1638
1581
  const ptr0 = passStringToWasm0(secret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1639
1582
  const len0 = WASM_VECTOR_LEN;
1640
1583
  wasm.privatekey_fromPrivateKeyCiphertext(retptr, ciphertext.__wbg_ptr, ptr0, len0);
1641
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1642
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1643
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1584
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1585
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1586
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1644
1587
  if (r2) {
1645
1588
  throw takeObject(r1);
1646
1589
  }
@@ -1653,11 +1596,11 @@ export class PrivateKey {
1653
1596
 
1654
1597
  const PrivateKeyCiphertextFinalization = (typeof FinalizationRegistry === 'undefined')
1655
1598
  ? { register: () => {}, unregister: () => {} }
1656
- : new FinalizationRegistry(ptr => wasm.__wbg_privatekeyciphertext_free(ptr >>> 0));
1599
+ : new FinalizationRegistry(ptr => wasm.__wbg_privatekeyciphertext_free(ptr >>> 0, 1));
1657
1600
  /**
1658
1601
  * Private Key in ciphertext form
1659
1602
  */
1660
- export class PrivateKeyCiphertext {
1603
+ class PrivateKeyCiphertext {
1661
1604
 
1662
1605
  static __wrap(ptr) {
1663
1606
  ptr = ptr >>> 0;
@@ -1676,7 +1619,7 @@ export class PrivateKeyCiphertext {
1676
1619
 
1677
1620
  free() {
1678
1621
  const ptr = this.__destroy_into_raw();
1679
- wasm.__wbg_privatekeyciphertext_free(ptr);
1622
+ wasm.__wbg_privatekeyciphertext_free(ptr, 0);
1680
1623
  }
1681
1624
  /**
1682
1625
  * Encrypt a private key using a secret string. The secret is sensitive and will be needed to
@@ -1695,10 +1638,10 @@ export class PrivateKeyCiphertext {
1695
1638
  _assertClass(private_key, PrivateKey);
1696
1639
  const ptr0 = passStringToWasm0(secret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1697
1640
  const len0 = WASM_VECTOR_LEN;
1698
- wasm.privatekeyciphertext_encryptPrivateKey(retptr, private_key.__wbg_ptr, ptr0, len0);
1699
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1700
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1701
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1641
+ wasm.privatekey_toCiphertext(retptr, private_key.__wbg_ptr, ptr0, len0);
1642
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1643
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1644
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1702
1645
  if (r2) {
1703
1646
  throw takeObject(r1);
1704
1647
  }
@@ -1722,9 +1665,9 @@ export class PrivateKeyCiphertext {
1722
1665
  const ptr0 = passStringToWasm0(secret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1723
1666
  const len0 = WASM_VECTOR_LEN;
1724
1667
  wasm.privatekeyciphertext_decryptToPrivateKey(retptr, this.__wbg_ptr, ptr0, len0);
1725
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1726
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1727
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1668
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1669
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1670
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1728
1671
  if (r2) {
1729
1672
  throw takeObject(r1);
1730
1673
  }
@@ -1745,8 +1688,8 @@ export class PrivateKeyCiphertext {
1745
1688
  try {
1746
1689
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1747
1690
  wasm.privatekeyciphertext_toString(retptr, this.__wbg_ptr);
1748
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1749
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1691
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1692
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1750
1693
  deferred1_0 = r0;
1751
1694
  deferred1_1 = r1;
1752
1695
  return getStringFromWasm0(r0, r1);
@@ -1769,9 +1712,9 @@ export class PrivateKeyCiphertext {
1769
1712
  const ptr0 = passStringToWasm0(ciphertext, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1770
1713
  const len0 = WASM_VECTOR_LEN;
1771
1714
  wasm.privatekeyciphertext_fromString(retptr, ptr0, len0);
1772
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1773
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1774
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1715
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1716
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1717
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1775
1718
  if (r2) {
1776
1719
  throw takeObject(r1);
1777
1720
  }
@@ -1784,11 +1727,11 @@ export class PrivateKeyCiphertext {
1784
1727
 
1785
1728
  const ProgramFinalization = (typeof FinalizationRegistry === 'undefined')
1786
1729
  ? { register: () => {}, unregister: () => {} }
1787
- : new FinalizationRegistry(ptr => wasm.__wbg_program_free(ptr >>> 0));
1730
+ : new FinalizationRegistry(ptr => wasm.__wbg_program_free(ptr >>> 0, 1));
1788
1731
  /**
1789
1732
  * Webassembly Representation of an Aleo program
1790
1733
  */
1791
- export class Program {
1734
+ class Program {
1792
1735
 
1793
1736
  static __wrap(ptr) {
1794
1737
  ptr = ptr >>> 0;
@@ -1807,7 +1750,7 @@ export class Program {
1807
1750
 
1808
1751
  free() {
1809
1752
  const ptr = this.__destroy_into_raw();
1810
- wasm.__wbg_program_free(ptr);
1753
+ wasm.__wbg_program_free(ptr, 0);
1811
1754
  }
1812
1755
  /**
1813
1756
  * Create a program from a program string
@@ -1823,9 +1766,9 @@ export class Program {
1823
1766
  const ptr0 = passStringToWasm0(program, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1824
1767
  const len0 = WASM_VECTOR_LEN;
1825
1768
  wasm.program_fromString(retptr, ptr0, len0);
1826
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1827
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1828
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1769
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1770
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1771
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1829
1772
  if (r2) {
1830
1773
  throw takeObject(r1);
1831
1774
  }
@@ -1846,8 +1789,8 @@ export class Program {
1846
1789
  try {
1847
1790
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1848
1791
  wasm.program_toString(retptr, this.__wbg_ptr);
1849
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1850
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1792
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1793
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1851
1794
  deferred1_0 = r0;
1852
1795
  deferred1_1 = r1;
1853
1796
  return getStringFromWasm0(r0, r1);
@@ -1942,9 +1885,9 @@ export class Program {
1942
1885
  const ptr0 = passStringToWasm0(function_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1943
1886
  const len0 = WASM_VECTOR_LEN;
1944
1887
  wasm.program_getFunctionInputs(retptr, this.__wbg_ptr, ptr0, len0);
1945
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1946
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1947
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1888
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1889
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1890
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1948
1891
  if (r2) {
1949
1892
  throw takeObject(r1);
1950
1893
  }
@@ -1977,9 +1920,9 @@ export class Program {
1977
1920
  try {
1978
1921
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1979
1922
  wasm.program_getMappings(retptr, this.__wbg_ptr);
1980
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1981
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1982
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1923
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1924
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1925
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1983
1926
  if (r2) {
1984
1927
  throw takeObject(r1);
1985
1928
  }
@@ -2025,9 +1968,9 @@ export class Program {
2025
1968
  const ptr0 = passStringToWasm0(record_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2026
1969
  const len0 = WASM_VECTOR_LEN;
2027
1970
  wasm.program_getRecordMembers(retptr, this.__wbg_ptr, ptr0, len0);
2028
- var r0 = getInt32Memory0()[retptr / 4 + 0];
2029
- var r1 = getInt32Memory0()[retptr / 4 + 1];
2030
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1971
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1972
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1973
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2031
1974
  if (r2) {
2032
1975
  throw takeObject(r1);
2033
1976
  }
@@ -2092,9 +2035,9 @@ export class Program {
2092
2035
  const ptr0 = passStringToWasm0(struct_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2093
2036
  const len0 = WASM_VECTOR_LEN;
2094
2037
  wasm.program_getStructMembers(retptr, this.__wbg_ptr, ptr0, len0);
2095
- var r0 = getInt32Memory0()[retptr / 4 + 0];
2096
- var r1 = getInt32Memory0()[retptr / 4 + 1];
2097
- var r2 = getInt32Memory0()[retptr / 4 + 2];
2038
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2039
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2040
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2098
2041
  if (r2) {
2099
2042
  throw takeObject(r1);
2100
2043
  }
@@ -2125,8 +2068,8 @@ export class Program {
2125
2068
  try {
2126
2069
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2127
2070
  wasm.program_id(retptr, this.__wbg_ptr);
2128
- var r0 = getInt32Memory0()[retptr / 4 + 0];
2129
- var r1 = getInt32Memory0()[retptr / 4 + 1];
2071
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2072
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2130
2073
  deferred1_0 = r0;
2131
2074
  deferred1_1 = r1;
2132
2075
  return getStringFromWasm0(r0, r1);
@@ -2145,9 +2088,9 @@ export class Program {
2145
2088
  try {
2146
2089
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2147
2090
  wasm.program_address(retptr, this.__wbg_ptr);
2148
- var r0 = getInt32Memory0()[retptr / 4 + 0];
2149
- var r1 = getInt32Memory0()[retptr / 4 + 1];
2150
- var r2 = getInt32Memory0()[retptr / 4 + 2];
2091
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2092
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2093
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2151
2094
  if (r2) {
2152
2095
  throw takeObject(r1);
2153
2096
  }
@@ -2202,10 +2145,10 @@ export class Program {
2202
2145
 
2203
2146
  const ProgramManagerFinalization = (typeof FinalizationRegistry === 'undefined')
2204
2147
  ? { register: () => {}, unregister: () => {} }
2205
- : new FinalizationRegistry(ptr => wasm.__wbg_programmanager_free(ptr >>> 0));
2148
+ : new FinalizationRegistry(ptr => wasm.__wbg_programmanager_free(ptr >>> 0, 1));
2206
2149
  /**
2207
2150
  */
2208
- export class ProgramManager {
2151
+ class ProgramManager {
2209
2152
 
2210
2153
  __destroy_into_raw() {
2211
2154
  const ptr = this.__wbg_ptr;
@@ -2216,281 +2159,68 @@ export class ProgramManager {
2216
2159
 
2217
2160
  free() {
2218
2161
  const ptr = this.__destroy_into_raw();
2219
- wasm.__wbg_programmanager_free(ptr);
2220
- }
2221
- /**
2222
- * Synthesize proving and verifying keys for a program
2223
- *
2224
- * @param program {string} The program source code of the program to synthesize keys for
2225
- * @param function_id {string} The function to synthesize keys for
2226
- * @param inputs {Array} The inputs to the function
2227
- * @param imports {Object | undefined} The imports for the program
2228
- * @param {PrivateKey} private_key
2229
- * @param {string} program
2230
- * @param {string} function_id
2231
- * @param {Array<any>} inputs
2232
- * @param {object | undefined} [imports]
2233
- * @returns {Promise<KeyPair>}
2234
- */
2235
- static synthesizeKeyPair(private_key, program, function_id, inputs, imports) {
2236
- _assertClass(private_key, PrivateKey);
2237
- const ptr0 = passStringToWasm0(program, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2238
- const len0 = WASM_VECTOR_LEN;
2239
- const ptr1 = passStringToWasm0(function_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2240
- const len1 = WASM_VECTOR_LEN;
2241
- const ret = wasm.programmanager_synthesizeKeyPair(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), isLikeNone(imports) ? 0 : addHeapObject(imports));
2242
- return takeObject(ret);
2162
+ wasm.__wbg_programmanager_free(ptr, 0);
2243
2163
  }
2244
2164
  /**
2245
- * Join two records together to create a new record with an amount of credits equal to the sum
2246
- * of the credits of the two original records
2165
+ * Deploy an Aleo program
2247
2166
  *
2248
2167
  * @param private_key The private key of the sender
2249
- * @param record_1 The first record to combine
2250
- * @param record_2 The second record to combine
2168
+ * @param program The source code of the program being deployed
2169
+ * @param imports A javascript object holding the source code of any imported programs in the
2170
+ * form \{"program_name1": "program_source_code", "program_name2": "program_source_code", ..\}.
2171
+ * Note that all imported programs must be deployed on chain before the main program in order
2172
+ * for the deployment to succeed
2251
2173
  * @param fee_credits The amount of credits to pay as a fee
2252
2174
  * @param fee_record The record to spend the fee from
2253
2175
  * @param url The url of the Aleo network node to send the transaction to
2254
- * @param join_proving_key (optional) Provide a proving key to use for the join function
2255
- * @param join_verifying_key (optional) Provide a verifying key to use for the join function
2176
+ * @param imports (optional) Provide a list of imports to use for the program deployment in the
2177
+ * form of a javascript object where the keys are a string of the program name and the values
2178
+ * are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
2256
2179
  * @param fee_proving_key (optional) Provide a proving key to use for the fee execution
2257
2180
  * @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
2258
- * @returns {Transaction | Error} Transaction object
2181
+ * @returns {Transaction | Error}
2259
2182
  * @param {PrivateKey} private_key
2260
- * @param {RecordPlaintext} record_1
2261
- * @param {RecordPlaintext} record_2
2183
+ * @param {string} program
2262
2184
  * @param {number} fee_credits
2263
2185
  * @param {RecordPlaintext | undefined} [fee_record]
2264
2186
  * @param {string | undefined} [url]
2265
- * @param {ProvingKey | undefined} [join_proving_key]
2266
- * @param {VerifyingKey | undefined} [join_verifying_key]
2187
+ * @param {object | undefined} [imports]
2267
2188
  * @param {ProvingKey | undefined} [fee_proving_key]
2268
2189
  * @param {VerifyingKey | undefined} [fee_verifying_key]
2269
2190
  * @param {OfflineQuery | undefined} [offline_query]
2270
2191
  * @returns {Promise<Transaction>}
2271
2192
  */
2272
- static buildJoinTransaction(private_key, record_1, record_2, fee_credits, fee_record, url, join_proving_key, join_verifying_key, fee_proving_key, fee_verifying_key, offline_query) {
2193
+ static buildDeploymentTransaction(private_key, program, fee_credits, fee_record, url, imports, fee_proving_key, fee_verifying_key, offline_query) {
2273
2194
  _assertClass(private_key, PrivateKey);
2274
- _assertClass(record_1, RecordPlaintext);
2275
- var ptr0 = record_1.__destroy_into_raw();
2276
- _assertClass(record_2, RecordPlaintext);
2277
- var ptr1 = record_2.__destroy_into_raw();
2278
- let ptr2 = 0;
2195
+ const ptr0 = passStringToWasm0(program, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2196
+ const len0 = WASM_VECTOR_LEN;
2197
+ let ptr1 = 0;
2279
2198
  if (!isLikeNone(fee_record)) {
2280
2199
  _assertClass(fee_record, RecordPlaintext);
2281
- ptr2 = fee_record.__destroy_into_raw();
2282
- }
2283
- var ptr3 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2284
- var len3 = WASM_VECTOR_LEN;
2285
- let ptr4 = 0;
2286
- if (!isLikeNone(join_proving_key)) {
2287
- _assertClass(join_proving_key, ProvingKey);
2288
- ptr4 = join_proving_key.__destroy_into_raw();
2289
- }
2290
- let ptr5 = 0;
2291
- if (!isLikeNone(join_verifying_key)) {
2292
- _assertClass(join_verifying_key, VerifyingKey);
2293
- ptr5 = join_verifying_key.__destroy_into_raw();
2200
+ ptr1 = fee_record.__destroy_into_raw();
2294
2201
  }
2295
- let ptr6 = 0;
2202
+ var ptr2 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2203
+ var len2 = WASM_VECTOR_LEN;
2204
+ let ptr3 = 0;
2296
2205
  if (!isLikeNone(fee_proving_key)) {
2297
2206
  _assertClass(fee_proving_key, ProvingKey);
2298
- ptr6 = fee_proving_key.__destroy_into_raw();
2207
+ ptr3 = fee_proving_key.__destroy_into_raw();
2299
2208
  }
2300
- let ptr7 = 0;
2209
+ let ptr4 = 0;
2301
2210
  if (!isLikeNone(fee_verifying_key)) {
2302
2211
  _assertClass(fee_verifying_key, VerifyingKey);
2303
- ptr7 = fee_verifying_key.__destroy_into_raw();
2212
+ ptr4 = fee_verifying_key.__destroy_into_raw();
2304
2213
  }
2305
- let ptr8 = 0;
2214
+ let ptr5 = 0;
2306
2215
  if (!isLikeNone(offline_query)) {
2307
2216
  _assertClass(offline_query, OfflineQuery);
2308
- ptr8 = offline_query.__destroy_into_raw();
2217
+ ptr5 = offline_query.__destroy_into_raw();
2309
2218
  }
2310
- const ret = wasm.programmanager_buildJoinTransaction(private_key.__wbg_ptr, ptr0, ptr1, fee_credits, ptr2, ptr3, len3, ptr4, ptr5, ptr6, ptr7, ptr8);
2219
+ const ret = wasm.programmanager_buildDeploymentTransaction(private_key.__wbg_ptr, ptr0, len0, fee_credits, ptr1, ptr2, len2, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr3, ptr4, ptr5);
2311
2220
  return takeObject(ret);
2312
2221
  }
2313
2222
  /**
2314
- * Split an Aleo credits record into two separate records. This function does not require a fee.
2315
- *
2316
- * @param private_key The private key of the sender
2317
- * @param split_amount The amount of the credit split. This amount will be subtracted from the
2318
- * value of the record and two new records will be created with the split amount and the remainder
2319
- * @param amount_record The record to split
2320
- * @param url The url of the Aleo network node to send the transaction to
2321
- * @param split_proving_key (optional) Provide a proving key to use for the split function
2322
- * @param split_verifying_key (optional) Provide a verifying key to use for the split function
2323
- * @returns {Transaction | Error} Transaction object
2324
- * @param {PrivateKey} private_key
2325
- * @param {number} split_amount
2326
- * @param {RecordPlaintext} amount_record
2327
- * @param {string | undefined} [url]
2328
- * @param {ProvingKey | undefined} [split_proving_key]
2329
- * @param {VerifyingKey | undefined} [split_verifying_key]
2330
- * @param {OfflineQuery | undefined} [offline_query]
2331
- * @returns {Promise<Transaction>}
2332
- */
2333
- static buildSplitTransaction(private_key, split_amount, amount_record, url, split_proving_key, split_verifying_key, offline_query) {
2334
- _assertClass(private_key, PrivateKey);
2335
- _assertClass(amount_record, RecordPlaintext);
2336
- var ptr0 = amount_record.__destroy_into_raw();
2337
- var ptr1 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2338
- var len1 = WASM_VECTOR_LEN;
2339
- let ptr2 = 0;
2340
- if (!isLikeNone(split_proving_key)) {
2341
- _assertClass(split_proving_key, ProvingKey);
2342
- ptr2 = split_proving_key.__destroy_into_raw();
2343
- }
2344
- let ptr3 = 0;
2345
- if (!isLikeNone(split_verifying_key)) {
2346
- _assertClass(split_verifying_key, VerifyingKey);
2347
- ptr3 = split_verifying_key.__destroy_into_raw();
2348
- }
2349
- let ptr4 = 0;
2350
- if (!isLikeNone(offline_query)) {
2351
- _assertClass(offline_query, OfflineQuery);
2352
- ptr4 = offline_query.__destroy_into_raw();
2353
- }
2354
- const ret = wasm.programmanager_buildSplitTransaction(private_key.__wbg_ptr, split_amount, ptr0, ptr1, len1, ptr2, ptr3, ptr4);
2355
- return takeObject(ret);
2356
- }
2357
- /**
2358
- * Send credits from one Aleo account to another
2359
- *
2360
- * @param private_key The private key of the sender
2361
- * @param amount_credits The amount of credits to send
2362
- * @param recipient The recipient of the transaction
2363
- * @param transfer_type The type of the transfer (options: "private", "public", "private_to_public", "public_to_private")
2364
- * @param amount_record The record to fund the amount from
2365
- * @param fee_credits The amount of credits to pay as a fee
2366
- * @param fee_record The record to spend the fee from
2367
- * @param url The url of the Aleo network node to send the transaction to
2368
- * @param transfer_verifying_key (optional) Provide a verifying key to use for the transfer
2369
- * function
2370
- * @param fee_proving_key (optional) Provide a proving key to use for the fee execution
2371
- * @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
2372
- * @returns {Transaction | Error}
2373
- * @param {PrivateKey} private_key
2374
- * @param {number} amount_credits
2375
- * @param {string} recipient
2376
- * @param {string} transfer_type
2377
- * @param {RecordPlaintext | undefined} amount_record
2378
- * @param {number} fee_credits
2379
- * @param {RecordPlaintext | undefined} [fee_record]
2380
- * @param {string | undefined} [url]
2381
- * @param {ProvingKey | undefined} [transfer_proving_key]
2382
- * @param {VerifyingKey | undefined} [transfer_verifying_key]
2383
- * @param {ProvingKey | undefined} [fee_proving_key]
2384
- * @param {VerifyingKey | undefined} [fee_verifying_key]
2385
- * @param {OfflineQuery | undefined} [offline_query]
2386
- * @returns {Promise<Transaction>}
2387
- */
2388
- static buildTransferTransaction(private_key, amount_credits, recipient, transfer_type, amount_record, fee_credits, fee_record, url, transfer_proving_key, transfer_verifying_key, fee_proving_key, fee_verifying_key, offline_query) {
2389
- _assertClass(private_key, PrivateKey);
2390
- const ptr0 = passStringToWasm0(recipient, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2391
- const len0 = WASM_VECTOR_LEN;
2392
- const ptr1 = passStringToWasm0(transfer_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2393
- const len1 = WASM_VECTOR_LEN;
2394
- let ptr2 = 0;
2395
- if (!isLikeNone(amount_record)) {
2396
- _assertClass(amount_record, RecordPlaintext);
2397
- ptr2 = amount_record.__destroy_into_raw();
2398
- }
2399
- let ptr3 = 0;
2400
- if (!isLikeNone(fee_record)) {
2401
- _assertClass(fee_record, RecordPlaintext);
2402
- ptr3 = fee_record.__destroy_into_raw();
2403
- }
2404
- var ptr4 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2405
- var len4 = WASM_VECTOR_LEN;
2406
- let ptr5 = 0;
2407
- if (!isLikeNone(transfer_proving_key)) {
2408
- _assertClass(transfer_proving_key, ProvingKey);
2409
- ptr5 = transfer_proving_key.__destroy_into_raw();
2410
- }
2411
- let ptr6 = 0;
2412
- if (!isLikeNone(transfer_verifying_key)) {
2413
- _assertClass(transfer_verifying_key, VerifyingKey);
2414
- ptr6 = transfer_verifying_key.__destroy_into_raw();
2415
- }
2416
- let ptr7 = 0;
2417
- if (!isLikeNone(fee_proving_key)) {
2418
- _assertClass(fee_proving_key, ProvingKey);
2419
- ptr7 = fee_proving_key.__destroy_into_raw();
2420
- }
2421
- let ptr8 = 0;
2422
- if (!isLikeNone(fee_verifying_key)) {
2423
- _assertClass(fee_verifying_key, VerifyingKey);
2424
- ptr8 = fee_verifying_key.__destroy_into_raw();
2425
- }
2426
- let ptr9 = 0;
2427
- if (!isLikeNone(offline_query)) {
2428
- _assertClass(offline_query, OfflineQuery);
2429
- ptr9 = offline_query.__destroy_into_raw();
2430
- }
2431
- const ret = wasm.programmanager_buildTransferTransaction(private_key.__wbg_ptr, amount_credits, ptr0, len0, ptr1, len1, ptr2, fee_credits, ptr3, ptr4, len4, ptr5, ptr6, ptr7, ptr8, ptr9);
2432
- return takeObject(ret);
2433
- }
2434
- /**
2435
- * Deploy an Aleo program
2436
- *
2437
- * @param private_key The private key of the sender
2438
- * @param program The source code of the program being deployed
2439
- * @param imports A javascript object holding the source code of any imported programs in the
2440
- * form \{"program_name1": "program_source_code", "program_name2": "program_source_code", ..\}.
2441
- * Note that all imported programs must be deployed on chain before the main program in order
2442
- * for the deployment to succeed
2443
- * @param fee_credits The amount of credits to pay as a fee
2444
- * @param fee_record The record to spend the fee from
2445
- * @param url The url of the Aleo network node to send the transaction to
2446
- * @param imports (optional) Provide a list of imports to use for the program deployment in the
2447
- * form of a javascript object where the keys are a string of the program name and the values
2448
- * are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
2449
- * @param fee_proving_key (optional) Provide a proving key to use for the fee execution
2450
- * @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
2451
- * @returns {Transaction | Error}
2452
- * @param {PrivateKey} private_key
2453
- * @param {string} program
2454
- * @param {number} fee_credits
2455
- * @param {RecordPlaintext | undefined} [fee_record]
2456
- * @param {string | undefined} [url]
2457
- * @param {object | undefined} [imports]
2458
- * @param {ProvingKey | undefined} [fee_proving_key]
2459
- * @param {VerifyingKey | undefined} [fee_verifying_key]
2460
- * @param {OfflineQuery | undefined} [offline_query]
2461
- * @returns {Promise<Transaction>}
2462
- */
2463
- static buildDeploymentTransaction(private_key, program, fee_credits, fee_record, url, imports, fee_proving_key, fee_verifying_key, offline_query) {
2464
- _assertClass(private_key, PrivateKey);
2465
- const ptr0 = passStringToWasm0(program, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2466
- const len0 = WASM_VECTOR_LEN;
2467
- let ptr1 = 0;
2468
- if (!isLikeNone(fee_record)) {
2469
- _assertClass(fee_record, RecordPlaintext);
2470
- ptr1 = fee_record.__destroy_into_raw();
2471
- }
2472
- var ptr2 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2473
- var len2 = WASM_VECTOR_LEN;
2474
- let ptr3 = 0;
2475
- if (!isLikeNone(fee_proving_key)) {
2476
- _assertClass(fee_proving_key, ProvingKey);
2477
- ptr3 = fee_proving_key.__destroy_into_raw();
2478
- }
2479
- let ptr4 = 0;
2480
- if (!isLikeNone(fee_verifying_key)) {
2481
- _assertClass(fee_verifying_key, VerifyingKey);
2482
- ptr4 = fee_verifying_key.__destroy_into_raw();
2483
- }
2484
- let ptr5 = 0;
2485
- if (!isLikeNone(offline_query)) {
2486
- _assertClass(offline_query, OfflineQuery);
2487
- ptr5 = offline_query.__destroy_into_raw();
2488
- }
2489
- const ret = wasm.programmanager_buildDeploymentTransaction(private_key.__wbg_ptr, ptr0, len0, fee_credits, ptr1, ptr2, len2, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr3, ptr4, ptr5);
2490
- return takeObject(ret);
2491
- }
2492
- /**
2493
- * Estimate the fee for a program deployment
2223
+ * Estimate the fee for a program deployment
2494
2224
  *
2495
2225
  * Disclaimer: Fee estimation is experimental and may not represent a correct estimate on any current or future network
2496
2226
  *
@@ -2527,9 +2257,9 @@ export class ProgramManager {
2527
2257
  const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2528
2258
  const len0 = WASM_VECTOR_LEN;
2529
2259
  wasm.programmanager_estimateProgramNameCost(retptr, ptr0, len0);
2530
- var r0 = getBigInt64Memory0()[retptr / 8 + 0];
2531
- var r2 = getInt32Memory0()[retptr / 4 + 2];
2532
- var r3 = getInt32Memory0()[retptr / 4 + 3];
2260
+ var r0 = getDataViewMemory0().getBigInt64(retptr + 8 * 0, true);
2261
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2262
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2533
2263
  if (r3) {
2534
2264
  throw takeObject(r2);
2535
2265
  }
@@ -2773,9 +2503,9 @@ export class ProgramManager {
2773
2503
  const ptr1 = passStringToWasm0(_function, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2774
2504
  const len1 = WASM_VECTOR_LEN;
2775
2505
  wasm.programmanager_estimateFinalizeFee(retptr, ptr0, len0, ptr1, len1);
2776
- var r0 = getBigInt64Memory0()[retptr / 8 + 0];
2777
- var r2 = getInt32Memory0()[retptr / 4 + 2];
2778
- var r3 = getInt32Memory0()[retptr / 4 + 3];
2506
+ var r0 = getDataViewMemory0().getBigInt64(retptr + 8 * 0, true);
2507
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2508
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2779
2509
  if (r3) {
2780
2510
  throw takeObject(r2);
2781
2511
  }
@@ -2784,51 +2514,264 @@ export class ProgramManager {
2784
2514
  wasm.__wbindgen_add_to_stack_pointer(16);
2785
2515
  }
2786
2516
  }
2787
- }
2788
-
2789
- const ProvingKeyFinalization = (typeof FinalizationRegistry === 'undefined')
2790
- ? { register: () => {}, unregister: () => {} }
2791
- : new FinalizationRegistry(ptr => wasm.__wbg_provingkey_free(ptr >>> 0));
2792
- /**
2793
- * Proving key for a function within an Aleo program
2794
- */
2795
- export class ProvingKey {
2796
-
2797
- static __wrap(ptr) {
2798
- ptr = ptr >>> 0;
2799
- const obj = Object.create(ProvingKey.prototype);
2800
- obj.__wbg_ptr = ptr;
2801
- ProvingKeyFinalization.register(obj, obj.__wbg_ptr, obj);
2802
- return obj;
2803
- }
2804
-
2805
- __destroy_into_raw() {
2806
- const ptr = this.__wbg_ptr;
2807
- this.__wbg_ptr = 0;
2808
- ProvingKeyFinalization.unregister(this);
2809
- return ptr;
2810
- }
2811
-
2812
- free() {
2813
- const ptr = this.__destroy_into_raw();
2814
- wasm.__wbg_provingkey_free(ptr);
2815
- }
2816
2517
  /**
2817
- * Verify if the proving key is for the bond_public function
2818
- *
2819
- * @example
2820
- * const provingKey = ProvingKey.fromBytes("bond_public_proving_key.bin");
2821
- * provingKey.isBondPublicProver() ? console.log("Key verified") : throw new Error("Invalid key");
2518
+ * Join two records together to create a new record with an amount of credits equal to the sum
2519
+ * of the credits of the two original records
2822
2520
  *
2823
- * @returns {boolean} returns true if the proving key is for the bond_public function, false if otherwise
2824
- * @returns {boolean}
2521
+ * @param private_key The private key of the sender
2522
+ * @param record_1 The first record to combine
2523
+ * @param record_2 The second record to combine
2524
+ * @param fee_credits The amount of credits to pay as a fee
2525
+ * @param fee_record The record to spend the fee from
2526
+ * @param url The url of the Aleo network node to send the transaction to
2527
+ * @param join_proving_key (optional) Provide a proving key to use for the join function
2528
+ * @param join_verifying_key (optional) Provide a verifying key to use for the join function
2529
+ * @param fee_proving_key (optional) Provide a proving key to use for the fee execution
2530
+ * @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
2531
+ * @returns {Transaction | Error} Transaction object
2532
+ * @param {PrivateKey} private_key
2533
+ * @param {RecordPlaintext} record_1
2534
+ * @param {RecordPlaintext} record_2
2535
+ * @param {number} fee_credits
2536
+ * @param {RecordPlaintext | undefined} [fee_record]
2537
+ * @param {string | undefined} [url]
2538
+ * @param {ProvingKey | undefined} [join_proving_key]
2539
+ * @param {VerifyingKey | undefined} [join_verifying_key]
2540
+ * @param {ProvingKey | undefined} [fee_proving_key]
2541
+ * @param {VerifyingKey | undefined} [fee_verifying_key]
2542
+ * @param {OfflineQuery | undefined} [offline_query]
2543
+ * @returns {Promise<Transaction>}
2825
2544
  */
2826
- isBondPublicProver() {
2827
- const ret = wasm.provingkey_isBondPublicProver(this.__wbg_ptr);
2828
- return ret !== 0;
2545
+ static buildJoinTransaction(private_key, record_1, record_2, fee_credits, fee_record, url, join_proving_key, join_verifying_key, fee_proving_key, fee_verifying_key, offline_query) {
2546
+ _assertClass(private_key, PrivateKey);
2547
+ _assertClass(record_1, RecordPlaintext);
2548
+ var ptr0 = record_1.__destroy_into_raw();
2549
+ _assertClass(record_2, RecordPlaintext);
2550
+ var ptr1 = record_2.__destroy_into_raw();
2551
+ let ptr2 = 0;
2552
+ if (!isLikeNone(fee_record)) {
2553
+ _assertClass(fee_record, RecordPlaintext);
2554
+ ptr2 = fee_record.__destroy_into_raw();
2555
+ }
2556
+ var ptr3 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2557
+ var len3 = WASM_VECTOR_LEN;
2558
+ let ptr4 = 0;
2559
+ if (!isLikeNone(join_proving_key)) {
2560
+ _assertClass(join_proving_key, ProvingKey);
2561
+ ptr4 = join_proving_key.__destroy_into_raw();
2562
+ }
2563
+ let ptr5 = 0;
2564
+ if (!isLikeNone(join_verifying_key)) {
2565
+ _assertClass(join_verifying_key, VerifyingKey);
2566
+ ptr5 = join_verifying_key.__destroy_into_raw();
2567
+ }
2568
+ let ptr6 = 0;
2569
+ if (!isLikeNone(fee_proving_key)) {
2570
+ _assertClass(fee_proving_key, ProvingKey);
2571
+ ptr6 = fee_proving_key.__destroy_into_raw();
2572
+ }
2573
+ let ptr7 = 0;
2574
+ if (!isLikeNone(fee_verifying_key)) {
2575
+ _assertClass(fee_verifying_key, VerifyingKey);
2576
+ ptr7 = fee_verifying_key.__destroy_into_raw();
2577
+ }
2578
+ let ptr8 = 0;
2579
+ if (!isLikeNone(offline_query)) {
2580
+ _assertClass(offline_query, OfflineQuery);
2581
+ ptr8 = offline_query.__destroy_into_raw();
2582
+ }
2583
+ const ret = wasm.programmanager_buildJoinTransaction(private_key.__wbg_ptr, ptr0, ptr1, fee_credits, ptr2, ptr3, len3, ptr4, ptr5, ptr6, ptr7, ptr8);
2584
+ return takeObject(ret);
2829
2585
  }
2830
2586
  /**
2831
- * Verify if the proving key is for the bond_validator function
2587
+ * Split an Aleo credits record into two separate records. This function does not require a fee.
2588
+ *
2589
+ * @param private_key The private key of the sender
2590
+ * @param split_amount The amount of the credit split. This amount will be subtracted from the
2591
+ * value of the record and two new records will be created with the split amount and the remainder
2592
+ * @param amount_record The record to split
2593
+ * @param url The url of the Aleo network node to send the transaction to
2594
+ * @param split_proving_key (optional) Provide a proving key to use for the split function
2595
+ * @param split_verifying_key (optional) Provide a verifying key to use for the split function
2596
+ * @returns {Transaction | Error} Transaction object
2597
+ * @param {PrivateKey} private_key
2598
+ * @param {number} split_amount
2599
+ * @param {RecordPlaintext} amount_record
2600
+ * @param {string | undefined} [url]
2601
+ * @param {ProvingKey | undefined} [split_proving_key]
2602
+ * @param {VerifyingKey | undefined} [split_verifying_key]
2603
+ * @param {OfflineQuery | undefined} [offline_query]
2604
+ * @returns {Promise<Transaction>}
2605
+ */
2606
+ static buildSplitTransaction(private_key, split_amount, amount_record, url, split_proving_key, split_verifying_key, offline_query) {
2607
+ _assertClass(private_key, PrivateKey);
2608
+ _assertClass(amount_record, RecordPlaintext);
2609
+ var ptr0 = amount_record.__destroy_into_raw();
2610
+ var ptr1 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2611
+ var len1 = WASM_VECTOR_LEN;
2612
+ let ptr2 = 0;
2613
+ if (!isLikeNone(split_proving_key)) {
2614
+ _assertClass(split_proving_key, ProvingKey);
2615
+ ptr2 = split_proving_key.__destroy_into_raw();
2616
+ }
2617
+ let ptr3 = 0;
2618
+ if (!isLikeNone(split_verifying_key)) {
2619
+ _assertClass(split_verifying_key, VerifyingKey);
2620
+ ptr3 = split_verifying_key.__destroy_into_raw();
2621
+ }
2622
+ let ptr4 = 0;
2623
+ if (!isLikeNone(offline_query)) {
2624
+ _assertClass(offline_query, OfflineQuery);
2625
+ ptr4 = offline_query.__destroy_into_raw();
2626
+ }
2627
+ const ret = wasm.programmanager_buildSplitTransaction(private_key.__wbg_ptr, split_amount, ptr0, ptr1, len1, ptr2, ptr3, ptr4);
2628
+ return takeObject(ret);
2629
+ }
2630
+ /**
2631
+ * Send credits from one Aleo account to another
2632
+ *
2633
+ * @param private_key The private key of the sender
2634
+ * @param amount_credits The amount of credits to send
2635
+ * @param recipient The recipient of the transaction
2636
+ * @param transfer_type The type of the transfer (options: "private", "public", "private_to_public", "public_to_private")
2637
+ * @param amount_record The record to fund the amount from
2638
+ * @param fee_credits The amount of credits to pay as a fee
2639
+ * @param fee_record The record to spend the fee from
2640
+ * @param url The url of the Aleo network node to send the transaction to
2641
+ * @param transfer_verifying_key (optional) Provide a verifying key to use for the transfer
2642
+ * function
2643
+ * @param fee_proving_key (optional) Provide a proving key to use for the fee execution
2644
+ * @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
2645
+ * @returns {Transaction | Error}
2646
+ * @param {PrivateKey} private_key
2647
+ * @param {number} amount_credits
2648
+ * @param {string} recipient
2649
+ * @param {string} transfer_type
2650
+ * @param {RecordPlaintext | undefined} amount_record
2651
+ * @param {number} fee_credits
2652
+ * @param {RecordPlaintext | undefined} [fee_record]
2653
+ * @param {string | undefined} [url]
2654
+ * @param {ProvingKey | undefined} [transfer_proving_key]
2655
+ * @param {VerifyingKey | undefined} [transfer_verifying_key]
2656
+ * @param {ProvingKey | undefined} [fee_proving_key]
2657
+ * @param {VerifyingKey | undefined} [fee_verifying_key]
2658
+ * @param {OfflineQuery | undefined} [offline_query]
2659
+ * @returns {Promise<Transaction>}
2660
+ */
2661
+ static buildTransferTransaction(private_key, amount_credits, recipient, transfer_type, amount_record, fee_credits, fee_record, url, transfer_proving_key, transfer_verifying_key, fee_proving_key, fee_verifying_key, offline_query) {
2662
+ _assertClass(private_key, PrivateKey);
2663
+ const ptr0 = passStringToWasm0(recipient, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2664
+ const len0 = WASM_VECTOR_LEN;
2665
+ const ptr1 = passStringToWasm0(transfer_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2666
+ const len1 = WASM_VECTOR_LEN;
2667
+ let ptr2 = 0;
2668
+ if (!isLikeNone(amount_record)) {
2669
+ _assertClass(amount_record, RecordPlaintext);
2670
+ ptr2 = amount_record.__destroy_into_raw();
2671
+ }
2672
+ let ptr3 = 0;
2673
+ if (!isLikeNone(fee_record)) {
2674
+ _assertClass(fee_record, RecordPlaintext);
2675
+ ptr3 = fee_record.__destroy_into_raw();
2676
+ }
2677
+ var ptr4 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2678
+ var len4 = WASM_VECTOR_LEN;
2679
+ let ptr5 = 0;
2680
+ if (!isLikeNone(transfer_proving_key)) {
2681
+ _assertClass(transfer_proving_key, ProvingKey);
2682
+ ptr5 = transfer_proving_key.__destroy_into_raw();
2683
+ }
2684
+ let ptr6 = 0;
2685
+ if (!isLikeNone(transfer_verifying_key)) {
2686
+ _assertClass(transfer_verifying_key, VerifyingKey);
2687
+ ptr6 = transfer_verifying_key.__destroy_into_raw();
2688
+ }
2689
+ let ptr7 = 0;
2690
+ if (!isLikeNone(fee_proving_key)) {
2691
+ _assertClass(fee_proving_key, ProvingKey);
2692
+ ptr7 = fee_proving_key.__destroy_into_raw();
2693
+ }
2694
+ let ptr8 = 0;
2695
+ if (!isLikeNone(fee_verifying_key)) {
2696
+ _assertClass(fee_verifying_key, VerifyingKey);
2697
+ ptr8 = fee_verifying_key.__destroy_into_raw();
2698
+ }
2699
+ let ptr9 = 0;
2700
+ if (!isLikeNone(offline_query)) {
2701
+ _assertClass(offline_query, OfflineQuery);
2702
+ ptr9 = offline_query.__destroy_into_raw();
2703
+ }
2704
+ const ret = wasm.programmanager_buildTransferTransaction(private_key.__wbg_ptr, amount_credits, ptr0, len0, ptr1, len1, ptr2, fee_credits, ptr3, ptr4, len4, ptr5, ptr6, ptr7, ptr8, ptr9);
2705
+ return takeObject(ret);
2706
+ }
2707
+ /**
2708
+ * Synthesize proving and verifying keys for a program
2709
+ *
2710
+ * @param program {string} The program source code of the program to synthesize keys for
2711
+ * @param function_id {string} The function to synthesize keys for
2712
+ * @param inputs {Array} The inputs to the function
2713
+ * @param imports {Object | undefined} The imports for the program
2714
+ * @param {PrivateKey} private_key
2715
+ * @param {string} program
2716
+ * @param {string} function_id
2717
+ * @param {Array<any>} inputs
2718
+ * @param {object | undefined} [imports]
2719
+ * @returns {Promise<KeyPair>}
2720
+ */
2721
+ static synthesizeKeyPair(private_key, program, function_id, inputs, imports) {
2722
+ _assertClass(private_key, PrivateKey);
2723
+ const ptr0 = passStringToWasm0(program, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2724
+ const len0 = WASM_VECTOR_LEN;
2725
+ const ptr1 = passStringToWasm0(function_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2726
+ const len1 = WASM_VECTOR_LEN;
2727
+ const ret = wasm.programmanager_synthesizeKeyPair(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), isLikeNone(imports) ? 0 : addHeapObject(imports));
2728
+ return takeObject(ret);
2729
+ }
2730
+ }
2731
+
2732
+ const ProvingKeyFinalization = (typeof FinalizationRegistry === 'undefined')
2733
+ ? { register: () => {}, unregister: () => {} }
2734
+ : new FinalizationRegistry(ptr => wasm.__wbg_provingkey_free(ptr >>> 0, 1));
2735
+ /**
2736
+ * Proving key for a function within an Aleo program
2737
+ */
2738
+ class ProvingKey {
2739
+
2740
+ static __wrap(ptr) {
2741
+ ptr = ptr >>> 0;
2742
+ const obj = Object.create(ProvingKey.prototype);
2743
+ obj.__wbg_ptr = ptr;
2744
+ ProvingKeyFinalization.register(obj, obj.__wbg_ptr, obj);
2745
+ return obj;
2746
+ }
2747
+
2748
+ __destroy_into_raw() {
2749
+ const ptr = this.__wbg_ptr;
2750
+ this.__wbg_ptr = 0;
2751
+ ProvingKeyFinalization.unregister(this);
2752
+ return ptr;
2753
+ }
2754
+
2755
+ free() {
2756
+ const ptr = this.__destroy_into_raw();
2757
+ wasm.__wbg_provingkey_free(ptr, 0);
2758
+ }
2759
+ /**
2760
+ * Verify if the proving key is for the bond_public function
2761
+ *
2762
+ * @example
2763
+ * const provingKey = ProvingKey.fromBytes("bond_public_proving_key.bin");
2764
+ * provingKey.isBondPublicProver() ? console.log("Key verified") : throw new Error("Invalid key");
2765
+ *
2766
+ * @returns {boolean} returns true if the proving key is for the bond_public function, false if otherwise
2767
+ * @returns {boolean}
2768
+ */
2769
+ isBondPublicProver() {
2770
+ const ret = wasm.provingkey_isBondPublicProver(this.__wbg_ptr);
2771
+ return ret !== 0;
2772
+ }
2773
+ /**
2774
+ * Verify if the proving key is for the bond_validator function
2832
2775
  *
2833
2776
  * @example
2834
2777
  * const provingKey = ProvingKey.fromBytes("bond_validator_proving_key.bin");
@@ -3035,8 +2978,8 @@ export class ProvingKey {
3035
2978
  try {
3036
2979
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3037
2980
  wasm.provingkey_checksum(retptr, this.__wbg_ptr);
3038
- var r0 = getInt32Memory0()[retptr / 4 + 0];
3039
- var r1 = getInt32Memory0()[retptr / 4 + 1];
2981
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2982
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3040
2983
  deferred1_0 = r0;
3041
2984
  deferred1_1 = r1;
3042
2985
  return getStringFromWasm0(r0, r1);
@@ -3069,9 +3012,9 @@ export class ProvingKey {
3069
3012
  const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
3070
3013
  const len0 = WASM_VECTOR_LEN;
3071
3014
  wasm.provingkey_fromBytes(retptr, ptr0, len0);
3072
- var r0 = getInt32Memory0()[retptr / 4 + 0];
3073
- var r1 = getInt32Memory0()[retptr / 4 + 1];
3074
- var r2 = getInt32Memory0()[retptr / 4 + 2];
3015
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3016
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3017
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3075
3018
  if (r2) {
3076
3019
  throw takeObject(r1);
3077
3020
  }
@@ -3093,9 +3036,9 @@ export class ProvingKey {
3093
3036
  const ptr0 = passStringToWasm0(string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3094
3037
  const len0 = WASM_VECTOR_LEN;
3095
3038
  wasm.provingkey_fromString(retptr, ptr0, len0);
3096
- var r0 = getInt32Memory0()[retptr / 4 + 0];
3097
- var r1 = getInt32Memory0()[retptr / 4 + 1];
3098
- var r2 = getInt32Memory0()[retptr / 4 + 2];
3039
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3040
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3041
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3099
3042
  if (r2) {
3100
3043
  throw takeObject(r1);
3101
3044
  }
@@ -3114,10 +3057,10 @@ export class ProvingKey {
3114
3057
  try {
3115
3058
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3116
3059
  wasm.provingkey_toBytes(retptr, this.__wbg_ptr);
3117
- var r0 = getInt32Memory0()[retptr / 4 + 0];
3118
- var r1 = getInt32Memory0()[retptr / 4 + 1];
3119
- var r2 = getInt32Memory0()[retptr / 4 + 2];
3120
- var r3 = getInt32Memory0()[retptr / 4 + 3];
3060
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3061
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3062
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3063
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
3121
3064
  if (r3) {
3122
3065
  throw takeObject(r2);
3123
3066
  }
@@ -3140,8 +3083,8 @@ export class ProvingKey {
3140
3083
  try {
3141
3084
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3142
3085
  wasm.provingkey_toString(retptr, this.__wbg_ptr);
3143
- var r0 = getInt32Memory0()[retptr / 4 + 0];
3144
- var r1 = getInt32Memory0()[retptr / 4 + 1];
3086
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3087
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3145
3088
  deferred1_0 = r0;
3146
3089
  deferred1_1 = r1;
3147
3090
  return getStringFromWasm0(r0, r1);
@@ -3154,11 +3097,11 @@ export class ProvingKey {
3154
3097
 
3155
3098
  const RecordCiphertextFinalization = (typeof FinalizationRegistry === 'undefined')
3156
3099
  ? { register: () => {}, unregister: () => {} }
3157
- : new FinalizationRegistry(ptr => wasm.__wbg_recordciphertext_free(ptr >>> 0));
3100
+ : new FinalizationRegistry(ptr => wasm.__wbg_recordciphertext_free(ptr >>> 0, 1));
3158
3101
  /**
3159
3102
  * Encrypted Aleo record
3160
3103
  */
3161
- export class RecordCiphertext {
3104
+ class RecordCiphertext {
3162
3105
 
3163
3106
  static __wrap(ptr) {
3164
3107
  ptr = ptr >>> 0;
@@ -3177,7 +3120,7 @@ export class RecordCiphertext {
3177
3120
 
3178
3121
  free() {
3179
3122
  const ptr = this.__destroy_into_raw();
3180
- wasm.__wbg_recordciphertext_free(ptr);
3123
+ wasm.__wbg_recordciphertext_free(ptr, 0);
3181
3124
  }
3182
3125
  /**
3183
3126
  * Create a record ciphertext from a string
@@ -3193,9 +3136,9 @@ export class RecordCiphertext {
3193
3136
  const ptr0 = passStringToWasm0(record, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3194
3137
  const len0 = WASM_VECTOR_LEN;
3195
3138
  wasm.recordciphertext_fromString(retptr, ptr0, len0);
3196
- var r0 = getInt32Memory0()[retptr / 4 + 0];
3197
- var r1 = getInt32Memory0()[retptr / 4 + 1];
3198
- var r2 = getInt32Memory0()[retptr / 4 + 2];
3139
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3140
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3141
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3199
3142
  if (r2) {
3200
3143
  throw takeObject(r1);
3201
3144
  }
@@ -3216,8 +3159,8 @@ export class RecordCiphertext {
3216
3159
  try {
3217
3160
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3218
3161
  wasm.recordciphertext_toString(retptr, this.__wbg_ptr);
3219
- var r0 = getInt32Memory0()[retptr / 4 + 0];
3220
- var r1 = getInt32Memory0()[retptr / 4 + 1];
3162
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3163
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3221
3164
  deferred1_0 = r0;
3222
3165
  deferred1_1 = r1;
3223
3166
  return getStringFromWasm0(r0, r1);
@@ -3240,9 +3183,9 @@ export class RecordCiphertext {
3240
3183
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3241
3184
  _assertClass(view_key, ViewKey);
3242
3185
  wasm.recordciphertext_decrypt(retptr, this.__wbg_ptr, view_key.__wbg_ptr);
3243
- var r0 = getInt32Memory0()[retptr / 4 + 0];
3244
- var r1 = getInt32Memory0()[retptr / 4 + 1];
3245
- var r2 = getInt32Memory0()[retptr / 4 + 2];
3186
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3187
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3188
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3246
3189
  if (r2) {
3247
3190
  throw takeObject(r1);
3248
3191
  }
@@ -3268,11 +3211,11 @@ export class RecordCiphertext {
3268
3211
 
3269
3212
  const RecordPlaintextFinalization = (typeof FinalizationRegistry === 'undefined')
3270
3213
  ? { register: () => {}, unregister: () => {} }
3271
- : new FinalizationRegistry(ptr => wasm.__wbg_recordplaintext_free(ptr >>> 0));
3214
+ : new FinalizationRegistry(ptr => wasm.__wbg_recordplaintext_free(ptr >>> 0, 1));
3272
3215
  /**
3273
3216
  * Plaintext representation of an Aleo record
3274
3217
  */
3275
- export class RecordPlaintext {
3218
+ class RecordPlaintext {
3276
3219
 
3277
3220
  static __wrap(ptr) {
3278
3221
  ptr = ptr >>> 0;
@@ -3291,7 +3234,7 @@ export class RecordPlaintext {
3291
3234
 
3292
3235
  free() {
3293
3236
  const ptr = this.__destroy_into_raw();
3294
- wasm.__wbg_recordplaintext_free(ptr);
3237
+ wasm.__wbg_recordplaintext_free(ptr, 0);
3295
3238
  }
3296
3239
  /**
3297
3240
  * @param {string} program_id
@@ -3306,9 +3249,9 @@ export class RecordPlaintext {
3306
3249
  const ptr1 = passStringToWasm0(record_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3307
3250
  const len1 = WASM_VECTOR_LEN;
3308
3251
  wasm.recordplaintext_commitment(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
3309
- var r0 = getInt32Memory0()[retptr / 4 + 0];
3310
- var r1 = getInt32Memory0()[retptr / 4 + 1];
3311
- var r2 = getInt32Memory0()[retptr / 4 + 2];
3252
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3253
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3254
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3312
3255
  if (r2) {
3313
3256
  throw takeObject(r1);
3314
3257
  }
@@ -3331,9 +3274,9 @@ export class RecordPlaintext {
3331
3274
  const ptr0 = passStringToWasm0(record, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3332
3275
  const len0 = WASM_VECTOR_LEN;
3333
3276
  wasm.recordplaintext_fromString(retptr, ptr0, len0);
3334
- var r0 = getInt32Memory0()[retptr / 4 + 0];
3335
- var r1 = getInt32Memory0()[retptr / 4 + 1];
3336
- var r2 = getInt32Memory0()[retptr / 4 + 2];
3277
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3278
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3279
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3337
3280
  if (r2) {
3338
3281
  throw takeObject(r1);
3339
3282
  }
@@ -3354,8 +3297,8 @@ export class RecordPlaintext {
3354
3297
  try {
3355
3298
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3356
3299
  wasm.recordplaintext_toString(retptr, this.__wbg_ptr);
3357
- var r0 = getInt32Memory0()[retptr / 4 + 0];
3358
- var r1 = getInt32Memory0()[retptr / 4 + 1];
3300
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3301
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3359
3302
  deferred1_0 = r0;
3360
3303
  deferred1_1 = r1;
3361
3304
  return getStringFromWasm0(r0, r1);
@@ -3386,8 +3329,8 @@ export class RecordPlaintext {
3386
3329
  try {
3387
3330
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3388
3331
  wasm.recordplaintext_nonce(retptr, this.__wbg_ptr);
3389
- var r0 = getInt32Memory0()[retptr / 4 + 0];
3390
- var r1 = getInt32Memory0()[retptr / 4 + 1];
3332
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3333
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3391
3334
  deferred1_0 = r0;
3392
3335
  deferred1_1 = r1;
3393
3336
  return getStringFromWasm0(r0, r1);
@@ -3419,10 +3362,10 @@ export class RecordPlaintext {
3419
3362
  const ptr1 = passStringToWasm0(record_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3420
3363
  const len1 = WASM_VECTOR_LEN;
3421
3364
  wasm.recordplaintext_serialNumberString(retptr, this.__wbg_ptr, private_key.__wbg_ptr, ptr0, len0, ptr1, len1);
3422
- var r0 = getInt32Memory0()[retptr / 4 + 0];
3423
- var r1 = getInt32Memory0()[retptr / 4 + 1];
3424
- var r2 = getInt32Memory0()[retptr / 4 + 2];
3425
- var r3 = getInt32Memory0()[retptr / 4 + 3];
3365
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3366
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3367
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3368
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
3426
3369
  var ptr3 = r0;
3427
3370
  var len3 = r1;
3428
3371
  if (r3) {
@@ -3441,11 +3384,11 @@ export class RecordPlaintext {
3441
3384
 
3442
3385
  const SignatureFinalization = (typeof FinalizationRegistry === 'undefined')
3443
3386
  ? { register: () => {}, unregister: () => {} }
3444
- : new FinalizationRegistry(ptr => wasm.__wbg_signature_free(ptr >>> 0));
3387
+ : new FinalizationRegistry(ptr => wasm.__wbg_signature_free(ptr >>> 0, 1));
3445
3388
  /**
3446
3389
  * Cryptographic signature of a message signed by an Aleo account
3447
3390
  */
3448
- export class Signature {
3391
+ class Signature {
3449
3392
 
3450
3393
  static __wrap(ptr) {
3451
3394
  ptr = ptr >>> 0;
@@ -3464,7 +3407,7 @@ export class Signature {
3464
3407
 
3465
3408
  free() {
3466
3409
  const ptr = this.__destroy_into_raw();
3467
- wasm.__wbg_signature_free(ptr);
3410
+ wasm.__wbg_signature_free(ptr, 0);
3468
3411
  }
3469
3412
  /**
3470
3413
  * Sign a message with a private key
@@ -3480,30 +3423,10 @@ export class Signature {
3480
3423
  _assertClass(private_key, PrivateKey);
3481
3424
  const ptr0 = passArray8ToWasm0(message, wasm.__wbindgen_malloc);
3482
3425
  const len0 = WASM_VECTOR_LEN;
3483
- const ret = wasm.signature_sign(private_key.__wbg_ptr, ptr0, len0);
3484
- return Signature.__wrap(ret);
3485
- }
3486
- /**
3487
- * @param {PrivateKey} private_key
3488
- * @param {Uint8Array} message
3489
- * @param {Uint8Array} seed
3490
- * @returns {Signature}
3491
- */
3492
- static sign_message(private_key, message, seed) {
3493
- _assertClass(private_key, PrivateKey);
3494
- const ptr0 = passArray8ToWasm0(message, wasm.__wbindgen_malloc);
3495
- const len0 = WASM_VECTOR_LEN;
3496
- const ptr1 = passArray8ToWasm0(seed, wasm.__wbindgen_malloc);
3497
- const len1 = WASM_VECTOR_LEN;
3498
- const ret = wasm.signature_sign_message(private_key.__wbg_ptr, ptr0, len0, ptr1, len1);
3426
+ const ret = wasm.privatekey_sign(private_key.__wbg_ptr, ptr0, len0);
3499
3427
  return Signature.__wrap(ret);
3500
3428
  }
3501
3429
  /**
3502
- * Ignore the mess below -- me testing things
3503
- * Turn a message into bits
3504
- *
3505
- * @param {Uint8Array} message Byte representation of the message to sign
3506
- * @returns {Vec<bool>} Vec of bool of the message
3507
3430
  * Verify a signature of a message with an address
3508
3431
  *
3509
3432
  * @param {Address} address The address to verify the signature with
@@ -3546,8 +3469,8 @@ export class Signature {
3546
3469
  try {
3547
3470
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3548
3471
  wasm.signature_to_string(retptr, this.__wbg_ptr);
3549
- var r0 = getInt32Memory0()[retptr / 4 + 0];
3550
- var r1 = getInt32Memory0()[retptr / 4 + 1];
3472
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3473
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3551
3474
  deferred1_0 = r0;
3552
3475
  deferred1_1 = r1;
3553
3476
  return getStringFromWasm0(r0, r1);
@@ -3560,14 +3483,14 @@ export class Signature {
3560
3483
 
3561
3484
  const TransactionFinalization = (typeof FinalizationRegistry === 'undefined')
3562
3485
  ? { register: () => {}, unregister: () => {} }
3563
- : new FinalizationRegistry(ptr => wasm.__wbg_transaction_free(ptr >>> 0));
3486
+ : new FinalizationRegistry(ptr => wasm.__wbg_transaction_free(ptr >>> 0, 1));
3564
3487
  /**
3565
3488
  * Webassembly Representation of an Aleo transaction
3566
3489
  *
3567
3490
  * This object is created when generating an on-chain function deployment or execution and is the
3568
3491
  * object that should be submitted to the Aleo Network in order to deploy or execute a function.
3569
3492
  */
3570
- export class Transaction {
3493
+ class Transaction {
3571
3494
 
3572
3495
  static __wrap(ptr) {
3573
3496
  ptr = ptr >>> 0;
@@ -3586,7 +3509,7 @@ export class Transaction {
3586
3509
 
3587
3510
  free() {
3588
3511
  const ptr = this.__destroy_into_raw();
3589
- wasm.__wbg_transaction_free(ptr);
3512
+ wasm.__wbg_transaction_free(ptr, 0);
3590
3513
  }
3591
3514
  /**
3592
3515
  * Create a transaction from a string
@@ -3602,9 +3525,9 @@ export class Transaction {
3602
3525
  const ptr0 = passStringToWasm0(transaction, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3603
3526
  const len0 = WASM_VECTOR_LEN;
3604
3527
  wasm.transaction_fromString(retptr, ptr0, len0);
3605
- var r0 = getInt32Memory0()[retptr / 4 + 0];
3606
- var r1 = getInt32Memory0()[retptr / 4 + 1];
3607
- var r2 = getInt32Memory0()[retptr / 4 + 2];
3528
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3529
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3530
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3608
3531
  if (r2) {
3609
3532
  throw takeObject(r1);
3610
3533
  }
@@ -3626,8 +3549,8 @@ export class Transaction {
3626
3549
  try {
3627
3550
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3628
3551
  wasm.transaction_toString(retptr, this.__wbg_ptr);
3629
- var r0 = getInt32Memory0()[retptr / 4 + 0];
3630
- var r1 = getInt32Memory0()[retptr / 4 + 1];
3552
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3553
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3631
3554
  deferred1_0 = r0;
3632
3555
  deferred1_1 = r1;
3633
3556
  return getStringFromWasm0(r0, r1);
@@ -3652,8 +3575,8 @@ export class Transaction {
3652
3575
  try {
3653
3576
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3654
3577
  wasm.transaction_transactionId(retptr, this.__wbg_ptr);
3655
- var r0 = getInt32Memory0()[retptr / 4 + 0];
3656
- var r1 = getInt32Memory0()[retptr / 4 + 1];
3578
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3579
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3657
3580
  deferred1_0 = r0;
3658
3581
  deferred1_1 = r1;
3659
3582
  return getStringFromWasm0(r0, r1);
@@ -3674,8 +3597,8 @@ export class Transaction {
3674
3597
  try {
3675
3598
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3676
3599
  wasm.transaction_transactionType(retptr, this.__wbg_ptr);
3677
- var r0 = getInt32Memory0()[retptr / 4 + 0];
3678
- var r1 = getInt32Memory0()[retptr / 4 + 1];
3600
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3601
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3679
3602
  deferred1_0 = r0;
3680
3603
  deferred1_1 = r1;
3681
3604
  return getStringFromWasm0(r0, r1);
@@ -3688,11 +3611,11 @@ export class Transaction {
3688
3611
 
3689
3612
  const VerifyingKeyFinalization = (typeof FinalizationRegistry === 'undefined')
3690
3613
  ? { register: () => {}, unregister: () => {} }
3691
- : new FinalizationRegistry(ptr => wasm.__wbg_verifyingkey_free(ptr >>> 0));
3614
+ : new FinalizationRegistry(ptr => wasm.__wbg_verifyingkey_free(ptr >>> 0, 1));
3692
3615
  /**
3693
3616
  * Verifying key for a function within an Aleo program
3694
3617
  */
3695
- export class VerifyingKey {
3618
+ class VerifyingKey {
3696
3619
 
3697
3620
  static __wrap(ptr) {
3698
3621
  ptr = ptr >>> 0;
@@ -3711,168 +3634,40 @@ export class VerifyingKey {
3711
3634
 
3712
3635
  free() {
3713
3636
  const ptr = this.__destroy_into_raw();
3714
- wasm.__wbg_verifyingkey_free(ptr);
3637
+ wasm.__wbg_verifyingkey_free(ptr, 0);
3715
3638
  }
3716
3639
  /**
3717
- * Get the checksum of the verifying key
3640
+ * Returns the verifying key for the bond_public function
3718
3641
  *
3719
- * @returns {string} Checksum of the verifying key
3720
- * @returns {string}
3642
+ * @returns {VerifyingKey} Verifying key for the bond_public function
3643
+ * @returns {VerifyingKey}
3721
3644
  */
3722
- checksum() {
3723
- let deferred1_0;
3724
- let deferred1_1;
3725
- try {
3726
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3727
- wasm.verifyingkey_checksum(retptr, this.__wbg_ptr);
3728
- var r0 = getInt32Memory0()[retptr / 4 + 0];
3729
- var r1 = getInt32Memory0()[retptr / 4 + 1];
3730
- deferred1_0 = r0;
3731
- deferred1_1 = r1;
3732
- return getStringFromWasm0(r0, r1);
3733
- } finally {
3734
- wasm.__wbindgen_add_to_stack_pointer(16);
3735
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
3736
- }
3645
+ static bondPublicVerifier() {
3646
+ const ret = wasm.verifyingkey_bondPublicVerifier();
3647
+ return VerifyingKey.__wrap(ret);
3737
3648
  }
3738
3649
  /**
3739
- * Create a copy of the verifying key
3650
+ * Returns the verifying key for the bond_validator function
3740
3651
  *
3741
- * @returns {VerifyingKey} A copy of the verifying key
3652
+ * @returns {VerifyingKey} Verifying key for the bond_validator function
3742
3653
  * @returns {VerifyingKey}
3743
3654
  */
3744
- copy() {
3745
- const ret = wasm.verifyingkey_copy(this.__wbg_ptr);
3655
+ static bondValidatorVerifier() {
3656
+ const ret = wasm.verifyingkey_bondValidatorVerifier();
3746
3657
  return VerifyingKey.__wrap(ret);
3747
3658
  }
3748
3659
  /**
3749
- * Construct a new verifying key from a byte array
3660
+ * Returns the verifying key for the claim_delegator function
3750
3661
  *
3751
- * @param {Uint8Array} bytes Byte representation of a verifying key
3752
- * @returns {VerifyingKey | Error}
3753
- * @param {Uint8Array} bytes
3662
+ * @returns {VerifyingKey} Verifying key for the claim_unbond_public function
3754
3663
  * @returns {VerifyingKey}
3755
3664
  */
3756
- static fromBytes(bytes) {
3757
- try {
3758
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3759
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
3760
- const len0 = WASM_VECTOR_LEN;
3761
- wasm.verifyingkey_fromBytes(retptr, ptr0, len0);
3762
- var r0 = getInt32Memory0()[retptr / 4 + 0];
3763
- var r1 = getInt32Memory0()[retptr / 4 + 1];
3764
- var r2 = getInt32Memory0()[retptr / 4 + 2];
3765
- if (r2) {
3766
- throw takeObject(r1);
3767
- }
3768
- return VerifyingKey.__wrap(r0);
3769
- } finally {
3770
- wasm.__wbindgen_add_to_stack_pointer(16);
3771
- }
3665
+ static claimUnbondPublicVerifier() {
3666
+ const ret = wasm.verifyingkey_claimUnbondPublicVerifier();
3667
+ return VerifyingKey.__wrap(ret);
3772
3668
  }
3773
3669
  /**
3774
- * Create a verifying key from string
3775
- *
3776
- * @param {String} string String representation of a verifying key
3777
- * @returns {VerifyingKey | Error}
3778
- * @param {string} string
3779
- * @returns {VerifyingKey}
3780
- */
3781
- static fromString(string) {
3782
- try {
3783
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3784
- const ptr0 = passStringToWasm0(string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3785
- const len0 = WASM_VECTOR_LEN;
3786
- wasm.verifyingkey_fromString(retptr, ptr0, len0);
3787
- var r0 = getInt32Memory0()[retptr / 4 + 0];
3788
- var r1 = getInt32Memory0()[retptr / 4 + 1];
3789
- var r2 = getInt32Memory0()[retptr / 4 + 2];
3790
- if (r2) {
3791
- throw takeObject(r1);
3792
- }
3793
- return VerifyingKey.__wrap(r0);
3794
- } finally {
3795
- wasm.__wbindgen_add_to_stack_pointer(16);
3796
- }
3797
- }
3798
- /**
3799
- * Create a byte array from a verifying key
3800
- *
3801
- * @returns {Uint8Array | Error} Byte representation of a verifying key
3802
- * @returns {Uint8Array}
3803
- */
3804
- toBytes() {
3805
- try {
3806
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3807
- wasm.verifyingkey_toBytes(retptr, this.__wbg_ptr);
3808
- var r0 = getInt32Memory0()[retptr / 4 + 0];
3809
- var r1 = getInt32Memory0()[retptr / 4 + 1];
3810
- var r2 = getInt32Memory0()[retptr / 4 + 2];
3811
- var r3 = getInt32Memory0()[retptr / 4 + 3];
3812
- if (r3) {
3813
- throw takeObject(r2);
3814
- }
3815
- var v1 = getArrayU8FromWasm0(r0, r1).slice();
3816
- wasm.__wbindgen_free(r0, r1 * 1, 1);
3817
- return v1;
3818
- } finally {
3819
- wasm.__wbindgen_add_to_stack_pointer(16);
3820
- }
3821
- }
3822
- /**
3823
- * Get a string representation of the verifying key
3824
- *
3825
- * @returns {String} String representation of the verifying key
3826
- * @returns {string}
3827
- */
3828
- toString() {
3829
- let deferred1_0;
3830
- let deferred1_1;
3831
- try {
3832
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3833
- wasm.verifyingkey_toString(retptr, this.__wbg_ptr);
3834
- var r0 = getInt32Memory0()[retptr / 4 + 0];
3835
- var r1 = getInt32Memory0()[retptr / 4 + 1];
3836
- deferred1_0 = r0;
3837
- deferred1_1 = r1;
3838
- return getStringFromWasm0(r0, r1);
3839
- } finally {
3840
- wasm.__wbindgen_add_to_stack_pointer(16);
3841
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
3842
- }
3843
- }
3844
- /**
3845
- * Returns the verifying key for the bond_public function
3846
- *
3847
- * @returns {VerifyingKey} Verifying key for the bond_public function
3848
- * @returns {VerifyingKey}
3849
- */
3850
- static bondPublicVerifier() {
3851
- const ret = wasm.verifyingkey_bondPublicVerifier();
3852
- return VerifyingKey.__wrap(ret);
3853
- }
3854
- /**
3855
- * Returns the verifying key for the bond_validator function
3856
- *
3857
- * @returns {VerifyingKey} Verifying key for the bond_validator function
3858
- * @returns {VerifyingKey}
3859
- */
3860
- static bondValidatorVerifier() {
3861
- const ret = wasm.verifyingkey_bondValidatorVerifier();
3862
- return VerifyingKey.__wrap(ret);
3863
- }
3864
- /**
3865
- * Returns the verifying key for the claim_delegator function
3866
- *
3867
- * @returns {VerifyingKey} Verifying key for the claim_unbond_public function
3868
- * @returns {VerifyingKey}
3869
- */
3870
- static claimUnbondPublicVerifier() {
3871
- const ret = wasm.verifyingkey_claimUnbondPublicVerifier();
3872
- return VerifyingKey.__wrap(ret);
3873
- }
3874
- /**
3875
- * Returns the verifying key for the fee_private function
3670
+ * Returns the verifying key for the fee_private function
3876
3671
  *
3877
3672
  * @returns {VerifyingKey} Verifying key for the fee_private function
3878
3673
  * @returns {VerifyingKey}
@@ -4141,14 +3936,142 @@ export class VerifyingKey {
4141
3936
  const ret = wasm.verifyingkey_isUnbondPublicVerifier(this.__wbg_ptr);
4142
3937
  return ret !== 0;
4143
3938
  }
3939
+ /**
3940
+ * Get the checksum of the verifying key
3941
+ *
3942
+ * @returns {string} Checksum of the verifying key
3943
+ * @returns {string}
3944
+ */
3945
+ checksum() {
3946
+ let deferred1_0;
3947
+ let deferred1_1;
3948
+ try {
3949
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3950
+ wasm.verifyingkey_checksum(retptr, this.__wbg_ptr);
3951
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3952
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3953
+ deferred1_0 = r0;
3954
+ deferred1_1 = r1;
3955
+ return getStringFromWasm0(r0, r1);
3956
+ } finally {
3957
+ wasm.__wbindgen_add_to_stack_pointer(16);
3958
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
3959
+ }
3960
+ }
3961
+ /**
3962
+ * Create a copy of the verifying key
3963
+ *
3964
+ * @returns {VerifyingKey} A copy of the verifying key
3965
+ * @returns {VerifyingKey}
3966
+ */
3967
+ copy() {
3968
+ const ret = wasm.verifyingkey_copy(this.__wbg_ptr);
3969
+ return VerifyingKey.__wrap(ret);
3970
+ }
3971
+ /**
3972
+ * Construct a new verifying key from a byte array
3973
+ *
3974
+ * @param {Uint8Array} bytes Byte representation of a verifying key
3975
+ * @returns {VerifyingKey | Error}
3976
+ * @param {Uint8Array} bytes
3977
+ * @returns {VerifyingKey}
3978
+ */
3979
+ static fromBytes(bytes) {
3980
+ try {
3981
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3982
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
3983
+ const len0 = WASM_VECTOR_LEN;
3984
+ wasm.verifyingkey_fromBytes(retptr, ptr0, len0);
3985
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3986
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3987
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3988
+ if (r2) {
3989
+ throw takeObject(r1);
3990
+ }
3991
+ return VerifyingKey.__wrap(r0);
3992
+ } finally {
3993
+ wasm.__wbindgen_add_to_stack_pointer(16);
3994
+ }
3995
+ }
3996
+ /**
3997
+ * Create a verifying key from string
3998
+ *
3999
+ * @param {String} string String representation of a verifying key
4000
+ * @returns {VerifyingKey | Error}
4001
+ * @param {string} string
4002
+ * @returns {VerifyingKey}
4003
+ */
4004
+ static fromString(string) {
4005
+ try {
4006
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4007
+ const ptr0 = passStringToWasm0(string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4008
+ const len0 = WASM_VECTOR_LEN;
4009
+ wasm.verifyingkey_fromString(retptr, ptr0, len0);
4010
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4011
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4012
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
4013
+ if (r2) {
4014
+ throw takeObject(r1);
4015
+ }
4016
+ return VerifyingKey.__wrap(r0);
4017
+ } finally {
4018
+ wasm.__wbindgen_add_to_stack_pointer(16);
4019
+ }
4020
+ }
4021
+ /**
4022
+ * Create a byte array from a verifying key
4023
+ *
4024
+ * @returns {Uint8Array | Error} Byte representation of a verifying key
4025
+ * @returns {Uint8Array}
4026
+ */
4027
+ toBytes() {
4028
+ try {
4029
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4030
+ wasm.verifyingkey_toBytes(retptr, this.__wbg_ptr);
4031
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4032
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4033
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
4034
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
4035
+ if (r3) {
4036
+ throw takeObject(r2);
4037
+ }
4038
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
4039
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
4040
+ return v1;
4041
+ } finally {
4042
+ wasm.__wbindgen_add_to_stack_pointer(16);
4043
+ }
4044
+ }
4045
+ /**
4046
+ * Get a string representation of the verifying key
4047
+ *
4048
+ * @returns {String} String representation of the verifying key
4049
+ * @returns {string}
4050
+ */
4051
+ toString() {
4052
+ let deferred1_0;
4053
+ let deferred1_1;
4054
+ try {
4055
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4056
+ wasm.verifyingkey_toString(retptr, this.__wbg_ptr);
4057
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4058
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4059
+ deferred1_0 = r0;
4060
+ deferred1_1 = r1;
4061
+ return getStringFromWasm0(r0, r1);
4062
+ } finally {
4063
+ wasm.__wbindgen_add_to_stack_pointer(16);
4064
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
4065
+ }
4066
+ }
4144
4067
  }
4145
4068
 
4146
4069
  const ViewKeyFinalization = (typeof FinalizationRegistry === 'undefined')
4147
4070
  ? { register: () => {}, unregister: () => {} }
4148
- : new FinalizationRegistry(ptr => wasm.__wbg_viewkey_free(ptr >>> 0));
4071
+ : new FinalizationRegistry(ptr => wasm.__wbg_viewkey_free(ptr >>> 0, 1));
4149
4072
  /**
4150
4073
  */
4151
- export class ViewKey {
4074
+ class ViewKey {
4152
4075
 
4153
4076
  static __wrap(ptr) {
4154
4077
  ptr = ptr >>> 0;
@@ -4167,7 +4090,7 @@ export class ViewKey {
4167
4090
 
4168
4091
  free() {
4169
4092
  const ptr = this.__destroy_into_raw();
4170
- wasm.__wbg_viewkey_free(ptr);
4093
+ wasm.__wbg_viewkey_free(ptr, 0);
4171
4094
  }
4172
4095
  /**
4173
4096
  * Create a new view key from a private key
@@ -4179,7 +4102,7 @@ export class ViewKey {
4179
4102
  */
4180
4103
  static from_private_key(private_key) {
4181
4104
  _assertClass(private_key, PrivateKey);
4182
- const ret = wasm.viewkey_from_private_key(private_key.__wbg_ptr);
4105
+ const ret = wasm.privatekey_to_view_key(private_key.__wbg_ptr);
4183
4106
  return ViewKey.__wrap(ret);
4184
4107
  }
4185
4108
  /**
@@ -4208,8 +4131,8 @@ export class ViewKey {
4208
4131
  try {
4209
4132
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4210
4133
  wasm.viewkey_to_string(retptr, this.__wbg_ptr);
4211
- var r0 = getInt32Memory0()[retptr / 4 + 0];
4212
- var r1 = getInt32Memory0()[retptr / 4 + 1];
4134
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4135
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4213
4136
  deferred1_0 = r0;
4214
4137
  deferred1_1 = r1;
4215
4138
  return getStringFromWasm0(r0, r1);
@@ -4225,7 +4148,7 @@ export class ViewKey {
4225
4148
  * @returns {Address}
4226
4149
  */
4227
4150
  to_address() {
4228
- const ret = wasm.viewkey_to_address(this.__wbg_ptr);
4151
+ const ret = wasm.address_from_view_key(this.__wbg_ptr);
4229
4152
  return Address.__wrap(ret);
4230
4153
  }
4231
4154
  /**
@@ -4244,10 +4167,10 @@ export class ViewKey {
4244
4167
  const ptr0 = passStringToWasm0(ciphertext, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4245
4168
  const len0 = WASM_VECTOR_LEN;
4246
4169
  wasm.viewkey_decrypt(retptr, this.__wbg_ptr, ptr0, len0);
4247
- var r0 = getInt32Memory0()[retptr / 4 + 0];
4248
- var r1 = getInt32Memory0()[retptr / 4 + 1];
4249
- var r2 = getInt32Memory0()[retptr / 4 + 2];
4250
- var r3 = getInt32Memory0()[retptr / 4 + 3];
4170
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4171
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4172
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
4173
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
4251
4174
  var ptr2 = r0;
4252
4175
  var len2 = r1;
4253
4176
  if (r3) {
@@ -4284,10 +4207,10 @@ export class ViewKey {
4284
4207
  const ptr3 = passStringToWasm0(function_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4285
4208
  const len3 = WASM_VECTOR_LEN;
4286
4209
  wasm.viewkey_decrypt_ciphertext(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, index);
4287
- var r0 = getInt32Memory0()[retptr / 4 + 0];
4288
- var r1 = getInt32Memory0()[retptr / 4 + 1];
4289
- var r2 = getInt32Memory0()[retptr / 4 + 2];
4290
- var r3 = getInt32Memory0()[retptr / 4 + 3];
4210
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4211
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4212
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
4213
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
4291
4214
  var ptr5 = r0;
4292
4215
  var len5 = r1;
4293
4216
  if (r3) {
@@ -4341,199 +4264,293 @@ function __wbg_get_imports() {
4341
4264
  imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
4342
4265
  takeObject(arg0);
4343
4266
  };
4344
- imports.wbg.__wbg_executionresponse_new = function(arg0) {
4345
- const ret = ExecutionResponse.__wrap(arg0);
4267
+ imports.wbg.__wbg_new_1ae25a6e3090015c = function() { return handleError(function () {
4268
+ const ret = new XMLHttpRequest();
4346
4269
  return addHeapObject(ret);
4347
- };
4348
- imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
4349
- const ret = getStringFromWasm0(arg0, arg1);
4270
+ }, arguments) };
4271
+ imports.wbg.__wbg_overrideMimeType_93fee129d6b7bd8a = function() { return handleError(function (arg0, arg1, arg2) {
4272
+ getObject(arg0).overrideMimeType(getStringFromWasm0(arg1, arg2));
4273
+ }, arguments) };
4274
+ imports.wbg.__wbg_open_24ef54e5747f14a4 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
4275
+ getObject(arg0).open(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4), arg5 !== 0);
4276
+ }, arguments) };
4277
+ imports.wbg.__wbg_send_98da1c2170a9db0f = function() { return handleError(function (arg0) {
4278
+ getObject(arg0).send();
4279
+ }, arguments) };
4280
+ imports.wbg.__wbg_response_8af60add8186fa5c = function() { return handleError(function (arg0) {
4281
+ const ret = getObject(arg0).response;
4350
4282
  return addHeapObject(ret);
4351
- };
4352
- imports.wbg.__wbg_transaction_new = function(arg0) {
4353
- const ret = Transaction.__wrap(arg0);
4283
+ }, arguments) };
4284
+ imports.wbg.__wbg_new_525245e2b9901204 = function() {
4285
+ const ret = new Object();
4354
4286
  return addHeapObject(ret);
4355
4287
  };
4356
- imports.wbg.__wbg_log_b46ba1e74db5adee = function(arg0, arg1) {
4357
- console.log(getStringFromWasm0(arg0, arg1));
4358
- };
4359
- imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
4360
- const obj = getObject(arg1);
4361
- const ret = typeof(obj) === 'string' ? obj : undefined;
4362
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4363
- var len1 = WASM_VECTOR_LEN;
4364
- getInt32Memory0()[arg0 / 4 + 1] = len1;
4365
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
4288
+ imports.wbg.__wbg_setmethod_dc68a742c2db5c6a = function(arg0, arg1, arg2) {
4289
+ getObject(arg0).method = getStringFromWasm0(arg1, arg2);
4366
4290
  };
4367
- imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
4368
- const ret = BigInt.asUintN(64, arg0);
4291
+ imports.wbg.__wbg_new_e27c93803e1acc42 = function() { return handleError(function () {
4292
+ const ret = new Headers();
4369
4293
  return addHeapObject(ret);
4294
+ }, arguments) };
4295
+ imports.wbg.__wbg_setheaders_be10a5ab566fd06f = function(arg0, arg1) {
4296
+ getObject(arg0).headers = getObject(arg1);
4370
4297
  };
4371
- imports.wbg.__wbg_keypair_new = function(arg0) {
4372
- const ret = KeyPair.__wrap(arg0);
4373
- return addHeapObject(ret);
4298
+ imports.wbg.__wbg_setmode_a781aae2bd3df202 = function(arg0, arg1) {
4299
+ getObject(arg0).mode = ["same-origin","no-cors","cors","navigate",][arg1];
4374
4300
  };
4375
- imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
4376
- const ret = getObject(arg0);
4377
- return addHeapObject(ret);
4301
+ imports.wbg.__wbg_setcredentials_2b67800db3f7b621 = function(arg0, arg1) {
4302
+ getObject(arg0).credentials = ["omit","same-origin","include",][arg1];
4378
4303
  };
4379
- imports.wbg.__wbg_authorizationresponse_new = function(arg0) {
4380
- const ret = AuthorizationResponse.__wrap(arg0);
4381
- return addHeapObject(ret);
4304
+ imports.wbg.__wbg_setbody_734cb3d7ee8e6e96 = function(arg0, arg1) {
4305
+ getObject(arg0).body = getObject(arg1);
4382
4306
  };
4383
- imports.wbg.__wbg_spawnWorker_d4740fc67f78311c = function(arg0, arg1, arg2, arg3) {
4384
- const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
4307
+ imports.wbg.__wbg_new_ebf2727385ee825c = function() { return handleError(function () {
4308
+ const ret = new AbortController();
4309
+ return addHeapObject(ret);
4310
+ }, arguments) };
4311
+ imports.wbg.__wbg_signal_41e46ccad44bb5e2 = function(arg0) {
4312
+ const ret = getObject(arg0).signal;
4385
4313
  return addHeapObject(ret);
4386
4314
  };
4387
- imports.wbg.__wbindgen_cb_drop = function(arg0) {
4388
- const obj = takeObject(arg0).original;
4389
- if (obj.cnt-- == 1) {
4390
- obj.a = 0;
4391
- return true;
4392
- }
4393
- const ret = false;
4394
- return ret;
4315
+ imports.wbg.__wbg_setsignal_91c4e8ebd04eb935 = function(arg0, arg1) {
4316
+ getObject(arg0).signal = getObject(arg1);
4395
4317
  };
4396
- imports.wbg.__wbindgen_number_new = function(arg0) {
4397
- const ret = arg0;
4398
- return addHeapObject(ret);
4318
+ imports.wbg.__wbg_append_f3a4426bb50622c5 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
4319
+ getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
4320
+ }, arguments) };
4321
+ imports.wbg.__wbg_instanceof_Response_e91b7eb7c611a9ae = function(arg0) {
4322
+ let result;
4323
+ try {
4324
+ result = getObject(arg0) instanceof Response;
4325
+ } catch (_) {
4326
+ result = false;
4327
+ }
4328
+ const ret = result;
4329
+ return ret;
4399
4330
  };
4400
- imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
4401
- const ret = new Error();
4402
- return addHeapObject(ret);
4331
+ imports.wbg.__wbg_status_ae8de515694c5c7c = function(arg0) {
4332
+ const ret = getObject(arg0).status;
4333
+ return ret;
4403
4334
  };
4404
- imports.wbg.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
4405
- const ret = getObject(arg1).stack;
4335
+ imports.wbg.__wbg_url_1bf85c8abeb8c92d = function(arg0, arg1) {
4336
+ const ret = getObject(arg1).url;
4406
4337
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4407
4338
  const len1 = WASM_VECTOR_LEN;
4408
- getInt32Memory0()[arg0 / 4 + 1] = len1;
4409
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
4339
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
4340
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
4410
4341
  };
4411
- imports.wbg.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
4412
- let deferred0_0;
4413
- let deferred0_1;
4414
- try {
4415
- deferred0_0 = arg0;
4416
- deferred0_1 = arg1;
4417
- console.error(getStringFromWasm0(arg0, arg1));
4418
- } finally {
4419
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
4420
- }
4421
- };
4422
- imports.wbg.__wbg_fetch_bc7c8e27076a5c84 = function(arg0) {
4423
- const ret = fetch(getObject(arg0));
4342
+ imports.wbg.__wbg_headers_5e283e8345689121 = function(arg0) {
4343
+ const ret = getObject(arg0).headers;
4424
4344
  return addHeapObject(ret);
4425
4345
  };
4426
- imports.wbg.__wbg_queueMicrotask_481971b0d87f3dd4 = function(arg0) {
4427
- queueMicrotask(getObject(arg0));
4428
- };
4429
- imports.wbg.__wbg_queueMicrotask_3cbae2ec6b6cd3d6 = function(arg0) {
4430
- const ret = getObject(arg0).queueMicrotask;
4346
+ imports.wbg.__wbg_iterator_888179a48810a9fe = function() {
4347
+ const ret = Symbol.iterator;
4431
4348
  return addHeapObject(ret);
4432
4349
  };
4350
+ imports.wbg.__wbg_get_224d16597dbbfd96 = function() { return handleError(function (arg0, arg1) {
4351
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
4352
+ return addHeapObject(ret);
4353
+ }, arguments) };
4433
4354
  imports.wbg.__wbindgen_is_function = function(arg0) {
4434
4355
  const ret = typeof(getObject(arg0)) === 'function';
4435
4356
  return ret;
4436
4357
  };
4437
- imports.wbg.__wbg_navigator_6c8fa55c5cc8796e = function(arg0) {
4438
- const ret = getObject(arg0).navigator;
4358
+ imports.wbg.__wbg_call_1084a111329e68ce = function() { return handleError(function (arg0, arg1) {
4359
+ const ret = getObject(arg0).call(getObject(arg1));
4439
4360
  return addHeapObject(ret);
4361
+ }, arguments) };
4362
+ imports.wbg.__wbindgen_is_object = function(arg0) {
4363
+ const val = getObject(arg0);
4364
+ const ret = typeof(val) === 'object' && val !== null;
4365
+ return ret;
4440
4366
  };
4441
- imports.wbg.__wbg_fetch_921fad6ef9e883dd = function(arg0, arg1) {
4442
- const ret = getObject(arg0).fetch(getObject(arg1));
4367
+ imports.wbg.__wbg_next_de3e9db4440638b2 = function(arg0) {
4368
+ const ret = getObject(arg0).next;
4443
4369
  return addHeapObject(ret);
4444
4370
  };
4445
- imports.wbg.__wbg_hardwareConcurrency_cffbaa73aab5ff44 = function(arg0) {
4446
- const ret = getObject(arg0).hardwareConcurrency;
4371
+ imports.wbg.__wbg_next_f9cb570345655b9a = function() { return handleError(function (arg0) {
4372
+ const ret = getObject(arg0).next();
4373
+ return addHeapObject(ret);
4374
+ }, arguments) };
4375
+ imports.wbg.__wbg_done_bfda7aa8f252b39f = function(arg0) {
4376
+ const ret = getObject(arg0).done;
4447
4377
  return ret;
4448
4378
  };
4449
- imports.wbg.__wbg_newwithstrandinit_3fd6fba4083ff2d0 = function() { return handleError(function (arg0, arg1, arg2) {
4450
- const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
4379
+ imports.wbg.__wbg_value_6d39332ab4788d86 = function(arg0) {
4380
+ const ret = getObject(arg0).value;
4381
+ return addHeapObject(ret);
4382
+ };
4383
+ imports.wbg.__wbg_abort_8659d889a7877ae3 = function(arg0) {
4384
+ getObject(arg0).abort();
4385
+ };
4386
+ imports.wbg.__wbg_stringify_bbf45426c92a6bf5 = function() { return handleError(function (arg0) {
4387
+ const ret = JSON.stringify(getObject(arg0));
4451
4388
  return addHeapObject(ret);
4452
4389
  }, arguments) };
4453
- imports.wbg.__wbg_signal_a61f78a3478fd9bc = function(arg0) {
4454
- const ret = getObject(arg0).signal;
4390
+ imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
4391
+ const obj = getObject(arg1);
4392
+ const ret = typeof(obj) === 'string' ? obj : undefined;
4393
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4394
+ var len1 = WASM_VECTOR_LEN;
4395
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
4396
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
4397
+ };
4398
+ imports.wbg.__wbg_log_24ae5b17cd7c1dc5 = function(arg0, arg1) {
4399
+ console.log(getStringFromWasm0(arg0, arg1));
4400
+ };
4401
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
4402
+ const ret = getStringFromWasm0(arg0, arg1);
4455
4403
  return addHeapObject(ret);
4456
4404
  };
4457
- imports.wbg.__wbg_new_0d76b0581eca6298 = function() { return handleError(function () {
4458
- const ret = new AbortController();
4405
+ imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
4406
+ const ret = BigInt.asUintN(64, arg0);
4459
4407
  return addHeapObject(ret);
4460
- }, arguments) };
4461
- imports.wbg.__wbg_abort_2aa7521d5690750e = function(arg0) {
4462
- getObject(arg0).abort();
4463
4408
  };
4464
- imports.wbg.__wbg_new_ab6fd82b10560829 = function() { return handleError(function () {
4465
- const ret = new Headers();
4409
+ imports.wbg.__wbg_call_89af060b4e1523f2 = function() { return handleError(function (arg0, arg1, arg2) {
4410
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
4466
4411
  return addHeapObject(ret);
4467
4412
  }, arguments) };
4468
- imports.wbg.__wbg_append_7bfcb4937d1d5e29 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
4469
- getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
4470
- }, arguments) };
4471
- imports.wbg.__wbg_instanceof_Response_849eb93e75734b6e = function(arg0) {
4472
- let result;
4473
- try {
4474
- result = getObject(arg0) instanceof Response;
4475
- } catch (_) {
4476
- result = false;
4477
- }
4478
- const ret = result;
4479
- return ret;
4413
+ imports.wbg.__wbg_newwithlength_b5660ad84eb3e8a9 = function(arg0) {
4414
+ const ret = new Array(arg0 >>> 0);
4415
+ return addHeapObject(ret);
4480
4416
  };
4481
- imports.wbg.__wbg_url_5f6dc4009ac5f99d = function(arg0, arg1) {
4482
- const ret = getObject(arg1).url;
4483
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4484
- const len1 = WASM_VECTOR_LEN;
4485
- getInt32Memory0()[arg0 / 4 + 1] = len1;
4486
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
4417
+ imports.wbg.__wbg_set_673dda6c73d19609 = function(arg0, arg1, arg2) {
4418
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
4487
4419
  };
4488
- imports.wbg.__wbg_status_61a01141acd3cf74 = function(arg0) {
4489
- const ret = getObject(arg0).status;
4420
+ imports.wbg.__wbg_transaction_new = function(arg0) {
4421
+ const ret = Transaction.__wrap(arg0);
4422
+ return addHeapObject(ret);
4423
+ };
4424
+ imports.wbg.__wbg_executionresponse_new = function(arg0) {
4425
+ const ret = ExecutionResponse.__wrap(arg0);
4426
+ return addHeapObject(ret);
4427
+ };
4428
+ imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
4429
+ const ret = getObject(arg0);
4430
+ return addHeapObject(ret);
4431
+ };
4432
+ imports.wbg.__wbg_authorizationresponse_new = function(arg0) {
4433
+ const ret = AuthorizationResponse.__wrap(arg0);
4434
+ return addHeapObject(ret);
4435
+ };
4436
+ imports.wbg.__wbindgen_module = function() {
4437
+ const ret = __wbg_init.__wbindgen_wasm_module;
4438
+ return addHeapObject(ret);
4439
+ };
4440
+ imports.wbg.__wbindgen_memory = function() {
4441
+ const ret = wasm.memory;
4442
+ return addHeapObject(ret);
4443
+ };
4444
+ imports.wbg.__wbg_spawnWorker_39cb4f9fffde8270 = function(arg0, arg1, arg2, arg3) {
4445
+ const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
4446
+ return addHeapObject(ret);
4447
+ };
4448
+ imports.wbg.__wbg_keypair_new = function(arg0) {
4449
+ const ret = KeyPair.__wrap(arg0);
4450
+ return addHeapObject(ret);
4451
+ };
4452
+ imports.wbg.__wbindgen_cb_drop = function(arg0) {
4453
+ const obj = takeObject(arg0).original;
4454
+ if (obj.cnt-- == 1) {
4455
+ obj.a = 0;
4456
+ return true;
4457
+ }
4458
+ const ret = false;
4490
4459
  return ret;
4491
4460
  };
4492
- imports.wbg.__wbg_headers_9620bfada380764a = function(arg0) {
4493
- const ret = getObject(arg0).headers;
4461
+ imports.wbg.__wbg_new_a220cf903aa02ca2 = function() {
4462
+ const ret = new Array();
4494
4463
  return addHeapObject(ret);
4495
4464
  };
4496
- imports.wbg.__wbg_arrayBuffer_29931d52c7206b02 = function() { return handleError(function (arg0) {
4465
+ imports.wbg.__wbg_push_37c89022f34c01ca = function(arg0, arg1) {
4466
+ const ret = getObject(arg0).push(getObject(arg1));
4467
+ return ret;
4468
+ };
4469
+ imports.wbg.__wbg_arrayBuffer_a5fbad63cc7e663b = function() { return handleError(function (arg0) {
4497
4470
  const ret = getObject(arg0).arrayBuffer();
4498
4471
  return addHeapObject(ret);
4499
4472
  }, arguments) };
4500
- imports.wbg.__wbg_status_d485fb5a478426fb = function() { return handleError(function (arg0) {
4501
- const ret = getObject(arg0).status;
4473
+ imports.wbg.__wbg_new_ea1883e1e5e86686 = function(arg0) {
4474
+ const ret = new Uint8Array(getObject(arg0));
4475
+ return addHeapObject(ret);
4476
+ };
4477
+ imports.wbg.__wbg_length_8339fcf5d8ecd12e = function(arg0) {
4478
+ const ret = getObject(arg0).length;
4479
+ return ret;
4480
+ };
4481
+ imports.wbg.__wbg_new_b85e72ed1bfd57f9 = function(arg0, arg1) {
4482
+ try {
4483
+ var state0 = {a: arg0, b: arg1};
4484
+ var cb0 = (arg0, arg1) => {
4485
+ const a = state0.a;
4486
+ state0.a = 0;
4487
+ try {
4488
+ return __wbg_adapter_292(a, state0.b, arg0, arg1);
4489
+ } finally {
4490
+ state0.a = a;
4491
+ }
4492
+ };
4493
+ const ret = new Promise(cb0);
4494
+ return addHeapObject(ret);
4495
+ } finally {
4496
+ state0.a = state0.b = 0;
4497
+ }
4498
+ };
4499
+ imports.wbg.__wbg_set_eacc7d73fefaafdf = function() { return handleError(function (arg0, arg1, arg2) {
4500
+ const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
4502
4501
  return ret;
4503
4502
  }, arguments) };
4504
- imports.wbg.__wbg_response_7c2e2759084f7279 = function() { return handleError(function (arg0) {
4505
- const ret = getObject(arg0).response;
4503
+ imports.wbg.__wbindgen_number_new = function(arg0) {
4504
+ const ret = arg0;
4506
4505
  return addHeapObject(ret);
4507
- }, arguments) };
4508
- imports.wbg.__wbg_responseText_c67ed2d48db10769 = function() { return handleError(function (arg0, arg1) {
4509
- const ret = getObject(arg1).responseText;
4510
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4511
- var len1 = WASM_VECTOR_LEN;
4512
- getInt32Memory0()[arg0 / 4 + 1] = len1;
4513
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
4514
- }, arguments) };
4515
- imports.wbg.__wbg_new_71801a555ad9f2aa = function() { return handleError(function () {
4516
- const ret = new XMLHttpRequest();
4506
+ };
4507
+ imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
4508
+ const ret = new Error();
4517
4509
  return addHeapObject(ret);
4510
+ };
4511
+ imports.wbg.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
4512
+ const ret = getObject(arg1).stack;
4513
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4514
+ const len1 = WASM_VECTOR_LEN;
4515
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
4516
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
4517
+ };
4518
+ imports.wbg.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
4519
+ let deferred0_0;
4520
+ let deferred0_1;
4521
+ try {
4522
+ deferred0_0 = arg0;
4523
+ deferred0_1 = arg1;
4524
+ console.error(getStringFromWasm0(arg0, arg1));
4525
+ } finally {
4526
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
4527
+ }
4528
+ };
4529
+ imports.wbg.__wbg_buffer_b7b08af79b0b0974 = function(arg0) {
4530
+ const ret = getObject(arg0).buffer;
4531
+ return addHeapObject(ret);
4532
+ };
4533
+ imports.wbg.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9 = function(arg0, arg1, arg2) {
4534
+ const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
4535
+ return addHeapObject(ret);
4536
+ };
4537
+ imports.wbg.__wbg_randomFillSync_5c9c955aa56b6049 = function() { return handleError(function (arg0, arg1) {
4538
+ getObject(arg0).randomFillSync(takeObject(arg1));
4518
4539
  }, arguments) };
4519
- imports.wbg.__wbg_open_c9eb0cf2c9d95679 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
4520
- getObject(arg0).open(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4), arg5 !== 0);
4521
- }, arguments) };
4522
- imports.wbg.__wbg_overrideMimeType_ee9c51919ceb418b = function() { return handleError(function (arg0, arg1, arg2) {
4523
- getObject(arg0).overrideMimeType(getStringFromWasm0(arg1, arg2));
4524
- }, arguments) };
4525
- imports.wbg.__wbg_send_80d29985093c1ec5 = function() { return handleError(function (arg0) {
4526
- getObject(arg0).send();
4540
+ imports.wbg.__wbg_subarray_7c2e3576afe181d1 = function(arg0, arg1, arg2) {
4541
+ const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
4542
+ return addHeapObject(ret);
4543
+ };
4544
+ imports.wbg.__wbg_getRandomValues_3aa56aa6edec874c = function() { return handleError(function (arg0, arg1) {
4545
+ getObject(arg0).getRandomValues(getObject(arg1));
4527
4546
  }, arguments) };
4547
+ imports.wbg.__wbg_set_d1e79e2388520f18 = function(arg0, arg1, arg2) {
4548
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
4549
+ };
4528
4550
  imports.wbg.__wbg_crypto_1d1f22824a6a080c = function(arg0) {
4529
4551
  const ret = getObject(arg0).crypto;
4530
4552
  return addHeapObject(ret);
4531
4553
  };
4532
- imports.wbg.__wbindgen_is_object = function(arg0) {
4533
- const val = getObject(arg0);
4534
- const ret = typeof(val) === 'object' && val !== null;
4535
- return ret;
4536
- };
4537
4554
  imports.wbg.__wbg_process_4a72847cc503995b = function(arg0) {
4538
4555
  const ret = getObject(arg0).process;
4539
4556
  return addHeapObject(ret);
@@ -4558,73 +4575,31 @@ function __wbg_get_imports() {
4558
4575
  const ret = getObject(arg0).msCrypto;
4559
4576
  return addHeapObject(ret);
4560
4577
  };
4561
- imports.wbg.__wbg_randomFillSync_5c9c955aa56b6049 = function() { return handleError(function (arg0, arg1) {
4562
- getObject(arg0).randomFillSync(takeObject(arg1));
4563
- }, arguments) };
4564
- imports.wbg.__wbg_getRandomValues_3aa56aa6edec874c = function() { return handleError(function (arg0, arg1) {
4565
- getObject(arg0).getRandomValues(getObject(arg1));
4566
- }, arguments) };
4567
- imports.wbg.__wbg_get_bd8e338fbd5f5cc8 = function(arg0, arg1) {
4568
- const ret = getObject(arg0)[arg1 >>> 0];
4578
+ imports.wbg.__wbg_newwithlength_ec548f448387c968 = function(arg0) {
4579
+ const ret = new Uint8Array(arg0 >>> 0);
4569
4580
  return addHeapObject(ret);
4570
4581
  };
4571
- imports.wbg.__wbg_length_cd7af8117672b8b8 = function(arg0) {
4582
+ imports.wbg.__wbg_length_ae22078168b726f5 = function(arg0) {
4572
4583
  const ret = getObject(arg0).length;
4573
4584
  return ret;
4574
4585
  };
4575
- imports.wbg.__wbg_new_16b304a2cfa7ff4a = function() {
4576
- const ret = new Array();
4577
- return addHeapObject(ret);
4578
- };
4579
- imports.wbg.__wbg_newnoargs_e258087cd0daa0ea = function(arg0, arg1) {
4580
- const ret = new Function(getStringFromWasm0(arg0, arg1));
4581
- return addHeapObject(ret);
4582
- };
4583
- imports.wbg.__wbg_next_40fc327bfc8770e6 = function(arg0) {
4584
- const ret = getObject(arg0).next;
4585
- return addHeapObject(ret);
4586
- };
4587
- imports.wbg.__wbg_next_196c84450b364254 = function() { return handleError(function (arg0) {
4588
- const ret = getObject(arg0).next();
4589
- return addHeapObject(ret);
4590
- }, arguments) };
4591
- imports.wbg.__wbg_done_298b57d23c0fc80c = function(arg0) {
4592
- const ret = getObject(arg0).done;
4593
- return ret;
4594
- };
4595
- imports.wbg.__wbg_value_d93c65011f51a456 = function(arg0) {
4596
- const ret = getObject(arg0).value;
4597
- return addHeapObject(ret);
4598
- };
4599
- imports.wbg.__wbg_iterator_2cee6dadfd956dfa = function() {
4600
- const ret = Symbol.iterator;
4601
- return addHeapObject(ret);
4602
- };
4603
- imports.wbg.__wbg_get_e3c254076557e348 = function() { return handleError(function (arg0, arg1) {
4604
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
4605
- return addHeapObject(ret);
4606
- }, arguments) };
4607
- imports.wbg.__wbg_call_27c0f87801dedf93 = function() { return handleError(function (arg0, arg1) {
4608
- const ret = getObject(arg0).call(getObject(arg1));
4609
- return addHeapObject(ret);
4610
- }, arguments) };
4611
- imports.wbg.__wbg_new_72fb9a18b5ae2624 = function() {
4612
- const ret = new Object();
4586
+ imports.wbg.__wbg_get_3baa728f9d58d3f6 = function(arg0, arg1) {
4587
+ const ret = getObject(arg0)[arg1 >>> 0];
4613
4588
  return addHeapObject(ret);
4614
4589
  };
4615
- imports.wbg.__wbg_self_ce0dbfc45cf2f5be = function() { return handleError(function () {
4590
+ imports.wbg.__wbg_self_3093d5d1f7bcb682 = function() { return handleError(function () {
4616
4591
  const ret = self.self;
4617
4592
  return addHeapObject(ret);
4618
4593
  }, arguments) };
4619
- imports.wbg.__wbg_window_c6fb939a7f436783 = function() { return handleError(function () {
4594
+ imports.wbg.__wbg_window_3bcfc4d31bc012f8 = function() { return handleError(function () {
4620
4595
  const ret = window.window;
4621
4596
  return addHeapObject(ret);
4622
4597
  }, arguments) };
4623
- imports.wbg.__wbg_globalThis_d1e6af4856ba331b = function() { return handleError(function () {
4598
+ imports.wbg.__wbg_globalThis_86b222e13bdf32ed = function() { return handleError(function () {
4624
4599
  const ret = globalThis.globalThis;
4625
4600
  return addHeapObject(ret);
4626
4601
  }, arguments) };
4627
- imports.wbg.__wbg_global_207b558942527489 = function() { return handleError(function () {
4602
+ imports.wbg.__wbg_global_e5a3fe56f8be9485 = function() { return handleError(function () {
4628
4603
  const ret = global.global;
4629
4604
  return addHeapObject(ret);
4630
4605
  }, arguments) };
@@ -4632,137 +4607,160 @@ function __wbg_get_imports() {
4632
4607
  const ret = getObject(arg0) === undefined;
4633
4608
  return ret;
4634
4609
  };
4635
- imports.wbg.__wbg_newwithlength_66ae46612e7f0234 = function(arg0) {
4636
- const ret = new Array(arg0 >>> 0);
4610
+ imports.wbg.__wbg_newnoargs_76313bd6ff35d0f2 = function(arg0, arg1) {
4611
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
4637
4612
  return addHeapObject(ret);
4638
4613
  };
4639
- imports.wbg.__wbg_set_d4638f722068f043 = function(arg0, arg1, arg2) {
4640
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
4641
- };
4642
- imports.wbg.__wbg_push_a5b05aedc7234f9f = function(arg0, arg1) {
4643
- const ret = getObject(arg0).push(getObject(arg1));
4614
+ imports.wbg.__wbg_has_4bfbc01db38743f7 = function() { return handleError(function (arg0, arg1) {
4615
+ const ret = Reflect.has(getObject(arg0), getObject(arg1));
4644
4616
  return ret;
4617
+ }, arguments) };
4618
+ imports.wbg.__wbg_fetch_bc7c8e27076a5c84 = function(arg0) {
4619
+ const ret = fetch(getObject(arg0));
4620
+ return addHeapObject(ret);
4645
4621
  };
4646
- imports.wbg.__wbg_call_b3ca7c6051f9bec1 = function() { return handleError(function (arg0, arg1, arg2) {
4647
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
4622
+ imports.wbg.__wbg_fetch_ba7fe179e527d942 = function(arg0, arg1) {
4623
+ const ret = getObject(arg0).fetch(getObject(arg1));
4648
4624
  return addHeapObject(ret);
4649
- }, arguments) };
4650
- imports.wbg.__wbg_new_81740750da40724f = function(arg0, arg1) {
4651
- try {
4652
- var state0 = {a: arg0, b: arg1};
4653
- var cb0 = (arg0, arg1) => {
4654
- const a = state0.a;
4655
- state0.a = 0;
4656
- try {
4657
- return __wbg_adapter_327(a, state0.b, arg0, arg1);
4658
- } finally {
4659
- state0.a = a;
4660
- }
4661
- };
4662
- const ret = new Promise(cb0);
4663
- return addHeapObject(ret);
4664
- } finally {
4665
- state0.a = state0.b = 0;
4666
- }
4667
4625
  };
4668
- imports.wbg.__wbg_resolve_b0083a7967828ec8 = function(arg0) {
4669
- const ret = Promise.resolve(getObject(arg0));
4626
+ imports.wbg.__wbindgen_throw = function(arg0, arg1) {
4627
+ throw new Error(getStringFromWasm0(arg0, arg1));
4628
+ };
4629
+ imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
4630
+ const ret = debugString(getObject(arg1));
4631
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4632
+ const len1 = WASM_VECTOR_LEN;
4633
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
4634
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
4635
+ };
4636
+ imports.wbg.__wbindgen_rethrow = function(arg0) {
4637
+ throw takeObject(arg0);
4638
+ };
4639
+ imports.wbg.__wbg_then_876bb3c633745cc6 = function(arg0, arg1, arg2) {
4640
+ const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
4670
4641
  return addHeapObject(ret);
4671
4642
  };
4672
- imports.wbg.__wbg_then_0c86a60e8fcfe9f6 = function(arg0, arg1) {
4643
+ imports.wbg.__wbg_then_95e6edc0f89b73b1 = function(arg0, arg1) {
4673
4644
  const ret = getObject(arg0).then(getObject(arg1));
4674
4645
  return addHeapObject(ret);
4675
4646
  };
4676
- imports.wbg.__wbg_then_a73caa9a87991566 = function(arg0, arg1, arg2) {
4677
- const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
4647
+ imports.wbg.__wbg_queueMicrotask_12a30234db4045d3 = function(arg0) {
4648
+ queueMicrotask(getObject(arg0));
4649
+ };
4650
+ imports.wbg.__wbg_queueMicrotask_48421b3cc9052b68 = function(arg0) {
4651
+ const ret = getObject(arg0).queueMicrotask;
4678
4652
  return addHeapObject(ret);
4679
4653
  };
4680
- imports.wbg.__wbg_buffer_12d079cc21e14bdb = function(arg0) {
4681
- const ret = getObject(arg0).buffer;
4654
+ imports.wbg.__wbg_resolve_570458cb99d56a43 = function(arg0) {
4655
+ const ret = Promise.resolve(getObject(arg0));
4682
4656
  return addHeapObject(ret);
4683
4657
  };
4684
- imports.wbg.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb = function(arg0, arg1, arg2) {
4685
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
4658
+ imports.wbg.__wbg_waitAsync_cd62c81646382b45 = function() {
4659
+ const ret = Atomics.waitAsync;
4686
4660
  return addHeapObject(ret);
4687
4661
  };
4688
- imports.wbg.__wbg_new_63b92bc8671ed464 = function(arg0) {
4689
- const ret = new Uint8Array(getObject(arg0));
4662
+ imports.wbg.__wbg_new_a0719a520adfdb99 = function(arg0) {
4663
+ const ret = new Int32Array(getObject(arg0));
4690
4664
  return addHeapObject(ret);
4691
4665
  };
4692
- imports.wbg.__wbg_set_a47bac70306a19a7 = function(arg0, arg1, arg2) {
4693
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
4666
+ imports.wbg.__wbg_waitAsync_3ed212d5e9450545 = function(arg0, arg1, arg2) {
4667
+ const ret = Atomics.waitAsync(getObject(arg0), arg1 >>> 0, arg2);
4668
+ return addHeapObject(ret);
4694
4669
  };
4695
- imports.wbg.__wbg_length_c20a40f15020d68a = function(arg0) {
4696
- const ret = getObject(arg0).length;
4670
+ imports.wbg.__wbg_async_49a1efd7e3e4bd73 = function(arg0) {
4671
+ const ret = getObject(arg0).async;
4697
4672
  return ret;
4698
4673
  };
4699
- imports.wbg.__wbg_newwithlength_e9b4878cebadb3d3 = function(arg0) {
4700
- const ret = new Uint8Array(arg0 >>> 0);
4674
+ imports.wbg.__wbg_value_96cb463707ad2f31 = function(arg0) {
4675
+ const ret = getObject(arg0).value;
4701
4676
  return addHeapObject(ret);
4702
4677
  };
4703
- imports.wbg.__wbg_subarray_a1f73cd4b5b42fe1 = function(arg0, arg1, arg2) {
4704
- const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
4678
+ imports.wbg.__wbg_new_25d9d4e2932d816f = function() { return handleError(function (arg0, arg1) {
4679
+ const ret = new Worker(getStringFromWasm0(arg0, arg1));
4705
4680
  return addHeapObject(ret);
4706
- };
4707
- imports.wbg.__wbg_has_0af94d20077affa2 = function() { return handleError(function (arg0, arg1) {
4708
- const ret = Reflect.has(getObject(arg0), getObject(arg1));
4709
- return ret;
4710
4681
  }, arguments) };
4711
- imports.wbg.__wbg_set_1f9b04f170055d33 = function() { return handleError(function (arg0, arg1, arg2) {
4712
- const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
4713
- return ret;
4714
- }, arguments) };
4715
- imports.wbg.__wbg_stringify_8887fe74e1c50d81 = function() { return handleError(function (arg0) {
4716
- const ret = JSON.stringify(getObject(arg0));
4682
+ imports.wbg.__wbg_setonmessage_7cee8e224acfa056 = function(arg0, arg1) {
4683
+ getObject(arg0).onmessage = getObject(arg1);
4684
+ };
4685
+ imports.wbg.__wbg_of_61f336d7eeabfca8 = function(arg0, arg1, arg2) {
4686
+ const ret = Array.of(getObject(arg0), getObject(arg1), getObject(arg2));
4717
4687
  return addHeapObject(ret);
4688
+ };
4689
+ imports.wbg.__wbg_postMessage_37faac1bc005e5c0 = function() { return handleError(function (arg0, arg1) {
4690
+ getObject(arg0).postMessage(getObject(arg1));
4718
4691
  }, arguments) };
4719
- imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
4720
- const ret = debugString(getObject(arg1));
4692
+ imports.wbg.__wbg_data_5c47a6985fefc490 = function(arg0) {
4693
+ const ret = getObject(arg0).data;
4694
+ return addHeapObject(ret);
4695
+ };
4696
+ imports.wbg.__wbindgen_link_8b58b27602368eaa = function(arg0) {
4697
+ const val = `onmessage = function (ev) {
4698
+ let [ia, index, value] = ev.data;
4699
+ ia = new Int32Array(ia.buffer);
4700
+ let result = Atomics.wait(ia, index, value);
4701
+ postMessage(result);
4702
+ };
4703
+ `;
4704
+ const ret = typeof URL.createObjectURL === 'undefined' ? "data:application/javascript," + encodeURIComponent(val) : URL.createObjectURL(new Blob([val], { type: "text/javascript" }));
4721
4705
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4722
4706
  const len1 = WASM_VECTOR_LEN;
4723
- getInt32Memory0()[arg0 / 4 + 1] = len1;
4724
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
4707
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
4708
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
4725
4709
  };
4726
- imports.wbg.__wbindgen_throw = function(arg0, arg1) {
4727
- throw new Error(getStringFromWasm0(arg0, arg1));
4728
- };
4729
- imports.wbg.__wbindgen_module = function() {
4730
- const ret = __wbg_init.__wbindgen_wasm_module;
4710
+ imports.wbg.__wbg_newwithstrandinit_a31c69e4cc337183 = function() { return handleError(function (arg0, arg1, arg2) {
4711
+ const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
4731
4712
  return addHeapObject(ret);
4732
- };
4733
- imports.wbg.__wbindgen_memory = function() {
4734
- const ret = wasm.memory;
4713
+ }, arguments) };
4714
+ imports.wbg.__wbg_status_d636644875ef1c96 = function() { return handleError(function (arg0) {
4715
+ const ret = getObject(arg0).status;
4716
+ return ret;
4717
+ }, arguments) };
4718
+ imports.wbg.__wbg_responseText_ab274b82ca127268 = function() { return handleError(function (arg0, arg1) {
4719
+ const ret = getObject(arg1).responseText;
4720
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4721
+ var len1 = WASM_VECTOR_LEN;
4722
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
4723
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
4724
+ }, arguments) };
4725
+ imports.wbg.__wbindgen_closure_wrapper6012 = function(arg0, arg1, arg2) {
4726
+ const ret = makeMutClosure(arg0, arg1, 621, __wbg_adapter_34);
4735
4727
  return addHeapObject(ret);
4736
4728
  };
4737
- imports.wbg.__wbindgen_closure_wrapper6161 = function(arg0, arg1, arg2) {
4738
- const ret = makeMutClosure(arg0, arg1, 865, __wbg_adapter_32);
4729
+ imports.wbg.__wbindgen_closure_wrapper6038 = function(arg0, arg1, arg2) {
4730
+ const ret = makeMutClosure(arg0, arg1, 621, __wbg_adapter_34);
4739
4731
  return addHeapObject(ret);
4740
4732
  };
4741
4733
 
4742
4734
  return imports;
4743
4735
  }
4744
4736
 
4745
- function __wbg_init_memory(imports, maybe_memory) {
4746
-
4737
+ function __wbg_init_memory(imports, memory) {
4738
+ imports.wbg.memory = memory || new WebAssembly.Memory({initial:25,maximum:65536,shared:true});
4747
4739
  }
4748
4740
 
4749
- function __wbg_finalize_init(instance, module) {
4741
+ function __wbg_finalize_init(instance, module, thread_stack_size) {
4750
4742
  wasm = instance.exports;
4751
4743
  __wbg_init.__wbindgen_wasm_module = module;
4752
- cachedBigInt64Memory0 = null;
4753
- cachedInt32Memory0 = null;
4754
- cachedUint8Memory0 = null;
4755
-
4744
+ cachedDataViewMemory0 = null;
4745
+ cachedUint8ArrayMemory0 = null;
4756
4746
 
4757
- return wasm;
4747
+ if (typeof thread_stack_size !== 'undefined' && (typeof thread_stack_size !== 'number' || thread_stack_size === 0 || thread_stack_size % 65536 !== 0)) { throw 'invalid stack size' }
4748
+ wasm.__wbindgen_start(thread_stack_size);
4749
+ return wasm;
4758
4750
  }
4759
4751
 
4760
- function initSync(module) {
4752
+ function initSync(module, memory) {
4761
4753
  if (wasm !== undefined) return wasm;
4762
4754
 
4755
+ let thread_stack_size;
4756
+ if (typeof module !== 'undefined' && Object.getPrototypeOf(module) === Object.prototype)
4757
+ ({module, memory, thread_stack_size} = module);
4758
+ else
4759
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead');
4760
+
4763
4761
  const imports = __wbg_get_imports();
4764
4762
 
4765
- __wbg_init_memory(imports);
4763
+ __wbg_init_memory(imports, memory);
4766
4764
 
4767
4765
  if (!(module instanceof WebAssembly.Module)) {
4768
4766
  module = new WebAssembly.Module(module);
@@ -4770,27 +4768,87 @@ function initSync(module) {
4770
4768
 
4771
4769
  const instance = new WebAssembly.Instance(module, imports);
4772
4770
 
4773
- return __wbg_finalize_init(instance, module);
4771
+ return __wbg_finalize_init(instance, module, thread_stack_size);
4774
4772
  }
4775
4773
 
4776
- async function __wbg_init(input) {
4774
+ async function __wbg_init(module_or_path, memory) {
4777
4775
  if (wasm !== undefined) return wasm;
4778
4776
 
4779
- if (typeof input === 'undefined') {
4780
- input = new URL('aleo_wasm_bg.wasm', import.meta.url);
4781
- }
4777
+ let thread_stack_size;
4778
+ if (typeof module_or_path !== 'undefined' && Object.getPrototypeOf(module_or_path) === Object.prototype)
4779
+ ({module_or_path, memory, thread_stack_size} = module_or_path);
4780
+ else
4781
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead');
4782
+
4783
+
4782
4784
  const imports = __wbg_get_imports();
4783
4785
 
4784
- if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
4785
- input = fetch(input);
4786
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
4787
+ module_or_path = fetch(module_or_path);
4786
4788
  }
4787
4789
 
4788
- __wbg_init_memory(imports);
4790
+ __wbg_init_memory(imports, memory);
4789
4791
 
4790
- const { instance, module } = await __wbg_load(await input, imports);
4792
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
4791
4793
 
4792
- return __wbg_finalize_init(instance, module);
4794
+ return __wbg_finalize_init(instance, module, thread_stack_size);
4793
4795
  }
4794
4796
 
4795
- export { initSync }
4796
- export default __wbg_init;
4797
+ var exports = /*#__PURE__*/Object.freeze({
4798
+ __proto__: null,
4799
+ Address: Address,
4800
+ AuthorizationResponse: AuthorizationResponse,
4801
+ Execution: Execution,
4802
+ ExecutionResponse: ExecutionResponse,
4803
+ Field: Field,
4804
+ KeyPair: KeyPair,
4805
+ Metadata: Metadata,
4806
+ OfflineQuery: OfflineQuery,
4807
+ Plaintext: Plaintext,
4808
+ PrivateKey: PrivateKey,
4809
+ PrivateKeyCiphertext: PrivateKeyCiphertext,
4810
+ Program: Program,
4811
+ ProgramManager: ProgramManager,
4812
+ ProvingKey: ProvingKey,
4813
+ RecordCiphertext: RecordCiphertext,
4814
+ RecordPlaintext: RecordPlaintext,
4815
+ Signature: Signature,
4816
+ Transaction: Transaction,
4817
+ VerifyingKey: VerifyingKey,
4818
+ ViewKey: ViewKey,
4819
+ default: __wbg_init,
4820
+ initSync: initSync,
4821
+ initThreadPool: initThreadPool,
4822
+ init_panic_hook: init_panic_hook,
4823
+ runRayonThread: runRayonThread,
4824
+ verifyFunctionExecution: verifyFunctionExecution
4825
+ });
4826
+
4827
+ const wasm_path = "aleo_wasm.wasm";
4828
+
4829
+
4830
+ var Cargo = async (opt = {}) => {
4831
+ let {importHook, serverPath, initializeHook} = opt;
4832
+
4833
+ let final_path = wasm_path;
4834
+
4835
+ if (serverPath != null) {
4836
+ final_path = serverPath + /[^\/\\]*$/.exec(final_path)[0];
4837
+ }
4838
+
4839
+ if (importHook != null) {
4840
+ final_path = importHook(final_path);
4841
+ }
4842
+
4843
+ if (initializeHook != null) {
4844
+ await initializeHook(__wbg_init, final_path);
4845
+
4846
+ } else {
4847
+ await __wbg_init(final_path);
4848
+ }
4849
+
4850
+ return exports;
4851
+ };
4852
+
4853
+ export { Cargo as default };
4854
+ //# sourceMappingURL=aleo_wasm.js.map