saito-wasm 0.1.48 → 0.1.49

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.48"
3
+ version = "0.1.49"
4
4
  edition = "2021"
5
5
 
6
6
  # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -23,7 +23,7 @@ console_log = { version = "1.0.0", features = ["color"] }
23
23
  log = "0.4.20"
24
24
  getrandom = { version = "0.2.11", features = ["js", "std"] }
25
25
  rand = { version = "0.8.5", features = ["getrandom"] }
26
- secp256k1 = { version = "0.28.0", features = ["hashes", "global-context", "serde"] }
26
+ secp256k1 = { version = "0.28.2", features = ["hashes", "global-context", "serde"] }
27
27
  bs58 = "0.5.0"
28
28
  figment = { version = "0.10.12", features = ["json"] }
29
29
  serde_json = { version = "1.0.108" }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saito-wasm",
3
- "version": "0.1.48",
3
+ "version": "0.1.49",
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,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-bee6f4652598cafe/js/msg_handler.js`);
4
+ const { MsgHandler } = require(String.raw`./snippets/saito-wasm-f63dd1db5e4e3624/js/msg_handler.js`);
5
5
  const { TextDecoder, TextEncoder } = require(`util`);
6
6
 
7
7
  const heap = new Array(128).fill(undefined);
@@ -228,12 +228,6 @@ function __wbg_adapter_40(arg0, arg1, arg2) {
228
228
  wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h953abaf3817987ff(arg0, arg1, addHeapObject(arg2));
229
229
  }
230
230
 
231
- function _assertClass(instance, klass) {
232
- if (!(instance instanceof klass)) {
233
- throw new Error(`expected instance of ${klass.name}`);
234
- }
235
- return instance.ptr;
236
- }
237
231
  /**
238
232
  * @param {string} json
239
233
  * @param {string} private_key
@@ -422,6 +416,12 @@ module.exports.get_balance_snapshot = function(keys) {
422
416
  return takeObject(ret);
423
417
  };
424
418
 
419
+ function _assertClass(instance, klass) {
420
+ if (!(instance instanceof klass)) {
421
+ throw new Error(`expected instance of ${klass.name}`);
422
+ }
423
+ return instance.ptr;
424
+ }
425
425
  /**
426
426
  * @param {WasmBalanceSnapshot} snapshot
427
427
  * @returns {Promise<void>}
@@ -2047,7 +2047,7 @@ class WasmWalletSlip {
2047
2047
  * @returns {string}
2048
2048
  */
2049
2049
  get_utxokey() {
2050
- const ret = wasm.wasmwalletslip_get_utxokey(this.__wbg_ptr);
2050
+ const ret = wasm.wasmslip_utxo_key(this.__wbg_ptr);
2051
2051
  return takeObject(ret);
2052
2052
  }
2053
2053
  /**
@@ -2060,40 +2060,40 @@ class WasmWalletSlip {
2060
2060
  * @returns {bigint}
2061
2061
  */
2062
2062
  get_amount() {
2063
- const ret = wasm.wasmwalletslip_get_amount(this.__wbg_ptr);
2063
+ const ret = wasm.wasmslip_amount(this.__wbg_ptr);
2064
2064
  return BigInt.asUintN(64, ret);
2065
2065
  }
2066
2066
  /**
2067
2067
  * @param {bigint} amount
2068
2068
  */
2069
2069
  set_amount(amount) {
2070
- wasm.wasmwalletslip_set_amount(this.__wbg_ptr, amount);
2070
+ wasm.wasmslip_set_amount(this.__wbg_ptr, amount);
2071
2071
  }
2072
2072
  /**
2073
2073
  * @returns {bigint}
2074
2074
  */
2075
2075
  get_block_id() {
2076
- const ret = wasm.wasmwalletslip_get_block_id(this.__wbg_ptr);
2076
+ const ret = wasm.wasmslip_block_id(this.__wbg_ptr);
2077
2077
  return BigInt.asUintN(64, ret);
2078
2078
  }
2079
2079
  /**
2080
2080
  * @param {bigint} block_id
2081
2081
  */
2082
2082
  set_block_id(block_id) {
2083
- wasm.wasmwalletslip_set_block_id(this.__wbg_ptr, block_id);
2083
+ wasm.wasmslip_set_block_id(this.__wbg_ptr, block_id);
2084
2084
  }
2085
2085
  /**
2086
2086
  * @returns {bigint}
2087
2087
  */
2088
2088
  get_tx_ordinal() {
2089
- const ret = wasm.wasmwalletslip_get_tx_ordinal(this.__wbg_ptr);
2089
+ const ret = wasm.wasmslip_tx_ordinal(this.__wbg_ptr);
2090
2090
  return BigInt.asUintN(64, ret);
2091
2091
  }
2092
2092
  /**
2093
2093
  * @param {bigint} ordinal
2094
2094
  */
2095
2095
  set_tx_ordinal(ordinal) {
2096
- wasm.wasmwalletslip_set_tx_ordinal(this.__wbg_ptr, ordinal);
2096
+ wasm.wasmslip_set_tx_ordinal(this.__wbg_ptr, ordinal);
2097
2097
  }
2098
2098
  /**
2099
2099
  * @returns {number}
@@ -2144,6 +2144,11 @@ class WasmWalletSlip {
2144
2144
  }
2145
2145
  module.exports.WasmWalletSlip = WasmWalletSlip;
2146
2146
 
2147
+ module.exports.__wbg_wasmtransaction_new = function(arg0) {
2148
+ const ret = WasmTransaction.__wrap(arg0);
2149
+ return addHeapObject(ret);
2150
+ };
2151
+
2147
2152
  module.exports.__wbindgen_object_drop_ref = function(arg0) {
2148
2153
  takeObject(arg0);
2149
2154
  };
@@ -2153,63 +2158,58 @@ module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
2153
2158
  return addHeapObject(ret);
2154
2159
  };
2155
2160
 
2156
- module.exports.__wbg_wasmwallet_new = function(arg0) {
2157
- const ret = WasmWallet.__wrap(arg0);
2158
- return addHeapObject(ret);
2159
- };
2160
-
2161
2161
  module.exports.__wbindgen_string_new = function(arg0, arg1) {
2162
2162
  const ret = getStringFromWasm0(arg0, arg1);
2163
2163
  return addHeapObject(ret);
2164
2164
  };
2165
2165
 
2166
- module.exports.__wbg_wasmpeer_new = function(arg0) {
2167
- const ret = WasmPeer.__wrap(arg0);
2166
+ module.exports.__wbg_wasmblock_new = function(arg0) {
2167
+ const ret = WasmBlock.__wrap(arg0);
2168
2168
  return addHeapObject(ret);
2169
2169
  };
2170
2170
 
2171
- module.exports.__wbg_wasmslip_new = function(arg0) {
2172
- const ret = WasmSlip.__wrap(arg0);
2171
+ module.exports.__wbg_wasmwallet_new = function(arg0) {
2172
+ const ret = WasmWallet.__wrap(arg0);
2173
2173
  return addHeapObject(ret);
2174
2174
  };
2175
2175
 
2176
- module.exports.__wbg_wasmtransaction_new = function(arg0) {
2177
- const ret = WasmTransaction.__wrap(arg0);
2178
- return addHeapObject(ret);
2176
+ module.exports.__wbindgen_is_falsy = function(arg0) {
2177
+ const ret = !getObject(arg0);
2178
+ return ret;
2179
2179
  };
2180
2180
 
2181
- module.exports.__wbg_wasmwalletslip_new = function(arg0) {
2182
- const ret = WasmWalletSlip.__wrap(arg0);
2183
- return addHeapObject(ret);
2181
+ module.exports.__wbindgen_string_get = function(arg0, arg1) {
2182
+ const obj = getObject(arg1);
2183
+ const ret = typeof(obj) === 'string' ? obj : undefined;
2184
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2185
+ var len1 = WASM_VECTOR_LEN;
2186
+ getInt32Memory0()[arg0 / 4 + 1] = len1;
2187
+ getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2184
2188
  };
2185
2189
 
2186
- module.exports.__wbg_wasmbalancesnapshot_new = function(arg0) {
2187
- const ret = WasmBalanceSnapshot.__wrap(arg0);
2190
+ module.exports.__wbg_wasmblockchain_new = function(arg0) {
2191
+ const ret = WasmBlockchain.__wrap(arg0);
2188
2192
  return addHeapObject(ret);
2189
2193
  };
2190
2194
 
2191
- module.exports.__wbg_wasmblockchain_new = function(arg0) {
2192
- const ret = WasmBlockchain.__wrap(arg0);
2195
+ module.exports.__wbg_wasmwalletslip_new = function(arg0) {
2196
+ const ret = WasmWalletSlip.__wrap(arg0);
2193
2197
  return addHeapObject(ret);
2194
2198
  };
2195
2199
 
2196
- module.exports.__wbg_wasmblock_new = function(arg0) {
2197
- const ret = WasmBlock.__wrap(arg0);
2200
+ module.exports.__wbg_wasmslip_new = function(arg0) {
2201
+ const ret = WasmSlip.__wrap(arg0);
2198
2202
  return addHeapObject(ret);
2199
2203
  };
2200
2204
 
2201
- module.exports.__wbindgen_is_falsy = function(arg0) {
2202
- const ret = !getObject(arg0);
2203
- return ret;
2205
+ module.exports.__wbg_wasmpeer_new = function(arg0) {
2206
+ const ret = WasmPeer.__wrap(arg0);
2207
+ return addHeapObject(ret);
2204
2208
  };
2205
2209
 
2206
- module.exports.__wbindgen_string_get = function(arg0, arg1) {
2207
- const obj = getObject(arg1);
2208
- const ret = typeof(obj) === 'string' ? obj : undefined;
2209
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2210
- var len1 = WASM_VECTOR_LEN;
2211
- getInt32Memory0()[arg0 / 4 + 1] = len1;
2212
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2210
+ module.exports.__wbg_wasmbalancesnapshot_new = function(arg0) {
2211
+ const ret = WasmBalanceSnapshot.__wrap(arg0);
2212
+ return addHeapObject(ret);
2213
2213
  };
2214
2214
 
2215
2215
  module.exports.__wbg_wasmhop_new = function(arg0) {
@@ -2227,11 +2227,6 @@ module.exports.__wbg_wasmpeerservice_new = function(arg0) {
2227
2227
  return addHeapObject(ret);
2228
2228
  };
2229
2229
 
2230
- module.exports.__wbindgen_error_new = function(arg0, arg1) {
2231
- const ret = new Error(getStringFromWasm0(arg0, arg1));
2232
- return addHeapObject(ret);
2233
- };
2234
-
2235
2230
  module.exports.__wbindgen_is_object = function(arg0) {
2236
2231
  const val = getObject(arg0);
2237
2232
  const ret = typeof(val) === 'object' && val !== null;
@@ -2248,25 +2243,30 @@ module.exports.__wbindgen_in = function(arg0, arg1) {
2248
2243
  return ret;
2249
2244
  };
2250
2245
 
2251
- module.exports.__wbg_sendmessage_852a76511cb6527f = function(arg0, arg1) {
2246
+ module.exports.__wbindgen_error_new = function(arg0, arg1) {
2247
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
2248
+ return addHeapObject(ret);
2249
+ };
2250
+
2251
+ module.exports.__wbg_sendmessage_4d8324b0e04b029b = function(arg0, arg1) {
2252
2252
  MsgHandler.send_message(takeObject(arg0), getObject(arg1));
2253
2253
  };
2254
2254
 
2255
- module.exports.__wbg_sendmessagetoall_5160cf97b40924cd = function(arg0, arg1) {
2255
+ module.exports.__wbg_sendmessagetoall_fc4033e49e94492d = function(arg0, arg1) {
2256
2256
  MsgHandler.send_message_to_all(getObject(arg0), getObject(arg1));
2257
2257
  };
2258
2258
 
2259
- module.exports.__wbg_connecttopeer_d6695c733213736c = function() { return handleError(function (arg0) {
2259
+ module.exports.__wbg_connecttopeer_f2667d6bd288fd72 = function() { return handleError(function (arg0) {
2260
2260
  const ret = MsgHandler.connect_to_peer(takeObject(arg0));
2261
2261
  return addHeapObject(ret);
2262
2262
  }, arguments) };
2263
2263
 
2264
- module.exports.__wbg_disconnectfrompeer_ba867bd87f1b7975 = function() { return handleError(function (arg0) {
2264
+ module.exports.__wbg_disconnectfrompeer_c3c2b00736ef7a8b = function() { return handleError(function (arg0) {
2265
2265
  const ret = MsgHandler.disconnect_from_peer(takeObject(arg0));
2266
2266
  return addHeapObject(ret);
2267
2267
  }, arguments) };
2268
2268
 
2269
- module.exports.__wbg_fetchblockfrompeer_4a6143b4aef8bdcc = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2269
+ module.exports.__wbg_fetchblockfrompeer_7b3879eb40d5c715 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2270
2270
  let deferred0_0;
2271
2271
  let deferred0_1;
2272
2272
  try {
@@ -2279,7 +2279,7 @@ module.exports.__wbg_fetchblockfrompeer_4a6143b4aef8bdcc = function() { return h
2279
2279
  }
2280
2280
  }, arguments) };
2281
2281
 
2282
- module.exports.__wbg_writevalue_87e8ba754be5b043 = function(arg0, arg1, arg2) {
2282
+ module.exports.__wbg_writevalue_49494b0c46942a0e = function(arg0, arg1, arg2) {
2283
2283
  let deferred0_0;
2284
2284
  let deferred0_1;
2285
2285
  try {
@@ -2291,7 +2291,7 @@ module.exports.__wbg_writevalue_87e8ba754be5b043 = function(arg0, arg1, arg2) {
2291
2291
  }
2292
2292
  };
2293
2293
 
2294
- module.exports.__wbg_readvalue_94f7827fba4a63c1 = function() { return handleError(function (arg0, arg1) {
2294
+ module.exports.__wbg_readvalue_d8c839e204ec589f = function() { return handleError(function (arg0, arg1) {
2295
2295
  let deferred0_0;
2296
2296
  let deferred0_1;
2297
2297
  try {
@@ -2304,12 +2304,12 @@ module.exports.__wbg_readvalue_94f7827fba4a63c1 = function() { return handleErro
2304
2304
  }
2305
2305
  }, arguments) };
2306
2306
 
2307
- module.exports.__wbg_loadblockfilelist_16018f0516427731 = function() { return handleError(function () {
2307
+ module.exports.__wbg_loadblockfilelist_4df96959899f024c = function() { return handleError(function () {
2308
2308
  const ret = MsgHandler.load_block_file_list();
2309
2309
  return addHeapObject(ret);
2310
2310
  }, arguments) };
2311
2311
 
2312
- module.exports.__wbg_isexistingfile_264a89498af23aea = function() { return handleError(function (arg0, arg1) {
2312
+ module.exports.__wbg_isexistingfile_764247ebdf52baf7 = function() { return handleError(function (arg0, arg1) {
2313
2313
  let deferred0_0;
2314
2314
  let deferred0_1;
2315
2315
  try {
@@ -2322,7 +2322,7 @@ module.exports.__wbg_isexistingfile_264a89498af23aea = function() { return handl
2322
2322
  }
2323
2323
  }, arguments) };
2324
2324
 
2325
- module.exports.__wbg_removevalue_a00fcecfaec11750 = function() { return handleError(function (arg0, arg1) {
2325
+ module.exports.__wbg_removevalue_a8b644ecdd75f936 = function() { return handleError(function (arg0, arg1) {
2326
2326
  let deferred0_0;
2327
2327
  let deferred0_1;
2328
2328
  try {
@@ -2335,7 +2335,7 @@ module.exports.__wbg_removevalue_a00fcecfaec11750 = function() { return handleEr
2335
2335
  }
2336
2336
  }, arguments) };
2337
2337
 
2338
- module.exports.__wbg_ensureblockdirectoryexists_3d8bbf658ca46a36 = function() { return handleError(function (arg0, arg1) {
2338
+ module.exports.__wbg_ensureblockdirectoryexists_027986899069f595 = function() { return handleError(function (arg0, arg1) {
2339
2339
  let deferred0_0;
2340
2340
  let deferred0_1;
2341
2341
  try {
@@ -2347,19 +2347,19 @@ module.exports.__wbg_ensureblockdirectoryexists_3d8bbf658ca46a36 = function() {
2347
2347
  }
2348
2348
  }, arguments) };
2349
2349
 
2350
- module.exports.__wbg_processapicall_b5b829072ddefb4d = function(arg0, arg1, arg2) {
2350
+ module.exports.__wbg_processapicall_82eb386a0aa46204 = function(arg0, arg1, arg2) {
2351
2351
  MsgHandler.process_api_call(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
2352
2352
  };
2353
2353
 
2354
- module.exports.__wbg_processapisuccess_fce9163285b965e3 = function(arg0, arg1, arg2) {
2354
+ module.exports.__wbg_processapisuccess_42d0540043e890eb = function(arg0, arg1, arg2) {
2355
2355
  MsgHandler.process_api_success(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
2356
2356
  };
2357
2357
 
2358
- module.exports.__wbg_processapierror_cac73a72c30a63d1 = function(arg0, arg1, arg2) {
2358
+ module.exports.__wbg_processapierror_2406e254e3a739c1 = function(arg0, arg1, arg2) {
2359
2359
  MsgHandler.process_api_error(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
2360
2360
  };
2361
2361
 
2362
- module.exports.__wbg_sendinterfaceevent_b5612b48ed4cca7d = function(arg0, arg1, arg2) {
2362
+ module.exports.__wbg_sendinterfaceevent_818aff1b0bfdc5f7 = function(arg0, arg1, arg2) {
2363
2363
  let deferred0_0;
2364
2364
  let deferred0_1;
2365
2365
  try {
@@ -2371,7 +2371,7 @@ module.exports.__wbg_sendinterfaceevent_b5612b48ed4cca7d = function(arg0, arg1,
2371
2371
  }
2372
2372
  };
2373
2373
 
2374
- module.exports.__wbg_sendblocksuccess_dce982a842847234 = function(arg0, arg1, arg2) {
2374
+ module.exports.__wbg_sendblocksuccess_f964dfa13d899b27 = function(arg0, arg1, arg2) {
2375
2375
  let deferred0_0;
2376
2376
  let deferred0_1;
2377
2377
  try {
@@ -2383,11 +2383,11 @@ module.exports.__wbg_sendblocksuccess_dce982a842847234 = function(arg0, arg1, ar
2383
2383
  }
2384
2384
  };
2385
2385
 
2386
- module.exports.__wbg_sendwalletupdate_c8dc290f091e0a7e = function() {
2386
+ module.exports.__wbg_sendwalletupdate_462cab49394a1c17 = function() {
2387
2387
  MsgHandler.send_wallet_update();
2388
2388
  };
2389
2389
 
2390
- module.exports.__wbg_sendnewversionalert_85b892ef0383f713 = function(arg0, arg1, arg2) {
2390
+ module.exports.__wbg_sendnewversionalert_2fdf2e6ae77153ec = function(arg0, arg1, arg2) {
2391
2391
  let deferred0_0;
2392
2392
  let deferred0_1;
2393
2393
  try {
@@ -2399,15 +2399,15 @@ module.exports.__wbg_sendnewversionalert_85b892ef0383f713 = function(arg0, arg1,
2399
2399
  }
2400
2400
  };
2401
2401
 
2402
- module.exports.__wbg_savewallet_9e616deed8dd9514 = function() {
2402
+ module.exports.__wbg_savewallet_0cf7fbea29fbdcab = function() {
2403
2403
  MsgHandler.save_wallet();
2404
2404
  };
2405
2405
 
2406
- module.exports.__wbg_loadwallet_4077cedbccbc5544 = function() {
2406
+ module.exports.__wbg_loadwallet_3a64c515e4ddaa8b = function() {
2407
2407
  MsgHandler.load_wallet();
2408
2408
  };
2409
2409
 
2410
- module.exports.__wbg_getmyservices_35a2cf577138e555 = function() {
2410
+ module.exports.__wbg_getmyservices_510360de98c318e5 = function() {
2411
2411
  const ret = MsgHandler.get_my_services();
2412
2412
  _assertClass(ret, WasmPeerServiceList);
2413
2413
  var ptr1 = ret.__destroy_into_raw();
@@ -2774,8 +2774,8 @@ module.exports.__wbindgen_memory = function() {
2774
2774
  return addHeapObject(ret);
2775
2775
  };
2776
2776
 
2777
- module.exports.__wbindgen_closure_wrapper1184 = function(arg0, arg1, arg2) {
2778
- const ret = makeMutClosure(arg0, arg1, 432, __wbg_adapter_40);
2777
+ module.exports.__wbindgen_closure_wrapper1213 = function(arg0, arg1, arg2) {
2778
+ const ret = makeMutClosure(arg0, arg1, 449, __wbg_adapter_40);
2779
2779
  return addHeapObject(ret);
2780
2780
  };
2781
2781
 
Binary file