saito-wasm 0.2.167 → 0.2.169

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/pkg/web/index.js CHANGED
@@ -1,7 +1,27 @@
1
- import { MsgHandler } from './snippets/saito-wasm-25d13ca010c26982/js/msg_handler.js';
1
+ import { MsgHandler } from './snippets/saito-wasm-ac621af49b696a83/js/msg_handler.js';
2
2
 
3
3
  let wasm;
4
4
 
5
+ const heap = new Array(128).fill(undefined);
6
+
7
+ heap.push(undefined, null, true, false);
8
+
9
+ function getObject(idx) { return heap[idx]; }
10
+
11
+ let heap_next = heap.length;
12
+
13
+ function dropObject(idx) {
14
+ if (idx < 132) return;
15
+ heap[idx] = heap_next;
16
+ heap_next = idx;
17
+ }
18
+
19
+ function takeObject(idx) {
20
+ const ret = getObject(idx);
21
+ dropObject(idx);
22
+ return ret;
23
+ }
24
+
5
25
  const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
6
26
 
7
27
  if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
@@ -20,12 +40,6 @@ function getStringFromWasm0(ptr, len) {
20
40
  return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
21
41
  }
22
42
 
23
- const heap = new Array(128).fill(undefined);
24
-
25
- heap.push(undefined, null, true, false);
26
-
27
- let heap_next = heap.length;
28
-
29
43
  function addHeapObject(obj) {
30
44
  if (heap_next === heap.length) heap.push(heap.length + 1);
31
45
  const idx = heap_next;
@@ -35,20 +49,6 @@ function addHeapObject(obj) {
35
49
  return idx;
36
50
  }
37
51
 
38
- function getObject(idx) { return heap[idx]; }
39
-
40
- function dropObject(idx) {
41
- if (idx < 132) return;
42
- heap[idx] = heap_next;
43
- heap_next = idx;
44
- }
45
-
46
- function takeObject(idx) {
47
- const ret = getObject(idx);
48
- dropObject(idx);
49
- return ret;
50
- }
51
-
52
52
  let WASM_VECTOR_LEN = 0;
53
53
 
54
54
  const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
@@ -226,84 +226,90 @@ function __wbg_adapter_38(arg0, arg1, arg2) {
226
226
  wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h18f9d53151d93e96(arg0, arg1, addHeapObject(arg2));
227
227
  }
228
228
 
229
- let stack_pointer = 128;
230
-
231
- function addBorrowedObject(obj) {
232
- if (stack_pointer == 1) throw new Error('out of js stack');
233
- heap[--stack_pointer] = obj;
234
- return stack_pointer;
235
- }
236
-
237
229
  function _assertClass(instance, klass) {
238
230
  if (!(instance instanceof klass)) {
239
231
  throw new Error(`expected instance of ${klass.name}`);
240
232
  }
241
233
  return instance.ptr;
242
234
  }
243
-
244
- function handleError(f, args) {
245
- try {
246
- return f.apply(this, args);
247
- } catch (e) {
248
- wasm.__wbindgen_exn_store(addHeapObject(e));
249
- }
235
+ /**
236
+ * @param {Uint8Array} buffer
237
+ * @returns {string}
238
+ */
239
+ export function hash(buffer) {
240
+ const ret = wasm.hash(addHeapObject(buffer));
241
+ return takeObject(ret);
250
242
  }
243
+
251
244
  /**
252
- * @returns {Promise<boolean>}
245
+ * @param {bigint} threshold
246
+ * @returns {Promise<void>}
253
247
  */
254
- export function produce_block_with_gt() {
255
- const ret = wasm.produce_block_with_gt();
248
+ export function write_issuance_file(threshold) {
249
+ const ret = wasm.write_issuance_file(threshold);
256
250
  return takeObject(ret);
257
251
  }
258
252
 
259
253
  /**
260
- * @param {bigint} duration_in_ms
254
+ * @param {bigint} peer_index
261
255
  * @returns {Promise<void>}
262
256
  */
263
- export function process_timer_event(duration_in_ms) {
264
- const ret = wasm.process_timer_event(duration_in_ms);
257
+ export function process_peer_disconnection(peer_index) {
258
+ const ret = wasm.process_peer_disconnection(peer_index);
265
259
  return takeObject(ret);
266
260
  }
267
261
 
268
262
  /**
269
- * @param {Array<any>} public_keys
270
- * @param {BigUint64Array} amounts
263
+ * @returns {Promise<string>}
264
+ */
265
+ export function get_peer_stats() {
266
+ const ret = wasm.get_peer_stats();
267
+ return takeObject(ret);
268
+ }
269
+
270
+ /**
271
+ * @param {bigint} num
272
+ * @param {bigint} deposit
273
+ * @param {Uint8Array} tx_msg
271
274
  * @param {bigint} fee
272
- * @param {boolean} _force_merge
275
+ * @param {string} recipient_public_key
276
+ * @param {string} nft_type
273
277
  * @returns {Promise<WasmTransaction>}
274
278
  */
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);
279
+ export function create_bound_transaction(num, deposit, tx_msg, fee, recipient_public_key, nft_type) {
280
+ const ret = wasm.create_bound_transaction(num, deposit, addHeapObject(tx_msg), fee, addHeapObject(recipient_public_key), addHeapObject(nft_type));
277
281
  return takeObject(ret);
278
282
  }
279
283
 
280
284
  /**
281
- * @returns {Promise<boolean>}
285
+ * @param {WasmTransaction} tx
286
+ * @returns {Promise<void>}
282
287
  */
283
- export function produce_block_without_gt() {
284
- const ret = wasm.produce_block_without_gt();
288
+ export function propagate_transaction(tx) {
289
+ _assertClass(tx, WasmTransaction);
290
+ const ret = wasm.propagate_transaction(tx.__wbg_ptr);
285
291
  return takeObject(ret);
286
292
  }
287
293
 
288
294
  /**
289
- * @param {Uint8Array} buffer
290
- * @param {number} msg_index
291
295
  * @param {bigint} peer_index
296
+ * @param {string} public_key
292
297
  * @returns {Promise<void>}
293
298
  */
294
- export function send_api_success(buffer, msg_index, peer_index) {
295
- const ret = wasm.send_api_success(addHeapObject(buffer), msg_index, peer_index);
299
+ export function process_stun_peer(peer_index, public_key) {
300
+ const ret = wasm.process_stun_peer(peer_index, addHeapObject(public_key));
296
301
  return takeObject(ret);
297
302
  }
298
303
 
299
304
  /**
300
- * @param {number} major
301
- * @param {number} minor
302
- * @param {number} patch
303
- * @returns {Promise<void>}
305
+ * @param {Array<any>} public_keys
306
+ * @param {BigUint64Array} amounts
307
+ * @param {bigint} fee
308
+ * @param {boolean} _force_merge
309
+ * @returns {Promise<WasmTransaction>}
304
310
  */
305
- export function set_wallet_version(major, minor, patch) {
306
- const ret = wasm.set_wallet_version(major, minor, patch);
311
+ export function create_transaction_with_multiple_payments(public_keys, amounts, fee, _force_merge) {
312
+ const ret = wasm.create_transaction_with_multiple_payments(addHeapObject(public_keys), addHeapObject(amounts), fee, _force_merge);
307
313
  return takeObject(ret);
308
314
  }
309
315
 
@@ -318,15 +324,6 @@ export function process_failed_block_fetch(hash, block_id, peer_index) {
318
324
  return takeObject(ret);
319
325
  }
320
326
 
321
- /**
322
- * @param {string} block_hash
323
- * @returns {Promise<WasmBlock>}
324
- */
325
- export function get_block(block_hash) {
326
- const ret = wasm.get_block(addHeapObject(block_hash));
327
- return takeObject(ret);
328
- }
329
-
330
327
  /**
331
328
  * @param {string} private_key
332
329
  * @returns {string}
@@ -348,123 +345,118 @@ export function generate_public_key(private_key) {
348
345
  }
349
346
 
350
347
  /**
351
- * @returns {Promise<Array<any>>}
352
- */
353
- export function get_nft_list() {
354
- const ret = wasm.get_nft_list();
355
- return takeObject(ret);
356
- }
357
-
358
- /**
359
- * @param {Uint8Array} buffer
360
- * @param {string} signature
361
- * @param {string} public_key
348
+ * @param {string} key
362
349
  * @returns {boolean}
363
350
  */
364
- export function verify_signature(buffer, signature, public_key) {
365
- const ret = wasm.verify_signature(addHeapObject(buffer), addHeapObject(signature), addHeapObject(public_key));
351
+ export function is_valid_public_key(key) {
352
+ const ret = wasm.is_valid_public_key(addHeapObject(key));
366
353
  return ret !== 0;
367
354
  }
368
355
 
369
356
  /**
370
- * @returns {Promise<string>}
357
+ * @returns {Promise<Array<any>>}
371
358
  */
372
- export function get_stats() {
373
- const ret = wasm.get_stats();
359
+ export function get_nft_list() {
360
+ const ret = wasm.get_nft_list();
374
361
  return takeObject(ret);
375
362
  }
376
363
 
377
364
  /**
378
- * @returns {Promise<any>}
365
+ * @returns {Promise<WasmBlockchain>}
379
366
  */
380
- export function get_confirmations() {
381
- const ret = wasm.get_confirmations();
367
+ export function get_blockchain() {
368
+ const ret = wasm.get_blockchain();
382
369
  return takeObject(ret);
383
370
  }
384
371
 
385
372
  /**
386
- * @returns {Promise<string>}
373
+ * @param {Uint8Array} buffer
374
+ * @param {number} msg_index
375
+ * @param {bigint} peer_index
376
+ * @returns {Promise<void>}
387
377
  */
388
- export function get_latest_block_hash() {
389
- const ret = wasm.get_latest_block_hash();
378
+ export function send_api_call(buffer, msg_index, peer_index) {
379
+ const ret = wasm.send_api_call(addHeapObject(buffer), msg_index, peer_index);
390
380
  return takeObject(ret);
391
381
  }
392
382
 
393
383
  /**
394
- * @param {Uint8Array} buffer
395
- * @returns {string}
384
+ * @param {bigint} peer_index
385
+ * @returns {Promise<void>}
396
386
  */
397
- export function hash(buffer) {
398
- const ret = wasm.hash(addHeapObject(buffer));
387
+ export function remove_stun_peer(peer_index) {
388
+ const ret = wasm.remove_stun_peer(peer_index);
399
389
  return takeObject(ret);
400
390
  }
401
391
 
402
392
  /**
403
- * @returns {Promise<string>}
393
+ * @param {bigint} duration_in_ms
394
+ * @returns {Promise<void>}
404
395
  */
405
- export function get_peer_stats() {
406
- const ret = wasm.get_peer_stats();
396
+ export function process_timer_event(duration_in_ms) {
397
+ const ret = wasm.process_timer_event(duration_in_ms);
407
398
  return takeObject(ret);
408
399
  }
409
400
 
410
401
  /**
411
402
  * @param {bigint} peer_index
412
- * @param {string} public_key
403
+ * @param {string} ip
413
404
  * @returns {Promise<void>}
414
405
  */
415
- export function process_stun_peer(peer_index, public_key) {
416
- const ret = wasm.process_stun_peer(peer_index, addHeapObject(public_key));
406
+ export function process_new_peer(peer_index, ip) {
407
+ const ret = wasm.process_new_peer(peer_index, addHeapObject(ip));
417
408
  return takeObject(ret);
418
409
  }
419
410
 
420
411
  /**
421
- * @returns {Promise<WasmWallet>}
412
+ * @param {WasmBalanceSnapshot} snapshot
413
+ * @returns {Promise<void>}
422
414
  */
423
- export function get_wallet() {
424
- const ret = wasm.get_wallet();
415
+ export function update_from_balance_snapshot(snapshot) {
416
+ _assertClass(snapshot, WasmBalanceSnapshot);
417
+ var ptr0 = snapshot.__destroy_into_raw();
418
+ const ret = wasm.update_from_balance_snapshot(ptr0);
425
419
  return takeObject(ret);
426
420
  }
427
421
 
428
422
  /**
429
- * @param {Uint8Array} buffer
430
- * @param {bigint} peer_index
431
- * @returns {Promise<void>}
423
+ * @param {Array<any>} keys
424
+ * @returns {Promise<WasmBalanceSnapshot>}
432
425
  */
433
- export function process_msg_buffer_from_peer(buffer, peer_index) {
434
- const ret = wasm.process_msg_buffer_from_peer(addHeapObject(buffer), peer_index);
426
+ export function get_balance_snapshot(keys) {
427
+ const ret = wasm.get_balance_snapshot(addHeapObject(keys));
435
428
  return takeObject(ret);
436
429
  }
437
430
 
438
431
  /**
439
- * @returns {Promise<bigint>}
432
+ * @returns {Promise<string>}
440
433
  */
441
- export function get_next_peer_index() {
442
- const ret = wasm.get_next_peer_index();
434
+ export function get_stats() {
435
+ const ret = wasm.get_stats();
443
436
  return takeObject(ret);
444
437
  }
445
438
 
446
439
  /**
447
440
  * @returns {Promise<Array<any>>}
448
441
  */
449
- export function get_peers() {
450
- const ret = wasm.get_peers();
442
+ export function get_mempool_txs() {
443
+ const ret = wasm.get_mempool_txs();
451
444
  return takeObject(ret);
452
445
  }
453
446
 
454
447
  /**
455
- * @returns {Promise<WasmBlockchain>}
448
+ * @returns {Promise<any>}
456
449
  */
457
- export function get_blockchain() {
458
- const ret = wasm.get_blockchain();
450
+ export function get_confirmations() {
451
+ const ret = wasm.get_confirmations();
459
452
  return takeObject(ret);
460
453
  }
461
454
 
462
455
  /**
463
- * @param {bigint} threshold
464
- * @returns {Promise<void>}
456
+ * @returns {string}
465
457
  */
466
- export function write_issuance_file(threshold) {
467
- const ret = wasm.write_issuance_file(threshold);
458
+ export function generate_private_key() {
459
+ const ret = wasm.generate_private_key();
468
460
  return takeObject(ret);
469
461
  }
470
462
 
@@ -480,81 +472,81 @@ export function send_api_error(buffer, msg_index, peer_index) {
480
472
  }
481
473
 
482
474
  /**
483
- * @param {string} nft_id_hex
484
- * @param {Uint8Array} tx_msg
485
- * @returns {Promise<WasmTransaction>}
475
+ * @param {bigint} peer_index
476
+ * @returns {Promise<WasmPeer | undefined>}
486
477
  */
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));
478
+ export function get_peer(peer_index) {
479
+ const ret = wasm.get_peer(peer_index);
491
480
  return takeObject(ret);
492
481
  }
493
482
 
494
483
  /**
495
- * @returns {string}
484
+ * @returns {Promise<void>}
496
485
  */
497
- export function generate_private_key() {
498
- const ret = wasm.generate_private_key();
486
+ export function start_from_received_ghost_chain() {
487
+ const ret = wasm.start_from_received_ghost_chain();
499
488
  return takeObject(ret);
500
489
  }
501
490
 
502
491
  /**
503
- * @param {bigint} peer_index
504
492
  * @returns {Promise<void>}
505
493
  */
506
- export function remove_stun_peer(peer_index) {
507
- const ret = wasm.remove_stun_peer(peer_index);
494
+ export function disable_producing_blocks_by_timer() {
495
+ const ret = wasm.disable_producing_blocks_by_timer();
508
496
  return takeObject(ret);
509
497
  }
510
498
 
511
499
  /**
512
- * @param {WasmBalanceSnapshot} snapshot
513
- * @returns {Promise<void>}
500
+ * @param {string} nft_id_hex
501
+ * @param {Uint8Array} tx_msg
502
+ * @returns {Promise<WasmTransaction>}
514
503
  */
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);
504
+ export function create_merge_bound_transaction(nft_id_hex, tx_msg) {
505
+ const ptr0 = passStringToWasm0(nft_id_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
506
+ const len0 = WASM_VECTOR_LEN;
507
+ const ret = wasm.create_merge_bound_transaction(ptr0, len0, addHeapObject(tx_msg));
519
508
  return takeObject(ret);
520
509
  }
521
510
 
522
511
  /**
523
- * @returns {Promise<string>}
512
+ * @param {string} config_json
513
+ * @param {string} private_key
514
+ * @param {number} log_level_num
515
+ * @param {bigint} hasten_multiplier
516
+ * @param {boolean} delete_old_blocks
517
+ * @returns {Promise<any>}
524
518
  */
525
- export function get_congestion_stats() {
526
- const ret = wasm.get_congestion_stats();
519
+ export function initialize(config_json, private_key, log_level_num, hasten_multiplier, delete_old_blocks) {
520
+ const ret = wasm.initialize(addHeapObject(config_json), addHeapObject(private_key), log_level_num, hasten_multiplier, delete_old_blocks);
527
521
  return takeObject(ret);
528
522
  }
529
523
 
530
524
  /**
531
525
  * @param {Uint8Array} buffer
532
- * @param {Uint8Array} hash
533
- * @param {bigint} block_id
534
- * @param {bigint} peer_index
535
- * @returns {Promise<void>}
526
+ * @param {string} signature
527
+ * @param {string} public_key
528
+ * @returns {boolean}
536
529
  */
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);
539
- return takeObject(ret);
530
+ export function verify_signature(buffer, signature, public_key) {
531
+ const ret = wasm.verify_signature(addHeapObject(buffer), addHeapObject(signature), addHeapObject(public_key));
532
+ return ret !== 0;
540
533
  }
541
534
 
542
535
  /**
543
- * @param {string} slip1_utxo_key
544
- * @param {string} slip2_utxo_key
545
- * @param {string} slip3_utxo_key
546
- * @returns {Promise<WasmTransaction>}
536
+ * @param {string} public_key
537
+ * @returns {Promise<Array<any>>}
547
538
  */
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));
539
+ export function get_account_slips(public_key) {
540
+ const ret = wasm.get_account_slips(addHeapObject(public_key));
550
541
  return takeObject(ret);
551
542
  }
552
543
 
553
544
  /**
554
- * @returns {Promise<void>}
545
+ * @param {string} block_hash
546
+ * @returns {Promise<WasmBlock>}
555
547
  */
556
- export function disable_producing_blocks_by_timer() {
557
- const ret = wasm.disable_producing_blocks_by_timer();
548
+ export function get_block(block_hash) {
549
+ const ret = wasm.get_block(addHeapObject(block_hash));
558
550
  return takeObject(ret);
559
551
  }
560
552
 
@@ -571,182 +563,189 @@ export function create_transaction(public_key, amount, fee, force_merge) {
571
563
  }
572
564
 
573
565
  /**
574
- * @returns {Promise<Array<any>>}
566
+ * @param {Uint8Array} buffer
567
+ * @param {string} private_key
568
+ * @returns {string}
575
569
  */
576
- export function get_mempool_txs() {
577
- const ret = wasm.get_mempool_txs();
570
+ export function sign_buffer(buffer, private_key) {
571
+ try {
572
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
573
+ wasm.sign_buffer(retptr, addHeapObject(buffer), addHeapObject(private_key));
574
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
575
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
576
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
577
+ if (r2) {
578
+ throw takeObject(r1);
579
+ }
580
+ return takeObject(r0);
581
+ } finally {
582
+ wasm.__wbindgen_add_to_stack_pointer(16);
583
+ }
584
+ }
585
+
586
+ /**
587
+ * @param {bigint} current_time
588
+ * @returns {Promise<void>}
589
+ */
590
+ export function process_stat_interval(current_time) {
591
+ const ret = wasm.process_stat_interval(current_time);
592
+ return takeObject(ret);
593
+ }
594
+
595
+ /**
596
+ * @returns {Promise<WasmWallet>}
597
+ */
598
+ export function get_wallet() {
599
+ const ret = wasm.get_wallet();
578
600
  return takeObject(ret);
579
601
  }
580
602
 
581
603
  /**
604
+ * @param {Uint8Array} buffer
605
+ * @param {bigint} peer_index
582
606
  * @returns {Promise<void>}
583
607
  */
584
- export function start_from_received_ghost_chain() {
585
- const ret = wasm.start_from_received_ghost_chain();
608
+ export function process_msg_buffer_from_peer(buffer, peer_index) {
609
+ const ret = wasm.process_msg_buffer_from_peer(addHeapObject(buffer), peer_index);
586
610
  return takeObject(ret);
587
611
  }
588
612
 
589
613
  /**
614
+ * @param {Uint8Array} buffer
615
+ * @param {number} msg_index
590
616
  * @param {bigint} peer_index
591
- * @returns {Promise<WasmPeer | undefined>}
617
+ * @returns {Promise<void>}
592
618
  */
593
- export function get_peer(peer_index) {
594
- const ret = wasm.get_peer(peer_index);
619
+ export function send_api_success(buffer, msg_index, peer_index) {
620
+ const ret = wasm.send_api_success(addHeapObject(buffer), msg_index, peer_index);
595
621
  return takeObject(ret);
596
622
  }
597
623
 
598
624
  /**
599
- * @param {bigint} amt
600
625
  * @param {string} slip1_utxo_key
601
626
  * @param {string} slip2_utxo_key
602
627
  * @param {string} slip3_utxo_key
603
- * @param {string} recipient_public_key
604
- * @param {Uint8Array} tx_msg
605
628
  * @returns {Promise<WasmTransaction>}
606
629
  */
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
+ export function create_remove_bound_transaction(slip1_utxo_key, slip2_utxo_key, slip3_utxo_key) {
631
+ const ret = wasm.create_remove_bound_transaction(addHeapObject(slip1_utxo_key), addHeapObject(slip2_utxo_key), addHeapObject(slip3_utxo_key));
609
632
  return takeObject(ret);
610
633
  }
611
634
 
612
635
  /**
613
- * @param {string} key
614
- * @returns {boolean}
615
- */
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>}
636
+ * @returns {Promise<string>}
624
637
  */
625
- export function get_balance_snapshot(keys) {
626
- const ret = wasm.get_balance_snapshot(addHeapObject(keys));
638
+ export function get_congestion_stats() {
639
+ const ret = wasm.get_congestion_stats();
627
640
  return takeObject(ret);
628
641
  }
629
642
 
630
643
  /**
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>}
644
+ * @returns {Promise<boolean>}
637
645
  */
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);
646
+ export function produce_block_with_gt() {
647
+ const ret = wasm.produce_block_with_gt();
640
648
  return takeObject(ret);
641
649
  }
642
650
 
643
651
  /**
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>}
652
+ * @returns {Promise<Array<any>>}
651
653
  */
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));
654
+ export function get_peers() {
655
+ const ret = wasm.get_peers();
654
656
  return takeObject(ret);
655
657
  }
656
658
 
657
659
  /**
658
- * @param {Uint8Array} buffer
659
- * @param {number} msg_index
660
- * @param {bigint} peer_index
660
+ * @param {number} major
661
+ * @param {number} minor
662
+ * @param {number} patch
661
663
  * @returns {Promise<void>}
662
664
  */
663
- export function send_api_call(buffer, msg_index, peer_index) {
664
- const ret = wasm.send_api_call(addHeapObject(buffer), msg_index, peer_index);
665
+ export function set_wallet_version(major, minor, patch) {
666
+ const ret = wasm.set_wallet_version(major, minor, patch);
665
667
  return takeObject(ret);
666
668
  }
667
669
 
668
670
  /**
669
- * @param {string} public_key
670
- * @returns {Promise<Array<any>>}
671
+ * @returns {Promise<boolean>}
671
672
  */
672
- export function get_account_slips(public_key) {
673
- const ret = wasm.get_account_slips(addHeapObject(public_key));
673
+ export function produce_block_without_gt() {
674
+ const ret = wasm.produce_block_without_gt();
674
675
  return takeObject(ret);
675
676
  }
676
677
 
677
678
  /**
678
- * @param {WasmTransaction} tx
679
- * @returns {Promise<void>}
679
+ * @returns {Promise<string>}
680
680
  */
681
- export function propagate_transaction(tx) {
682
- _assertClass(tx, WasmTransaction);
683
- const ret = wasm.propagate_transaction(tx.__wbg_ptr);
681
+ export function get_latest_block_hash() {
682
+ const ret = wasm.get_latest_block_hash();
684
683
  return takeObject(ret);
685
684
  }
686
685
 
687
686
  /**
687
+ * @param {Uint8Array} buffer
688
+ * @param {Uint8Array} hash
689
+ * @param {bigint} block_id
688
690
  * @param {bigint} peer_index
689
- * @param {string} ip
690
691
  * @returns {Promise<void>}
691
692
  */
692
- export function process_new_peer(peer_index, ip) {
693
- const ret = wasm.process_new_peer(peer_index, addHeapObject(ip));
693
+ export function process_fetched_block(buffer, hash, block_id, peer_index) {
694
+ const ret = wasm.process_fetched_block(addHeapObject(buffer), addHeapObject(hash), block_id, peer_index);
694
695
  return takeObject(ret);
695
696
  }
696
697
 
697
698
  /**
698
- * @param {bigint} current_time
699
- * @returns {Promise<void>}
699
+ * @returns {Promise<bigint>}
700
700
  */
701
- export function process_stat_interval(current_time) {
702
- const ret = wasm.process_stat_interval(current_time);
701
+ export function get_next_peer_index() {
702
+ const ret = wasm.get_next_peer_index();
703
703
  return takeObject(ret);
704
704
  }
705
705
 
706
706
  /**
707
- * @param {bigint} peer_index
708
- * @returns {Promise<void>}
707
+ * @param {string} slip1_utxo_key
708
+ * @param {string} slip2_utxo_key
709
+ * @param {string} slip3_utxo_key
710
+ * @param {number} left_count
711
+ * @param {number} right_count
712
+ * @param {Uint8Array} tx_msg
713
+ * @returns {Promise<WasmTransaction>}
709
714
  */
710
- export function process_peer_disconnection(peer_index) {
711
- const ret = wasm.process_peer_disconnection(peer_index);
715
+ export function create_split_bound_transaction(slip1_utxo_key, slip2_utxo_key, slip3_utxo_key, left_count, right_count, tx_msg) {
716
+ 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));
712
717
  return takeObject(ret);
713
718
  }
714
719
 
715
720
  /**
716
- * @param {bigint} num
717
- * @param {bigint} deposit
718
- * @param {Uint8Array} tx_msg
719
- * @param {bigint} fee
721
+ * @param {bigint} amt
722
+ * @param {string} slip1_utxo_key
723
+ * @param {string} slip2_utxo_key
724
+ * @param {string} slip3_utxo_key
720
725
  * @param {string} recipient_public_key
721
- * @param {string} nft_type
726
+ * @param {Uint8Array} tx_msg
722
727
  * @returns {Promise<WasmTransaction>}
723
728
  */
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));
729
+ export function create_send_bound_transaction(amt, slip1_utxo_key, slip2_utxo_key, slip3_utxo_key, recipient_public_key, tx_msg) {
730
+ 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));
726
731
  return takeObject(ret);
727
732
  }
728
733
 
729
- /**
730
- * @param {Uint8Array} buffer
731
- * @param {string} private_key
732
- * @returns {string}
733
- */
734
- export function sign_buffer(buffer, private_key) {
734
+ function handleError(f, args) {
735
735
  try {
736
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
737
- wasm.sign_buffer(retptr, addHeapObject(buffer), addHeapObject(private_key));
738
- var r0 = getInt32Memory0()[retptr / 4 + 0];
739
- var r1 = getInt32Memory0()[retptr / 4 + 1];
740
- var r2 = getInt32Memory0()[retptr / 4 + 2];
741
- if (r2) {
742
- throw takeObject(r1);
743
- }
744
- return takeObject(r0);
745
- } finally {
746
- wasm.__wbindgen_add_to_stack_pointer(16);
736
+ return f.apply(this, args);
737
+ } catch (e) {
738
+ wasm.__wbindgen_exn_store(addHeapObject(e));
747
739
  }
748
740
  }
749
741
 
742
+ let stack_pointer = 128;
743
+
744
+ function addBorrowedObject(obj) {
745
+ if (stack_pointer == 1) throw new Error('out of js stack');
746
+ heap[--stack_pointer] = obj;
747
+ return stack_pointer;
748
+ }
750
749
  function __wbg_adapter_406(arg0, arg1, arg2, arg3) {
751
750
  wasm.wasm_bindgen__convert__closures__invoke2_mut__h58ba5fc31ee09770(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
752
751
  }
@@ -2669,25 +2668,21 @@ async function __wbg_load(module, imports) {
2669
2668
  function __wbg_get_imports() {
2670
2669
  const imports = {};
2671
2670
  imports.wbg = {};
2672
- imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
2673
- const ret = getStringFromWasm0(arg0, arg1);
2674
- return addHeapObject(ret);
2675
- };
2676
2671
  imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
2677
2672
  takeObject(arg0);
2678
2673
  };
2679
- imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
2680
- const ret = BigInt.asUintN(64, arg0);
2681
- return addHeapObject(ret);
2682
- };
2683
- imports.wbg.__wbg_wasmblock_new = function(arg0) {
2684
- const ret = WasmBlock.__wrap(arg0);
2674
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
2675
+ const ret = getStringFromWasm0(arg0, arg1);
2685
2676
  return addHeapObject(ret);
2686
2677
  };
2687
2678
  imports.wbg.__wbg_wasmtransaction_new = function(arg0) {
2688
2679
  const ret = WasmTransaction.__wrap(arg0);
2689
2680
  return addHeapObject(ret);
2690
2681
  };
2682
+ imports.wbg.__wbg_wasmnft_new = function(arg0) {
2683
+ const ret = WasmNFT.__wrap(arg0);
2684
+ return addHeapObject(ret);
2685
+ };
2691
2686
  imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
2692
2687
  const obj = getObject(arg1);
2693
2688
  const ret = typeof(obj) === 'string' ? obj : undefined;
@@ -2696,36 +2691,40 @@ function __wbg_get_imports() {
2696
2691
  getInt32Memory0()[arg0 / 4 + 1] = len1;
2697
2692
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2698
2693
  };
2699
- imports.wbg.__wbg_wasmslip_new = function(arg0) {
2700
- const ret = WasmSlip.__wrap(arg0);
2701
- return addHeapObject(ret);
2702
- };
2703
- imports.wbg.__wbg_wasmbalancesnapshot_new = function(arg0) {
2704
- const ret = WasmBalanceSnapshot.__wrap(arg0);
2705
- return addHeapObject(ret);
2706
- };
2707
2694
  imports.wbg.__wbg_wasmpeer_new = function(arg0) {
2708
2695
  const ret = WasmPeer.__wrap(arg0);
2709
2696
  return addHeapObject(ret);
2710
2697
  };
2711
- imports.wbg.__wbg_wasmblockchain_new = function(arg0) {
2712
- const ret = WasmBlockchain.__wrap(arg0);
2698
+ imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
2699
+ const ret = BigInt.asUintN(64, arg0);
2713
2700
  return addHeapObject(ret);
2714
2701
  };
2715
2702
  imports.wbg.__wbg_wasmwallet_new = function(arg0) {
2716
2703
  const ret = WasmWallet.__wrap(arg0);
2717
2704
  return addHeapObject(ret);
2718
2705
  };
2706
+ imports.wbg.__wbg_wasmbalancesnapshot_new = function(arg0) {
2707
+ const ret = WasmBalanceSnapshot.__wrap(arg0);
2708
+ return addHeapObject(ret);
2709
+ };
2710
+ imports.wbg.__wbg_wasmwalletslip_new = function(arg0) {
2711
+ const ret = WasmWalletSlip.__wrap(arg0);
2712
+ return addHeapObject(ret);
2713
+ };
2714
+ imports.wbg.__wbg_wasmblock_new = function(arg0) {
2715
+ const ret = WasmBlock.__wrap(arg0);
2716
+ return addHeapObject(ret);
2717
+ };
2719
2718
  imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
2720
2719
  const ret = getObject(arg0);
2721
2720
  return addHeapObject(ret);
2722
2721
  };
2723
- imports.wbg.__wbg_wasmnft_new = function(arg0) {
2724
- const ret = WasmNFT.__wrap(arg0);
2722
+ imports.wbg.__wbg_wasmslip_new = function(arg0) {
2723
+ const ret = WasmSlip.__wrap(arg0);
2725
2724
  return addHeapObject(ret);
2726
2725
  };
2727
- imports.wbg.__wbg_wasmwalletslip_new = function(arg0) {
2728
- const ret = WasmWalletSlip.__wrap(arg0);
2726
+ imports.wbg.__wbg_wasmblockchain_new = function(arg0) {
2727
+ const ret = WasmBlockchain.__wrap(arg0);
2729
2728
  return addHeapObject(ret);
2730
2729
  };
2731
2730
  imports.wbg.__wbg_wasmpeerservice_new = function(arg0) {
@@ -2736,6 +2735,10 @@ function __wbg_get_imports() {
2736
2735
  const ret = WasmHop.__wrap(arg0);
2737
2736
  return addHeapObject(ret);
2738
2737
  };
2738
+ imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
2739
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
2740
+ return addHeapObject(ret);
2741
+ };
2739
2742
  imports.wbg.__wbindgen_is_object = function(arg0) {
2740
2743
  const val = getObject(arg0);
2741
2744
  const ret = typeof(val) === 'object' && val !== null;
@@ -2749,7 +2752,7 @@ function __wbg_get_imports() {
2749
2752
  const ret = getObject(arg0) in getObject(arg1);
2750
2753
  return ret;
2751
2754
  };
2752
- imports.wbg.__wbg_flushdata_2c769b019d5f1e66 = function(arg0, arg1) {
2755
+ imports.wbg.__wbg_flushdata_571e46cce4f70e72 = function(arg0, arg1) {
2753
2756
  let deferred0_0;
2754
2757
  let deferred0_1;
2755
2758
  try {
@@ -2760,7 +2763,7 @@ function __wbg_get_imports() {
2760
2763
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2761
2764
  }
2762
2765
  };
2763
- imports.wbg.__wbg_readvalue_19e0ac3170ed6477 = function() { return handleError(function (arg0, arg1) {
2766
+ imports.wbg.__wbg_readvalue_0023aabd3b029c28 = function() { return handleError(function (arg0, arg1) {
2764
2767
  let deferred0_0;
2765
2768
  let deferred0_1;
2766
2769
  try {
@@ -2772,13 +2775,13 @@ function __wbg_get_imports() {
2772
2775
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2773
2776
  }
2774
2777
  }, arguments) };
2775
- imports.wbg.__wbg_loadwallet_9ad824e287b4d1e9 = function() {
2778
+ imports.wbg.__wbg_loadwallet_c7d36edfd9b3141c = function() {
2776
2779
  MsgHandler.load_wallet();
2777
2780
  };
2778
- imports.wbg.__wbg_savewallet_c607f3a3206411cf = function() {
2781
+ imports.wbg.__wbg_savewallet_7f660732fea84939 = function() {
2779
2782
  MsgHandler.save_wallet();
2780
2783
  };
2781
- imports.wbg.__wbg_writevalue_2f493d22dc09e6f5 = function(arg0, arg1, arg2) {
2784
+ imports.wbg.__wbg_writevalue_a37456c36a13f7c1 = function(arg0, arg1, arg2) {
2782
2785
  let deferred0_0;
2783
2786
  let deferred0_1;
2784
2787
  try {
@@ -2789,7 +2792,7 @@ function __wbg_get_imports() {
2789
2792
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2790
2793
  }
2791
2794
  };
2792
- imports.wbg.__wbg_appendvalue_720c0ca8080d6eac = function(arg0, arg1, arg2) {
2795
+ imports.wbg.__wbg_appendvalue_5e41b908bebdda6f = function(arg0, arg1, arg2) {
2793
2796
  let deferred0_0;
2794
2797
  let deferred0_1;
2795
2798
  try {
@@ -2800,7 +2803,7 @@ function __wbg_get_imports() {
2800
2803
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2801
2804
  }
2802
2805
  };
2803
- imports.wbg.__wbg_removevalue_215faba975f5b863 = function() { return handleError(function (arg0, arg1) {
2806
+ imports.wbg.__wbg_removevalue_942827cd11acedcd = function() { return handleError(function (arg0, arg1) {
2804
2807
  let deferred0_0;
2805
2808
  let deferred0_1;
2806
2809
  try {
@@ -2812,10 +2815,10 @@ function __wbg_get_imports() {
2812
2815
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2813
2816
  }
2814
2817
  }, arguments) };
2815
- imports.wbg.__wbg_sendmessage_bd6888af7ee69749 = function(arg0, arg1) {
2818
+ imports.wbg.__wbg_sendmessage_586a19ec4082b8fb = function(arg0, arg1) {
2816
2819
  MsgHandler.send_message(takeObject(arg0), getObject(arg1));
2817
2820
  };
2818
- imports.wbg.__wbg_connecttopeer_6940934591bed84e = function() { return handleError(function (arg0, arg1, arg2) {
2821
+ imports.wbg.__wbg_connecttopeer_da5cf59d8cfa1695 = function() { return handleError(function (arg0, arg1, arg2) {
2819
2822
  let deferred0_0;
2820
2823
  let deferred0_1;
2821
2824
  try {
@@ -2827,13 +2830,13 @@ function __wbg_get_imports() {
2827
2830
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2828
2831
  }
2829
2832
  }, arguments) };
2830
- imports.wbg.__wbg_getmyservices_ba97efc7dbbb3da2 = function() {
2833
+ imports.wbg.__wbg_getmyservices_4cd3d2838160a2e4 = function() {
2831
2834
  const ret = MsgHandler.get_my_services();
2832
2835
  _assertClass(ret, WasmPeerServiceList);
2833
2836
  var ptr1 = ret.__destroy_into_raw();
2834
2837
  return ptr1;
2835
2838
  };
2836
- imports.wbg.__wbg_isexistingfile_7f4f0c51bececaa6 = function() { return handleError(function (arg0, arg1) {
2839
+ imports.wbg.__wbg_isexistingfile_dfbccf2cbef6e84d = function() { return handleError(function (arg0, arg1) {
2837
2840
  let deferred0_0;
2838
2841
  let deferred0_1;
2839
2842
  try {
@@ -2845,27 +2848,27 @@ function __wbg_get_imports() {
2845
2848
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2846
2849
  }
2847
2850
  }, arguments) };
2848
- imports.wbg.__wbg_processapicall_9af56479d30d7f49 = function(arg0, arg1, arg2) {
2851
+ imports.wbg.__wbg_processapicall_acd7d33fd42c3d1f = function(arg0, arg1, arg2) {
2849
2852
  MsgHandler.process_api_call(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2850
2853
  };
2851
- imports.wbg.__wbg_processapierror_1405fddcb5daf450 = function(arg0, arg1, arg2) {
2854
+ imports.wbg.__wbg_processapierror_ab72949eda06b691 = function(arg0, arg1, arg2) {
2852
2855
  MsgHandler.process_api_error(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2853
2856
  };
2854
- imports.wbg.__wbg_processapisuccess_8690e76bad65861c = function(arg0, arg1, arg2) {
2857
+ imports.wbg.__wbg_processapisuccess_961e9892246de79c = function(arg0, arg1, arg2) {
2855
2858
  MsgHandler.process_api_success(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2856
2859
  };
2857
- imports.wbg.__wbg_sendmessagetoall_7d5345f9160e8d4c = function(arg0, arg1) {
2860
+ imports.wbg.__wbg_sendmessagetoall_11e5fcfef1b07a13 = function(arg0, arg1) {
2858
2861
  MsgHandler.send_message_to_all(getObject(arg0), getObject(arg1));
2859
2862
  };
2860
- imports.wbg.__wbg_disconnectfrompeer_86615bc01515789c = function() { return handleError(function (arg0) {
2863
+ imports.wbg.__wbg_disconnectfrompeer_5c175d44122eb2c6 = function() { return handleError(function (arg0) {
2861
2864
  const ret = MsgHandler.disconnect_from_peer(takeObject(arg0));
2862
2865
  return addHeapObject(ret);
2863
2866
  }, arguments) };
2864
- imports.wbg.__wbg_loadblockfilelist_39475ff4bda56def = function() { return handleError(function () {
2867
+ imports.wbg.__wbg_loadblockfilelist_b7839cc4defb38f4 = function() { return handleError(function () {
2865
2868
  const ret = MsgHandler.load_block_file_list();
2866
2869
  return addHeapObject(ret);
2867
2870
  }, arguments) };
2868
- imports.wbg.__wbg_sendinterfaceevent_9c79439340b79f8e = function(arg0, arg1, arg2, arg3, arg4) {
2871
+ imports.wbg.__wbg_sendinterfaceevent_a6e7d41837b235e5 = function(arg0, arg1, arg2, arg3, arg4) {
2869
2872
  let deferred0_0;
2870
2873
  let deferred0_1;
2871
2874
  let deferred1_0;
@@ -2881,7 +2884,7 @@ function __wbg_get_imports() {
2881
2884
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2882
2885
  }
2883
2886
  };
2884
- imports.wbg.__wbg_sendblocksuccess_1c721c4150775963 = function(arg0, arg1, arg2) {
2887
+ imports.wbg.__wbg_sendblocksuccess_3b8aec2ff636f96a = function(arg0, arg1, arg2) {
2885
2888
  let deferred0_0;
2886
2889
  let deferred0_1;
2887
2890
  try {
@@ -2892,10 +2895,10 @@ function __wbg_get_imports() {
2892
2895
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2893
2896
  }
2894
2897
  };
2895
- imports.wbg.__wbg_sendwalletupdate_ddb4fb9d9766e284 = function() {
2898
+ imports.wbg.__wbg_sendwalletupdate_7adec123401b1a23 = function() {
2896
2899
  MsgHandler.send_wallet_update();
2897
2900
  };
2898
- imports.wbg.__wbg_sendnewversionalert_fa5e1d7df7e1161b = function(arg0, arg1, arg2) {
2901
+ imports.wbg.__wbg_sendnewversionalert_a07a565734d2fc1d = function(arg0, arg1, arg2) {
2899
2902
  let deferred0_0;
2900
2903
  let deferred0_1;
2901
2904
  try {
@@ -2906,13 +2909,13 @@ function __wbg_get_imports() {
2906
2909
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2907
2910
  }
2908
2911
  };
2909
- imports.wbg.__wbg_sendblockfetchstatusevent_3f27984e18d29a1c = function(arg0) {
2912
+ imports.wbg.__wbg_sendblockfetchstatusevent_1d40c9cc7dd2eab0 = function(arg0) {
2910
2913
  MsgHandler.send_block_fetch_status_event(BigInt.asUintN(64, arg0));
2911
2914
  };
2912
- imports.wbg.__wbg_sendnewchaindetectedevent_8e502ee05519582d = function() {
2915
+ imports.wbg.__wbg_sendnewchaindetectedevent_32e1d671ab68b024 = function() {
2913
2916
  MsgHandler.send_new_chain_detected_event();
2914
2917
  };
2915
- imports.wbg.__wbg_fetchblockfrompeer_d09e3f0752b33dd5 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2918
+ imports.wbg.__wbg_fetchblockfrompeer_8c4ed4e20aed0348 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2916
2919
  let deferred0_0;
2917
2920
  let deferred0_1;
2918
2921
  try {
@@ -2924,21 +2927,17 @@ function __wbg_get_imports() {
2924
2927
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2925
2928
  }
2926
2929
  }, arguments) };
2927
- imports.wbg.__wbg_ensureblockdirectoryexists_23741132d74452f6 = function() { return handleError(function (arg0, arg1) {
2930
+ imports.wbg.__wbg_ensuredirectoryexists_9661b66ed6842ef4 = function() { return handleError(function (arg0, arg1) {
2928
2931
  let deferred0_0;
2929
2932
  let deferred0_1;
2930
2933
  try {
2931
2934
  deferred0_0 = arg0;
2932
2935
  deferred0_1 = arg1;
2933
- MsgHandler.ensure_block_directory_exists(getStringFromWasm0(arg0, arg1));
2936
+ MsgHandler.ensure_directory_exists(getStringFromWasm0(arg0, arg1));
2934
2937
  } finally {
2935
2938
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2936
2939
  }
2937
2940
  }, arguments) };
2938
- imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
2939
- const ret = new Error(getStringFromWasm0(arg0, arg1));
2940
- return addHeapObject(ret);
2941
- };
2942
2941
  imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
2943
2942
  const ret = getObject(arg0) == getObject(arg1);
2944
2943
  return ret;
@@ -3247,8 +3246,8 @@ function __wbg_get_imports() {
3247
3246
  getInt32Memory0()[arg0 / 4 + 1] = len1;
3248
3247
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
3249
3248
  };
3250
- imports.wbg.__wbindgen_closure_wrapper1628 = function(arg0, arg1, arg2) {
3251
- const ret = makeMutClosure(arg0, arg1, 581, __wbg_adapter_38);
3249
+ imports.wbg.__wbindgen_closure_wrapper1554 = function(arg0, arg1, arg2) {
3250
+ const ret = makeMutClosure(arg0, arg1, 572, __wbg_adapter_38);
3252
3251
  return addHeapObject(ret);
3253
3252
  };
3254
3253