saito-wasm 0.1.13 → 0.1.15

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.1.13"
3
+ version = "0.1.15"
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.1.13",
3
+ "version": "0.1.15",
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,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-7d38dadf2b6bf874/js/msg_handler.js`);
5
- const { TextDecoder, TextEncoder } = require(`util`);
4
+ const { MsgHandler } = require(String.raw`./snippets/saito-wasm-209e146841b06b8b/js/msg_handler.js`);
5
+ const { TextEncoder, TextDecoder } = require(`util`);
6
6
 
7
7
  const heap = new Array(128).fill(undefined);
8
8
 
@@ -24,9 +24,7 @@ function takeObject(idx) {
24
24
  return ret;
25
25
  }
26
26
 
27
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
28
-
29
- cachedTextDecoder.decode();
27
+ let WASM_VECTOR_LEN = 0;
30
28
 
31
29
  let cachedUint8Memory0 = null;
32
30
 
@@ -37,22 +35,6 @@ function getUint8Memory0() {
37
35
  return cachedUint8Memory0;
38
36
  }
39
37
 
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
-
56
38
  let cachedTextEncoder = new TextEncoder('utf-8');
57
39
 
58
40
  const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
@@ -119,6 +101,24 @@ function getInt32Memory0() {
119
101
  return cachedInt32Memory0;
120
102
  }
121
103
 
104
+ function addHeapObject(obj) {
105
+ if (heap_next === heap.length) heap.push(heap.length + 1);
106
+ const idx = heap_next;
107
+ heap_next = heap[idx];
108
+
109
+ heap[idx] = obj;
110
+ return idx;
111
+ }
112
+
113
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
114
+
115
+ cachedTextDecoder.decode();
116
+
117
+ function getStringFromWasm0(ptr, len) {
118
+ ptr = ptr >>> 0;
119
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
120
+ }
121
+
122
122
  let cachedFloat64Memory0 = null;
123
123
 
124
124
  function getFloat64Memory0() {
@@ -227,6 +227,14 @@ function _assertClass(instance, klass) {
227
227
  }
228
228
  return instance.ptr;
229
229
  }
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
+ }
230
238
  /**
231
239
  * @param {string} json
232
240
  * @param {string} private_key
@@ -498,19 +506,11 @@ module.exports.get_mempool_txs = function() {
498
506
  return takeObject(ret);
499
507
  };
500
508
 
501
- function handleError(f, args) {
502
- try {
503
- return f.apply(this, args);
504
- } catch (e) {
505
- wasm.__wbindgen_exn_store(addHeapObject(e));
506
- }
507
- }
508
-
509
509
  function getArrayU8FromWasm0(ptr, len) {
510
510
  ptr = ptr >>> 0;
511
511
  return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
512
512
  }
513
- function __wbg_adapter_356(arg0, arg1, arg2, arg3) {
513
+ function __wbg_adapter_358(arg0, arg1, arg2, arg3) {
514
514
  wasm.wasm_bindgen__convert__closures__invoke2_mut__h11b7b9bfb0812a52(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
515
515
  }
516
516
 
@@ -2047,53 +2047,53 @@ module.exports.__wbindgen_object_drop_ref = function(arg0) {
2047
2047
  takeObject(arg0);
2048
2048
  };
2049
2049
 
2050
- module.exports.__wbindgen_string_new = function(arg0, arg1) {
2051
- const ret = getStringFromWasm0(arg0, arg1);
2052
- return addHeapObject(ret);
2050
+ module.exports.__wbindgen_is_falsy = function(arg0) {
2051
+ const ret = !getObject(arg0);
2052
+ return ret;
2053
2053
  };
2054
2054
 
2055
- module.exports.__wbg_wasmwalletslip_new = function(arg0) {
2056
- const ret = WasmWalletSlip.__wrap(arg0);
2057
- return addHeapObject(ret);
2055
+ module.exports.__wbindgen_string_get = function(arg0, arg1) {
2056
+ const obj = getObject(arg1);
2057
+ const ret = typeof(obj) === 'string' ? obj : undefined;
2058
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2059
+ var len1 = WASM_VECTOR_LEN;
2060
+ getInt32Memory0()[arg0 / 4 + 1] = len1;
2061
+ getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2058
2062
  };
2059
2063
 
2060
- module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
2061
- const ret = BigInt.asUintN(64, arg0);
2064
+ module.exports.__wbg_wasmtransaction_new = function(arg0) {
2065
+ const ret = WasmTransaction.__wrap(arg0);
2062
2066
  return addHeapObject(ret);
2063
2067
  };
2064
2068
 
2065
- module.exports.__wbg_wasmwallet_new = function(arg0) {
2066
- const ret = WasmWallet.__wrap(arg0);
2069
+ module.exports.__wbg_wasmpeer_new = function(arg0) {
2070
+ const ret = WasmPeer.__wrap(arg0);
2067
2071
  return addHeapObject(ret);
2068
2072
  };
2069
2073
 
2070
- module.exports.__wbg_wasmtransaction_new = function(arg0) {
2071
- const ret = WasmTransaction.__wrap(arg0);
2074
+ module.exports.__wbg_wasmblockchain_new = function(arg0) {
2075
+ const ret = WasmBlockchain.__wrap(arg0);
2072
2076
  return addHeapObject(ret);
2073
2077
  };
2074
2078
 
2075
- module.exports.__wbg_wasmpeer_new = function(arg0) {
2076
- const ret = WasmPeer.__wrap(arg0);
2079
+ module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
2080
+ const ret = BigInt.asUintN(64, arg0);
2077
2081
  return addHeapObject(ret);
2078
2082
  };
2079
2083
 
2080
- module.exports.__wbg_wasmblock_new = function(arg0) {
2081
- const ret = WasmBlock.__wrap(arg0);
2084
+ module.exports.__wbg_wasmwallet_new = function(arg0) {
2085
+ const ret = WasmWallet.__wrap(arg0);
2082
2086
  return addHeapObject(ret);
2083
2087
  };
2084
2088
 
2085
- module.exports.__wbindgen_is_falsy = function(arg0) {
2086
- const ret = !getObject(arg0);
2087
- return ret;
2089
+ module.exports.__wbindgen_string_new = function(arg0, arg1) {
2090
+ const ret = getStringFromWasm0(arg0, arg1);
2091
+ return addHeapObject(ret);
2088
2092
  };
2089
2093
 
2090
- module.exports.__wbindgen_string_get = function(arg0, arg1) {
2091
- const obj = getObject(arg1);
2092
- const ret = typeof(obj) === 'string' ? obj : undefined;
2093
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2094
- var len1 = WASM_VECTOR_LEN;
2095
- getInt32Memory0()[arg0 / 4 + 1] = len1;
2096
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2094
+ module.exports.__wbg_wasmbalancesnapshot_new = function(arg0) {
2095
+ const ret = WasmBalanceSnapshot.__wrap(arg0);
2096
+ return addHeapObject(ret);
2097
2097
  };
2098
2098
 
2099
2099
  module.exports.__wbg_wasmslip_new = function(arg0) {
@@ -2101,13 +2101,13 @@ module.exports.__wbg_wasmslip_new = function(arg0) {
2101
2101
  return addHeapObject(ret);
2102
2102
  };
2103
2103
 
2104
- module.exports.__wbg_wasmbalancesnapshot_new = function(arg0) {
2105
- const ret = WasmBalanceSnapshot.__wrap(arg0);
2104
+ module.exports.__wbg_wasmwalletslip_new = function(arg0) {
2105
+ const ret = WasmWalletSlip.__wrap(arg0);
2106
2106
  return addHeapObject(ret);
2107
2107
  };
2108
2108
 
2109
- module.exports.__wbg_wasmblockchain_new = function(arg0) {
2110
- const ret = WasmBlockchain.__wrap(arg0);
2109
+ module.exports.__wbg_wasmblock_new = function(arg0) {
2110
+ const ret = WasmBlock.__wrap(arg0);
2111
2111
  return addHeapObject(ret);
2112
2112
  };
2113
2113
 
@@ -2116,13 +2116,13 @@ module.exports.__wbg_wasmblockpayout_new = function(arg0) {
2116
2116
  return addHeapObject(ret);
2117
2117
  };
2118
2118
 
2119
- module.exports.__wbg_wasmconsensusvalues_new = function(arg0) {
2120
- const ret = WasmConsensusValues.__wrap(arg0);
2119
+ module.exports.__wbg_wasmpeerservice_new = function(arg0) {
2120
+ const ret = WasmPeerService.__wrap(arg0);
2121
2121
  return addHeapObject(ret);
2122
2122
  };
2123
2123
 
2124
- module.exports.__wbg_wasmpeerservice_new = function(arg0) {
2125
- const ret = WasmPeerService.__wrap(arg0);
2124
+ module.exports.__wbg_wasmconsensusvalues_new = function(arg0) {
2125
+ const ret = WasmConsensusValues.__wrap(arg0);
2126
2126
  return addHeapObject(ret);
2127
2127
  };
2128
2128
 
@@ -2147,25 +2147,25 @@ module.exports.__wbindgen_error_new = function(arg0, arg1) {
2147
2147
  return addHeapObject(ret);
2148
2148
  };
2149
2149
 
2150
- module.exports.__wbg_sendmessage_a8cc3166ebb88bd9 = function(arg0, arg1) {
2150
+ module.exports.__wbg_sendmessage_462b586dd17da61f = function(arg0, arg1) {
2151
2151
  MsgHandler.send_message(takeObject(arg0), getObject(arg1));
2152
2152
  };
2153
2153
 
2154
- module.exports.__wbg_sendmessagetoall_62505d1c4aa46bb1 = function(arg0, arg1) {
2154
+ module.exports.__wbg_sendmessagetoall_d3eecba0357fb9ea = function(arg0, arg1) {
2155
2155
  MsgHandler.send_message_to_all(getObject(arg0), getObject(arg1));
2156
2156
  };
2157
2157
 
2158
- module.exports.__wbg_connecttopeer_a07890f1770492c2 = function() { return handleError(function (arg0) {
2158
+ module.exports.__wbg_connecttopeer_97f8ae2d79425b01 = function() { return handleError(function (arg0) {
2159
2159
  const ret = MsgHandler.connect_to_peer(takeObject(arg0));
2160
2160
  return addHeapObject(ret);
2161
2161
  }, arguments) };
2162
2162
 
2163
- module.exports.__wbg_disconnectfrompeer_5fefb284395c691f = function() { return handleError(function (arg0) {
2163
+ module.exports.__wbg_disconnectfrompeer_79d20399bbfff11a = function() { return handleError(function (arg0) {
2164
2164
  const ret = MsgHandler.disconnect_from_peer(takeObject(arg0));
2165
2165
  return addHeapObject(ret);
2166
2166
  }, arguments) };
2167
2167
 
2168
- module.exports.__wbg_fetchblockfrompeer_1cc41b8cd95cc09d = function() { return handleError(function (arg0, arg1, arg2, arg3) {
2168
+ module.exports.__wbg_fetchblockfrompeer_42a5c0a842f9b612 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
2169
2169
  let deferred0_0;
2170
2170
  let deferred0_1;
2171
2171
  try {
@@ -2178,7 +2178,7 @@ module.exports.__wbg_fetchblockfrompeer_1cc41b8cd95cc09d = function() { return h
2178
2178
  }
2179
2179
  }, arguments) };
2180
2180
 
2181
- module.exports.__wbg_writevalue_e4ad0ef26e198418 = function(arg0, arg1, arg2) {
2181
+ module.exports.__wbg_writevalue_74e0bcb5563740e4 = function(arg0, arg1, arg2) {
2182
2182
  let deferred0_0;
2183
2183
  let deferred0_1;
2184
2184
  try {
@@ -2190,7 +2190,7 @@ module.exports.__wbg_writevalue_e4ad0ef26e198418 = function(arg0, arg1, arg2) {
2190
2190
  }
2191
2191
  };
2192
2192
 
2193
- module.exports.__wbg_readvalue_50d04c758b54cc56 = function() { return handleError(function (arg0, arg1) {
2193
+ module.exports.__wbg_readvalue_5b9111afd79e9878 = function() { return handleError(function (arg0, arg1) {
2194
2194
  let deferred0_0;
2195
2195
  let deferred0_1;
2196
2196
  try {
@@ -2203,12 +2203,12 @@ module.exports.__wbg_readvalue_50d04c758b54cc56 = function() { return handleErro
2203
2203
  }
2204
2204
  }, arguments) };
2205
2205
 
2206
- module.exports.__wbg_loadblockfilelist_7098cd792c814d98 = function() { return handleError(function () {
2206
+ module.exports.__wbg_loadblockfilelist_45c501ecf28b86b3 = function() { return handleError(function () {
2207
2207
  const ret = MsgHandler.load_block_file_list();
2208
2208
  return addHeapObject(ret);
2209
2209
  }, arguments) };
2210
2210
 
2211
- module.exports.__wbg_isexistingfile_a8099d2d65d302d6 = function() { return handleError(function (arg0, arg1) {
2211
+ module.exports.__wbg_isexistingfile_82b54aae1d99a3c0 = function() { return handleError(function (arg0, arg1) {
2212
2212
  let deferred0_0;
2213
2213
  let deferred0_1;
2214
2214
  try {
@@ -2221,7 +2221,7 @@ module.exports.__wbg_isexistingfile_a8099d2d65d302d6 = function() { return handl
2221
2221
  }
2222
2222
  }, arguments) };
2223
2223
 
2224
- module.exports.__wbg_removevalue_6dcfba28325ebb10 = function() { return handleError(function (arg0, arg1) {
2224
+ module.exports.__wbg_removevalue_7e5cee5b8902baf5 = function() { return handleError(function (arg0, arg1) {
2225
2225
  let deferred0_0;
2226
2226
  let deferred0_1;
2227
2227
  try {
@@ -2234,19 +2234,19 @@ module.exports.__wbg_removevalue_6dcfba28325ebb10 = function() { return handleEr
2234
2234
  }
2235
2235
  }, arguments) };
2236
2236
 
2237
- module.exports.__wbg_processapicall_ebfbc0f4ea3727a3 = function(arg0, arg1, arg2) {
2237
+ module.exports.__wbg_processapicall_4ebab918cb875c80 = function(arg0, arg1, arg2) {
2238
2238
  MsgHandler.process_api_call(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
2239
2239
  };
2240
2240
 
2241
- module.exports.__wbg_processapisuccess_32401c14ae6ce9f1 = function(arg0, arg1, arg2) {
2241
+ module.exports.__wbg_processapisuccess_3a4107cfe106223a = function(arg0, arg1, arg2) {
2242
2242
  MsgHandler.process_api_success(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
2243
2243
  };
2244
2244
 
2245
- module.exports.__wbg_processapierror_2e28f17acab1078d = function(arg0, arg1, arg2) {
2245
+ module.exports.__wbg_processapierror_3ed2e52a8d6b0f9f = function(arg0, arg1, arg2) {
2246
2246
  MsgHandler.process_api_error(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
2247
2247
  };
2248
2248
 
2249
- module.exports.__wbg_sendinterfaceevent_e956f651ee30162a = function(arg0, arg1, arg2) {
2249
+ module.exports.__wbg_sendinterfaceevent_92512c1c999b4828 = function(arg0, arg1, arg2) {
2250
2250
  let deferred0_0;
2251
2251
  let deferred0_1;
2252
2252
  try {
@@ -2258,7 +2258,7 @@ module.exports.__wbg_sendinterfaceevent_e956f651ee30162a = function(arg0, arg1,
2258
2258
  }
2259
2259
  };
2260
2260
 
2261
- module.exports.__wbg_sendblocksuccess_19e7920020bcd50d = function(arg0, arg1, arg2) {
2261
+ module.exports.__wbg_sendblocksuccess_332fb59303bead4d = function(arg0, arg1, arg2) {
2262
2262
  let deferred0_0;
2263
2263
  let deferred0_1;
2264
2264
  try {
@@ -2270,19 +2270,19 @@ module.exports.__wbg_sendblocksuccess_19e7920020bcd50d = function(arg0, arg1, ar
2270
2270
  }
2271
2271
  };
2272
2272
 
2273
- module.exports.__wbg_sendwalletupdate_d59921be34ddaa9a = function() {
2273
+ module.exports.__wbg_sendwalletupdate_c695776cea7713cb = function() {
2274
2274
  MsgHandler.send_wallet_update();
2275
2275
  };
2276
2276
 
2277
- module.exports.__wbg_savewallet_c598ab6d5eeffac0 = function() {
2277
+ module.exports.__wbg_savewallet_9032e99d06d6fe63 = function() {
2278
2278
  MsgHandler.save_wallet();
2279
2279
  };
2280
2280
 
2281
- module.exports.__wbg_loadwallet_f8d0563715533b87 = function() {
2281
+ module.exports.__wbg_loadwallet_3aa1472afacbaadf = function() {
2282
2282
  MsgHandler.load_wallet();
2283
2283
  };
2284
2284
 
2285
- module.exports.__wbg_getmyservices_6863a3775cdfbf09 = function() {
2285
+ module.exports.__wbg_getmyservices_2b0cfdfb17d11e45 = function() {
2286
2286
  const ret = MsgHandler.get_my_services();
2287
2287
  _assertClass(ret, WasmPeerServiceList);
2288
2288
  var ptr1 = ret.__destroy_into_raw();
@@ -2510,6 +2510,11 @@ module.exports.__wbg_new0_494c19a27871d56f = function() {
2510
2510
  return addHeapObject(ret);
2511
2511
  };
2512
2512
 
2513
+ module.exports.__wbg_toString_ab06368affce2984 = function(arg0) {
2514
+ const ret = getObject(arg0).toString();
2515
+ return addHeapObject(ret);
2516
+ };
2517
+
2513
2518
  module.exports.__wbg_new_2b55e405e4af4986 = function(arg0, arg1) {
2514
2519
  try {
2515
2520
  var state0 = {a: arg0, b: arg1};
@@ -2517,7 +2522,7 @@ module.exports.__wbg_new_2b55e405e4af4986 = function(arg0, arg1) {
2517
2522
  const a = state0.a;
2518
2523
  state0.a = 0;
2519
2524
  try {
2520
- return __wbg_adapter_356(a, state0.b, arg0, arg1);
2525
+ return __wbg_adapter_358(a, state0.b, arg0, arg1);
2521
2526
  } finally {
2522
2527
  state0.a = a;
2523
2528
  }
@@ -2611,8 +2616,8 @@ module.exports.__wbindgen_memory = function() {
2611
2616
  return addHeapObject(ret);
2612
2617
  };
2613
2618
 
2614
- module.exports.__wbindgen_closure_wrapper1081 = function(arg0, arg1, arg2) {
2615
- const ret = makeMutClosure(arg0, arg1, 340, __wbg_adapter_40);
2619
+ module.exports.__wbindgen_closure_wrapper1071 = function(arg0, arg1, arg2) {
2620
+ const ret = makeMutClosure(arg0, arg1, 335, __wbg_adapter_40);
2616
2621
  return addHeapObject(ret);
2617
2622
  };
2618
2623
 
Binary file