saito-wasm 0.2.178 → 0.2.180

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-aa917f543b5208b0/js/msg_handler.js`);
4
+ const { MsgHandler } = require(String.raw`./snippets/saito-wasm-572c1aae3abbfe8d/js/msg_handler.js`);
5
5
  const { TextDecoder, TextEncoder } = require(`util`);
6
6
 
7
7
  const heap = new Array(128).fill(undefined);
@@ -24,6 +24,15 @@ function takeObject(idx) {
24
24
  return ret;
25
25
  }
26
26
 
27
+ function addHeapObject(obj) {
28
+ if (heap_next === heap.length) heap.push(heap.length + 1);
29
+ const idx = heap_next;
30
+ heap_next = heap[idx];
31
+
32
+ heap[idx] = obj;
33
+ return idx;
34
+ }
35
+
27
36
  let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
28
37
 
29
38
  cachedTextDecoder.decode();
@@ -42,15 +51,6 @@ function getStringFromWasm0(ptr, len) {
42
51
  return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
43
52
  }
44
53
 
45
- function addHeapObject(obj) {
46
- if (heap_next === heap.length) heap.push(heap.length + 1);
47
- const idx = heap_next;
48
- heap_next = heap[idx];
49
-
50
- heap[idx] = obj;
51
- return idx;
52
- }
53
-
54
54
  let WASM_VECTOR_LEN = 0;
55
55
 
56
56
  let cachedTextEncoder = new TextEncoder('utf-8');
@@ -235,226 +235,217 @@ function _assertClass(instance, klass) {
235
235
  return instance.ptr;
236
236
  }
237
237
  /**
238
- * @param {bigint} threshold
239
- * @returns {Promise<void>}
238
+ * @param {Uint8Array} buffer
239
+ * @param {string} private_key
240
+ * @returns {string}
240
241
  */
241
- module.exports.write_issuance_file = function(threshold) {
242
- const ret = wasm.write_issuance_file(threshold);
243
- return takeObject(ret);
242
+ module.exports.sign_buffer = function(buffer, private_key) {
243
+ try {
244
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
245
+ wasm.sign_buffer(retptr, addHeapObject(buffer), addHeapObject(private_key));
246
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
247
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
248
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
249
+ if (r2) {
250
+ throw takeObject(r1);
251
+ }
252
+ return takeObject(r0);
253
+ } finally {
254
+ wasm.__wbindgen_add_to_stack_pointer(16);
255
+ }
244
256
  };
245
257
 
246
258
  /**
247
- * @param {bigint} num
248
- * @param {bigint} deposit
249
- * @param {Uint8Array} tx_msg
250
- * @param {bigint} fee
251
- * @param {string} recipient_public_key
252
- * @param {string} nft_type
253
- * @returns {Promise<WasmTransaction>}
259
+ * @param {bigint} peer_index
260
+ * @returns {Promise<WasmPeer | undefined>}
254
261
  */
255
- module.exports.create_bound_transaction = function(num, deposit, tx_msg, fee, recipient_public_key, nft_type) {
256
- const ret = wasm.create_bound_transaction(num, deposit, addHeapObject(tx_msg), fee, addHeapObject(recipient_public_key), addHeapObject(nft_type));
262
+ module.exports.get_peer = function(peer_index) {
263
+ const ret = wasm.get_peer(peer_index);
257
264
  return takeObject(ret);
258
265
  };
259
266
 
260
267
  /**
261
- * @returns {Promise<boolean>}
268
+ * @returns {string}
262
269
  */
263
- module.exports.produce_block_with_gt = function() {
264
- const ret = wasm.produce_block_with_gt();
270
+ module.exports.generate_private_key = function() {
271
+ const ret = wasm.generate_private_key();
265
272
  return takeObject(ret);
266
273
  };
267
274
 
268
275
  /**
269
- * @param {WasmBalanceSnapshot} snapshot
270
- * @returns {Promise<void>}
276
+ * @returns {Promise<string>}
271
277
  */
272
- module.exports.update_from_balance_snapshot = function(snapshot) {
273
- _assertClass(snapshot, WasmBalanceSnapshot);
274
- var ptr0 = snapshot.__destroy_into_raw();
275
- const ret = wasm.update_from_balance_snapshot(ptr0);
278
+ module.exports.get_latest_block_hash = function() {
279
+ const ret = wasm.get_latest_block_hash();
276
280
  return takeObject(ret);
277
281
  };
278
282
 
279
283
  /**
280
- * @returns {Promise<WasmWallet>}
284
+ * @param {string} public_key
285
+ * @returns {Promise<Array<any>>}
281
286
  */
282
- module.exports.get_wallet = function() {
283
- const ret = wasm.get_wallet();
287
+ module.exports.get_account_slips = function(public_key) {
288
+ const ret = wasm.get_account_slips(addHeapObject(public_key));
284
289
  return takeObject(ret);
285
290
  };
286
291
 
287
292
  /**
288
- * @param {Uint8Array} hash
289
- * @param {bigint} block_id
290
- * @param {bigint} peer_index
291
- * @returns {Promise<void>}
293
+ * @param {string} key
294
+ * @returns {boolean}
292
295
  */
293
- module.exports.process_failed_block_fetch = function(hash, block_id, peer_index) {
294
- const ret = wasm.process_failed_block_fetch(addHeapObject(hash), block_id, peer_index);
295
- return takeObject(ret);
296
+ module.exports.is_valid_public_key = function(key) {
297
+ const ret = wasm.is_valid_public_key(addHeapObject(key));
298
+ return ret !== 0;
296
299
  };
297
300
 
298
301
  /**
299
302
  * @param {Uint8Array} buffer
300
- * @param {number} msg_index
301
- * @param {bigint} peer_index
302
- * @returns {Promise<void>}
303
- */
304
- module.exports.send_api_success = function(buffer, msg_index, peer_index) {
305
- const ret = wasm.send_api_success(addHeapObject(buffer), msg_index, peer_index);
306
- return takeObject(ret);
307
- };
308
-
309
- /**
310
- * @param {Array<any>} public_keys
311
- * @param {BigUint64Array} amounts
312
- * @param {bigint} fee
313
- * @param {boolean} _force_merge
314
- * @returns {Promise<WasmTransaction>}
303
+ * @param {string} signature
304
+ * @param {string} public_key
305
+ * @returns {boolean}
315
306
  */
316
- module.exports.create_transaction_with_multiple_payments = function(public_keys, amounts, fee, _force_merge) {
317
- const ret = wasm.create_transaction_with_multiple_payments(addHeapObject(public_keys), addHeapObject(amounts), fee, _force_merge);
318
- return takeObject(ret);
307
+ module.exports.verify_signature = function(buffer, signature, public_key) {
308
+ const ret = wasm.verify_signature(addHeapObject(buffer), addHeapObject(signature), addHeapObject(public_key));
309
+ return ret !== 0;
319
310
  };
320
311
 
321
312
  /**
322
- * @returns {string}
313
+ * @returns {Promise<Array<any>>}
323
314
  */
324
- module.exports.generate_private_key = function() {
325
- const ret = wasm.generate_private_key();
315
+ module.exports.get_mempool_txs = function() {
316
+ const ret = wasm.get_mempool_txs();
326
317
  return takeObject(ret);
327
318
  };
328
319
 
329
320
  /**
330
- * @returns {Promise<string>}
321
+ * @param {Uint8Array} buffer
322
+ * @param {number} msg_index
323
+ * @param {bigint} peer_index
324
+ * @returns {Promise<void>}
331
325
  */
332
- module.exports.get_peer_stats = function() {
333
- const ret = wasm.get_peer_stats();
326
+ module.exports.send_api_error = function(buffer, msg_index, peer_index) {
327
+ const ret = wasm.send_api_error(addHeapObject(buffer), msg_index, peer_index);
334
328
  return takeObject(ret);
335
329
  };
336
330
 
337
331
  /**
338
- * @returns {Promise<void>}
332
+ * @returns {Promise<Array<any>>}
339
333
  */
340
- module.exports.disable_producing_blocks_by_timer = function() {
341
- const ret = wasm.disable_producing_blocks_by_timer();
334
+ module.exports.get_peers = function() {
335
+ const ret = wasm.get_peers();
342
336
  return takeObject(ret);
343
337
  };
344
338
 
345
339
  /**
346
340
  * @param {Uint8Array} buffer
341
+ * @param {Uint8Array} hash
342
+ * @param {bigint} block_id
347
343
  * @param {bigint} peer_index
348
344
  * @returns {Promise<void>}
349
345
  */
350
- module.exports.process_msg_buffer_from_peer = function(buffer, peer_index) {
351
- const ret = wasm.process_msg_buffer_from_peer(addHeapObject(buffer), peer_index);
346
+ module.exports.process_fetched_block = function(buffer, hash, block_id, peer_index) {
347
+ const ret = wasm.process_fetched_block(addHeapObject(buffer), addHeapObject(hash), block_id, peer_index);
352
348
  return takeObject(ret);
353
349
  };
354
350
 
355
351
  /**
356
- * @param {bigint} peer_index
357
- * @returns {Promise<void>}
352
+ * @returns {Promise<string>}
358
353
  */
359
- module.exports.remove_stun_peer = function(peer_index) {
360
- const ret = wasm.remove_stun_peer(peer_index);
354
+ module.exports.get_peer_stats = function() {
355
+ const ret = wasm.get_peer_stats();
361
356
  return takeObject(ret);
362
357
  };
363
358
 
364
359
  /**
365
- * @param {Uint8Array} buffer
366
- * @param {number} msg_index
367
- * @param {bigint} peer_index
368
- * @returns {Promise<void>}
360
+ * @returns {Promise<string>}
369
361
  */
370
- module.exports.send_api_error = function(buffer, msg_index, peer_index) {
371
- const ret = wasm.send_api_error(addHeapObject(buffer), msg_index, peer_index);
362
+ module.exports.get_stats = function() {
363
+ const ret = wasm.get_stats();
372
364
  return takeObject(ret);
373
365
  };
374
366
 
375
367
  /**
376
- * @returns {Promise<bigint>}
368
+ * @param {bigint} peer_index
369
+ * @param {string} ip
370
+ * @returns {Promise<void>}
377
371
  */
378
- module.exports.get_next_peer_index = function() {
379
- const ret = wasm.get_next_peer_index();
372
+ module.exports.process_new_peer = function(peer_index, ip) {
373
+ const ret = wasm.process_new_peer(peer_index, addHeapObject(ip));
380
374
  return takeObject(ret);
381
375
  };
382
376
 
383
377
  /**
384
- * @param {string} block_hash
385
- * @returns {Promise<WasmBlock>}
378
+ * @param {bigint} threshold
379
+ * @returns {Promise<void>}
386
380
  */
387
- module.exports.get_block = function(block_hash) {
388
- const ret = wasm.get_block(addHeapObject(block_hash));
381
+ module.exports.write_issuance_file = function(threshold) {
382
+ const ret = wasm.write_issuance_file(threshold);
389
383
  return takeObject(ret);
390
384
  };
391
385
 
392
386
  /**
393
- * @returns {Promise<string>}
387
+ * @param {Array<any>} public_keys
388
+ * @param {BigUint64Array} amounts
389
+ * @param {bigint} fee
390
+ * @param {boolean} _force_merge
391
+ * @returns {Promise<WasmTransaction>}
394
392
  */
395
- module.exports.get_congestion_stats = function() {
396
- const ret = wasm.get_congestion_stats();
393
+ module.exports.create_transaction_with_multiple_payments = function(public_keys, amounts, fee, _force_merge) {
394
+ const ret = wasm.create_transaction_with_multiple_payments(addHeapObject(public_keys), addHeapObject(amounts), fee, _force_merge);
397
395
  return takeObject(ret);
398
396
  };
399
397
 
400
398
  /**
401
- * @param {string} nft_id_hex
402
- * @param {Uint8Array} tx_msg
403
- * @returns {Promise<WasmTransaction>}
399
+ * @returns {Promise<Array<any>>}
404
400
  */
405
- module.exports.create_merge_bound_transaction = function(nft_id_hex, tx_msg) {
406
- const ptr0 = passStringToWasm0(nft_id_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
407
- const len0 = WASM_VECTOR_LEN;
408
- const ret = wasm.create_merge_bound_transaction(ptr0, len0, addHeapObject(tx_msg));
401
+ module.exports.get_nft_list = function() {
402
+ const ret = wasm.get_nft_list();
409
403
  return takeObject(ret);
410
404
  };
411
405
 
412
406
  /**
413
- * @param {bigint} peer_index
407
+ * @param {WasmBalanceSnapshot} snapshot
414
408
  * @returns {Promise<void>}
415
409
  */
416
- module.exports.process_peer_disconnection = function(peer_index) {
417
- const ret = wasm.process_peer_disconnection(peer_index);
410
+ module.exports.update_from_balance_snapshot = function(snapshot) {
411
+ _assertClass(snapshot, WasmBalanceSnapshot);
412
+ var ptr0 = snapshot.__destroy_into_raw();
413
+ const ret = wasm.update_from_balance_snapshot(ptr0);
418
414
  return takeObject(ret);
419
415
  };
420
416
 
421
417
  /**
422
- * @param {WasmTransaction} tx
423
- * @returns {Promise<void>}
418
+ * @returns {Promise<any>}
424
419
  */
425
- module.exports.propagate_transaction = function(tx) {
426
- _assertClass(tx, WasmTransaction);
427
- const ret = wasm.propagate_transaction(tx.__wbg_ptr);
420
+ module.exports.get_confirmations = function() {
421
+ const ret = wasm.get_confirmations();
428
422
  return takeObject(ret);
429
423
  };
430
424
 
431
425
  /**
432
- * @param {string} public_key
433
- * @param {bigint} amount
434
- * @param {bigint} fee
435
- * @param {boolean} force_merge
436
- * @returns {Promise<WasmTransaction>}
426
+ * @param {number} major
427
+ * @param {number} minor
428
+ * @param {number} patch
429
+ * @returns {Promise<void>}
437
430
  */
438
- module.exports.create_transaction = function(public_key, amount, fee, force_merge) {
439
- const ret = wasm.create_transaction(addHeapObject(public_key), amount, fee, force_merge);
431
+ module.exports.set_wallet_version = function(major, minor, patch) {
432
+ const ret = wasm.set_wallet_version(major, minor, patch);
440
433
  return takeObject(ret);
441
434
  };
442
435
 
443
436
  /**
444
- * @returns {Promise<any>}
437
+ * @returns {Promise<void>}
445
438
  */
446
- module.exports.get_confirmations = function() {
447
- const ret = wasm.get_confirmations();
439
+ module.exports.start_from_received_ghost_chain = function() {
440
+ const ret = wasm.start_from_received_ghost_chain();
448
441
  return takeObject(ret);
449
442
  };
450
443
 
451
444
  /**
452
- * @param {bigint} peer_index
453
- * @param {string} public_key
454
- * @returns {Promise<void>}
445
+ * @returns {Promise<bigint>}
455
446
  */
456
- module.exports.process_stun_peer = function(peer_index, public_key) {
457
- const ret = wasm.process_stun_peer(peer_index, addHeapObject(public_key));
447
+ module.exports.get_next_peer_index = function() {
448
+ const ret = wasm.get_next_peer_index();
458
449
  return takeObject(ret);
459
450
  };
460
451
 
@@ -479,65 +470,48 @@ module.exports.generate_public_key = function(private_key) {
479
470
  };
480
471
 
481
472
  /**
482
- * @param {Uint8Array} buffer
483
- * @param {string} signature
484
- * @param {string} public_key
485
- * @returns {boolean}
486
- */
487
- module.exports.verify_signature = function(buffer, signature, public_key) {
488
- const ret = wasm.verify_signature(addHeapObject(buffer), addHeapObject(signature), addHeapObject(public_key));
489
- return ret !== 0;
490
- };
491
-
492
- /**
493
- * @param {Uint8Array} buffer
494
- * @param {string} private_key
495
- * @returns {string}
496
- */
497
- module.exports.sign_buffer = function(buffer, private_key) {
498
- try {
499
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
500
- wasm.sign_buffer(retptr, addHeapObject(buffer), addHeapObject(private_key));
501
- var r0 = getInt32Memory0()[retptr / 4 + 0];
502
- var r1 = getInt32Memory0()[retptr / 4 + 1];
503
- var r2 = getInt32Memory0()[retptr / 4 + 2];
504
- if (r2) {
505
- throw takeObject(r1);
506
- }
507
- return takeObject(r0);
508
- } finally {
509
- wasm.__wbindgen_add_to_stack_pointer(16);
510
- }
473
+ * @param {Uint8Array} buffer
474
+ * @param {number} msg_index
475
+ * @param {bigint} peer_index
476
+ * @returns {Promise<void>}
477
+ */
478
+ module.exports.send_api_call = function(buffer, msg_index, peer_index) {
479
+ const ret = wasm.send_api_call(addHeapObject(buffer), msg_index, peer_index);
480
+ return takeObject(ret);
511
481
  };
512
482
 
513
483
  /**
514
- * @returns {Promise<Array<any>>}
484
+ * @param {bigint} amt
485
+ * @param {string} slip1_utxo_key
486
+ * @param {string} slip2_utxo_key
487
+ * @param {string} slip3_utxo_key
488
+ * @param {string} recipient_public_key
489
+ * @param {Uint8Array} tx_msg
490
+ * @returns {Promise<WasmTransaction>}
515
491
  */
516
- module.exports.get_peers = function() {
517
- const ret = wasm.get_peers();
492
+ module.exports.create_send_bound_transaction = function(amt, slip1_utxo_key, slip2_utxo_key, slip3_utxo_key, recipient_public_key, tx_msg) {
493
+ 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));
518
494
  return takeObject(ret);
519
495
  };
520
496
 
521
497
  /**
522
498
  * @param {bigint} peer_index
523
- * @param {string} ip
499
+ * @param {string} public_key
524
500
  * @returns {Promise<void>}
525
501
  */
526
- module.exports.process_new_peer = function(peer_index, ip) {
527
- const ret = wasm.process_new_peer(peer_index, addHeapObject(ip));
502
+ module.exports.process_stun_peer = function(peer_index, public_key) {
503
+ const ret = wasm.process_stun_peer(peer_index, addHeapObject(public_key));
528
504
  return takeObject(ret);
529
505
  };
530
506
 
531
507
  /**
532
- * @param {string} config_json
533
- * @param {string} private_key
534
- * @param {number} log_level_num
535
- * @param {bigint} hasten_multiplier
536
- * @param {boolean} delete_old_blocks
537
- * @returns {Promise<any>}
508
+ * @param {Uint8Array} hash
509
+ * @param {bigint} block_id
510
+ * @param {bigint} peer_index
511
+ * @returns {Promise<void>}
538
512
  */
539
- module.exports.initialize = function(config_json, private_key, log_level_num, hasten_multiplier, delete_old_blocks) {
540
- const ret = wasm.initialize(addHeapObject(config_json), addHeapObject(private_key), log_level_num, hasten_multiplier, delete_old_blocks);
513
+ module.exports.process_failed_block_fetch = function(hash, block_id, peer_index) {
514
+ const ret = wasm.process_failed_block_fetch(addHeapObject(hash), block_id, peer_index);
541
515
  return takeObject(ret);
542
516
  };
543
517
 
@@ -552,79 +526,76 @@ module.exports.get_balance_snapshot = function(keys) {
552
526
 
553
527
  /**
554
528
  * @param {Uint8Array} buffer
555
- * @param {number} msg_index
556
529
  * @param {bigint} peer_index
557
530
  * @returns {Promise<void>}
558
531
  */
559
- module.exports.send_api_call = function(buffer, msg_index, peer_index) {
560
- const ret = wasm.send_api_call(addHeapObject(buffer), msg_index, peer_index);
532
+ module.exports.process_msg_buffer_from_peer = function(buffer, peer_index) {
533
+ const ret = wasm.process_msg_buffer_from_peer(addHeapObject(buffer), peer_index);
561
534
  return takeObject(ret);
562
535
  };
563
536
 
564
537
  /**
565
- * @returns {Promise<string>}
538
+ * @param {bigint} peer_index
539
+ * @returns {Promise<void>}
566
540
  */
567
- module.exports.get_latest_block_hash = function() {
568
- const ret = wasm.get_latest_block_hash();
541
+ module.exports.process_peer_disconnection = function(peer_index) {
542
+ const ret = wasm.process_peer_disconnection(peer_index);
569
543
  return takeObject(ret);
570
544
  };
571
545
 
572
546
  /**
573
- * @param {bigint} peer_index
574
- * @returns {Promise<WasmPeer | undefined>}
547
+ * @param {string} config_json
548
+ * @param {string} private_key
549
+ * @param {number} log_level_num
550
+ * @param {bigint} hasten_multiplier
551
+ * @param {boolean} delete_old_blocks
552
+ * @returns {Promise<any>}
575
553
  */
576
- module.exports.get_peer = function(peer_index) {
577
- const ret = wasm.get_peer(peer_index);
554
+ module.exports.initialize = function(config_json, private_key, log_level_num, hasten_multiplier, delete_old_blocks) {
555
+ const ret = wasm.initialize(addHeapObject(config_json), addHeapObject(private_key), log_level_num, hasten_multiplier, delete_old_blocks);
578
556
  return takeObject(ret);
579
557
  };
580
558
 
581
559
  /**
582
- * @param {bigint} current_time
583
- * @returns {Promise<void>}
560
+ * @returns {Promise<boolean>}
584
561
  */
585
- module.exports.process_stat_interval = function(current_time) {
586
- const ret = wasm.process_stat_interval(current_time);
562
+ module.exports.produce_block_with_gt = function() {
563
+ const ret = wasm.produce_block_with_gt();
587
564
  return takeObject(ret);
588
565
  };
589
566
 
590
567
  /**
591
- * @param {string} slip1_utxo_key
592
- * @param {string} slip2_utxo_key
593
- * @param {string} slip3_utxo_key
594
- * @param {Uint8Array} tx_msg
595
- * @returns {Promise<WasmTransaction>}
568
+ * @returns {Promise<WasmWallet>}
596
569
  */
597
- module.exports.create_remove_bound_transaction = function(slip1_utxo_key, slip2_utxo_key, slip3_utxo_key, tx_msg) {
598
- const ret = wasm.create_remove_bound_transaction(addHeapObject(slip1_utxo_key), addHeapObject(slip2_utxo_key), addHeapObject(slip3_utxo_key), addHeapObject(tx_msg));
570
+ module.exports.get_wallet = function() {
571
+ const ret = wasm.get_wallet();
599
572
  return takeObject(ret);
600
573
  };
601
574
 
602
575
  /**
603
- * @returns {Promise<string>}
576
+ * @returns {Promise<boolean>}
604
577
  */
605
- module.exports.get_stats = function() {
606
- const ret = wasm.get_stats();
578
+ module.exports.produce_block_without_gt = function() {
579
+ const ret = wasm.produce_block_without_gt();
607
580
  return takeObject(ret);
608
581
  };
609
582
 
610
583
  /**
611
- * @param {Uint8Array} buffer
612
- * @param {Uint8Array} hash
613
- * @param {bigint} block_id
614
- * @param {bigint} peer_index
584
+ * @param {bigint} duration_in_ms
615
585
  * @returns {Promise<void>}
616
586
  */
617
- module.exports.process_fetched_block = function(buffer, hash, block_id, peer_index) {
618
- const ret = wasm.process_fetched_block(addHeapObject(buffer), addHeapObject(hash), block_id, peer_index);
587
+ module.exports.process_timer_event = function(duration_in_ms) {
588
+ const ret = wasm.process_timer_event(duration_in_ms);
619
589
  return takeObject(ret);
620
590
  };
621
591
 
622
592
  /**
623
- * @param {string} public_key
624
- * @returns {Promise<Array<any>>}
593
+ * @param {WasmTransaction} tx
594
+ * @returns {Promise<void>}
625
595
  */
626
- module.exports.get_account_slips = function(public_key) {
627
- const ret = wasm.get_account_slips(addHeapObject(public_key));
596
+ module.exports.propagate_transaction = function(tx) {
597
+ _assertClass(tx, WasmTransaction);
598
+ const ret = wasm.propagate_transaction(tx.__wbg_ptr);
628
599
  return takeObject(ret);
629
600
  };
630
601
 
@@ -638,51 +609,53 @@ module.exports.hash = function(buffer) {
638
609
  };
639
610
 
640
611
  /**
641
- * @returns {Promise<WasmBlockchain>}
612
+ * @param {Uint8Array} buffer
613
+ * @param {number} msg_index
614
+ * @param {bigint} peer_index
615
+ * @returns {Promise<void>}
642
616
  */
643
- module.exports.get_blockchain = function() {
644
- const ret = wasm.get_blockchain();
617
+ module.exports.send_api_success = function(buffer, msg_index, peer_index) {
618
+ const ret = wasm.send_api_success(addHeapObject(buffer), msg_index, peer_index);
645
619
  return takeObject(ret);
646
620
  };
647
621
 
648
622
  /**
649
- * @param {bigint} amt
650
- * @param {string} slip1_utxo_key
651
- * @param {string} slip2_utxo_key
652
- * @param {string} slip3_utxo_key
653
- * @param {string} recipient_public_key
654
- * @param {Uint8Array} tx_msg
623
+ * @param {string} public_key
624
+ * @param {bigint} amount
625
+ * @param {bigint} fee
626
+ * @param {boolean} force_merge
655
627
  * @returns {Promise<WasmTransaction>}
656
628
  */
657
- module.exports.create_send_bound_transaction = function(amt, slip1_utxo_key, slip2_utxo_key, slip3_utxo_key, recipient_public_key, tx_msg) {
658
- 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));
629
+ module.exports.create_transaction = function(public_key, amount, fee, force_merge) {
630
+ const ret = wasm.create_transaction(addHeapObject(public_key), amount, fee, force_merge);
659
631
  return takeObject(ret);
660
632
  };
661
633
 
662
634
  /**
663
- * @returns {Promise<Array<any>>}
635
+ * @returns {Promise<WasmBlockchain>}
664
636
  */
665
- module.exports.get_nft_list = function() {
666
- const ret = wasm.get_nft_list();
637
+ module.exports.get_blockchain = function() {
638
+ const ret = wasm.get_blockchain();
667
639
  return takeObject(ret);
668
640
  };
669
641
 
670
642
  /**
671
- * @param {number} major
672
- * @param {number} minor
673
- * @param {number} patch
674
- * @returns {Promise<void>}
643
+ * @param {string} nft_id_hex
644
+ * @param {Uint8Array} tx_msg
645
+ * @returns {Promise<WasmTransaction>}
675
646
  */
676
- module.exports.set_wallet_version = function(major, minor, patch) {
677
- const ret = wasm.set_wallet_version(major, minor, patch);
647
+ module.exports.create_merge_bound_transaction = function(nft_id_hex, tx_msg) {
648
+ const ptr0 = passStringToWasm0(nft_id_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
649
+ const len0 = WASM_VECTOR_LEN;
650
+ const ret = wasm.create_merge_bound_transaction(ptr0, len0, addHeapObject(tx_msg));
678
651
  return takeObject(ret);
679
652
  };
680
653
 
681
654
  /**
682
- * @returns {Promise<boolean>}
655
+ * @returns {Promise<string>}
683
656
  */
684
- module.exports.produce_block_without_gt = function() {
685
- const ret = wasm.produce_block_without_gt();
657
+ module.exports.get_congestion_stats = function() {
658
+ const ret = wasm.get_congestion_stats();
686
659
  return takeObject(ret);
687
660
  };
688
661
 
@@ -701,36 +674,63 @@ module.exports.create_split_bound_transaction = function(slip1_utxo_key, slip2_u
701
674
  };
702
675
 
703
676
  /**
704
- * @param {bigint} duration_in_ms
705
- * @returns {Promise<void>}
677
+ * @param {bigint} num
678
+ * @param {bigint} deposit
679
+ * @param {Uint8Array} tx_msg
680
+ * @param {bigint} fee
681
+ * @param {string} recipient_public_key
682
+ * @param {string} nft_type
683
+ * @returns {Promise<WasmTransaction>}
706
684
  */
707
- module.exports.process_timer_event = function(duration_in_ms) {
708
- const ret = wasm.process_timer_event(duration_in_ms);
685
+ module.exports.create_bound_transaction = function(num, deposit, tx_msg, fee, recipient_public_key, nft_type) {
686
+ const ret = wasm.create_bound_transaction(num, deposit, addHeapObject(tx_msg), fee, addHeapObject(recipient_public_key), addHeapObject(nft_type));
709
687
  return takeObject(ret);
710
688
  };
711
689
 
712
690
  /**
713
- * @param {string} key
714
- * @returns {boolean}
691
+ * @param {string} slip1_utxo_key
692
+ * @param {string} slip2_utxo_key
693
+ * @param {string} slip3_utxo_key
694
+ * @param {Uint8Array} tx_msg
695
+ * @returns {Promise<WasmTransaction>}
715
696
  */
716
- module.exports.is_valid_public_key = function(key) {
717
- const ret = wasm.is_valid_public_key(addHeapObject(key));
718
- return ret !== 0;
697
+ module.exports.create_remove_bound_transaction = function(slip1_utxo_key, slip2_utxo_key, slip3_utxo_key, tx_msg) {
698
+ const ret = wasm.create_remove_bound_transaction(addHeapObject(slip1_utxo_key), addHeapObject(slip2_utxo_key), addHeapObject(slip3_utxo_key), addHeapObject(tx_msg));
699
+ return takeObject(ret);
700
+ };
701
+
702
+ /**
703
+ * @param {string} block_hash
704
+ * @returns {Promise<WasmBlock>}
705
+ */
706
+ module.exports.get_block = function(block_hash) {
707
+ const ret = wasm.get_block(addHeapObject(block_hash));
708
+ return takeObject(ret);
719
709
  };
720
710
 
721
711
  /**
712
+ * @param {bigint} current_time
722
713
  * @returns {Promise<void>}
723
714
  */
724
- module.exports.start_from_received_ghost_chain = function() {
725
- const ret = wasm.start_from_received_ghost_chain();
715
+ module.exports.process_stat_interval = function(current_time) {
716
+ const ret = wasm.process_stat_interval(current_time);
726
717
  return takeObject(ret);
727
718
  };
728
719
 
729
720
  /**
730
- * @returns {Promise<Array<any>>}
721
+ * @returns {Promise<void>}
731
722
  */
732
- module.exports.get_mempool_txs = function() {
733
- const ret = wasm.get_mempool_txs();
723
+ module.exports.disable_producing_blocks_by_timer = function() {
724
+ const ret = wasm.disable_producing_blocks_by_timer();
725
+ return takeObject(ret);
726
+ };
727
+
728
+ /**
729
+ * @param {bigint} peer_index
730
+ * @returns {Promise<void>}
731
+ */
732
+ module.exports.remove_stun_peer = function(peer_index) {
733
+ const ret = wasm.remove_stun_peer(peer_index);
734
734
  return takeObject(ret);
735
735
  };
736
736
 
@@ -2685,13 +2685,33 @@ module.exports.__wbindgen_object_drop_ref = function(arg0) {
2685
2685
  takeObject(arg0);
2686
2686
  };
2687
2687
 
2688
+ module.exports.__wbg_wasmwalletslip_new = function(arg0) {
2689
+ const ret = WasmWalletSlip.__wrap(arg0);
2690
+ return addHeapObject(ret);
2691
+ };
2692
+
2693
+ module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
2694
+ const ret = BigInt.asUintN(64, arg0);
2695
+ return addHeapObject(ret);
2696
+ };
2697
+
2688
2698
  module.exports.__wbindgen_string_new = function(arg0, arg1) {
2689
2699
  const ret = getStringFromWasm0(arg0, arg1);
2690
2700
  return addHeapObject(ret);
2691
2701
  };
2692
2702
 
2693
- module.exports.__wbg_wasmslip_new = function(arg0) {
2694
- const ret = WasmSlip.__wrap(arg0);
2703
+ module.exports.__wbg_wasmwallet_new = function(arg0) {
2704
+ const ret = WasmWallet.__wrap(arg0);
2705
+ return addHeapObject(ret);
2706
+ };
2707
+
2708
+ module.exports.__wbg_wasmpeer_new = function(arg0) {
2709
+ const ret = WasmPeer.__wrap(arg0);
2710
+ return addHeapObject(ret);
2711
+ };
2712
+
2713
+ module.exports.__wbg_wasmblock_new = function(arg0) {
2714
+ const ret = WasmBlock.__wrap(arg0);
2695
2715
  return addHeapObject(ret);
2696
2716
  };
2697
2717
 
@@ -2724,23 +2744,8 @@ module.exports.__wbg_wasmblockchain_new = function(arg0) {
2724
2744
  return addHeapObject(ret);
2725
2745
  };
2726
2746
 
2727
- module.exports.__wbg_wasmblock_new = function(arg0) {
2728
- const ret = WasmBlock.__wrap(arg0);
2729
- return addHeapObject(ret);
2730
- };
2731
-
2732
- module.exports.__wbg_wasmpeer_new = function(arg0) {
2733
- const ret = WasmPeer.__wrap(arg0);
2734
- return addHeapObject(ret);
2735
- };
2736
-
2737
- module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
2738
- const ret = BigInt.asUintN(64, arg0);
2739
- return addHeapObject(ret);
2740
- };
2741
-
2742
- module.exports.__wbg_wasmwalletslip_new = function(arg0) {
2743
- const ret = WasmWalletSlip.__wrap(arg0);
2747
+ module.exports.__wbg_wasmslip_new = function(arg0) {
2748
+ const ret = WasmSlip.__wrap(arg0);
2744
2749
  return addHeapObject(ret);
2745
2750
  };
2746
2751
 
@@ -2749,11 +2754,6 @@ module.exports.__wbg_wasmbalancesnapshot_new = function(arg0) {
2749
2754
  return addHeapObject(ret);
2750
2755
  };
2751
2756
 
2752
- module.exports.__wbg_wasmwallet_new = function(arg0) {
2753
- const ret = WasmWallet.__wrap(arg0);
2754
- return addHeapObject(ret);
2755
- };
2756
-
2757
2757
  module.exports.__wbindgen_error_new = function(arg0, arg1) {
2758
2758
  const ret = new Error(getStringFromWasm0(arg0, arg1));
2759
2759
  return addHeapObject(ret);
@@ -2785,7 +2785,7 @@ module.exports.__wbg_wasmhop_new = function(arg0) {
2785
2785
  return addHeapObject(ret);
2786
2786
  };
2787
2787
 
2788
- module.exports.__wbg_flushdata_e19f8531f715563c = function(arg0, arg1) {
2788
+ module.exports.__wbg_flushdata_8a3be53f8be8f226 = function(arg0, arg1) {
2789
2789
  let deferred0_0;
2790
2790
  let deferred0_1;
2791
2791
  try {
@@ -2797,7 +2797,7 @@ module.exports.__wbg_flushdata_e19f8531f715563c = function(arg0, arg1) {
2797
2797
  }
2798
2798
  };
2799
2799
 
2800
- module.exports.__wbg_readvalue_d3282c9c5d63c751 = function() { return handleError(function (arg0, arg1) {
2800
+ module.exports.__wbg_readvalue_f8e3c605b6013fe7 = function() { return handleError(function (arg0, arg1) {
2801
2801
  let deferred0_0;
2802
2802
  let deferred0_1;
2803
2803
  try {
@@ -2810,15 +2810,15 @@ module.exports.__wbg_readvalue_d3282c9c5d63c751 = function() { return handleErro
2810
2810
  }
2811
2811
  }, arguments) };
2812
2812
 
2813
- module.exports.__wbg_loadwallet_f66232ebdacd134c = function() {
2813
+ module.exports.__wbg_loadwallet_40a7a0a063c9ff37 = function() {
2814
2814
  MsgHandler.load_wallet();
2815
2815
  };
2816
2816
 
2817
- module.exports.__wbg_savewallet_900c6615a7c444ff = function() {
2817
+ module.exports.__wbg_savewallet_42bc0a121ea1c325 = function() {
2818
2818
  MsgHandler.save_wallet();
2819
2819
  };
2820
2820
 
2821
- module.exports.__wbg_writevalue_55ad59a477682cf4 = function(arg0, arg1, arg2) {
2821
+ module.exports.__wbg_writevalue_1599a6bbe5b9fcba = function(arg0, arg1, arg2) {
2822
2822
  let deferred0_0;
2823
2823
  let deferred0_1;
2824
2824
  try {
@@ -2830,7 +2830,7 @@ module.exports.__wbg_writevalue_55ad59a477682cf4 = function(arg0, arg1, arg2) {
2830
2830
  }
2831
2831
  };
2832
2832
 
2833
- module.exports.__wbg_appendvalue_9bad2e39591861df = function(arg0, arg1, arg2) {
2833
+ module.exports.__wbg_appendvalue_2602f3dff3c02ed3 = function(arg0, arg1, arg2) {
2834
2834
  let deferred0_0;
2835
2835
  let deferred0_1;
2836
2836
  try {
@@ -2842,7 +2842,7 @@ module.exports.__wbg_appendvalue_9bad2e39591861df = function(arg0, arg1, arg2) {
2842
2842
  }
2843
2843
  };
2844
2844
 
2845
- module.exports.__wbg_removevalue_0829d7a3fdf241e8 = function() { return handleError(function (arg0, arg1) {
2845
+ module.exports.__wbg_removevalue_864a1ee43137bd0c = function() { return handleError(function (arg0, arg1) {
2846
2846
  let deferred0_0;
2847
2847
  let deferred0_1;
2848
2848
  try {
@@ -2855,11 +2855,11 @@ module.exports.__wbg_removevalue_0829d7a3fdf241e8 = function() { return handleEr
2855
2855
  }
2856
2856
  }, arguments) };
2857
2857
 
2858
- module.exports.__wbg_sendmessage_8bfa28cc4629d485 = function(arg0, arg1) {
2858
+ module.exports.__wbg_sendmessage_94db158b4f1537d2 = function(arg0, arg1) {
2859
2859
  MsgHandler.send_message(takeObject(arg0), getObject(arg1));
2860
2860
  };
2861
2861
 
2862
- module.exports.__wbg_connecttopeer_a97abb6ea54e73f4 = function() { return handleError(function (arg0, arg1, arg2) {
2862
+ module.exports.__wbg_connecttopeer_c5deae2cdbdb9f5d = function() { return handleError(function (arg0, arg1, arg2) {
2863
2863
  let deferred0_0;
2864
2864
  let deferred0_1;
2865
2865
  try {
@@ -2872,14 +2872,14 @@ module.exports.__wbg_connecttopeer_a97abb6ea54e73f4 = function() { return handle
2872
2872
  }
2873
2873
  }, arguments) };
2874
2874
 
2875
- module.exports.__wbg_getmyservices_0af92500fd842b5c = function() {
2875
+ module.exports.__wbg_getmyservices_7bc1499ff4f2976d = function() {
2876
2876
  const ret = MsgHandler.get_my_services();
2877
2877
  _assertClass(ret, WasmPeerServiceList);
2878
2878
  var ptr1 = ret.__destroy_into_raw();
2879
2879
  return ptr1;
2880
2880
  };
2881
2881
 
2882
- module.exports.__wbg_isexistingfile_c5074d5d9ae77250 = function() { return handleError(function (arg0, arg1) {
2882
+ module.exports.__wbg_isexistingfile_0099b8b5ea955d68 = function() { return handleError(function (arg0, arg1) {
2883
2883
  let deferred0_0;
2884
2884
  let deferred0_1;
2885
2885
  try {
@@ -2892,33 +2892,33 @@ module.exports.__wbg_isexistingfile_c5074d5d9ae77250 = function() { return handl
2892
2892
  }
2893
2893
  }, arguments) };
2894
2894
 
2895
- module.exports.__wbg_processapicall_447fe8b16543cfe2 = function(arg0, arg1, arg2) {
2895
+ module.exports.__wbg_processapicall_71052b8f6948e2e5 = function(arg0, arg1, arg2) {
2896
2896
  MsgHandler.process_api_call(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2897
2897
  };
2898
2898
 
2899
- module.exports.__wbg_processapierror_ae6a7accec497e67 = function(arg0, arg1, arg2) {
2899
+ module.exports.__wbg_processapierror_42532e404878dc4f = function(arg0, arg1, arg2) {
2900
2900
  MsgHandler.process_api_error(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2901
2901
  };
2902
2902
 
2903
- module.exports.__wbg_processapisuccess_55add6554d3b2fbf = function(arg0, arg1, arg2) {
2903
+ module.exports.__wbg_processapisuccess_99b6c280a2d87a47 = function(arg0, arg1, arg2) {
2904
2904
  MsgHandler.process_api_success(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2905
2905
  };
2906
2906
 
2907
- module.exports.__wbg_sendmessagetoall_9db2f0f8745a3b61 = function(arg0, arg1) {
2907
+ module.exports.__wbg_sendmessagetoall_f01c609b2749f987 = function(arg0, arg1) {
2908
2908
  MsgHandler.send_message_to_all(getObject(arg0), getObject(arg1));
2909
2909
  };
2910
2910
 
2911
- module.exports.__wbg_disconnectfrompeer_93f8374a739a911c = function() { return handleError(function (arg0) {
2911
+ module.exports.__wbg_disconnectfrompeer_d2743f7eb8c25e08 = function() { return handleError(function (arg0) {
2912
2912
  const ret = MsgHandler.disconnect_from_peer(takeObject(arg0));
2913
2913
  return addHeapObject(ret);
2914
2914
  }, arguments) };
2915
2915
 
2916
- module.exports.__wbg_loadblockfilelist_909ff75cd1004eec = function() { return handleError(function () {
2916
+ module.exports.__wbg_loadblockfilelist_8f3794d11016af8e = function() { return handleError(function () {
2917
2917
  const ret = MsgHandler.load_block_file_list();
2918
2918
  return addHeapObject(ret);
2919
2919
  }, arguments) };
2920
2920
 
2921
- module.exports.__wbg_sendinterfaceevent_7045bede3f7d75b1 = function(arg0, arg1, arg2, arg3, arg4) {
2921
+ module.exports.__wbg_sendinterfaceevent_ea3b82df825804d3 = function(arg0, arg1, arg2, arg3, arg4) {
2922
2922
  let deferred0_0;
2923
2923
  let deferred0_1;
2924
2924
  let deferred1_0;
@@ -2935,7 +2935,7 @@ module.exports.__wbg_sendinterfaceevent_7045bede3f7d75b1 = function(arg0, arg1,
2935
2935
  }
2936
2936
  };
2937
2937
 
2938
- module.exports.__wbg_sendblocksuccess_4a65fd07f3e613ab = function(arg0, arg1, arg2) {
2938
+ module.exports.__wbg_sendblocksuccess_3f6c6666f1c6ce59 = function(arg0, arg1, arg2) {
2939
2939
  let deferred0_0;
2940
2940
  let deferred0_1;
2941
2941
  try {
@@ -2947,11 +2947,11 @@ module.exports.__wbg_sendblocksuccess_4a65fd07f3e613ab = function(arg0, arg1, ar
2947
2947
  }
2948
2948
  };
2949
2949
 
2950
- module.exports.__wbg_sendwalletupdate_4622857ac663a957 = function() {
2950
+ module.exports.__wbg_sendwalletupdate_2c49ae3e0d15ee8d = function() {
2951
2951
  MsgHandler.send_wallet_update();
2952
2952
  };
2953
2953
 
2954
- module.exports.__wbg_sendnewversionalert_e01dcdcfd2560293 = function(arg0, arg1, arg2) {
2954
+ module.exports.__wbg_sendnewversionalert_011ddf281aa4b239 = function(arg0, arg1, arg2) {
2955
2955
  let deferred0_0;
2956
2956
  let deferred0_1;
2957
2957
  try {
@@ -2963,15 +2963,15 @@ module.exports.__wbg_sendnewversionalert_e01dcdcfd2560293 = function(arg0, arg1,
2963
2963
  }
2964
2964
  };
2965
2965
 
2966
- module.exports.__wbg_sendblockfetchstatusevent_4e05211bffe95385 = function(arg0) {
2966
+ module.exports.__wbg_sendblockfetchstatusevent_0980203dcc2ecc63 = function(arg0) {
2967
2967
  MsgHandler.send_block_fetch_status_event(BigInt.asUintN(64, arg0));
2968
2968
  };
2969
2969
 
2970
- module.exports.__wbg_sendnewchaindetectedevent_9db9e5dcd7e122b8 = function() {
2970
+ module.exports.__wbg_sendnewchaindetectedevent_d12fa4645380fe48 = function() {
2971
2971
  MsgHandler.send_new_chain_detected_event();
2972
2972
  };
2973
2973
 
2974
- module.exports.__wbg_fetchblockfrompeer_7f0851a8d64bfa82 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2974
+ module.exports.__wbg_fetchblockfrompeer_68ea2e6049430713 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2975
2975
  let deferred0_0;
2976
2976
  let deferred0_1;
2977
2977
  try {
@@ -2984,7 +2984,7 @@ module.exports.__wbg_fetchblockfrompeer_7f0851a8d64bfa82 = function() { return h
2984
2984
  }
2985
2985
  }, arguments) };
2986
2986
 
2987
- module.exports.__wbg_ensuredirectoryexists_6bfc5f098f9a291d = function() { return handleError(function (arg0, arg1) {
2987
+ module.exports.__wbg_ensuredirectoryexists_c993e374fac2a231 = function() { return handleError(function (arg0, arg1) {
2988
2988
  let deferred0_0;
2989
2989
  let deferred0_1;
2990
2990
  try {
@@ -3372,7 +3372,7 @@ module.exports.__wbindgen_debug_string = function(arg0, arg1) {
3372
3372
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
3373
3373
  };
3374
3374
 
3375
- module.exports.__wbindgen_closure_wrapper1615 = function(arg0, arg1, arg2) {
3375
+ module.exports.__wbindgen_closure_wrapper1616 = function(arg0, arg1, arg2) {
3376
3376
  const ret = makeMutClosure(arg0, arg1, 598, __wbg_adapter_38);
3377
3377
  return addHeapObject(ret);
3378
3378
  };