saito-wasm 0.2.101 → 0.2.102

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/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "saito-wasm"
3
- version = "0.2.101"
3
+ version = "0.2.102"
4
4
  edition = "2021"
5
5
 
6
6
  # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saito-wasm",
3
- "version": "0.2.101",
3
+ "version": "0.2.102",
4
4
  "description": "js wrappings around saito-core using wasm",
5
5
  "scripts": {
6
6
  "test": "./node_modules/.bin/jest",
package/pkg/node/index.js CHANGED
@@ -1,9 +1,29 @@
1
1
  let imports = {};
2
2
  imports['__wbindgen_placeholder__'] = module.exports;
3
3
  let wasm;
4
- const { MsgHandler } = require(String.raw`./snippets/saito-wasm-958bee07b1c04fca/js/msg_handler.js`);
4
+ const { MsgHandler } = require(String.raw`./snippets/saito-wasm-0b227ddc72cb853d/js/msg_handler.js`);
5
5
  const { TextDecoder, TextEncoder } = require(`util`);
6
6
 
7
+ const heap = new Array(128).fill(undefined);
8
+
9
+ heap.push(undefined, null, true, false);
10
+
11
+ function getObject(idx) { return heap[idx]; }
12
+
13
+ let heap_next = heap.length;
14
+
15
+ function dropObject(idx) {
16
+ if (idx < 132) return;
17
+ heap[idx] = heap_next;
18
+ heap_next = idx;
19
+ }
20
+
21
+ function takeObject(idx) {
22
+ const ret = getObject(idx);
23
+ dropObject(idx);
24
+ return ret;
25
+ }
26
+
7
27
  let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
8
28
 
9
29
  cachedTextDecoder.decode();
@@ -22,12 +42,6 @@ function getStringFromWasm0(ptr, len) {
22
42
  return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
23
43
  }
24
44
 
25
- const heap = new Array(128).fill(undefined);
26
-
27
- heap.push(undefined, null, true, false);
28
-
29
- let heap_next = heap.length;
30
-
31
45
  function addHeapObject(obj) {
32
46
  if (heap_next === heap.length) heap.push(heap.length + 1);
33
47
  const idx = heap_next;
@@ -37,20 +51,6 @@ function addHeapObject(obj) {
37
51
  return idx;
38
52
  }
39
53
 
40
- function getObject(idx) { return heap[idx]; }
41
-
42
- function dropObject(idx) {
43
- if (idx < 132) return;
44
- heap[idx] = heap_next;
45
- heap_next = idx;
46
- }
47
-
48
- function takeObject(idx) {
49
- const ret = getObject(idx);
50
- dropObject(idx);
51
- return ret;
52
- }
53
-
54
54
  let WASM_VECTOR_LEN = 0;
55
55
 
56
56
  let cachedTextEncoder = new TextEncoder('utf-8');
@@ -228,14 +228,6 @@ function __wbg_adapter_38(arg0, arg1, arg2) {
228
228
  wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h575b308e3e106cb6(arg0, arg1, addHeapObject(arg2));
229
229
  }
230
230
 
231
- function handleError(f, args) {
232
- try {
233
- return f.apply(this, args);
234
- } catch (e) {
235
- wasm.__wbindgen_exn_store(addHeapObject(e));
236
- }
237
- }
238
-
239
231
  function _assertClass(instance, klass) {
240
232
  if (!(instance instanceof klass)) {
241
233
  throw new Error(`expected instance of ${klass.name}`);
@@ -723,6 +715,14 @@ function addBorrowedObject(obj) {
723
715
  heap[--stack_pointer] = obj;
724
716
  return stack_pointer;
725
717
  }
718
+
719
+ function handleError(f, args) {
720
+ try {
721
+ return f.apply(this, args);
722
+ } catch (e) {
723
+ wasm.__wbindgen_exn_store(addHeapObject(e));
724
+ }
725
+ }
726
726
  function __wbg_adapter_424(arg0, arg1, arg2, arg3) {
727
727
  wasm.wasm_bindgen__convert__closures__invoke2_mut__h1d2fe914d97897fe(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
728
728
  }
@@ -2603,37 +2603,27 @@ class WasmWalletSlip {
2603
2603
  }
2604
2604
  module.exports.WasmWalletSlip = WasmWalletSlip;
2605
2605
 
2606
- module.exports.__wbindgen_string_new = function(arg0, arg1) {
2607
- const ret = getStringFromWasm0(arg0, arg1);
2608
- return addHeapObject(ret);
2609
- };
2610
-
2611
2606
  module.exports.__wbindgen_object_drop_ref = function(arg0) {
2612
2607
  takeObject(arg0);
2613
2608
  };
2614
2609
 
2615
- module.exports.__wbg_wasmtransaction_new = function(arg0) {
2616
- const ret = WasmTransaction.__wrap(arg0);
2617
- return addHeapObject(ret);
2618
- };
2619
-
2620
- module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
2621
- const ret = BigInt.asUintN(64, arg0);
2610
+ module.exports.__wbg_wasmwalletslip_new = function(arg0) {
2611
+ const ret = WasmWalletSlip.__wrap(arg0);
2622
2612
  return addHeapObject(ret);
2623
2613
  };
2624
2614
 
2625
- module.exports.__wbg_wasmwalletslip_new = function(arg0) {
2626
- const ret = WasmWalletSlip.__wrap(arg0);
2615
+ module.exports.__wbindgen_string_new = function(arg0, arg1) {
2616
+ const ret = getStringFromWasm0(arg0, arg1);
2627
2617
  return addHeapObject(ret);
2628
2618
  };
2629
2619
 
2630
- module.exports.__wbg_wasmblock_new = function(arg0) {
2631
- const ret = WasmBlock.__wrap(arg0);
2620
+ module.exports.__wbg_wasmtransaction_new = function(arg0) {
2621
+ const ret = WasmTransaction.__wrap(arg0);
2632
2622
  return addHeapObject(ret);
2633
2623
  };
2634
2624
 
2635
- module.exports.__wbg_wasmblockchain_new = function(arg0) {
2636
- const ret = WasmBlockchain.__wrap(arg0);
2625
+ module.exports.__wbg_wasmnft_new = function(arg0) {
2626
+ const ret = WasmNFT.__wrap(arg0);
2637
2627
  return addHeapObject(ret);
2638
2628
  };
2639
2629
 
@@ -2646,18 +2636,23 @@ module.exports.__wbindgen_string_get = function(arg0, arg1) {
2646
2636
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2647
2637
  };
2648
2638
 
2649
- module.exports.__wbg_wasmbalancesnapshot_new = function(arg0) {
2650
- const ret = WasmBalanceSnapshot.__wrap(arg0);
2639
+ module.exports.__wbg_wasmblock_new = function(arg0) {
2640
+ const ret = WasmBlock.__wrap(arg0);
2651
2641
  return addHeapObject(ret);
2652
2642
  };
2653
2643
 
2654
- module.exports.__wbg_wasmwallet_new = function(arg0) {
2655
- const ret = WasmWallet.__wrap(arg0);
2644
+ module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
2645
+ const ret = BigInt.asUintN(64, arg0);
2656
2646
  return addHeapObject(ret);
2657
2647
  };
2658
2648
 
2659
- module.exports.__wbg_wasmnft_new = function(arg0) {
2660
- const ret = WasmNFT.__wrap(arg0);
2649
+ module.exports.__wbg_wasmblockchain_new = function(arg0) {
2650
+ const ret = WasmBlockchain.__wrap(arg0);
2651
+ return addHeapObject(ret);
2652
+ };
2653
+
2654
+ module.exports.__wbg_wasmwallet_new = function(arg0) {
2655
+ const ret = WasmWallet.__wrap(arg0);
2661
2656
  return addHeapObject(ret);
2662
2657
  };
2663
2658
 
@@ -2671,6 +2666,26 @@ module.exports.__wbg_wasmslip_new = function(arg0) {
2671
2666
  return addHeapObject(ret);
2672
2667
  };
2673
2668
 
2669
+ module.exports.__wbg_wasmbalancesnapshot_new = function(arg0) {
2670
+ const ret = WasmBalanceSnapshot.__wrap(arg0);
2671
+ return addHeapObject(ret);
2672
+ };
2673
+
2674
+ module.exports.__wbg_wasmhop_new = function(arg0) {
2675
+ const ret = WasmHop.__wrap(arg0);
2676
+ return addHeapObject(ret);
2677
+ };
2678
+
2679
+ module.exports.__wbindgen_error_new = function(arg0, arg1) {
2680
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
2681
+ return addHeapObject(ret);
2682
+ };
2683
+
2684
+ module.exports.__wbg_wasmpeerservice_new = function(arg0) {
2685
+ const ret = WasmPeerService.__wrap(arg0);
2686
+ return addHeapObject(ret);
2687
+ };
2688
+
2674
2689
  module.exports.__wbindgen_is_object = function(arg0) {
2675
2690
  const val = getObject(arg0);
2676
2691
  const ret = typeof(val) === 'object' && val !== null;
@@ -2687,15 +2702,15 @@ module.exports.__wbindgen_in = function(arg0, arg1) {
2687
2702
  return ret;
2688
2703
  };
2689
2704
 
2690
- module.exports.__wbg_sendmessage_d0e06410fff34f9f = function(arg0, arg1) {
2705
+ module.exports.__wbg_sendmessage_6e594fa7741cf035 = function(arg0, arg1) {
2691
2706
  MsgHandler.send_message(takeObject(arg0), getObject(arg1));
2692
2707
  };
2693
2708
 
2694
- module.exports.__wbg_sendmessagetoall_b2330294b57f683e = function(arg0, arg1) {
2709
+ module.exports.__wbg_sendmessagetoall_0a81b286a3e2caf4 = function(arg0, arg1) {
2695
2710
  MsgHandler.send_message_to_all(getObject(arg0), getObject(arg1));
2696
2711
  };
2697
2712
 
2698
- module.exports.__wbg_connecttopeer_4a7e032cdcc7ece3 = function() { return handleError(function (arg0, arg1, arg2) {
2713
+ module.exports.__wbg_connecttopeer_8df68b1a973b3ffc = function() { return handleError(function (arg0, arg1, arg2) {
2699
2714
  let deferred0_0;
2700
2715
  let deferred0_1;
2701
2716
  try {
@@ -2708,12 +2723,12 @@ module.exports.__wbg_connecttopeer_4a7e032cdcc7ece3 = function() { return handle
2708
2723
  }
2709
2724
  }, arguments) };
2710
2725
 
2711
- module.exports.__wbg_disconnectfrompeer_4c1ff4e46907a233 = function() { return handleError(function (arg0) {
2726
+ module.exports.__wbg_disconnectfrompeer_0c6a6ca311bd81c1 = function() { return handleError(function (arg0) {
2712
2727
  const ret = MsgHandler.disconnect_from_peer(takeObject(arg0));
2713
2728
  return addHeapObject(ret);
2714
2729
  }, arguments) };
2715
2730
 
2716
- module.exports.__wbg_fetchblockfrompeer_34b697fd2793f1b6 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2731
+ module.exports.__wbg_fetchblockfrompeer_871ed124490e21f3 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2717
2732
  let deferred0_0;
2718
2733
  let deferred0_1;
2719
2734
  try {
@@ -2726,7 +2741,7 @@ module.exports.__wbg_fetchblockfrompeer_34b697fd2793f1b6 = function() { return h
2726
2741
  }
2727
2742
  }, arguments) };
2728
2743
 
2729
- module.exports.__wbg_writevalue_d2581b549eeb5c4a = function(arg0, arg1, arg2) {
2744
+ module.exports.__wbg_writevalue_940d2a5226813577 = function(arg0, arg1, arg2) {
2730
2745
  let deferred0_0;
2731
2746
  let deferred0_1;
2732
2747
  try {
@@ -2738,7 +2753,7 @@ module.exports.__wbg_writevalue_d2581b549eeb5c4a = function(arg0, arg1, arg2) {
2738
2753
  }
2739
2754
  };
2740
2755
 
2741
- module.exports.__wbg_appendvalue_2f0317c234604430 = function(arg0, arg1, arg2) {
2756
+ module.exports.__wbg_appendvalue_d9afbf079b04d813 = function(arg0, arg1, arg2) {
2742
2757
  let deferred0_0;
2743
2758
  let deferred0_1;
2744
2759
  try {
@@ -2750,7 +2765,7 @@ module.exports.__wbg_appendvalue_2f0317c234604430 = function(arg0, arg1, arg2) {
2750
2765
  }
2751
2766
  };
2752
2767
 
2753
- module.exports.__wbg_flushdata_ecad627b19d54427 = function(arg0, arg1) {
2768
+ module.exports.__wbg_flushdata_beeb205ca7770df9 = function(arg0, arg1) {
2754
2769
  let deferred0_0;
2755
2770
  let deferred0_1;
2756
2771
  try {
@@ -2762,7 +2777,7 @@ module.exports.__wbg_flushdata_ecad627b19d54427 = function(arg0, arg1) {
2762
2777
  }
2763
2778
  };
2764
2779
 
2765
- module.exports.__wbg_readvalue_2cf01bced3e50050 = function() { return handleError(function (arg0, arg1) {
2780
+ module.exports.__wbg_readvalue_05678ddbed986dca = function() { return handleError(function (arg0, arg1) {
2766
2781
  let deferred0_0;
2767
2782
  let deferred0_1;
2768
2783
  try {
@@ -2775,12 +2790,12 @@ module.exports.__wbg_readvalue_2cf01bced3e50050 = function() { return handleErro
2775
2790
  }
2776
2791
  }, arguments) };
2777
2792
 
2778
- module.exports.__wbg_loadblockfilelist_eb7c9d3d4df62209 = function() { return handleError(function () {
2793
+ module.exports.__wbg_loadblockfilelist_713c08a2ac2acd40 = function() { return handleError(function () {
2779
2794
  const ret = MsgHandler.load_block_file_list();
2780
2795
  return addHeapObject(ret);
2781
2796
  }, arguments) };
2782
2797
 
2783
- module.exports.__wbg_isexistingfile_4485ea39c2201d92 = function() { return handleError(function (arg0, arg1) {
2798
+ module.exports.__wbg_isexistingfile_89a361da624882df = function() { return handleError(function (arg0, arg1) {
2784
2799
  let deferred0_0;
2785
2800
  let deferred0_1;
2786
2801
  try {
@@ -2793,7 +2808,7 @@ module.exports.__wbg_isexistingfile_4485ea39c2201d92 = function() { return handl
2793
2808
  }
2794
2809
  }, arguments) };
2795
2810
 
2796
- module.exports.__wbg_removevalue_cc37642e2a0f3f93 = function() { return handleError(function (arg0, arg1) {
2811
+ module.exports.__wbg_removevalue_f63e94499415dacb = function() { return handleError(function (arg0, arg1) {
2797
2812
  let deferred0_0;
2798
2813
  let deferred0_1;
2799
2814
  try {
@@ -2806,7 +2821,7 @@ module.exports.__wbg_removevalue_cc37642e2a0f3f93 = function() { return handleEr
2806
2821
  }
2807
2822
  }, arguments) };
2808
2823
 
2809
- module.exports.__wbg_ensureblockdirectoryexists_7a89c316da8abeb7 = function() { return handleError(function (arg0, arg1) {
2824
+ module.exports.__wbg_ensureblockdirectoryexists_340f85e270785434 = function() { return handleError(function (arg0, arg1) {
2810
2825
  let deferred0_0;
2811
2826
  let deferred0_1;
2812
2827
  try {
@@ -2818,19 +2833,19 @@ module.exports.__wbg_ensureblockdirectoryexists_7a89c316da8abeb7 = function() {
2818
2833
  }
2819
2834
  }, arguments) };
2820
2835
 
2821
- module.exports.__wbg_processapicall_ec41cb6e4e986c5e = function(arg0, arg1, arg2) {
2836
+ module.exports.__wbg_processapicall_742ea540f3abc08b = function(arg0, arg1, arg2) {
2822
2837
  MsgHandler.process_api_call(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2823
2838
  };
2824
2839
 
2825
- module.exports.__wbg_processapisuccess_2b75673333585a5d = function(arg0, arg1, arg2) {
2840
+ module.exports.__wbg_processapisuccess_8f781d13c2cf3c11 = function(arg0, arg1, arg2) {
2826
2841
  MsgHandler.process_api_success(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2827
2842
  };
2828
2843
 
2829
- module.exports.__wbg_processapierror_f62de6fe14995b76 = function(arg0, arg1, arg2) {
2844
+ module.exports.__wbg_processapierror_dda74ca17c5c2d0c = function(arg0, arg1, arg2) {
2830
2845
  MsgHandler.process_api_error(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2831
2846
  };
2832
2847
 
2833
- module.exports.__wbg_sendinterfaceevent_5b837221da0f48ce = function(arg0, arg1, arg2, arg3, arg4) {
2848
+ module.exports.__wbg_sendinterfaceevent_2287d1381611df87 = function(arg0, arg1, arg2, arg3, arg4) {
2834
2849
  let deferred0_0;
2835
2850
  let deferred0_1;
2836
2851
  let deferred1_0;
@@ -2847,7 +2862,7 @@ module.exports.__wbg_sendinterfaceevent_5b837221da0f48ce = function(arg0, arg1,
2847
2862
  }
2848
2863
  };
2849
2864
 
2850
- module.exports.__wbg_sendblocksuccess_ce5dc56f76095a37 = function(arg0, arg1, arg2) {
2865
+ module.exports.__wbg_sendblocksuccess_3a5ff6043a85c7e7 = function(arg0, arg1, arg2) {
2851
2866
  let deferred0_0;
2852
2867
  let deferred0_1;
2853
2868
  try {
@@ -2859,11 +2874,11 @@ module.exports.__wbg_sendblocksuccess_ce5dc56f76095a37 = function(arg0, arg1, ar
2859
2874
  }
2860
2875
  };
2861
2876
 
2862
- module.exports.__wbg_sendwalletupdate_66d217b0538cffb9 = function() {
2877
+ module.exports.__wbg_sendwalletupdate_766b34b0cd38b949 = function() {
2863
2878
  MsgHandler.send_wallet_update();
2864
2879
  };
2865
2880
 
2866
- module.exports.__wbg_sendnewversionalert_497b5d3cb9566dc8 = function(arg0, arg1, arg2) {
2881
+ module.exports.__wbg_sendnewversionalert_e40b46e70c75599b = function(arg0, arg1, arg2) {
2867
2882
  let deferred0_0;
2868
2883
  let deferred0_1;
2869
2884
  try {
@@ -2875,40 +2890,25 @@ module.exports.__wbg_sendnewversionalert_497b5d3cb9566dc8 = function(arg0, arg1,
2875
2890
  }
2876
2891
  };
2877
2892
 
2878
- module.exports.__wbg_sendblockfetchstatusevent_213af79ffaab952b = function(arg0) {
2893
+ module.exports.__wbg_sendblockfetchstatusevent_17d223f37becb782 = function(arg0) {
2879
2894
  MsgHandler.send_block_fetch_status_event(BigInt.asUintN(64, arg0));
2880
2895
  };
2881
2896
 
2882
- module.exports.__wbg_savewallet_ce62d845625e4c60 = function() {
2897
+ module.exports.__wbg_savewallet_d75d83cda9dbc6bc = function() {
2883
2898
  MsgHandler.save_wallet();
2884
2899
  };
2885
2900
 
2886
- module.exports.__wbg_loadwallet_c7ef93181a027f77 = function() {
2901
+ module.exports.__wbg_loadwallet_76ff5120d6dfda7b = function() {
2887
2902
  MsgHandler.load_wallet();
2888
2903
  };
2889
2904
 
2890
- module.exports.__wbg_getmyservices_5c453dad0c5de4b1 = function() {
2905
+ module.exports.__wbg_getmyservices_30981cf57468e07b = function() {
2891
2906
  const ret = MsgHandler.get_my_services();
2892
2907
  _assertClass(ret, WasmPeerServiceList);
2893
2908
  var ptr1 = ret.__destroy_into_raw();
2894
2909
  return ptr1;
2895
2910
  };
2896
2911
 
2897
- module.exports.__wbg_wasmpeerservice_new = function(arg0) {
2898
- const ret = WasmPeerService.__wrap(arg0);
2899
- return addHeapObject(ret);
2900
- };
2901
-
2902
- module.exports.__wbindgen_error_new = function(arg0, arg1) {
2903
- const ret = new Error(getStringFromWasm0(arg0, arg1));
2904
- return addHeapObject(ret);
2905
- };
2906
-
2907
- module.exports.__wbg_wasmhop_new = function(arg0) {
2908
- const ret = WasmHop.__wrap(arg0);
2909
- return addHeapObject(ret);
2910
- };
2911
-
2912
2912
  module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
2913
2913
  const ret = getObject(arg0) == getObject(arg1);
2914
2914
  return ret;
@@ -3275,8 +3275,8 @@ module.exports.__wbindgen_memory = function() {
3275
3275
  return addHeapObject(ret);
3276
3276
  };
3277
3277
 
3278
- module.exports.__wbindgen_closure_wrapper1511 = function(arg0, arg1, arg2) {
3279
- const ret = makeMutClosure(arg0, arg1, 541, __wbg_adapter_38);
3278
+ module.exports.__wbindgen_closure_wrapper1509 = function(arg0, arg1, arg2) {
3279
+ const ret = makeMutClosure(arg0, arg1, 540, __wbg_adapter_38);
3280
3280
  return addHeapObject(ret);
3281
3281
  };
3282
3282
 
Binary file