saito-wasm 0.2.53 → 0.2.54

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.53"
3
+ version = "0.2.54"
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.53",
3
+ "version": "0.2.54",
4
4
  "description": "js wrappings around saito-core using wasm",
5
5
  "scripts": {
6
6
  "test": "./node_modules/.bin/jest",
@@ -577,6 +577,9 @@ export class WasmPeer {
577
577
  */
578
578
  services: any;
579
579
  /**
580
+ */
581
+ readonly status: string;
582
+ /**
580
583
  */
581
584
  readonly sync_type: string;
582
585
  }
package/pkg/node/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  let imports = {};
2
2
  imports['__wbindgen_placeholder__'] = module.exports;
3
3
  let wasm;
4
- const { MsgHandler } = require(String.raw`./snippets/saito-wasm-7188d2801187666b/js/msg_handler.js`);
5
- const { TextEncoder, TextDecoder } = require(`util`);
4
+ const { MsgHandler } = require(String.raw`./snippets/saito-wasm-e43993b09b19fc81/js/msg_handler.js`);
5
+ const { TextDecoder, TextEncoder } = require(`util`);
6
6
 
7
7
  const heap = new Array(128).fill(undefined);
8
8
 
@@ -24,16 +24,9 @@ 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
- }
27
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
35
28
 
36
- let WASM_VECTOR_LEN = 0;
29
+ cachedTextDecoder.decode();
37
30
 
38
31
  let cachedUint8Memory0 = null;
39
32
 
@@ -44,6 +37,22 @@ function getUint8Memory0() {
44
37
  return cachedUint8Memory0;
45
38
  }
46
39
 
40
+ function getStringFromWasm0(ptr, len) {
41
+ ptr = ptr >>> 0;
42
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
43
+ }
44
+
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
+ let WASM_VECTOR_LEN = 0;
55
+
47
56
  let cachedTextEncoder = new TextEncoder('utf-8');
48
57
 
49
58
  const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
@@ -111,15 +120,6 @@ function getInt32Memory0() {
111
120
  return cachedInt32Memory0;
112
121
  }
113
122
 
114
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
115
-
116
- cachedTextDecoder.decode();
117
-
118
- function getStringFromWasm0(ptr, len) {
119
- ptr = ptr >>> 0;
120
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
121
- }
122
-
123
123
  let cachedFloat64Memory0 = null;
124
124
 
125
125
  function getFloat64Memory0() {
@@ -626,7 +626,7 @@ function handleError(f, args) {
626
626
  wasm.__wbindgen_exn_store(addHeapObject(e));
627
627
  }
628
628
  }
629
- function __wbg_adapter_402(arg0, arg1, arg2, arg3) {
629
+ function __wbg_adapter_403(arg0, arg1, arg2, arg3) {
630
630
  wasm.wasm_bindgen__convert__closures__invoke2_mut__h0c01c5600db7d9cc(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
631
631
  }
632
632
 
@@ -1626,6 +1626,13 @@ class WasmPeer {
1626
1626
  const ret = wasm.wasmpeer_has_service(this.__wbg_ptr, addHeapObject(service));
1627
1627
  return ret !== 0;
1628
1628
  }
1629
+ /**
1630
+ * @returns {string}
1631
+ */
1632
+ get status() {
1633
+ const ret = wasm.wasmpeer_get_status(this.__wbg_ptr);
1634
+ return takeObject(ret);
1635
+ }
1629
1636
  }
1630
1637
  module.exports.WasmPeer = WasmPeer;
1631
1638
 
@@ -2341,47 +2348,33 @@ module.exports.__wbindgen_object_drop_ref = function(arg0) {
2341
2348
  takeObject(arg0);
2342
2349
  };
2343
2350
 
2344
- module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
2345
- const ret = BigInt.asUintN(64, arg0);
2346
- return addHeapObject(ret);
2347
- };
2348
-
2349
- module.exports.__wbg_wasmwalletslip_new = function(arg0) {
2350
- const ret = WasmWalletSlip.__wrap(arg0);
2351
+ module.exports.__wbg_wasmtransaction_new = function(arg0) {
2352
+ const ret = WasmTransaction.__wrap(arg0);
2351
2353
  return addHeapObject(ret);
2352
2354
  };
2353
2355
 
2354
- module.exports.__wbindgen_string_get = function(arg0, arg1) {
2355
- const obj = getObject(arg1);
2356
- const ret = typeof(obj) === 'string' ? obj : undefined;
2357
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2358
- var len1 = WASM_VECTOR_LEN;
2359
- getInt32Memory0()[arg0 / 4 + 1] = len1;
2360
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2361
- };
2362
-
2363
- module.exports.__wbg_wasmblockchain_new = function(arg0) {
2364
- const ret = WasmBlockchain.__wrap(arg0);
2356
+ module.exports.__wbindgen_string_new = function(arg0, arg1) {
2357
+ const ret = getStringFromWasm0(arg0, arg1);
2365
2358
  return addHeapObject(ret);
2366
2359
  };
2367
2360
 
2368
- module.exports.__wbg_wasmpeer_new = function(arg0) {
2369
- const ret = WasmPeer.__wrap(arg0);
2361
+ module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
2362
+ const ret = BigInt.asUintN(64, arg0);
2370
2363
  return addHeapObject(ret);
2371
2364
  };
2372
2365
 
2373
- module.exports.__wbg_wasmbalancesnapshot_new = function(arg0) {
2374
- const ret = WasmBalanceSnapshot.__wrap(arg0);
2366
+ module.exports.__wbg_wasmblock_new = function(arg0) {
2367
+ const ret = WasmBlock.__wrap(arg0);
2375
2368
  return addHeapObject(ret);
2376
2369
  };
2377
2370
 
2378
- module.exports.__wbindgen_string_new = function(arg0, arg1) {
2379
- const ret = getStringFromWasm0(arg0, arg1);
2371
+ module.exports.__wbg_wasmblockchain_new = function(arg0) {
2372
+ const ret = WasmBlockchain.__wrap(arg0);
2380
2373
  return addHeapObject(ret);
2381
2374
  };
2382
2375
 
2383
- module.exports.__wbg_wasmtransaction_new = function(arg0) {
2384
- const ret = WasmTransaction.__wrap(arg0);
2376
+ module.exports.__wbg_wasmwalletslip_new = function(arg0) {
2377
+ const ret = WasmWalletSlip.__wrap(arg0);
2385
2378
  return addHeapObject(ret);
2386
2379
  };
2387
2380
 
@@ -2395,11 +2388,25 @@ module.exports.__wbg_wasmwallet_new = function(arg0) {
2395
2388
  return addHeapObject(ret);
2396
2389
  };
2397
2390
 
2398
- module.exports.__wbg_wasmblock_new = function(arg0) {
2399
- const ret = WasmBlock.__wrap(arg0);
2391
+ module.exports.__wbg_wasmpeer_new = function(arg0) {
2392
+ const ret = WasmPeer.__wrap(arg0);
2393
+ return addHeapObject(ret);
2394
+ };
2395
+
2396
+ module.exports.__wbg_wasmbalancesnapshot_new = function(arg0) {
2397
+ const ret = WasmBalanceSnapshot.__wrap(arg0);
2400
2398
  return addHeapObject(ret);
2401
2399
  };
2402
2400
 
2401
+ module.exports.__wbindgen_string_get = function(arg0, arg1) {
2402
+ const obj = getObject(arg1);
2403
+ const ret = typeof(obj) === 'string' ? obj : undefined;
2404
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2405
+ var len1 = WASM_VECTOR_LEN;
2406
+ getInt32Memory0()[arg0 / 4 + 1] = len1;
2407
+ getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2408
+ };
2409
+
2403
2410
  module.exports.__wbg_wasmpeerservice_new = function(arg0) {
2404
2411
  const ret = WasmPeerService.__wrap(arg0);
2405
2412
  return addHeapObject(ret);
@@ -2431,15 +2438,15 @@ module.exports.__wbindgen_error_new = function(arg0, arg1) {
2431
2438
  return addHeapObject(ret);
2432
2439
  };
2433
2440
 
2434
- module.exports.__wbg_sendmessage_ff9bbdf18bf6e102 = function(arg0, arg1) {
2441
+ module.exports.__wbg_sendmessage_109371eeaf1fb442 = function(arg0, arg1) {
2435
2442
  MsgHandler.send_message(takeObject(arg0), getObject(arg1));
2436
2443
  };
2437
2444
 
2438
- module.exports.__wbg_sendmessagetoall_1fa66acb52d3be50 = function(arg0, arg1) {
2445
+ module.exports.__wbg_sendmessagetoall_5478be26f0b02d42 = function(arg0, arg1) {
2439
2446
  MsgHandler.send_message_to_all(getObject(arg0), getObject(arg1));
2440
2447
  };
2441
2448
 
2442
- module.exports.__wbg_connecttopeer_ba955a5f63c25657 = function() { return handleError(function (arg0, arg1, arg2) {
2449
+ module.exports.__wbg_connecttopeer_03c0f3fae8f8544a = function() { return handleError(function (arg0, arg1, arg2) {
2443
2450
  let deferred0_0;
2444
2451
  let deferred0_1;
2445
2452
  try {
@@ -2452,12 +2459,12 @@ module.exports.__wbg_connecttopeer_ba955a5f63c25657 = function() { return handle
2452
2459
  }
2453
2460
  }, arguments) };
2454
2461
 
2455
- module.exports.__wbg_disconnectfrompeer_05a35deded8da1b6 = function() { return handleError(function (arg0) {
2462
+ module.exports.__wbg_disconnectfrompeer_1c30bee24f20fb95 = function() { return handleError(function (arg0) {
2456
2463
  const ret = MsgHandler.disconnect_from_peer(takeObject(arg0));
2457
2464
  return addHeapObject(ret);
2458
2465
  }, arguments) };
2459
2466
 
2460
- module.exports.__wbg_fetchblockfrompeer_4fd80c73d179dc95 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2467
+ module.exports.__wbg_fetchblockfrompeer_e2201fc411b7867d = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2461
2468
  let deferred0_0;
2462
2469
  let deferred0_1;
2463
2470
  try {
@@ -2470,7 +2477,7 @@ module.exports.__wbg_fetchblockfrompeer_4fd80c73d179dc95 = function() { return h
2470
2477
  }
2471
2478
  }, arguments) };
2472
2479
 
2473
- module.exports.__wbg_writevalue_ed5964748d666a01 = function(arg0, arg1, arg2) {
2480
+ module.exports.__wbg_writevalue_b8bbfdc4d1e4d276 = function(arg0, arg1, arg2) {
2474
2481
  let deferred0_0;
2475
2482
  let deferred0_1;
2476
2483
  try {
@@ -2482,7 +2489,7 @@ module.exports.__wbg_writevalue_ed5964748d666a01 = function(arg0, arg1, arg2) {
2482
2489
  }
2483
2490
  };
2484
2491
 
2485
- module.exports.__wbg_appendvalue_1d32d77194e5cea2 = function(arg0, arg1, arg2) {
2492
+ module.exports.__wbg_appendvalue_59202351dc3c3750 = function(arg0, arg1, arg2) {
2486
2493
  let deferred0_0;
2487
2494
  let deferred0_1;
2488
2495
  try {
@@ -2494,7 +2501,7 @@ module.exports.__wbg_appendvalue_1d32d77194e5cea2 = function(arg0, arg1, arg2) {
2494
2501
  }
2495
2502
  };
2496
2503
 
2497
- module.exports.__wbg_flushdata_80f9bbed01e0e58a = function(arg0, arg1) {
2504
+ module.exports.__wbg_flushdata_b4cd4de56d788a5a = function(arg0, arg1) {
2498
2505
  let deferred0_0;
2499
2506
  let deferred0_1;
2500
2507
  try {
@@ -2506,7 +2513,7 @@ module.exports.__wbg_flushdata_80f9bbed01e0e58a = function(arg0, arg1) {
2506
2513
  }
2507
2514
  };
2508
2515
 
2509
- module.exports.__wbg_readvalue_781fb638c5a547ce = function() { return handleError(function (arg0, arg1) {
2516
+ module.exports.__wbg_readvalue_7852ac963511cc8c = function() { return handleError(function (arg0, arg1) {
2510
2517
  let deferred0_0;
2511
2518
  let deferred0_1;
2512
2519
  try {
@@ -2519,12 +2526,12 @@ module.exports.__wbg_readvalue_781fb638c5a547ce = function() { return handleErro
2519
2526
  }
2520
2527
  }, arguments) };
2521
2528
 
2522
- module.exports.__wbg_loadblockfilelist_51f146190f327d8d = function() { return handleError(function () {
2529
+ module.exports.__wbg_loadblockfilelist_e71588826f9de2c7 = function() { return handleError(function () {
2523
2530
  const ret = MsgHandler.load_block_file_list();
2524
2531
  return addHeapObject(ret);
2525
2532
  }, arguments) };
2526
2533
 
2527
- module.exports.__wbg_isexistingfile_c3bf9aeee5b392fb = function() { return handleError(function (arg0, arg1) {
2534
+ module.exports.__wbg_isexistingfile_41c7f491b58e322e = function() { return handleError(function (arg0, arg1) {
2528
2535
  let deferred0_0;
2529
2536
  let deferred0_1;
2530
2537
  try {
@@ -2537,7 +2544,7 @@ module.exports.__wbg_isexistingfile_c3bf9aeee5b392fb = function() { return handl
2537
2544
  }
2538
2545
  }, arguments) };
2539
2546
 
2540
- module.exports.__wbg_removevalue_63db73e5efaaa0d2 = function() { return handleError(function (arg0, arg1) {
2547
+ module.exports.__wbg_removevalue_531e7cfbe67deea7 = function() { return handleError(function (arg0, arg1) {
2541
2548
  let deferred0_0;
2542
2549
  let deferred0_1;
2543
2550
  try {
@@ -2550,7 +2557,7 @@ module.exports.__wbg_removevalue_63db73e5efaaa0d2 = function() { return handleEr
2550
2557
  }
2551
2558
  }, arguments) };
2552
2559
 
2553
- module.exports.__wbg_ensureblockdirectoryexists_972815925b1f6f00 = function() { return handleError(function (arg0, arg1) {
2560
+ module.exports.__wbg_ensureblockdirectoryexists_296ba406e9f3e694 = function() { return handleError(function (arg0, arg1) {
2554
2561
  let deferred0_0;
2555
2562
  let deferred0_1;
2556
2563
  try {
@@ -2562,19 +2569,19 @@ module.exports.__wbg_ensureblockdirectoryexists_972815925b1f6f00 = function() {
2562
2569
  }
2563
2570
  }, arguments) };
2564
2571
 
2565
- module.exports.__wbg_processapicall_2100eb96cb495341 = function(arg0, arg1, arg2) {
2572
+ module.exports.__wbg_processapicall_7ef2b67a9bfa7b6e = function(arg0, arg1, arg2) {
2566
2573
  MsgHandler.process_api_call(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2567
2574
  };
2568
2575
 
2569
- module.exports.__wbg_processapisuccess_dd75c157d0050a9b = function(arg0, arg1, arg2) {
2576
+ module.exports.__wbg_processapisuccess_2bf4d82b9815ec32 = function(arg0, arg1, arg2) {
2570
2577
  MsgHandler.process_api_success(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2571
2578
  };
2572
2579
 
2573
- module.exports.__wbg_processapierror_2d6a8ec426e34920 = function(arg0, arg1, arg2) {
2580
+ module.exports.__wbg_processapierror_a80ab983d780e05d = function(arg0, arg1, arg2) {
2574
2581
  MsgHandler.process_api_error(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2575
2582
  };
2576
2583
 
2577
- module.exports.__wbg_sendinterfaceevent_bae7ab1f7a67949d = function(arg0, arg1, arg2, arg3, arg4) {
2584
+ module.exports.__wbg_sendinterfaceevent_3cf6a87ed61cbc1f = function(arg0, arg1, arg2, arg3, arg4) {
2578
2585
  let deferred0_0;
2579
2586
  let deferred0_1;
2580
2587
  let deferred1_0;
@@ -2591,7 +2598,7 @@ module.exports.__wbg_sendinterfaceevent_bae7ab1f7a67949d = function(arg0, arg1,
2591
2598
  }
2592
2599
  };
2593
2600
 
2594
- module.exports.__wbg_sendblocksuccess_620687d6b1efda22 = function(arg0, arg1, arg2) {
2601
+ module.exports.__wbg_sendblocksuccess_0afc702da42cdf1d = function(arg0, arg1, arg2) {
2595
2602
  let deferred0_0;
2596
2603
  let deferred0_1;
2597
2604
  try {
@@ -2603,11 +2610,11 @@ module.exports.__wbg_sendblocksuccess_620687d6b1efda22 = function(arg0, arg1, ar
2603
2610
  }
2604
2611
  };
2605
2612
 
2606
- module.exports.__wbg_sendwalletupdate_aeb10d8928d2fd32 = function() {
2613
+ module.exports.__wbg_sendwalletupdate_825760db251b5ac8 = function() {
2607
2614
  MsgHandler.send_wallet_update();
2608
2615
  };
2609
2616
 
2610
- module.exports.__wbg_sendnewversionalert_c6883c89e68d3b0b = function(arg0, arg1, arg2) {
2617
+ module.exports.__wbg_sendnewversionalert_f64ad7412651900e = function(arg0, arg1, arg2) {
2611
2618
  let deferred0_0;
2612
2619
  let deferred0_1;
2613
2620
  try {
@@ -2619,19 +2626,19 @@ module.exports.__wbg_sendnewversionalert_c6883c89e68d3b0b = function(arg0, arg1,
2619
2626
  }
2620
2627
  };
2621
2628
 
2622
- module.exports.__wbg_sendblockfetchstatusevent_a1634ba7324fca9c = function(arg0) {
2629
+ module.exports.__wbg_sendblockfetchstatusevent_b4841acfbddb2c36 = function(arg0) {
2623
2630
  MsgHandler.send_block_fetch_status_event(BigInt.asUintN(64, arg0));
2624
2631
  };
2625
2632
 
2626
- module.exports.__wbg_savewallet_63463ed9dd3bf927 = function() {
2633
+ module.exports.__wbg_savewallet_822312e93069770a = function() {
2627
2634
  MsgHandler.save_wallet();
2628
2635
  };
2629
2636
 
2630
- module.exports.__wbg_loadwallet_a14ffbfff10a4a4d = function() {
2637
+ module.exports.__wbg_loadwallet_bd192f2485618365 = function() {
2631
2638
  MsgHandler.load_wallet();
2632
2639
  };
2633
2640
 
2634
- module.exports.__wbg_getmyservices_2002c47f4428f89d = function() {
2641
+ module.exports.__wbg_getmyservices_19454e925feaded2 = function() {
2635
2642
  const ret = MsgHandler.get_my_services();
2636
2643
  _assertClass(ret, WasmPeerServiceList);
2637
2644
  var ptr1 = ret.__destroy_into_raw();
@@ -2910,7 +2917,7 @@ module.exports.__wbg_new_81740750da40724f = function(arg0, arg1) {
2910
2917
  const a = state0.a;
2911
2918
  state0.a = 0;
2912
2919
  try {
2913
- return __wbg_adapter_402(a, state0.b, arg0, arg1);
2920
+ return __wbg_adapter_403(a, state0.b, arg0, arg1);
2914
2921
  } finally {
2915
2922
  state0.a = a;
2916
2923
  }
@@ -3008,7 +3015,7 @@ module.exports.__wbindgen_memory = function() {
3008
3015
  return addHeapObject(ret);
3009
3016
  };
3010
3017
 
3011
- module.exports.__wbindgen_closure_wrapper1339 = function(arg0, arg1, arg2) {
3018
+ module.exports.__wbindgen_closure_wrapper1341 = function(arg0, arg1, arg2) {
3012
3019
  const ret = makeMutClosure(arg0, arg1, 472, __wbg_adapter_38);
3013
3020
  return addHeapObject(ret);
3014
3021
  };
Binary file
@@ -14,6 +14,7 @@ export function wasmpeer_get_sync_type(a: number): number;
14
14
  export function wasmpeer_get_services(a: number): number;
15
15
  export function wasmpeer_set_services(a: number, b: number): void;
16
16
  export function wasmpeer_has_service(a: number, b: number): number;
17
+ export function wasmpeer_get_status(a: number): number;
17
18
  export function __wbg_wasmslip_free(a: number): void;
18
19
  export function wasmslip_amount(a: number): number;
19
20
  export function wasmslip_set_amount(a: number, b: number): void;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saito-wasm",
3
- "version": "0.2.53",
3
+ "version": "0.2.54",
4
4
  "files": [
5
5
  "index_bg.wasm",
6
6
  "index.js",
@@ -577,6 +577,9 @@ export class WasmPeer {
577
577
  */
578
578
  services: any;
579
579
  /**
580
+ */
581
+ readonly status: string;
582
+ /**
580
583
  */
581
584
  readonly sync_type: string;
582
585
  }
@@ -861,6 +864,7 @@ export interface InitOutput {
861
864
  readonly wasmpeer_get_services: (a: number) => number;
862
865
  readonly wasmpeer_set_services: (a: number, b: number) => void;
863
866
  readonly wasmpeer_has_service: (a: number, b: number) => number;
867
+ readonly wasmpeer_get_status: (a: number) => number;
864
868
  readonly __wbg_wasmslip_free: (a: number) => void;
865
869
  readonly wasmslip_amount: (a: number) => number;
866
870
  readonly wasmslip_set_amount: (a: number, b: number) => void;
package/pkg/web/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { MsgHandler } from './snippets/saito-wasm-7188d2801187666b/js/msg_handler.js';
1
+ import { MsgHandler } from './snippets/saito-wasm-e43993b09b19fc81/js/msg_handler.js';
2
2
 
3
3
  let wasm;
4
4
 
@@ -22,16 +22,9 @@ function takeObject(idx) {
22
22
  return ret;
23
23
  }
24
24
 
25
- function addHeapObject(obj) {
26
- if (heap_next === heap.length) heap.push(heap.length + 1);
27
- const idx = heap_next;
28
- heap_next = heap[idx];
29
-
30
- heap[idx] = obj;
31
- return idx;
32
- }
25
+ const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
33
26
 
34
- let WASM_VECTOR_LEN = 0;
27
+ if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
35
28
 
36
29
  let cachedUint8Memory0 = null;
37
30
 
@@ -42,6 +35,22 @@ function getUint8Memory0() {
42
35
  return cachedUint8Memory0;
43
36
  }
44
37
 
38
+ function getStringFromWasm0(ptr, len) {
39
+ ptr = ptr >>> 0;
40
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
41
+ }
42
+
43
+ function addHeapObject(obj) {
44
+ if (heap_next === heap.length) heap.push(heap.length + 1);
45
+ const idx = heap_next;
46
+ heap_next = heap[idx];
47
+
48
+ heap[idx] = obj;
49
+ return idx;
50
+ }
51
+
52
+ let WASM_VECTOR_LEN = 0;
53
+
45
54
  const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
46
55
 
47
56
  const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
@@ -109,15 +118,6 @@ function getInt32Memory0() {
109
118
  return cachedInt32Memory0;
110
119
  }
111
120
 
112
- const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
113
-
114
- if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
115
-
116
- function getStringFromWasm0(ptr, len) {
117
- ptr = ptr >>> 0;
118
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
119
- }
120
-
121
121
  let cachedFloat64Memory0 = null;
122
122
 
123
123
  function getFloat64Memory0() {
@@ -624,7 +624,7 @@ function handleError(f, args) {
624
624
  wasm.__wbindgen_exn_store(addHeapObject(e));
625
625
  }
626
626
  }
627
- function __wbg_adapter_402(arg0, arg1, arg2, arg3) {
627
+ function __wbg_adapter_403(arg0, arg1, arg2, arg3) {
628
628
  wasm.wasm_bindgen__convert__closures__invoke2_mut__h0c01c5600db7d9cc(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
629
629
  }
630
630
 
@@ -1617,6 +1617,13 @@ export class WasmPeer {
1617
1617
  const ret = wasm.wasmpeer_has_service(this.__wbg_ptr, addHeapObject(service));
1618
1618
  return ret !== 0;
1619
1619
  }
1620
+ /**
1621
+ * @returns {string}
1622
+ */
1623
+ get status() {
1624
+ const ret = wasm.wasmpeer_get_status(this.__wbg_ptr);
1625
+ return takeObject(ret);
1626
+ }
1620
1627
  }
1621
1628
 
1622
1629
  const WasmPeerServiceFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -2358,40 +2365,28 @@ function __wbg_get_imports() {
2358
2365
  imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
2359
2366
  takeObject(arg0);
2360
2367
  };
2361
- imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
2362
- const ret = BigInt.asUintN(64, arg0);
2363
- return addHeapObject(ret);
2364
- };
2365
- imports.wbg.__wbg_wasmwalletslip_new = function(arg0) {
2366
- const ret = WasmWalletSlip.__wrap(arg0);
2368
+ imports.wbg.__wbg_wasmtransaction_new = function(arg0) {
2369
+ const ret = WasmTransaction.__wrap(arg0);
2367
2370
  return addHeapObject(ret);
2368
2371
  };
2369
- imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
2370
- const obj = getObject(arg1);
2371
- const ret = typeof(obj) === 'string' ? obj : undefined;
2372
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2373
- var len1 = WASM_VECTOR_LEN;
2374
- getInt32Memory0()[arg0 / 4 + 1] = len1;
2375
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2376
- };
2377
- imports.wbg.__wbg_wasmblockchain_new = function(arg0) {
2378
- const ret = WasmBlockchain.__wrap(arg0);
2372
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
2373
+ const ret = getStringFromWasm0(arg0, arg1);
2379
2374
  return addHeapObject(ret);
2380
2375
  };
2381
- imports.wbg.__wbg_wasmpeer_new = function(arg0) {
2382
- const ret = WasmPeer.__wrap(arg0);
2376
+ imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
2377
+ const ret = BigInt.asUintN(64, arg0);
2383
2378
  return addHeapObject(ret);
2384
2379
  };
2385
- imports.wbg.__wbg_wasmbalancesnapshot_new = function(arg0) {
2386
- const ret = WasmBalanceSnapshot.__wrap(arg0);
2380
+ imports.wbg.__wbg_wasmblock_new = function(arg0) {
2381
+ const ret = WasmBlock.__wrap(arg0);
2387
2382
  return addHeapObject(ret);
2388
2383
  };
2389
- imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
2390
- const ret = getStringFromWasm0(arg0, arg1);
2384
+ imports.wbg.__wbg_wasmblockchain_new = function(arg0) {
2385
+ const ret = WasmBlockchain.__wrap(arg0);
2391
2386
  return addHeapObject(ret);
2392
2387
  };
2393
- imports.wbg.__wbg_wasmtransaction_new = function(arg0) {
2394
- const ret = WasmTransaction.__wrap(arg0);
2388
+ imports.wbg.__wbg_wasmwalletslip_new = function(arg0) {
2389
+ const ret = WasmWalletSlip.__wrap(arg0);
2395
2390
  return addHeapObject(ret);
2396
2391
  };
2397
2392
  imports.wbg.__wbg_wasmslip_new = function(arg0) {
@@ -2402,10 +2397,22 @@ function __wbg_get_imports() {
2402
2397
  const ret = WasmWallet.__wrap(arg0);
2403
2398
  return addHeapObject(ret);
2404
2399
  };
2405
- imports.wbg.__wbg_wasmblock_new = function(arg0) {
2406
- const ret = WasmBlock.__wrap(arg0);
2400
+ imports.wbg.__wbg_wasmpeer_new = function(arg0) {
2401
+ const ret = WasmPeer.__wrap(arg0);
2407
2402
  return addHeapObject(ret);
2408
2403
  };
2404
+ imports.wbg.__wbg_wasmbalancesnapshot_new = function(arg0) {
2405
+ const ret = WasmBalanceSnapshot.__wrap(arg0);
2406
+ return addHeapObject(ret);
2407
+ };
2408
+ imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
2409
+ const obj = getObject(arg1);
2410
+ const ret = typeof(obj) === 'string' ? obj : undefined;
2411
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2412
+ var len1 = WASM_VECTOR_LEN;
2413
+ getInt32Memory0()[arg0 / 4 + 1] = len1;
2414
+ getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2415
+ };
2409
2416
  imports.wbg.__wbg_wasmpeerservice_new = function(arg0) {
2410
2417
  const ret = WasmPeerService.__wrap(arg0);
2411
2418
  return addHeapObject(ret);
@@ -2431,13 +2438,13 @@ function __wbg_get_imports() {
2431
2438
  const ret = new Error(getStringFromWasm0(arg0, arg1));
2432
2439
  return addHeapObject(ret);
2433
2440
  };
2434
- imports.wbg.__wbg_sendmessage_ff9bbdf18bf6e102 = function(arg0, arg1) {
2441
+ imports.wbg.__wbg_sendmessage_109371eeaf1fb442 = function(arg0, arg1) {
2435
2442
  MsgHandler.send_message(takeObject(arg0), getObject(arg1));
2436
2443
  };
2437
- imports.wbg.__wbg_sendmessagetoall_1fa66acb52d3be50 = function(arg0, arg1) {
2444
+ imports.wbg.__wbg_sendmessagetoall_5478be26f0b02d42 = function(arg0, arg1) {
2438
2445
  MsgHandler.send_message_to_all(getObject(arg0), getObject(arg1));
2439
2446
  };
2440
- imports.wbg.__wbg_connecttopeer_ba955a5f63c25657 = function() { return handleError(function (arg0, arg1, arg2) {
2447
+ imports.wbg.__wbg_connecttopeer_03c0f3fae8f8544a = function() { return handleError(function (arg0, arg1, arg2) {
2441
2448
  let deferred0_0;
2442
2449
  let deferred0_1;
2443
2450
  try {
@@ -2449,11 +2456,11 @@ function __wbg_get_imports() {
2449
2456
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2450
2457
  }
2451
2458
  }, arguments) };
2452
- imports.wbg.__wbg_disconnectfrompeer_05a35deded8da1b6 = function() { return handleError(function (arg0) {
2459
+ imports.wbg.__wbg_disconnectfrompeer_1c30bee24f20fb95 = function() { return handleError(function (arg0) {
2453
2460
  const ret = MsgHandler.disconnect_from_peer(takeObject(arg0));
2454
2461
  return addHeapObject(ret);
2455
2462
  }, arguments) };
2456
- imports.wbg.__wbg_fetchblockfrompeer_4fd80c73d179dc95 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2463
+ imports.wbg.__wbg_fetchblockfrompeer_e2201fc411b7867d = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2457
2464
  let deferred0_0;
2458
2465
  let deferred0_1;
2459
2466
  try {
@@ -2465,7 +2472,7 @@ function __wbg_get_imports() {
2465
2472
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2466
2473
  }
2467
2474
  }, arguments) };
2468
- imports.wbg.__wbg_writevalue_ed5964748d666a01 = function(arg0, arg1, arg2) {
2475
+ imports.wbg.__wbg_writevalue_b8bbfdc4d1e4d276 = function(arg0, arg1, arg2) {
2469
2476
  let deferred0_0;
2470
2477
  let deferred0_1;
2471
2478
  try {
@@ -2476,7 +2483,7 @@ function __wbg_get_imports() {
2476
2483
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2477
2484
  }
2478
2485
  };
2479
- imports.wbg.__wbg_appendvalue_1d32d77194e5cea2 = function(arg0, arg1, arg2) {
2486
+ imports.wbg.__wbg_appendvalue_59202351dc3c3750 = function(arg0, arg1, arg2) {
2480
2487
  let deferred0_0;
2481
2488
  let deferred0_1;
2482
2489
  try {
@@ -2487,7 +2494,7 @@ function __wbg_get_imports() {
2487
2494
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2488
2495
  }
2489
2496
  };
2490
- imports.wbg.__wbg_flushdata_80f9bbed01e0e58a = function(arg0, arg1) {
2497
+ imports.wbg.__wbg_flushdata_b4cd4de56d788a5a = function(arg0, arg1) {
2491
2498
  let deferred0_0;
2492
2499
  let deferred0_1;
2493
2500
  try {
@@ -2498,7 +2505,7 @@ function __wbg_get_imports() {
2498
2505
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2499
2506
  }
2500
2507
  };
2501
- imports.wbg.__wbg_readvalue_781fb638c5a547ce = function() { return handleError(function (arg0, arg1) {
2508
+ imports.wbg.__wbg_readvalue_7852ac963511cc8c = function() { return handleError(function (arg0, arg1) {
2502
2509
  let deferred0_0;
2503
2510
  let deferred0_1;
2504
2511
  try {
@@ -2510,11 +2517,11 @@ function __wbg_get_imports() {
2510
2517
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2511
2518
  }
2512
2519
  }, arguments) };
2513
- imports.wbg.__wbg_loadblockfilelist_51f146190f327d8d = function() { return handleError(function () {
2520
+ imports.wbg.__wbg_loadblockfilelist_e71588826f9de2c7 = function() { return handleError(function () {
2514
2521
  const ret = MsgHandler.load_block_file_list();
2515
2522
  return addHeapObject(ret);
2516
2523
  }, arguments) };
2517
- imports.wbg.__wbg_isexistingfile_c3bf9aeee5b392fb = function() { return handleError(function (arg0, arg1) {
2524
+ imports.wbg.__wbg_isexistingfile_41c7f491b58e322e = function() { return handleError(function (arg0, arg1) {
2518
2525
  let deferred0_0;
2519
2526
  let deferred0_1;
2520
2527
  try {
@@ -2526,7 +2533,7 @@ function __wbg_get_imports() {
2526
2533
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2527
2534
  }
2528
2535
  }, arguments) };
2529
- imports.wbg.__wbg_removevalue_63db73e5efaaa0d2 = function() { return handleError(function (arg0, arg1) {
2536
+ imports.wbg.__wbg_removevalue_531e7cfbe67deea7 = function() { return handleError(function (arg0, arg1) {
2530
2537
  let deferred0_0;
2531
2538
  let deferred0_1;
2532
2539
  try {
@@ -2538,7 +2545,7 @@ function __wbg_get_imports() {
2538
2545
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2539
2546
  }
2540
2547
  }, arguments) };
2541
- imports.wbg.__wbg_ensureblockdirectoryexists_972815925b1f6f00 = function() { return handleError(function (arg0, arg1) {
2548
+ imports.wbg.__wbg_ensureblockdirectoryexists_296ba406e9f3e694 = function() { return handleError(function (arg0, arg1) {
2542
2549
  let deferred0_0;
2543
2550
  let deferred0_1;
2544
2551
  try {
@@ -2549,16 +2556,16 @@ function __wbg_get_imports() {
2549
2556
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2550
2557
  }
2551
2558
  }, arguments) };
2552
- imports.wbg.__wbg_processapicall_2100eb96cb495341 = function(arg0, arg1, arg2) {
2559
+ imports.wbg.__wbg_processapicall_7ef2b67a9bfa7b6e = function(arg0, arg1, arg2) {
2553
2560
  MsgHandler.process_api_call(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2554
2561
  };
2555
- imports.wbg.__wbg_processapisuccess_dd75c157d0050a9b = function(arg0, arg1, arg2) {
2562
+ imports.wbg.__wbg_processapisuccess_2bf4d82b9815ec32 = function(arg0, arg1, arg2) {
2556
2563
  MsgHandler.process_api_success(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2557
2564
  };
2558
- imports.wbg.__wbg_processapierror_2d6a8ec426e34920 = function(arg0, arg1, arg2) {
2565
+ imports.wbg.__wbg_processapierror_a80ab983d780e05d = function(arg0, arg1, arg2) {
2559
2566
  MsgHandler.process_api_error(takeObject(arg0), arg1 >>> 0, takeObject(arg2));
2560
2567
  };
2561
- imports.wbg.__wbg_sendinterfaceevent_bae7ab1f7a67949d = function(arg0, arg1, arg2, arg3, arg4) {
2568
+ imports.wbg.__wbg_sendinterfaceevent_3cf6a87ed61cbc1f = function(arg0, arg1, arg2, arg3, arg4) {
2562
2569
  let deferred0_0;
2563
2570
  let deferred0_1;
2564
2571
  let deferred1_0;
@@ -2574,7 +2581,7 @@ function __wbg_get_imports() {
2574
2581
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2575
2582
  }
2576
2583
  };
2577
- imports.wbg.__wbg_sendblocksuccess_620687d6b1efda22 = function(arg0, arg1, arg2) {
2584
+ imports.wbg.__wbg_sendblocksuccess_0afc702da42cdf1d = function(arg0, arg1, arg2) {
2578
2585
  let deferred0_0;
2579
2586
  let deferred0_1;
2580
2587
  try {
@@ -2585,10 +2592,10 @@ function __wbg_get_imports() {
2585
2592
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2586
2593
  }
2587
2594
  };
2588
- imports.wbg.__wbg_sendwalletupdate_aeb10d8928d2fd32 = function() {
2595
+ imports.wbg.__wbg_sendwalletupdate_825760db251b5ac8 = function() {
2589
2596
  MsgHandler.send_wallet_update();
2590
2597
  };
2591
- imports.wbg.__wbg_sendnewversionalert_c6883c89e68d3b0b = function(arg0, arg1, arg2) {
2598
+ imports.wbg.__wbg_sendnewversionalert_f64ad7412651900e = function(arg0, arg1, arg2) {
2592
2599
  let deferred0_0;
2593
2600
  let deferred0_1;
2594
2601
  try {
@@ -2599,16 +2606,16 @@ function __wbg_get_imports() {
2599
2606
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2600
2607
  }
2601
2608
  };
2602
- imports.wbg.__wbg_sendblockfetchstatusevent_a1634ba7324fca9c = function(arg0) {
2609
+ imports.wbg.__wbg_sendblockfetchstatusevent_b4841acfbddb2c36 = function(arg0) {
2603
2610
  MsgHandler.send_block_fetch_status_event(BigInt.asUintN(64, arg0));
2604
2611
  };
2605
- imports.wbg.__wbg_savewallet_63463ed9dd3bf927 = function() {
2612
+ imports.wbg.__wbg_savewallet_822312e93069770a = function() {
2606
2613
  MsgHandler.save_wallet();
2607
2614
  };
2608
- imports.wbg.__wbg_loadwallet_a14ffbfff10a4a4d = function() {
2615
+ imports.wbg.__wbg_loadwallet_bd192f2485618365 = function() {
2609
2616
  MsgHandler.load_wallet();
2610
2617
  };
2611
- imports.wbg.__wbg_getmyservices_2002c47f4428f89d = function() {
2618
+ imports.wbg.__wbg_getmyservices_19454e925feaded2 = function() {
2612
2619
  const ret = MsgHandler.get_my_services();
2613
2620
  _assertClass(ret, WasmPeerServiceList);
2614
2621
  var ptr1 = ret.__destroy_into_raw();
@@ -2836,7 +2843,7 @@ function __wbg_get_imports() {
2836
2843
  const a = state0.a;
2837
2844
  state0.a = 0;
2838
2845
  try {
2839
- return __wbg_adapter_402(a, state0.b, arg0, arg1);
2846
+ return __wbg_adapter_403(a, state0.b, arg0, arg1);
2840
2847
  } finally {
2841
2848
  state0.a = a;
2842
2849
  }
@@ -2917,7 +2924,7 @@ function __wbg_get_imports() {
2917
2924
  const ret = wasm.memory;
2918
2925
  return addHeapObject(ret);
2919
2926
  };
2920
- imports.wbg.__wbindgen_closure_wrapper1339 = function(arg0, arg1, arg2) {
2927
+ imports.wbg.__wbindgen_closure_wrapper1341 = function(arg0, arg1, arg2) {
2921
2928
  const ret = makeMutClosure(arg0, arg1, 472, __wbg_adapter_38);
2922
2929
  return addHeapObject(ret);
2923
2930
  };
Binary file
@@ -14,6 +14,7 @@ export function wasmpeer_get_sync_type(a: number): number;
14
14
  export function wasmpeer_get_services(a: number): number;
15
15
  export function wasmpeer_set_services(a: number, b: number): void;
16
16
  export function wasmpeer_has_service(a: number, b: number): number;
17
+ export function wasmpeer_get_status(a: number): number;
17
18
  export function __wbg_wasmslip_free(a: number): void;
18
19
  export function wasmslip_amount(a: number): number;
19
20
  export function wasmslip_set_amount(a: number, b: number): void;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saito-wasm",
3
- "version": "0.2.53",
3
+ "version": "0.2.54",
4
4
  "files": [
5
5
  "index_bg.wasm",
6
6
  "index.js",
@@ -12,7 +12,7 @@
12
12
  "./snippets/*"
13
13
  ],
14
14
  "dependencies": {
15
- "cross-env": "^7.0.3",
16
- "node-fetch": "^3.3.0"
15
+ "node-fetch": "^3.3.0",
16
+ "cross-env": "^7.0.3"
17
17
  }
18
18
  }