saito-wasm 0.2.169 → 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/node/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  let imports = {};
2
2
  imports['__wbindgen_placeholder__'] = module.exports;
3
3
  let wasm;
4
- const { MsgHandler } = require(String.raw`./snippets/saito-wasm-ac621af49b696a83/js/msg_handler.js`);
4
+ const { MsgHandler } = require(String.raw`./snippets/saito-wasm-110f636d48c332b6/js/msg_handler.js`);
5
5
  const { TextDecoder, TextEncoder } = require(`util`);
6
6
 
7
7
  const heap = new Array(128).fill(undefined);
@@ -236,60 +236,60 @@ function _assertClass(instance, klass) {
236
236
  }
237
237
  /**
238
238
  * @param {Uint8Array} buffer
239
- * @returns {string}
239
+ * @param {bigint} peer_index
240
+ * @returns {Promise<void>}
240
241
  */
241
- module.exports.hash = function(buffer) {
242
- const ret = wasm.hash(addHeapObject(buffer));
242
+ module.exports.process_msg_buffer_from_peer = function(buffer, peer_index) {
243
+ const ret = wasm.process_msg_buffer_from_peer(addHeapObject(buffer), peer_index);
243
244
  return takeObject(ret);
244
245
  };
245
246
 
246
247
  /**
247
- * @param {bigint} threshold
248
- * @returns {Promise<void>}
248
+ * @param {string} slip1_utxo_key
249
+ * @param {string} slip2_utxo_key
250
+ * @param {string} slip3_utxo_key
251
+ * @returns {Promise<WasmTransaction>}
249
252
  */
250
- module.exports.write_issuance_file = function(threshold) {
251
- const ret = wasm.write_issuance_file(threshold);
253
+ module.exports.create_remove_bound_transaction = function(slip1_utxo_key, slip2_utxo_key, slip3_utxo_key) {
254
+ const ret = wasm.create_remove_bound_transaction(addHeapObject(slip1_utxo_key), addHeapObject(slip2_utxo_key), addHeapObject(slip3_utxo_key));
252
255
  return takeObject(ret);
253
256
  };
254
257
 
255
258
  /**
259
+ * @param {Uint8Array} buffer
260
+ * @param {Uint8Array} hash
261
+ * @param {bigint} block_id
256
262
  * @param {bigint} peer_index
257
263
  * @returns {Promise<void>}
258
264
  */
259
- module.exports.process_peer_disconnection = function(peer_index) {
260
- const ret = wasm.process_peer_disconnection(peer_index);
265
+ module.exports.process_fetched_block = function(buffer, hash, block_id, peer_index) {
266
+ const ret = wasm.process_fetched_block(addHeapObject(buffer), addHeapObject(hash), block_id, peer_index);
261
267
  return takeObject(ret);
262
268
  };
263
269
 
264
270
  /**
265
- * @returns {Promise<string>}
271
+ * @param {bigint} peer_index
272
+ * @returns {Promise<WasmPeer | undefined>}
266
273
  */
267
- module.exports.get_peer_stats = function() {
268
- const ret = wasm.get_peer_stats();
274
+ module.exports.get_peer = function(peer_index) {
275
+ const ret = wasm.get_peer(peer_index);
269
276
  return takeObject(ret);
270
277
  };
271
278
 
272
279
  /**
273
- * @param {bigint} num
274
- * @param {bigint} deposit
275
- * @param {Uint8Array} tx_msg
276
- * @param {bigint} fee
277
- * @param {string} recipient_public_key
278
- * @param {string} nft_type
279
- * @returns {Promise<WasmTransaction>}
280
+ * @param {string} block_hash
281
+ * @returns {Promise<WasmBlock>}
280
282
  */
281
- module.exports.create_bound_transaction = function(num, deposit, tx_msg, fee, recipient_public_key, nft_type) {
282
- const ret = wasm.create_bound_transaction(num, deposit, addHeapObject(tx_msg), fee, addHeapObject(recipient_public_key), addHeapObject(nft_type));
283
+ module.exports.get_block = function(block_hash) {
284
+ const ret = wasm.get_block(addHeapObject(block_hash));
283
285
  return takeObject(ret);
284
286
  };
285
287
 
286
288
  /**
287
- * @param {WasmTransaction} tx
288
- * @returns {Promise<void>}
289
+ * @returns {Promise<Array<any>>}
289
290
  */
290
- module.exports.propagate_transaction = function(tx) {
291
- _assertClass(tx, WasmTransaction);
292
- const ret = wasm.propagate_transaction(tx.__wbg_ptr);
291
+ module.exports.get_mempool_txs = function() {
292
+ const ret = wasm.get_mempool_txs();
293
293
  return takeObject(ret);
294
294
  };
295
295
 
@@ -304,36 +304,31 @@ module.exports.process_stun_peer = function(peer_index, public_key) {
304
304
  };
305
305
 
306
306
  /**
307
- * @param {Array<any>} public_keys
308
- * @param {BigUint64Array} amounts
309
- * @param {bigint} fee
310
- * @param {boolean} _force_merge
311
- * @returns {Promise<WasmTransaction>}
307
+ * @param {string} key
308
+ * @returns {boolean}
312
309
  */
313
- module.exports.create_transaction_with_multiple_payments = function(public_keys, amounts, fee, _force_merge) {
314
- const ret = wasm.create_transaction_with_multiple_payments(addHeapObject(public_keys), addHeapObject(amounts), fee, _force_merge);
315
- return takeObject(ret);
310
+ module.exports.is_valid_public_key = function(key) {
311
+ const ret = wasm.is_valid_public_key(addHeapObject(key));
312
+ return ret !== 0;
316
313
  };
317
314
 
318
315
  /**
319
- * @param {Uint8Array} hash
320
- * @param {bigint} block_id
321
- * @param {bigint} peer_index
322
- * @returns {Promise<void>}
316
+ * @returns {Promise<string>}
323
317
  */
324
- module.exports.process_failed_block_fetch = function(hash, block_id, peer_index) {
325
- const ret = wasm.process_failed_block_fetch(addHeapObject(hash), block_id, peer_index);
318
+ module.exports.get_stats = function() {
319
+ const ret = wasm.get_stats();
326
320
  return takeObject(ret);
327
321
  };
328
322
 
329
323
  /**
324
+ * @param {Uint8Array} buffer
330
325
  * @param {string} private_key
331
326
  * @returns {string}
332
327
  */
333
- module.exports.generate_public_key = function(private_key) {
328
+ module.exports.sign_buffer = function(buffer, private_key) {
334
329
  try {
335
330
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
336
- wasm.generate_public_key(retptr, addHeapObject(private_key));
331
+ wasm.sign_buffer(retptr, addHeapObject(buffer), addHeapObject(private_key));
337
332
  var r0 = getInt32Memory0()[retptr / 4 + 0];
338
333
  var r1 = getInt32Memory0()[retptr / 4 + 1];
339
334
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -347,19 +342,11 @@ module.exports.generate_public_key = function(private_key) {
347
342
  };
348
343
 
349
344
  /**
350
- * @param {string} key
351
- * @returns {boolean}
352
- */
353
- module.exports.is_valid_public_key = function(key) {
354
- const ret = wasm.is_valid_public_key(addHeapObject(key));
355
- return ret !== 0;
356
- };
357
-
358
- /**
359
- * @returns {Promise<Array<any>>}
345
+ * @param {bigint} peer_index
346
+ * @returns {Promise<void>}
360
347
  */
361
- module.exports.get_nft_list = function() {
362
- const ret = wasm.get_nft_list();
348
+ module.exports.process_peer_disconnection = function(peer_index) {
349
+ const ret = wasm.process_peer_disconnection(peer_index);
363
350
  return takeObject(ret);
364
351
  };
365
352
 
@@ -372,183 +359,214 @@ module.exports.get_blockchain = function() {
372
359
  };
373
360
 
374
361
  /**
375
- * @param {Uint8Array} buffer
376
- * @param {number} msg_index
377
- * @param {bigint} peer_index
378
- * @returns {Promise<void>}
362
+ * @returns {Promise<string>}
379
363
  */
380
- module.exports.send_api_call = function(buffer, msg_index, peer_index) {
381
- const ret = wasm.send_api_call(addHeapObject(buffer), msg_index, peer_index);
364
+ module.exports.get_congestion_stats = function() {
365
+ const ret = wasm.get_congestion_stats();
382
366
  return takeObject(ret);
383
367
  };
384
368
 
385
369
  /**
386
- * @param {bigint} peer_index
387
- * @returns {Promise<void>}
370
+ * @returns {Promise<any>}
388
371
  */
389
- module.exports.remove_stun_peer = function(peer_index) {
390
- const ret = wasm.remove_stun_peer(peer_index);
372
+ module.exports.get_confirmations = function() {
373
+ const ret = wasm.get_confirmations();
391
374
  return takeObject(ret);
392
375
  };
393
376
 
394
377
  /**
395
- * @param {bigint} duration_in_ms
396
- * @returns {Promise<void>}
378
+ * @param {string} slip1_utxo_key
379
+ * @param {string} slip2_utxo_key
380
+ * @param {string} slip3_utxo_key
381
+ * @param {number} left_count
382
+ * @param {number} right_count
383
+ * @param {Uint8Array} tx_msg
384
+ * @returns {Promise<WasmTransaction>}
397
385
  */
398
- module.exports.process_timer_event = function(duration_in_ms) {
399
- const ret = wasm.process_timer_event(duration_in_ms);
386
+ module.exports.create_split_bound_transaction = function(slip1_utxo_key, slip2_utxo_key, slip3_utxo_key, left_count, right_count, tx_msg) {
387
+ 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));
400
388
  return takeObject(ret);
401
389
  };
402
390
 
403
391
  /**
404
- * @param {bigint} peer_index
405
- * @param {string} ip
406
- * @returns {Promise<void>}
392
+ * @param {bigint} amt
393
+ * @param {string} slip1_utxo_key
394
+ * @param {string} slip2_utxo_key
395
+ * @param {string} slip3_utxo_key
396
+ * @param {string} recipient_public_key
397
+ * @param {Uint8Array} tx_msg
398
+ * @returns {Promise<WasmTransaction>}
407
399
  */
408
- module.exports.process_new_peer = function(peer_index, ip) {
409
- const ret = wasm.process_new_peer(peer_index, addHeapObject(ip));
400
+ module.exports.create_send_bound_transaction = function(amt, slip1_utxo_key, slip2_utxo_key, slip3_utxo_key, recipient_public_key, tx_msg) {
401
+ 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
402
  return takeObject(ret);
411
403
  };
412
404
 
413
405
  /**
414
- * @param {WasmBalanceSnapshot} snapshot
415
- * @returns {Promise<void>}
406
+ * @returns {Promise<string>}
416
407
  */
417
- module.exports.update_from_balance_snapshot = function(snapshot) {
418
- _assertClass(snapshot, WasmBalanceSnapshot);
419
- var ptr0 = snapshot.__destroy_into_raw();
420
- const ret = wasm.update_from_balance_snapshot(ptr0);
408
+ module.exports.get_latest_block_hash = function() {
409
+ const ret = wasm.get_latest_block_hash();
421
410
  return takeObject(ret);
422
411
  };
423
412
 
424
413
  /**
425
- * @param {Array<any>} keys
426
- * @returns {Promise<WasmBalanceSnapshot>}
414
+ * @returns {Promise<WasmWallet>}
427
415
  */
428
- module.exports.get_balance_snapshot = function(keys) {
429
- const ret = wasm.get_balance_snapshot(addHeapObject(keys));
416
+ module.exports.get_wallet = function() {
417
+ const ret = wasm.get_wallet();
430
418
  return takeObject(ret);
431
419
  };
432
420
 
433
421
  /**
434
422
  * @returns {Promise<string>}
435
423
  */
436
- module.exports.get_stats = function() {
437
- const ret = wasm.get_stats();
424
+ module.exports.get_peer_stats = function() {
425
+ const ret = wasm.get_peer_stats();
438
426
  return takeObject(ret);
439
427
  };
440
428
 
441
429
  /**
442
430
  * @returns {Promise<Array<any>>}
443
431
  */
444
- module.exports.get_mempool_txs = function() {
445
- const ret = wasm.get_mempool_txs();
432
+ module.exports.get_peers = function() {
433
+ const ret = wasm.get_peers();
446
434
  return takeObject(ret);
447
435
  };
448
436
 
449
437
  /**
450
- * @returns {Promise<any>}
438
+ * @param {Uint8Array} buffer
439
+ * @param {number} msg_index
440
+ * @param {bigint} peer_index
441
+ * @returns {Promise<void>}
451
442
  */
452
- module.exports.get_confirmations = function() {
453
- const ret = wasm.get_confirmations();
443
+ module.exports.send_api_call = function(buffer, msg_index, peer_index) {
444
+ const ret = wasm.send_api_call(addHeapObject(buffer), msg_index, peer_index);
454
445
  return takeObject(ret);
455
446
  };
456
447
 
457
448
  /**
449
+ * @param {string} private_key
458
450
  * @returns {string}
459
451
  */
460
- module.exports.generate_private_key = function() {
461
- const ret = wasm.generate_private_key();
462
- return takeObject(ret);
452
+ module.exports.generate_public_key = function(private_key) {
453
+ try {
454
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
455
+ wasm.generate_public_key(retptr, addHeapObject(private_key));
456
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
457
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
458
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
459
+ if (r2) {
460
+ throw takeObject(r1);
461
+ }
462
+ return takeObject(r0);
463
+ } finally {
464
+ wasm.__wbindgen_add_to_stack_pointer(16);
465
+ }
463
466
  };
464
467
 
465
468
  /**
466
- * @param {Uint8Array} buffer
467
- * @param {number} msg_index
468
- * @param {bigint} peer_index
469
+ * @param {WasmTransaction} tx
469
470
  * @returns {Promise<void>}
470
471
  */
471
- module.exports.send_api_error = function(buffer, msg_index, peer_index) {
472
- const ret = wasm.send_api_error(addHeapObject(buffer), msg_index, peer_index);
472
+ module.exports.propagate_transaction = function(tx) {
473
+ _assertClass(tx, WasmTransaction);
474
+ const ret = wasm.propagate_transaction(tx.__wbg_ptr);
473
475
  return takeObject(ret);
474
476
  };
475
477
 
476
478
  /**
477
- * @param {bigint} peer_index
478
- * @returns {Promise<WasmPeer | undefined>}
479
+ * @param {Array<any>} keys
480
+ * @returns {Promise<WasmBalanceSnapshot>}
479
481
  */
480
- module.exports.get_peer = function(peer_index) {
481
- const ret = wasm.get_peer(peer_index);
482
+ module.exports.get_balance_snapshot = function(keys) {
483
+ const ret = wasm.get_balance_snapshot(addHeapObject(keys));
482
484
  return takeObject(ret);
483
485
  };
484
486
 
485
487
  /**
486
- * @returns {Promise<void>}
488
+ * @param {string} nft_id_hex
489
+ * @param {Uint8Array} tx_msg
490
+ * @returns {Promise<WasmTransaction>}
487
491
  */
488
- module.exports.start_from_received_ghost_chain = function() {
489
- const ret = wasm.start_from_received_ghost_chain();
492
+ module.exports.create_merge_bound_transaction = function(nft_id_hex, tx_msg) {
493
+ const ptr0 = passStringToWasm0(nft_id_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
494
+ const len0 = WASM_VECTOR_LEN;
495
+ const ret = wasm.create_merge_bound_transaction(ptr0, len0, addHeapObject(tx_msg));
490
496
  return takeObject(ret);
491
497
  };
492
498
 
493
499
  /**
500
+ * @param {bigint} peer_index
501
+ * @param {string} ip
494
502
  * @returns {Promise<void>}
495
503
  */
496
- module.exports.disable_producing_blocks_by_timer = function() {
497
- const ret = wasm.disable_producing_blocks_by_timer();
504
+ module.exports.process_new_peer = function(peer_index, ip) {
505
+ const ret = wasm.process_new_peer(peer_index, addHeapObject(ip));
498
506
  return takeObject(ret);
499
507
  };
500
508
 
501
509
  /**
502
- * @param {string} nft_id_hex
503
- * @param {Uint8Array} tx_msg
510
+ * @param {Array<any>} public_keys
511
+ * @param {BigUint64Array} amounts
512
+ * @param {bigint} fee
513
+ * @param {boolean} _force_merge
504
514
  * @returns {Promise<WasmTransaction>}
505
515
  */
506
- module.exports.create_merge_bound_transaction = function(nft_id_hex, tx_msg) {
507
- const ptr0 = passStringToWasm0(nft_id_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
508
- const len0 = WASM_VECTOR_LEN;
509
- const ret = wasm.create_merge_bound_transaction(ptr0, len0, addHeapObject(tx_msg));
516
+ module.exports.create_transaction_with_multiple_payments = function(public_keys, amounts, fee, _force_merge) {
517
+ const ret = wasm.create_transaction_with_multiple_payments(addHeapObject(public_keys), addHeapObject(amounts), fee, _force_merge);
510
518
  return takeObject(ret);
511
519
  };
512
520
 
513
521
  /**
514
- * @param {string} config_json
515
- * @param {string} private_key
516
- * @param {number} log_level_num
517
- * @param {bigint} hasten_multiplier
518
- * @param {boolean} delete_old_blocks
519
- * @returns {Promise<any>}
522
+ * @param {Uint8Array} hash
523
+ * @param {bigint} block_id
524
+ * @param {bigint} peer_index
525
+ * @returns {Promise<void>}
520
526
  */
521
- module.exports.initialize = function(config_json, private_key, log_level_num, hasten_multiplier, delete_old_blocks) {
522
- const ret = wasm.initialize(addHeapObject(config_json), addHeapObject(private_key), log_level_num, hasten_multiplier, delete_old_blocks);
527
+ module.exports.process_failed_block_fetch = function(hash, block_id, peer_index) {
528
+ const ret = wasm.process_failed_block_fetch(addHeapObject(hash), block_id, peer_index);
523
529
  return takeObject(ret);
524
530
  };
525
531
 
526
532
  /**
527
- * @param {Uint8Array} buffer
528
- * @param {string} signature
529
- * @param {string} public_key
530
- * @returns {boolean}
533
+ * @returns {Promise<Array<any>>}
531
534
  */
532
- module.exports.verify_signature = function(buffer, signature, public_key) {
533
- const ret = wasm.verify_signature(addHeapObject(buffer), addHeapObject(signature), addHeapObject(public_key));
534
- return ret !== 0;
535
+ module.exports.get_nft_list = function() {
536
+ const ret = wasm.get_nft_list();
537
+ return takeObject(ret);
535
538
  };
536
539
 
537
540
  /**
538
- * @param {string} public_key
539
- * @returns {Promise<Array<any>>}
541
+ * @returns {Promise<boolean>}
540
542
  */
541
- module.exports.get_account_slips = function(public_key) {
542
- const ret = wasm.get_account_slips(addHeapObject(public_key));
543
+ module.exports.produce_block_with_gt = function() {
544
+ const ret = wasm.produce_block_with_gt();
543
545
  return takeObject(ret);
544
546
  };
545
547
 
546
548
  /**
547
- * @param {string} block_hash
548
- * @returns {Promise<WasmBlock>}
549
+ * @param {bigint} peer_index
550
+ * @returns {Promise<void>}
549
551
  */
550
- module.exports.get_block = function(block_hash) {
551
- const ret = wasm.get_block(addHeapObject(block_hash));
552
+ module.exports.remove_stun_peer = function(peer_index) {
553
+ const ret = wasm.remove_stun_peer(peer_index);
554
+ return takeObject(ret);
555
+ };
556
+
557
+ /**
558
+ * @returns {string}
559
+ */
560
+ module.exports.generate_private_key = function() {
561
+ const ret = wasm.generate_private_key();
562
+ return takeObject(ret);
563
+ };
564
+
565
+ /**
566
+ * @returns {Promise<void>}
567
+ */
568
+ module.exports.start_from_received_ghost_chain = function() {
569
+ const ret = wasm.start_from_received_ghost_chain();
552
570
  return takeObject(ret);
553
571
  };
554
572
 
@@ -565,50 +583,42 @@ module.exports.create_transaction = function(public_key, amount, fee, force_merg
565
583
  };
566
584
 
567
585
  /**
568
- * @param {Uint8Array} buffer
569
- * @param {string} private_key
570
- * @returns {string}
586
+ * @param {string} public_key
587
+ * @returns {Promise<Array<any>>}
571
588
  */
572
- module.exports.sign_buffer = function(buffer, private_key) {
573
- try {
574
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
575
- wasm.sign_buffer(retptr, addHeapObject(buffer), addHeapObject(private_key));
576
- var r0 = getInt32Memory0()[retptr / 4 + 0];
577
- var r1 = getInt32Memory0()[retptr / 4 + 1];
578
- var r2 = getInt32Memory0()[retptr / 4 + 2];
579
- if (r2) {
580
- throw takeObject(r1);
581
- }
582
- return takeObject(r0);
583
- } finally {
584
- wasm.__wbindgen_add_to_stack_pointer(16);
585
- }
589
+ module.exports.get_account_slips = function(public_key) {
590
+ const ret = wasm.get_account_slips(addHeapObject(public_key));
591
+ return takeObject(ret);
586
592
  };
587
593
 
588
594
  /**
589
- * @param {bigint} current_time
590
- * @returns {Promise<void>}
595
+ * @param {bigint} num
596
+ * @param {bigint} deposit
597
+ * @param {Uint8Array} tx_msg
598
+ * @param {bigint} fee
599
+ * @param {string} recipient_public_key
600
+ * @param {string} nft_type
601
+ * @returns {Promise<WasmTransaction>}
591
602
  */
592
- module.exports.process_stat_interval = function(current_time) {
593
- const ret = wasm.process_stat_interval(current_time);
603
+ module.exports.create_bound_transaction = function(num, deposit, tx_msg, fee, recipient_public_key, nft_type) {
604
+ const ret = wasm.create_bound_transaction(num, deposit, addHeapObject(tx_msg), fee, addHeapObject(recipient_public_key), addHeapObject(nft_type));
594
605
  return takeObject(ret);
595
606
  };
596
607
 
597
608
  /**
598
- * @returns {Promise<WasmWallet>}
609
+ * @param {bigint} current_time
610
+ * @returns {Promise<void>}
599
611
  */
600
- module.exports.get_wallet = function() {
601
- const ret = wasm.get_wallet();
612
+ module.exports.process_stat_interval = function(current_time) {
613
+ const ret = wasm.process_stat_interval(current_time);
602
614
  return takeObject(ret);
603
615
  };
604
616
 
605
617
  /**
606
- * @param {Uint8Array} buffer
607
- * @param {bigint} peer_index
608
618
  * @returns {Promise<void>}
609
619
  */
610
- module.exports.process_msg_buffer_from_peer = function(buffer, peer_index) {
611
- const ret = wasm.process_msg_buffer_from_peer(addHeapObject(buffer), peer_index);
620
+ module.exports.disable_producing_blocks_by_timer = function() {
621
+ const ret = wasm.disable_producing_blocks_by_timer();
612
622
  return takeObject(ret);
613
623
  };
614
624
 
@@ -624,38 +634,42 @@ module.exports.send_api_success = function(buffer, msg_index, peer_index) {
624
634
  };
625
635
 
626
636
  /**
627
- * @param {string} slip1_utxo_key
628
- * @param {string} slip2_utxo_key
629
- * @param {string} slip3_utxo_key
630
- * @returns {Promise<WasmTransaction>}
637
+ * @param {bigint} duration_in_ms
638
+ * @returns {Promise<void>}
631
639
  */
632
- module.exports.create_remove_bound_transaction = function(slip1_utxo_key, slip2_utxo_key, slip3_utxo_key) {
633
- const ret = wasm.create_remove_bound_transaction(addHeapObject(slip1_utxo_key), addHeapObject(slip2_utxo_key), addHeapObject(slip3_utxo_key));
640
+ module.exports.process_timer_event = function(duration_in_ms) {
641
+ const ret = wasm.process_timer_event(duration_in_ms);
634
642
  return takeObject(ret);
635
643
  };
636
644
 
637
645
  /**
638
- * @returns {Promise<string>}
646
+ * @returns {Promise<boolean>}
639
647
  */
640
- module.exports.get_congestion_stats = function() {
641
- const ret = wasm.get_congestion_stats();
648
+ module.exports.produce_block_without_gt = function() {
649
+ const ret = wasm.produce_block_without_gt();
642
650
  return takeObject(ret);
643
651
  };
644
652
 
645
653
  /**
646
- * @returns {Promise<boolean>}
654
+ * @param {WasmBalanceSnapshot} snapshot
655
+ * @returns {Promise<void>}
647
656
  */
648
- module.exports.produce_block_with_gt = function() {
649
- const ret = wasm.produce_block_with_gt();
657
+ module.exports.update_from_balance_snapshot = function(snapshot) {
658
+ _assertClass(snapshot, WasmBalanceSnapshot);
659
+ var ptr0 = snapshot.__destroy_into_raw();
660
+ const ret = wasm.update_from_balance_snapshot(ptr0);
650
661
  return takeObject(ret);
651
662
  };
652
663
 
653
664
  /**
654
- * @returns {Promise<Array<any>>}
665
+ * @param {Uint8Array} buffer
666
+ * @param {string} signature
667
+ * @param {string} public_key
668
+ * @returns {boolean}
655
669
  */
656
- module.exports.get_peers = function() {
657
- const ret = wasm.get_peers();
658
- return takeObject(ret);
670
+ module.exports.verify_signature = function(buffer, signature, public_key) {
671
+ const ret = wasm.verify_signature(addHeapObject(buffer), addHeapObject(signature), addHeapObject(public_key));
672
+ return ret !== 0;
659
673
  };
660
674
 
661
675
  /**
@@ -670,66 +684,52 @@ module.exports.set_wallet_version = function(major, minor, patch) {
670
684
  };
671
685
 
672
686
  /**
673
- * @returns {Promise<boolean>}
687
+ * @param {bigint} threshold
688
+ * @returns {Promise<void>}
674
689
  */
675
- module.exports.produce_block_without_gt = function() {
676
- const ret = wasm.produce_block_without_gt();
690
+ module.exports.write_issuance_file = function(threshold) {
691
+ const ret = wasm.write_issuance_file(threshold);
677
692
  return takeObject(ret);
678
693
  };
679
694
 
680
695
  /**
681
- * @returns {Promise<string>}
696
+ * @returns {Promise<bigint>}
682
697
  */
683
- module.exports.get_latest_block_hash = function() {
684
- const ret = wasm.get_latest_block_hash();
698
+ module.exports.get_next_peer_index = function() {
699
+ const ret = wasm.get_next_peer_index();
685
700
  return takeObject(ret);
686
701
  };
687
702
 
688
703
  /**
689
704
  * @param {Uint8Array} buffer
690
- * @param {Uint8Array} hash
691
- * @param {bigint} block_id
692
- * @param {bigint} peer_index
693
- * @returns {Promise<void>}
694
- */
695
- module.exports.process_fetched_block = function(buffer, hash, block_id, peer_index) {
696
- const ret = wasm.process_fetched_block(addHeapObject(buffer), addHeapObject(hash), block_id, peer_index);
697
- return takeObject(ret);
698
- };
699
-
700
- /**
701
- * @returns {Promise<bigint>}
705
+ * @returns {string}
702
706
  */
703
- module.exports.get_next_peer_index = function() {
704
- const ret = wasm.get_next_peer_index();
707
+ module.exports.hash = function(buffer) {
708
+ const ret = wasm.hash(addHeapObject(buffer));
705
709
  return takeObject(ret);
706
710
  };
707
711
 
708
712
  /**
709
- * @param {string} slip1_utxo_key
710
- * @param {string} slip2_utxo_key
711
- * @param {string} slip3_utxo_key
712
- * @param {number} left_count
713
- * @param {number} right_count
714
- * @param {Uint8Array} tx_msg
715
- * @returns {Promise<WasmTransaction>}
713
+ * @param {string} config_json
714
+ * @param {string} private_key
715
+ * @param {number} log_level_num
716
+ * @param {bigint} hasten_multiplier
717
+ * @param {boolean} delete_old_blocks
718
+ * @returns {Promise<any>}
716
719
  */
717
- module.exports.create_split_bound_transaction = function(slip1_utxo_key, slip2_utxo_key, slip3_utxo_key, left_count, right_count, tx_msg) {
718
- 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));
720
+ module.exports.initialize = function(config_json, private_key, log_level_num, hasten_multiplier, delete_old_blocks) {
721
+ const ret = wasm.initialize(addHeapObject(config_json), addHeapObject(private_key), log_level_num, hasten_multiplier, delete_old_blocks);
719
722
  return takeObject(ret);
720
723
  };
721
724
 
722
725
  /**
723
- * @param {bigint} amt
724
- * @param {string} slip1_utxo_key
725
- * @param {string} slip2_utxo_key
726
- * @param {string} slip3_utxo_key
727
- * @param {string} recipient_public_key
728
- * @param {Uint8Array} tx_msg
729
- * @returns {Promise<WasmTransaction>}
726
+ * @param {Uint8Array} buffer
727
+ * @param {number} msg_index
728
+ * @param {bigint} peer_index
729
+ * @returns {Promise<void>}
730
730
  */
731
- module.exports.create_send_bound_transaction = function(amt, slip1_utxo_key, slip2_utxo_key, slip3_utxo_key, recipient_public_key, tx_msg) {
732
- 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));
731
+ module.exports.send_api_error = function(buffer, msg_index, peer_index) {
732
+ const ret = wasm.send_api_error(addHeapObject(buffer), msg_index, peer_index);
733
733
  return takeObject(ret);
734
734
  };
735
735
 
@@ -2666,11 +2666,31 @@ module.exports.__wbg_wasmtransaction_new = function(arg0) {
2666
2666
  return addHeapObject(ret);
2667
2667
  };
2668
2668
 
2669
+ module.exports.__wbg_wasmbalancesnapshot_new = function(arg0) {
2670
+ const ret = WasmBalanceSnapshot.__wrap(arg0);
2671
+ return addHeapObject(ret);
2672
+ };
2673
+
2674
+ module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
2675
+ const ret = BigInt.asUintN(64, arg0);
2676
+ return addHeapObject(ret);
2677
+ };
2678
+
2669
2679
  module.exports.__wbg_wasmnft_new = function(arg0) {
2670
2680
  const ret = WasmNFT.__wrap(arg0);
2671
2681
  return addHeapObject(ret);
2672
2682
  };
2673
2683
 
2684
+ module.exports.__wbg_wasmblock_new = function(arg0) {
2685
+ const ret = WasmBlock.__wrap(arg0);
2686
+ return addHeapObject(ret);
2687
+ };
2688
+
2689
+ module.exports.__wbindgen_object_clone_ref = function(arg0) {
2690
+ const ret = getObject(arg0);
2691
+ return addHeapObject(ret);
2692
+ };
2693
+
2674
2694
  module.exports.__wbindgen_string_get = function(arg0, arg1) {
2675
2695
  const obj = getObject(arg1);
2676
2696
  const ret = typeof(obj) === 'string' ? obj : undefined;
@@ -2685,38 +2705,18 @@ module.exports.__wbg_wasmpeer_new = function(arg0) {
2685
2705
  return addHeapObject(ret);
2686
2706
  };
2687
2707
 
2688
- module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
2689
- const ret = BigInt.asUintN(64, arg0);
2690
- return addHeapObject(ret);
2691
- };
2692
-
2693
- module.exports.__wbg_wasmwallet_new = function(arg0) {
2694
- const ret = WasmWallet.__wrap(arg0);
2695
- return addHeapObject(ret);
2696
- };
2697
-
2698
- module.exports.__wbg_wasmbalancesnapshot_new = function(arg0) {
2699
- const ret = WasmBalanceSnapshot.__wrap(arg0);
2700
- return addHeapObject(ret);
2701
- };
2702
-
2703
2708
  module.exports.__wbg_wasmwalletslip_new = function(arg0) {
2704
2709
  const ret = WasmWalletSlip.__wrap(arg0);
2705
2710
  return addHeapObject(ret);
2706
2711
  };
2707
2712
 
2708
- module.exports.__wbg_wasmblock_new = function(arg0) {
2709
- const ret = WasmBlock.__wrap(arg0);
2710
- return addHeapObject(ret);
2711
- };
2712
-
2713
- module.exports.__wbindgen_object_clone_ref = function(arg0) {
2714
- const ret = getObject(arg0);
2713
+ module.exports.__wbg_wasmslip_new = function(arg0) {
2714
+ const ret = WasmSlip.__wrap(arg0);
2715
2715
  return addHeapObject(ret);
2716
2716
  };
2717
2717
 
2718
- module.exports.__wbg_wasmslip_new = function(arg0) {
2719
- const ret = WasmSlip.__wrap(arg0);
2718
+ module.exports.__wbg_wasmwallet_new = function(arg0) {
2719
+ const ret = WasmWallet.__wrap(arg0);
2720
2720
  return addHeapObject(ret);
2721
2721
  };
2722
2722
 
@@ -2756,7 +2756,7 @@ module.exports.__wbindgen_in = function(arg0, arg1) {
2756
2756
  return ret;
2757
2757
  };
2758
2758
 
2759
- module.exports.__wbg_flushdata_571e46cce4f70e72 = function(arg0, arg1) {
2759
+ module.exports.__wbg_flushdata_31d2c087e1642e7d = function(arg0, arg1) {
2760
2760
  let deferred0_0;
2761
2761
  let deferred0_1;
2762
2762
  try {
@@ -2768,7 +2768,7 @@ module.exports.__wbg_flushdata_571e46cce4f70e72 = function(arg0, arg1) {
2768
2768
  }
2769
2769
  };
2770
2770
 
2771
- module.exports.__wbg_readvalue_0023aabd3b029c28 = function() { return handleError(function (arg0, arg1) {
2771
+ module.exports.__wbg_readvalue_8d065620fad540d3 = function() { return handleError(function (arg0, arg1) {
2772
2772
  let deferred0_0;
2773
2773
  let deferred0_1;
2774
2774
  try {
@@ -2781,15 +2781,15 @@ module.exports.__wbg_readvalue_0023aabd3b029c28 = function() { return handleErro
2781
2781
  }
2782
2782
  }, arguments) };
2783
2783
 
2784
- module.exports.__wbg_loadwallet_c7d36edfd9b3141c = function() {
2784
+ module.exports.__wbg_loadwallet_b2c7c0fa442cbf65 = function() {
2785
2785
  MsgHandler.load_wallet();
2786
2786
  };
2787
2787
 
2788
- module.exports.__wbg_savewallet_7f660732fea84939 = function() {
2788
+ module.exports.__wbg_savewallet_8ffd86ac6de7743c = function() {
2789
2789
  MsgHandler.save_wallet();
2790
2790
  };
2791
2791
 
2792
- module.exports.__wbg_writevalue_a37456c36a13f7c1 = function(arg0, arg1, arg2) {
2792
+ module.exports.__wbg_writevalue_7d36c3a0011f6888 = function(arg0, arg1, arg2) {
2793
2793
  let deferred0_0;
2794
2794
  let deferred0_1;
2795
2795
  try {
@@ -2801,7 +2801,7 @@ module.exports.__wbg_writevalue_a37456c36a13f7c1 = function(arg0, arg1, arg2) {
2801
2801
  }
2802
2802
  };
2803
2803
 
2804
- module.exports.__wbg_appendvalue_5e41b908bebdda6f = function(arg0, arg1, arg2) {
2804
+ module.exports.__wbg_appendvalue_9c7e734a5893fc55 = function(arg0, arg1, arg2) {
2805
2805
  let deferred0_0;
2806
2806
  let deferred0_1;
2807
2807
  try {
@@ -2813,7 +2813,7 @@ module.exports.__wbg_appendvalue_5e41b908bebdda6f = function(arg0, arg1, arg2) {
2813
2813
  }
2814
2814
  };
2815
2815
 
2816
- module.exports.__wbg_removevalue_942827cd11acedcd = function() { return handleError(function (arg0, arg1) {
2816
+ module.exports.__wbg_removevalue_227bcc904f295bd0 = function() { return handleError(function (arg0, arg1) {
2817
2817
  let deferred0_0;
2818
2818
  let deferred0_1;
2819
2819
  try {
@@ -2826,11 +2826,11 @@ module.exports.__wbg_removevalue_942827cd11acedcd = function() { return handleEr
2826
2826
  }
2827
2827
  }, arguments) };
2828
2828
 
2829
- module.exports.__wbg_sendmessage_586a19ec4082b8fb = function(arg0, arg1) {
2829
+ module.exports.__wbg_sendmessage_cd344e9a3340f289 = function(arg0, arg1) {
2830
2830
  MsgHandler.send_message(takeObject(arg0), getObject(arg1));
2831
2831
  };
2832
2832
 
2833
- module.exports.__wbg_connecttopeer_da5cf59d8cfa1695 = function() { return handleError(function (arg0, arg1, arg2) {
2833
+ module.exports.__wbg_connecttopeer_16e7986091989ecf = function() { return handleError(function (arg0, arg1, arg2) {
2834
2834
  let deferred0_0;
2835
2835
  let deferred0_1;
2836
2836
  try {
@@ -2843,14 +2843,14 @@ module.exports.__wbg_connecttopeer_da5cf59d8cfa1695 = function() { return handle
2843
2843
  }
2844
2844
  }, arguments) };
2845
2845
 
2846
- module.exports.__wbg_getmyservices_4cd3d2838160a2e4 = function() {
2846
+ module.exports.__wbg_getmyservices_b806cf3d9852d311 = function() {
2847
2847
  const ret = MsgHandler.get_my_services();
2848
2848
  _assertClass(ret, WasmPeerServiceList);
2849
2849
  var ptr1 = ret.__destroy_into_raw();
2850
2850
  return ptr1;
2851
2851
  };
2852
2852
 
2853
- module.exports.__wbg_isexistingfile_dfbccf2cbef6e84d = function() { return handleError(function (arg0, arg1) {
2853
+ module.exports.__wbg_isexistingfile_c062164dc13b389d = function() { return handleError(function (arg0, arg1) {
2854
2854
  let deferred0_0;
2855
2855
  let deferred0_1;
2856
2856
  try {
@@ -2863,33 +2863,33 @@ module.exports.__wbg_isexistingfile_dfbccf2cbef6e84d = function() { return handl
2863
2863
  }
2864
2864
  }, arguments) };
2865
2865
 
2866
- module.exports.__wbg_processapicall_acd7d33fd42c3d1f = function(arg0, arg1, arg2) {
2866
+ module.exports.__wbg_processapicall_c2228580d601f805 = function(arg0, arg1, arg2) {
2867
2867
  MsgHandler.process_api_call(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2868
2868
  };
2869
2869
 
2870
- module.exports.__wbg_processapierror_ab72949eda06b691 = function(arg0, arg1, arg2) {
2870
+ module.exports.__wbg_processapierror_0cb5fae74370713b = function(arg0, arg1, arg2) {
2871
2871
  MsgHandler.process_api_error(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2872
2872
  };
2873
2873
 
2874
- module.exports.__wbg_processapisuccess_961e9892246de79c = function(arg0, arg1, arg2) {
2874
+ module.exports.__wbg_processapisuccess_20585df4ae6a3084 = function(arg0, arg1, arg2) {
2875
2875
  MsgHandler.process_api_success(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2876
2876
  };
2877
2877
 
2878
- module.exports.__wbg_sendmessagetoall_11e5fcfef1b07a13 = function(arg0, arg1) {
2878
+ module.exports.__wbg_sendmessagetoall_8d207c0a3aad8a72 = function(arg0, arg1) {
2879
2879
  MsgHandler.send_message_to_all(getObject(arg0), getObject(arg1));
2880
2880
  };
2881
2881
 
2882
- module.exports.__wbg_disconnectfrompeer_5c175d44122eb2c6 = function() { return handleError(function (arg0) {
2882
+ module.exports.__wbg_disconnectfrompeer_038b8dc66715b3af = function() { return handleError(function (arg0) {
2883
2883
  const ret = MsgHandler.disconnect_from_peer(takeObject(arg0));
2884
2884
  return addHeapObject(ret);
2885
2885
  }, arguments) };
2886
2886
 
2887
- module.exports.__wbg_loadblockfilelist_b7839cc4defb38f4 = function() { return handleError(function () {
2887
+ module.exports.__wbg_loadblockfilelist_ddddc432935846b1 = function() { return handleError(function () {
2888
2888
  const ret = MsgHandler.load_block_file_list();
2889
2889
  return addHeapObject(ret);
2890
2890
  }, arguments) };
2891
2891
 
2892
- module.exports.__wbg_sendinterfaceevent_a6e7d41837b235e5 = function(arg0, arg1, arg2, arg3, arg4) {
2892
+ module.exports.__wbg_sendinterfaceevent_b3ac2596012c70b8 = function(arg0, arg1, arg2, arg3, arg4) {
2893
2893
  let deferred0_0;
2894
2894
  let deferred0_1;
2895
2895
  let deferred1_0;
@@ -2906,7 +2906,7 @@ module.exports.__wbg_sendinterfaceevent_a6e7d41837b235e5 = function(arg0, arg1,
2906
2906
  }
2907
2907
  };
2908
2908
 
2909
- module.exports.__wbg_sendblocksuccess_3b8aec2ff636f96a = function(arg0, arg1, arg2) {
2909
+ module.exports.__wbg_sendblocksuccess_aa77d9dead690b65 = function(arg0, arg1, arg2) {
2910
2910
  let deferred0_0;
2911
2911
  let deferred0_1;
2912
2912
  try {
@@ -2918,11 +2918,11 @@ module.exports.__wbg_sendblocksuccess_3b8aec2ff636f96a = function(arg0, arg1, ar
2918
2918
  }
2919
2919
  };
2920
2920
 
2921
- module.exports.__wbg_sendwalletupdate_7adec123401b1a23 = function() {
2921
+ module.exports.__wbg_sendwalletupdate_35c6568561a24666 = function() {
2922
2922
  MsgHandler.send_wallet_update();
2923
2923
  };
2924
2924
 
2925
- module.exports.__wbg_sendnewversionalert_a07a565734d2fc1d = function(arg0, arg1, arg2) {
2925
+ module.exports.__wbg_sendnewversionalert_0046b47daaccee8c = function(arg0, arg1, arg2) {
2926
2926
  let deferred0_0;
2927
2927
  let deferred0_1;
2928
2928
  try {
@@ -2934,15 +2934,15 @@ module.exports.__wbg_sendnewversionalert_a07a565734d2fc1d = function(arg0, arg1,
2934
2934
  }
2935
2935
  };
2936
2936
 
2937
- module.exports.__wbg_sendblockfetchstatusevent_1d40c9cc7dd2eab0 = function(arg0) {
2937
+ module.exports.__wbg_sendblockfetchstatusevent_ba790c923d8851df = function(arg0) {
2938
2938
  MsgHandler.send_block_fetch_status_event(BigInt.asUintN(64, arg0));
2939
2939
  };
2940
2940
 
2941
- module.exports.__wbg_sendnewchaindetectedevent_32e1d671ab68b024 = function() {
2941
+ module.exports.__wbg_sendnewchaindetectedevent_ba661f60b624e9c7 = function() {
2942
2942
  MsgHandler.send_new_chain_detected_event();
2943
2943
  };
2944
2944
 
2945
- module.exports.__wbg_fetchblockfrompeer_8c4ed4e20aed0348 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2945
+ module.exports.__wbg_fetchblockfrompeer_d143d80f117d06f4 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2946
2946
  let deferred0_0;
2947
2947
  let deferred0_1;
2948
2948
  try {
@@ -2955,7 +2955,7 @@ module.exports.__wbg_fetchblockfrompeer_8c4ed4e20aed0348 = function() { return h
2955
2955
  }
2956
2956
  }, arguments) };
2957
2957
 
2958
- module.exports.__wbg_ensuredirectoryexists_9661b66ed6842ef4 = function() { return handleError(function (arg0, arg1) {
2958
+ module.exports.__wbg_ensuredirectoryexists_617323f95264e9c1 = function() { return handleError(function (arg0, arg1) {
2959
2959
  let deferred0_0;
2960
2960
  let deferred0_1;
2961
2961
  try {