saito-wasm 0.2.6 → 0.2.7

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.6"
3
+ version = "0.2.7"
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.6",
3
+ "version": "0.2.7",
4
4
  "description": "js wrappings around saito-core using wasm",
5
5
  "scripts": {
6
6
  "test": "./node_modules/.bin/jest",
@@ -680,6 +680,11 @@ export class WasmWallet {
680
680
  */
681
681
  add_slip(slip: WasmWalletSlip): Promise<void>;
682
682
  /**
683
+ * @param {WasmTransaction} tx
684
+ * @returns {Promise<void>}
685
+ */
686
+ add_to_pending(tx: WasmTransaction): Promise<void>;
687
+ /**
683
688
  * @returns {Promise<Array<any>>}
684
689
  */
685
690
  get_key_list(): Promise<Array<any>>;
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-85a38d0d1511b673/js/msg_handler.js`);
4
+ const { MsgHandler } = require(String.raw`./snippets/saito-wasm-d957b4bff15e00bf/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');
@@ -582,7 +582,7 @@ function handleError(f, args) {
582
582
  wasm.__wbindgen_exn_store(addHeapObject(e));
583
583
  }
584
584
  }
585
- function __wbg_adapter_372(arg0, arg1, arg2, arg3) {
585
+ function __wbg_adapter_373(arg0, arg1, arg2, arg3) {
586
586
  wasm.wasm_bindgen__convert__closures__invoke2_mut__h633d734e7d6d6514(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
587
587
  }
588
588
 
@@ -2020,6 +2020,16 @@ class WasmWallet {
2020
2020
  return takeObject(ret);
2021
2021
  }
2022
2022
  /**
2023
+ * @param {WasmTransaction} tx
2024
+ * @returns {Promise<void>}
2025
+ */
2026
+ add_to_pending(tx) {
2027
+ _assertClass(tx, WasmTransaction);
2028
+ var ptr0 = tx.__destroy_into_raw();
2029
+ const ret = wasm.wasmwallet_add_to_pending(this.__wbg_ptr, ptr0);
2030
+ return takeObject(ret);
2031
+ }
2032
+ /**
2023
2033
  * @returns {Promise<Array<any>>}
2024
2034
  */
2025
2035
  get_key_list() {
@@ -2168,6 +2178,11 @@ module.exports.__wbindgen_object_drop_ref = function(arg0) {
2168
2178
  takeObject(arg0);
2169
2179
  };
2170
2180
 
2181
+ module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
2182
+ const ret = BigInt.asUintN(64, arg0);
2183
+ return addHeapObject(ret);
2184
+ };
2185
+
2171
2186
  module.exports.__wbg_wasmwallet_new = function(arg0) {
2172
2187
  const ret = WasmWallet.__wrap(arg0);
2173
2188
  return addHeapObject(ret);
@@ -2178,8 +2193,8 @@ module.exports.__wbindgen_string_new = function(arg0, arg1) {
2178
2193
  return addHeapObject(ret);
2179
2194
  };
2180
2195
 
2181
- module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
2182
- const ret = BigInt.asUintN(64, arg0);
2196
+ module.exports.__wbg_wasmblock_new = function(arg0) {
2197
+ const ret = WasmBlock.__wrap(arg0);
2183
2198
  return addHeapObject(ret);
2184
2199
  };
2185
2200
 
@@ -2188,8 +2203,13 @@ module.exports.__wbg_wasmtransaction_new = function(arg0) {
2188
2203
  return addHeapObject(ret);
2189
2204
  };
2190
2205
 
2191
- module.exports.__wbg_wasmblock_new = function(arg0) {
2192
- const ret = WasmBlock.__wrap(arg0);
2206
+ module.exports.__wbg_wasmslip_new = function(arg0) {
2207
+ const ret = WasmSlip.__wrap(arg0);
2208
+ return addHeapObject(ret);
2209
+ };
2210
+
2211
+ module.exports.__wbg_wasmpeer_new = function(arg0) {
2212
+ const ret = WasmPeer.__wrap(arg0);
2193
2213
  return addHeapObject(ret);
2194
2214
  };
2195
2215
 
@@ -2203,21 +2223,11 @@ module.exports.__wbg_wasmwalletslip_new = function(arg0) {
2203
2223
  return addHeapObject(ret);
2204
2224
  };
2205
2225
 
2206
- module.exports.__wbg_wasmpeer_new = function(arg0) {
2207
- const ret = WasmPeer.__wrap(arg0);
2208
- return addHeapObject(ret);
2209
- };
2210
-
2211
2226
  module.exports.__wbg_wasmblockchain_new = function(arg0) {
2212
2227
  const ret = WasmBlockchain.__wrap(arg0);
2213
2228
  return addHeapObject(ret);
2214
2229
  };
2215
2230
 
2216
- module.exports.__wbg_wasmslip_new = function(arg0) {
2217
- const ret = WasmSlip.__wrap(arg0);
2218
- return addHeapObject(ret);
2219
- };
2220
-
2221
2231
  module.exports.__wbindgen_string_get = function(arg0, arg1) {
2222
2232
  const obj = getObject(arg1);
2223
2233
  const ret = typeof(obj) === 'string' ? obj : undefined;
@@ -2247,15 +2257,31 @@ module.exports.__wbg_wasmpeerservice_new = function(arg0) {
2247
2257
  return addHeapObject(ret);
2248
2258
  };
2249
2259
 
2250
- module.exports.__wbg_sendmessage_d26d631079e7972e = function(arg0, arg1) {
2260
+ module.exports.__wbindgen_is_object = function(arg0) {
2261
+ const val = getObject(arg0);
2262
+ const ret = typeof(val) === 'object' && val !== null;
2263
+ return ret;
2264
+ };
2265
+
2266
+ module.exports.__wbindgen_is_undefined = function(arg0) {
2267
+ const ret = getObject(arg0) === undefined;
2268
+ return ret;
2269
+ };
2270
+
2271
+ module.exports.__wbindgen_in = function(arg0, arg1) {
2272
+ const ret = getObject(arg0) in getObject(arg1);
2273
+ return ret;
2274
+ };
2275
+
2276
+ module.exports.__wbg_sendmessage_1212902dea9a6462 = function(arg0, arg1) {
2251
2277
  MsgHandler.send_message(takeObject(arg0), getObject(arg1));
2252
2278
  };
2253
2279
 
2254
- module.exports.__wbg_sendmessagetoall_767fe6a653155589 = function(arg0, arg1) {
2280
+ module.exports.__wbg_sendmessagetoall_183360a6e457aafd = function(arg0, arg1) {
2255
2281
  MsgHandler.send_message_to_all(getObject(arg0), getObject(arg1));
2256
2282
  };
2257
2283
 
2258
- module.exports.__wbg_connecttopeer_3e5a8d255a863186 = function() { return handleError(function (arg0, arg1, arg2) {
2284
+ module.exports.__wbg_connecttopeer_0cf6f403c55758af = function() { return handleError(function (arg0, arg1, arg2) {
2259
2285
  let deferred0_0;
2260
2286
  let deferred0_1;
2261
2287
  try {
@@ -2268,12 +2294,12 @@ module.exports.__wbg_connecttopeer_3e5a8d255a863186 = function() { return handle
2268
2294
  }
2269
2295
  }, arguments) };
2270
2296
 
2271
- module.exports.__wbg_disconnectfrompeer_c90b6ed7778a6070 = function() { return handleError(function (arg0) {
2297
+ module.exports.__wbg_disconnectfrompeer_a1dc7eccc30f5818 = function() { return handleError(function (arg0) {
2272
2298
  const ret = MsgHandler.disconnect_from_peer(takeObject(arg0));
2273
2299
  return addHeapObject(ret);
2274
2300
  }, arguments) };
2275
2301
 
2276
- module.exports.__wbg_fetchblockfrompeer_9ae8da796cdd9ccc = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2302
+ module.exports.__wbg_fetchblockfrompeer_e168ba6cd017328b = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2277
2303
  let deferred0_0;
2278
2304
  let deferred0_1;
2279
2305
  try {
@@ -2286,7 +2312,7 @@ module.exports.__wbg_fetchblockfrompeer_9ae8da796cdd9ccc = function() { return h
2286
2312
  }
2287
2313
  }, arguments) };
2288
2314
 
2289
- module.exports.__wbg_writevalue_82bbfb598e61c29e = function(arg0, arg1, arg2) {
2315
+ module.exports.__wbg_writevalue_9a62a4977742a047 = function(arg0, arg1, arg2) {
2290
2316
  let deferred0_0;
2291
2317
  let deferred0_1;
2292
2318
  try {
@@ -2298,7 +2324,7 @@ module.exports.__wbg_writevalue_82bbfb598e61c29e = function(arg0, arg1, arg2) {
2298
2324
  }
2299
2325
  };
2300
2326
 
2301
- module.exports.__wbg_appendvalue_62f8251b6942f759 = function(arg0, arg1, arg2) {
2327
+ module.exports.__wbg_appendvalue_63e50a60464d461e = function(arg0, arg1, arg2) {
2302
2328
  let deferred0_0;
2303
2329
  let deferred0_1;
2304
2330
  try {
@@ -2310,7 +2336,7 @@ module.exports.__wbg_appendvalue_62f8251b6942f759 = function(arg0, arg1, arg2) {
2310
2336
  }
2311
2337
  };
2312
2338
 
2313
- module.exports.__wbg_flushdata_ddac78ca401e0844 = function(arg0, arg1) {
2339
+ module.exports.__wbg_flushdata_1acb4b409d575db6 = function(arg0, arg1) {
2314
2340
  let deferred0_0;
2315
2341
  let deferred0_1;
2316
2342
  try {
@@ -2322,7 +2348,7 @@ module.exports.__wbg_flushdata_ddac78ca401e0844 = function(arg0, arg1) {
2322
2348
  }
2323
2349
  };
2324
2350
 
2325
- module.exports.__wbg_readvalue_aae34bfe629835d9 = function() { return handleError(function (arg0, arg1) {
2351
+ module.exports.__wbg_readvalue_49067ac50abb8208 = function() { return handleError(function (arg0, arg1) {
2326
2352
  let deferred0_0;
2327
2353
  let deferred0_1;
2328
2354
  try {
@@ -2335,12 +2361,12 @@ module.exports.__wbg_readvalue_aae34bfe629835d9 = function() { return handleErro
2335
2361
  }
2336
2362
  }, arguments) };
2337
2363
 
2338
- module.exports.__wbg_loadblockfilelist_800a58c25da71868 = function() { return handleError(function () {
2364
+ module.exports.__wbg_loadblockfilelist_eb03e9752951a64a = function() { return handleError(function () {
2339
2365
  const ret = MsgHandler.load_block_file_list();
2340
2366
  return addHeapObject(ret);
2341
2367
  }, arguments) };
2342
2368
 
2343
- module.exports.__wbg_isexistingfile_23a3fb33acbbd80f = function() { return handleError(function (arg0, arg1) {
2369
+ module.exports.__wbg_isexistingfile_81371a9c2a12a59c = function() { return handleError(function (arg0, arg1) {
2344
2370
  let deferred0_0;
2345
2371
  let deferred0_1;
2346
2372
  try {
@@ -2353,7 +2379,7 @@ module.exports.__wbg_isexistingfile_23a3fb33acbbd80f = function() { return handl
2353
2379
  }
2354
2380
  }, arguments) };
2355
2381
 
2356
- module.exports.__wbg_removevalue_46d840deac0c4803 = function() { return handleError(function (arg0, arg1) {
2382
+ module.exports.__wbg_removevalue_c48bd4d3ddc63a16 = function() { return handleError(function (arg0, arg1) {
2357
2383
  let deferred0_0;
2358
2384
  let deferred0_1;
2359
2385
  try {
@@ -2366,7 +2392,7 @@ module.exports.__wbg_removevalue_46d840deac0c4803 = function() { return handleEr
2366
2392
  }
2367
2393
  }, arguments) };
2368
2394
 
2369
- module.exports.__wbg_ensureblockdirectoryexists_15554c117deaa3c6 = function() { return handleError(function (arg0, arg1) {
2395
+ module.exports.__wbg_ensureblockdirectoryexists_b8ec8bfe122fc839 = function() { return handleError(function (arg0, arg1) {
2370
2396
  let deferred0_0;
2371
2397
  let deferred0_1;
2372
2398
  try {
@@ -2378,19 +2404,19 @@ module.exports.__wbg_ensureblockdirectoryexists_15554c117deaa3c6 = function() {
2378
2404
  }
2379
2405
  }, arguments) };
2380
2406
 
2381
- module.exports.__wbg_processapicall_9af7fcc8479f7e5c = function(arg0, arg1, arg2) {
2407
+ module.exports.__wbg_processapicall_0ca260a137ffbce1 = function(arg0, arg1, arg2) {
2382
2408
  MsgHandler.process_api_call(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
2383
2409
  };
2384
2410
 
2385
- module.exports.__wbg_processapisuccess_cef3d5002c643541 = function(arg0, arg1, arg2) {
2411
+ module.exports.__wbg_processapisuccess_6f6ceae85a6465b2 = function(arg0, arg1, arg2) {
2386
2412
  MsgHandler.process_api_success(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
2387
2413
  };
2388
2414
 
2389
- module.exports.__wbg_processapierror_0fa072d72a578db8 = function(arg0, arg1, arg2) {
2415
+ module.exports.__wbg_processapierror_8d79343f046dd6c7 = function(arg0, arg1, arg2) {
2390
2416
  MsgHandler.process_api_error(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
2391
2417
  };
2392
2418
 
2393
- module.exports.__wbg_sendinterfaceevent_88b4d4a5728022b1 = function(arg0, arg1, arg2) {
2419
+ module.exports.__wbg_sendinterfaceevent_7e2f07cb642775f1 = function(arg0, arg1, arg2) {
2394
2420
  let deferred0_0;
2395
2421
  let deferred0_1;
2396
2422
  try {
@@ -2402,7 +2428,7 @@ module.exports.__wbg_sendinterfaceevent_88b4d4a5728022b1 = function(arg0, arg1,
2402
2428
  }
2403
2429
  };
2404
2430
 
2405
- module.exports.__wbg_sendblocksuccess_4728a163332d53c9 = function(arg0, arg1, arg2) {
2431
+ module.exports.__wbg_sendblocksuccess_362a17063f76c899 = function(arg0, arg1, arg2) {
2406
2432
  let deferred0_0;
2407
2433
  let deferred0_1;
2408
2434
  try {
@@ -2414,11 +2440,11 @@ module.exports.__wbg_sendblocksuccess_4728a163332d53c9 = function(arg0, arg1, ar
2414
2440
  }
2415
2441
  };
2416
2442
 
2417
- module.exports.__wbg_sendwalletupdate_f931362359108be7 = function() {
2443
+ module.exports.__wbg_sendwalletupdate_3d9d825dd9f8e55b = function() {
2418
2444
  MsgHandler.send_wallet_update();
2419
2445
  };
2420
2446
 
2421
- module.exports.__wbg_sendnewversionalert_77bf6d74fe788061 = function(arg0, arg1, arg2) {
2447
+ module.exports.__wbg_sendnewversionalert_b1859d60af870099 = function(arg0, arg1, arg2) {
2422
2448
  let deferred0_0;
2423
2449
  let deferred0_1;
2424
2450
  try {
@@ -2430,37 +2456,21 @@ module.exports.__wbg_sendnewversionalert_77bf6d74fe788061 = function(arg0, arg1,
2430
2456
  }
2431
2457
  };
2432
2458
 
2433
- module.exports.__wbg_savewallet_8e2925a27385680c = function() {
2459
+ module.exports.__wbg_savewallet_f160f9f36cd4902f = function() {
2434
2460
  MsgHandler.save_wallet();
2435
2461
  };
2436
2462
 
2437
- module.exports.__wbg_loadwallet_85e9ee8adf8f8653 = function() {
2463
+ module.exports.__wbg_loadwallet_d091a30c73f3c185 = function() {
2438
2464
  MsgHandler.load_wallet();
2439
2465
  };
2440
2466
 
2441
- module.exports.__wbg_getmyservices_08c9cff42d43cd20 = function() {
2467
+ module.exports.__wbg_getmyservices_0dec251bd1afa3c2 = function() {
2442
2468
  const ret = MsgHandler.get_my_services();
2443
2469
  _assertClass(ret, WasmPeerServiceList);
2444
2470
  var ptr1 = ret.__destroy_into_raw();
2445
2471
  return ptr1;
2446
2472
  };
2447
2473
 
2448
- module.exports.__wbindgen_is_object = function(arg0) {
2449
- const val = getObject(arg0);
2450
- const ret = typeof(val) === 'object' && val !== null;
2451
- return ret;
2452
- };
2453
-
2454
- module.exports.__wbindgen_is_undefined = function(arg0) {
2455
- const ret = getObject(arg0) === undefined;
2456
- return ret;
2457
- };
2458
-
2459
- module.exports.__wbindgen_in = function(arg0, arg1) {
2460
- const ret = getObject(arg0) in getObject(arg1);
2461
- return ret;
2462
- };
2463
-
2464
2474
  module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
2465
2475
  const ret = getObject(arg0) == getObject(arg1);
2466
2476
  return ret;
@@ -2708,7 +2718,7 @@ module.exports.__wbg_new_81740750da40724f = function(arg0, arg1) {
2708
2718
  const a = state0.a;
2709
2719
  state0.a = 0;
2710
2720
  try {
2711
- return __wbg_adapter_372(a, state0.b, arg0, arg1);
2721
+ return __wbg_adapter_373(a, state0.b, arg0, arg1);
2712
2722
  } finally {
2713
2723
  state0.a = a;
2714
2724
  }
@@ -2806,8 +2816,8 @@ module.exports.__wbindgen_memory = function() {
2806
2816
  return addHeapObject(ret);
2807
2817
  };
2808
2818
 
2809
- module.exports.__wbindgen_closure_wrapper1209 = function(arg0, arg1, arg2) {
2810
- const ret = makeMutClosure(arg0, arg1, 456, __wbg_adapter_38);
2819
+ module.exports.__wbindgen_closure_wrapper1216 = function(arg0, arg1, arg2) {
2820
+ const ret = makeMutClosure(arg0, arg1, 460, __wbg_adapter_38);
2811
2821
  return addHeapObject(ret);
2812
2822
  };
2813
2823
 
Binary file
@@ -83,8 +83,6 @@ export function wasmpeerservice_set_domain(a: number, b: number): void;
83
83
  export function wasmpeerservice_get_domain(a: number): number;
84
84
  export function wasmpeerservicelist_push(a: number, b: number): void;
85
85
  export function wasmpeerservicelist_new(): number;
86
- export function __wbg_wasmconfiguration_free(a: number): void;
87
- export function wasmconfiguration_new(): number;
88
86
  export function __wbg_wasmblock_free(a: number): void;
89
87
  export function wasmblock_new(): number;
90
88
  export function wasmblock_get_transactions(a: number): number;
@@ -180,6 +178,7 @@ export function wasmwallet_get_balance(a: number): number;
180
178
  export function wasmwallet_get_pending_txs(a: number): number;
181
179
  export function wasmwallet_get_slips(a: number): number;
182
180
  export function wasmwallet_add_slip(a: number, b: number): number;
181
+ export function wasmwallet_add_to_pending(a: number, b: number): number;
183
182
  export function wasmwallet_get_key_list(a: number): number;
184
183
  export function wasmwallet_set_key_list(a: number, b: number): number;
185
184
  export function wasmwalletslip_get_utxokey(a: number): number;
@@ -210,6 +209,8 @@ export function wasmpeer_get_sync_type(a: number): number;
210
209
  export function wasmpeer_get_services(a: number): number;
211
210
  export function wasmpeer_set_services(a: number, b: number): void;
212
211
  export function wasmpeer_has_service(a: number, b: number): number;
212
+ export function __wbg_wasmconfiguration_free(a: number): void;
213
+ export function wasmconfiguration_new(): number;
213
214
  export function rustsecp256k1_v0_10_0_context_create(a: number): number;
214
215
  export function rustsecp256k1_v0_10_0_context_destroy(a: number): void;
215
216
  export function rustsecp256k1_v0_10_0_default_illegal_callback_fn(a: number, b: number): void;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saito-wasm",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "files": [
5
5
  "index_bg.wasm",
6
6
  "index.js",
@@ -680,6 +680,11 @@ export class WasmWallet {
680
680
  */
681
681
  add_slip(slip: WasmWalletSlip): Promise<void>;
682
682
  /**
683
+ * @param {WasmTransaction} tx
684
+ * @returns {Promise<void>}
685
+ */
686
+ add_to_pending(tx: WasmTransaction): Promise<void>;
687
+ /**
683
688
  * @returns {Promise<Array<any>>}
684
689
  */
685
690
  get_key_list(): Promise<Array<any>>;
@@ -840,8 +845,6 @@ export interface InitOutput {
840
845
  readonly wasmpeerservice_get_domain: (a: number) => number;
841
846
  readonly wasmpeerservicelist_push: (a: number, b: number) => void;
842
847
  readonly wasmpeerservicelist_new: () => number;
843
- readonly __wbg_wasmconfiguration_free: (a: number) => void;
844
- readonly wasmconfiguration_new: () => number;
845
848
  readonly __wbg_wasmblock_free: (a: number) => void;
846
849
  readonly wasmblock_new: () => number;
847
850
  readonly wasmblock_get_transactions: (a: number) => number;
@@ -937,6 +940,7 @@ export interface InitOutput {
937
940
  readonly wasmwallet_get_pending_txs: (a: number) => number;
938
941
  readonly wasmwallet_get_slips: (a: number) => number;
939
942
  readonly wasmwallet_add_slip: (a: number, b: number) => number;
943
+ readonly wasmwallet_add_to_pending: (a: number, b: number) => number;
940
944
  readonly wasmwallet_get_key_list: (a: number) => number;
941
945
  readonly wasmwallet_set_key_list: (a: number, b: number) => number;
942
946
  readonly wasmwalletslip_get_utxokey: (a: number) => number;
@@ -967,6 +971,8 @@ export interface InitOutput {
967
971
  readonly wasmpeer_get_services: (a: number) => number;
968
972
  readonly wasmpeer_set_services: (a: number, b: number) => void;
969
973
  readonly wasmpeer_has_service: (a: number, b: number) => number;
974
+ readonly __wbg_wasmconfiguration_free: (a: number) => void;
975
+ readonly wasmconfiguration_new: () => number;
970
976
  readonly rustsecp256k1_v0_10_0_context_create: (a: number) => number;
971
977
  readonly rustsecp256k1_v0_10_0_context_destroy: (a: number) => void;
972
978
  readonly rustsecp256k1_v0_10_0_default_illegal_callback_fn: (a: number, b: number) => void;
package/pkg/web/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { MsgHandler } from './snippets/saito-wasm-85a38d0d1511b673/js/msg_handler.js';
1
+ import { MsgHandler } from './snippets/saito-wasm-d957b4bff15e00bf/js/msg_handler.js';
2
2
 
3
3
  let wasm;
4
4
 
@@ -22,6 +22,15 @@ 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
+ }
33
+
25
34
  const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
26
35
 
27
36
  if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
@@ -40,15 +49,6 @@ function getStringFromWasm0(ptr, len) {
40
49
  return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
41
50
  }
42
51
 
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
52
  let WASM_VECTOR_LEN = 0;
53
53
 
54
54
  const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
@@ -580,7 +580,7 @@ function handleError(f, args) {
580
580
  wasm.__wbindgen_exn_store(addHeapObject(e));
581
581
  }
582
582
  }
583
- function __wbg_adapter_372(arg0, arg1, arg2, arg3) {
583
+ function __wbg_adapter_373(arg0, arg1, arg2, arg3) {
584
584
  wasm.wasm_bindgen__convert__closures__invoke2_mut__h633d734e7d6d6514(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
585
585
  }
586
586
 
@@ -2006,6 +2006,16 @@ export class WasmWallet {
2006
2006
  return takeObject(ret);
2007
2007
  }
2008
2008
  /**
2009
+ * @param {WasmTransaction} tx
2010
+ * @returns {Promise<void>}
2011
+ */
2012
+ add_to_pending(tx) {
2013
+ _assertClass(tx, WasmTransaction);
2014
+ var ptr0 = tx.__destroy_into_raw();
2015
+ const ret = wasm.wasmwallet_add_to_pending(this.__wbg_ptr, ptr0);
2016
+ return takeObject(ret);
2017
+ }
2018
+ /**
2009
2019
  * @returns {Promise<Array<any>>}
2010
2020
  */
2011
2021
  get_key_list() {
@@ -2185,6 +2195,10 @@ function __wbg_get_imports() {
2185
2195
  imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
2186
2196
  takeObject(arg0);
2187
2197
  };
2198
+ imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
2199
+ const ret = BigInt.asUintN(64, arg0);
2200
+ return addHeapObject(ret);
2201
+ };
2188
2202
  imports.wbg.__wbg_wasmwallet_new = function(arg0) {
2189
2203
  const ret = WasmWallet.__wrap(arg0);
2190
2204
  return addHeapObject(ret);
@@ -2193,16 +2207,20 @@ function __wbg_get_imports() {
2193
2207
  const ret = getStringFromWasm0(arg0, arg1);
2194
2208
  return addHeapObject(ret);
2195
2209
  };
2196
- imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
2197
- const ret = BigInt.asUintN(64, arg0);
2210
+ imports.wbg.__wbg_wasmblock_new = function(arg0) {
2211
+ const ret = WasmBlock.__wrap(arg0);
2198
2212
  return addHeapObject(ret);
2199
2213
  };
2200
2214
  imports.wbg.__wbg_wasmtransaction_new = function(arg0) {
2201
2215
  const ret = WasmTransaction.__wrap(arg0);
2202
2216
  return addHeapObject(ret);
2203
2217
  };
2204
- imports.wbg.__wbg_wasmblock_new = function(arg0) {
2205
- const ret = WasmBlock.__wrap(arg0);
2218
+ imports.wbg.__wbg_wasmslip_new = function(arg0) {
2219
+ const ret = WasmSlip.__wrap(arg0);
2220
+ return addHeapObject(ret);
2221
+ };
2222
+ imports.wbg.__wbg_wasmpeer_new = function(arg0) {
2223
+ const ret = WasmPeer.__wrap(arg0);
2206
2224
  return addHeapObject(ret);
2207
2225
  };
2208
2226
  imports.wbg.__wbg_wasmbalancesnapshot_new = function(arg0) {
@@ -2213,18 +2231,10 @@ function __wbg_get_imports() {
2213
2231
  const ret = WasmWalletSlip.__wrap(arg0);
2214
2232
  return addHeapObject(ret);
2215
2233
  };
2216
- imports.wbg.__wbg_wasmpeer_new = function(arg0) {
2217
- const ret = WasmPeer.__wrap(arg0);
2218
- return addHeapObject(ret);
2219
- };
2220
2234
  imports.wbg.__wbg_wasmblockchain_new = function(arg0) {
2221
2235
  const ret = WasmBlockchain.__wrap(arg0);
2222
2236
  return addHeapObject(ret);
2223
2237
  };
2224
- imports.wbg.__wbg_wasmslip_new = function(arg0) {
2225
- const ret = WasmSlip.__wrap(arg0);
2226
- return addHeapObject(ret);
2227
- };
2228
2238
  imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
2229
2239
  const obj = getObject(arg1);
2230
2240
  const ret = typeof(obj) === 'string' ? obj : undefined;
@@ -2249,13 +2259,26 @@ function __wbg_get_imports() {
2249
2259
  const ret = WasmPeerService.__wrap(arg0);
2250
2260
  return addHeapObject(ret);
2251
2261
  };
2252
- imports.wbg.__wbg_sendmessage_d26d631079e7972e = function(arg0, arg1) {
2262
+ imports.wbg.__wbindgen_is_object = function(arg0) {
2263
+ const val = getObject(arg0);
2264
+ const ret = typeof(val) === 'object' && val !== null;
2265
+ return ret;
2266
+ };
2267
+ imports.wbg.__wbindgen_is_undefined = function(arg0) {
2268
+ const ret = getObject(arg0) === undefined;
2269
+ return ret;
2270
+ };
2271
+ imports.wbg.__wbindgen_in = function(arg0, arg1) {
2272
+ const ret = getObject(arg0) in getObject(arg1);
2273
+ return ret;
2274
+ };
2275
+ imports.wbg.__wbg_sendmessage_1212902dea9a6462 = function(arg0, arg1) {
2253
2276
  MsgHandler.send_message(takeObject(arg0), getObject(arg1));
2254
2277
  };
2255
- imports.wbg.__wbg_sendmessagetoall_767fe6a653155589 = function(arg0, arg1) {
2278
+ imports.wbg.__wbg_sendmessagetoall_183360a6e457aafd = function(arg0, arg1) {
2256
2279
  MsgHandler.send_message_to_all(getObject(arg0), getObject(arg1));
2257
2280
  };
2258
- imports.wbg.__wbg_connecttopeer_3e5a8d255a863186 = function() { return handleError(function (arg0, arg1, arg2) {
2281
+ imports.wbg.__wbg_connecttopeer_0cf6f403c55758af = function() { return handleError(function (arg0, arg1, arg2) {
2259
2282
  let deferred0_0;
2260
2283
  let deferred0_1;
2261
2284
  try {
@@ -2267,11 +2290,11 @@ function __wbg_get_imports() {
2267
2290
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2268
2291
  }
2269
2292
  }, arguments) };
2270
- imports.wbg.__wbg_disconnectfrompeer_c90b6ed7778a6070 = function() { return handleError(function (arg0) {
2293
+ imports.wbg.__wbg_disconnectfrompeer_a1dc7eccc30f5818 = function() { return handleError(function (arg0) {
2271
2294
  const ret = MsgHandler.disconnect_from_peer(takeObject(arg0));
2272
2295
  return addHeapObject(ret);
2273
2296
  }, arguments) };
2274
- imports.wbg.__wbg_fetchblockfrompeer_9ae8da796cdd9ccc = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2297
+ imports.wbg.__wbg_fetchblockfrompeer_e168ba6cd017328b = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2275
2298
  let deferred0_0;
2276
2299
  let deferred0_1;
2277
2300
  try {
@@ -2283,7 +2306,7 @@ function __wbg_get_imports() {
2283
2306
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2284
2307
  }
2285
2308
  }, arguments) };
2286
- imports.wbg.__wbg_writevalue_82bbfb598e61c29e = function(arg0, arg1, arg2) {
2309
+ imports.wbg.__wbg_writevalue_9a62a4977742a047 = function(arg0, arg1, arg2) {
2287
2310
  let deferred0_0;
2288
2311
  let deferred0_1;
2289
2312
  try {
@@ -2294,7 +2317,7 @@ function __wbg_get_imports() {
2294
2317
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2295
2318
  }
2296
2319
  };
2297
- imports.wbg.__wbg_appendvalue_62f8251b6942f759 = function(arg0, arg1, arg2) {
2320
+ imports.wbg.__wbg_appendvalue_63e50a60464d461e = function(arg0, arg1, arg2) {
2298
2321
  let deferred0_0;
2299
2322
  let deferred0_1;
2300
2323
  try {
@@ -2305,7 +2328,7 @@ function __wbg_get_imports() {
2305
2328
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2306
2329
  }
2307
2330
  };
2308
- imports.wbg.__wbg_flushdata_ddac78ca401e0844 = function(arg0, arg1) {
2331
+ imports.wbg.__wbg_flushdata_1acb4b409d575db6 = function(arg0, arg1) {
2309
2332
  let deferred0_0;
2310
2333
  let deferred0_1;
2311
2334
  try {
@@ -2316,7 +2339,7 @@ function __wbg_get_imports() {
2316
2339
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2317
2340
  }
2318
2341
  };
2319
- imports.wbg.__wbg_readvalue_aae34bfe629835d9 = function() { return handleError(function (arg0, arg1) {
2342
+ imports.wbg.__wbg_readvalue_49067ac50abb8208 = function() { return handleError(function (arg0, arg1) {
2320
2343
  let deferred0_0;
2321
2344
  let deferred0_1;
2322
2345
  try {
@@ -2328,11 +2351,11 @@ function __wbg_get_imports() {
2328
2351
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2329
2352
  }
2330
2353
  }, arguments) };
2331
- imports.wbg.__wbg_loadblockfilelist_800a58c25da71868 = function() { return handleError(function () {
2354
+ imports.wbg.__wbg_loadblockfilelist_eb03e9752951a64a = function() { return handleError(function () {
2332
2355
  const ret = MsgHandler.load_block_file_list();
2333
2356
  return addHeapObject(ret);
2334
2357
  }, arguments) };
2335
- imports.wbg.__wbg_isexistingfile_23a3fb33acbbd80f = function() { return handleError(function (arg0, arg1) {
2358
+ imports.wbg.__wbg_isexistingfile_81371a9c2a12a59c = function() { return handleError(function (arg0, arg1) {
2336
2359
  let deferred0_0;
2337
2360
  let deferred0_1;
2338
2361
  try {
@@ -2344,7 +2367,7 @@ function __wbg_get_imports() {
2344
2367
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2345
2368
  }
2346
2369
  }, arguments) };
2347
- imports.wbg.__wbg_removevalue_46d840deac0c4803 = function() { return handleError(function (arg0, arg1) {
2370
+ imports.wbg.__wbg_removevalue_c48bd4d3ddc63a16 = function() { return handleError(function (arg0, arg1) {
2348
2371
  let deferred0_0;
2349
2372
  let deferred0_1;
2350
2373
  try {
@@ -2356,7 +2379,7 @@ function __wbg_get_imports() {
2356
2379
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2357
2380
  }
2358
2381
  }, arguments) };
2359
- imports.wbg.__wbg_ensureblockdirectoryexists_15554c117deaa3c6 = function() { return handleError(function (arg0, arg1) {
2382
+ imports.wbg.__wbg_ensureblockdirectoryexists_b8ec8bfe122fc839 = function() { return handleError(function (arg0, arg1) {
2360
2383
  let deferred0_0;
2361
2384
  let deferred0_1;
2362
2385
  try {
@@ -2367,16 +2390,16 @@ function __wbg_get_imports() {
2367
2390
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2368
2391
  }
2369
2392
  }, arguments) };
2370
- imports.wbg.__wbg_processapicall_9af7fcc8479f7e5c = function(arg0, arg1, arg2) {
2393
+ imports.wbg.__wbg_processapicall_0ca260a137ffbce1 = function(arg0, arg1, arg2) {
2371
2394
  MsgHandler.process_api_call(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
2372
2395
  };
2373
- imports.wbg.__wbg_processapisuccess_cef3d5002c643541 = function(arg0, arg1, arg2) {
2396
+ imports.wbg.__wbg_processapisuccess_6f6ceae85a6465b2 = function(arg0, arg1, arg2) {
2374
2397
  MsgHandler.process_api_success(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
2375
2398
  };
2376
- imports.wbg.__wbg_processapierror_0fa072d72a578db8 = function(arg0, arg1, arg2) {
2399
+ imports.wbg.__wbg_processapierror_8d79343f046dd6c7 = function(arg0, arg1, arg2) {
2377
2400
  MsgHandler.process_api_error(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
2378
2401
  };
2379
- imports.wbg.__wbg_sendinterfaceevent_88b4d4a5728022b1 = function(arg0, arg1, arg2) {
2402
+ imports.wbg.__wbg_sendinterfaceevent_7e2f07cb642775f1 = function(arg0, arg1, arg2) {
2380
2403
  let deferred0_0;
2381
2404
  let deferred0_1;
2382
2405
  try {
@@ -2387,7 +2410,7 @@ function __wbg_get_imports() {
2387
2410
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2388
2411
  }
2389
2412
  };
2390
- imports.wbg.__wbg_sendblocksuccess_4728a163332d53c9 = function(arg0, arg1, arg2) {
2413
+ imports.wbg.__wbg_sendblocksuccess_362a17063f76c899 = function(arg0, arg1, arg2) {
2391
2414
  let deferred0_0;
2392
2415
  let deferred0_1;
2393
2416
  try {
@@ -2398,10 +2421,10 @@ function __wbg_get_imports() {
2398
2421
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2399
2422
  }
2400
2423
  };
2401
- imports.wbg.__wbg_sendwalletupdate_f931362359108be7 = function() {
2424
+ imports.wbg.__wbg_sendwalletupdate_3d9d825dd9f8e55b = function() {
2402
2425
  MsgHandler.send_wallet_update();
2403
2426
  };
2404
- imports.wbg.__wbg_sendnewversionalert_77bf6d74fe788061 = function(arg0, arg1, arg2) {
2427
+ imports.wbg.__wbg_sendnewversionalert_b1859d60af870099 = function(arg0, arg1, arg2) {
2405
2428
  let deferred0_0;
2406
2429
  let deferred0_1;
2407
2430
  try {
@@ -2412,31 +2435,18 @@ function __wbg_get_imports() {
2412
2435
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2413
2436
  }
2414
2437
  };
2415
- imports.wbg.__wbg_savewallet_8e2925a27385680c = function() {
2438
+ imports.wbg.__wbg_savewallet_f160f9f36cd4902f = function() {
2416
2439
  MsgHandler.save_wallet();
2417
2440
  };
2418
- imports.wbg.__wbg_loadwallet_85e9ee8adf8f8653 = function() {
2441
+ imports.wbg.__wbg_loadwallet_d091a30c73f3c185 = function() {
2419
2442
  MsgHandler.load_wallet();
2420
2443
  };
2421
- imports.wbg.__wbg_getmyservices_08c9cff42d43cd20 = function() {
2444
+ imports.wbg.__wbg_getmyservices_0dec251bd1afa3c2 = function() {
2422
2445
  const ret = MsgHandler.get_my_services();
2423
2446
  _assertClass(ret, WasmPeerServiceList);
2424
2447
  var ptr1 = ret.__destroy_into_raw();
2425
2448
  return ptr1;
2426
2449
  };
2427
- imports.wbg.__wbindgen_is_object = function(arg0) {
2428
- const val = getObject(arg0);
2429
- const ret = typeof(val) === 'object' && val !== null;
2430
- return ret;
2431
- };
2432
- imports.wbg.__wbindgen_is_undefined = function(arg0) {
2433
- const ret = getObject(arg0) === undefined;
2434
- return ret;
2435
- };
2436
- imports.wbg.__wbindgen_in = function(arg0, arg1) {
2437
- const ret = getObject(arg0) in getObject(arg1);
2438
- return ret;
2439
- };
2440
2450
  imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
2441
2451
  const ret = getObject(arg0) == getObject(arg1);
2442
2452
  return ret;
@@ -2637,7 +2647,7 @@ function __wbg_get_imports() {
2637
2647
  const a = state0.a;
2638
2648
  state0.a = 0;
2639
2649
  try {
2640
- return __wbg_adapter_372(a, state0.b, arg0, arg1);
2650
+ return __wbg_adapter_373(a, state0.b, arg0, arg1);
2641
2651
  } finally {
2642
2652
  state0.a = a;
2643
2653
  }
@@ -2718,8 +2728,8 @@ function __wbg_get_imports() {
2718
2728
  const ret = wasm.memory;
2719
2729
  return addHeapObject(ret);
2720
2730
  };
2721
- imports.wbg.__wbindgen_closure_wrapper1209 = function(arg0, arg1, arg2) {
2722
- const ret = makeMutClosure(arg0, arg1, 456, __wbg_adapter_38);
2731
+ imports.wbg.__wbindgen_closure_wrapper1216 = function(arg0, arg1, arg2) {
2732
+ const ret = makeMutClosure(arg0, arg1, 460, __wbg_adapter_38);
2723
2733
  return addHeapObject(ret);
2724
2734
  };
2725
2735
 
Binary file
@@ -83,8 +83,6 @@ export function wasmpeerservice_set_domain(a: number, b: number): void;
83
83
  export function wasmpeerservice_get_domain(a: number): number;
84
84
  export function wasmpeerservicelist_push(a: number, b: number): void;
85
85
  export function wasmpeerservicelist_new(): number;
86
- export function __wbg_wasmconfiguration_free(a: number): void;
87
- export function wasmconfiguration_new(): number;
88
86
  export function __wbg_wasmblock_free(a: number): void;
89
87
  export function wasmblock_new(): number;
90
88
  export function wasmblock_get_transactions(a: number): number;
@@ -180,6 +178,7 @@ export function wasmwallet_get_balance(a: number): number;
180
178
  export function wasmwallet_get_pending_txs(a: number): number;
181
179
  export function wasmwallet_get_slips(a: number): number;
182
180
  export function wasmwallet_add_slip(a: number, b: number): number;
181
+ export function wasmwallet_add_to_pending(a: number, b: number): number;
183
182
  export function wasmwallet_get_key_list(a: number): number;
184
183
  export function wasmwallet_set_key_list(a: number, b: number): number;
185
184
  export function wasmwalletslip_get_utxokey(a: number): number;
@@ -210,6 +209,8 @@ export function wasmpeer_get_sync_type(a: number): number;
210
209
  export function wasmpeer_get_services(a: number): number;
211
210
  export function wasmpeer_set_services(a: number, b: number): void;
212
211
  export function wasmpeer_has_service(a: number, b: number): number;
212
+ export function __wbg_wasmconfiguration_free(a: number): void;
213
+ export function wasmconfiguration_new(): number;
213
214
  export function rustsecp256k1_v0_10_0_context_create(a: number): number;
214
215
  export function rustsecp256k1_v0_10_0_context_destroy(a: number): void;
215
216
  export function rustsecp256k1_v0_10_0_default_illegal_callback_fn(a: number, b: number): void;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saito-wasm",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
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
- "node-fetch": "^3.3.0",
16
- "cross-env": "^7.0.3"
15
+ "cross-env": "^7.0.3",
16
+ "node-fetch": "^3.3.0"
17
17
  }
18
18
  }