saito-wasm 0.2.162 → 0.2.164

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/web/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { MsgHandler } from './snippets/saito-wasm-4fafc63e3cd3af2c/js/msg_handler.js';
1
+ import { MsgHandler } from './snippets/saito-wasm-21975b2e7dbeb5a0/js/msg_handler.js';
2
2
 
3
3
  let wasm;
4
4
 
@@ -22,6 +22,15 @@ function takeObject(idx) {
22
22
  return ret;
23
23
  }
24
24
 
25
+ function addHeapObject(obj) {
26
+ if (heap_next === heap.length) heap.push(heap.length + 1);
27
+ const idx = heap_next;
28
+ heap_next = heap[idx];
29
+
30
+ heap[idx] = obj;
31
+ return idx;
32
+ }
33
+
25
34
  const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
26
35
 
27
36
  if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
@@ -40,15 +49,6 @@ function getStringFromWasm0(ptr, len) {
40
49
  return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
41
50
  }
42
51
 
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;
50
- }
51
-
52
52
  let WASM_VECTOR_LEN = 0;
53
53
 
54
54
  const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
@@ -240,6 +240,35 @@ function addBorrowedObject(obj) {
240
240
  heap[--stack_pointer] = obj;
241
241
  return stack_pointer;
242
242
  }
243
+ /**
244
+ * @param {string} private_key
245
+ * @returns {string}
246
+ */
247
+ export function generate_public_key(private_key) {
248
+ try {
249
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
250
+ wasm.generate_public_key(retptr, addHeapObject(private_key));
251
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
252
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
253
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
254
+ if (r2) {
255
+ throw takeObject(r1);
256
+ }
257
+ return takeObject(r0);
258
+ } finally {
259
+ wasm.__wbindgen_add_to_stack_pointer(16);
260
+ }
261
+ }
262
+
263
+ /**
264
+ * @param {bigint} current_time
265
+ * @returns {Promise<void>}
266
+ */
267
+ export function process_stat_interval(current_time) {
268
+ const ret = wasm.process_stat_interval(current_time);
269
+ return takeObject(ret);
270
+ }
271
+
243
272
  /**
244
273
  * @param {string} public_key
245
274
  * @returns {Promise<Array<any>>}
@@ -249,6 +278,14 @@ export function get_account_slips(public_key) {
249
278
  return takeObject(ret);
250
279
  }
251
280
 
281
+ /**
282
+ * @returns {Promise<string>}
283
+ */
284
+ export function get_latest_block_hash() {
285
+ const ret = wasm.get_latest_block_hash();
286
+ return takeObject(ret);
287
+ }
288
+
252
289
  /**
253
290
  * @param {bigint} peer_index
254
291
  * @returns {Promise<WasmPeer | undefined>}
@@ -259,10 +296,10 @@ export function get_peer(peer_index) {
259
296
  }
260
297
 
261
298
  /**
262
- * @returns {Promise<any>}
299
+ * @returns {Promise<boolean>}
263
300
  */
264
- export function get_confirmations() {
265
- const ret = wasm.get_confirmations();
301
+ export function produce_block_without_gt() {
302
+ const ret = wasm.produce_block_without_gt();
266
303
  return takeObject(ret);
267
304
  }
268
305
 
@@ -272,42 +309,29 @@ export function get_confirmations() {
272
309
  * @param {bigint} peer_index
273
310
  * @returns {Promise<void>}
274
311
  */
275
- export function send_api_error(buffer, msg_index, peer_index) {
276
- const ret = wasm.send_api_error(addHeapObject(buffer), msg_index, peer_index);
312
+ export function send_api_call(buffer, msg_index, peer_index) {
313
+ const ret = wasm.send_api_call(addHeapObject(buffer), msg_index, peer_index);
277
314
  return takeObject(ret);
278
315
  }
279
316
 
280
317
  /**
281
- * @param {number} major
282
- * @param {number} minor
283
- * @param {number} patch
318
+ * @param {bigint} peer_index
319
+ * @param {string} public_key
284
320
  * @returns {Promise<void>}
285
321
  */
286
- export function set_wallet_version(major, minor, patch) {
287
- const ret = wasm.set_wallet_version(major, minor, patch);
288
- return takeObject(ret);
289
- }
290
-
291
- /**
292
- * @param {string} block_hash
293
- * @returns {Promise<WasmBlock>}
294
- */
295
- export function get_block(block_hash) {
296
- const ret = wasm.get_block(addHeapObject(block_hash));
322
+ export function process_stun_peer(peer_index, public_key) {
323
+ const ret = wasm.process_stun_peer(peer_index, addHeapObject(public_key));
297
324
  return takeObject(ret);
298
325
  }
299
326
 
300
327
  /**
301
- * @param {bigint} num
302
- * @param {bigint} deposit
303
- * @param {Uint8Array} tx_msg
304
- * @param {bigint} fee
305
- * @param {string} recipient_public_key
306
- * @param {string} nft_type
307
- * @returns {Promise<WasmTransaction>}
328
+ * @param {Uint8Array} hash
329
+ * @param {bigint} block_id
330
+ * @param {bigint} peer_index
331
+ * @returns {Promise<void>}
308
332
  */
309
- export function create_bound_transaction(num, deposit, tx_msg, fee, recipient_public_key, nft_type) {
310
- const ret = wasm.create_bound_transaction(num, deposit, addHeapObject(tx_msg), fee, addHeapObject(recipient_public_key), addHeapObject(nft_type));
333
+ export function process_failed_block_fetch(hash, block_id, peer_index) {
334
+ const ret = wasm.process_failed_block_fetch(addHeapObject(hash), block_id, peer_index);
311
335
  return takeObject(ret);
312
336
  }
313
337
 
@@ -325,31 +349,19 @@ export function initialize(config_json, private_key, log_level_num, hasten_multi
325
349
  }
326
350
 
327
351
  /**
328
- * @param {Uint8Array} buffer
329
- * @param {string} signature
330
- * @param {string} public_key
352
+ * @param {string} key
331
353
  * @returns {boolean}
332
354
  */
333
- export function verify_signature(buffer, signature, public_key) {
334
- const ret = wasm.verify_signature(addHeapObject(buffer), addHeapObject(signature), addHeapObject(public_key));
355
+ export function is_valid_public_key(key) {
356
+ const ret = wasm.is_valid_public_key(addHeapObject(key));
335
357
  return ret !== 0;
336
358
  }
337
359
 
338
360
  /**
339
- * @returns {Promise<string>}
340
- */
341
- export function get_stats() {
342
- const ret = wasm.get_stats();
343
- return takeObject(ret);
344
- }
345
-
346
- /**
347
- * @param {bigint} peer_index
348
- * @param {string} public_key
349
- * @returns {Promise<void>}
361
+ * @returns {Promise<Array<any>>}
350
362
  */
351
- export function process_stun_peer(peer_index, public_key) {
352
- const ret = wasm.process_stun_peer(peer_index, addHeapObject(public_key));
363
+ export function get_nft_list() {
364
+ const ret = wasm.get_nft_list();
353
365
  return takeObject(ret);
354
366
  }
355
367
 
@@ -366,50 +378,108 @@ export function create_merge_bound_transaction(nft_id_hex, tx_msg) {
366
378
  }
367
379
 
368
380
  /**
369
- * @param {WasmTransaction} tx
381
+ * @returns {Promise<WasmBlockchain>}
382
+ */
383
+ export function get_blockchain() {
384
+ const ret = wasm.get_blockchain();
385
+ return takeObject(ret);
386
+ }
387
+
388
+ /**
389
+ * @param {Array<any>} keys
390
+ * @returns {Promise<WasmBalanceSnapshot>}
391
+ */
392
+ export function get_balance_snapshot(keys) {
393
+ const ret = wasm.get_balance_snapshot(addHeapObject(keys));
394
+ return takeObject(ret);
395
+ }
396
+
397
+ /**
398
+ * @param {bigint} threshold
370
399
  * @returns {Promise<void>}
371
400
  */
372
- export function propagate_transaction(tx) {
373
- _assertClass(tx, WasmTransaction);
374
- const ret = wasm.propagate_transaction(tx.__wbg_ptr);
401
+ export function write_issuance_file(threshold) {
402
+ const ret = wasm.write_issuance_file(threshold);
403
+ return takeObject(ret);
404
+ }
405
+
406
+ /**
407
+ * @param {Uint8Array} buffer
408
+ * @param {Uint8Array} hash
409
+ * @param {bigint} block_id
410
+ * @param {bigint} peer_index
411
+ * @returns {Promise<void>}
412
+ */
413
+ export function process_fetched_block(buffer, hash, block_id, peer_index) {
414
+ const ret = wasm.process_fetched_block(addHeapObject(buffer), addHeapObject(hash), block_id, peer_index);
415
+ return takeObject(ret);
416
+ }
417
+
418
+ /**
419
+ * @returns {Promise<bigint>}
420
+ */
421
+ export function get_next_peer_index() {
422
+ const ret = wasm.get_next_peer_index();
375
423
  return takeObject(ret);
376
424
  }
377
425
 
378
426
  /**
379
427
  * @returns {Promise<Array<any>>}
380
428
  */
381
- export function get_nft_list() {
382
- const ret = wasm.get_nft_list();
429
+ export function get_mempool_txs() {
430
+ const ret = wasm.get_mempool_txs();
383
431
  return takeObject(ret);
384
432
  }
385
433
 
386
434
  /**
435
+ * @returns {Promise<boolean>}
436
+ */
437
+ export function produce_block_with_gt() {
438
+ const ret = wasm.produce_block_with_gt();
439
+ return takeObject(ret);
440
+ }
441
+
442
+ /**
443
+ * @returns {string}
444
+ */
445
+ export function generate_private_key() {
446
+ const ret = wasm.generate_private_key();
447
+ return takeObject(ret);
448
+ }
449
+
450
+ /**
451
+ * @param {Uint8Array} buffer
452
+ * @param {number} msg_index
387
453
  * @param {bigint} peer_index
388
- * @param {string} ip
389
454
  * @returns {Promise<void>}
390
455
  */
391
- export function process_new_peer(peer_index, ip) {
392
- const ret = wasm.process_new_peer(peer_index, addHeapObject(ip));
456
+ export function send_api_error(buffer, msg_index, peer_index) {
457
+ const ret = wasm.send_api_error(addHeapObject(buffer), msg_index, peer_index);
393
458
  return takeObject(ret);
394
459
  }
395
460
 
396
461
  /**
397
- * @param {WasmBalanceSnapshot} snapshot
398
- * @returns {Promise<void>}
462
+ * @param {string} slip1_utxo_key
463
+ * @param {string} slip2_utxo_key
464
+ * @param {string} slip3_utxo_key
465
+ * @param {number} left_count
466
+ * @param {number} right_count
467
+ * @param {Uint8Array} tx_msg
468
+ * @returns {Promise<WasmTransaction>}
399
469
  */
400
- export function update_from_balance_snapshot(snapshot) {
401
- _assertClass(snapshot, WasmBalanceSnapshot);
402
- var ptr0 = snapshot.__destroy_into_raw();
403
- const ret = wasm.update_from_balance_snapshot(ptr0);
470
+ export function create_split_bound_transaction(slip1_utxo_key, slip2_utxo_key, slip3_utxo_key, left_count, right_count, tx_msg) {
471
+ const ret = wasm.create_split_bound_transaction(addHeapObject(slip1_utxo_key), addHeapObject(slip2_utxo_key), addHeapObject(slip3_utxo_key), left_count, right_count, addHeapObject(tx_msg));
404
472
  return takeObject(ret);
405
473
  }
406
474
 
407
475
  /**
408
- * @param {bigint} peer_index
476
+ * @param {WasmBalanceSnapshot} snapshot
409
477
  * @returns {Promise<void>}
410
478
  */
411
- export function remove_stun_peer(peer_index) {
412
- const ret = wasm.remove_stun_peer(peer_index);
479
+ export function update_from_balance_snapshot(snapshot) {
480
+ _assertClass(snapshot, WasmBalanceSnapshot);
481
+ var ptr0 = snapshot.__destroy_into_raw();
482
+ const ret = wasm.update_from_balance_snapshot(ptr0);
413
483
  return takeObject(ret);
414
484
  }
415
485
 
@@ -428,73 +498,69 @@ export function create_send_bound_transaction(amt, slip1_utxo_key, slip2_utxo_ke
428
498
  }
429
499
 
430
500
  /**
431
- * @param {Uint8Array} buffer
432
- * @param {string} private_key
433
- * @returns {string}
501
+ * @param {string} block_hash
502
+ * @returns {Promise<WasmBlock>}
434
503
  */
435
- export function sign_buffer(buffer, private_key) {
436
- try {
437
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
438
- wasm.sign_buffer(retptr, addHeapObject(buffer), addHeapObject(private_key));
439
- var r0 = getInt32Memory0()[retptr / 4 + 0];
440
- var r1 = getInt32Memory0()[retptr / 4 + 1];
441
- var r2 = getInt32Memory0()[retptr / 4 + 2];
442
- if (r2) {
443
- throw takeObject(r1);
444
- }
445
- return takeObject(r0);
446
- } finally {
447
- wasm.__wbindgen_add_to_stack_pointer(16);
448
- }
504
+ export function get_block(block_hash) {
505
+ const ret = wasm.get_block(addHeapObject(block_hash));
506
+ return takeObject(ret);
449
507
  }
450
508
 
451
509
  /**
452
- * @param {bigint} duration_in_ms
453
- * @returns {Promise<void>}
510
+ * @returns {Promise<string>}
454
511
  */
455
- export function process_timer_event(duration_in_ms) {
456
- const ret = wasm.process_timer_event(duration_in_ms);
512
+ export function get_peer_stats() {
513
+ const ret = wasm.get_peer_stats();
457
514
  return takeObject(ret);
458
515
  }
459
516
 
460
517
  /**
461
- * @returns {Promise<string>}
518
+ * @param {bigint} peer_index
519
+ * @returns {Promise<void>}
462
520
  */
463
- export function get_peer_stats() {
464
- const ret = wasm.get_peer_stats();
521
+ export function remove_stun_peer(peer_index) {
522
+ const ret = wasm.remove_stun_peer(peer_index);
465
523
  return takeObject(ret);
466
524
  }
467
525
 
468
526
  /**
469
- * @returns {Promise<string>}
527
+ * @param {Uint8Array} buffer
528
+ * @returns {string}
470
529
  */
471
- export function get_congestion_stats() {
472
- const ret = wasm.get_congestion_stats();
530
+ export function hash(buffer) {
531
+ const ret = wasm.hash(addHeapObject(buffer));
473
532
  return takeObject(ret);
474
533
  }
475
534
 
476
535
  /**
477
- * @param {bigint} threshold
478
- * @returns {Promise<void>}
536
+ * @param {Array<any>} public_keys
537
+ * @param {BigUint64Array} amounts
538
+ * @param {bigint} fee
539
+ * @param {boolean} _force_merge
540
+ * @returns {Promise<WasmTransaction>}
479
541
  */
480
- export function write_issuance_file(threshold) {
481
- const ret = wasm.write_issuance_file(threshold);
542
+ export function create_transaction_with_multiple_payments(public_keys, amounts, fee, _force_merge) {
543
+ const ret = wasm.create_transaction_with_multiple_payments(addHeapObject(public_keys), addHeapObject(amounts), fee, _force_merge);
482
544
  return takeObject(ret);
483
545
  }
484
546
 
485
547
  /**
486
- * @returns {Promise<bigint>}
548
+ * @param {bigint} duration_in_ms
549
+ * @returns {Promise<void>}
487
550
  */
488
- export function get_next_peer_index() {
489
- const ret = wasm.get_next_peer_index();
551
+ export function process_timer_event(duration_in_ms) {
552
+ const ret = wasm.process_timer_event(duration_in_ms);
490
553
  return takeObject(ret);
491
554
  }
492
555
 
493
556
  /**
494
- * @returns {Promise<string>}
557
+ * @param {number} major
558
+ * @param {number} minor
559
+ * @param {number} patch
560
+ * @returns {Promise<void>}
495
561
  */
496
- export function get_latest_block_hash() {
497
- const ret = wasm.get_latest_block_hash();
562
+ export function set_wallet_version(major, minor, patch) {
563
+ const ret = wasm.set_wallet_version(major, minor, patch);
498
564
  return takeObject(ret);
499
565
  }
500
566
 
@@ -510,33 +576,49 @@ export function send_api_success(buffer, msg_index, peer_index) {
510
576
  }
511
577
 
512
578
  /**
513
- * @returns {Promise<boolean>}
579
+ * @param {bigint} peer_index
580
+ * @param {string} ip
581
+ * @returns {Promise<void>}
514
582
  */
515
- export function produce_block_with_gt() {
516
- const ret = wasm.produce_block_with_gt();
583
+ export function process_new_peer(peer_index, ip) {
584
+ const ret = wasm.process_new_peer(peer_index, addHeapObject(ip));
517
585
  return takeObject(ret);
518
586
  }
519
587
 
520
588
  /**
521
- * @param {string} slip1_utxo_key
522
- * @param {string} slip2_utxo_key
523
- * @param {string} slip3_utxo_key
524
- * @param {number} left_count
525
- * @param {number} right_count
526
- * @param {Uint8Array} tx_msg
527
- * @returns {Promise<WasmTransaction>}
589
+ * @param {Uint8Array} buffer
590
+ * @param {string} signature
591
+ * @param {string} public_key
592
+ * @returns {boolean}
528
593
  */
529
- export function create_split_bound_transaction(slip1_utxo_key, slip2_utxo_key, slip3_utxo_key, left_count, right_count, tx_msg) {
530
- const ret = wasm.create_split_bound_transaction(addHeapObject(slip1_utxo_key), addHeapObject(slip2_utxo_key), addHeapObject(slip3_utxo_key), left_count, right_count, addHeapObject(tx_msg));
594
+ export function verify_signature(buffer, signature, public_key) {
595
+ const ret = wasm.verify_signature(addHeapObject(buffer), addHeapObject(signature), addHeapObject(public_key));
596
+ return ret !== 0;
597
+ }
598
+
599
+ /**
600
+ * @returns {Promise<Array<any>>}
601
+ */
602
+ export function get_peers() {
603
+ const ret = wasm.get_peers();
531
604
  return takeObject(ret);
532
605
  }
533
606
 
534
607
  /**
608
+ * @param {Uint8Array} buffer
535
609
  * @param {bigint} peer_index
536
610
  * @returns {Promise<void>}
537
611
  */
538
- export function process_peer_disconnection(peer_index) {
539
- const ret = wasm.process_peer_disconnection(peer_index);
612
+ export function process_msg_buffer_from_peer(buffer, peer_index) {
613
+ const ret = wasm.process_msg_buffer_from_peer(addHeapObject(buffer), peer_index);
614
+ return takeObject(ret);
615
+ }
616
+
617
+ /**
618
+ * @returns {Promise<void>}
619
+ */
620
+ export function start_from_received_ghost_chain() {
621
+ const ret = wasm.start_from_received_ghost_chain();
540
622
  return takeObject(ret);
541
623
  }
542
624
 
@@ -553,21 +635,22 @@ export function create_transaction(public_key, amount, fee, force_merge) {
553
635
  }
554
636
 
555
637
  /**
556
- * @returns {Promise<boolean>}
638
+ * @returns {Promise<string>}
557
639
  */
558
- export function produce_block_without_gt() {
559
- const ret = wasm.produce_block_without_gt();
640
+ export function get_congestion_stats() {
641
+ const ret = wasm.get_congestion_stats();
560
642
  return takeObject(ret);
561
643
  }
562
644
 
563
645
  /**
646
+ * @param {Uint8Array} buffer
564
647
  * @param {string} private_key
565
648
  * @returns {string}
566
649
  */
567
- export function generate_public_key(private_key) {
650
+ export function sign_buffer(buffer, private_key) {
568
651
  try {
569
652
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
570
- wasm.generate_public_key(retptr, addHeapObject(private_key));
653
+ wasm.sign_buffer(retptr, addHeapObject(buffer), addHeapObject(private_key));
571
654
  var r0 = getInt32Memory0()[retptr / 4 + 0];
572
655
  var r1 = getInt32Memory0()[retptr / 4 + 1];
573
656
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -589,142 +672,59 @@ export function get_wallet() {
589
672
  }
590
673
 
591
674
  /**
592
- * @returns {Promise<Array<any>>}
593
- */
594
- export function get_mempool_txs() {
595
- const ret = wasm.get_mempool_txs();
596
- return takeObject(ret);
597
- }
598
-
599
- /**
600
- * @returns {Promise<void>}
601
- */
602
- export function start_from_received_ghost_chain() {
603
- const ret = wasm.start_from_received_ghost_chain();
604
- return takeObject(ret);
605
- }
606
-
607
- /**
608
- * @param {bigint} current_time
609
- * @returns {Promise<void>}
610
- */
611
- export function process_stat_interval(current_time) {
612
- const ret = wasm.process_stat_interval(current_time);
613
- return takeObject(ret);
614
- }
615
-
616
- /**
617
- * @returns {string}
618
- */
619
- export function generate_private_key() {
620
- const ret = wasm.generate_private_key();
621
- return takeObject(ret);
622
- }
623
-
624
- /**
625
- * @param {Uint8Array} buffer
626
- * @param {Uint8Array} hash
627
- * @param {bigint} block_id
628
- * @param {bigint} peer_index
629
- * @returns {Promise<void>}
630
- */
631
- export function process_fetched_block(buffer, hash, block_id, peer_index) {
632
- const ret = wasm.process_fetched_block(addHeapObject(buffer), addHeapObject(hash), block_id, peer_index);
633
- return takeObject(ret);
634
- }
635
-
636
- /**
637
- * @returns {Promise<Array<any>>}
638
- */
639
- export function get_peers() {
640
- const ret = wasm.get_peers();
641
- return takeObject(ret);
642
- }
643
-
644
- /**
645
- * @param {Uint8Array} buffer
646
- * @param {bigint} peer_index
647
- * @returns {Promise<void>}
648
- */
649
- export function process_msg_buffer_from_peer(buffer, peer_index) {
650
- const ret = wasm.process_msg_buffer_from_peer(addHeapObject(buffer), peer_index);
651
- return takeObject(ret);
652
- }
653
-
654
- /**
655
- * @param {string} key
656
- * @returns {boolean}
657
- */
658
- export function is_valid_public_key(key) {
659
- const ret = wasm.is_valid_public_key(addHeapObject(key));
660
- return ret !== 0;
661
- }
662
-
663
- /**
664
- * @param {Array<any>} public_keys
665
- * @param {BigUint64Array} amounts
675
+ * @param {bigint} num
676
+ * @param {bigint} deposit
677
+ * @param {Uint8Array} tx_msg
666
678
  * @param {bigint} fee
667
- * @param {boolean} _force_merge
679
+ * @param {string} recipient_public_key
680
+ * @param {string} nft_type
668
681
  * @returns {Promise<WasmTransaction>}
669
682
  */
670
- export function create_transaction_with_multiple_payments(public_keys, amounts, fee, _force_merge) {
671
- const ret = wasm.create_transaction_with_multiple_payments(addHeapObject(public_keys), addHeapObject(amounts), fee, _force_merge);
683
+ export function create_bound_transaction(num, deposit, tx_msg, fee, recipient_public_key, nft_type) {
684
+ const ret = wasm.create_bound_transaction(num, deposit, addHeapObject(tx_msg), fee, addHeapObject(recipient_public_key), addHeapObject(nft_type));
672
685
  return takeObject(ret);
673
686
  }
674
687
 
675
688
  /**
676
- * @returns {Promise<WasmBlockchain>}
689
+ * @returns {Promise<any>}
677
690
  */
678
- export function get_blockchain() {
679
- const ret = wasm.get_blockchain();
691
+ export function get_confirmations() {
692
+ const ret = wasm.get_confirmations();
680
693
  return takeObject(ret);
681
694
  }
682
695
 
683
696
  /**
697
+ * @param {WasmTransaction} tx
684
698
  * @returns {Promise<void>}
685
699
  */
686
- export function disable_producing_blocks_by_timer() {
687
- const ret = wasm.disable_producing_blocks_by_timer();
700
+ export function propagate_transaction(tx) {
701
+ _assertClass(tx, WasmTransaction);
702
+ const ret = wasm.propagate_transaction(tx.__wbg_ptr);
688
703
  return takeObject(ret);
689
704
  }
690
705
 
691
706
  /**
692
- * @param {Uint8Array} buffer
693
- * @returns {string}
707
+ * @returns {Promise<string>}
694
708
  */
695
- export function hash(buffer) {
696
- const ret = wasm.hash(addHeapObject(buffer));
709
+ export function get_stats() {
710
+ const ret = wasm.get_stats();
697
711
  return takeObject(ret);
698
712
  }
699
713
 
700
714
  /**
701
- * @param {Uint8Array} hash
702
- * @param {bigint} block_id
703
715
  * @param {bigint} peer_index
704
716
  * @returns {Promise<void>}
705
717
  */
706
- export function process_failed_block_fetch(hash, block_id, peer_index) {
707
- const ret = wasm.process_failed_block_fetch(addHeapObject(hash), block_id, peer_index);
718
+ export function process_peer_disconnection(peer_index) {
719
+ const ret = wasm.process_peer_disconnection(peer_index);
708
720
  return takeObject(ret);
709
721
  }
710
722
 
711
723
  /**
712
- * @param {Uint8Array} buffer
713
- * @param {number} msg_index
714
- * @param {bigint} peer_index
715
724
  * @returns {Promise<void>}
716
725
  */
717
- export function send_api_call(buffer, msg_index, peer_index) {
718
- const ret = wasm.send_api_call(addHeapObject(buffer), msg_index, peer_index);
719
- return takeObject(ret);
720
- }
721
-
722
- /**
723
- * @param {Array<any>} keys
724
- * @returns {Promise<WasmBalanceSnapshot>}
725
- */
726
- export function get_balance_snapshot(keys) {
727
- const ret = wasm.get_balance_snapshot(addHeapObject(keys));
726
+ export function disable_producing_blocks_by_timer() {
727
+ const ret = wasm.disable_producing_blocks_by_timer();
728
728
  return takeObject(ret);
729
729
  }
730
730
 
@@ -2660,28 +2660,28 @@ function __wbg_get_imports() {
2660
2660
  imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
2661
2661
  takeObject(arg0);
2662
2662
  };
2663
- imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
2664
- const ret = getStringFromWasm0(arg0, arg1);
2663
+ imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
2664
+ const ret = BigInt.asUintN(64, arg0);
2665
2665
  return addHeapObject(ret);
2666
2666
  };
2667
2667
  imports.wbg.__wbg_wasmtransaction_new = function(arg0) {
2668
2668
  const ret = WasmTransaction.__wrap(arg0);
2669
2669
  return addHeapObject(ret);
2670
2670
  };
2671
- imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
2672
- const ret = getObject(arg0);
2671
+ imports.wbg.__wbg_wasmpeer_new = function(arg0) {
2672
+ const ret = WasmPeer.__wrap(arg0);
2673
2673
  return addHeapObject(ret);
2674
2674
  };
2675
- imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
2676
- const ret = BigInt.asUintN(64, arg0);
2675
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
2676
+ const ret = getStringFromWasm0(arg0, arg1);
2677
2677
  return addHeapObject(ret);
2678
2678
  };
2679
- imports.wbg.__wbg_wasmpeer_new = function(arg0) {
2680
- const ret = WasmPeer.__wrap(arg0);
2679
+ imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
2680
+ const ret = getObject(arg0);
2681
2681
  return addHeapObject(ret);
2682
2682
  };
2683
- imports.wbg.__wbg_wasmnft_new = function(arg0) {
2684
- const ret = WasmNFT.__wrap(arg0);
2683
+ imports.wbg.__wbg_wasmslip_new = function(arg0) {
2684
+ const ret = WasmSlip.__wrap(arg0);
2685
2685
  return addHeapObject(ret);
2686
2686
  };
2687
2687
  imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
@@ -2696,16 +2696,8 @@ function __wbg_get_imports() {
2696
2696
  const ret = WasmBlock.__wrap(arg0);
2697
2697
  return addHeapObject(ret);
2698
2698
  };
2699
- imports.wbg.__wbg_wasmbalancesnapshot_new = function(arg0) {
2700
- const ret = WasmBalanceSnapshot.__wrap(arg0);
2701
- return addHeapObject(ret);
2702
- };
2703
- imports.wbg.__wbg_wasmslip_new = function(arg0) {
2704
- const ret = WasmSlip.__wrap(arg0);
2705
- return addHeapObject(ret);
2706
- };
2707
- imports.wbg.__wbg_wasmblockchain_new = function(arg0) {
2708
- const ret = WasmBlockchain.__wrap(arg0);
2699
+ imports.wbg.__wbg_wasmnft_new = function(arg0) {
2700
+ const ret = WasmNFT.__wrap(arg0);
2709
2701
  return addHeapObject(ret);
2710
2702
  };
2711
2703
  imports.wbg.__wbg_wasmwalletslip_new = function(arg0) {
@@ -2716,6 +2708,14 @@ function __wbg_get_imports() {
2716
2708
  const ret = WasmWallet.__wrap(arg0);
2717
2709
  return addHeapObject(ret);
2718
2710
  };
2711
+ imports.wbg.__wbg_wasmbalancesnapshot_new = function(arg0) {
2712
+ const ret = WasmBalanceSnapshot.__wrap(arg0);
2713
+ return addHeapObject(ret);
2714
+ };
2715
+ imports.wbg.__wbg_wasmblockchain_new = function(arg0) {
2716
+ const ret = WasmBlockchain.__wrap(arg0);
2717
+ return addHeapObject(ret);
2718
+ };
2719
2719
  imports.wbg.__wbindgen_is_object = function(arg0) {
2720
2720
  const val = getObject(arg0);
2721
2721
  const ret = typeof(val) === 'object' && val !== null;
@@ -2741,7 +2741,7 @@ function __wbg_get_imports() {
2741
2741
  const ret = WasmPeerService.__wrap(arg0);
2742
2742
  return addHeapObject(ret);
2743
2743
  };
2744
- imports.wbg.__wbg_flushdata_18a251eb49cec9a9 = function(arg0, arg1) {
2744
+ imports.wbg.__wbg_flushdata_aece8dc223521e86 = function(arg0, arg1) {
2745
2745
  let deferred0_0;
2746
2746
  let deferred0_1;
2747
2747
  try {
@@ -2752,7 +2752,7 @@ function __wbg_get_imports() {
2752
2752
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2753
2753
  }
2754
2754
  };
2755
- imports.wbg.__wbg_readvalue_63d41520b484fd87 = function() { return handleError(function (arg0, arg1) {
2755
+ imports.wbg.__wbg_readvalue_6b30d6a36eadedae = function() { return handleError(function (arg0, arg1) {
2756
2756
  let deferred0_0;
2757
2757
  let deferred0_1;
2758
2758
  try {
@@ -2764,13 +2764,13 @@ function __wbg_get_imports() {
2764
2764
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2765
2765
  }
2766
2766
  }, arguments) };
2767
- imports.wbg.__wbg_loadwallet_a702ea0f227cddbd = function() {
2767
+ imports.wbg.__wbg_loadwallet_859958a8a64bf9fa = function() {
2768
2768
  MsgHandler.load_wallet();
2769
2769
  };
2770
- imports.wbg.__wbg_savewallet_c68b1642af9c594d = function() {
2770
+ imports.wbg.__wbg_savewallet_2980f66ae84af44e = function() {
2771
2771
  MsgHandler.save_wallet();
2772
2772
  };
2773
- imports.wbg.__wbg_writevalue_9096a95d5621ed81 = function(arg0, arg1, arg2) {
2773
+ imports.wbg.__wbg_writevalue_6c5d0ae738c625fd = function(arg0, arg1, arg2) {
2774
2774
  let deferred0_0;
2775
2775
  let deferred0_1;
2776
2776
  try {
@@ -2781,7 +2781,7 @@ function __wbg_get_imports() {
2781
2781
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2782
2782
  }
2783
2783
  };
2784
- imports.wbg.__wbg_appendvalue_72e46d3bea542087 = function(arg0, arg1, arg2) {
2784
+ imports.wbg.__wbg_appendvalue_7a64f2b8d6b939c6 = function(arg0, arg1, arg2) {
2785
2785
  let deferred0_0;
2786
2786
  let deferred0_1;
2787
2787
  try {
@@ -2792,7 +2792,7 @@ function __wbg_get_imports() {
2792
2792
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2793
2793
  }
2794
2794
  };
2795
- imports.wbg.__wbg_removevalue_f0a580705086fe4e = function() { return handleError(function (arg0, arg1) {
2795
+ imports.wbg.__wbg_removevalue_fa146f87d5f18cc2 = function() { return handleError(function (arg0, arg1) {
2796
2796
  let deferred0_0;
2797
2797
  let deferred0_1;
2798
2798
  try {
@@ -2804,10 +2804,10 @@ function __wbg_get_imports() {
2804
2804
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2805
2805
  }
2806
2806
  }, arguments) };
2807
- imports.wbg.__wbg_sendmessage_ef65393a67692b54 = function(arg0, arg1) {
2807
+ imports.wbg.__wbg_sendmessage_678a358e5a2bbc3c = function(arg0, arg1) {
2808
2808
  MsgHandler.send_message(takeObject(arg0), getObject(arg1));
2809
2809
  };
2810
- imports.wbg.__wbg_connecttopeer_6324d1d563208b33 = function() { return handleError(function (arg0, arg1, arg2) {
2810
+ imports.wbg.__wbg_connecttopeer_67e8d4deca7e7daf = function() { return handleError(function (arg0, arg1, arg2) {
2811
2811
  let deferred0_0;
2812
2812
  let deferred0_1;
2813
2813
  try {
@@ -2819,13 +2819,13 @@ function __wbg_get_imports() {
2819
2819
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2820
2820
  }
2821
2821
  }, arguments) };
2822
- imports.wbg.__wbg_getmyservices_f256fabe6c79db51 = function() {
2822
+ imports.wbg.__wbg_getmyservices_519eae3c1e735bb8 = function() {
2823
2823
  const ret = MsgHandler.get_my_services();
2824
2824
  _assertClass(ret, WasmPeerServiceList);
2825
2825
  var ptr1 = ret.__destroy_into_raw();
2826
2826
  return ptr1;
2827
2827
  };
2828
- imports.wbg.__wbg_isexistingfile_066460c532232f85 = function() { return handleError(function (arg0, arg1) {
2828
+ imports.wbg.__wbg_isexistingfile_e53dd691a0d35efd = function() { return handleError(function (arg0, arg1) {
2829
2829
  let deferred0_0;
2830
2830
  let deferred0_1;
2831
2831
  try {
@@ -2837,27 +2837,27 @@ function __wbg_get_imports() {
2837
2837
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2838
2838
  }
2839
2839
  }, arguments) };
2840
- imports.wbg.__wbg_processapicall_049fe71861bf5f39 = function(arg0, arg1, arg2) {
2840
+ imports.wbg.__wbg_processapicall_7010105e6c44f1f7 = function(arg0, arg1, arg2) {
2841
2841
  MsgHandler.process_api_call(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2842
2842
  };
2843
- imports.wbg.__wbg_processapierror_91128e6e272589bb = function(arg0, arg1, arg2) {
2843
+ imports.wbg.__wbg_processapierror_f885f698605b436e = function(arg0, arg1, arg2) {
2844
2844
  MsgHandler.process_api_error(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2845
2845
  };
2846
- imports.wbg.__wbg_processapisuccess_68804d636bb16bf9 = function(arg0, arg1, arg2) {
2846
+ imports.wbg.__wbg_processapisuccess_f35eaefa100da4a2 = function(arg0, arg1, arg2) {
2847
2847
  MsgHandler.process_api_success(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2848
2848
  };
2849
- imports.wbg.__wbg_sendmessagetoall_593dfdadda643b2a = function(arg0, arg1) {
2849
+ imports.wbg.__wbg_sendmessagetoall_4a160fbd574d23b3 = function(arg0, arg1) {
2850
2850
  MsgHandler.send_message_to_all(getObject(arg0), getObject(arg1));
2851
2851
  };
2852
- imports.wbg.__wbg_disconnectfrompeer_e8dd660963a47aca = function() { return handleError(function (arg0) {
2852
+ imports.wbg.__wbg_disconnectfrompeer_2739f7a30005ac18 = function() { return handleError(function (arg0) {
2853
2853
  const ret = MsgHandler.disconnect_from_peer(takeObject(arg0));
2854
2854
  return addHeapObject(ret);
2855
2855
  }, arguments) };
2856
- imports.wbg.__wbg_loadblockfilelist_7fcf48909494816e = function() { return handleError(function () {
2856
+ imports.wbg.__wbg_loadblockfilelist_9c3eba157d4018d7 = function() { return handleError(function () {
2857
2857
  const ret = MsgHandler.load_block_file_list();
2858
2858
  return addHeapObject(ret);
2859
2859
  }, arguments) };
2860
- imports.wbg.__wbg_sendinterfaceevent_0f5591a40cdc28a0 = function(arg0, arg1, arg2, arg3, arg4) {
2860
+ imports.wbg.__wbg_sendinterfaceevent_9ec642f87407fb57 = function(arg0, arg1, arg2, arg3, arg4) {
2861
2861
  let deferred0_0;
2862
2862
  let deferred0_1;
2863
2863
  let deferred1_0;
@@ -2873,7 +2873,7 @@ function __wbg_get_imports() {
2873
2873
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2874
2874
  }
2875
2875
  };
2876
- imports.wbg.__wbg_sendblocksuccess_331ed20b601c69a1 = function(arg0, arg1, arg2) {
2876
+ imports.wbg.__wbg_sendblocksuccess_8593630796d08f4a = function(arg0, arg1, arg2) {
2877
2877
  let deferred0_0;
2878
2878
  let deferred0_1;
2879
2879
  try {
@@ -2884,10 +2884,10 @@ function __wbg_get_imports() {
2884
2884
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2885
2885
  }
2886
2886
  };
2887
- imports.wbg.__wbg_sendwalletupdate_2609da4d6d7128d1 = function() {
2887
+ imports.wbg.__wbg_sendwalletupdate_a4fae063dc4307f9 = function() {
2888
2888
  MsgHandler.send_wallet_update();
2889
2889
  };
2890
- imports.wbg.__wbg_sendnewversionalert_0668d8f5d25f4178 = function(arg0, arg1, arg2) {
2890
+ imports.wbg.__wbg_sendnewversionalert_90ce546ef6f38fc8 = function(arg0, arg1, arg2) {
2891
2891
  let deferred0_0;
2892
2892
  let deferred0_1;
2893
2893
  try {
@@ -2898,13 +2898,13 @@ function __wbg_get_imports() {
2898
2898
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2899
2899
  }
2900
2900
  };
2901
- imports.wbg.__wbg_sendblockfetchstatusevent_8d7056d571e6dc97 = function(arg0) {
2901
+ imports.wbg.__wbg_sendblockfetchstatusevent_1a279a1f6532f08b = function(arg0) {
2902
2902
  MsgHandler.send_block_fetch_status_event(BigInt.asUintN(64, arg0));
2903
2903
  };
2904
- imports.wbg.__wbg_sendnewchaindetectedevent_a8f8383f24e06887 = function() {
2904
+ imports.wbg.__wbg_sendnewchaindetectedevent_3137097dd52dfe5f = function() {
2905
2905
  MsgHandler.send_new_chain_detected_event();
2906
2906
  };
2907
- imports.wbg.__wbg_fetchblockfrompeer_07c7276e8f9a93fe = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2907
+ imports.wbg.__wbg_fetchblockfrompeer_e70058129ff6d454 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2908
2908
  let deferred0_0;
2909
2909
  let deferred0_1;
2910
2910
  try {
@@ -2916,7 +2916,7 @@ function __wbg_get_imports() {
2916
2916
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2917
2917
  }
2918
2918
  }, arguments) };
2919
- imports.wbg.__wbg_ensureblockdirectoryexists_e3b6f6d4ce1df9ce = function() { return handleError(function (arg0, arg1) {
2919
+ imports.wbg.__wbg_ensureblockdirectoryexists_423cb5cd137cb12e = function() { return handleError(function (arg0, arg1) {
2920
2920
  let deferred0_0;
2921
2921
  let deferred0_1;
2922
2922
  try {