saito-wasm 0.1.46 → 0.1.48

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.46"
3
+ version = "0.1.48"
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.46",
3
+ "version": "0.1.48",
4
4
  "description": "js wrappings around saito-core using wasm",
5
5
  "scripts": {
6
6
  "test": "./node_modules/.bin/jest",
@@ -57,6 +57,13 @@ export function process_msg_buffer_from_peer(buffer: Uint8Array, peer_index: big
57
57
  */
58
58
  export function process_fetched_block(buffer: Uint8Array, hash: Uint8Array, peer_index: bigint): Promise<void>;
59
59
  /**
60
+ * @param {Uint8Array} hash
61
+ * @param {bigint} block_id
62
+ * @param {bigint} peer_index
63
+ * @returns {Promise<void>}
64
+ */
65
+ export function process_failed_block_fetch(hash: Uint8Array, block_id: bigint, peer_index: bigint): Promise<void>;
66
+ /**
60
67
  * @param {bigint} duration_in_ms
61
68
  * @returns {Promise<void>}
62
69
  */
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-8c18e4f881e1872e/js/msg_handler.js`);
4
+ const { MsgHandler } = require(String.raw`./snippets/saito-wasm-bee6f4652598cafe/js/msg_handler.js`);
5
5
  const { TextDecoder, TextEncoder } = require(`util`);
6
6
 
7
7
  const heap = new Array(128).fill(undefined);
@@ -225,7 +225,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
225
225
  return real;
226
226
  }
227
227
  function __wbg_adapter_40(arg0, arg1, arg2) {
228
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h71ee5d4075b93a8f(arg0, arg1, addHeapObject(arg2));
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
231
  function _assertClass(instance, klass) {
@@ -326,6 +326,17 @@ module.exports.process_fetched_block = function(buffer, hash, peer_index) {
326
326
  return takeObject(ret);
327
327
  };
328
328
 
329
+ /**
330
+ * @param {Uint8Array} hash
331
+ * @param {bigint} block_id
332
+ * @param {bigint} peer_index
333
+ * @returns {Promise<void>}
334
+ */
335
+ module.exports.process_failed_block_fetch = function(hash, block_id, peer_index) {
336
+ const ret = wasm.process_failed_block_fetch(addHeapObject(hash), block_id, peer_index);
337
+ return takeObject(ret);
338
+ };
339
+
329
340
  /**
330
341
  * @param {bigint} duration_in_ms
331
342
  * @returns {Promise<void>}
@@ -544,8 +555,8 @@ function handleError(f, args) {
544
555
  wasm.__wbindgen_exn_store(addHeapObject(e));
545
556
  }
546
557
  }
547
- function __wbg_adapter_369(arg0, arg1, arg2, arg3) {
548
- wasm.wasm_bindgen__convert__closures__invoke2_mut__h042dde47a1d77254(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
558
+ function __wbg_adapter_370(arg0, arg1, arg2, arg3) {
559
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__h4e52ae1122c1d137(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
549
560
  }
550
561
 
551
562
  const SaitoWasmFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -2142,23 +2153,18 @@ module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
2142
2153
  return addHeapObject(ret);
2143
2154
  };
2144
2155
 
2145
- module.exports.__wbg_wasmwalletslip_new = function(arg0) {
2146
- const ret = WasmWalletSlip.__wrap(arg0);
2147
- return addHeapObject(ret);
2148
- };
2149
-
2150
2156
  module.exports.__wbg_wasmwallet_new = function(arg0) {
2151
2157
  const ret = WasmWallet.__wrap(arg0);
2152
2158
  return addHeapObject(ret);
2153
2159
  };
2154
2160
 
2155
- module.exports.__wbg_wasmblockchain_new = function(arg0) {
2156
- const ret = WasmBlockchain.__wrap(arg0);
2161
+ module.exports.__wbindgen_string_new = function(arg0, arg1) {
2162
+ const ret = getStringFromWasm0(arg0, arg1);
2157
2163
  return addHeapObject(ret);
2158
2164
  };
2159
2165
 
2160
- module.exports.__wbindgen_string_new = function(arg0, arg1) {
2161
- const ret = getStringFromWasm0(arg0, arg1);
2166
+ module.exports.__wbg_wasmpeer_new = function(arg0) {
2167
+ const ret = WasmPeer.__wrap(arg0);
2162
2168
  return addHeapObject(ret);
2163
2169
  };
2164
2170
 
@@ -2172,6 +2178,21 @@ module.exports.__wbg_wasmtransaction_new = function(arg0) {
2172
2178
  return addHeapObject(ret);
2173
2179
  };
2174
2180
 
2181
+ module.exports.__wbg_wasmwalletslip_new = function(arg0) {
2182
+ const ret = WasmWalletSlip.__wrap(arg0);
2183
+ return addHeapObject(ret);
2184
+ };
2185
+
2186
+ module.exports.__wbg_wasmbalancesnapshot_new = function(arg0) {
2187
+ const ret = WasmBalanceSnapshot.__wrap(arg0);
2188
+ return addHeapObject(ret);
2189
+ };
2190
+
2191
+ module.exports.__wbg_wasmblockchain_new = function(arg0) {
2192
+ const ret = WasmBlockchain.__wrap(arg0);
2193
+ return addHeapObject(ret);
2194
+ };
2195
+
2175
2196
  module.exports.__wbg_wasmblock_new = function(arg0) {
2176
2197
  const ret = WasmBlock.__wrap(arg0);
2177
2198
  return addHeapObject(ret);
@@ -2191,16 +2212,6 @@ module.exports.__wbindgen_string_get = function(arg0, arg1) {
2191
2212
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2192
2213
  };
2193
2214
 
2194
- module.exports.__wbg_wasmpeer_new = function(arg0) {
2195
- const ret = WasmPeer.__wrap(arg0);
2196
- return addHeapObject(ret);
2197
- };
2198
-
2199
- module.exports.__wbg_wasmbalancesnapshot_new = function(arg0) {
2200
- const ret = WasmBalanceSnapshot.__wrap(arg0);
2201
- return addHeapObject(ret);
2202
- };
2203
-
2204
2215
  module.exports.__wbg_wasmhop_new = function(arg0) {
2205
2216
  const ret = WasmHop.__wrap(arg0);
2206
2217
  return addHeapObject(ret);
@@ -2237,38 +2248,38 @@ module.exports.__wbindgen_in = function(arg0, arg1) {
2237
2248
  return ret;
2238
2249
  };
2239
2250
 
2240
- module.exports.__wbg_sendmessage_5ad9fcfca644e52d = function(arg0, arg1) {
2251
+ module.exports.__wbg_sendmessage_852a76511cb6527f = function(arg0, arg1) {
2241
2252
  MsgHandler.send_message(takeObject(arg0), getObject(arg1));
2242
2253
  };
2243
2254
 
2244
- module.exports.__wbg_sendmessagetoall_3a53e557d5a7b3f5 = function(arg0, arg1) {
2255
+ module.exports.__wbg_sendmessagetoall_5160cf97b40924cd = function(arg0, arg1) {
2245
2256
  MsgHandler.send_message_to_all(getObject(arg0), getObject(arg1));
2246
2257
  };
2247
2258
 
2248
- module.exports.__wbg_connecttopeer_5111d21e039c34a4 = function() { return handleError(function (arg0) {
2259
+ module.exports.__wbg_connecttopeer_d6695c733213736c = function() { return handleError(function (arg0) {
2249
2260
  const ret = MsgHandler.connect_to_peer(takeObject(arg0));
2250
2261
  return addHeapObject(ret);
2251
2262
  }, arguments) };
2252
2263
 
2253
- module.exports.__wbg_disconnectfrompeer_6147b8c175b9ff9a = function() { return handleError(function (arg0) {
2264
+ module.exports.__wbg_disconnectfrompeer_ba867bd87f1b7975 = function() { return handleError(function (arg0) {
2254
2265
  const ret = MsgHandler.disconnect_from_peer(takeObject(arg0));
2255
2266
  return addHeapObject(ret);
2256
2267
  }, arguments) };
2257
2268
 
2258
- module.exports.__wbg_fetchblockfrompeer_9211aa1fb219db5f = function() { return handleError(function (arg0, arg1, arg2, arg3) {
2269
+ module.exports.__wbg_fetchblockfrompeer_4a6143b4aef8bdcc = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2259
2270
  let deferred0_0;
2260
2271
  let deferred0_1;
2261
2272
  try {
2262
2273
  deferred0_0 = arg2;
2263
2274
  deferred0_1 = arg3;
2264
- const ret = MsgHandler.fetch_block_from_peer(getObject(arg0), takeObject(arg1), getStringFromWasm0(arg2, arg3));
2275
+ const ret = MsgHandler.fetch_block_from_peer(getObject(arg0), takeObject(arg1), getStringFromWasm0(arg2, arg3), takeObject(arg4));
2265
2276
  return addHeapObject(ret);
2266
2277
  } finally {
2267
2278
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2268
2279
  }
2269
2280
  }, arguments) };
2270
2281
 
2271
- module.exports.__wbg_writevalue_4fca84ab33c90cf3 = function(arg0, arg1, arg2) {
2282
+ module.exports.__wbg_writevalue_87e8ba754be5b043 = function(arg0, arg1, arg2) {
2272
2283
  let deferred0_0;
2273
2284
  let deferred0_1;
2274
2285
  try {
@@ -2280,7 +2291,7 @@ module.exports.__wbg_writevalue_4fca84ab33c90cf3 = function(arg0, arg1, arg2) {
2280
2291
  }
2281
2292
  };
2282
2293
 
2283
- module.exports.__wbg_readvalue_d087b44f36774ed7 = function() { return handleError(function (arg0, arg1) {
2294
+ module.exports.__wbg_readvalue_94f7827fba4a63c1 = function() { return handleError(function (arg0, arg1) {
2284
2295
  let deferred0_0;
2285
2296
  let deferred0_1;
2286
2297
  try {
@@ -2293,12 +2304,12 @@ module.exports.__wbg_readvalue_d087b44f36774ed7 = function() { return handleErro
2293
2304
  }
2294
2305
  }, arguments) };
2295
2306
 
2296
- module.exports.__wbg_loadblockfilelist_8f5f845d0fa0cfdf = function() { return handleError(function () {
2307
+ module.exports.__wbg_loadblockfilelist_16018f0516427731 = function() { return handleError(function () {
2297
2308
  const ret = MsgHandler.load_block_file_list();
2298
2309
  return addHeapObject(ret);
2299
2310
  }, arguments) };
2300
2311
 
2301
- module.exports.__wbg_isexistingfile_209a2a6fd1e83bfc = function() { return handleError(function (arg0, arg1) {
2312
+ module.exports.__wbg_isexistingfile_264a89498af23aea = function() { return handleError(function (arg0, arg1) {
2302
2313
  let deferred0_0;
2303
2314
  let deferred0_1;
2304
2315
  try {
@@ -2311,7 +2322,7 @@ module.exports.__wbg_isexistingfile_209a2a6fd1e83bfc = function() { return handl
2311
2322
  }
2312
2323
  }, arguments) };
2313
2324
 
2314
- module.exports.__wbg_removevalue_152b9e3b5c25b65b = function() { return handleError(function (arg0, arg1) {
2325
+ module.exports.__wbg_removevalue_a00fcecfaec11750 = function() { return handleError(function (arg0, arg1) {
2315
2326
  let deferred0_0;
2316
2327
  let deferred0_1;
2317
2328
  try {
@@ -2324,7 +2335,7 @@ module.exports.__wbg_removevalue_152b9e3b5c25b65b = function() { return handleEr
2324
2335
  }
2325
2336
  }, arguments) };
2326
2337
 
2327
- module.exports.__wbg_ensureblockdirectoryexists_61aa09babd711ebd = function() { return handleError(function (arg0, arg1) {
2338
+ module.exports.__wbg_ensureblockdirectoryexists_3d8bbf658ca46a36 = function() { return handleError(function (arg0, arg1) {
2328
2339
  let deferred0_0;
2329
2340
  let deferred0_1;
2330
2341
  try {
@@ -2336,19 +2347,19 @@ module.exports.__wbg_ensureblockdirectoryexists_61aa09babd711ebd = function() {
2336
2347
  }
2337
2348
  }, arguments) };
2338
2349
 
2339
- module.exports.__wbg_processapicall_5837c3c1eb77b6ab = function(arg0, arg1, arg2) {
2350
+ module.exports.__wbg_processapicall_b5b829072ddefb4d = function(arg0, arg1, arg2) {
2340
2351
  MsgHandler.process_api_call(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
2341
2352
  };
2342
2353
 
2343
- module.exports.__wbg_processapisuccess_d7b709a0dbbcdf97 = function(arg0, arg1, arg2) {
2354
+ module.exports.__wbg_processapisuccess_fce9163285b965e3 = function(arg0, arg1, arg2) {
2344
2355
  MsgHandler.process_api_success(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
2345
2356
  };
2346
2357
 
2347
- module.exports.__wbg_processapierror_1d2ecb7b9c54f5fd = function(arg0, arg1, arg2) {
2358
+ module.exports.__wbg_processapierror_cac73a72c30a63d1 = function(arg0, arg1, arg2) {
2348
2359
  MsgHandler.process_api_error(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
2349
2360
  };
2350
2361
 
2351
- module.exports.__wbg_sendinterfaceevent_6970a814a76481f5 = function(arg0, arg1, arg2) {
2362
+ module.exports.__wbg_sendinterfaceevent_b5612b48ed4cca7d = function(arg0, arg1, arg2) {
2352
2363
  let deferred0_0;
2353
2364
  let deferred0_1;
2354
2365
  try {
@@ -2360,7 +2371,7 @@ module.exports.__wbg_sendinterfaceevent_6970a814a76481f5 = function(arg0, arg1,
2360
2371
  }
2361
2372
  };
2362
2373
 
2363
- module.exports.__wbg_sendblocksuccess_f846a1f1e943b704 = function(arg0, arg1, arg2) {
2374
+ module.exports.__wbg_sendblocksuccess_dce982a842847234 = function(arg0, arg1, arg2) {
2364
2375
  let deferred0_0;
2365
2376
  let deferred0_1;
2366
2377
  try {
@@ -2372,11 +2383,11 @@ module.exports.__wbg_sendblocksuccess_f846a1f1e943b704 = function(arg0, arg1, ar
2372
2383
  }
2373
2384
  };
2374
2385
 
2375
- module.exports.__wbg_sendwalletupdate_d7adc771b9b0d982 = function() {
2386
+ module.exports.__wbg_sendwalletupdate_c8dc290f091e0a7e = function() {
2376
2387
  MsgHandler.send_wallet_update();
2377
2388
  };
2378
2389
 
2379
- module.exports.__wbg_sendnewversionalert_ba100fad975d0e8d = function(arg0, arg1, arg2) {
2390
+ module.exports.__wbg_sendnewversionalert_85b892ef0383f713 = function(arg0, arg1, arg2) {
2380
2391
  let deferred0_0;
2381
2392
  let deferred0_1;
2382
2393
  try {
@@ -2388,15 +2399,15 @@ module.exports.__wbg_sendnewversionalert_ba100fad975d0e8d = function(arg0, arg1,
2388
2399
  }
2389
2400
  };
2390
2401
 
2391
- module.exports.__wbg_savewallet_6379efcc479145ec = function() {
2402
+ module.exports.__wbg_savewallet_9e616deed8dd9514 = function() {
2392
2403
  MsgHandler.save_wallet();
2393
2404
  };
2394
2405
 
2395
- module.exports.__wbg_loadwallet_f998f6f5e3d90b1e = function() {
2406
+ module.exports.__wbg_loadwallet_4077cedbccbc5544 = function() {
2396
2407
  MsgHandler.load_wallet();
2397
2408
  };
2398
2409
 
2399
- module.exports.__wbg_getmyservices_4705725093cf9d12 = function() {
2410
+ module.exports.__wbg_getmyservices_35a2cf577138e555 = function() {
2400
2411
  const ret = MsgHandler.get_my_services();
2401
2412
  _assertClass(ret, WasmPeerServiceList);
2402
2413
  var ptr1 = ret.__destroy_into_raw();
@@ -2655,7 +2666,7 @@ module.exports.__wbg_new_81740750da40724f = function(arg0, arg1) {
2655
2666
  const a = state0.a;
2656
2667
  state0.a = 0;
2657
2668
  try {
2658
- return __wbg_adapter_369(a, state0.b, arg0, arg1);
2669
+ return __wbg_adapter_370(a, state0.b, arg0, arg1);
2659
2670
  } finally {
2660
2671
  state0.a = a;
2661
2672
  }
@@ -2763,8 +2774,8 @@ module.exports.__wbindgen_memory = function() {
2763
2774
  return addHeapObject(ret);
2764
2775
  };
2765
2776
 
2766
- module.exports.__wbindgen_closure_wrapper1176 = function(arg0, arg1, arg2) {
2767
- const ret = makeMutClosure(arg0, arg1, 427, __wbg_adapter_40);
2777
+ module.exports.__wbindgen_closure_wrapper1184 = function(arg0, arg1, arg2) {
2778
+ const ret = makeMutClosure(arg0, arg1, 432, __wbg_adapter_40);
2768
2779
  return addHeapObject(ret);
2769
2780
  };
2770
2781
 
Binary file
@@ -128,6 +128,7 @@ export function process_new_peer(a: number, b: number): number;
128
128
  export function process_peer_disconnection(a: number): number;
129
129
  export function process_msg_buffer_from_peer(a: number, b: number): number;
130
130
  export function process_fetched_block(a: number, b: number, c: number): number;
131
+ export function process_failed_block_fetch(a: number, b: number, c: number): number;
131
132
  export function process_timer_event(a: number): number;
132
133
  export function hash(a: number): number;
133
134
  export function sign_buffer(a: number, b: number, c: number): void;
@@ -148,6 +149,26 @@ export function get_blockchain(): number;
148
149
  export function get_mempool_txs(): number;
149
150
  export function set_wallet_version(a: number, b: number, c: number): number;
150
151
  export function is_valid_public_key(a: number): number;
152
+ export function __wbg_wasmblockchain_free(a: number): void;
153
+ export function wasmblockchain_reset(a: number): number;
154
+ export function wasmblockchain_get_last_block_id(a: number): number;
155
+ export function wasmblockchain_get_last_timestamp(a: number): number;
156
+ export function wasmblockchain_get_longest_chain_hash_at(a: number, b: number): number;
157
+ export function wasmblockchain_get_last_block_hash(a: number): number;
158
+ export function wasmblockchain_get_last_burnfee(a: number): number;
159
+ export function wasmblockchain_get_genesis_block_id(a: number): number;
160
+ export function wasmblockchain_get_genesis_timestamp(a: number): number;
161
+ export function wasmblockchain_get_lowest_acceptable_timestamp(a: number): number;
162
+ export function wasmblockchain_get_lowest_acceptable_block_hash(a: number): number;
163
+ export function wasmblockchain_get_lowest_acceptable_block_id(a: number): number;
164
+ export function wasmblockchain_get_latest_block_id(a: number): number;
165
+ export function wasmblockchain_get_fork_id(a: number): number;
166
+ export function wasmblockchain_get_longest_chain_hash_at_id(a: number, b: number): number;
167
+ export function wasmblockchain_get_hashes_at_id(a: number, b: number): number;
168
+ export function __wbg_wasmhop_free(a: number): void;
169
+ export function wasmhop_from(a: number, b: number): void;
170
+ export function wasmhop_sig(a: number, b: number): void;
171
+ export function wasmhop_to(a: number, b: number): void;
151
172
  export function __wbg_wasmconsensusvalues_free(a: number): void;
152
173
  export function wasmconsensusvalues_it_num(a: number): number;
153
174
  export function wasmconsensusvalues_fee_transaction(a: number): number;
@@ -187,26 +208,6 @@ export function wasmtransaction_set_type(a: number, b: number): void;
187
208
  export function wasmtransaction_total_fees(a: number): number;
188
209
  export function wasmtransaction_serialize(a: number): number;
189
210
  export function wasmtransaction_deserialize(a: number, b: number): void;
190
- export function __wbg_wasmblockchain_free(a: number): void;
191
- export function wasmblockchain_reset(a: number): number;
192
- export function wasmblockchain_get_last_block_id(a: number): number;
193
- export function wasmblockchain_get_last_timestamp(a: number): number;
194
- export function wasmblockchain_get_longest_chain_hash_at(a: number, b: number): number;
195
- export function wasmblockchain_get_last_block_hash(a: number): number;
196
- export function wasmblockchain_get_last_burnfee(a: number): number;
197
- export function wasmblockchain_get_genesis_block_id(a: number): number;
198
- export function wasmblockchain_get_genesis_timestamp(a: number): number;
199
- export function wasmblockchain_get_lowest_acceptable_timestamp(a: number): number;
200
- export function wasmblockchain_get_lowest_acceptable_block_hash(a: number): number;
201
- export function wasmblockchain_get_lowest_acceptable_block_id(a: number): number;
202
- export function wasmblockchain_get_latest_block_id(a: number): number;
203
- export function wasmblockchain_get_fork_id(a: number): number;
204
- export function wasmblockchain_get_longest_chain_hash_at_id(a: number, b: number): number;
205
- export function wasmblockchain_get_hashes_at_id(a: number, b: number): number;
206
- export function __wbg_wasmhop_free(a: number): void;
207
- export function wasmhop_from(a: number, b: number): void;
208
- export function wasmhop_sig(a: number, b: number): void;
209
- export function wasmhop_to(a: number, b: number): void;
210
211
  export function rustsecp256k1_v0_9_0_context_create(a: number): number;
211
212
  export function rustsecp256k1_v0_9_0_context_destroy(a: number): void;
212
213
  export function rustsecp256k1_v0_9_0_default_illegal_callback_fn(a: number, b: number): void;
@@ -214,8 +215,8 @@ export function rustsecp256k1_v0_9_0_default_error_callback_fn(a: number, b: num
214
215
  export function __wbindgen_malloc(a: number, b: number): number;
215
216
  export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number;
216
217
  export const __wbindgen_export_2: WebAssembly.Table;
217
- export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h71ee5d4075b93a8f(a: number, b: number, c: number): void;
218
+ export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h953abaf3817987ff(a: number, b: number, c: number): void;
218
219
  export function __wbindgen_add_to_stack_pointer(a: number): number;
219
220
  export function __wbindgen_free(a: number, b: number, c: number): void;
220
221
  export function __wbindgen_exn_store(a: number): void;
221
- export function wasm_bindgen__convert__closures__invoke2_mut__h042dde47a1d77254(a: number, b: number, c: number, d: number): void;
222
+ export function wasm_bindgen__convert__closures__invoke2_mut__h4e52ae1122c1d137(a: number, b: number, c: number, d: number): void;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saito-wasm",
3
- "version": "0.1.46",
3
+ "version": "0.1.48",
4
4
  "files": [
5
5
  "index_bg.wasm",
6
6
  "index.js",
@@ -9,7 +9,7 @@
9
9
  "main": "index.js",
10
10
  "types": "index.d.ts",
11
11
  "dependencies": {
12
- "node-fetch": "^3.3.0",
13
- "cross-env": "^7.0.3"
12
+ "cross-env": "^7.0.3",
13
+ "node-fetch": "^3.3.0"
14
14
  }
15
15
  }
@@ -39,8 +39,8 @@ class MsgHandler {
39
39
  return global.shared_methods.disconnect_from_peer(peer_index);
40
40
  }
41
41
 
42
- static fetch_block_from_peer(hash, peer_index, url) {
43
- return global.shared_methods.fetch_block_from_peer(hash, peer_index, url);
42
+ static fetch_block_from_peer(hash, peer_index, url, block_id) {
43
+ return global.shared_methods.fetch_block_from_peer(hash, peer_index, url, block_id);
44
44
  }
45
45
 
46
46
  static process_api_call(buffer, msgIndex, peerIndex) {
@@ -57,6 +57,13 @@ export function process_msg_buffer_from_peer(buffer: Uint8Array, peer_index: big
57
57
  */
58
58
  export function process_fetched_block(buffer: Uint8Array, hash: Uint8Array, peer_index: bigint): Promise<void>;
59
59
  /**
60
+ * @param {Uint8Array} hash
61
+ * @param {bigint} block_id
62
+ * @param {bigint} peer_index
63
+ * @returns {Promise<void>}
64
+ */
65
+ export function process_failed_block_fetch(hash: Uint8Array, block_id: bigint, peer_index: bigint): Promise<void>;
66
+ /**
60
67
  * @param {bigint} duration_in_ms
61
68
  * @returns {Promise<void>}
62
69
  */
@@ -867,6 +874,7 @@ export interface InitOutput {
867
874
  readonly process_peer_disconnection: (a: number) => number;
868
875
  readonly process_msg_buffer_from_peer: (a: number, b: number) => number;
869
876
  readonly process_fetched_block: (a: number, b: number, c: number) => number;
877
+ readonly process_failed_block_fetch: (a: number, b: number, c: number) => number;
870
878
  readonly process_timer_event: (a: number) => number;
871
879
  readonly hash: (a: number) => number;
872
880
  readonly sign_buffer: (a: number, b: number, c: number) => void;
@@ -887,6 +895,26 @@ export interface InitOutput {
887
895
  readonly get_mempool_txs: () => number;
888
896
  readonly set_wallet_version: (a: number, b: number, c: number) => number;
889
897
  readonly is_valid_public_key: (a: number) => number;
898
+ readonly __wbg_wasmblockchain_free: (a: number) => void;
899
+ readonly wasmblockchain_reset: (a: number) => number;
900
+ readonly wasmblockchain_get_last_block_id: (a: number) => number;
901
+ readonly wasmblockchain_get_last_timestamp: (a: number) => number;
902
+ readonly wasmblockchain_get_longest_chain_hash_at: (a: number, b: number) => number;
903
+ readonly wasmblockchain_get_last_block_hash: (a: number) => number;
904
+ readonly wasmblockchain_get_last_burnfee: (a: number) => number;
905
+ readonly wasmblockchain_get_genesis_block_id: (a: number) => number;
906
+ readonly wasmblockchain_get_genesis_timestamp: (a: number) => number;
907
+ readonly wasmblockchain_get_lowest_acceptable_timestamp: (a: number) => number;
908
+ readonly wasmblockchain_get_lowest_acceptable_block_hash: (a: number) => number;
909
+ readonly wasmblockchain_get_lowest_acceptable_block_id: (a: number) => number;
910
+ readonly wasmblockchain_get_latest_block_id: (a: number) => number;
911
+ readonly wasmblockchain_get_fork_id: (a: number) => number;
912
+ readonly wasmblockchain_get_longest_chain_hash_at_id: (a: number, b: number) => number;
913
+ readonly wasmblockchain_get_hashes_at_id: (a: number, b: number) => number;
914
+ readonly __wbg_wasmhop_free: (a: number) => void;
915
+ readonly wasmhop_from: (a: number, b: number) => void;
916
+ readonly wasmhop_sig: (a: number, b: number) => void;
917
+ readonly wasmhop_to: (a: number, b: number) => void;
890
918
  readonly __wbg_wasmconsensusvalues_free: (a: number) => void;
891
919
  readonly wasmconsensusvalues_it_num: (a: number) => number;
892
920
  readonly wasmconsensusvalues_fee_transaction: (a: number) => number;
@@ -926,26 +954,6 @@ export interface InitOutput {
926
954
  readonly wasmtransaction_total_fees: (a: number) => number;
927
955
  readonly wasmtransaction_serialize: (a: number) => number;
928
956
  readonly wasmtransaction_deserialize: (a: number, b: number) => void;
929
- readonly __wbg_wasmblockchain_free: (a: number) => void;
930
- readonly wasmblockchain_reset: (a: number) => number;
931
- readonly wasmblockchain_get_last_block_id: (a: number) => number;
932
- readonly wasmblockchain_get_last_timestamp: (a: number) => number;
933
- readonly wasmblockchain_get_longest_chain_hash_at: (a: number, b: number) => number;
934
- readonly wasmblockchain_get_last_block_hash: (a: number) => number;
935
- readonly wasmblockchain_get_last_burnfee: (a: number) => number;
936
- readonly wasmblockchain_get_genesis_block_id: (a: number) => number;
937
- readonly wasmblockchain_get_genesis_timestamp: (a: number) => number;
938
- readonly wasmblockchain_get_lowest_acceptable_timestamp: (a: number) => number;
939
- readonly wasmblockchain_get_lowest_acceptable_block_hash: (a: number) => number;
940
- readonly wasmblockchain_get_lowest_acceptable_block_id: (a: number) => number;
941
- readonly wasmblockchain_get_latest_block_id: (a: number) => number;
942
- readonly wasmblockchain_get_fork_id: (a: number) => number;
943
- readonly wasmblockchain_get_longest_chain_hash_at_id: (a: number, b: number) => number;
944
- readonly wasmblockchain_get_hashes_at_id: (a: number, b: number) => number;
945
- readonly __wbg_wasmhop_free: (a: number) => void;
946
- readonly wasmhop_from: (a: number, b: number) => void;
947
- readonly wasmhop_sig: (a: number, b: number) => void;
948
- readonly wasmhop_to: (a: number, b: number) => void;
949
957
  readonly rustsecp256k1_v0_9_0_context_create: (a: number) => number;
950
958
  readonly rustsecp256k1_v0_9_0_context_destroy: (a: number) => void;
951
959
  readonly rustsecp256k1_v0_9_0_default_illegal_callback_fn: (a: number, b: number) => void;
@@ -953,11 +961,11 @@ export interface InitOutput {
953
961
  readonly __wbindgen_malloc: (a: number, b: number) => number;
954
962
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
955
963
  readonly __wbindgen_export_2: WebAssembly.Table;
956
- readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h71ee5d4075b93a8f: (a: number, b: number, c: number) => void;
964
+ readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h953abaf3817987ff: (a: number, b: number, c: number) => void;
957
965
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
958
966
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
959
967
  readonly __wbindgen_exn_store: (a: number) => void;
960
- readonly wasm_bindgen__convert__closures__invoke2_mut__h042dde47a1d77254: (a: number, b: number, c: number, d: number) => void;
968
+ readonly wasm_bindgen__convert__closures__invoke2_mut__h4e52ae1122c1d137: (a: number, b: number, c: number, d: number) => void;
961
969
  }
962
970
 
963
971
  export type SyncInitInput = BufferSource | WebAssembly.Module;
package/pkg/web/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { MsgHandler } from './snippets/saito-wasm-8c18e4f881e1872e/js/msg_handler.js';
1
+ import { MsgHandler } from './snippets/saito-wasm-bee6f4652598cafe/js/msg_handler.js';
2
2
 
3
3
  let wasm;
4
4
 
@@ -223,7 +223,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
223
223
  return real;
224
224
  }
225
225
  function __wbg_adapter_40(arg0, arg1, arg2) {
226
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h71ee5d4075b93a8f(arg0, arg1, addHeapObject(arg2));
226
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h953abaf3817987ff(arg0, arg1, addHeapObject(arg2));
227
227
  }
228
228
 
229
229
  function _assertClass(instance, klass) {
@@ -324,6 +324,17 @@ export function process_fetched_block(buffer, hash, peer_index) {
324
324
  return takeObject(ret);
325
325
  }
326
326
 
327
+ /**
328
+ * @param {Uint8Array} hash
329
+ * @param {bigint} block_id
330
+ * @param {bigint} peer_index
331
+ * @returns {Promise<void>}
332
+ */
333
+ export function process_failed_block_fetch(hash, block_id, peer_index) {
334
+ const ret = wasm.process_failed_block_fetch(addHeapObject(hash), block_id, peer_index);
335
+ return takeObject(ret);
336
+ }
337
+
327
338
  /**
328
339
  * @param {bigint} duration_in_ms
329
340
  * @returns {Promise<void>}
@@ -542,8 +553,8 @@ function handleError(f, args) {
542
553
  wasm.__wbindgen_exn_store(addHeapObject(e));
543
554
  }
544
555
  }
545
- function __wbg_adapter_369(arg0, arg1, arg2, arg3) {
546
- wasm.wasm_bindgen__convert__closures__invoke2_mut__h042dde47a1d77254(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
556
+ function __wbg_adapter_370(arg0, arg1, arg2, arg3) {
557
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__h4e52ae1122c1d137(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
547
558
  }
548
559
 
549
560
  const SaitoWasmFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -2158,22 +2169,18 @@ function __wbg_get_imports() {
2158
2169
  const ret = BigInt.asUintN(64, arg0);
2159
2170
  return addHeapObject(ret);
2160
2171
  };
2161
- imports.wbg.__wbg_wasmwalletslip_new = function(arg0) {
2162
- const ret = WasmWalletSlip.__wrap(arg0);
2163
- return addHeapObject(ret);
2164
- };
2165
2172
  imports.wbg.__wbg_wasmwallet_new = function(arg0) {
2166
2173
  const ret = WasmWallet.__wrap(arg0);
2167
2174
  return addHeapObject(ret);
2168
2175
  };
2169
- imports.wbg.__wbg_wasmblockchain_new = function(arg0) {
2170
- const ret = WasmBlockchain.__wrap(arg0);
2171
- return addHeapObject(ret);
2172
- };
2173
2176
  imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
2174
2177
  const ret = getStringFromWasm0(arg0, arg1);
2175
2178
  return addHeapObject(ret);
2176
2179
  };
2180
+ imports.wbg.__wbg_wasmpeer_new = function(arg0) {
2181
+ const ret = WasmPeer.__wrap(arg0);
2182
+ return addHeapObject(ret);
2183
+ };
2177
2184
  imports.wbg.__wbg_wasmslip_new = function(arg0) {
2178
2185
  const ret = WasmSlip.__wrap(arg0);
2179
2186
  return addHeapObject(ret);
@@ -2182,6 +2189,18 @@ function __wbg_get_imports() {
2182
2189
  const ret = WasmTransaction.__wrap(arg0);
2183
2190
  return addHeapObject(ret);
2184
2191
  };
2192
+ imports.wbg.__wbg_wasmwalletslip_new = function(arg0) {
2193
+ const ret = WasmWalletSlip.__wrap(arg0);
2194
+ return addHeapObject(ret);
2195
+ };
2196
+ imports.wbg.__wbg_wasmbalancesnapshot_new = function(arg0) {
2197
+ const ret = WasmBalanceSnapshot.__wrap(arg0);
2198
+ return addHeapObject(ret);
2199
+ };
2200
+ imports.wbg.__wbg_wasmblockchain_new = function(arg0) {
2201
+ const ret = WasmBlockchain.__wrap(arg0);
2202
+ return addHeapObject(ret);
2203
+ };
2185
2204
  imports.wbg.__wbg_wasmblock_new = function(arg0) {
2186
2205
  const ret = WasmBlock.__wrap(arg0);
2187
2206
  return addHeapObject(ret);
@@ -2198,14 +2217,6 @@ function __wbg_get_imports() {
2198
2217
  getInt32Memory0()[arg0 / 4 + 1] = len1;
2199
2218
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2200
2219
  };
2201
- imports.wbg.__wbg_wasmpeer_new = function(arg0) {
2202
- const ret = WasmPeer.__wrap(arg0);
2203
- return addHeapObject(ret);
2204
- };
2205
- imports.wbg.__wbg_wasmbalancesnapshot_new = function(arg0) {
2206
- const ret = WasmBalanceSnapshot.__wrap(arg0);
2207
- return addHeapObject(ret);
2208
- };
2209
2220
  imports.wbg.__wbg_wasmhop_new = function(arg0) {
2210
2221
  const ret = WasmHop.__wrap(arg0);
2211
2222
  return addHeapObject(ret);
@@ -2235,33 +2246,33 @@ function __wbg_get_imports() {
2235
2246
  const ret = getObject(arg0) in getObject(arg1);
2236
2247
  return ret;
2237
2248
  };
2238
- imports.wbg.__wbg_sendmessage_5ad9fcfca644e52d = function(arg0, arg1) {
2249
+ imports.wbg.__wbg_sendmessage_852a76511cb6527f = function(arg0, arg1) {
2239
2250
  MsgHandler.send_message(takeObject(arg0), getObject(arg1));
2240
2251
  };
2241
- imports.wbg.__wbg_sendmessagetoall_3a53e557d5a7b3f5 = function(arg0, arg1) {
2252
+ imports.wbg.__wbg_sendmessagetoall_5160cf97b40924cd = function(arg0, arg1) {
2242
2253
  MsgHandler.send_message_to_all(getObject(arg0), getObject(arg1));
2243
2254
  };
2244
- imports.wbg.__wbg_connecttopeer_5111d21e039c34a4 = function() { return handleError(function (arg0) {
2255
+ imports.wbg.__wbg_connecttopeer_d6695c733213736c = function() { return handleError(function (arg0) {
2245
2256
  const ret = MsgHandler.connect_to_peer(takeObject(arg0));
2246
2257
  return addHeapObject(ret);
2247
2258
  }, arguments) };
2248
- imports.wbg.__wbg_disconnectfrompeer_6147b8c175b9ff9a = function() { return handleError(function (arg0) {
2259
+ imports.wbg.__wbg_disconnectfrompeer_ba867bd87f1b7975 = function() { return handleError(function (arg0) {
2249
2260
  const ret = MsgHandler.disconnect_from_peer(takeObject(arg0));
2250
2261
  return addHeapObject(ret);
2251
2262
  }, arguments) };
2252
- imports.wbg.__wbg_fetchblockfrompeer_9211aa1fb219db5f = function() { return handleError(function (arg0, arg1, arg2, arg3) {
2263
+ imports.wbg.__wbg_fetchblockfrompeer_4a6143b4aef8bdcc = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2253
2264
  let deferred0_0;
2254
2265
  let deferred0_1;
2255
2266
  try {
2256
2267
  deferred0_0 = arg2;
2257
2268
  deferred0_1 = arg3;
2258
- const ret = MsgHandler.fetch_block_from_peer(getObject(arg0), takeObject(arg1), getStringFromWasm0(arg2, arg3));
2269
+ const ret = MsgHandler.fetch_block_from_peer(getObject(arg0), takeObject(arg1), getStringFromWasm0(arg2, arg3), takeObject(arg4));
2259
2270
  return addHeapObject(ret);
2260
2271
  } finally {
2261
2272
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2262
2273
  }
2263
2274
  }, arguments) };
2264
- imports.wbg.__wbg_writevalue_4fca84ab33c90cf3 = function(arg0, arg1, arg2) {
2275
+ imports.wbg.__wbg_writevalue_87e8ba754be5b043 = function(arg0, arg1, arg2) {
2265
2276
  let deferred0_0;
2266
2277
  let deferred0_1;
2267
2278
  try {
@@ -2272,7 +2283,7 @@ function __wbg_get_imports() {
2272
2283
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2273
2284
  }
2274
2285
  };
2275
- imports.wbg.__wbg_readvalue_d087b44f36774ed7 = function() { return handleError(function (arg0, arg1) {
2286
+ imports.wbg.__wbg_readvalue_94f7827fba4a63c1 = function() { return handleError(function (arg0, arg1) {
2276
2287
  let deferred0_0;
2277
2288
  let deferred0_1;
2278
2289
  try {
@@ -2284,11 +2295,11 @@ function __wbg_get_imports() {
2284
2295
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2285
2296
  }
2286
2297
  }, arguments) };
2287
- imports.wbg.__wbg_loadblockfilelist_8f5f845d0fa0cfdf = function() { return handleError(function () {
2298
+ imports.wbg.__wbg_loadblockfilelist_16018f0516427731 = function() { return handleError(function () {
2288
2299
  const ret = MsgHandler.load_block_file_list();
2289
2300
  return addHeapObject(ret);
2290
2301
  }, arguments) };
2291
- imports.wbg.__wbg_isexistingfile_209a2a6fd1e83bfc = function() { return handleError(function (arg0, arg1) {
2302
+ imports.wbg.__wbg_isexistingfile_264a89498af23aea = function() { return handleError(function (arg0, arg1) {
2292
2303
  let deferred0_0;
2293
2304
  let deferred0_1;
2294
2305
  try {
@@ -2300,7 +2311,7 @@ function __wbg_get_imports() {
2300
2311
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2301
2312
  }
2302
2313
  }, arguments) };
2303
- imports.wbg.__wbg_removevalue_152b9e3b5c25b65b = function() { return handleError(function (arg0, arg1) {
2314
+ imports.wbg.__wbg_removevalue_a00fcecfaec11750 = function() { return handleError(function (arg0, arg1) {
2304
2315
  let deferred0_0;
2305
2316
  let deferred0_1;
2306
2317
  try {
@@ -2312,7 +2323,7 @@ function __wbg_get_imports() {
2312
2323
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2313
2324
  }
2314
2325
  }, arguments) };
2315
- imports.wbg.__wbg_ensureblockdirectoryexists_61aa09babd711ebd = function() { return handleError(function (arg0, arg1) {
2326
+ imports.wbg.__wbg_ensureblockdirectoryexists_3d8bbf658ca46a36 = function() { return handleError(function (arg0, arg1) {
2316
2327
  let deferred0_0;
2317
2328
  let deferred0_1;
2318
2329
  try {
@@ -2323,16 +2334,16 @@ function __wbg_get_imports() {
2323
2334
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2324
2335
  }
2325
2336
  }, arguments) };
2326
- imports.wbg.__wbg_processapicall_5837c3c1eb77b6ab = function(arg0, arg1, arg2) {
2337
+ imports.wbg.__wbg_processapicall_b5b829072ddefb4d = function(arg0, arg1, arg2) {
2327
2338
  MsgHandler.process_api_call(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
2328
2339
  };
2329
- imports.wbg.__wbg_processapisuccess_d7b709a0dbbcdf97 = function(arg0, arg1, arg2) {
2340
+ imports.wbg.__wbg_processapisuccess_fce9163285b965e3 = function(arg0, arg1, arg2) {
2330
2341
  MsgHandler.process_api_success(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
2331
2342
  };
2332
- imports.wbg.__wbg_processapierror_1d2ecb7b9c54f5fd = function(arg0, arg1, arg2) {
2343
+ imports.wbg.__wbg_processapierror_cac73a72c30a63d1 = function(arg0, arg1, arg2) {
2333
2344
  MsgHandler.process_api_error(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
2334
2345
  };
2335
- imports.wbg.__wbg_sendinterfaceevent_6970a814a76481f5 = function(arg0, arg1, arg2) {
2346
+ imports.wbg.__wbg_sendinterfaceevent_b5612b48ed4cca7d = function(arg0, arg1, arg2) {
2336
2347
  let deferred0_0;
2337
2348
  let deferred0_1;
2338
2349
  try {
@@ -2343,7 +2354,7 @@ function __wbg_get_imports() {
2343
2354
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2344
2355
  }
2345
2356
  };
2346
- imports.wbg.__wbg_sendblocksuccess_f846a1f1e943b704 = function(arg0, arg1, arg2) {
2357
+ imports.wbg.__wbg_sendblocksuccess_dce982a842847234 = function(arg0, arg1, arg2) {
2347
2358
  let deferred0_0;
2348
2359
  let deferred0_1;
2349
2360
  try {
@@ -2354,10 +2365,10 @@ function __wbg_get_imports() {
2354
2365
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2355
2366
  }
2356
2367
  };
2357
- imports.wbg.__wbg_sendwalletupdate_d7adc771b9b0d982 = function() {
2368
+ imports.wbg.__wbg_sendwalletupdate_c8dc290f091e0a7e = function() {
2358
2369
  MsgHandler.send_wallet_update();
2359
2370
  };
2360
- imports.wbg.__wbg_sendnewversionalert_ba100fad975d0e8d = function(arg0, arg1, arg2) {
2371
+ imports.wbg.__wbg_sendnewversionalert_85b892ef0383f713 = function(arg0, arg1, arg2) {
2361
2372
  let deferred0_0;
2362
2373
  let deferred0_1;
2363
2374
  try {
@@ -2368,13 +2379,13 @@ function __wbg_get_imports() {
2368
2379
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2369
2380
  }
2370
2381
  };
2371
- imports.wbg.__wbg_savewallet_6379efcc479145ec = function() {
2382
+ imports.wbg.__wbg_savewallet_9e616deed8dd9514 = function() {
2372
2383
  MsgHandler.save_wallet();
2373
2384
  };
2374
- imports.wbg.__wbg_loadwallet_f998f6f5e3d90b1e = function() {
2385
+ imports.wbg.__wbg_loadwallet_4077cedbccbc5544 = function() {
2375
2386
  MsgHandler.load_wallet();
2376
2387
  };
2377
- imports.wbg.__wbg_getmyservices_4705725093cf9d12 = function() {
2388
+ imports.wbg.__wbg_getmyservices_35a2cf577138e555 = function() {
2378
2389
  const ret = MsgHandler.get_my_services();
2379
2390
  _assertClass(ret, WasmPeerServiceList);
2380
2391
  var ptr1 = ret.__destroy_into_raw();
@@ -2584,7 +2595,7 @@ function __wbg_get_imports() {
2584
2595
  const a = state0.a;
2585
2596
  state0.a = 0;
2586
2597
  try {
2587
- return __wbg_adapter_369(a, state0.b, arg0, arg1);
2598
+ return __wbg_adapter_370(a, state0.b, arg0, arg1);
2588
2599
  } finally {
2589
2600
  state0.a = a;
2590
2601
  }
@@ -2673,8 +2684,8 @@ function __wbg_get_imports() {
2673
2684
  const ret = wasm.memory;
2674
2685
  return addHeapObject(ret);
2675
2686
  };
2676
- imports.wbg.__wbindgen_closure_wrapper1176 = function(arg0, arg1, arg2) {
2677
- const ret = makeMutClosure(arg0, arg1, 427, __wbg_adapter_40);
2687
+ imports.wbg.__wbindgen_closure_wrapper1184 = function(arg0, arg1, arg2) {
2688
+ const ret = makeMutClosure(arg0, arg1, 432, __wbg_adapter_40);
2678
2689
  return addHeapObject(ret);
2679
2690
  };
2680
2691
 
Binary file
@@ -128,6 +128,7 @@ export function process_new_peer(a: number, b: number): number;
128
128
  export function process_peer_disconnection(a: number): number;
129
129
  export function process_msg_buffer_from_peer(a: number, b: number): number;
130
130
  export function process_fetched_block(a: number, b: number, c: number): number;
131
+ export function process_failed_block_fetch(a: number, b: number, c: number): number;
131
132
  export function process_timer_event(a: number): number;
132
133
  export function hash(a: number): number;
133
134
  export function sign_buffer(a: number, b: number, c: number): void;
@@ -148,6 +149,26 @@ export function get_blockchain(): number;
148
149
  export function get_mempool_txs(): number;
149
150
  export function set_wallet_version(a: number, b: number, c: number): number;
150
151
  export function is_valid_public_key(a: number): number;
152
+ export function __wbg_wasmblockchain_free(a: number): void;
153
+ export function wasmblockchain_reset(a: number): number;
154
+ export function wasmblockchain_get_last_block_id(a: number): number;
155
+ export function wasmblockchain_get_last_timestamp(a: number): number;
156
+ export function wasmblockchain_get_longest_chain_hash_at(a: number, b: number): number;
157
+ export function wasmblockchain_get_last_block_hash(a: number): number;
158
+ export function wasmblockchain_get_last_burnfee(a: number): number;
159
+ export function wasmblockchain_get_genesis_block_id(a: number): number;
160
+ export function wasmblockchain_get_genesis_timestamp(a: number): number;
161
+ export function wasmblockchain_get_lowest_acceptable_timestamp(a: number): number;
162
+ export function wasmblockchain_get_lowest_acceptable_block_hash(a: number): number;
163
+ export function wasmblockchain_get_lowest_acceptable_block_id(a: number): number;
164
+ export function wasmblockchain_get_latest_block_id(a: number): number;
165
+ export function wasmblockchain_get_fork_id(a: number): number;
166
+ export function wasmblockchain_get_longest_chain_hash_at_id(a: number, b: number): number;
167
+ export function wasmblockchain_get_hashes_at_id(a: number, b: number): number;
168
+ export function __wbg_wasmhop_free(a: number): void;
169
+ export function wasmhop_from(a: number, b: number): void;
170
+ export function wasmhop_sig(a: number, b: number): void;
171
+ export function wasmhop_to(a: number, b: number): void;
151
172
  export function __wbg_wasmconsensusvalues_free(a: number): void;
152
173
  export function wasmconsensusvalues_it_num(a: number): number;
153
174
  export function wasmconsensusvalues_fee_transaction(a: number): number;
@@ -187,26 +208,6 @@ export function wasmtransaction_set_type(a: number, b: number): void;
187
208
  export function wasmtransaction_total_fees(a: number): number;
188
209
  export function wasmtransaction_serialize(a: number): number;
189
210
  export function wasmtransaction_deserialize(a: number, b: number): void;
190
- export function __wbg_wasmblockchain_free(a: number): void;
191
- export function wasmblockchain_reset(a: number): number;
192
- export function wasmblockchain_get_last_block_id(a: number): number;
193
- export function wasmblockchain_get_last_timestamp(a: number): number;
194
- export function wasmblockchain_get_longest_chain_hash_at(a: number, b: number): number;
195
- export function wasmblockchain_get_last_block_hash(a: number): number;
196
- export function wasmblockchain_get_last_burnfee(a: number): number;
197
- export function wasmblockchain_get_genesis_block_id(a: number): number;
198
- export function wasmblockchain_get_genesis_timestamp(a: number): number;
199
- export function wasmblockchain_get_lowest_acceptable_timestamp(a: number): number;
200
- export function wasmblockchain_get_lowest_acceptable_block_hash(a: number): number;
201
- export function wasmblockchain_get_lowest_acceptable_block_id(a: number): number;
202
- export function wasmblockchain_get_latest_block_id(a: number): number;
203
- export function wasmblockchain_get_fork_id(a: number): number;
204
- export function wasmblockchain_get_longest_chain_hash_at_id(a: number, b: number): number;
205
- export function wasmblockchain_get_hashes_at_id(a: number, b: number): number;
206
- export function __wbg_wasmhop_free(a: number): void;
207
- export function wasmhop_from(a: number, b: number): void;
208
- export function wasmhop_sig(a: number, b: number): void;
209
- export function wasmhop_to(a: number, b: number): void;
210
211
  export function rustsecp256k1_v0_9_0_context_create(a: number): number;
211
212
  export function rustsecp256k1_v0_9_0_context_destroy(a: number): void;
212
213
  export function rustsecp256k1_v0_9_0_default_illegal_callback_fn(a: number, b: number): void;
@@ -214,8 +215,8 @@ export function rustsecp256k1_v0_9_0_default_error_callback_fn(a: number, b: num
214
215
  export function __wbindgen_malloc(a: number, b: number): number;
215
216
  export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number;
216
217
  export const __wbindgen_export_2: WebAssembly.Table;
217
- export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h71ee5d4075b93a8f(a: number, b: number, c: number): void;
218
+ export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h953abaf3817987ff(a: number, b: number, c: number): void;
218
219
  export function __wbindgen_add_to_stack_pointer(a: number): number;
219
220
  export function __wbindgen_free(a: number, b: number, c: number): void;
220
221
  export function __wbindgen_exn_store(a: number): void;
221
- export function wasm_bindgen__convert__closures__invoke2_mut__h042dde47a1d77254(a: number, b: number, c: number, d: number): void;
222
+ export function wasm_bindgen__convert__closures__invoke2_mut__h4e52ae1122c1d137(a: number, b: number, c: number, d: number): void;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saito-wasm",
3
- "version": "0.1.46",
3
+ "version": "0.1.48",
4
4
  "files": [
5
5
  "index_bg.wasm",
6
6
  "index.js",
@@ -39,8 +39,8 @@ class MsgHandler {
39
39
  return global.shared_methods.disconnect_from_peer(peer_index);
40
40
  }
41
41
 
42
- static fetch_block_from_peer(hash, peer_index, url) {
43
- return global.shared_methods.fetch_block_from_peer(hash, peer_index, url);
42
+ static fetch_block_from_peer(hash, peer_index, url, block_id) {
43
+ return global.shared_methods.fetch_block_from_peer(hash, peer_index, url, block_id);
44
44
  }
45
45
 
46
46
  static process_api_call(buffer, msgIndex, peerIndex) {