saito-wasm 0.2.171 → 0.2.173

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,7 +1,27 @@
1
- import { MsgHandler } from './snippets/saito-wasm-d893e173c1089dfc/js/msg_handler.js';
1
+ import { MsgHandler } from './snippets/saito-wasm-7be8883e9ab9764a/js/msg_handler.js';
2
2
 
3
3
  let wasm;
4
4
 
5
+ const heap = new Array(128).fill(undefined);
6
+
7
+ heap.push(undefined, null, true, false);
8
+
9
+ function getObject(idx) { return heap[idx]; }
10
+
11
+ let heap_next = heap.length;
12
+
13
+ function dropObject(idx) {
14
+ if (idx < 132) return;
15
+ heap[idx] = heap_next;
16
+ heap_next = idx;
17
+ }
18
+
19
+ function takeObject(idx) {
20
+ const ret = getObject(idx);
21
+ dropObject(idx);
22
+ return ret;
23
+ }
24
+
5
25
  const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
6
26
 
7
27
  if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
@@ -20,12 +40,6 @@ function getStringFromWasm0(ptr, len) {
20
40
  return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
21
41
  }
22
42
 
23
- const heap = new Array(128).fill(undefined);
24
-
25
- heap.push(undefined, null, true, false);
26
-
27
- let heap_next = heap.length;
28
-
29
43
  function addHeapObject(obj) {
30
44
  if (heap_next === heap.length) heap.push(heap.length + 1);
31
45
  const idx = heap_next;
@@ -35,20 +49,6 @@ function addHeapObject(obj) {
35
49
  return idx;
36
50
  }
37
51
 
38
- function getObject(idx) { return heap[idx]; }
39
-
40
- function dropObject(idx) {
41
- if (idx < 132) return;
42
- heap[idx] = heap_next;
43
- heap_next = idx;
44
- }
45
-
46
- function takeObject(idx) {
47
- const ret = getObject(idx);
48
- dropObject(idx);
49
- return ret;
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,74 +240,101 @@ function addBorrowedObject(obj) {
240
240
  heap[--stack_pointer] = obj;
241
241
  return stack_pointer;
242
242
  }
243
+ /**
244
+ * @returns {Promise<string>}
245
+ */
246
+ export function get_peer_stats() {
247
+ const ret = wasm.get_peer_stats();
248
+ return takeObject(ret);
249
+ }
250
+
251
+ /**
252
+ * @param {string} slip1_utxo_key
253
+ * @param {string} slip2_utxo_key
254
+ * @param {string} slip3_utxo_key
255
+ * @param {number} left_count
256
+ * @param {number} right_count
257
+ * @param {Uint8Array} tx_msg
258
+ * @returns {Promise<WasmTransaction>}
259
+ */
260
+ export function create_split_bound_transaction(slip1_utxo_key, slip2_utxo_key, slip3_utxo_key, left_count, right_count, tx_msg) {
261
+ 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));
262
+ return takeObject(ret);
263
+ }
264
+
243
265
  /**
244
266
  * @param {Uint8Array} buffer
245
- * @param {number} msg_index
246
267
  * @param {bigint} peer_index
247
268
  * @returns {Promise<void>}
248
269
  */
249
- export function send_api_call(buffer, msg_index, peer_index) {
250
- const ret = wasm.send_api_call(addHeapObject(buffer), msg_index, peer_index);
270
+ export function process_msg_buffer_from_peer(buffer, peer_index) {
271
+ const ret = wasm.process_msg_buffer_from_peer(addHeapObject(buffer), peer_index);
251
272
  return takeObject(ret);
252
273
  }
253
274
 
254
275
  /**
255
- * @param {Uint8Array} hash
256
- * @param {bigint} block_id
257
- * @param {bigint} peer_index
276
+ * @param {number} major
277
+ * @param {number} minor
278
+ * @param {number} patch
258
279
  * @returns {Promise<void>}
259
280
  */
260
- export function process_failed_block_fetch(hash, block_id, peer_index) {
261
- const ret = wasm.process_failed_block_fetch(addHeapObject(hash), block_id, peer_index);
281
+ export function set_wallet_version(major, minor, patch) {
282
+ const ret = wasm.set_wallet_version(major, minor, patch);
262
283
  return takeObject(ret);
263
284
  }
264
285
 
265
286
  /**
266
- * @param {string} key
267
- * @returns {boolean}
287
+ * @returns {string}
268
288
  */
269
- export function is_valid_public_key(key) {
270
- const ret = wasm.is_valid_public_key(addHeapObject(key));
271
- return ret !== 0;
289
+ export function generate_private_key() {
290
+ const ret = wasm.generate_private_key();
291
+ return takeObject(ret);
272
292
  }
273
293
 
274
294
  /**
275
- * @param {Uint8Array} buffer
276
- * @param {number} msg_index
277
- * @param {bigint} peer_index
278
- * @returns {Promise<void>}
295
+ * @param {string} nft_id_hex
296
+ * @param {Uint8Array} tx_msg
297
+ * @returns {Promise<WasmTransaction>}
279
298
  */
280
- export function send_api_success(buffer, msg_index, peer_index) {
281
- const ret = wasm.send_api_success(addHeapObject(buffer), msg_index, peer_index);
299
+ export function create_merge_bound_transaction(nft_id_hex, tx_msg) {
300
+ const ptr0 = passStringToWasm0(nft_id_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
301
+ const len0 = WASM_VECTOR_LEN;
302
+ const ret = wasm.create_merge_bound_transaction(ptr0, len0, addHeapObject(tx_msg));
282
303
  return takeObject(ret);
283
304
  }
284
305
 
285
306
  /**
286
- * @returns {Promise<void>}
307
+ * @returns {Promise<boolean>}
287
308
  */
288
- export function disable_producing_blocks_by_timer() {
289
- const ret = wasm.disable_producing_blocks_by_timer();
309
+ export function produce_block_with_gt() {
310
+ const ret = wasm.produce_block_with_gt();
290
311
  return takeObject(ret);
291
312
  }
292
313
 
293
314
  /**
294
- * @param {Array<any>} public_keys
295
- * @param {BigUint64Array} amounts
296
- * @param {bigint} fee
297
- * @param {boolean} _force_merge
298
- * @returns {Promise<WasmTransaction>}
315
+ * @returns {Promise<Array<any>>}
299
316
  */
300
- export function create_transaction_with_multiple_payments(public_keys, amounts, fee, _force_merge) {
301
- const ret = wasm.create_transaction_with_multiple_payments(addHeapObject(public_keys), addHeapObject(amounts), fee, _force_merge);
317
+ export function get_nft_list() {
318
+ const ret = wasm.get_nft_list();
302
319
  return takeObject(ret);
303
320
  }
304
321
 
305
322
  /**
323
+ * @param {Uint8Array} hash
324
+ * @param {bigint} block_id
306
325
  * @param {bigint} peer_index
307
- * @returns {Promise<WasmPeer | undefined>}
326
+ * @returns {Promise<void>}
308
327
  */
309
- export function get_peer(peer_index) {
310
- const ret = wasm.get_peer(peer_index);
328
+ export function process_failed_block_fetch(hash, block_id, peer_index) {
329
+ const ret = wasm.process_failed_block_fetch(addHeapObject(hash), block_id, peer_index);
330
+ return takeObject(ret);
331
+ }
332
+
333
+ /**
334
+ * @returns {Promise<WasmBlockchain>}
335
+ */
336
+ export function get_blockchain() {
337
+ const ret = wasm.get_blockchain();
311
338
  return takeObject(ret);
312
339
  }
313
340
 
@@ -336,97 +363,55 @@ export function create_bound_transaction(num, deposit, tx_msg, fee, recipient_pu
336
363
  }
337
364
 
338
365
  /**
339
- * @param {number} major
340
- * @param {number} minor
341
- * @param {number} patch
342
- * @returns {Promise<void>}
343
- */
344
- export function set_wallet_version(major, minor, patch) {
345
- const ret = wasm.set_wallet_version(major, minor, patch);
346
- return takeObject(ret);
347
- }
348
-
349
- /**
350
- * @param {bigint} threshold
366
+ * @param {WasmBalanceSnapshot} snapshot
351
367
  * @returns {Promise<void>}
352
368
  */
353
- export function write_issuance_file(threshold) {
354
- const ret = wasm.write_issuance_file(threshold);
355
- return takeObject(ret);
356
- }
357
-
358
- /**
359
- * @param {Uint8Array} buffer
360
- * @returns {string}
361
- */
362
- export function hash(buffer) {
363
- const ret = wasm.hash(addHeapObject(buffer));
369
+ export function update_from_balance_snapshot(snapshot) {
370
+ _assertClass(snapshot, WasmBalanceSnapshot);
371
+ var ptr0 = snapshot.__destroy_into_raw();
372
+ const ret = wasm.update_from_balance_snapshot(ptr0);
364
373
  return takeObject(ret);
365
374
  }
366
375
 
367
376
  /**
368
377
  * @returns {Promise<string>}
369
378
  */
370
- export function get_congestion_stats() {
371
- const ret = wasm.get_congestion_stats();
379
+ export function get_latest_block_hash() {
380
+ const ret = wasm.get_latest_block_hash();
372
381
  return takeObject(ret);
373
382
  }
374
383
 
375
384
  /**
376
- * @param {string} slip1_utxo_key
377
- * @param {string} slip2_utxo_key
378
- * @param {string} slip3_utxo_key
379
- * @param {number} left_count
380
- * @param {number} right_count
381
- * @param {Uint8Array} tx_msg
382
- * @returns {Promise<WasmTransaction>}
385
+ * @param {Array<any>} keys
386
+ * @returns {Promise<WasmBalanceSnapshot>}
383
387
  */
384
- export function create_split_bound_transaction(slip1_utxo_key, slip2_utxo_key, slip3_utxo_key, left_count, right_count, tx_msg) {
385
- 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));
388
+ export function get_balance_snapshot(keys) {
389
+ const ret = wasm.get_balance_snapshot(addHeapObject(keys));
386
390
  return takeObject(ret);
387
391
  }
388
392
 
389
393
  /**
390
- * @param {string} public_key
391
- * @param {bigint} amount
392
- * @param {bigint} fee
393
- * @param {boolean} force_merge
394
- * @returns {Promise<WasmTransaction>}
394
+ * @returns {Promise<string>}
395
395
  */
396
- export function create_transaction(public_key, amount, fee, force_merge) {
397
- const ret = wasm.create_transaction(addHeapObject(public_key), amount, fee, force_merge);
396
+ export function get_stats() {
397
+ const ret = wasm.get_stats();
398
398
  return takeObject(ret);
399
399
  }
400
400
 
401
401
  /**
402
402
  * @param {Uint8Array} buffer
403
- * @param {string} signature
404
- * @param {string} public_key
405
- * @returns {boolean}
406
- */
407
- export function verify_signature(buffer, signature, public_key) {
408
- const ret = wasm.verify_signature(addHeapObject(buffer), addHeapObject(signature), addHeapObject(public_key));
409
- return ret !== 0;
410
- }
411
-
412
- /**
413
- * @param {string} nft_id_hex
414
- * @param {Uint8Array} tx_msg
415
- * @returns {Promise<WasmTransaction>}
403
+ * @returns {string}
416
404
  */
417
- export function create_merge_bound_transaction(nft_id_hex, tx_msg) {
418
- const ptr0 = passStringToWasm0(nft_id_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
419
- const len0 = WASM_VECTOR_LEN;
420
- const ret = wasm.create_merge_bound_transaction(ptr0, len0, addHeapObject(tx_msg));
405
+ export function hash(buffer) {
406
+ const ret = wasm.hash(addHeapObject(buffer));
421
407
  return takeObject(ret);
422
408
  }
423
409
 
424
410
  /**
425
- * @param {string} block_hash
426
- * @returns {Promise<WasmBlock>}
411
+ * @returns {Promise<string>}
427
412
  */
428
- export function get_block(block_hash) {
429
- const ret = wasm.get_block(addHeapObject(block_hash));
413
+ export function get_congestion_stats() {
414
+ const ret = wasm.get_congestion_stats();
430
415
  return takeObject(ret);
431
416
  }
432
417
 
@@ -443,78 +428,95 @@ export function process_fetched_block(buffer, hash, block_id, peer_index) {
443
428
  }
444
429
 
445
430
  /**
446
- * @returns {Promise<string>}
431
+ * @param {Uint8Array} buffer
432
+ * @param {number} msg_index
433
+ * @param {bigint} peer_index
434
+ * @returns {Promise<void>}
447
435
  */
448
- export function get_peer_stats() {
449
- const ret = wasm.get_peer_stats();
436
+ export function send_api_success(buffer, msg_index, peer_index) {
437
+ const ret = wasm.send_api_success(addHeapObject(buffer), msg_index, peer_index);
450
438
  return takeObject(ret);
451
439
  }
452
440
 
453
441
  /**
454
- * @returns {Promise<Array<any>>}
442
+ * @param {string} slip1_utxo_key
443
+ * @param {string} slip2_utxo_key
444
+ * @param {string} slip3_utxo_key
445
+ * @returns {Promise<WasmTransaction>}
455
446
  */
456
- export function get_nft_list() {
457
- const ret = wasm.get_nft_list();
447
+ export function create_remove_bound_transaction(slip1_utxo_key, slip2_utxo_key, slip3_utxo_key) {
448
+ const ret = wasm.create_remove_bound_transaction(addHeapObject(slip1_utxo_key), addHeapObject(slip2_utxo_key), addHeapObject(slip3_utxo_key));
458
449
  return takeObject(ret);
459
450
  }
460
451
 
461
452
  /**
462
- * @param {string} public_key
463
- * @returns {Promise<Array<any>>}
453
+ * @param {bigint} amt
454
+ * @param {string} slip1_utxo_key
455
+ * @param {string} slip2_utxo_key
456
+ * @param {string} slip3_utxo_key
457
+ * @param {string} recipient_public_key
458
+ * @param {Uint8Array} tx_msg
459
+ * @returns {Promise<WasmTransaction>}
464
460
  */
465
- export function get_account_slips(public_key) {
466
- const ret = wasm.get_account_slips(addHeapObject(public_key));
461
+ export function create_send_bound_transaction(amt, slip1_utxo_key, slip2_utxo_key, slip3_utxo_key, recipient_public_key, tx_msg) {
462
+ const ret = wasm.create_send_bound_transaction(amt, addHeapObject(slip1_utxo_key), addHeapObject(slip2_utxo_key), addHeapObject(slip3_utxo_key), addHeapObject(recipient_public_key), addHeapObject(tx_msg));
467
463
  return takeObject(ret);
468
464
  }
469
465
 
470
466
  /**
471
- * @param {bigint} duration_in_ms
467
+ * @param {bigint} peer_index
472
468
  * @returns {Promise<void>}
473
469
  */
474
- export function process_timer_event(duration_in_ms) {
475
- const ret = wasm.process_timer_event(duration_in_ms);
470
+ export function process_peer_disconnection(peer_index) {
471
+ const ret = wasm.process_peer_disconnection(peer_index);
476
472
  return takeObject(ret);
477
473
  }
478
474
 
479
475
  /**
480
- * @returns {Promise<string>}
476
+ * @returns {Promise<bigint>}
481
477
  */
482
- export function get_latest_block_hash() {
483
- const ret = wasm.get_latest_block_hash();
478
+ export function get_next_peer_index() {
479
+ const ret = wasm.get_next_peer_index();
484
480
  return takeObject(ret);
485
481
  }
486
482
 
487
483
  /**
488
- * @param {bigint} peer_index
489
- * @returns {Promise<void>}
484
+ * @param {string} public_key
485
+ * @param {bigint} amount
486
+ * @param {bigint} fee
487
+ * @param {boolean} force_merge
488
+ * @returns {Promise<WasmTransaction>}
490
489
  */
491
- export function remove_stun_peer(peer_index) {
492
- const ret = wasm.remove_stun_peer(peer_index);
490
+ export function create_transaction(public_key, amount, fee, force_merge) {
491
+ const ret = wasm.create_transaction(addHeapObject(public_key), amount, fee, force_merge);
493
492
  return takeObject(ret);
494
493
  }
495
494
 
496
495
  /**
497
- * @param {bigint} peer_index
498
- * @returns {Promise<void>}
496
+ * @param {Uint8Array} buffer
497
+ * @param {string} signature
498
+ * @param {string} public_key
499
+ * @returns {boolean}
499
500
  */
500
- export function process_peer_disconnection(peer_index) {
501
- const ret = wasm.process_peer_disconnection(peer_index);
502
- return takeObject(ret);
501
+ export function verify_signature(buffer, signature, public_key) {
502
+ const ret = wasm.verify_signature(addHeapObject(buffer), addHeapObject(signature), addHeapObject(public_key));
503
+ return ret !== 0;
503
504
  }
504
505
 
505
506
  /**
506
- * @returns {Promise<string>}
507
+ * @returns {Promise<void>}
507
508
  */
508
- export function get_stats() {
509
- const ret = wasm.get_stats();
509
+ export function start_from_received_ghost_chain() {
510
+ const ret = wasm.start_from_received_ghost_chain();
510
511
  return takeObject(ret);
511
512
  }
512
513
 
513
514
  /**
514
- * @returns {Promise<boolean>}
515
+ * @param {bigint} peer_index
516
+ * @returns {Promise<void>}
515
517
  */
516
- export function produce_block_with_gt() {
517
- const ret = wasm.produce_block_with_gt();
518
+ export function remove_stun_peer(peer_index) {
519
+ const ret = wasm.remove_stun_peer(peer_index);
518
520
  return takeObject(ret);
519
521
  }
520
522
 
@@ -532,35 +534,37 @@ export function initialize(config_json, private_key, log_level_num, hasten_multi
532
534
  }
533
535
 
534
536
  /**
535
- * @returns {string}
537
+ * @returns {Promise<WasmWallet>}
536
538
  */
537
- export function generate_private_key() {
538
- const ret = wasm.generate_private_key();
539
+ export function get_wallet() {
540
+ const ret = wasm.get_wallet();
539
541
  return takeObject(ret);
540
542
  }
541
543
 
542
544
  /**
543
- * @returns {Promise<Array<any>>}
545
+ * @param {Uint8Array} buffer
546
+ * @param {number} msg_index
547
+ * @param {bigint} peer_index
548
+ * @returns {Promise<void>}
544
549
  */
545
- export function get_mempool_txs() {
546
- const ret = wasm.get_mempool_txs();
550
+ export function send_api_error(buffer, msg_index, peer_index) {
551
+ const ret = wasm.send_api_error(addHeapObject(buffer), msg_index, peer_index);
547
552
  return takeObject(ret);
548
553
  }
549
554
 
550
555
  /**
551
- * @param {bigint} current_time
552
- * @returns {Promise<void>}
556
+ * @returns {Promise<any>}
553
557
  */
554
- export function process_stat_interval(current_time) {
555
- const ret = wasm.process_stat_interval(current_time);
558
+ export function get_confirmations() {
559
+ const ret = wasm.get_confirmations();
556
560
  return takeObject(ret);
557
561
  }
558
562
 
559
563
  /**
560
- * @returns {Promise<boolean>}
564
+ * @returns {Promise<Array<any>>}
561
565
  */
562
- export function produce_block_without_gt() {
563
- const ret = wasm.produce_block_without_gt();
566
+ export function get_mempool_txs() {
567
+ const ret = wasm.get_mempool_txs();
564
568
  return takeObject(ret);
565
569
  }
566
570
 
@@ -575,48 +579,56 @@ export function propagate_transaction(tx) {
575
579
  }
576
580
 
577
581
  /**
578
- * @param {Uint8Array} buffer
579
- * @param {number} msg_index
580
- * @param {bigint} peer_index
581
582
  * @returns {Promise<void>}
582
583
  */
583
- export function send_api_error(buffer, msg_index, peer_index) {
584
- const ret = wasm.send_api_error(addHeapObject(buffer), msg_index, peer_index);
584
+ export function disable_producing_blocks_by_timer() {
585
+ const ret = wasm.disable_producing_blocks_by_timer();
585
586
  return takeObject(ret);
586
587
  }
587
588
 
588
589
  /**
589
- * @param {WasmBalanceSnapshot} snapshot
590
+ * @param {bigint} peer_index
591
+ * @param {string} ip
590
592
  * @returns {Promise<void>}
591
593
  */
592
- export function update_from_balance_snapshot(snapshot) {
593
- _assertClass(snapshot, WasmBalanceSnapshot);
594
- var ptr0 = snapshot.__destroy_into_raw();
595
- const ret = wasm.update_from_balance_snapshot(ptr0);
594
+ export function process_new_peer(peer_index, ip) {
595
+ const ret = wasm.process_new_peer(peer_index, addHeapObject(ip));
596
596
  return takeObject(ret);
597
597
  }
598
598
 
599
599
  /**
600
600
  * @param {bigint} peer_index
601
- * @param {string} ip
601
+ * @returns {Promise<WasmPeer | undefined>}
602
+ */
603
+ export function get_peer(peer_index) {
604
+ const ret = wasm.get_peer(peer_index);
605
+ return takeObject(ret);
606
+ }
607
+
608
+ /**
609
+ * @param {string} key
610
+ * @returns {boolean}
611
+ */
612
+ export function is_valid_public_key(key) {
613
+ const ret = wasm.is_valid_public_key(addHeapObject(key));
614
+ return ret !== 0;
615
+ }
616
+
617
+ /**
618
+ * @param {bigint} duration_in_ms
602
619
  * @returns {Promise<void>}
603
620
  */
604
- export function process_new_peer(peer_index, ip) {
605
- const ret = wasm.process_new_peer(peer_index, addHeapObject(ip));
621
+ export function process_timer_event(duration_in_ms) {
622
+ const ret = wasm.process_timer_event(duration_in_ms);
606
623
  return takeObject(ret);
607
624
  }
608
625
 
609
626
  /**
610
- * @param {bigint} amt
611
- * @param {string} slip1_utxo_key
612
- * @param {string} slip2_utxo_key
613
- * @param {string} slip3_utxo_key
614
- * @param {string} recipient_public_key
615
- * @param {Uint8Array} tx_msg
616
- * @returns {Promise<WasmTransaction>}
627
+ * @param {bigint} threshold
628
+ * @returns {Promise<void>}
617
629
  */
618
- export function create_send_bound_transaction(amt, slip1_utxo_key, slip2_utxo_key, slip3_utxo_key, recipient_public_key, tx_msg) {
619
- const ret = wasm.create_send_bound_transaction(amt, addHeapObject(slip1_utxo_key), addHeapObject(slip2_utxo_key), addHeapObject(slip3_utxo_key), addHeapObject(recipient_public_key), addHeapObject(tx_msg));
630
+ export function write_issuance_file(threshold) {
631
+ const ret = wasm.write_issuance_file(threshold);
620
632
  return takeObject(ret);
621
633
  }
622
634
 
@@ -629,48 +641,63 @@ export function get_peers() {
629
641
  }
630
642
 
631
643
  /**
644
+ * @param {Uint8Array} buffer
645
+ * @param {number} msg_index
646
+ * @param {bigint} peer_index
632
647
  * @returns {Promise<void>}
633
648
  */
634
- export function start_from_received_ghost_chain() {
635
- const ret = wasm.start_from_received_ghost_chain();
649
+ export function send_api_call(buffer, msg_index, peer_index) {
650
+ const ret = wasm.send_api_call(addHeapObject(buffer), msg_index, peer_index);
636
651
  return takeObject(ret);
637
652
  }
638
653
 
639
654
  /**
640
- * @returns {Promise<any>}
655
+ * @param {bigint} current_time
656
+ * @returns {Promise<void>}
641
657
  */
642
- export function get_confirmations() {
643
- const ret = wasm.get_confirmations();
658
+ export function process_stat_interval(current_time) {
659
+ const ret = wasm.process_stat_interval(current_time);
644
660
  return takeObject(ret);
645
661
  }
646
662
 
647
663
  /**
648
- * @param {string} slip1_utxo_key
649
- * @param {string} slip2_utxo_key
650
- * @param {string} slip3_utxo_key
664
+ * @param {Array<any>} public_keys
665
+ * @param {BigUint64Array} amounts
666
+ * @param {bigint} fee
667
+ * @param {boolean} _force_merge
651
668
  * @returns {Promise<WasmTransaction>}
652
669
  */
653
- export function create_remove_bound_transaction(slip1_utxo_key, slip2_utxo_key, slip3_utxo_key) {
654
- const ret = wasm.create_remove_bound_transaction(addHeapObject(slip1_utxo_key), addHeapObject(slip2_utxo_key), addHeapObject(slip3_utxo_key));
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);
655
672
  return takeObject(ret);
656
673
  }
657
674
 
658
675
  /**
659
- * @returns {Promise<WasmWallet>}
676
+ * @returns {Promise<boolean>}
660
677
  */
661
- export function get_wallet() {
662
- const ret = wasm.get_wallet();
678
+ export function produce_block_without_gt() {
679
+ const ret = wasm.produce_block_without_gt();
680
+ return takeObject(ret);
681
+ }
682
+
683
+ /**
684
+ * @param {string} public_key
685
+ * @returns {Promise<Array<any>>}
686
+ */
687
+ export function get_account_slips(public_key) {
688
+ const ret = wasm.get_account_slips(addHeapObject(public_key));
663
689
  return takeObject(ret);
664
690
  }
665
691
 
666
692
  /**
693
+ * @param {Uint8Array} buffer
667
694
  * @param {string} private_key
668
695
  * @returns {string}
669
696
  */
670
- export function generate_public_key(private_key) {
697
+ export function sign_buffer(buffer, private_key) {
671
698
  try {
672
699
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
673
- wasm.generate_public_key(retptr, addHeapObject(private_key));
700
+ wasm.sign_buffer(retptr, addHeapObject(buffer), addHeapObject(private_key));
674
701
  var r0 = getInt32Memory0()[retptr / 4 + 0];
675
702
  var r1 = getInt32Memory0()[retptr / 4 + 1];
676
703
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -684,49 +711,13 @@ export function generate_public_key(private_key) {
684
711
  }
685
712
 
686
713
  /**
687
- * @param {Uint8Array} buffer
688
- * @param {bigint} peer_index
689
- * @returns {Promise<void>}
690
- */
691
- export function process_msg_buffer_from_peer(buffer, peer_index) {
692
- const ret = wasm.process_msg_buffer_from_peer(addHeapObject(buffer), peer_index);
693
- return takeObject(ret);
694
- }
695
-
696
- /**
697
- * @returns {Promise<WasmBlockchain>}
698
- */
699
- export function get_blockchain() {
700
- const ret = wasm.get_blockchain();
701
- return takeObject(ret);
702
- }
703
-
704
- /**
705
- * @returns {Promise<bigint>}
706
- */
707
- export function get_next_peer_index() {
708
- const ret = wasm.get_next_peer_index();
709
- return takeObject(ret);
710
- }
711
-
712
- /**
713
- * @param {Array<any>} keys
714
- * @returns {Promise<WasmBalanceSnapshot>}
715
- */
716
- export function get_balance_snapshot(keys) {
717
- const ret = wasm.get_balance_snapshot(addHeapObject(keys));
718
- return takeObject(ret);
719
- }
720
-
721
- /**
722
- * @param {Uint8Array} buffer
723
714
  * @param {string} private_key
724
715
  * @returns {string}
725
716
  */
726
- export function sign_buffer(buffer, private_key) {
717
+ export function generate_public_key(private_key) {
727
718
  try {
728
719
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
729
- wasm.sign_buffer(retptr, addHeapObject(buffer), addHeapObject(private_key));
720
+ wasm.generate_public_key(retptr, addHeapObject(private_key));
730
721
  var r0 = getInt32Memory0()[retptr / 4 + 0];
731
722
  var r1 = getInt32Memory0()[retptr / 4 + 1];
732
723
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -739,6 +730,15 @@ export function sign_buffer(buffer, private_key) {
739
730
  }
740
731
  }
741
732
 
733
+ /**
734
+ * @param {string} block_hash
735
+ * @returns {Promise<WasmBlock>}
736
+ */
737
+ export function get_block(block_hash) {
738
+ const ret = wasm.get_block(addHeapObject(block_hash));
739
+ return takeObject(ret);
740
+ }
741
+
742
742
  function handleError(f, args) {
743
743
  try {
744
744
  return f.apply(this, args);
@@ -2696,15 +2696,11 @@ async function __wbg_load(module, imports) {
2696
2696
  function __wbg_get_imports() {
2697
2697
  const imports = {};
2698
2698
  imports.wbg = {};
2699
- imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
2700
- const ret = getStringFromWasm0(arg0, arg1);
2701
- return addHeapObject(ret);
2702
- };
2703
2699
  imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
2704
2700
  takeObject(arg0);
2705
2701
  };
2706
- imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
2707
- const ret = BigInt.asUintN(64, arg0);
2702
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
2703
+ const ret = getStringFromWasm0(arg0, arg1);
2708
2704
  return addHeapObject(ret);
2709
2705
  };
2710
2706
  imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
@@ -2719,42 +2715,46 @@ function __wbg_get_imports() {
2719
2715
  const ret = WasmTransaction.__wrap(arg0);
2720
2716
  return addHeapObject(ret);
2721
2717
  };
2722
- imports.wbg.__wbg_wasmnft_new = function(arg0) {
2723
- const ret = WasmNFT.__wrap(arg0);
2724
- return addHeapObject(ret);
2725
- };
2726
- imports.wbg.__wbg_wasmwalletslip_new = function(arg0) {
2727
- const ret = WasmWalletSlip.__wrap(arg0);
2718
+ imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
2719
+ const ret = BigInt.asUintN(64, arg0);
2728
2720
  return addHeapObject(ret);
2729
2721
  };
2730
2722
  imports.wbg.__wbg_wasmpeer_new = function(arg0) {
2731
2723
  const ret = WasmPeer.__wrap(arg0);
2732
2724
  return addHeapObject(ret);
2733
2725
  };
2734
- imports.wbg.__wbg_wasmblock_new = function(arg0) {
2735
- const ret = WasmBlock.__wrap(arg0);
2726
+ imports.wbg.__wbg_wasmwallet_new = function(arg0) {
2727
+ const ret = WasmWallet.__wrap(arg0);
2736
2728
  return addHeapObject(ret);
2737
2729
  };
2738
2730
  imports.wbg.__wbg_wasmblockchain_new = function(arg0) {
2739
2731
  const ret = WasmBlockchain.__wrap(arg0);
2740
2732
  return addHeapObject(ret);
2741
2733
  };
2742
- imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
2743
- const ret = getObject(arg0);
2744
- return addHeapObject(ret);
2745
- };
2746
- imports.wbg.__wbg_wasmslip_new = function(arg0) {
2747
- const ret = WasmSlip.__wrap(arg0);
2734
+ imports.wbg.__wbg_wasmwalletslip_new = function(arg0) {
2735
+ const ret = WasmWalletSlip.__wrap(arg0);
2748
2736
  return addHeapObject(ret);
2749
2737
  };
2750
- imports.wbg.__wbg_wasmwallet_new = function(arg0) {
2751
- const ret = WasmWallet.__wrap(arg0);
2738
+ imports.wbg.__wbg_wasmblock_new = function(arg0) {
2739
+ const ret = WasmBlock.__wrap(arg0);
2752
2740
  return addHeapObject(ret);
2753
2741
  };
2754
2742
  imports.wbg.__wbg_wasmbalancesnapshot_new = function(arg0) {
2755
2743
  const ret = WasmBalanceSnapshot.__wrap(arg0);
2756
2744
  return addHeapObject(ret);
2757
2745
  };
2746
+ imports.wbg.__wbg_wasmnft_new = function(arg0) {
2747
+ const ret = WasmNFT.__wrap(arg0);
2748
+ return addHeapObject(ret);
2749
+ };
2750
+ imports.wbg.__wbg_wasmslip_new = function(arg0) {
2751
+ const ret = WasmSlip.__wrap(arg0);
2752
+ return addHeapObject(ret);
2753
+ };
2754
+ imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
2755
+ const ret = getObject(arg0);
2756
+ return addHeapObject(ret);
2757
+ };
2758
2758
  imports.wbg.__wbindgen_is_object = function(arg0) {
2759
2759
  const val = getObject(arg0);
2760
2760
  const ret = typeof(val) === 'object' && val !== null;
@@ -2772,7 +2772,7 @@ function __wbg_get_imports() {
2772
2772
  const ret = WasmHop.__wrap(arg0);
2773
2773
  return addHeapObject(ret);
2774
2774
  };
2775
- imports.wbg.__wbg_flushdata_d0071995637d9dca = function(arg0, arg1) {
2775
+ imports.wbg.__wbg_flushdata_782694d9b96c64ed = function(arg0, arg1) {
2776
2776
  let deferred0_0;
2777
2777
  let deferred0_1;
2778
2778
  try {
@@ -2783,7 +2783,7 @@ function __wbg_get_imports() {
2783
2783
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2784
2784
  }
2785
2785
  };
2786
- imports.wbg.__wbg_readvalue_7f66bac15f2b1d9b = function() { return handleError(function (arg0, arg1) {
2786
+ imports.wbg.__wbg_readvalue_c97d73d5a2788af3 = function() { return handleError(function (arg0, arg1) {
2787
2787
  let deferred0_0;
2788
2788
  let deferred0_1;
2789
2789
  try {
@@ -2795,13 +2795,13 @@ function __wbg_get_imports() {
2795
2795
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2796
2796
  }
2797
2797
  }, arguments) };
2798
- imports.wbg.__wbg_loadwallet_6532e71a32ebe34a = function() {
2798
+ imports.wbg.__wbg_loadwallet_195579a7d3db528c = function() {
2799
2799
  MsgHandler.load_wallet();
2800
2800
  };
2801
- imports.wbg.__wbg_savewallet_c435deea2f8fe957 = function() {
2801
+ imports.wbg.__wbg_savewallet_33279d81a586665d = function() {
2802
2802
  MsgHandler.save_wallet();
2803
2803
  };
2804
- imports.wbg.__wbg_writevalue_3c113add4c7138d6 = function(arg0, arg1, arg2) {
2804
+ imports.wbg.__wbg_writevalue_463aeeb91d56f3d5 = function(arg0, arg1, arg2) {
2805
2805
  let deferred0_0;
2806
2806
  let deferred0_1;
2807
2807
  try {
@@ -2812,7 +2812,7 @@ function __wbg_get_imports() {
2812
2812
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2813
2813
  }
2814
2814
  };
2815
- imports.wbg.__wbg_appendvalue_66bca83dbfdae00f = function(arg0, arg1, arg2) {
2815
+ imports.wbg.__wbg_appendvalue_b427962970b5abb6 = function(arg0, arg1, arg2) {
2816
2816
  let deferred0_0;
2817
2817
  let deferred0_1;
2818
2818
  try {
@@ -2823,7 +2823,7 @@ function __wbg_get_imports() {
2823
2823
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2824
2824
  }
2825
2825
  };
2826
- imports.wbg.__wbg_removevalue_e988da25f31f33f7 = function() { return handleError(function (arg0, arg1) {
2826
+ imports.wbg.__wbg_removevalue_3c1595639830a6b1 = function() { return handleError(function (arg0, arg1) {
2827
2827
  let deferred0_0;
2828
2828
  let deferred0_1;
2829
2829
  try {
@@ -2835,10 +2835,10 @@ function __wbg_get_imports() {
2835
2835
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2836
2836
  }
2837
2837
  }, arguments) };
2838
- imports.wbg.__wbg_sendmessage_faf762a243036e23 = function(arg0, arg1) {
2838
+ imports.wbg.__wbg_sendmessage_315b5ec1a9b4580d = function(arg0, arg1) {
2839
2839
  MsgHandler.send_message(takeObject(arg0), getObject(arg1));
2840
2840
  };
2841
- imports.wbg.__wbg_connecttopeer_1d02808ea8234cd0 = function() { return handleError(function (arg0, arg1, arg2) {
2841
+ imports.wbg.__wbg_connecttopeer_3cdd1ebe4a6a8f2a = function() { return handleError(function (arg0, arg1, arg2) {
2842
2842
  let deferred0_0;
2843
2843
  let deferred0_1;
2844
2844
  try {
@@ -2850,13 +2850,13 @@ function __wbg_get_imports() {
2850
2850
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2851
2851
  }
2852
2852
  }, arguments) };
2853
- imports.wbg.__wbg_getmyservices_f19adeeffe50a035 = function() {
2853
+ imports.wbg.__wbg_getmyservices_6c00e5de42eb7e4d = function() {
2854
2854
  const ret = MsgHandler.get_my_services();
2855
2855
  _assertClass(ret, WasmPeerServiceList);
2856
2856
  var ptr1 = ret.__destroy_into_raw();
2857
2857
  return ptr1;
2858
2858
  };
2859
- imports.wbg.__wbg_isexistingfile_847c2977bc75bcb7 = function() { return handleError(function (arg0, arg1) {
2859
+ imports.wbg.__wbg_isexistingfile_f87b68e97a90dba1 = function() { return handleError(function (arg0, arg1) {
2860
2860
  let deferred0_0;
2861
2861
  let deferred0_1;
2862
2862
  try {
@@ -2868,27 +2868,27 @@ function __wbg_get_imports() {
2868
2868
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2869
2869
  }
2870
2870
  }, arguments) };
2871
- imports.wbg.__wbg_processapicall_77c60bf695c62278 = function(arg0, arg1, arg2) {
2871
+ imports.wbg.__wbg_processapicall_90eb27310b01c5c9 = function(arg0, arg1, arg2) {
2872
2872
  MsgHandler.process_api_call(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2873
2873
  };
2874
- imports.wbg.__wbg_processapierror_4152ed10526d1e90 = function(arg0, arg1, arg2) {
2874
+ imports.wbg.__wbg_processapierror_0c077a8fbc642abd = function(arg0, arg1, arg2) {
2875
2875
  MsgHandler.process_api_error(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2876
2876
  };
2877
- imports.wbg.__wbg_processapisuccess_e31b2c1bbeda6850 = function(arg0, arg1, arg2) {
2877
+ imports.wbg.__wbg_processapisuccess_83cda5fc8f709984 = function(arg0, arg1, arg2) {
2878
2878
  MsgHandler.process_api_success(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2879
2879
  };
2880
- imports.wbg.__wbg_sendmessagetoall_23ec9ae3c65baa3b = function(arg0, arg1) {
2880
+ imports.wbg.__wbg_sendmessagetoall_65c26d42cf5ec0b1 = function(arg0, arg1) {
2881
2881
  MsgHandler.send_message_to_all(getObject(arg0), getObject(arg1));
2882
2882
  };
2883
- imports.wbg.__wbg_disconnectfrompeer_64a207462fb9170f = function() { return handleError(function (arg0) {
2883
+ imports.wbg.__wbg_disconnectfrompeer_84bb5ae1a11275a2 = function() { return handleError(function (arg0) {
2884
2884
  const ret = MsgHandler.disconnect_from_peer(takeObject(arg0));
2885
2885
  return addHeapObject(ret);
2886
2886
  }, arguments) };
2887
- imports.wbg.__wbg_loadblockfilelist_de5306e2fa167e2f = function() { return handleError(function () {
2887
+ imports.wbg.__wbg_loadblockfilelist_5c427c4886a9b35f = function() { return handleError(function () {
2888
2888
  const ret = MsgHandler.load_block_file_list();
2889
2889
  return addHeapObject(ret);
2890
2890
  }, arguments) };
2891
- imports.wbg.__wbg_sendinterfaceevent_52637a4231d38f0c = function(arg0, arg1, arg2, arg3, arg4) {
2891
+ imports.wbg.__wbg_sendinterfaceevent_545684113f494709 = function(arg0, arg1, arg2, arg3, arg4) {
2892
2892
  let deferred0_0;
2893
2893
  let deferred0_1;
2894
2894
  let deferred1_0;
@@ -2904,7 +2904,7 @@ function __wbg_get_imports() {
2904
2904
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2905
2905
  }
2906
2906
  };
2907
- imports.wbg.__wbg_sendblocksuccess_037e59183e3f8fc8 = function(arg0, arg1, arg2) {
2907
+ imports.wbg.__wbg_sendblocksuccess_38e53e8b93e087a7 = function(arg0, arg1, arg2) {
2908
2908
  let deferred0_0;
2909
2909
  let deferred0_1;
2910
2910
  try {
@@ -2915,10 +2915,10 @@ function __wbg_get_imports() {
2915
2915
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2916
2916
  }
2917
2917
  };
2918
- imports.wbg.__wbg_sendwalletupdate_203090048ea64a43 = function() {
2918
+ imports.wbg.__wbg_sendwalletupdate_ca4df5bf41062961 = function() {
2919
2919
  MsgHandler.send_wallet_update();
2920
2920
  };
2921
- imports.wbg.__wbg_sendnewversionalert_90ec60877849aec0 = function(arg0, arg1, arg2) {
2921
+ imports.wbg.__wbg_sendnewversionalert_905be141c7705d0a = function(arg0, arg1, arg2) {
2922
2922
  let deferred0_0;
2923
2923
  let deferred0_1;
2924
2924
  try {
@@ -2929,13 +2929,13 @@ function __wbg_get_imports() {
2929
2929
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2930
2930
  }
2931
2931
  };
2932
- imports.wbg.__wbg_sendblockfetchstatusevent_d5e8d4d7fce58f7e = function(arg0) {
2932
+ imports.wbg.__wbg_sendblockfetchstatusevent_b85682b36072bc70 = function(arg0) {
2933
2933
  MsgHandler.send_block_fetch_status_event(BigInt.asUintN(64, arg0));
2934
2934
  };
2935
- imports.wbg.__wbg_sendnewchaindetectedevent_7f3a6efc2e389a50 = function() {
2935
+ imports.wbg.__wbg_sendnewchaindetectedevent_2716566461445c2c = function() {
2936
2936
  MsgHandler.send_new_chain_detected_event();
2937
2937
  };
2938
- imports.wbg.__wbg_fetchblockfrompeer_09517f5c7d00dcb1 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2938
+ imports.wbg.__wbg_fetchblockfrompeer_e64e17797e6e941b = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2939
2939
  let deferred0_0;
2940
2940
  let deferred0_1;
2941
2941
  try {
@@ -2947,7 +2947,7 @@ function __wbg_get_imports() {
2947
2947
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2948
2948
  }
2949
2949
  }, arguments) };
2950
- imports.wbg.__wbg_ensuredirectoryexists_05a10b0b56f6d6e7 = function() { return handleError(function (arg0, arg1) {
2950
+ imports.wbg.__wbg_ensuredirectoryexists_9256ee76e227cc2c = function() { return handleError(function (arg0, arg1) {
2951
2951
  let deferred0_0;
2952
2952
  let deferred0_1;
2953
2953
  try {