saito-wasm 0.2.166 → 0.2.167

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,27 +1,7 @@
1
- import { MsgHandler } from './snippets/saito-wasm-083e81febfc0ef0c/js/msg_handler.js';
1
+ import { MsgHandler } from './snippets/saito-wasm-25d13ca010c26982/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
-
25
5
  const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
26
6
 
27
7
  if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
@@ -40,6 +20,12 @@ function getStringFromWasm0(ptr, len) {
40
20
  return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
41
21
  }
42
22
 
23
+ const heap = new Array(128).fill(undefined);
24
+
25
+ heap.push(undefined, null, true, false);
26
+
27
+ let heap_next = heap.length;
28
+
43
29
  function addHeapObject(obj) {
44
30
  if (heap_next === heap.length) heap.push(heap.length + 1);
45
31
  const idx = heap_next;
@@ -49,6 +35,20 @@ function addHeapObject(obj) {
49
35
  return idx;
50
36
  }
51
37
 
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') } } );
@@ -249,232 +249,222 @@ function handleError(f, args) {
249
249
  }
250
250
  }
251
251
  /**
252
- * @returns {Promise<string>}
252
+ * @returns {Promise<boolean>}
253
253
  */
254
- export function get_congestion_stats() {
255
- const ret = wasm.get_congestion_stats();
254
+ export function produce_block_with_gt() {
255
+ const ret = wasm.produce_block_with_gt();
256
256
  return takeObject(ret);
257
257
  }
258
258
 
259
259
  /**
260
- * @param {WasmBalanceSnapshot} snapshot
260
+ * @param {bigint} duration_in_ms
261
261
  * @returns {Promise<void>}
262
262
  */
263
- export function update_from_balance_snapshot(snapshot) {
264
- _assertClass(snapshot, WasmBalanceSnapshot);
265
- var ptr0 = snapshot.__destroy_into_raw();
266
- const ret = wasm.update_from_balance_snapshot(ptr0);
263
+ export function process_timer_event(duration_in_ms) {
264
+ const ret = wasm.process_timer_event(duration_in_ms);
267
265
  return takeObject(ret);
268
266
  }
269
267
 
270
268
  /**
271
- * @returns {Promise<void>}
269
+ * @param {Array<any>} public_keys
270
+ * @param {BigUint64Array} amounts
271
+ * @param {bigint} fee
272
+ * @param {boolean} _force_merge
273
+ * @returns {Promise<WasmTransaction>}
272
274
  */
273
- export function disable_producing_blocks_by_timer() {
274
- const ret = wasm.disable_producing_blocks_by_timer();
275
+ export function create_transaction_with_multiple_payments(public_keys, amounts, fee, _force_merge) {
276
+ const ret = wasm.create_transaction_with_multiple_payments(addHeapObject(public_keys), addHeapObject(amounts), fee, _force_merge);
275
277
  return takeObject(ret);
276
278
  }
277
279
 
278
280
  /**
279
- * @returns {Promise<string>}
281
+ * @returns {Promise<boolean>}
280
282
  */
281
- export function get_stats() {
282
- const ret = wasm.get_stats();
283
+ export function produce_block_without_gt() {
284
+ const ret = wasm.produce_block_without_gt();
283
285
  return takeObject(ret);
284
286
  }
285
287
 
286
288
  /**
287
- * @param {string} public_key
288
- * @returns {Promise<Array<any>>}
289
+ * @param {Uint8Array} buffer
290
+ * @param {number} msg_index
291
+ * @param {bigint} peer_index
292
+ * @returns {Promise<void>}
289
293
  */
290
- export function get_account_slips(public_key) {
291
- const ret = wasm.get_account_slips(addHeapObject(public_key));
294
+ export function send_api_success(buffer, msg_index, peer_index) {
295
+ const ret = wasm.send_api_success(addHeapObject(buffer), msg_index, peer_index);
292
296
  return takeObject(ret);
293
297
  }
294
298
 
295
299
  /**
296
- * @param {bigint} num
297
- * @param {bigint} deposit
298
- * @param {Uint8Array} tx_msg
299
- * @param {bigint} fee
300
- * @param {string} recipient_public_key
301
- * @param {string} nft_type
302
- * @returns {Promise<WasmTransaction>}
300
+ * @param {number} major
301
+ * @param {number} minor
302
+ * @param {number} patch
303
+ * @returns {Promise<void>}
303
304
  */
304
- export function create_bound_transaction(num, deposit, tx_msg, fee, recipient_public_key, nft_type) {
305
- const ret = wasm.create_bound_transaction(num, deposit, addHeapObject(tx_msg), fee, addHeapObject(recipient_public_key), addHeapObject(nft_type));
305
+ export function set_wallet_version(major, minor, patch) {
306
+ const ret = wasm.set_wallet_version(major, minor, patch);
306
307
  return takeObject(ret);
307
308
  }
308
309
 
309
310
  /**
311
+ * @param {Uint8Array} hash
312
+ * @param {bigint} block_id
310
313
  * @param {bigint} peer_index
311
314
  * @returns {Promise<void>}
312
315
  */
313
- export function remove_stun_peer(peer_index) {
314
- const ret = wasm.remove_stun_peer(peer_index);
316
+ export function process_failed_block_fetch(hash, block_id, peer_index) {
317
+ const ret = wasm.process_failed_block_fetch(addHeapObject(hash), block_id, peer_index);
315
318
  return takeObject(ret);
316
319
  }
317
320
 
318
321
  /**
319
- * @returns {Promise<any>}
322
+ * @param {string} block_hash
323
+ * @returns {Promise<WasmBlock>}
320
324
  */
321
- export function get_confirmations() {
322
- const ret = wasm.get_confirmations();
325
+ export function get_block(block_hash) {
326
+ const ret = wasm.get_block(addHeapObject(block_hash));
323
327
  return takeObject(ret);
324
328
  }
325
329
 
326
330
  /**
327
- * @param {bigint} current_time
328
- * @returns {Promise<void>}
331
+ * @param {string} private_key
332
+ * @returns {string}
329
333
  */
330
- export function process_stat_interval(current_time) {
331
- const ret = wasm.process_stat_interval(current_time);
332
- return takeObject(ret);
334
+ export function generate_public_key(private_key) {
335
+ try {
336
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
337
+ wasm.generate_public_key(retptr, addHeapObject(private_key));
338
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
339
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
340
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
341
+ if (r2) {
342
+ throw takeObject(r1);
343
+ }
344
+ return takeObject(r0);
345
+ } finally {
346
+ wasm.__wbindgen_add_to_stack_pointer(16);
347
+ }
333
348
  }
334
349
 
335
350
  /**
336
- * @param {string} key
337
- * @returns {boolean}
351
+ * @returns {Promise<Array<any>>}
338
352
  */
339
- export function is_valid_public_key(key) {
340
- const ret = wasm.is_valid_public_key(addHeapObject(key));
341
- return ret !== 0;
353
+ export function get_nft_list() {
354
+ const ret = wasm.get_nft_list();
355
+ return takeObject(ret);
342
356
  }
343
357
 
344
358
  /**
345
- * @param {string} config_json
346
- * @param {string} private_key
347
- * @param {number} log_level_num
348
- * @param {bigint} hasten_multiplier
349
- * @param {boolean} delete_old_blocks
350
- * @returns {Promise<any>}
359
+ * @param {Uint8Array} buffer
360
+ * @param {string} signature
361
+ * @param {string} public_key
362
+ * @returns {boolean}
351
363
  */
352
- export function initialize(config_json, private_key, log_level_num, hasten_multiplier, delete_old_blocks) {
353
- const ret = wasm.initialize(addHeapObject(config_json), addHeapObject(private_key), log_level_num, hasten_multiplier, delete_old_blocks);
354
- return takeObject(ret);
364
+ export function verify_signature(buffer, signature, public_key) {
365
+ const ret = wasm.verify_signature(addHeapObject(buffer), addHeapObject(signature), addHeapObject(public_key));
366
+ return ret !== 0;
355
367
  }
356
368
 
357
369
  /**
358
- * @param {bigint} amt
359
- * @param {string} slip1_utxo_key
360
- * @param {string} slip2_utxo_key
361
- * @param {string} slip3_utxo_key
362
- * @param {string} recipient_public_key
363
- * @param {Uint8Array} tx_msg
364
- * @returns {Promise<WasmTransaction>}
370
+ * @returns {Promise<string>}
365
371
  */
366
- export function create_send_bound_transaction(amt, slip1_utxo_key, slip2_utxo_key, slip3_utxo_key, recipient_public_key, tx_msg) {
367
- 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));
372
+ export function get_stats() {
373
+ const ret = wasm.get_stats();
368
374
  return takeObject(ret);
369
375
  }
370
376
 
371
377
  /**
372
- * @param {string} slip1_utxo_key
373
- * @param {string} slip2_utxo_key
374
- * @param {string} slip3_utxo_key
375
- * @returns {Promise<WasmTransaction>}
378
+ * @returns {Promise<any>}
376
379
  */
377
- export function create_remove_bound_transaction(slip1_utxo_key, slip2_utxo_key, slip3_utxo_key) {
378
- const ret = wasm.create_remove_bound_transaction(addHeapObject(slip1_utxo_key), addHeapObject(slip2_utxo_key), addHeapObject(slip3_utxo_key));
380
+ export function get_confirmations() {
381
+ const ret = wasm.get_confirmations();
379
382
  return takeObject(ret);
380
383
  }
381
384
 
382
385
  /**
383
- * @returns {Promise<WasmBlockchain>}
386
+ * @returns {Promise<string>}
384
387
  */
385
- export function get_blockchain() {
386
- const ret = wasm.get_blockchain();
388
+ export function get_latest_block_hash() {
389
+ const ret = wasm.get_latest_block_hash();
387
390
  return takeObject(ret);
388
391
  }
389
392
 
390
393
  /**
391
- * @returns {Promise<Array<any>>}
394
+ * @param {Uint8Array} buffer
395
+ * @returns {string}
392
396
  */
393
- export function get_mempool_txs() {
394
- const ret = wasm.get_mempool_txs();
397
+ export function hash(buffer) {
398
+ const ret = wasm.hash(addHeapObject(buffer));
395
399
  return takeObject(ret);
396
400
  }
397
401
 
398
402
  /**
399
- * @param {string} nft_id_hex
400
- * @param {Uint8Array} tx_msg
401
- * @returns {Promise<WasmTransaction>}
403
+ * @returns {Promise<string>}
402
404
  */
403
- export function create_merge_bound_transaction(nft_id_hex, tx_msg) {
404
- const ptr0 = passStringToWasm0(nft_id_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
405
- const len0 = WASM_VECTOR_LEN;
406
- const ret = wasm.create_merge_bound_transaction(ptr0, len0, addHeapObject(tx_msg));
405
+ export function get_peer_stats() {
406
+ const ret = wasm.get_peer_stats();
407
407
  return takeObject(ret);
408
408
  }
409
409
 
410
410
  /**
411
- * @returns {Promise<Array<any>>}
411
+ * @param {bigint} peer_index
412
+ * @param {string} public_key
413
+ * @returns {Promise<void>}
412
414
  */
413
- export function get_nft_list() {
414
- const ret = wasm.get_nft_list();
415
+ export function process_stun_peer(peer_index, public_key) {
416
+ const ret = wasm.process_stun_peer(peer_index, addHeapObject(public_key));
415
417
  return takeObject(ret);
416
418
  }
417
419
 
418
420
  /**
419
- * @returns {Promise<string>}
421
+ * @returns {Promise<WasmWallet>}
420
422
  */
421
- export function get_latest_block_hash() {
422
- const ret = wasm.get_latest_block_hash();
423
+ export function get_wallet() {
424
+ const ret = wasm.get_wallet();
423
425
  return takeObject(ret);
424
426
  }
425
427
 
426
428
  /**
427
429
  * @param {Uint8Array} buffer
428
- * @param {string} private_key
429
- * @returns {string}
430
+ * @param {bigint} peer_index
431
+ * @returns {Promise<void>}
430
432
  */
431
- export function sign_buffer(buffer, private_key) {
432
- try {
433
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
434
- wasm.sign_buffer(retptr, addHeapObject(buffer), addHeapObject(private_key));
435
- var r0 = getInt32Memory0()[retptr / 4 + 0];
436
- var r1 = getInt32Memory0()[retptr / 4 + 1];
437
- var r2 = getInt32Memory0()[retptr / 4 + 2];
438
- if (r2) {
439
- throw takeObject(r1);
440
- }
441
- return takeObject(r0);
442
- } finally {
443
- wasm.__wbindgen_add_to_stack_pointer(16);
444
- }
433
+ export function process_msg_buffer_from_peer(buffer, peer_index) {
434
+ const ret = wasm.process_msg_buffer_from_peer(addHeapObject(buffer), peer_index);
435
+ return takeObject(ret);
445
436
  }
446
437
 
447
438
  /**
448
- * @param {bigint} peer_index
449
- * @returns {Promise<WasmPeer | undefined>}
439
+ * @returns {Promise<bigint>}
450
440
  */
451
- export function get_peer(peer_index) {
452
- const ret = wasm.get_peer(peer_index);
441
+ export function get_next_peer_index() {
442
+ const ret = wasm.get_next_peer_index();
453
443
  return takeObject(ret);
454
444
  }
455
445
 
456
446
  /**
457
- * @returns {Promise<void>}
447
+ * @returns {Promise<Array<any>>}
458
448
  */
459
- export function start_from_received_ghost_chain() {
460
- const ret = wasm.start_from_received_ghost_chain();
449
+ export function get_peers() {
450
+ const ret = wasm.get_peers();
461
451
  return takeObject(ret);
462
452
  }
463
453
 
464
454
  /**
465
- * @returns {string}
455
+ * @returns {Promise<WasmBlockchain>}
466
456
  */
467
- export function generate_private_key() {
468
- const ret = wasm.generate_private_key();
457
+ export function get_blockchain() {
458
+ const ret = wasm.get_blockchain();
469
459
  return takeObject(ret);
470
460
  }
471
461
 
472
462
  /**
473
- * @param {string} block_hash
474
- * @returns {Promise<WasmBlock>}
463
+ * @param {bigint} threshold
464
+ * @returns {Promise<void>}
475
465
  */
476
- export function get_block(block_hash) {
477
- const ret = wasm.get_block(addHeapObject(block_hash));
466
+ export function write_issuance_file(threshold) {
467
+ const ret = wasm.write_issuance_file(threshold);
478
468
  return takeObject(ret);
479
469
  }
480
470
 
@@ -490,91 +480,81 @@ export function send_api_error(buffer, msg_index, peer_index) {
490
480
  }
491
481
 
492
482
  /**
493
- * @param {Array<any>} public_keys
494
- * @param {BigUint64Array} amounts
495
- * @param {bigint} fee
496
- * @param {boolean} _force_merge
483
+ * @param {string} nft_id_hex
484
+ * @param {Uint8Array} tx_msg
497
485
  * @returns {Promise<WasmTransaction>}
498
486
  */
499
- export function create_transaction_with_multiple_payments(public_keys, amounts, fee, _force_merge) {
500
- const ret = wasm.create_transaction_with_multiple_payments(addHeapObject(public_keys), addHeapObject(amounts), fee, _force_merge);
501
- return takeObject(ret);
502
- }
503
-
504
- /**
505
- * @param {Uint8Array} buffer
506
- * @returns {string}
507
- */
508
- export function hash(buffer) {
509
- const ret = wasm.hash(addHeapObject(buffer));
487
+ export function create_merge_bound_transaction(nft_id_hex, tx_msg) {
488
+ const ptr0 = passStringToWasm0(nft_id_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
489
+ const len0 = WASM_VECTOR_LEN;
490
+ const ret = wasm.create_merge_bound_transaction(ptr0, len0, addHeapObject(tx_msg));
510
491
  return takeObject(ret);
511
492
  }
512
493
 
513
494
  /**
514
- * @returns {Promise<boolean>}
495
+ * @returns {string}
515
496
  */
516
- export function produce_block_with_gt() {
517
- const ret = wasm.produce_block_with_gt();
497
+ export function generate_private_key() {
498
+ const ret = wasm.generate_private_key();
518
499
  return takeObject(ret);
519
500
  }
520
501
 
521
502
  /**
522
- * @param {Uint8Array} hash
523
- * @param {bigint} block_id
524
503
  * @param {bigint} peer_index
525
504
  * @returns {Promise<void>}
526
505
  */
527
- export function process_failed_block_fetch(hash, block_id, peer_index) {
528
- const ret = wasm.process_failed_block_fetch(addHeapObject(hash), block_id, peer_index);
506
+ export function remove_stun_peer(peer_index) {
507
+ const ret = wasm.remove_stun_peer(peer_index);
529
508
  return takeObject(ret);
530
509
  }
531
510
 
532
511
  /**
533
- * @param {Uint8Array} buffer
534
- * @param {Uint8Array} hash
535
- * @param {bigint} block_id
536
- * @param {bigint} peer_index
512
+ * @param {WasmBalanceSnapshot} snapshot
537
513
  * @returns {Promise<void>}
538
514
  */
539
- export function process_fetched_block(buffer, hash, block_id, peer_index) {
540
- const ret = wasm.process_fetched_block(addHeapObject(buffer), addHeapObject(hash), block_id, peer_index);
515
+ export function update_from_balance_snapshot(snapshot) {
516
+ _assertClass(snapshot, WasmBalanceSnapshot);
517
+ var ptr0 = snapshot.__destroy_into_raw();
518
+ const ret = wasm.update_from_balance_snapshot(ptr0);
541
519
  return takeObject(ret);
542
520
  }
543
521
 
544
522
  /**
545
- * @param {number} major
546
- * @param {number} minor
547
- * @param {number} patch
548
- * @returns {Promise<void>}
523
+ * @returns {Promise<string>}
549
524
  */
550
- export function set_wallet_version(major, minor, patch) {
551
- const ret = wasm.set_wallet_version(major, minor, patch);
525
+ export function get_congestion_stats() {
526
+ const ret = wasm.get_congestion_stats();
552
527
  return takeObject(ret);
553
528
  }
554
529
 
555
530
  /**
556
- * @returns {Promise<boolean>}
531
+ * @param {Uint8Array} buffer
532
+ * @param {Uint8Array} hash
533
+ * @param {bigint} block_id
534
+ * @param {bigint} peer_index
535
+ * @returns {Promise<void>}
557
536
  */
558
- export function produce_block_without_gt() {
559
- const ret = wasm.produce_block_without_gt();
537
+ export function process_fetched_block(buffer, hash, block_id, peer_index) {
538
+ const ret = wasm.process_fetched_block(addHeapObject(buffer), addHeapObject(hash), block_id, peer_index);
560
539
  return takeObject(ret);
561
540
  }
562
541
 
563
542
  /**
564
- * @param {bigint} threshold
565
- * @returns {Promise<void>}
543
+ * @param {string} slip1_utxo_key
544
+ * @param {string} slip2_utxo_key
545
+ * @param {string} slip3_utxo_key
546
+ * @returns {Promise<WasmTransaction>}
566
547
  */
567
- export function write_issuance_file(threshold) {
568
- const ret = wasm.write_issuance_file(threshold);
548
+ export function create_remove_bound_transaction(slip1_utxo_key, slip2_utxo_key, slip3_utxo_key) {
549
+ const ret = wasm.create_remove_bound_transaction(addHeapObject(slip1_utxo_key), addHeapObject(slip2_utxo_key), addHeapObject(slip3_utxo_key));
569
550
  return takeObject(ret);
570
551
  }
571
552
 
572
553
  /**
573
- * @param {bigint} peer_index
574
554
  * @returns {Promise<void>}
575
555
  */
576
- export function process_peer_disconnection(peer_index) {
577
- const ret = wasm.process_peer_disconnection(peer_index);
556
+ export function disable_producing_blocks_by_timer() {
557
+ const ret = wasm.disable_producing_blocks_by_timer();
578
558
  return takeObject(ret);
579
559
  }
580
560
 
@@ -591,58 +571,86 @@ export function create_transaction(public_key, amount, fee, force_merge) {
591
571
  }
592
572
 
593
573
  /**
594
- * @param {Array<any>} keys
595
- * @returns {Promise<WasmBalanceSnapshot>}
574
+ * @returns {Promise<Array<any>>}
596
575
  */
597
- export function get_balance_snapshot(keys) {
598
- const ret = wasm.get_balance_snapshot(addHeapObject(keys));
576
+ export function get_mempool_txs() {
577
+ const ret = wasm.get_mempool_txs();
599
578
  return takeObject(ret);
600
579
  }
601
580
 
602
581
  /**
603
- * @param {Uint8Array} buffer
604
- * @param {bigint} peer_index
605
582
  * @returns {Promise<void>}
606
583
  */
607
- export function process_msg_buffer_from_peer(buffer, peer_index) {
608
- const ret = wasm.process_msg_buffer_from_peer(addHeapObject(buffer), peer_index);
584
+ export function start_from_received_ghost_chain() {
585
+ const ret = wasm.start_from_received_ghost_chain();
609
586
  return takeObject(ret);
610
587
  }
611
588
 
612
589
  /**
613
590
  * @param {bigint} peer_index
614
- * @param {string} public_key
615
- * @returns {Promise<void>}
591
+ * @returns {Promise<WasmPeer | undefined>}
616
592
  */
617
- export function process_stun_peer(peer_index, public_key) {
618
- const ret = wasm.process_stun_peer(peer_index, addHeapObject(public_key));
593
+ export function get_peer(peer_index) {
594
+ const ret = wasm.get_peer(peer_index);
619
595
  return takeObject(ret);
620
596
  }
621
597
 
622
598
  /**
623
- * @param {Uint8Array} buffer
624
- * @param {number} msg_index
625
- * @param {bigint} peer_index
626
- * @returns {Promise<void>}
599
+ * @param {bigint} amt
600
+ * @param {string} slip1_utxo_key
601
+ * @param {string} slip2_utxo_key
602
+ * @param {string} slip3_utxo_key
603
+ * @param {string} recipient_public_key
604
+ * @param {Uint8Array} tx_msg
605
+ * @returns {Promise<WasmTransaction>}
627
606
  */
628
- export function send_api_success(buffer, msg_index, peer_index) {
629
- const ret = wasm.send_api_success(addHeapObject(buffer), msg_index, peer_index);
607
+ export function create_send_bound_transaction(amt, slip1_utxo_key, slip2_utxo_key, slip3_utxo_key, recipient_public_key, tx_msg) {
608
+ 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
609
  return takeObject(ret);
631
610
  }
632
611
 
633
612
  /**
634
- * @returns {Promise<WasmWallet>}
613
+ * @param {string} key
614
+ * @returns {boolean}
635
615
  */
636
- export function get_wallet() {
637
- const ret = wasm.get_wallet();
616
+ export function is_valid_public_key(key) {
617
+ const ret = wasm.is_valid_public_key(addHeapObject(key));
618
+ return ret !== 0;
619
+ }
620
+
621
+ /**
622
+ * @param {Array<any>} keys
623
+ * @returns {Promise<WasmBalanceSnapshot>}
624
+ */
625
+ export function get_balance_snapshot(keys) {
626
+ const ret = wasm.get_balance_snapshot(addHeapObject(keys));
638
627
  return takeObject(ret);
639
628
  }
640
629
 
641
630
  /**
642
- * @returns {Promise<Array<any>>}
631
+ * @param {string} config_json
632
+ * @param {string} private_key
633
+ * @param {number} log_level_num
634
+ * @param {bigint} hasten_multiplier
635
+ * @param {boolean} delete_old_blocks
636
+ * @returns {Promise<any>}
643
637
  */
644
- export function get_peers() {
645
- const ret = wasm.get_peers();
638
+ export function initialize(config_json, private_key, log_level_num, hasten_multiplier, delete_old_blocks) {
639
+ const ret = wasm.initialize(addHeapObject(config_json), addHeapObject(private_key), log_level_num, hasten_multiplier, delete_old_blocks);
640
+ return takeObject(ret);
641
+ }
642
+
643
+ /**
644
+ * @param {string} slip1_utxo_key
645
+ * @param {string} slip2_utxo_key
646
+ * @param {string} slip3_utxo_key
647
+ * @param {number} left_count
648
+ * @param {number} right_count
649
+ * @param {Uint8Array} tx_msg
650
+ * @returns {Promise<WasmTransaction>}
651
+ */
652
+ export function create_split_bound_transaction(slip1_utxo_key, slip2_utxo_key, slip3_utxo_key, left_count, right_count, tx_msg) {
653
+ 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));
646
654
  return takeObject(ret);
647
655
  }
648
656
 
@@ -658,12 +666,11 @@ export function send_api_call(buffer, msg_index, peer_index) {
658
666
  }
659
667
 
660
668
  /**
661
- * @param {bigint} peer_index
662
- * @param {string} ip
663
- * @returns {Promise<void>}
669
+ * @param {string} public_key
670
+ * @returns {Promise<Array<any>>}
664
671
  */
665
- export function process_new_peer(peer_index, ip) {
666
- const ret = wasm.process_new_peer(peer_index, addHeapObject(ip));
672
+ export function get_account_slips(public_key) {
673
+ const ret = wasm.get_account_slips(addHeapObject(public_key));
667
674
  return takeObject(ret);
668
675
  }
669
676
 
@@ -678,40 +685,56 @@ export function propagate_transaction(tx) {
678
685
  }
679
686
 
680
687
  /**
681
- * @returns {Promise<string>}
688
+ * @param {bigint} peer_index
689
+ * @param {string} ip
690
+ * @returns {Promise<void>}
682
691
  */
683
- export function get_peer_stats() {
684
- const ret = wasm.get_peer_stats();
692
+ export function process_new_peer(peer_index, ip) {
693
+ const ret = wasm.process_new_peer(peer_index, addHeapObject(ip));
685
694
  return takeObject(ret);
686
695
  }
687
696
 
688
697
  /**
689
- * @param {Uint8Array} buffer
690
- * @param {string} signature
691
- * @param {string} public_key
692
- * @returns {boolean}
698
+ * @param {bigint} current_time
699
+ * @returns {Promise<void>}
693
700
  */
694
- export function verify_signature(buffer, signature, public_key) {
695
- const ret = wasm.verify_signature(addHeapObject(buffer), addHeapObject(signature), addHeapObject(public_key));
696
- return ret !== 0;
701
+ export function process_stat_interval(current_time) {
702
+ const ret = wasm.process_stat_interval(current_time);
703
+ return takeObject(ret);
697
704
  }
698
705
 
699
706
  /**
700
- * @returns {Promise<bigint>}
707
+ * @param {bigint} peer_index
708
+ * @returns {Promise<void>}
701
709
  */
702
- export function get_next_peer_index() {
703
- const ret = wasm.get_next_peer_index();
710
+ export function process_peer_disconnection(peer_index) {
711
+ const ret = wasm.process_peer_disconnection(peer_index);
712
+ return takeObject(ret);
713
+ }
714
+
715
+ /**
716
+ * @param {bigint} num
717
+ * @param {bigint} deposit
718
+ * @param {Uint8Array} tx_msg
719
+ * @param {bigint} fee
720
+ * @param {string} recipient_public_key
721
+ * @param {string} nft_type
722
+ * @returns {Promise<WasmTransaction>}
723
+ */
724
+ export function create_bound_transaction(num, deposit, tx_msg, fee, recipient_public_key, nft_type) {
725
+ const ret = wasm.create_bound_transaction(num, deposit, addHeapObject(tx_msg), fee, addHeapObject(recipient_public_key), addHeapObject(nft_type));
704
726
  return takeObject(ret);
705
727
  }
706
728
 
707
729
  /**
730
+ * @param {Uint8Array} buffer
708
731
  * @param {string} private_key
709
732
  * @returns {string}
710
733
  */
711
- export function generate_public_key(private_key) {
734
+ export function sign_buffer(buffer, private_key) {
712
735
  try {
713
736
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
714
- wasm.generate_public_key(retptr, addHeapObject(private_key));
737
+ wasm.sign_buffer(retptr, addHeapObject(buffer), addHeapObject(private_key));
715
738
  var r0 = getInt32Memory0()[retptr / 4 + 0];
716
739
  var r1 = getInt32Memory0()[retptr / 4 + 1];
717
740
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -724,29 +747,6 @@ export function generate_public_key(private_key) {
724
747
  }
725
748
  }
726
749
 
727
- /**
728
- * @param {bigint} duration_in_ms
729
- * @returns {Promise<void>}
730
- */
731
- export function process_timer_event(duration_in_ms) {
732
- const ret = wasm.process_timer_event(duration_in_ms);
733
- return takeObject(ret);
734
- }
735
-
736
- /**
737
- * @param {string} slip1_utxo_key
738
- * @param {string} slip2_utxo_key
739
- * @param {string} slip3_utxo_key
740
- * @param {number} left_count
741
- * @param {number} right_count
742
- * @param {Uint8Array} tx_msg
743
- * @returns {Promise<WasmTransaction>}
744
- */
745
- export function create_split_bound_transaction(slip1_utxo_key, slip2_utxo_key, slip3_utxo_key, left_count, right_count, tx_msg) {
746
- 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));
747
- return takeObject(ret);
748
- }
749
-
750
750
  function __wbg_adapter_406(arg0, arg1, arg2, arg3) {
751
751
  wasm.wasm_bindgen__convert__closures__invoke2_mut__h58ba5fc31ee09770(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
752
752
  }
@@ -2669,20 +2669,12 @@ async function __wbg_load(module, imports) {
2669
2669
  function __wbg_get_imports() {
2670
2670
  const imports = {};
2671
2671
  imports.wbg = {};
2672
- imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
2673
- takeObject(arg0);
2674
- };
2675
2672
  imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
2676
2673
  const ret = getStringFromWasm0(arg0, arg1);
2677
2674
  return addHeapObject(ret);
2678
2675
  };
2679
- imports.wbg.__wbg_wasmpeer_new = function(arg0) {
2680
- const ret = WasmPeer.__wrap(arg0);
2681
- return addHeapObject(ret);
2682
- };
2683
- imports.wbg.__wbg_wasmtransaction_new = function(arg0) {
2684
- const ret = WasmTransaction.__wrap(arg0);
2685
- return addHeapObject(ret);
2676
+ imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
2677
+ takeObject(arg0);
2686
2678
  };
2687
2679
  imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
2688
2680
  const ret = BigInt.asUintN(64, arg0);
@@ -2692,12 +2684,8 @@ function __wbg_get_imports() {
2692
2684
  const ret = WasmBlock.__wrap(arg0);
2693
2685
  return addHeapObject(ret);
2694
2686
  };
2695
- imports.wbg.__wbg_wasmbalancesnapshot_new = function(arg0) {
2696
- const ret = WasmBalanceSnapshot.__wrap(arg0);
2697
- return addHeapObject(ret);
2698
- };
2699
- imports.wbg.__wbg_wasmnft_new = function(arg0) {
2700
- const ret = WasmNFT.__wrap(arg0);
2687
+ imports.wbg.__wbg_wasmtransaction_new = function(arg0) {
2688
+ const ret = WasmTransaction.__wrap(arg0);
2701
2689
  return addHeapObject(ret);
2702
2690
  };
2703
2691
  imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
@@ -2708,22 +2696,34 @@ function __wbg_get_imports() {
2708
2696
  getInt32Memory0()[arg0 / 4 + 1] = len1;
2709
2697
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2710
2698
  };
2711
- imports.wbg.__wbg_wasmwallet_new = function(arg0) {
2712
- const ret = WasmWallet.__wrap(arg0);
2699
+ imports.wbg.__wbg_wasmslip_new = function(arg0) {
2700
+ const ret = WasmSlip.__wrap(arg0);
2713
2701
  return addHeapObject(ret);
2714
2702
  };
2715
- imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
2716
- const ret = getObject(arg0);
2703
+ imports.wbg.__wbg_wasmbalancesnapshot_new = function(arg0) {
2704
+ const ret = WasmBalanceSnapshot.__wrap(arg0);
2717
2705
  return addHeapObject(ret);
2718
2706
  };
2719
- imports.wbg.__wbg_wasmslip_new = function(arg0) {
2720
- const ret = WasmSlip.__wrap(arg0);
2707
+ imports.wbg.__wbg_wasmpeer_new = function(arg0) {
2708
+ const ret = WasmPeer.__wrap(arg0);
2721
2709
  return addHeapObject(ret);
2722
2710
  };
2723
2711
  imports.wbg.__wbg_wasmblockchain_new = function(arg0) {
2724
2712
  const ret = WasmBlockchain.__wrap(arg0);
2725
2713
  return addHeapObject(ret);
2726
2714
  };
2715
+ imports.wbg.__wbg_wasmwallet_new = function(arg0) {
2716
+ const ret = WasmWallet.__wrap(arg0);
2717
+ return addHeapObject(ret);
2718
+ };
2719
+ imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
2720
+ const ret = getObject(arg0);
2721
+ return addHeapObject(ret);
2722
+ };
2723
+ imports.wbg.__wbg_wasmnft_new = function(arg0) {
2724
+ const ret = WasmNFT.__wrap(arg0);
2725
+ return addHeapObject(ret);
2726
+ };
2727
2727
  imports.wbg.__wbg_wasmwalletslip_new = function(arg0) {
2728
2728
  const ret = WasmWalletSlip.__wrap(arg0);
2729
2729
  return addHeapObject(ret);
@@ -2749,7 +2749,7 @@ function __wbg_get_imports() {
2749
2749
  const ret = getObject(arg0) in getObject(arg1);
2750
2750
  return ret;
2751
2751
  };
2752
- imports.wbg.__wbg_flushdata_3e493160b5623279 = function(arg0, arg1) {
2752
+ imports.wbg.__wbg_flushdata_2c769b019d5f1e66 = function(arg0, arg1) {
2753
2753
  let deferred0_0;
2754
2754
  let deferred0_1;
2755
2755
  try {
@@ -2760,7 +2760,7 @@ function __wbg_get_imports() {
2760
2760
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2761
2761
  }
2762
2762
  };
2763
- imports.wbg.__wbg_readvalue_5d0f093e1595617d = function() { return handleError(function (arg0, arg1) {
2763
+ imports.wbg.__wbg_readvalue_19e0ac3170ed6477 = function() { return handleError(function (arg0, arg1) {
2764
2764
  let deferred0_0;
2765
2765
  let deferred0_1;
2766
2766
  try {
@@ -2772,13 +2772,13 @@ function __wbg_get_imports() {
2772
2772
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2773
2773
  }
2774
2774
  }, arguments) };
2775
- imports.wbg.__wbg_loadwallet_59081515a24e409d = function() {
2775
+ imports.wbg.__wbg_loadwallet_9ad824e287b4d1e9 = function() {
2776
2776
  MsgHandler.load_wallet();
2777
2777
  };
2778
- imports.wbg.__wbg_savewallet_86e332f8fdf6bc63 = function() {
2778
+ imports.wbg.__wbg_savewallet_c607f3a3206411cf = function() {
2779
2779
  MsgHandler.save_wallet();
2780
2780
  };
2781
- imports.wbg.__wbg_writevalue_9f48cba844bce929 = function(arg0, arg1, arg2) {
2781
+ imports.wbg.__wbg_writevalue_2f493d22dc09e6f5 = function(arg0, arg1, arg2) {
2782
2782
  let deferred0_0;
2783
2783
  let deferred0_1;
2784
2784
  try {
@@ -2789,7 +2789,7 @@ function __wbg_get_imports() {
2789
2789
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2790
2790
  }
2791
2791
  };
2792
- imports.wbg.__wbg_appendvalue_e7ab232264abb10f = function(arg0, arg1, arg2) {
2792
+ imports.wbg.__wbg_appendvalue_720c0ca8080d6eac = function(arg0, arg1, arg2) {
2793
2793
  let deferred0_0;
2794
2794
  let deferred0_1;
2795
2795
  try {
@@ -2800,7 +2800,7 @@ function __wbg_get_imports() {
2800
2800
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2801
2801
  }
2802
2802
  };
2803
- imports.wbg.__wbg_removevalue_c5af6fcdb8e65e93 = function() { return handleError(function (arg0, arg1) {
2803
+ imports.wbg.__wbg_removevalue_215faba975f5b863 = function() { return handleError(function (arg0, arg1) {
2804
2804
  let deferred0_0;
2805
2805
  let deferred0_1;
2806
2806
  try {
@@ -2812,10 +2812,10 @@ function __wbg_get_imports() {
2812
2812
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2813
2813
  }
2814
2814
  }, arguments) };
2815
- imports.wbg.__wbg_sendmessage_360fd9c5b7eb6710 = function(arg0, arg1) {
2815
+ imports.wbg.__wbg_sendmessage_bd6888af7ee69749 = function(arg0, arg1) {
2816
2816
  MsgHandler.send_message(takeObject(arg0), getObject(arg1));
2817
2817
  };
2818
- imports.wbg.__wbg_connecttopeer_099b3d1c7c6e20da = function() { return handleError(function (arg0, arg1, arg2) {
2818
+ imports.wbg.__wbg_connecttopeer_6940934591bed84e = function() { return handleError(function (arg0, arg1, arg2) {
2819
2819
  let deferred0_0;
2820
2820
  let deferred0_1;
2821
2821
  try {
@@ -2827,13 +2827,13 @@ function __wbg_get_imports() {
2827
2827
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2828
2828
  }
2829
2829
  }, arguments) };
2830
- imports.wbg.__wbg_getmyservices_012e89506828bc2f = function() {
2830
+ imports.wbg.__wbg_getmyservices_ba97efc7dbbb3da2 = function() {
2831
2831
  const ret = MsgHandler.get_my_services();
2832
2832
  _assertClass(ret, WasmPeerServiceList);
2833
2833
  var ptr1 = ret.__destroy_into_raw();
2834
2834
  return ptr1;
2835
2835
  };
2836
- imports.wbg.__wbg_isexistingfile_89e9eb758e45ff5e = function() { return handleError(function (arg0, arg1) {
2836
+ imports.wbg.__wbg_isexistingfile_7f4f0c51bececaa6 = function() { return handleError(function (arg0, arg1) {
2837
2837
  let deferred0_0;
2838
2838
  let deferred0_1;
2839
2839
  try {
@@ -2845,27 +2845,27 @@ function __wbg_get_imports() {
2845
2845
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2846
2846
  }
2847
2847
  }, arguments) };
2848
- imports.wbg.__wbg_processapicall_06672752efc468c6 = function(arg0, arg1, arg2) {
2848
+ imports.wbg.__wbg_processapicall_9af56479d30d7f49 = function(arg0, arg1, arg2) {
2849
2849
  MsgHandler.process_api_call(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2850
2850
  };
2851
- imports.wbg.__wbg_processapierror_f821f4aea886cad6 = function(arg0, arg1, arg2) {
2851
+ imports.wbg.__wbg_processapierror_1405fddcb5daf450 = function(arg0, arg1, arg2) {
2852
2852
  MsgHandler.process_api_error(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2853
2853
  };
2854
- imports.wbg.__wbg_processapisuccess_b088c5350b1602ab = function(arg0, arg1, arg2) {
2854
+ imports.wbg.__wbg_processapisuccess_8690e76bad65861c = function(arg0, arg1, arg2) {
2855
2855
  MsgHandler.process_api_success(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2856
2856
  };
2857
- imports.wbg.__wbg_sendmessagetoall_6fcbaa970ca58136 = function(arg0, arg1) {
2857
+ imports.wbg.__wbg_sendmessagetoall_7d5345f9160e8d4c = function(arg0, arg1) {
2858
2858
  MsgHandler.send_message_to_all(getObject(arg0), getObject(arg1));
2859
2859
  };
2860
- imports.wbg.__wbg_disconnectfrompeer_300d63aa93f61d50 = function() { return handleError(function (arg0) {
2860
+ imports.wbg.__wbg_disconnectfrompeer_86615bc01515789c = function() { return handleError(function (arg0) {
2861
2861
  const ret = MsgHandler.disconnect_from_peer(takeObject(arg0));
2862
2862
  return addHeapObject(ret);
2863
2863
  }, arguments) };
2864
- imports.wbg.__wbg_loadblockfilelist_7ebdc6dd8988f2e9 = function() { return handleError(function () {
2864
+ imports.wbg.__wbg_loadblockfilelist_39475ff4bda56def = function() { return handleError(function () {
2865
2865
  const ret = MsgHandler.load_block_file_list();
2866
2866
  return addHeapObject(ret);
2867
2867
  }, arguments) };
2868
- imports.wbg.__wbg_sendinterfaceevent_3091ea002268b66a = function(arg0, arg1, arg2, arg3, arg4) {
2868
+ imports.wbg.__wbg_sendinterfaceevent_9c79439340b79f8e = function(arg0, arg1, arg2, arg3, arg4) {
2869
2869
  let deferred0_0;
2870
2870
  let deferred0_1;
2871
2871
  let deferred1_0;
@@ -2881,7 +2881,7 @@ function __wbg_get_imports() {
2881
2881
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2882
2882
  }
2883
2883
  };
2884
- imports.wbg.__wbg_sendblocksuccess_4076186533b0dd4b = function(arg0, arg1, arg2) {
2884
+ imports.wbg.__wbg_sendblocksuccess_1c721c4150775963 = function(arg0, arg1, arg2) {
2885
2885
  let deferred0_0;
2886
2886
  let deferred0_1;
2887
2887
  try {
@@ -2892,10 +2892,10 @@ function __wbg_get_imports() {
2892
2892
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2893
2893
  }
2894
2894
  };
2895
- imports.wbg.__wbg_sendwalletupdate_a4a45445d63fa2a1 = function() {
2895
+ imports.wbg.__wbg_sendwalletupdate_ddb4fb9d9766e284 = function() {
2896
2896
  MsgHandler.send_wallet_update();
2897
2897
  };
2898
- imports.wbg.__wbg_sendnewversionalert_3ec71b6bf65d28d0 = function(arg0, arg1, arg2) {
2898
+ imports.wbg.__wbg_sendnewversionalert_fa5e1d7df7e1161b = function(arg0, arg1, arg2) {
2899
2899
  let deferred0_0;
2900
2900
  let deferred0_1;
2901
2901
  try {
@@ -2906,13 +2906,13 @@ function __wbg_get_imports() {
2906
2906
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2907
2907
  }
2908
2908
  };
2909
- imports.wbg.__wbg_sendblockfetchstatusevent_23c7a26cfd3a5d15 = function(arg0) {
2909
+ imports.wbg.__wbg_sendblockfetchstatusevent_3f27984e18d29a1c = function(arg0) {
2910
2910
  MsgHandler.send_block_fetch_status_event(BigInt.asUintN(64, arg0));
2911
2911
  };
2912
- imports.wbg.__wbg_sendnewchaindetectedevent_9814eea25ed127aa = function() {
2912
+ imports.wbg.__wbg_sendnewchaindetectedevent_8e502ee05519582d = function() {
2913
2913
  MsgHandler.send_new_chain_detected_event();
2914
2914
  };
2915
- imports.wbg.__wbg_fetchblockfrompeer_ab58f5ed93834e68 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2915
+ imports.wbg.__wbg_fetchblockfrompeer_d09e3f0752b33dd5 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2916
2916
  let deferred0_0;
2917
2917
  let deferred0_1;
2918
2918
  try {
@@ -2924,7 +2924,7 @@ function __wbg_get_imports() {
2924
2924
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2925
2925
  }
2926
2926
  }, arguments) };
2927
- imports.wbg.__wbg_ensureblockdirectoryexists_e06f5acab13f0888 = function() { return handleError(function (arg0, arg1) {
2927
+ imports.wbg.__wbg_ensureblockdirectoryexists_23741132d74452f6 = function() { return handleError(function (arg0, arg1) {
2928
2928
  let deferred0_0;
2929
2929
  let deferred0_1;
2930
2930
  try {
@@ -3247,7 +3247,7 @@ function __wbg_get_imports() {
3247
3247
  getInt32Memory0()[arg0 / 4 + 1] = len1;
3248
3248
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
3249
3249
  };
3250
- imports.wbg.__wbindgen_closure_wrapper1627 = function(arg0, arg1, arg2) {
3250
+ imports.wbg.__wbindgen_closure_wrapper1628 = function(arg0, arg1, arg2) {
3251
3251
  const ret = makeMutClosure(arg0, arg1, 581, __wbg_adapter_38);
3252
3252
  return addHeapObject(ret);
3253
3253
  };