saito-wasm 0.2.240 → 0.2.243

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/pkg/node/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  let imports = {};
2
2
  imports['__wbindgen_placeholder__'] = module.exports;
3
3
  let wasm;
4
- const { MsgHandler } = require(String.raw`./snippets/saito-wasm-9fecb2991d64dbbe/js/msg_handler.js`);
4
+ const { MsgHandler } = require(String.raw`./snippets/saito-wasm-6523703f0a873c92/js/msg_handler.js`);
5
5
  const { TextDecoder, TextEncoder } = require(`util`);
6
6
 
7
7
  const heap = new Array(128).fill(undefined);
@@ -225,7 +225,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
225
225
  return real;
226
226
  }
227
227
  function __wbg_adapter_40(arg0, arg1, arg2) {
228
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h39c9a967ba047c79(arg0, arg1, addHeapObject(arg2));
228
+ wasm._dyn_core_9b3796e30d99ddb7___ops__function__FnMut_______Output______as_wasm_bindgen_9c0a948636c8b8c4___closure__WasmClosure___describe__invoke___wasm_bindgen_9c0a948636c8b8c4___JsValue_____(arg0, arg1, addHeapObject(arg2));
229
229
  }
230
230
 
231
231
  function handleError(f, args) {
@@ -235,8 +235,8 @@ function handleError(f, args) {
235
235
  wasm.__wbindgen_exn_store(addHeapObject(e));
236
236
  }
237
237
  }
238
- function __wbg_adapter_83(arg0, arg1, arg2, arg3) {
239
- wasm.wasm_bindgen__convert__closures__invoke2_mut__h01747b21cbcb5f0a(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
238
+ function __wbg_adapter_91(arg0, arg1, arg2, arg3) {
239
+ wasm.wasm_bindgen_9c0a948636c8b8c4___convert__closures__invoke2_mut___wasm_bindgen_9c0a948636c8b8c4___JsValue__wasm_bindgen_9c0a948636c8b8c4___JsValue_____(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
240
240
  }
241
241
 
242
242
  function _assertClass(instance, klass) {
@@ -245,76 +245,159 @@ function _assertClass(instance, klass) {
245
245
  }
246
246
  return instance.ptr;
247
247
  }
248
+ /**
249
+ * @param {string} json
250
+ * @returns {string}
251
+ */
252
+ module.exports.get_script_address = function(json) {
253
+ let deferred1_0;
254
+ let deferred1_1;
255
+ try {
256
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
257
+ wasm.get_script_address(retptr, addHeapObject(json));
258
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
259
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
260
+ deferred1_0 = r0;
261
+ deferred1_1 = r1;
262
+ return getStringFromWasm0(r0, r1);
263
+ } finally {
264
+ wasm.__wbindgen_add_to_stack_pointer(16);
265
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
266
+ }
267
+ };
248
268
 
249
- let stack_pointer = 128;
250
-
251
- function addBorrowedObject(obj) {
252
- if (stack_pointer == 1) throw new Error('out of js stack');
253
- heap[--stack_pointer] = obj;
254
- return stack_pointer;
255
- }
256
269
  /**
270
+ * @param {string} script_json
271
+ * @param {string} witness_json
257
272
  * @returns {string}
258
273
  */
259
- module.exports.generate_private_key = function() {
260
- const ret = wasm.generate_private_key();
274
+ module.exports.merge_witness = function(script_json, witness_json) {
275
+ let deferred1_0;
276
+ let deferred1_1;
277
+ try {
278
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
279
+ wasm.merge_witness(retptr, addHeapObject(script_json), addHeapObject(witness_json));
280
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
281
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
282
+ deferred1_0 = r0;
283
+ deferred1_1 = r1;
284
+ return getStringFromWasm0(r0, r1);
285
+ } finally {
286
+ wasm.__wbindgen_add_to_stack_pointer(16);
287
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
288
+ }
289
+ };
290
+
291
+ /**
292
+ * @param {string} public_key
293
+ * @returns {Promise<Array<any>>}
294
+ */
295
+ module.exports.get_account_slips = function(public_key) {
296
+ const ret = wasm.get_account_slips(addHeapObject(public_key));
261
297
  return takeObject(ret);
262
298
  };
263
299
 
264
300
  /**
265
- * @returns {Promise<boolean>}
301
+ * @param {Array<any>} keys
302
+ * @returns {Promise<WasmBalanceSnapshot>}
266
303
  */
267
- module.exports.produce_block_without_gt = function() {
268
- const ret = wasm.produce_block_without_gt();
304
+ module.exports.get_balance_snapshot = function(keys) {
305
+ const ret = wasm.get_balance_snapshot(addHeapObject(keys));
269
306
  return takeObject(ret);
270
307
  };
271
308
 
272
309
  /**
273
- * @param {bigint} peer_id
274
- * @param {string} public_key
310
+ * @param {bigint} threshold
275
311
  * @returns {Promise<void>}
276
312
  */
277
- module.exports.remove_stun_peer = function(peer_id, public_key) {
278
- const ret = wasm.remove_stun_peer(peer_id, addHeapObject(public_key));
313
+ module.exports.write_issuance_file = function(threshold) {
314
+ const ret = wasm.write_issuance_file(threshold);
279
315
  return takeObject(ret);
280
316
  };
281
317
 
282
318
  /**
283
- * @param {string | undefined} [url]
284
- * @returns {Promise<WasmNetworkPeer>}
319
+ * @returns {Promise<void>}
285
320
  */
286
- module.exports.create_network_peer = function(url) {
287
- var ptr0 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
321
+ module.exports.disable_producing_blocks_by_timer = function() {
322
+ const ret = wasm.disable_producing_blocks_by_timer();
323
+ return takeObject(ret);
324
+ };
325
+
326
+ /**
327
+ * @returns {Promise<void>}
328
+ */
329
+ module.exports.enable_producing_blocks_by_timer = function() {
330
+ const ret = wasm.enable_producing_blocks_by_timer();
331
+ return takeObject(ret);
332
+ };
333
+
334
+ let cachedUint32Memory0 = null;
335
+
336
+ function getUint32Memory0() {
337
+ if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) {
338
+ cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
339
+ }
340
+ return cachedUint32Memory0;
341
+ }
342
+
343
+ function passArrayJsValueToWasm0(array, malloc) {
344
+ const ptr = malloc(array.length * 4, 4) >>> 0;
345
+ const mem = getUint32Memory0();
346
+ for (let i = 0; i < array.length; i++) {
347
+ mem[ptr / 4 + i] = addHeapObject(array[i]);
348
+ }
349
+ WASM_VECTOR_LEN = array.length;
350
+ return ptr;
351
+ }
352
+ /**
353
+ * @param {(Uint8Array)[] | undefined} [extra_txs]
354
+ * @returns {Promise<boolean>}
355
+ */
356
+ module.exports.produce_block_with_gt = function(extra_txs) {
357
+ var ptr0 = isLikeNone(extra_txs) ? 0 : passArrayJsValueToWasm0(extra_txs, wasm.__wbindgen_malloc);
288
358
  var len0 = WASM_VECTOR_LEN;
289
- const ret = wasm.create_network_peer(ptr0, len0);
359
+ const ret = wasm.produce_block_with_gt(ptr0, len0);
290
360
  return takeObject(ret);
291
361
  };
292
362
 
293
363
  /**
364
+ * @param {(Uint8Array)[] | undefined} [extra_txs]
294
365
  * @returns {Promise<boolean>}
295
366
  */
296
- module.exports.produce_block_with_gt = function() {
297
- const ret = wasm.produce_block_with_gt();
367
+ module.exports.produce_block_without_gt = function(extra_txs) {
368
+ var ptr0 = isLikeNone(extra_txs) ? 0 : passArrayJsValueToWasm0(extra_txs, wasm.__wbindgen_malloc);
369
+ var len0 = WASM_VECTOR_LEN;
370
+ const ret = wasm.produce_block_without_gt(ptr0, len0);
298
371
  return takeObject(ret);
299
372
  };
300
373
 
301
374
  /**
302
- * @returns {Promise<string>}
375
+ * @param {WasmBalanceSnapshot} snapshot
376
+ * @returns {Promise<void>}
303
377
  */
304
- module.exports.get_latest_block_hash = function() {
305
- const ret = wasm.get_latest_block_hash();
378
+ module.exports.update_from_balance_snapshot = function(snapshot) {
379
+ _assertClass(snapshot, WasmBalanceSnapshot);
380
+ var ptr0 = snapshot.__destroy_into_raw();
381
+ const ret = wasm.update_from_balance_snapshot(ptr0);
382
+ return takeObject(ret);
383
+ };
384
+
385
+ /**
386
+ * @returns {string}
387
+ */
388
+ module.exports.generate_private_key = function() {
389
+ const ret = wasm.generate_private_key();
306
390
  return takeObject(ret);
307
391
  };
308
392
 
309
393
  /**
310
- * @param {Uint8Array} buffer
311
394
  * @param {string} private_key
312
395
  * @returns {string}
313
396
  */
314
- module.exports.sign_buffer = function(buffer, private_key) {
397
+ module.exports.generate_public_key = function(private_key) {
315
398
  try {
316
399
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
317
- wasm.sign_buffer(retptr, addHeapObject(buffer), addHeapObject(private_key));
400
+ wasm.generate_public_key(retptr, addHeapObject(private_key));
318
401
  var r0 = getInt32Memory0()[retptr / 4 + 0];
319
402
  var r1 = getInt32Memory0()[retptr / 4 + 1];
320
403
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -327,6 +410,14 @@ module.exports.sign_buffer = function(buffer, private_key) {
327
410
  }
328
411
  };
329
412
 
413
+ /**
414
+ * @returns {Promise<WasmWallet>}
415
+ */
416
+ module.exports.get_wallet = function() {
417
+ const ret = wasm.get_wallet();
418
+ return takeObject(ret);
419
+ };
420
+
330
421
  /**
331
422
  * @returns {WasmNetwork}
332
423
  */
@@ -336,151 +427,176 @@ module.exports.get_network = function() {
336
427
  };
337
428
 
338
429
  /**
339
- * @param {Uint8Array} buffer
340
- * @returns {string}
430
+ * @returns {Promise<WasmBlockchain>}
341
431
  */
342
- module.exports.hash = function(buffer) {
343
- const ret = wasm.hash(addHeapObject(buffer));
432
+ module.exports.get_blockchain = function() {
433
+ const ret = wasm.get_blockchain();
344
434
  return takeObject(ret);
345
435
  };
346
436
 
347
437
  /**
348
- * @returns {Promise<WasmBlockchain>}
438
+ * @returns {Promise<Array<any>>}
349
439
  */
350
- module.exports.get_blockchain = function() {
351
- const ret = wasm.get_blockchain();
440
+ module.exports.get_mempool_txs = function() {
441
+ const ret = wasm.get_mempool_txs();
352
442
  return takeObject(ret);
353
443
  };
354
444
 
355
445
  /**
356
- * @param {bigint} duration_in_ms
357
- * @returns {Promise<void>}
446
+ * @param {string} key
447
+ * @returns {boolean}
358
448
  */
359
- module.exports.process_timer_event = function(duration_in_ms) {
360
- const ret = wasm.process_timer_event(duration_in_ms);
361
- return takeObject(ret);
449
+ module.exports.isPublicKey = function(key) {
450
+ const ret = wasm.isPublicKey(addHeapObject(key));
451
+ return ret !== 0;
362
452
  };
363
453
 
364
454
  /**
365
- * @param {Uint8Array} buffer
366
- * @param {Uint8Array} hash
367
- * @param {bigint} block_id
368
- * @param {bigint} peer_id
369
- * @returns {Promise<void>}
455
+ * @param {string | undefined} [url]
456
+ * @returns {Promise<WasmNetworkPeer>}
370
457
  */
371
- module.exports.process_fetched_block = function(buffer, hash, block_id, peer_id) {
372
- const ret = wasm.process_fetched_block(addHeapObject(buffer), addHeapObject(hash), block_id, peer_id);
458
+ module.exports.create_network_peer = function(url) {
459
+ var ptr0 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
460
+ var len0 = WASM_VECTOR_LEN;
461
+ const ret = wasm.create_network_peer(ptr0, len0);
373
462
  return takeObject(ret);
374
463
  };
375
464
 
376
465
  /**
377
- * @param {string} json
378
- * @returns {Promise<number>}
466
+ * @param {string} config_json
467
+ * @param {string} private_key
468
+ * @param {number} log_level_num
469
+ * @param {bigint} hasten_multiplier
470
+ * @param {boolean} delete_old_blocks
471
+ * @returns {Promise<any>}
379
472
  */
380
- module.exports.evaluate_script = function(json) {
381
- const ret = wasm.evaluate_script(addHeapObject(json));
473
+ module.exports.initialize = function(config_json, private_key, log_level_num, hasten_multiplier, delete_old_blocks) {
474
+ const ret = wasm.initialize(addHeapObject(config_json), addHeapObject(private_key), log_level_num, hasten_multiplier, delete_old_blocks);
382
475
  return takeObject(ret);
383
476
  };
384
477
 
385
478
  /**
386
- * @returns {Promise<void>}
479
+ * @returns {Promise<Array<any>>}
387
480
  */
388
- module.exports.disable_producing_blocks_by_timer = function() {
389
- const ret = wasm.disable_producing_blocks_by_timer();
481
+ module.exports.get_nft_list = function() {
482
+ const ret = wasm.get_nft_list();
390
483
  return takeObject(ret);
391
484
  };
392
485
 
393
486
  /**
394
- * @returns {Promise<WasmWallet>}
487
+ * @param {bigint} duration_in_ms
488
+ * @returns {Promise<void>}
395
489
  */
396
- module.exports.get_wallet = function() {
397
- const ret = wasm.get_wallet();
490
+ module.exports.process_timer_event = function(duration_in_ms) {
491
+ const ret = wasm.process_timer_event(duration_in_ms);
398
492
  return takeObject(ret);
399
493
  };
400
494
 
401
495
  /**
402
- * @param {string} block_hash
403
- * @returns {Promise<WasmBlock>}
496
+ * @param {bigint} current_time
497
+ * @returns {Promise<void>}
404
498
  */
405
- module.exports.get_block = function(block_hash) {
406
- const ret = wasm.get_block(addHeapObject(block_hash));
499
+ module.exports.process_stat_interval = function(current_time) {
500
+ const ret = wasm.process_stat_interval(current_time);
407
501
  return takeObject(ret);
408
502
  };
409
503
 
410
504
  /**
411
- * @returns {Promise<Array<any>>}
505
+ * @param {Uint8Array} buffer
506
+ * @returns {string}
412
507
  */
413
- module.exports.get_mempool_txs = function() {
414
- const ret = wasm.get_mempool_txs();
508
+ module.exports.hash = function(buffer) {
509
+ const ret = wasm.hash(addHeapObject(buffer));
415
510
  return takeObject(ret);
416
511
  };
417
512
 
418
513
  /**
419
- * @param {WasmBalanceSnapshot} snapshot
420
- * @returns {Promise<void>}
514
+ * @param {Uint8Array} buffer
515
+ * @param {string} private_key
516
+ * @returns {string}
421
517
  */
422
- module.exports.update_from_balance_snapshot = function(snapshot) {
423
- _assertClass(snapshot, WasmBalanceSnapshot);
424
- var ptr0 = snapshot.__destroy_into_raw();
425
- const ret = wasm.update_from_balance_snapshot(ptr0);
426
- return takeObject(ret);
518
+ module.exports.sign_buffer = function(buffer, private_key) {
519
+ try {
520
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
521
+ wasm.sign_buffer(retptr, addHeapObject(buffer), addHeapObject(private_key));
522
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
523
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
524
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
525
+ if (r2) {
526
+ throw takeObject(r1);
527
+ }
528
+ return takeObject(r0);
529
+ } finally {
530
+ wasm.__wbindgen_add_to_stack_pointer(16);
531
+ }
427
532
  };
428
533
 
429
534
  /**
430
- * @param {string} key
535
+ * @param {Uint8Array} buffer
536
+ * @param {string} signature
537
+ * @param {string} public_key
431
538
  * @returns {boolean}
432
539
  */
433
- module.exports.isPublicKey = function(key) {
434
- const ret = wasm.isPublicKey(addHeapObject(key));
540
+ module.exports.verify_signature = function(buffer, signature, public_key) {
541
+ const ret = wasm.verify_signature(addHeapObject(buffer), addHeapObject(signature), addHeapObject(public_key));
435
542
  return ret !== 0;
436
543
  };
437
544
 
438
545
  /**
439
- * @param {bigint} peer_id
440
- * @returns {Promise<void>}
546
+ * @param {string} json
547
+ * @returns {Promise<number>}
441
548
  */
442
- module.exports.process_peer_disconnection = function(peer_id) {
443
- const ret = wasm.process_peer_disconnection(peer_id);
549
+ module.exports.evaluate_script = function(json) {
550
+ const ret = wasm.evaluate_script(addHeapObject(json));
444
551
  return takeObject(ret);
445
552
  };
446
553
 
447
554
  /**
448
- * @param {string} config_json
449
- * @param {string} private_key
450
- * @param {number} log_level_num
451
- * @param {bigint} hasten_multiplier
452
- * @param {boolean} delete_old_blocks
453
- * @returns {Promise<any>}
555
+ * @param {string} json
556
+ * @param {WasmTransaction} tx
557
+ * @returns {Promise<number>}
454
558
  */
455
- module.exports.initialize = function(config_json, private_key, log_level_num, hasten_multiplier, delete_old_blocks) {
456
- const ret = wasm.initialize(addHeapObject(config_json), addHeapObject(private_key), log_level_num, hasten_multiplier, delete_old_blocks);
559
+ module.exports.evaluate_script_with_transaction = function(json, tx) {
560
+ _assertClass(tx, WasmTransaction);
561
+ const ret = wasm.evaluate_script_with_transaction(addHeapObject(json), tx.__wbg_ptr);
457
562
  return takeObject(ret);
458
563
  };
459
564
 
460
565
  /**
461
- * @param {bigint} current_time
462
- * @returns {Promise<void>}
566
+ * @param {string} json
567
+ * @returns {string}
463
568
  */
464
- module.exports.process_stat_interval = function(current_time) {
465
- const ret = wasm.process_stat_interval(current_time);
466
- return takeObject(ret);
569
+ module.exports.get_script_hash = function(json) {
570
+ let deferred1_0;
571
+ let deferred1_1;
572
+ try {
573
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
574
+ wasm.get_script_hash(retptr, addHeapObject(json));
575
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
576
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
577
+ deferred1_0 = r0;
578
+ deferred1_1 = r1;
579
+ return getStringFromWasm0(r0, r1);
580
+ } finally {
581
+ wasm.__wbindgen_add_to_stack_pointer(16);
582
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
583
+ }
467
584
  };
468
585
 
469
586
  /**
470
- * @param {bigint} threshold
471
- * @returns {Promise<void>}
587
+ * @returns {Promise<string>}
472
588
  */
473
- module.exports.write_issuance_file = function(threshold) {
474
- const ret = wasm.write_issuance_file(threshold);
589
+ module.exports.get_latest_block_hash = function() {
590
+ const ret = wasm.get_latest_block_hash();
475
591
  return takeObject(ret);
476
592
  };
477
593
 
478
594
  /**
479
- * @param {Array<any>} keys
480
- * @returns {Promise<WasmBalanceSnapshot>}
595
+ * @param {string} block_hash
596
+ * @returns {Promise<WasmBlock>}
481
597
  */
482
- module.exports.get_balance_snapshot = function(keys) {
483
- const ret = wasm.get_balance_snapshot(addHeapObject(keys));
598
+ module.exports.get_block = function(block_hash) {
599
+ const ret = wasm.get_block(addHeapObject(block_hash));
484
600
  return takeObject(ret);
485
601
  };
486
602
 
@@ -493,73 +609,56 @@ module.exports.process_new_peer = function(peer_id, initiate_handshake) {
493
609
  const ret = wasm.process_new_peer(peer_id, initiate_handshake);
494
610
  return takeObject(ret);
495
611
  };
496
-
497
- /**
498
- * @param {Uint8Array} buffer
499
- * @param {string} signature
500
- * @param {string} public_key
501
- * @returns {boolean}
502
- */
503
- module.exports.verify_signature = function(buffer, signature, public_key) {
504
- const ret = wasm.verify_signature(addHeapObject(buffer), addHeapObject(signature), addHeapObject(public_key));
505
- return ret !== 0;
506
- };
507
-
508
- /**
509
- * @param {Uint8Array} buffer
510
- * @param {WasmNetworkPeer} peer
511
- * @returns {Promise<Uint8Array>}
612
+
613
+ /**
614
+ * @param {bigint} peer_id
615
+ * @param {string} public_key
616
+ * @returns {Promise<void>}
512
617
  */
513
- module.exports.process_msg_buffer_from_peer = function(buffer, peer) {
514
- _assertClass(peer, WasmNetworkPeer);
515
- const ret = wasm.process_msg_buffer_from_peer(addHeapObject(buffer), peer.__wbg_ptr);
618
+ module.exports.process_stun_peer = function(peer_id, public_key) {
619
+ const ret = wasm.process_stun_peer(peer_id, addHeapObject(public_key));
516
620
  return takeObject(ret);
517
621
  };
518
622
 
519
623
  /**
520
- * @param {string} private_key
521
- * @returns {string}
624
+ * @param {bigint} peer_id
625
+ * @param {string} public_key
626
+ * @returns {Promise<void>}
522
627
  */
523
- module.exports.generate_public_key = function(private_key) {
524
- try {
525
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
526
- wasm.generate_public_key(retptr, addHeapObject(private_key));
527
- var r0 = getInt32Memory0()[retptr / 4 + 0];
528
- var r1 = getInt32Memory0()[retptr / 4 + 1];
529
- var r2 = getInt32Memory0()[retptr / 4 + 2];
530
- if (r2) {
531
- throw takeObject(r1);
532
- }
533
- return takeObject(r0);
534
- } finally {
535
- wasm.__wbindgen_add_to_stack_pointer(16);
536
- }
628
+ module.exports.remove_stun_peer = function(peer_id, public_key) {
629
+ const ret = wasm.remove_stun_peer(peer_id, addHeapObject(public_key));
630
+ return takeObject(ret);
537
631
  };
538
632
 
539
633
  /**
540
- * @returns {Promise<Array<any>>}
634
+ * @param {bigint} peer_id
635
+ * @returns {Promise<void>}
541
636
  */
542
- module.exports.get_nft_list = function() {
543
- const ret = wasm.get_nft_list();
637
+ module.exports.process_peer_disconnection = function(peer_id) {
638
+ const ret = wasm.process_peer_disconnection(peer_id);
544
639
  return takeObject(ret);
545
640
  };
546
641
 
547
642
  /**
548
- * @param {string} public_key
549
- * @returns {Promise<Array<any>>}
643
+ * @param {Uint8Array} buffer
644
+ * @param {WasmNetworkPeer} peer
645
+ * @returns {Promise<Uint8Array>}
550
646
  */
551
- module.exports.get_account_slips = function(public_key) {
552
- const ret = wasm.get_account_slips(addHeapObject(public_key));
647
+ module.exports.process_msg_buffer_from_peer = function(buffer, peer) {
648
+ _assertClass(peer, WasmNetworkPeer);
649
+ const ret = wasm.process_msg_buffer_from_peer(addHeapObject(buffer), peer.__wbg_ptr);
553
650
  return takeObject(ret);
554
651
  };
555
652
 
556
653
  /**
654
+ * @param {Uint8Array} buffer
655
+ * @param {Uint8Array} hash
656
+ * @param {bigint} block_id
557
657
  * @param {bigint} peer_id
558
- * @param {string} public_key
559
658
  * @returns {Promise<void>}
560
659
  */
561
- module.exports.process_stun_peer = function(peer_id, public_key) {
562
- const ret = wasm.process_stun_peer(peer_id, addHeapObject(public_key));
660
+ module.exports.process_fetched_block = function(buffer, hash, block_id, peer_id) {
661
+ const ret = wasm.process_fetched_block(addHeapObject(buffer), addHeapObject(hash), block_id, peer_id);
563
662
  return takeObject(ret);
564
663
  };
565
664
 
@@ -574,6 +673,14 @@ module.exports.process_failed_block_fetch = function(hash, block_id, peer_id) {
574
673
  return takeObject(ret);
575
674
  };
576
675
 
676
+ let stack_pointer = 128;
677
+
678
+ function addBorrowedObject(obj) {
679
+ if (stack_pointer == 1) throw new Error('out of js stack');
680
+ heap[--stack_pointer] = obj;
681
+ return stack_pointer;
682
+ }
683
+
577
684
  const SaitoWasmFinalization = (typeof FinalizationRegistry === 'undefined')
578
685
  ? { register: () => {}, unregister: () => {} }
579
686
  : new FinalizationRegistry(ptr => wasm.__wbg_saitowasm_free(ptr >>> 0));
@@ -1128,6 +1235,15 @@ class WasmBlockchain {
1128
1235
  wasm.__wbg_wasmblockchain_free(ptr);
1129
1236
  }
1130
1237
  /**
1238
+ * @param {number} count
1239
+ * @param {boolean} include_offchain
1240
+ * @returns {Promise<Array<any>>}
1241
+ */
1242
+ get_blocks(count, include_offchain) {
1243
+ const ret = wasm.wasmblockchain_get_blocks(this.__wbg_ptr, count, include_offchain);
1244
+ return takeObject(ret);
1245
+ }
1246
+ /**
1131
1247
  * @returns {Promise<string>}
1132
1248
  */
1133
1249
  get_fork_id() {
@@ -1144,6 +1260,15 @@ class WasmBlockchain {
1144
1260
  }
1145
1261
  /**
1146
1262
  * @param {bigint} block_id
1263
+ * @param {boolean} include_transactions
1264
+ * @returns {Promise<WasmBlock>}
1265
+ */
1266
+ get_block_by_id(block_id, include_transactions) {
1267
+ const ret = wasm.wasmblockchain_get_block_by_id(this.__wbg_ptr, block_id, include_transactions);
1268
+ return takeObject(ret);
1269
+ }
1270
+ /**
1271
+ * @param {bigint} block_id
1147
1272
  * @returns {Promise<Array<any>>}
1148
1273
  */
1149
1274
  get_hashes_at_id(block_id) {
@@ -1277,17 +1402,26 @@ class WasmBlockchain {
1277
1402
  return takeObject(ret);
1278
1403
  }
1279
1404
  /**
1280
- * @returns {any}
1405
+ * @returns {Promise<void>}
1281
1406
  */
1282
- get() {
1283
- const ret = wasm.wasmblockchain_get(this.__wbg_ptr);
1407
+ reset() {
1408
+ const ret = wasm.wasmblockchain_reset(this.__wbg_ptr);
1284
1409
  return takeObject(ret);
1285
1410
  }
1286
1411
  /**
1287
- * @returns {Promise<void>}
1412
+ * @param {string} block_hash
1413
+ * @param {boolean} include_transactions
1414
+ * @returns {Promise<WasmBlock>}
1288
1415
  */
1289
- reset() {
1290
- const ret = wasm.wasmblockchain_reset(this.__wbg_ptr);
1416
+ get_block(block_hash, include_transactions) {
1417
+ const ret = wasm.wasmblockchain_get_block(this.__wbg_ptr, addHeapObject(block_hash), include_transactions);
1418
+ return takeObject(ret);
1419
+ }
1420
+ /**
1421
+ * @returns {any}
1422
+ */
1423
+ get() {
1424
+ const ret = wasm.wasmblockchain_get(this.__wbg_ptr);
1291
1425
  return takeObject(ret);
1292
1426
  }
1293
1427
  }
@@ -1702,6 +1836,21 @@ class WasmNetwork {
1702
1836
  return takeObject(ret);
1703
1837
  }
1704
1838
  /**
1839
+ * @param {string} key
1840
+ * @returns {Promise<WasmPeer | undefined>}
1841
+ */
1842
+ getPeer(key) {
1843
+ const ret = wasm.wasmnetwork_getPeer(this.__wbg_ptr, addHeapObject(key));
1844
+ return takeObject(ret);
1845
+ }
1846
+ /**
1847
+ * @returns {Promise<Array<any>>}
1848
+ */
1849
+ getPeers() {
1850
+ const ret = wasm.wasmnetwork_getPeers(this.__wbg_ptr);
1851
+ return takeObject(ret);
1852
+ }
1853
+ /**
1705
1854
  * @returns {WasmNetworkApi}
1706
1855
  */
1707
1856
  get api() {
@@ -1722,21 +1871,6 @@ class WasmNetwork {
1722
1871
  const ret = wasm.wasmnetwork_api(this.__wbg_ptr);
1723
1872
  return WasmPeers.__wrap(ret);
1724
1873
  }
1725
- /**
1726
- * @param {string} key
1727
- * @returns {Promise<WasmPeer | undefined>}
1728
- */
1729
- getPeer(key) {
1730
- const ret = wasm.wasmnetwork_getPeer(this.__wbg_ptr, addHeapObject(key));
1731
- return takeObject(ret);
1732
- }
1733
- /**
1734
- * @returns {Promise<Array<any>>}
1735
- */
1736
- getPeers() {
1737
- const ret = wasm.wasmnetwork_getPeers(this.__wbg_ptr);
1738
- return takeObject(ret);
1739
- }
1740
1874
  }
1741
1875
  module.exports.WasmNetwork = WasmNetwork;
1742
1876
 
@@ -1833,13 +1967,6 @@ class WasmNetworkPeer {
1833
1967
  return takeObject(ret);
1834
1968
  }
1835
1969
  /**
1836
- * @returns {bigint}
1837
- */
1838
- get_id() {
1839
- const ret = wasm.wasmnetworkpeer_get_id(this.__wbg_ptr);
1840
- return BigInt.asUintN(64, ret);
1841
- }
1842
- /**
1843
1970
  * @returns {Promise<string>}
1844
1971
  */
1845
1972
  get_url() {
@@ -1847,6 +1974,13 @@ class WasmNetworkPeer {
1847
1974
  return takeObject(ret);
1848
1975
  }
1849
1976
  /**
1977
+ * @returns {bigint}
1978
+ */
1979
+ get_id() {
1980
+ const ret = wasm.wasmnetworkpeer_get_id(this.__wbg_ptr);
1981
+ return BigInt.asUintN(64, ret);
1982
+ }
1983
+ /**
1850
1984
  * @param {bigint} peer_id
1851
1985
  */
1852
1986
  constructor(peer_id) {
@@ -1906,6 +2040,13 @@ class WasmPeer {
1906
2040
  return takeObject(ret);
1907
2041
  }
1908
2042
  /**
2043
+ * @returns {string}
2044
+ */
2045
+ get protocol() {
2046
+ const ret = wasm.wasmpeer_get_protocol(this.__wbg_ptr);
2047
+ return takeObject(ret);
2048
+ }
2049
+ /**
1909
2050
  * @returns {any}
1910
2051
  */
1911
2052
  get services() {
@@ -1939,6 +2080,20 @@ class WasmPeer {
1939
2080
  const ret = wasm.wasmnetworkpeer_get_id(this.__wbg_ptr);
1940
2081
  return BigInt.asUintN(64, ret);
1941
2082
  }
2083
+ /**
2084
+ * @returns {string}
2085
+ */
2086
+ get host() {
2087
+ const ret = wasm.wasmpeer_get_host(this.__wbg_ptr);
2088
+ return takeObject(ret);
2089
+ }
2090
+ /**
2091
+ * @returns {number}
2092
+ */
2093
+ get port() {
2094
+ const ret = wasm.wasmpeer_get_port(this.__wbg_ptr);
2095
+ return ret;
2096
+ }
1942
2097
  }
1943
2098
  module.exports.WasmPeer = WasmPeer;
1944
2099
 
@@ -2254,6 +2409,13 @@ class WasmTransaction {
2254
2409
  wasm.__wbg_wasmtransaction_free(ptr);
2255
2410
  }
2256
2411
  /**
2412
+ * @returns {Promise<void>}
2413
+ */
2414
+ sign() {
2415
+ const ret = wasm.wasmtransaction_sign(this.__wbg_ptr);
2416
+ return takeObject(ret);
2417
+ }
2418
+ /**
2257
2419
  * @returns {bigint}
2258
2420
  */
2259
2421
  get total_fees() {
@@ -2368,13 +2530,6 @@ class WasmTransaction {
2368
2530
  return takeObject(ret);
2369
2531
  }
2370
2532
  /**
2371
- * @returns {Promise<void>}
2372
- */
2373
- sign() {
2374
- const ret = wasm.wasmtransaction_sign(this.__wbg_ptr);
2375
- return takeObject(ret);
2376
- }
2377
- /**
2378
2533
  * @param {string} key
2379
2534
  * @returns {boolean}
2380
2535
  */
@@ -2655,13 +2810,6 @@ class WasmWallet {
2655
2810
  return takeObject(ret);
2656
2811
  }
2657
2812
  /**
2658
- * @returns {any}
2659
- */
2660
- get() {
2661
- const ret = wasm.wasmwallet_get(this.__wbg_ptr);
2662
- return takeObject(ret);
2663
- }
2664
- /**
2665
2813
  * @param {Array<any>} public_keys
2666
2814
  * @param {BigUint64Array} amounts
2667
2815
  * @param {bigint} fee
@@ -2736,6 +2884,13 @@ class WasmWallet {
2736
2884
  const ret = wasm.wasmwallet_get_slips(this.__wbg_ptr);
2737
2885
  return takeObject(ret);
2738
2886
  }
2887
+ /**
2888
+ * @returns {any}
2889
+ */
2890
+ get() {
2891
+ const ret = wasm.wasmwallet_get(this.__wbg_ptr);
2892
+ return takeObject(ret);
2893
+ }
2739
2894
  }
2740
2895
  module.exports.WasmWallet = WasmWallet;
2741
2896
 
@@ -3041,49 +3196,57 @@ module.exports.__wbg_call_27c0f87801dedf93 = function() { return handleError(fun
3041
3196
  return addHeapObject(ret);
3042
3197
  }, arguments) };
3043
3198
 
3044
- module.exports.__wbg_length_c20a40f15020d68a = function(arg0) {
3045
- const ret = getObject(arg0).length;
3199
+ module.exports.__wbg_iterator_2cee6dadfd956dfa = function() {
3200
+ const ret = Symbol.iterator;
3201
+ return addHeapObject(ret);
3202
+ };
3203
+
3204
+ module.exports.__wbg_get_e3c254076557e348 = function() { return handleError(function (arg0, arg1) {
3205
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
3206
+ return addHeapObject(ret);
3207
+ }, arguments) };
3208
+
3209
+ module.exports.__wbg_next_40fc327bfc8770e6 = function(arg0) {
3210
+ const ret = getObject(arg0).next;
3211
+ return addHeapObject(ret);
3212
+ };
3213
+
3214
+ module.exports.__wbg_push_a5b05aedc7234f9f = function(arg0, arg1) {
3215
+ const ret = getObject(arg0).push(getObject(arg1));
3046
3216
  return ret;
3047
3217
  };
3048
3218
 
3049
- module.exports.__wbg_new_5b2a2842270c66e6 = function(arg0) {
3050
- const ret = new BigUint64Array(getObject(arg0));
3219
+ module.exports.__wbg_new_16b304a2cfa7ff4a = function() {
3220
+ const ret = new Array();
3051
3221
  return addHeapObject(ret);
3052
3222
  };
3053
3223
 
3054
- module.exports.__wbg_set_dc7aa8fdca321349 = function(arg0, arg1, arg2) {
3055
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
3224
+ module.exports.__wbg_newwithlength_66ae46612e7f0234 = function(arg0) {
3225
+ const ret = new Array(arg0 >>> 0);
3226
+ return addHeapObject(ret);
3056
3227
  };
3057
3228
 
3058
- module.exports.__wbg_newwithbyteoffsetandlength_f3784c11ba58e531 = function(arg0, arg1, arg2) {
3059
- const ret = new BigUint64Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
3229
+ module.exports.__wbg_get_bd8e338fbd5f5cc8 = function(arg0, arg1) {
3230
+ const ret = getObject(arg0)[arg1 >>> 0];
3060
3231
  return addHeapObject(ret);
3061
3232
  };
3062
3233
 
3063
- module.exports.__wbg_length_a641162bc8055216 = function(arg0) {
3064
- const ret = getObject(arg0).length;
3234
+ module.exports.__wbg_set_d4638f722068f043 = function(arg0, arg1, arg2) {
3235
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
3236
+ };
3237
+
3238
+ module.exports.__wbg_isArray_2ab64d95e09ea0ae = function(arg0) {
3239
+ const ret = Array.isArray(getObject(arg0));
3065
3240
  return ret;
3066
3241
  };
3067
3242
 
3068
- module.exports.__wbg_instanceof_Uint8Array_2b3bbecd033d19f6 = function(arg0) {
3069
- let result;
3070
- try {
3071
- result = getObject(arg0) instanceof Uint8Array;
3072
- } catch (_) {
3073
- result = false;
3074
- }
3075
- const ret = result;
3243
+ module.exports.__wbg_length_cd7af8117672b8b8 = function(arg0) {
3244
+ const ret = getObject(arg0).length;
3076
3245
  return ret;
3077
3246
  };
3078
3247
 
3079
- module.exports.__wbg_instanceof_ArrayBuffer_836825be07d4c9d2 = function(arg0) {
3080
- let result;
3081
- try {
3082
- result = getObject(arg0) instanceof ArrayBuffer;
3083
- } catch (_) {
3084
- result = false;
3085
- }
3086
- const ret = result;
3248
+ module.exports.__wbg_valueOf_b4771ea2a1ea7469 = function(arg0) {
3249
+ const ret = getObject(arg0).valueOf();
3087
3250
  return ret;
3088
3251
  };
3089
3252
 
@@ -3097,52 +3260,52 @@ module.exports.__wbg_set_8417257aaedc936b = function(arg0, arg1, arg2) {
3097
3260
  return addHeapObject(ret);
3098
3261
  };
3099
3262
 
3100
- module.exports.__wbg_now_3014639a94423537 = function() {
3101
- const ret = Date.now();
3102
- return ret;
3103
- };
3263
+ module.exports.__wbg_call_b3ca7c6051f9bec1 = function() { return handleError(function (arg0, arg1, arg2) {
3264
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
3265
+ return addHeapObject(ret);
3266
+ }, arguments) };
3104
3267
 
3105
- module.exports.__wbg_newwithlength_66ae46612e7f0234 = function(arg0) {
3106
- const ret = new Array(arg0 >>> 0);
3268
+ module.exports.__wbg_call_8e7cb608789c2528 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
3269
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
3107
3270
  return addHeapObject(ret);
3108
- };
3271
+ }, arguments) };
3109
3272
 
3110
- module.exports.__wbg_get_bd8e338fbd5f5cc8 = function(arg0, arg1) {
3111
- const ret = getObject(arg0)[arg1 >>> 0];
3273
+ module.exports.__wbg_call_938992c832f74314 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
3274
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4));
3112
3275
  return addHeapObject(ret);
3113
- };
3276
+ }, arguments) };
3114
3277
 
3115
- module.exports.__wbg_new_16b304a2cfa7ff4a = function() {
3116
- const ret = new Array();
3117
- return addHeapObject(ret);
3278
+ module.exports.__wbg_now_3014639a94423537 = function() {
3279
+ const ret = Date.now();
3280
+ return ret;
3118
3281
  };
3119
3282
 
3120
- module.exports.__wbg_set_d4638f722068f043 = function(arg0, arg1, arg2) {
3121
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
3283
+ module.exports.__wbg_new_72fb9a18b5ae2624 = function() {
3284
+ const ret = new Object();
3285
+ return addHeapObject(ret);
3122
3286
  };
3123
3287
 
3124
- module.exports.__wbg_length_cd7af8117672b8b8 = function(arg0) {
3288
+ module.exports.__wbg_length_c20a40f15020d68a = function(arg0) {
3125
3289
  const ret = getObject(arg0).length;
3126
3290
  return ret;
3127
3291
  };
3128
3292
 
3129
- module.exports.__wbg_push_a5b05aedc7234f9f = function(arg0, arg1) {
3130
- const ret = getObject(arg0).push(getObject(arg1));
3131
- return ret;
3293
+ module.exports.__wbg_new_5b2a2842270c66e6 = function(arg0) {
3294
+ const ret = new BigUint64Array(getObject(arg0));
3295
+ return addHeapObject(ret);
3132
3296
  };
3133
3297
 
3134
- module.exports.__wbg_isArray_2ab64d95e09ea0ae = function(arg0) {
3135
- const ret = Array.isArray(getObject(arg0));
3136
- return ret;
3298
+ module.exports.__wbg_set_dc7aa8fdca321349 = function(arg0, arg1, arg2) {
3299
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
3137
3300
  };
3138
3301
 
3139
- module.exports.__wbg_new_72fb9a18b5ae2624 = function() {
3140
- const ret = new Object();
3302
+ module.exports.__wbg_newwithbyteoffsetandlength_f3784c11ba58e531 = function(arg0, arg1, arg2) {
3303
+ const ret = new BigUint64Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
3141
3304
  return addHeapObject(ret);
3142
3305
  };
3143
3306
 
3144
- module.exports.__wbg_valueOf_b4771ea2a1ea7469 = function(arg0) {
3145
- const ret = getObject(arg0).valueOf();
3307
+ module.exports.__wbg_length_a641162bc8055216 = function(arg0) {
3308
+ const ret = getObject(arg0).length;
3146
3309
  return ret;
3147
3310
  };
3148
3311
 
@@ -3153,7 +3316,7 @@ module.exports.__wbg_new_81740750da40724f = function(arg0, arg1) {
3153
3316
  const a = state0.a;
3154
3317
  state0.a = 0;
3155
3318
  try {
3156
- return __wbg_adapter_83(a, state0.b, arg0, arg1);
3319
+ return __wbg_adapter_91(a, state0.b, arg0, arg1);
3157
3320
  } finally {
3158
3321
  state0.a = a;
3159
3322
  }
@@ -3165,13 +3328,13 @@ module.exports.__wbg_new_81740750da40724f = function(arg0, arg1) {
3165
3328
  }
3166
3329
  };
3167
3330
 
3168
- module.exports.__wbg_then_0c86a60e8fcfe9f6 = function(arg0, arg1) {
3169
- const ret = getObject(arg0).then(getObject(arg1));
3331
+ module.exports.__wbg_resolve_b0083a7967828ec8 = function(arg0) {
3332
+ const ret = Promise.resolve(getObject(arg0));
3170
3333
  return addHeapObject(ret);
3171
3334
  };
3172
3335
 
3173
- module.exports.__wbg_resolve_b0083a7967828ec8 = function(arg0) {
3174
- const ret = Promise.resolve(getObject(arg0));
3336
+ module.exports.__wbg_then_0c86a60e8fcfe9f6 = function(arg0, arg1) {
3337
+ const ret = getObject(arg0).then(getObject(arg1));
3175
3338
  return addHeapObject(ret);
3176
3339
  };
3177
3340
 
@@ -3180,36 +3343,6 @@ module.exports.__wbg_set_1f9b04f170055d33 = function() { return handleError(func
3180
3343
  return ret;
3181
3344
  }, arguments) };
3182
3345
 
3183
- module.exports.__wbg_call_b3ca7c6051f9bec1 = function() { return handleError(function (arg0, arg1, arg2) {
3184
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
3185
- return addHeapObject(ret);
3186
- }, arguments) };
3187
-
3188
- module.exports.__wbg_call_8e7cb608789c2528 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
3189
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
3190
- return addHeapObject(ret);
3191
- }, arguments) };
3192
-
3193
- module.exports.__wbg_call_938992c832f74314 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
3194
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4));
3195
- return addHeapObject(ret);
3196
- }, arguments) };
3197
-
3198
- module.exports.__wbg_iterator_2cee6dadfd956dfa = function() {
3199
- const ret = Symbol.iterator;
3200
- return addHeapObject(ret);
3201
- };
3202
-
3203
- module.exports.__wbg_get_e3c254076557e348 = function() { return handleError(function (arg0, arg1) {
3204
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
3205
- return addHeapObject(ret);
3206
- }, arguments) };
3207
-
3208
- module.exports.__wbg_next_40fc327bfc8770e6 = function(arg0) {
3209
- const ret = getObject(arg0).next;
3210
- return addHeapObject(ret);
3211
- };
3212
-
3213
3346
  module.exports.__wbindgen_string_get = function(arg0, arg1) {
3214
3347
  const obj = getObject(arg1);
3215
3348
  const ret = typeof(obj) === 'string' ? obj : undefined;
@@ -3234,6 +3367,28 @@ module.exports.__wbg_value_d93c65011f51a456 = function(arg0) {
3234
3367
  return addHeapObject(ret);
3235
3368
  };
3236
3369
 
3370
+ module.exports.__wbg_instanceof_Uint8Array_2b3bbecd033d19f6 = function(arg0) {
3371
+ let result;
3372
+ try {
3373
+ result = getObject(arg0) instanceof Uint8Array;
3374
+ } catch (_) {
3375
+ result = false;
3376
+ }
3377
+ const ret = result;
3378
+ return ret;
3379
+ };
3380
+
3381
+ module.exports.__wbg_instanceof_ArrayBuffer_836825be07d4c9d2 = function(arg0) {
3382
+ let result;
3383
+ try {
3384
+ result = getObject(arg0) instanceof ArrayBuffer;
3385
+ } catch (_) {
3386
+ result = false;
3387
+ }
3388
+ const ret = result;
3389
+ return ret;
3390
+ };
3391
+
3237
3392
  module.exports.__wbindgen_number_new = function(arg0) {
3238
3393
  const ret = arg0;
3239
3394
  return addHeapObject(ret);
@@ -3248,7 +3403,72 @@ module.exports.__wbg_set_f975102236d3c502 = function(arg0, arg1, arg2) {
3248
3403
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
3249
3404
  };
3250
3405
 
3251
- module.exports.__wbg_flushdata_15c72fd141afd1f6 = function(arg0, arg1) {
3406
+ module.exports.__wbindgen_error_new = function(arg0, arg1) {
3407
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
3408
+ return addHeapObject(ret);
3409
+ };
3410
+
3411
+ module.exports.__wbg_getwithrefkey_edc2c8960f0f1191 = function(arg0, arg1) {
3412
+ const ret = getObject(arg0)[getObject(arg1)];
3413
+ return addHeapObject(ret);
3414
+ };
3415
+
3416
+ module.exports.__wbindgen_in = function(arg0, arg1) {
3417
+ const ret = getObject(arg0) in getObject(arg1);
3418
+ return ret;
3419
+ };
3420
+
3421
+ module.exports.__wbg_wasmpeer_new = function(arg0) {
3422
+ const ret = WasmPeer.__wrap(arg0);
3423
+ return addHeapObject(ret);
3424
+ };
3425
+
3426
+ module.exports.__wbg_wasmblock_new = function(arg0) {
3427
+ const ret = WasmBlock.__wrap(arg0);
3428
+ return addHeapObject(ret);
3429
+ };
3430
+
3431
+ module.exports.__wbg_wasmtransaction_new = function(arg0) {
3432
+ const ret = WasmTransaction.__wrap(arg0);
3433
+ return addHeapObject(ret);
3434
+ };
3435
+
3436
+ module.exports.__wbg_wasmwalletslip_new = function(arg0) {
3437
+ const ret = WasmWalletSlip.__wrap(arg0);
3438
+ return addHeapObject(ret);
3439
+ };
3440
+
3441
+ module.exports.__wbg_wasmnetworkpeer_new = function(arg0) {
3442
+ const ret = WasmNetworkPeer.__wrap(arg0);
3443
+ return addHeapObject(ret);
3444
+ };
3445
+
3446
+ module.exports.__wbg_wasmslip_new = function(arg0) {
3447
+ const ret = WasmSlip.__wrap(arg0);
3448
+ return addHeapObject(ret);
3449
+ };
3450
+
3451
+ module.exports.__wbg_wasmbalancesnapshot_new = function(arg0) {
3452
+ const ret = WasmBalanceSnapshot.__wrap(arg0);
3453
+ return addHeapObject(ret);
3454
+ };
3455
+
3456
+ module.exports.__wbg_wasmwallet_new = function(arg0) {
3457
+ const ret = WasmWallet.__wrap(arg0);
3458
+ return addHeapObject(ret);
3459
+ };
3460
+
3461
+ module.exports.__wbg_wasmblockchain_new = function(arg0) {
3462
+ const ret = WasmBlockchain.__wrap(arg0);
3463
+ return addHeapObject(ret);
3464
+ };
3465
+
3466
+ module.exports.__wbg_wasmnft_new = function(arg0) {
3467
+ const ret = WasmNFT.__wrap(arg0);
3468
+ return addHeapObject(ret);
3469
+ };
3470
+
3471
+ module.exports.__wbg_flushdata_9ece0e84eb7462e3 = function(arg0, arg1) {
3252
3472
  let deferred0_0;
3253
3473
  let deferred0_1;
3254
3474
  try {
@@ -3260,7 +3480,7 @@ module.exports.__wbg_flushdata_15c72fd141afd1f6 = function(arg0, arg1) {
3260
3480
  }
3261
3481
  };
3262
3482
 
3263
- module.exports.__wbg_readvalue_69a3f2e88a3c946e = function() { return handleError(function (arg0, arg1) {
3483
+ module.exports.__wbg_readvalue_67f8062fd6fa00ec = function() { return handleError(function (arg0, arg1) {
3264
3484
  let deferred0_0;
3265
3485
  let deferred0_1;
3266
3486
  try {
@@ -3273,15 +3493,15 @@ module.exports.__wbg_readvalue_69a3f2e88a3c946e = function() { return handleErro
3273
3493
  }
3274
3494
  }, arguments) };
3275
3495
 
3276
- module.exports.__wbg_loadwallet_513ce6acad23df9a = function() {
3496
+ module.exports.__wbg_loadwallet_1e41cbb5ea438afc = function() {
3277
3497
  MsgHandler.load_wallet();
3278
3498
  };
3279
3499
 
3280
- module.exports.__wbg_savewallet_9aec487e01fc9fd2 = function() {
3500
+ module.exports.__wbg_savewallet_515ec9471bebaf69 = function() {
3281
3501
  MsgHandler.save_wallet();
3282
3502
  };
3283
3503
 
3284
- module.exports.__wbg_writevalue_1520a480bb7c22ad = function(arg0, arg1, arg2) {
3504
+ module.exports.__wbg_writevalue_9b57371e9f40783d = function(arg0, arg1, arg2) {
3285
3505
  let deferred0_0;
3286
3506
  let deferred0_1;
3287
3507
  try {
@@ -3293,7 +3513,7 @@ module.exports.__wbg_writevalue_1520a480bb7c22ad = function(arg0, arg1, arg2) {
3293
3513
  }
3294
3514
  };
3295
3515
 
3296
- module.exports.__wbg_appendvalue_581d6c9ae5452456 = function(arg0, arg1, arg2) {
3516
+ module.exports.__wbg_appendvalue_85b932d641763676 = function(arg0, arg1, arg2) {
3297
3517
  let deferred0_0;
3298
3518
  let deferred0_1;
3299
3519
  try {
@@ -3305,7 +3525,7 @@ module.exports.__wbg_appendvalue_581d6c9ae5452456 = function(arg0, arg1, arg2) {
3305
3525
  }
3306
3526
  };
3307
3527
 
3308
- module.exports.__wbg_removevalue_dd1985a9a11c06d0 = function() { return handleError(function (arg0, arg1) {
3528
+ module.exports.__wbg_removevalue_f00e02247f09aa21 = function() { return handleError(function (arg0, arg1) {
3309
3529
  let deferred0_0;
3310
3530
  let deferred0_1;
3311
3531
  try {
@@ -3318,7 +3538,7 @@ module.exports.__wbg_removevalue_dd1985a9a11c06d0 = function() { return handleEr
3318
3538
  }
3319
3539
  }, arguments) };
3320
3540
 
3321
- module.exports.__wbg_sendmessage_f113d492eb4524b5 = function(arg0, arg1, arg2) {
3541
+ module.exports.__wbg_sendmessage_0daf407989ca8b40 = function(arg0, arg1, arg2) {
3322
3542
  let deferred0_0;
3323
3543
  let deferred0_1;
3324
3544
  try {
@@ -3330,7 +3550,7 @@ module.exports.__wbg_sendmessage_f113d492eb4524b5 = function(arg0, arg1, arg2) {
3330
3550
  }
3331
3551
  };
3332
3552
 
3333
- module.exports.__wbg_connecttopeer_50c2d98a86c4e5b6 = function() { return handleError(function (arg0, arg1) {
3553
+ module.exports.__wbg_connecttopeer_78667955172c1b64 = function() { return handleError(function (arg0, arg1) {
3334
3554
  let deferred0_0;
3335
3555
  let deferred0_1;
3336
3556
  try {
@@ -3343,14 +3563,7 @@ module.exports.__wbg_connecttopeer_50c2d98a86c4e5b6 = function() { return handle
3343
3563
  }
3344
3564
  }, arguments) };
3345
3565
 
3346
- module.exports.__wbg_getmyservices_cc19d8692abbc29e = function() {
3347
- const ret = MsgHandler.get_my_services();
3348
- _assertClass(ret, WasmPeerServiceList);
3349
- var ptr1 = ret.__destroy_into_raw();
3350
- return ptr1;
3351
- };
3352
-
3353
- module.exports.__wbg_isexistingfile_1a7b6ec3d354fe47 = function() { return handleError(function (arg0, arg1) {
3566
+ module.exports.__wbg_isexistingfile_c568db3c025a33e4 = function() { return handleError(function (arg0, arg1) {
3354
3567
  let deferred0_0;
3355
3568
  let deferred0_1;
3356
3569
  try {
@@ -3363,7 +3576,7 @@ module.exports.__wbg_isexistingfile_1a7b6ec3d354fe47 = function() { return handl
3363
3576
  }
3364
3577
  }, arguments) };
3365
3578
 
3366
- module.exports.__wbg_processapicall_1e58d2a1f1ee5c8f = function(arg0, arg1, arg2, arg3) {
3579
+ module.exports.__wbg_processapicall_2d751e023280ca3d = function(arg0, arg1, arg2, arg3) {
3367
3580
  let deferred0_0;
3368
3581
  let deferred0_1;
3369
3582
  try {
@@ -3375,7 +3588,7 @@ module.exports.__wbg_processapicall_1e58d2a1f1ee5c8f = function(arg0, arg1, arg2
3375
3588
  }
3376
3589
  };
3377
3590
 
3378
- module.exports.__wbg_processapierror_10fc62fff96aca4e = function(arg0, arg1, arg2, arg3) {
3591
+ module.exports.__wbg_processapierror_4826eb89adba3884 = function(arg0, arg1, arg2, arg3) {
3379
3592
  let deferred0_0;
3380
3593
  let deferred0_1;
3381
3594
  try {
@@ -3387,7 +3600,7 @@ module.exports.__wbg_processapierror_10fc62fff96aca4e = function(arg0, arg1, arg
3387
3600
  }
3388
3601
  };
3389
3602
 
3390
- module.exports.__wbg_processapisuccess_115f7ccf9993b8bb = function(arg0, arg1, arg2, arg3) {
3603
+ module.exports.__wbg_processapisuccess_fa0856e746ec1f81 = function(arg0, arg1, arg2, arg3) {
3391
3604
  let deferred0_0;
3392
3605
  let deferred0_1;
3393
3606
  try {
@@ -3399,25 +3612,21 @@ module.exports.__wbg_processapisuccess_115f7ccf9993b8bb = function(arg0, arg1, a
3399
3612
  }
3400
3613
  };
3401
3614
 
3402
- module.exports.__wbg_sendmessagetoall_3a2755dbde8c724b = function(arg0, arg1) {
3615
+ module.exports.__wbg_sendmessagetoall_4b1ea082c4e969dd = function(arg0, arg1) {
3403
3616
  MsgHandler.send_message_to_all(getObject(arg0), getObject(arg1));
3404
3617
  };
3405
3618
 
3406
- module.exports.__wbg_disconnectfrompeer_6b3a9c09ca632433 = function() { return handleError(function (arg0) {
3619
+ module.exports.__wbg_disconnectfrompeer_b486d43e000ce035 = function() { return handleError(function (arg0) {
3407
3620
  const ret = MsgHandler.disconnect_from_peer(BigInt.asUintN(64, arg0));
3408
3621
  return addHeapObject(ret);
3409
3622
  }, arguments) };
3410
3623
 
3411
- module.exports.__wbg_loadblockfilelist_233c686ce335ec67 = function() { return handleError(function () {
3624
+ module.exports.__wbg_loadblockfilelist_59d21845541aa7f6 = function() { return handleError(function () {
3412
3625
  const ret = MsgHandler.load_block_file_list();
3413
3626
  return addHeapObject(ret);
3414
3627
  }, arguments) };
3415
3628
 
3416
- module.exports.__wbg_emitinterfaceevent_141e012d55133e7f = function(arg0, arg1, arg2, arg3) {
3417
- MsgHandler.emit_interface_event(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
3418
- };
3419
-
3420
- module.exports.__wbg_fetchblockfrompeer_3c7bd808808548a3 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
3629
+ module.exports.__wbg_fetchblockfrompeer_86df2b7bab93a76f = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
3421
3630
  let deferred0_0;
3422
3631
  let deferred0_1;
3423
3632
  try {
@@ -3430,7 +3639,22 @@ module.exports.__wbg_fetchblockfrompeer_3c7bd808808548a3 = function() { return h
3430
3639
  }
3431
3640
  }, arguments) };
3432
3641
 
3433
- module.exports.__wbg_ensuredirectoryexists_46fdedb3a33ad8ed = function() { return handleError(function (arg0, arg1) {
3642
+ module.exports.__wbg_sendmessagebypeerid_97c4b297d1ae6e07 = function(arg0, arg1) {
3643
+ MsgHandler.send_message_by_peer_id(BigInt.asUintN(64, arg0), getObject(arg1));
3644
+ };
3645
+
3646
+ module.exports.__wbg_getmyservices_5fbf6dacc06df628 = function() {
3647
+ const ret = MsgHandler.get_my_services();
3648
+ _assertClass(ret, WasmPeerServiceList);
3649
+ var ptr1 = ret.__destroy_into_raw();
3650
+ return ptr1;
3651
+ };
3652
+
3653
+ module.exports.__wbg_emitinterfaceevent_88ce821fcc3034c0 = function(arg0, arg1, arg2, arg3) {
3654
+ MsgHandler.emit_interface_event(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
3655
+ };
3656
+
3657
+ module.exports.__wbg_ensuredirectoryexists_1e42102868fcc2ae = function() { return handleError(function (arg0, arg1) {
3434
3658
  let deferred0_0;
3435
3659
  let deferred0_1;
3436
3660
  try {
@@ -3442,75 +3666,6 @@ module.exports.__wbg_ensuredirectoryexists_46fdedb3a33ad8ed = function() { retur
3442
3666
  }
3443
3667
  }, arguments) };
3444
3668
 
3445
- module.exports.__wbg_sendmessagebypeerid_571fb58dab25fe97 = function(arg0, arg1) {
3446
- MsgHandler.send_message_by_peer_id(BigInt.asUintN(64, arg0), getObject(arg1));
3447
- };
3448
-
3449
- module.exports.__wbg_wasmtransaction_new = function(arg0) {
3450
- const ret = WasmTransaction.__wrap(arg0);
3451
- return addHeapObject(ret);
3452
- };
3453
-
3454
- module.exports.__wbg_wasmslip_new = function(arg0) {
3455
- const ret = WasmSlip.__wrap(arg0);
3456
- return addHeapObject(ret);
3457
- };
3458
-
3459
- module.exports.__wbg_wasmblockchain_new = function(arg0) {
3460
- const ret = WasmBlockchain.__wrap(arg0);
3461
- return addHeapObject(ret);
3462
- };
3463
-
3464
- module.exports.__wbg_wasmbalancesnapshot_new = function(arg0) {
3465
- const ret = WasmBalanceSnapshot.__wrap(arg0);
3466
- return addHeapObject(ret);
3467
- };
3468
-
3469
- module.exports.__wbg_wasmwallet_new = function(arg0) {
3470
- const ret = WasmWallet.__wrap(arg0);
3471
- return addHeapObject(ret);
3472
- };
3473
-
3474
- module.exports.__wbg_wasmpeer_new = function(arg0) {
3475
- const ret = WasmPeer.__wrap(arg0);
3476
- return addHeapObject(ret);
3477
- };
3478
-
3479
- module.exports.__wbg_wasmnft_new = function(arg0) {
3480
- const ret = WasmNFT.__wrap(arg0);
3481
- return addHeapObject(ret);
3482
- };
3483
-
3484
- module.exports.__wbg_wasmnetworkpeer_new = function(arg0) {
3485
- const ret = WasmNetworkPeer.__wrap(arg0);
3486
- return addHeapObject(ret);
3487
- };
3488
-
3489
- module.exports.__wbg_wasmblock_new = function(arg0) {
3490
- const ret = WasmBlock.__wrap(arg0);
3491
- return addHeapObject(ret);
3492
- };
3493
-
3494
- module.exports.__wbg_wasmwalletslip_new = function(arg0) {
3495
- const ret = WasmWalletSlip.__wrap(arg0);
3496
- return addHeapObject(ret);
3497
- };
3498
-
3499
- module.exports.__wbindgen_error_new = function(arg0, arg1) {
3500
- const ret = new Error(getStringFromWasm0(arg0, arg1));
3501
- return addHeapObject(ret);
3502
- };
3503
-
3504
- module.exports.__wbg_getwithrefkey_edc2c8960f0f1191 = function(arg0, arg1) {
3505
- const ret = getObject(arg0)[getObject(arg1)];
3506
- return addHeapObject(ret);
3507
- };
3508
-
3509
- module.exports.__wbindgen_in = function(arg0, arg1) {
3510
- const ret = getObject(arg0) in getObject(arg1);
3511
- return ret;
3512
- };
3513
-
3514
3669
  module.exports.__wbg_wasmpeerservice_new = function(arg0) {
3515
3670
  const ret = WasmPeerService.__wrap(arg0);
3516
3671
  return addHeapObject(ret);
@@ -3551,10 +3706,6 @@ module.exports.__wbindgen_debug_string = function(arg0, arg1) {
3551
3706
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
3552
3707
  };
3553
3708
 
3554
- module.exports.__wbg_queueMicrotask_481971b0d87f3dd4 = function(arg0) {
3555
- queueMicrotask(getObject(arg0));
3556
- };
3557
-
3558
3709
  module.exports.__wbg_queueMicrotask_3cbae2ec6b6cd3d6 = function(arg0) {
3559
3710
  const ret = getObject(arg0).queueMicrotask;
3560
3711
  return addHeapObject(ret);
@@ -3570,6 +3721,10 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
3570
3721
  return ret;
3571
3722
  };
3572
3723
 
3724
+ module.exports.__wbg_queueMicrotask_481971b0d87f3dd4 = function(arg0) {
3725
+ queueMicrotask(getObject(arg0));
3726
+ };
3727
+
3573
3728
  module.exports.__wbg_info_80803d9a3f0aad16 = function(arg0, arg1, arg2, arg3) {
3574
3729
  console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3575
3730
  };
@@ -3586,8 +3741,8 @@ module.exports.__wbg_error_696630710900ec44 = function(arg0, arg1, arg2, arg3) {
3586
3741
  console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3587
3742
  };
3588
3743
 
3589
- module.exports.__wbindgen_closure_wrapper2900 = function(arg0, arg1, arg2) {
3590
- const ret = makeMutClosure(arg0, arg1, 805, __wbg_adapter_40);
3744
+ module.exports.__wbindgen_closure_wrapper2970 = function(arg0, arg1, arg2) {
3745
+ const ret = makeMutClosure(arg0, arg1, 827, __wbg_adapter_40);
3591
3746
  return addHeapObject(ret);
3592
3747
  };
3593
3748