saito-wasm 0.2.168 → 0.2.170

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-86859bf1424d0da8/js/msg_handler.js';
1
+ import { MsgHandler } from './snippets/saito-wasm-110f636d48c332b6/js/msg_handler.js';
2
2
 
3
3
  let wasm;
4
4
 
@@ -22,16 +22,9 @@ 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
- }
25
+ const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
33
26
 
34
- let WASM_VECTOR_LEN = 0;
27
+ if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
35
28
 
36
29
  let cachedUint8Memory0 = null;
37
30
 
@@ -42,6 +35,22 @@ function getUint8Memory0() {
42
35
  return cachedUint8Memory0;
43
36
  }
44
37
 
38
+ function getStringFromWasm0(ptr, len) {
39
+ ptr = ptr >>> 0;
40
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
41
+ }
42
+
43
+ function addHeapObject(obj) {
44
+ if (heap_next === heap.length) heap.push(heap.length + 1);
45
+ const idx = heap_next;
46
+ heap_next = heap[idx];
47
+
48
+ heap[idx] = obj;
49
+ return idx;
50
+ }
51
+
52
+ let WASM_VECTOR_LEN = 0;
53
+
45
54
  const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
46
55
 
47
56
  const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
@@ -109,15 +118,6 @@ function getInt32Memory0() {
109
118
  return cachedInt32Memory0;
110
119
  }
111
120
 
112
- const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
113
-
114
- if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
115
-
116
- function getStringFromWasm0(ptr, len) {
117
- ptr = ptr >>> 0;
118
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
119
- }
120
-
121
121
  let cachedFloat64Memory0 = null;
122
122
 
123
123
  function getFloat64Memory0() {
@@ -233,10 +233,12 @@ function _assertClass(instance, klass) {
233
233
  return instance.ptr;
234
234
  }
235
235
  /**
236
- * @returns {Promise<string>}
236
+ * @param {Uint8Array} buffer
237
+ * @param {bigint} peer_index
238
+ * @returns {Promise<void>}
237
239
  */
238
- export function get_stats() {
239
- const ret = wasm.get_stats();
240
+ export function process_msg_buffer_from_peer(buffer, peer_index) {
241
+ const ret = wasm.process_msg_buffer_from_peer(addHeapObject(buffer), peer_index);
240
242
  return takeObject(ret);
241
243
  }
242
244
 
@@ -252,66 +254,67 @@ export function create_remove_bound_transaction(slip1_utxo_key, slip2_utxo_key,
252
254
  }
253
255
 
254
256
  /**
255
- * @returns {Promise<string>}
257
+ * @param {Uint8Array} buffer
258
+ * @param {Uint8Array} hash
259
+ * @param {bigint} block_id
260
+ * @param {bigint} peer_index
261
+ * @returns {Promise<void>}
256
262
  */
257
- export function get_congestion_stats() {
258
- const ret = wasm.get_congestion_stats();
263
+ export function process_fetched_block(buffer, hash, block_id, peer_index) {
264
+ const ret = wasm.process_fetched_block(addHeapObject(buffer), addHeapObject(hash), block_id, peer_index);
259
265
  return takeObject(ret);
260
266
  }
261
267
 
262
268
  /**
263
- * @param {bigint} threshold
264
- * @returns {Promise<void>}
269
+ * @param {bigint} peer_index
270
+ * @returns {Promise<WasmPeer | undefined>}
265
271
  */
266
- export function write_issuance_file(threshold) {
267
- const ret = wasm.write_issuance_file(threshold);
272
+ export function get_peer(peer_index) {
273
+ const ret = wasm.get_peer(peer_index);
268
274
  return takeObject(ret);
269
275
  }
270
276
 
271
277
  /**
272
- * @returns {Promise<string>}
278
+ * @param {string} block_hash
279
+ * @returns {Promise<WasmBlock>}
273
280
  */
274
- export function get_peer_stats() {
275
- const ret = wasm.get_peer_stats();
281
+ export function get_block(block_hash) {
282
+ const ret = wasm.get_block(addHeapObject(block_hash));
276
283
  return takeObject(ret);
277
284
  }
278
285
 
279
286
  /**
280
- * @returns {Promise<WasmWallet>}
287
+ * @returns {Promise<Array<any>>}
281
288
  */
282
- export function get_wallet() {
283
- const ret = wasm.get_wallet();
289
+ export function get_mempool_txs() {
290
+ const ret = wasm.get_mempool_txs();
284
291
  return takeObject(ret);
285
292
  }
286
293
 
287
294
  /**
288
295
  * @param {bigint} peer_index
289
- * @param {string} ip
296
+ * @param {string} public_key
290
297
  * @returns {Promise<void>}
291
298
  */
292
- export function process_new_peer(peer_index, ip) {
293
- const ret = wasm.process_new_peer(peer_index, addHeapObject(ip));
299
+ export function process_stun_peer(peer_index, public_key) {
300
+ const ret = wasm.process_stun_peer(peer_index, addHeapObject(public_key));
294
301
  return takeObject(ret);
295
302
  }
296
303
 
297
304
  /**
298
- * @param {Array<any>} public_keys
299
- * @param {BigUint64Array} amounts
300
- * @param {bigint} fee
301
- * @param {boolean} _force_merge
302
- * @returns {Promise<WasmTransaction>}
305
+ * @param {string} key
306
+ * @returns {boolean}
303
307
  */
304
- export function create_transaction_with_multiple_payments(public_keys, amounts, fee, _force_merge) {
305
- const ret = wasm.create_transaction_with_multiple_payments(addHeapObject(public_keys), addHeapObject(amounts), fee, _force_merge);
306
- return takeObject(ret);
308
+ export function is_valid_public_key(key) {
309
+ const ret = wasm.is_valid_public_key(addHeapObject(key));
310
+ return ret !== 0;
307
311
  }
308
312
 
309
313
  /**
310
- * @param {bigint} peer_index
311
- * @returns {Promise<void>}
314
+ * @returns {Promise<string>}
312
315
  */
313
- export function remove_stun_peer(peer_index) {
314
- const ret = wasm.remove_stun_peer(peer_index);
316
+ export function get_stats() {
317
+ const ret = wasm.get_stats();
315
318
  return takeObject(ret);
316
319
  }
317
320
 
@@ -337,53 +340,35 @@ export function sign_buffer(buffer, private_key) {
337
340
  }
338
341
 
339
342
  /**
340
- * @param {Uint8Array} buffer
341
- * @returns {string}
342
- */
343
- export function hash(buffer) {
344
- const ret = wasm.hash(addHeapObject(buffer));
345
- return takeObject(ret);
346
- }
347
-
348
- /**
349
- * @returns {Promise<boolean>}
350
- */
351
- export function produce_block_without_gt() {
352
- const ret = wasm.produce_block_without_gt();
353
- return takeObject(ret);
354
- }
355
-
356
- /**
357
- * @returns {Promise<Array<any>>}
343
+ * @param {bigint} peer_index
344
+ * @returns {Promise<void>}
358
345
  */
359
- export function get_nft_list() {
360
- const ret = wasm.get_nft_list();
346
+ export function process_peer_disconnection(peer_index) {
347
+ const ret = wasm.process_peer_disconnection(peer_index);
361
348
  return takeObject(ret);
362
349
  }
363
350
 
364
351
  /**
365
- * @param {bigint} peer_index
366
- * @returns {Promise<WasmPeer | undefined>}
352
+ * @returns {Promise<WasmBlockchain>}
367
353
  */
368
- export function get_peer(peer_index) {
369
- const ret = wasm.get_peer(peer_index);
354
+ export function get_blockchain() {
355
+ const ret = wasm.get_blockchain();
370
356
  return takeObject(ret);
371
357
  }
372
358
 
373
359
  /**
374
- * @param {bigint} duration_in_ms
375
- * @returns {Promise<void>}
360
+ * @returns {Promise<string>}
376
361
  */
377
- export function process_timer_event(duration_in_ms) {
378
- const ret = wasm.process_timer_event(duration_in_ms);
362
+ export function get_congestion_stats() {
363
+ const ret = wasm.get_congestion_stats();
379
364
  return takeObject(ret);
380
365
  }
381
366
 
382
367
  /**
383
- * @returns {Promise<boolean>}
368
+ * @returns {Promise<any>}
384
369
  */
385
- export function produce_block_with_gt() {
386
- const ret = wasm.produce_block_with_gt();
370
+ export function get_confirmations() {
371
+ const ret = wasm.get_confirmations();
387
372
  return takeObject(ret);
388
373
  }
389
374
 
@@ -402,56 +387,59 @@ export function create_split_bound_transaction(slip1_utxo_key, slip2_utxo_key, s
402
387
  }
403
388
 
404
389
  /**
405
- * @param {bigint} current_time
406
- * @returns {Promise<void>}
390
+ * @param {bigint} amt
391
+ * @param {string} slip1_utxo_key
392
+ * @param {string} slip2_utxo_key
393
+ * @param {string} slip3_utxo_key
394
+ * @param {string} recipient_public_key
395
+ * @param {Uint8Array} tx_msg
396
+ * @returns {Promise<WasmTransaction>}
407
397
  */
408
- export function process_stat_interval(current_time) {
409
- const ret = wasm.process_stat_interval(current_time);
398
+ export function create_send_bound_transaction(amt, slip1_utxo_key, slip2_utxo_key, slip3_utxo_key, recipient_public_key, tx_msg) {
399
+ 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));
410
400
  return takeObject(ret);
411
401
  }
412
402
 
413
403
  /**
414
- * @param {bigint} peer_index
415
- * @param {string} public_key
416
- * @returns {Promise<void>}
404
+ * @returns {Promise<string>}
417
405
  */
418
- export function process_stun_peer(peer_index, public_key) {
419
- const ret = wasm.process_stun_peer(peer_index, addHeapObject(public_key));
406
+ export function get_latest_block_hash() {
407
+ const ret = wasm.get_latest_block_hash();
420
408
  return takeObject(ret);
421
409
  }
422
410
 
423
411
  /**
424
- * @returns {Promise<any>}
412
+ * @returns {Promise<WasmWallet>}
425
413
  */
426
- export function get_confirmations() {
427
- const ret = wasm.get_confirmations();
414
+ export function get_wallet() {
415
+ const ret = wasm.get_wallet();
428
416
  return takeObject(ret);
429
417
  }
430
418
 
431
419
  /**
432
- * @returns {Promise<void>}
420
+ * @returns {Promise<string>}
433
421
  */
434
- export function start_from_received_ghost_chain() {
435
- const ret = wasm.start_from_received_ghost_chain();
422
+ export function get_peer_stats() {
423
+ const ret = wasm.get_peer_stats();
436
424
  return takeObject(ret);
437
425
  }
438
426
 
439
427
  /**
440
- * @param {Uint8Array} buffer
441
- * @param {number} msg_index
442
- * @param {bigint} peer_index
443
- * @returns {Promise<void>}
428
+ * @returns {Promise<Array<any>>}
444
429
  */
445
- export function send_api_error(buffer, msg_index, peer_index) {
446
- const ret = wasm.send_api_error(addHeapObject(buffer), msg_index, peer_index);
430
+ export function get_peers() {
431
+ const ret = wasm.get_peers();
447
432
  return takeObject(ret);
448
433
  }
449
434
 
450
435
  /**
451
- * @returns {Promise<Array<any>>}
436
+ * @param {Uint8Array} buffer
437
+ * @param {number} msg_index
438
+ * @param {bigint} peer_index
439
+ * @returns {Promise<void>}
452
440
  */
453
- export function get_mempool_txs() {
454
- const ret = wasm.get_mempool_txs();
441
+ export function send_api_call(buffer, msg_index, peer_index) {
442
+ const ret = wasm.send_api_call(addHeapObject(buffer), msg_index, peer_index);
455
443
  return takeObject(ret);
456
444
  }
457
445
 
@@ -476,58 +464,55 @@ export function generate_public_key(private_key) {
476
464
  }
477
465
 
478
466
  /**
479
- * @param {string} config_json
480
- * @param {string} private_key
481
- * @param {number} log_level_num
482
- * @param {bigint} hasten_multiplier
483
- * @param {boolean} delete_old_blocks
484
- * @returns {Promise<any>}
467
+ * @param {WasmTransaction} tx
468
+ * @returns {Promise<void>}
485
469
  */
486
- export function initialize(config_json, private_key, log_level_num, hasten_multiplier, delete_old_blocks) {
487
- const ret = wasm.initialize(addHeapObject(config_json), addHeapObject(private_key), log_level_num, hasten_multiplier, delete_old_blocks);
470
+ export function propagate_transaction(tx) {
471
+ _assertClass(tx, WasmTransaction);
472
+ const ret = wasm.propagate_transaction(tx.__wbg_ptr);
488
473
  return takeObject(ret);
489
474
  }
490
475
 
491
476
  /**
492
- * @param {Uint8Array} buffer
493
- * @param {string} signature
494
- * @param {string} public_key
495
- * @returns {boolean}
477
+ * @param {Array<any>} keys
478
+ * @returns {Promise<WasmBalanceSnapshot>}
496
479
  */
497
- export function verify_signature(buffer, signature, public_key) {
498
- const ret = wasm.verify_signature(addHeapObject(buffer), addHeapObject(signature), addHeapObject(public_key));
499
- return ret !== 0;
480
+ export function get_balance_snapshot(keys) {
481
+ const ret = wasm.get_balance_snapshot(addHeapObject(keys));
482
+ return takeObject(ret);
500
483
  }
501
484
 
502
485
  /**
503
- * @param {Uint8Array} buffer
504
- * @param {bigint} peer_index
505
- * @returns {Promise<void>}
486
+ * @param {string} nft_id_hex
487
+ * @param {Uint8Array} tx_msg
488
+ * @returns {Promise<WasmTransaction>}
506
489
  */
507
- export function process_msg_buffer_from_peer(buffer, peer_index) {
508
- const ret = wasm.process_msg_buffer_from_peer(addHeapObject(buffer), peer_index);
490
+ export function create_merge_bound_transaction(nft_id_hex, tx_msg) {
491
+ const ptr0 = passStringToWasm0(nft_id_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
492
+ const len0 = WASM_VECTOR_LEN;
493
+ const ret = wasm.create_merge_bound_transaction(ptr0, len0, addHeapObject(tx_msg));
509
494
  return takeObject(ret);
510
495
  }
511
496
 
512
497
  /**
513
- * @param {bigint} num
514
- * @param {bigint} deposit
515
- * @param {Uint8Array} tx_msg
516
- * @param {bigint} fee
517
- * @param {string} recipient_public_key
518
- * @param {string} nft_type
519
- * @returns {Promise<WasmTransaction>}
498
+ * @param {bigint} peer_index
499
+ * @param {string} ip
500
+ * @returns {Promise<void>}
520
501
  */
521
- export function create_bound_transaction(num, deposit, tx_msg, fee, recipient_public_key, nft_type) {
522
- const ret = wasm.create_bound_transaction(num, deposit, addHeapObject(tx_msg), fee, addHeapObject(recipient_public_key), addHeapObject(nft_type));
502
+ export function process_new_peer(peer_index, ip) {
503
+ const ret = wasm.process_new_peer(peer_index, addHeapObject(ip));
523
504
  return takeObject(ret);
524
505
  }
525
506
 
526
507
  /**
527
- * @returns {Promise<WasmBlockchain>}
508
+ * @param {Array<any>} public_keys
509
+ * @param {BigUint64Array} amounts
510
+ * @param {bigint} fee
511
+ * @param {boolean} _force_merge
512
+ * @returns {Promise<WasmTransaction>}
528
513
  */
529
- export function get_blockchain() {
530
- const ret = wasm.get_blockchain();
514
+ export function create_transaction_with_multiple_payments(public_keys, amounts, fee, _force_merge) {
515
+ const ret = wasm.create_transaction_with_multiple_payments(addHeapObject(public_keys), addHeapObject(amounts), fee, _force_merge);
531
516
  return takeObject(ret);
532
517
  }
533
518
 
@@ -543,64 +528,55 @@ export function process_failed_block_fetch(hash, block_id, peer_index) {
543
528
  }
544
529
 
545
530
  /**
546
- * @returns {string}
531
+ * @returns {Promise<Array<any>>}
547
532
  */
548
- export function generate_private_key() {
549
- const ret = wasm.generate_private_key();
533
+ export function get_nft_list() {
534
+ const ret = wasm.get_nft_list();
550
535
  return takeObject(ret);
551
536
  }
552
537
 
553
538
  /**
554
- * @param {string} public_key
555
- * @param {bigint} amount
556
- * @param {bigint} fee
557
- * @param {boolean} force_merge
558
- * @returns {Promise<WasmTransaction>}
539
+ * @returns {Promise<boolean>}
559
540
  */
560
- export function create_transaction(public_key, amount, fee, force_merge) {
561
- const ret = wasm.create_transaction(addHeapObject(public_key), amount, fee, force_merge);
541
+ export function produce_block_with_gt() {
542
+ const ret = wasm.produce_block_with_gt();
562
543
  return takeObject(ret);
563
544
  }
564
545
 
565
546
  /**
566
- * @param {WasmBalanceSnapshot} snapshot
547
+ * @param {bigint} peer_index
567
548
  * @returns {Promise<void>}
568
549
  */
569
- export function update_from_balance_snapshot(snapshot) {
570
- _assertClass(snapshot, WasmBalanceSnapshot);
571
- var ptr0 = snapshot.__destroy_into_raw();
572
- const ret = wasm.update_from_balance_snapshot(ptr0);
550
+ export function remove_stun_peer(peer_index) {
551
+ const ret = wasm.remove_stun_peer(peer_index);
573
552
  return takeObject(ret);
574
553
  }
575
554
 
576
555
  /**
577
- * @param {WasmTransaction} tx
578
- * @returns {Promise<void>}
556
+ * @returns {string}
579
557
  */
580
- export function propagate_transaction(tx) {
581
- _assertClass(tx, WasmTransaction);
582
- const ret = wasm.propagate_transaction(tx.__wbg_ptr);
558
+ export function generate_private_key() {
559
+ const ret = wasm.generate_private_key();
583
560
  return takeObject(ret);
584
561
  }
585
562
 
586
563
  /**
587
- * @param {bigint} peer_index
588
564
  * @returns {Promise<void>}
589
565
  */
590
- export function process_peer_disconnection(peer_index) {
591
- const ret = wasm.process_peer_disconnection(peer_index);
566
+ export function start_from_received_ghost_chain() {
567
+ const ret = wasm.start_from_received_ghost_chain();
592
568
  return takeObject(ret);
593
569
  }
594
570
 
595
571
  /**
596
- * @param {Uint8Array} buffer
597
- * @param {Uint8Array} hash
598
- * @param {bigint} block_id
599
- * @param {bigint} peer_index
600
- * @returns {Promise<void>}
572
+ * @param {string} public_key
573
+ * @param {bigint} amount
574
+ * @param {bigint} fee
575
+ * @param {boolean} force_merge
576
+ * @returns {Promise<WasmTransaction>}
601
577
  */
602
- export function process_fetched_block(buffer, hash, block_id, peer_index) {
603
- const ret = wasm.process_fetched_block(addHeapObject(buffer), addHeapObject(hash), block_id, peer_index);
578
+ export function create_transaction(public_key, amount, fee, force_merge) {
579
+ const ret = wasm.create_transaction(addHeapObject(public_key), amount, fee, force_merge);
604
580
  return takeObject(ret);
605
581
  }
606
582
 
@@ -614,120 +590,144 @@ export function get_account_slips(public_key) {
614
590
  }
615
591
 
616
592
  /**
617
- * @returns {Promise<Array<any>>}
593
+ * @param {bigint} num
594
+ * @param {bigint} deposit
595
+ * @param {Uint8Array} tx_msg
596
+ * @param {bigint} fee
597
+ * @param {string} recipient_public_key
598
+ * @param {string} nft_type
599
+ * @returns {Promise<WasmTransaction>}
618
600
  */
619
- export function get_peers() {
620
- const ret = wasm.get_peers();
601
+ export function create_bound_transaction(num, deposit, tx_msg, fee, recipient_public_key, nft_type) {
602
+ const ret = wasm.create_bound_transaction(num, deposit, addHeapObject(tx_msg), fee, addHeapObject(recipient_public_key), addHeapObject(nft_type));
621
603
  return takeObject(ret);
622
604
  }
623
605
 
624
606
  /**
625
- * @param {string} key
626
- * @returns {boolean}
607
+ * @param {bigint} current_time
608
+ * @returns {Promise<void>}
627
609
  */
628
- export function is_valid_public_key(key) {
629
- const ret = wasm.is_valid_public_key(addHeapObject(key));
630
- return ret !== 0;
610
+ export function process_stat_interval(current_time) {
611
+ const ret = wasm.process_stat_interval(current_time);
612
+ return takeObject(ret);
631
613
  }
632
614
 
633
615
  /**
634
- * @param {string} block_hash
635
- * @returns {Promise<WasmBlock>}
616
+ * @returns {Promise<void>}
636
617
  */
637
- export function get_block(block_hash) {
638
- const ret = wasm.get_block(addHeapObject(block_hash));
618
+ export function disable_producing_blocks_by_timer() {
619
+ const ret = wasm.disable_producing_blocks_by_timer();
639
620
  return takeObject(ret);
640
621
  }
641
622
 
642
623
  /**
643
- * @returns {Promise<string>}
624
+ * @param {Uint8Array} buffer
625
+ * @param {number} msg_index
626
+ * @param {bigint} peer_index
627
+ * @returns {Promise<void>}
644
628
  */
645
- export function get_latest_block_hash() {
646
- const ret = wasm.get_latest_block_hash();
629
+ export function send_api_success(buffer, msg_index, peer_index) {
630
+ const ret = wasm.send_api_success(addHeapObject(buffer), msg_index, peer_index);
647
631
  return takeObject(ret);
648
632
  }
649
633
 
650
634
  /**
651
- * @param {bigint} amt
652
- * @param {string} slip1_utxo_key
653
- * @param {string} slip2_utxo_key
654
- * @param {string} slip3_utxo_key
655
- * @param {string} recipient_public_key
656
- * @param {Uint8Array} tx_msg
657
- * @returns {Promise<WasmTransaction>}
635
+ * @param {bigint} duration_in_ms
636
+ * @returns {Promise<void>}
658
637
  */
659
- export function create_send_bound_transaction(amt, slip1_utxo_key, slip2_utxo_key, slip3_utxo_key, recipient_public_key, tx_msg) {
660
- 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));
638
+ export function process_timer_event(duration_in_ms) {
639
+ const ret = wasm.process_timer_event(duration_in_ms);
661
640
  return takeObject(ret);
662
641
  }
663
642
 
664
643
  /**
665
- * @returns {Promise<bigint>}
644
+ * @returns {Promise<boolean>}
666
645
  */
667
- export function get_next_peer_index() {
668
- const ret = wasm.get_next_peer_index();
646
+ export function produce_block_without_gt() {
647
+ const ret = wasm.produce_block_without_gt();
669
648
  return takeObject(ret);
670
649
  }
671
650
 
672
651
  /**
652
+ * @param {WasmBalanceSnapshot} snapshot
673
653
  * @returns {Promise<void>}
674
654
  */
675
- export function disable_producing_blocks_by_timer() {
676
- const ret = wasm.disable_producing_blocks_by_timer();
655
+ export function update_from_balance_snapshot(snapshot) {
656
+ _assertClass(snapshot, WasmBalanceSnapshot);
657
+ var ptr0 = snapshot.__destroy_into_raw();
658
+ const ret = wasm.update_from_balance_snapshot(ptr0);
677
659
  return takeObject(ret);
678
660
  }
679
661
 
680
662
  /**
681
663
  * @param {Uint8Array} buffer
682
- * @param {number} msg_index
683
- * @param {bigint} peer_index
664
+ * @param {string} signature
665
+ * @param {string} public_key
666
+ * @returns {boolean}
667
+ */
668
+ export function verify_signature(buffer, signature, public_key) {
669
+ const ret = wasm.verify_signature(addHeapObject(buffer), addHeapObject(signature), addHeapObject(public_key));
670
+ return ret !== 0;
671
+ }
672
+
673
+ /**
674
+ * @param {number} major
675
+ * @param {number} minor
676
+ * @param {number} patch
684
677
  * @returns {Promise<void>}
685
678
  */
686
- export function send_api_call(buffer, msg_index, peer_index) {
687
- const ret = wasm.send_api_call(addHeapObject(buffer), msg_index, peer_index);
679
+ export function set_wallet_version(major, minor, patch) {
680
+ const ret = wasm.set_wallet_version(major, minor, patch);
688
681
  return takeObject(ret);
689
682
  }
690
683
 
691
684
  /**
692
- * @param {Array<any>} keys
693
- * @returns {Promise<WasmBalanceSnapshot>}
685
+ * @param {bigint} threshold
686
+ * @returns {Promise<void>}
694
687
  */
695
- export function get_balance_snapshot(keys) {
696
- const ret = wasm.get_balance_snapshot(addHeapObject(keys));
688
+ export function write_issuance_file(threshold) {
689
+ const ret = wasm.write_issuance_file(threshold);
690
+ return takeObject(ret);
691
+ }
692
+
693
+ /**
694
+ * @returns {Promise<bigint>}
695
+ */
696
+ export function get_next_peer_index() {
697
+ const ret = wasm.get_next_peer_index();
697
698
  return takeObject(ret);
698
699
  }
699
700
 
700
701
  /**
701
702
  * @param {Uint8Array} buffer
702
- * @param {number} msg_index
703
- * @param {bigint} peer_index
704
- * @returns {Promise<void>}
703
+ * @returns {string}
705
704
  */
706
- export function send_api_success(buffer, msg_index, peer_index) {
707
- const ret = wasm.send_api_success(addHeapObject(buffer), msg_index, peer_index);
705
+ export function hash(buffer) {
706
+ const ret = wasm.hash(addHeapObject(buffer));
708
707
  return takeObject(ret);
709
708
  }
710
709
 
711
710
  /**
712
- * @param {string} nft_id_hex
713
- * @param {Uint8Array} tx_msg
714
- * @returns {Promise<WasmTransaction>}
711
+ * @param {string} config_json
712
+ * @param {string} private_key
713
+ * @param {number} log_level_num
714
+ * @param {bigint} hasten_multiplier
715
+ * @param {boolean} delete_old_blocks
716
+ * @returns {Promise<any>}
715
717
  */
716
- export function create_merge_bound_transaction(nft_id_hex, tx_msg) {
717
- const ptr0 = passStringToWasm0(nft_id_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
718
- const len0 = WASM_VECTOR_LEN;
719
- const ret = wasm.create_merge_bound_transaction(ptr0, len0, addHeapObject(tx_msg));
718
+ export function initialize(config_json, private_key, log_level_num, hasten_multiplier, delete_old_blocks) {
719
+ const ret = wasm.initialize(addHeapObject(config_json), addHeapObject(private_key), log_level_num, hasten_multiplier, delete_old_blocks);
720
720
  return takeObject(ret);
721
721
  }
722
722
 
723
723
  /**
724
- * @param {number} major
725
- * @param {number} minor
726
- * @param {number} patch
724
+ * @param {Uint8Array} buffer
725
+ * @param {number} msg_index
726
+ * @param {bigint} peer_index
727
727
  * @returns {Promise<void>}
728
728
  */
729
- export function set_wallet_version(major, minor, patch) {
730
- const ret = wasm.set_wallet_version(major, minor, patch);
729
+ export function send_api_error(buffer, msg_index, peer_index) {
730
+ const ret = wasm.send_api_error(addHeapObject(buffer), msg_index, peer_index);
731
731
  return takeObject(ret);
732
732
  }
733
733
 
@@ -2668,63 +2668,63 @@ async function __wbg_load(module, imports) {
2668
2668
  function __wbg_get_imports() {
2669
2669
  const imports = {};
2670
2670
  imports.wbg = {};
2671
- imports.wbg.__wbg_wasmwallet_new = function(arg0) {
2672
- const ret = WasmWallet.__wrap(arg0);
2673
- return addHeapObject(ret);
2674
- };
2675
2671
  imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
2676
2672
  takeObject(arg0);
2677
2673
  };
2678
- imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
2679
- const ret = BigInt.asUintN(64, arg0);
2674
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
2675
+ const ret = getStringFromWasm0(arg0, arg1);
2680
2676
  return addHeapObject(ret);
2681
2677
  };
2682
- imports.wbg.__wbg_wasmpeer_new = function(arg0) {
2683
- const ret = WasmPeer.__wrap(arg0);
2678
+ imports.wbg.__wbg_wasmtransaction_new = function(arg0) {
2679
+ const ret = WasmTransaction.__wrap(arg0);
2684
2680
  return addHeapObject(ret);
2685
2681
  };
2686
- imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
2687
- const obj = getObject(arg1);
2688
- const ret = typeof(obj) === 'string' ? obj : undefined;
2689
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2690
- var len1 = WASM_VECTOR_LEN;
2691
- getInt32Memory0()[arg0 / 4 + 1] = len1;
2692
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2693
- };
2694
- imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
2695
- const ret = getObject(arg0);
2682
+ imports.wbg.__wbg_wasmbalancesnapshot_new = function(arg0) {
2683
+ const ret = WasmBalanceSnapshot.__wrap(arg0);
2696
2684
  return addHeapObject(ret);
2697
2685
  };
2698
- imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
2699
- const ret = getStringFromWasm0(arg0, arg1);
2686
+ imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
2687
+ const ret = BigInt.asUintN(64, arg0);
2700
2688
  return addHeapObject(ret);
2701
2689
  };
2702
- imports.wbg.__wbg_wasmtransaction_new = function(arg0) {
2703
- const ret = WasmTransaction.__wrap(arg0);
2690
+ imports.wbg.__wbg_wasmnft_new = function(arg0) {
2691
+ const ret = WasmNFT.__wrap(arg0);
2704
2692
  return addHeapObject(ret);
2705
2693
  };
2706
2694
  imports.wbg.__wbg_wasmblock_new = function(arg0) {
2707
2695
  const ret = WasmBlock.__wrap(arg0);
2708
2696
  return addHeapObject(ret);
2709
2697
  };
2710
- imports.wbg.__wbg_wasmnft_new = function(arg0) {
2711
- const ret = WasmNFT.__wrap(arg0);
2698
+ imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
2699
+ const ret = getObject(arg0);
2700
+ return addHeapObject(ret);
2701
+ };
2702
+ imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
2703
+ const obj = getObject(arg1);
2704
+ const ret = typeof(obj) === 'string' ? obj : undefined;
2705
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2706
+ var len1 = WASM_VECTOR_LEN;
2707
+ getInt32Memory0()[arg0 / 4 + 1] = len1;
2708
+ getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2709
+ };
2710
+ imports.wbg.__wbg_wasmpeer_new = function(arg0) {
2711
+ const ret = WasmPeer.__wrap(arg0);
2712
2712
  return addHeapObject(ret);
2713
2713
  };
2714
2714
  imports.wbg.__wbg_wasmwalletslip_new = function(arg0) {
2715
2715
  const ret = WasmWalletSlip.__wrap(arg0);
2716
2716
  return addHeapObject(ret);
2717
2717
  };
2718
- imports.wbg.__wbg_wasmblockchain_new = function(arg0) {
2719
- const ret = WasmBlockchain.__wrap(arg0);
2718
+ imports.wbg.__wbg_wasmslip_new = function(arg0) {
2719
+ const ret = WasmSlip.__wrap(arg0);
2720
2720
  return addHeapObject(ret);
2721
2721
  };
2722
- imports.wbg.__wbg_wasmbalancesnapshot_new = function(arg0) {
2723
- const ret = WasmBalanceSnapshot.__wrap(arg0);
2722
+ imports.wbg.__wbg_wasmwallet_new = function(arg0) {
2723
+ const ret = WasmWallet.__wrap(arg0);
2724
2724
  return addHeapObject(ret);
2725
2725
  };
2726
- imports.wbg.__wbg_wasmslip_new = function(arg0) {
2727
- const ret = WasmSlip.__wrap(arg0);
2726
+ imports.wbg.__wbg_wasmblockchain_new = function(arg0) {
2727
+ const ret = WasmBlockchain.__wrap(arg0);
2728
2728
  return addHeapObject(ret);
2729
2729
  };
2730
2730
  imports.wbg.__wbg_wasmpeerservice_new = function(arg0) {
@@ -2752,7 +2752,7 @@ function __wbg_get_imports() {
2752
2752
  const ret = getObject(arg0) in getObject(arg1);
2753
2753
  return ret;
2754
2754
  };
2755
- imports.wbg.__wbg_flushdata_808d365e0b29c0a2 = function(arg0, arg1) {
2755
+ imports.wbg.__wbg_flushdata_31d2c087e1642e7d = function(arg0, arg1) {
2756
2756
  let deferred0_0;
2757
2757
  let deferred0_1;
2758
2758
  try {
@@ -2763,7 +2763,7 @@ function __wbg_get_imports() {
2763
2763
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2764
2764
  }
2765
2765
  };
2766
- imports.wbg.__wbg_readvalue_477650491ff9e695 = function() { return handleError(function (arg0, arg1) {
2766
+ imports.wbg.__wbg_readvalue_8d065620fad540d3 = function() { return handleError(function (arg0, arg1) {
2767
2767
  let deferred0_0;
2768
2768
  let deferred0_1;
2769
2769
  try {
@@ -2775,13 +2775,13 @@ function __wbg_get_imports() {
2775
2775
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2776
2776
  }
2777
2777
  }, arguments) };
2778
- imports.wbg.__wbg_loadwallet_1fe5d48fd952ef73 = function() {
2778
+ imports.wbg.__wbg_loadwallet_b2c7c0fa442cbf65 = function() {
2779
2779
  MsgHandler.load_wallet();
2780
2780
  };
2781
- imports.wbg.__wbg_savewallet_b940ab300375ff10 = function() {
2781
+ imports.wbg.__wbg_savewallet_8ffd86ac6de7743c = function() {
2782
2782
  MsgHandler.save_wallet();
2783
2783
  };
2784
- imports.wbg.__wbg_writevalue_a276627f5b0daa75 = function(arg0, arg1, arg2) {
2784
+ imports.wbg.__wbg_writevalue_7d36c3a0011f6888 = 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_appendvalue_a0ebb6a0493e9646 = function(arg0, arg1, arg2) {
2795
+ imports.wbg.__wbg_appendvalue_9c7e734a5893fc55 = function(arg0, arg1, arg2) {
2796
2796
  let deferred0_0;
2797
2797
  let deferred0_1;
2798
2798
  try {
@@ -2803,7 +2803,7 @@ function __wbg_get_imports() {
2803
2803
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2804
2804
  }
2805
2805
  };
2806
- imports.wbg.__wbg_removevalue_bc2f16573f079618 = function() { return handleError(function (arg0, arg1) {
2806
+ imports.wbg.__wbg_removevalue_227bcc904f295bd0 = function() { return handleError(function (arg0, arg1) {
2807
2807
  let deferred0_0;
2808
2808
  let deferred0_1;
2809
2809
  try {
@@ -2815,10 +2815,10 @@ function __wbg_get_imports() {
2815
2815
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2816
2816
  }
2817
2817
  }, arguments) };
2818
- imports.wbg.__wbg_sendmessage_cdd0bd5423f92af1 = function(arg0, arg1) {
2818
+ imports.wbg.__wbg_sendmessage_cd344e9a3340f289 = function(arg0, arg1) {
2819
2819
  MsgHandler.send_message(takeObject(arg0), getObject(arg1));
2820
2820
  };
2821
- imports.wbg.__wbg_connecttopeer_736987b1f0448891 = function() { return handleError(function (arg0, arg1, arg2) {
2821
+ imports.wbg.__wbg_connecttopeer_16e7986091989ecf = function() { return handleError(function (arg0, arg1, arg2) {
2822
2822
  let deferred0_0;
2823
2823
  let deferred0_1;
2824
2824
  try {
@@ -2830,13 +2830,13 @@ function __wbg_get_imports() {
2830
2830
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2831
2831
  }
2832
2832
  }, arguments) };
2833
- imports.wbg.__wbg_getmyservices_330667a8654f35a7 = function() {
2833
+ imports.wbg.__wbg_getmyservices_b806cf3d9852d311 = function() {
2834
2834
  const ret = MsgHandler.get_my_services();
2835
2835
  _assertClass(ret, WasmPeerServiceList);
2836
2836
  var ptr1 = ret.__destroy_into_raw();
2837
2837
  return ptr1;
2838
2838
  };
2839
- imports.wbg.__wbg_isexistingfile_1613c50ce134b84a = function() { return handleError(function (arg0, arg1) {
2839
+ imports.wbg.__wbg_isexistingfile_c062164dc13b389d = function() { return handleError(function (arg0, arg1) {
2840
2840
  let deferred0_0;
2841
2841
  let deferred0_1;
2842
2842
  try {
@@ -2848,27 +2848,27 @@ function __wbg_get_imports() {
2848
2848
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2849
2849
  }
2850
2850
  }, arguments) };
2851
- imports.wbg.__wbg_processapicall_dbf1c9f895fcb1cd = function(arg0, arg1, arg2) {
2851
+ imports.wbg.__wbg_processapicall_c2228580d601f805 = function(arg0, arg1, arg2) {
2852
2852
  MsgHandler.process_api_call(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2853
2853
  };
2854
- imports.wbg.__wbg_processapierror_595ac1369f5acea7 = function(arg0, arg1, arg2) {
2854
+ imports.wbg.__wbg_processapierror_0cb5fae74370713b = function(arg0, arg1, arg2) {
2855
2855
  MsgHandler.process_api_error(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2856
2856
  };
2857
- imports.wbg.__wbg_processapisuccess_695629f3f7756a39 = function(arg0, arg1, arg2) {
2857
+ imports.wbg.__wbg_processapisuccess_20585df4ae6a3084 = function(arg0, arg1, arg2) {
2858
2858
  MsgHandler.process_api_success(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2859
2859
  };
2860
- imports.wbg.__wbg_sendmessagetoall_e023831c7abb9bd3 = function(arg0, arg1) {
2860
+ imports.wbg.__wbg_sendmessagetoall_8d207c0a3aad8a72 = function(arg0, arg1) {
2861
2861
  MsgHandler.send_message_to_all(getObject(arg0), getObject(arg1));
2862
2862
  };
2863
- imports.wbg.__wbg_disconnectfrompeer_b547175d81b1476c = function() { return handleError(function (arg0) {
2863
+ imports.wbg.__wbg_disconnectfrompeer_038b8dc66715b3af = function() { return handleError(function (arg0) {
2864
2864
  const ret = MsgHandler.disconnect_from_peer(takeObject(arg0));
2865
2865
  return addHeapObject(ret);
2866
2866
  }, arguments) };
2867
- imports.wbg.__wbg_loadblockfilelist_75f095d9dae692ce = function() { return handleError(function () {
2867
+ imports.wbg.__wbg_loadblockfilelist_ddddc432935846b1 = function() { return handleError(function () {
2868
2868
  const ret = MsgHandler.load_block_file_list();
2869
2869
  return addHeapObject(ret);
2870
2870
  }, arguments) };
2871
- imports.wbg.__wbg_sendinterfaceevent_00bfe127965dc99e = function(arg0, arg1, arg2, arg3, arg4) {
2871
+ imports.wbg.__wbg_sendinterfaceevent_b3ac2596012c70b8 = function(arg0, arg1, arg2, arg3, arg4) {
2872
2872
  let deferred0_0;
2873
2873
  let deferred0_1;
2874
2874
  let deferred1_0;
@@ -2884,7 +2884,7 @@ function __wbg_get_imports() {
2884
2884
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2885
2885
  }
2886
2886
  };
2887
- imports.wbg.__wbg_sendblocksuccess_63460f2639b4b899 = function(arg0, arg1, arg2) {
2887
+ imports.wbg.__wbg_sendblocksuccess_aa77d9dead690b65 = function(arg0, arg1, arg2) {
2888
2888
  let deferred0_0;
2889
2889
  let deferred0_1;
2890
2890
  try {
@@ -2895,10 +2895,10 @@ function __wbg_get_imports() {
2895
2895
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2896
2896
  }
2897
2897
  };
2898
- imports.wbg.__wbg_sendwalletupdate_3ef24be988fc4dd1 = function() {
2898
+ imports.wbg.__wbg_sendwalletupdate_35c6568561a24666 = function() {
2899
2899
  MsgHandler.send_wallet_update();
2900
2900
  };
2901
- imports.wbg.__wbg_sendnewversionalert_e45716b22ec97837 = function(arg0, arg1, arg2) {
2901
+ imports.wbg.__wbg_sendnewversionalert_0046b47daaccee8c = function(arg0, arg1, arg2) {
2902
2902
  let deferred0_0;
2903
2903
  let deferred0_1;
2904
2904
  try {
@@ -2909,13 +2909,13 @@ function __wbg_get_imports() {
2909
2909
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2910
2910
  }
2911
2911
  };
2912
- imports.wbg.__wbg_sendblockfetchstatusevent_cf674bcce95292a6 = function(arg0) {
2912
+ imports.wbg.__wbg_sendblockfetchstatusevent_ba790c923d8851df = function(arg0) {
2913
2913
  MsgHandler.send_block_fetch_status_event(BigInt.asUintN(64, arg0));
2914
2914
  };
2915
- imports.wbg.__wbg_sendnewchaindetectedevent_502482fa170b328f = function() {
2915
+ imports.wbg.__wbg_sendnewchaindetectedevent_ba661f60b624e9c7 = function() {
2916
2916
  MsgHandler.send_new_chain_detected_event();
2917
2917
  };
2918
- imports.wbg.__wbg_fetchblockfrompeer_5132eaf236da1718 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2918
+ imports.wbg.__wbg_fetchblockfrompeer_d143d80f117d06f4 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2919
2919
  let deferred0_0;
2920
2920
  let deferred0_1;
2921
2921
  try {
@@ -2927,7 +2927,7 @@ function __wbg_get_imports() {
2927
2927
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2928
2928
  }
2929
2929
  }, arguments) };
2930
- imports.wbg.__wbg_ensuredirectoryexists_491b0c004ede35e8 = function() { return handleError(function (arg0, arg1) {
2930
+ imports.wbg.__wbg_ensuredirectoryexists_617323f95264e9c1 = function() { return handleError(function (arg0, arg1) {
2931
2931
  let deferred0_0;
2932
2932
  let deferred0_1;
2933
2933
  try {
@@ -3246,8 +3246,8 @@ function __wbg_get_imports() {
3246
3246
  getInt32Memory0()[arg0 / 4 + 1] = len1;
3247
3247
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
3248
3248
  };
3249
- imports.wbg.__wbindgen_closure_wrapper1558 = function(arg0, arg1, arg2) {
3250
- const ret = makeMutClosure(arg0, arg1, 574, __wbg_adapter_38);
3249
+ imports.wbg.__wbindgen_closure_wrapper1554 = function(arg0, arg1, arg2) {
3250
+ const ret = makeMutClosure(arg0, arg1, 572, __wbg_adapter_38);
3251
3251
  return addHeapObject(ret);
3252
3252
  };
3253
3253