saito-wasm 0.2.162 → 0.2.163

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-e8d94f6fc48cc1ba/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,74 +240,48 @@ function addBorrowedObject(obj) {
240
240
  heap[--stack_pointer] = obj;
241
241
  return stack_pointer;
242
242
  }
243
- /**
244
- * @param {string} public_key
245
- * @returns {Promise<Array<any>>}
246
- */
247
- export function get_account_slips(public_key) {
248
- const ret = wasm.get_account_slips(addHeapObject(public_key));
249
- return takeObject(ret);
250
- }
251
-
252
243
  /**
253
244
  * @param {bigint} peer_index
254
- * @returns {Promise<WasmPeer | undefined>}
245
+ * @returns {Promise<void>}
255
246
  */
256
- export function get_peer(peer_index) {
257
- const ret = wasm.get_peer(peer_index);
247
+ export function remove_stun_peer(peer_index) {
248
+ const ret = wasm.remove_stun_peer(peer_index);
258
249
  return takeObject(ret);
259
250
  }
260
251
 
261
252
  /**
262
- * @returns {Promise<any>}
253
+ * @param {bigint} amt
254
+ * @param {string} slip1_utxo_key
255
+ * @param {string} slip2_utxo_key
256
+ * @param {string} slip3_utxo_key
257
+ * @param {string} recipient_public_key
258
+ * @param {Uint8Array} tx_msg
259
+ * @returns {Promise<WasmTransaction>}
263
260
  */
264
- export function get_confirmations() {
265
- const ret = wasm.get_confirmations();
261
+ export function create_send_bound_transaction(amt, slip1_utxo_key, slip2_utxo_key, slip3_utxo_key, recipient_public_key, tx_msg) {
262
+ 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));
266
263
  return takeObject(ret);
267
264
  }
268
265
 
269
266
  /**
270
- * @param {Uint8Array} buffer
271
- * @param {number} msg_index
272
267
  * @param {bigint} peer_index
268
+ * @param {string} ip
273
269
  * @returns {Promise<void>}
274
270
  */
275
- export function send_api_error(buffer, msg_index, peer_index) {
276
- const ret = wasm.send_api_error(addHeapObject(buffer), msg_index, peer_index);
277
- return takeObject(ret);
278
- }
279
-
280
- /**
281
- * @param {number} major
282
- * @param {number} minor
283
- * @param {number} patch
284
- * @returns {Promise<void>}
285
- */
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));
271
+ export function process_new_peer(peer_index, ip) {
272
+ const ret = wasm.process_new_peer(peer_index, addHeapObject(ip));
297
273
  return takeObject(ret);
298
274
  }
299
275
 
300
276
  /**
301
- * @param {bigint} num
302
- * @param {bigint} deposit
303
- * @param {Uint8Array} tx_msg
277
+ * @param {Array<any>} public_keys
278
+ * @param {BigUint64Array} amounts
304
279
  * @param {bigint} fee
305
- * @param {string} recipient_public_key
306
- * @param {string} nft_type
280
+ * @param {boolean} _force_merge
307
281
  * @returns {Promise<WasmTransaction>}
308
282
  */
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));
283
+ export function create_transaction_with_multiple_payments(public_keys, amounts, fee, _force_merge) {
284
+ const ret = wasm.create_transaction_with_multiple_payments(addHeapObject(public_keys), addHeapObject(amounts), fee, _force_merge);
311
285
  return takeObject(ret);
312
286
  }
313
287
 
@@ -325,71 +299,75 @@ export function initialize(config_json, private_key, log_level_num, hasten_multi
325
299
  }
326
300
 
327
301
  /**
328
- * @param {Uint8Array} buffer
329
- * @param {string} signature
330
- * @param {string} public_key
331
- * @returns {boolean}
302
+ * @returns {Promise<void>}
332
303
  */
333
- export function verify_signature(buffer, signature, public_key) {
334
- const ret = wasm.verify_signature(addHeapObject(buffer), addHeapObject(signature), addHeapObject(public_key));
335
- return ret !== 0;
304
+ export function start_from_received_ghost_chain() {
305
+ const ret = wasm.start_from_received_ghost_chain();
306
+ return takeObject(ret);
336
307
  }
337
308
 
338
309
  /**
339
- * @returns {Promise<string>}
310
+ * @param {Uint8Array} hash
311
+ * @param {bigint} block_id
312
+ * @param {bigint} peer_index
313
+ * @returns {Promise<void>}
340
314
  */
341
- export function get_stats() {
342
- const ret = wasm.get_stats();
315
+ export function process_failed_block_fetch(hash, block_id, peer_index) {
316
+ const ret = wasm.process_failed_block_fetch(addHeapObject(hash), block_id, peer_index);
343
317
  return takeObject(ret);
344
318
  }
345
319
 
346
320
  /**
347
- * @param {bigint} peer_index
348
321
  * @param {string} public_key
349
- * @returns {Promise<void>}
322
+ * @param {bigint} amount
323
+ * @param {bigint} fee
324
+ * @param {boolean} force_merge
325
+ * @returns {Promise<WasmTransaction>}
350
326
  */
351
- export function process_stun_peer(peer_index, public_key) {
352
- const ret = wasm.process_stun_peer(peer_index, addHeapObject(public_key));
327
+ export function create_transaction(public_key, amount, fee, force_merge) {
328
+ const ret = wasm.create_transaction(addHeapObject(public_key), amount, fee, force_merge);
353
329
  return takeObject(ret);
354
330
  }
355
331
 
356
332
  /**
357
- * @param {string} nft_id_hex
358
- * @param {Uint8Array} tx_msg
359
- * @returns {Promise<WasmTransaction>}
333
+ * @param {Uint8Array} buffer
334
+ * @param {number} msg_index
335
+ * @param {bigint} peer_index
336
+ * @returns {Promise<void>}
360
337
  */
361
- export function create_merge_bound_transaction(nft_id_hex, tx_msg) {
362
- const ptr0 = passStringToWasm0(nft_id_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
363
- const len0 = WASM_VECTOR_LEN;
364
- const ret = wasm.create_merge_bound_transaction(ptr0, len0, addHeapObject(tx_msg));
338
+ export function send_api_success(buffer, msg_index, peer_index) {
339
+ const ret = wasm.send_api_success(addHeapObject(buffer), msg_index, peer_index);
365
340
  return takeObject(ret);
366
341
  }
367
342
 
368
343
  /**
369
- * @param {WasmTransaction} tx
344
+ * @param {bigint} threshold
370
345
  * @returns {Promise<void>}
371
346
  */
372
- export function propagate_transaction(tx) {
373
- _assertClass(tx, WasmTransaction);
374
- const ret = wasm.propagate_transaction(tx.__wbg_ptr);
347
+ export function write_issuance_file(threshold) {
348
+ const ret = wasm.write_issuance_file(threshold);
375
349
  return takeObject(ret);
376
350
  }
377
351
 
378
352
  /**
379
353
  * @returns {Promise<Array<any>>}
380
354
  */
381
- export function get_nft_list() {
382
- const ret = wasm.get_nft_list();
355
+ export function get_peers() {
356
+ const ret = wasm.get_peers();
383
357
  return takeObject(ret);
384
358
  }
385
359
 
386
360
  /**
387
- * @param {bigint} peer_index
388
- * @param {string} ip
389
- * @returns {Promise<void>}
361
+ * @param {bigint} num
362
+ * @param {bigint} deposit
363
+ * @param {Uint8Array} tx_msg
364
+ * @param {bigint} fee
365
+ * @param {string} recipient_public_key
366
+ * @param {string} nft_type
367
+ * @returns {Promise<WasmTransaction>}
390
368
  */
391
- export function process_new_peer(peer_index, ip) {
392
- const ret = wasm.process_new_peer(peer_index, addHeapObject(ip));
369
+ export function create_bound_transaction(num, deposit, tx_msg, fee, recipient_public_key, nft_type) {
370
+ const ret = wasm.create_bound_transaction(num, deposit, addHeapObject(tx_msg), fee, addHeapObject(recipient_public_key), addHeapObject(nft_type));
393
371
  return takeObject(ret);
394
372
  }
395
373
 
@@ -408,34 +386,81 @@ export function update_from_balance_snapshot(snapshot) {
408
386
  * @param {bigint} peer_index
409
387
  * @returns {Promise<void>}
410
388
  */
411
- export function remove_stun_peer(peer_index) {
412
- const ret = wasm.remove_stun_peer(peer_index);
389
+ export function process_peer_disconnection(peer_index) {
390
+ const ret = wasm.process_peer_disconnection(peer_index);
413
391
  return takeObject(ret);
414
392
  }
415
393
 
416
394
  /**
417
- * @param {bigint} amt
418
- * @param {string} slip1_utxo_key
419
- * @param {string} slip2_utxo_key
420
- * @param {string} slip3_utxo_key
421
- * @param {string} recipient_public_key
395
+ * @returns {Promise<any>}
396
+ */
397
+ export function get_confirmations() {
398
+ const ret = wasm.get_confirmations();
399
+ return takeObject(ret);
400
+ }
401
+
402
+ /**
403
+ * @param {Uint8Array} buffer
404
+ * @returns {string}
405
+ */
406
+ export function hash(buffer) {
407
+ const ret = wasm.hash(addHeapObject(buffer));
408
+ return takeObject(ret);
409
+ }
410
+
411
+ /**
412
+ * @returns {Promise<bigint>}
413
+ */
414
+ export function get_next_peer_index() {
415
+ const ret = wasm.get_next_peer_index();
416
+ return takeObject(ret);
417
+ }
418
+
419
+ /**
420
+ * @returns {Promise<string>}
421
+ */
422
+ export function get_peer_stats() {
423
+ const ret = wasm.get_peer_stats();
424
+ return takeObject(ret);
425
+ }
426
+
427
+ /**
428
+ * @param {string} key
429
+ * @returns {boolean}
430
+ */
431
+ export function is_valid_public_key(key) {
432
+ const ret = wasm.is_valid_public_key(addHeapObject(key));
433
+ return ret !== 0;
434
+ }
435
+
436
+ /**
437
+ * @param {string} nft_id_hex
422
438
  * @param {Uint8Array} tx_msg
423
439
  * @returns {Promise<WasmTransaction>}
424
440
  */
425
- export function create_send_bound_transaction(amt, slip1_utxo_key, slip2_utxo_key, slip3_utxo_key, recipient_public_key, tx_msg) {
426
- 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));
441
+ export function create_merge_bound_transaction(nft_id_hex, tx_msg) {
442
+ const ptr0 = passStringToWasm0(nft_id_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
443
+ const len0 = WASM_VECTOR_LEN;
444
+ const ret = wasm.create_merge_bound_transaction(ptr0, len0, addHeapObject(tx_msg));
445
+ return takeObject(ret);
446
+ }
447
+
448
+ /**
449
+ * @returns {Promise<boolean>}
450
+ */
451
+ export function produce_block_with_gt() {
452
+ const ret = wasm.produce_block_with_gt();
427
453
  return takeObject(ret);
428
454
  }
429
455
 
430
456
  /**
431
- * @param {Uint8Array} buffer
432
457
  * @param {string} private_key
433
458
  * @returns {string}
434
459
  */
435
- export function sign_buffer(buffer, private_key) {
460
+ export function generate_public_key(private_key) {
436
461
  try {
437
462
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
438
- wasm.sign_buffer(retptr, addHeapObject(buffer), addHeapObject(private_key));
463
+ wasm.generate_public_key(retptr, addHeapObject(private_key));
439
464
  var r0 = getInt32Memory0()[retptr / 4 + 0];
440
465
  var r1 = getInt32Memory0()[retptr / 4 + 1];
441
466
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -449,22 +474,34 @@ export function sign_buffer(buffer, private_key) {
449
474
  }
450
475
 
451
476
  /**
452
- * @param {bigint} duration_in_ms
453
- * @returns {Promise<void>}
477
+ * @returns {Promise<WasmBlockchain>}
454
478
  */
455
- export function process_timer_event(duration_in_ms) {
456
- const ret = wasm.process_timer_event(duration_in_ms);
479
+ export function get_blockchain() {
480
+ const ret = wasm.get_blockchain();
457
481
  return takeObject(ret);
458
482
  }
459
483
 
460
484
  /**
461
- * @returns {Promise<string>}
485
+ * @param {bigint} peer_index
486
+ * @param {string} public_key
487
+ * @returns {Promise<void>}
462
488
  */
463
- export function get_peer_stats() {
464
- const ret = wasm.get_peer_stats();
489
+ export function process_stun_peer(peer_index, public_key) {
490
+ const ret = wasm.process_stun_peer(peer_index, addHeapObject(public_key));
465
491
  return takeObject(ret);
466
492
  }
467
493
 
494
+ /**
495
+ * @param {Uint8Array} buffer
496
+ * @param {string} signature
497
+ * @param {string} public_key
498
+ * @returns {boolean}
499
+ */
500
+ export function verify_signature(buffer, signature, public_key) {
501
+ const ret = wasm.verify_signature(addHeapObject(buffer), addHeapObject(signature), addHeapObject(public_key));
502
+ return ret !== 0;
503
+ }
504
+
468
505
  /**
469
506
  * @returns {Promise<string>}
470
507
  */
@@ -474,27 +511,48 @@ export function get_congestion_stats() {
474
511
  }
475
512
 
476
513
  /**
477
- * @param {bigint} threshold
514
+ * @returns {Promise<Array<any>>}
515
+ */
516
+ export function get_nft_list() {
517
+ const ret = wasm.get_nft_list();
518
+ return takeObject(ret);
519
+ }
520
+
521
+ /**
522
+ * @param {Uint8Array} buffer
523
+ * @param {number} msg_index
524
+ * @param {bigint} peer_index
525
+ * @returns {Promise<void>}
526
+ */
527
+ export function send_api_call(buffer, msg_index, peer_index) {
528
+ const ret = wasm.send_api_call(addHeapObject(buffer), msg_index, peer_index);
529
+ return takeObject(ret);
530
+ }
531
+
532
+ /**
533
+ * @param {WasmTransaction} tx
478
534
  * @returns {Promise<void>}
479
535
  */
480
- export function write_issuance_file(threshold) {
481
- const ret = wasm.write_issuance_file(threshold);
536
+ export function propagate_transaction(tx) {
537
+ _assertClass(tx, WasmTransaction);
538
+ const ret = wasm.propagate_transaction(tx.__wbg_ptr);
482
539
  return takeObject(ret);
483
540
  }
484
541
 
485
542
  /**
486
- * @returns {Promise<bigint>}
543
+ * @param {string} public_key
544
+ * @returns {Promise<Array<any>>}
487
545
  */
488
- export function get_next_peer_index() {
489
- const ret = wasm.get_next_peer_index();
546
+ export function get_account_slips(public_key) {
547
+ const ret = wasm.get_account_slips(addHeapObject(public_key));
490
548
  return takeObject(ret);
491
549
  }
492
550
 
493
551
  /**
494
- * @returns {Promise<string>}
552
+ * @returns {Promise<boolean>}
495
553
  */
496
- export function get_latest_block_hash() {
497
- const ret = wasm.get_latest_block_hash();
554
+ export function produce_block_without_gt() {
555
+ const ret = wasm.produce_block_without_gt();
498
556
  return takeObject(ret);
499
557
  }
500
558
 
@@ -504,16 +562,17 @@ export function get_latest_block_hash() {
504
562
  * @param {bigint} peer_index
505
563
  * @returns {Promise<void>}
506
564
  */
507
- export function send_api_success(buffer, msg_index, peer_index) {
508
- const ret = wasm.send_api_success(addHeapObject(buffer), msg_index, peer_index);
565
+ export function send_api_error(buffer, msg_index, peer_index) {
566
+ const ret = wasm.send_api_error(addHeapObject(buffer), msg_index, peer_index);
509
567
  return takeObject(ret);
510
568
  }
511
569
 
512
570
  /**
513
- * @returns {Promise<boolean>}
571
+ * @param {bigint} current_time
572
+ * @returns {Promise<void>}
514
573
  */
515
- export function produce_block_with_gt() {
516
- const ret = wasm.produce_block_with_gt();
574
+ export function process_stat_interval(current_time) {
575
+ const ret = wasm.process_stat_interval(current_time);
517
576
  return takeObject(ret);
518
577
  }
519
578
 
@@ -532,112 +591,69 @@ export function create_split_bound_transaction(slip1_utxo_key, slip2_utxo_key, s
532
591
  }
533
592
 
534
593
  /**
535
- * @param {bigint} peer_index
536
- * @returns {Promise<void>}
537
- */
538
- export function process_peer_disconnection(peer_index) {
539
- const ret = wasm.process_peer_disconnection(peer_index);
540
- return takeObject(ret);
541
- }
542
-
543
- /**
544
- * @param {string} public_key
545
- * @param {bigint} amount
546
- * @param {bigint} fee
547
- * @param {boolean} force_merge
548
- * @returns {Promise<WasmTransaction>}
549
- */
550
- export function create_transaction(public_key, amount, fee, force_merge) {
551
- const ret = wasm.create_transaction(addHeapObject(public_key), amount, fee, force_merge);
552
- return takeObject(ret);
553
- }
554
-
555
- /**
556
- * @returns {Promise<boolean>}
594
+ * @returns {Promise<string>}
557
595
  */
558
- export function produce_block_without_gt() {
559
- const ret = wasm.produce_block_without_gt();
596
+ export function get_latest_block_hash() {
597
+ const ret = wasm.get_latest_block_hash();
560
598
  return takeObject(ret);
561
599
  }
562
600
 
563
601
  /**
564
- * @param {string} private_key
565
- * @returns {string}
566
- */
567
- export function generate_public_key(private_key) {
568
- try {
569
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
570
- wasm.generate_public_key(retptr, addHeapObject(private_key));
571
- var r0 = getInt32Memory0()[retptr / 4 + 0];
572
- var r1 = getInt32Memory0()[retptr / 4 + 1];
573
- var r2 = getInt32Memory0()[retptr / 4 + 2];
574
- if (r2) {
575
- throw takeObject(r1);
576
- }
577
- return takeObject(r0);
578
- } finally {
579
- wasm.__wbindgen_add_to_stack_pointer(16);
580
- }
581
- }
582
-
583
- /**
584
- * @returns {Promise<WasmWallet>}
602
+ * @returns {Promise<string>}
585
603
  */
586
- export function get_wallet() {
587
- const ret = wasm.get_wallet();
604
+ export function get_stats() {
605
+ const ret = wasm.get_stats();
588
606
  return takeObject(ret);
589
607
  }
590
608
 
591
609
  /**
592
- * @returns {Promise<Array<any>>}
610
+ * @param {Array<any>} keys
611
+ * @returns {Promise<WasmBalanceSnapshot>}
593
612
  */
594
- export function get_mempool_txs() {
595
- const ret = wasm.get_mempool_txs();
613
+ export function get_balance_snapshot(keys) {
614
+ const ret = wasm.get_balance_snapshot(addHeapObject(keys));
596
615
  return takeObject(ret);
597
616
  }
598
617
 
599
618
  /**
600
619
  * @returns {Promise<void>}
601
620
  */
602
- export function start_from_received_ghost_chain() {
603
- const ret = wasm.start_from_received_ghost_chain();
621
+ export function disable_producing_blocks_by_timer() {
622
+ const ret = wasm.disable_producing_blocks_by_timer();
604
623
  return takeObject(ret);
605
624
  }
606
625
 
607
626
  /**
608
- * @param {bigint} current_time
609
- * @returns {Promise<void>}
627
+ * @returns {string}
610
628
  */
611
- export function process_stat_interval(current_time) {
612
- const ret = wasm.process_stat_interval(current_time);
629
+ export function generate_private_key() {
630
+ const ret = wasm.generate_private_key();
613
631
  return takeObject(ret);
614
632
  }
615
633
 
616
634
  /**
617
- * @returns {string}
635
+ * @param {string} block_hash
636
+ * @returns {Promise<WasmBlock>}
618
637
  */
619
- export function generate_private_key() {
620
- const ret = wasm.generate_private_key();
638
+ export function get_block(block_hash) {
639
+ const ret = wasm.get_block(addHeapObject(block_hash));
621
640
  return takeObject(ret);
622
641
  }
623
642
 
624
643
  /**
625
- * @param {Uint8Array} buffer
626
- * @param {Uint8Array} hash
627
- * @param {bigint} block_id
628
- * @param {bigint} peer_index
644
+ * @param {bigint} duration_in_ms
629
645
  * @returns {Promise<void>}
630
646
  */
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);
647
+ export function process_timer_event(duration_in_ms) {
648
+ const ret = wasm.process_timer_event(duration_in_ms);
633
649
  return takeObject(ret);
634
650
  }
635
651
 
636
652
  /**
637
- * @returns {Promise<Array<any>>}
653
+ * @returns {Promise<WasmWallet>}
638
654
  */
639
- export function get_peers() {
640
- const ret = wasm.get_peers();
655
+ export function get_wallet() {
656
+ const ret = wasm.get_wallet();
641
657
  return takeObject(ret);
642
658
  }
643
659
 
@@ -652,79 +668,63 @@ export function process_msg_buffer_from_peer(buffer, peer_index) {
652
668
  }
653
669
 
654
670
  /**
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
666
- * @param {bigint} fee
667
- * @param {boolean} _force_merge
668
- * @returns {Promise<WasmTransaction>}
669
- */
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);
672
- return takeObject(ret);
673
- }
674
-
675
- /**
676
- * @returns {Promise<WasmBlockchain>}
671
+ * @returns {Promise<Array<any>>}
677
672
  */
678
- export function get_blockchain() {
679
- const ret = wasm.get_blockchain();
673
+ export function get_mempool_txs() {
674
+ const ret = wasm.get_mempool_txs();
680
675
  return takeObject(ret);
681
676
  }
682
677
 
683
678
  /**
679
+ * @param {number} major
680
+ * @param {number} minor
681
+ * @param {number} patch
684
682
  * @returns {Promise<void>}
685
683
  */
686
- export function disable_producing_blocks_by_timer() {
687
- const ret = wasm.disable_producing_blocks_by_timer();
684
+ export function set_wallet_version(major, minor, patch) {
685
+ const ret = wasm.set_wallet_version(major, minor, patch);
688
686
  return takeObject(ret);
689
687
  }
690
688
 
691
689
  /**
692
690
  * @param {Uint8Array} buffer
691
+ * @param {string} private_key
693
692
  * @returns {string}
694
693
  */
695
- export function hash(buffer) {
696
- const ret = wasm.hash(addHeapObject(buffer));
697
- return takeObject(ret);
694
+ export function sign_buffer(buffer, private_key) {
695
+ try {
696
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
697
+ wasm.sign_buffer(retptr, addHeapObject(buffer), addHeapObject(private_key));
698
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
699
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
700
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
701
+ if (r2) {
702
+ throw takeObject(r1);
703
+ }
704
+ return takeObject(r0);
705
+ } finally {
706
+ wasm.__wbindgen_add_to_stack_pointer(16);
707
+ }
698
708
  }
699
709
 
700
710
  /**
701
- * @param {Uint8Array} hash
702
- * @param {bigint} block_id
703
711
  * @param {bigint} peer_index
704
- * @returns {Promise<void>}
712
+ * @returns {Promise<WasmPeer | undefined>}
705
713
  */
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);
714
+ export function get_peer(peer_index) {
715
+ const ret = wasm.get_peer(peer_index);
708
716
  return takeObject(ret);
709
717
  }
710
718
 
711
719
  /**
712
720
  * @param {Uint8Array} buffer
713
- * @param {number} msg_index
721
+ * @param {Uint8Array} hash
722
+ * @param {bigint} block_id
714
723
  * @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 process_fetched_block(buffer, hash, block_id, peer_index) {
727
+ const ret = wasm.process_fetched_block(addHeapObject(buffer), addHeapObject(hash), block_id, peer_index);
728
728
  return takeObject(ret);
729
729
  }
730
730
 
@@ -2660,62 +2660,62 @@ function __wbg_get_imports() {
2660
2660
  imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
2661
2661
  takeObject(arg0);
2662
2662
  };
2663
+ imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
2664
+ const ret = BigInt.asUintN(64, arg0);
2665
+ return addHeapObject(ret);
2666
+ };
2667
+ imports.wbg.__wbg_wasmwallet_new = function(arg0) {
2668
+ const ret = WasmWallet.__wrap(arg0);
2669
+ return addHeapObject(ret);
2670
+ };
2663
2671
  imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
2664
2672
  const ret = getStringFromWasm0(arg0, arg1);
2665
2673
  return addHeapObject(ret);
2666
2674
  };
2675
+ imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
2676
+ const obj = getObject(arg1);
2677
+ const ret = typeof(obj) === 'string' ? obj : undefined;
2678
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2679
+ var len1 = WASM_VECTOR_LEN;
2680
+ getInt32Memory0()[arg0 / 4 + 1] = len1;
2681
+ getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2682
+ };
2667
2683
  imports.wbg.__wbg_wasmtransaction_new = function(arg0) {
2668
2684
  const ret = WasmTransaction.__wrap(arg0);
2669
2685
  return addHeapObject(ret);
2670
2686
  };
2671
- imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
2672
- const ret = getObject(arg0);
2673
- return addHeapObject(ret);
2674
- };
2675
- imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
2676
- const ret = BigInt.asUintN(64, arg0);
2687
+ imports.wbg.__wbg_wasmslip_new = function(arg0) {
2688
+ const ret = WasmSlip.__wrap(arg0);
2677
2689
  return addHeapObject(ret);
2678
2690
  };
2679
- imports.wbg.__wbg_wasmpeer_new = function(arg0) {
2680
- const ret = WasmPeer.__wrap(arg0);
2691
+ imports.wbg.__wbg_wasmwalletslip_new = function(arg0) {
2692
+ const ret = WasmWalletSlip.__wrap(arg0);
2681
2693
  return addHeapObject(ret);
2682
2694
  };
2683
2695
  imports.wbg.__wbg_wasmnft_new = function(arg0) {
2684
2696
  const ret = WasmNFT.__wrap(arg0);
2685
2697
  return addHeapObject(ret);
2686
2698
  };
2687
- imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
2688
- const obj = getObject(arg1);
2689
- const ret = typeof(obj) === 'string' ? obj : undefined;
2690
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2691
- var len1 = WASM_VECTOR_LEN;
2692
- getInt32Memory0()[arg0 / 4 + 1] = len1;
2693
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2699
+ imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
2700
+ const ret = getObject(arg0);
2701
+ return addHeapObject(ret);
2694
2702
  };
2695
2703
  imports.wbg.__wbg_wasmblock_new = function(arg0) {
2696
2704
  const ret = WasmBlock.__wrap(arg0);
2697
2705
  return addHeapObject(ret);
2698
2706
  };
2699
- imports.wbg.__wbg_wasmbalancesnapshot_new = function(arg0) {
2700
- const ret = WasmBalanceSnapshot.__wrap(arg0);
2707
+ imports.wbg.__wbg_wasmpeer_new = function(arg0) {
2708
+ const ret = WasmPeer.__wrap(arg0);
2701
2709
  return addHeapObject(ret);
2702
2710
  };
2703
- imports.wbg.__wbg_wasmslip_new = function(arg0) {
2704
- const ret = WasmSlip.__wrap(arg0);
2711
+ imports.wbg.__wbg_wasmbalancesnapshot_new = function(arg0) {
2712
+ const ret = WasmBalanceSnapshot.__wrap(arg0);
2705
2713
  return addHeapObject(ret);
2706
2714
  };
2707
2715
  imports.wbg.__wbg_wasmblockchain_new = function(arg0) {
2708
2716
  const ret = WasmBlockchain.__wrap(arg0);
2709
2717
  return addHeapObject(ret);
2710
2718
  };
2711
- imports.wbg.__wbg_wasmwalletslip_new = function(arg0) {
2712
- const ret = WasmWalletSlip.__wrap(arg0);
2713
- return addHeapObject(ret);
2714
- };
2715
- imports.wbg.__wbg_wasmwallet_new = function(arg0) {
2716
- const ret = WasmWallet.__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_43f1541fff3d78bd = 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_0a9c92750448f1d1 = 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_5cd451ac436ab682 = function() {
2768
2768
  MsgHandler.load_wallet();
2769
2769
  };
2770
- imports.wbg.__wbg_savewallet_c68b1642af9c594d = function() {
2770
+ imports.wbg.__wbg_savewallet_6826e875e5dd251b = function() {
2771
2771
  MsgHandler.save_wallet();
2772
2772
  };
2773
- imports.wbg.__wbg_writevalue_9096a95d5621ed81 = function(arg0, arg1, arg2) {
2773
+ imports.wbg.__wbg_writevalue_cf07df01ae9d9d9b = 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_3d3f4ddc7cd7f668 = 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_f5900816b911805e = 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_6d75e3e0b6cbcdea = 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_0dbfd6477b38b460 = 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_671fa3941c07e37c = 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_9c5802df7eec1b8c = 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_84802524f4b72626 = 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_d543c65b7ba51917 = 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_346f01f1e249ab95 = 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_8b367c13a928c498 = 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_eb1d4acfd8e133d3 = 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_e8a6bbf7850e77ec = 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_478dfe7c1d77edc1 = 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_50f30a221c95ccb2 = 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_f56f83f3e07b49a9 = function() {
2888
2888
  MsgHandler.send_wallet_update();
2889
2889
  };
2890
- imports.wbg.__wbg_sendnewversionalert_0668d8f5d25f4178 = function(arg0, arg1, arg2) {
2890
+ imports.wbg.__wbg_sendnewversionalert_cf706b447638507f = 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_34b0e8fb201fbfc5 = 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_3ebfc9ce48ce2f00 = 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_42bdb36ab5eb6374 = 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_2eeab9246fcb6206 = function() { return handleError(function (arg0, arg1) {
2920
2920
  let deferred0_0;
2921
2921
  let deferred0_1;
2922
2922
  try {