lwk_node 0.15.0 → 0.17.0

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/lwk_wasm.js CHANGED
@@ -229,32 +229,6 @@ function takeFromExternrefTable0(idx) {
229
229
  return value;
230
230
  }
231
231
 
232
- function passArrayJsValueToWasm0(array, malloc) {
233
- const ptr = malloc(array.length * 4, 4) >>> 0;
234
- for (let i = 0; i < array.length; i++) {
235
- const add = addToExternrefTable0(array[i]);
236
- getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
237
- }
238
- WASM_VECTOR_LEN = array.length;
239
- return ptr;
240
- }
241
-
242
- let cachedUint32ArrayMemory0 = null;
243
-
244
- function getUint32ArrayMemory0() {
245
- if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
246
- cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
247
- }
248
- return cachedUint32ArrayMemory0;
249
- }
250
-
251
- function passArray32ToWasm0(arg, malloc) {
252
- const ptr = malloc(arg.length * 4, 4) >>> 0;
253
- getUint32ArrayMemory0().set(arg, ptr / 4);
254
- WASM_VECTOR_LEN = arg.length;
255
- return ptr;
256
- }
257
-
258
232
  function getArrayJsValueFromWasm0(ptr, len) {
259
233
  ptr = ptr >>> 0;
260
234
  const mem = getDataViewMemory0();
@@ -265,11 +239,6 @@ function getArrayJsValueFromWasm0(ptr, len) {
265
239
  wasm.__externref_drop_slice(ptr, len);
266
240
  return result;
267
241
  }
268
-
269
- function getArrayU32FromWasm0(ptr, len) {
270
- ptr = ptr >>> 0;
271
- return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
272
- }
273
242
  /**
274
243
  * @returns {Promise<HIDDevice>}
275
244
  */
@@ -278,6 +247,21 @@ exports.searchLedgerDevice = function() {
278
247
  return ret;
279
248
  };
280
249
 
250
+ let cachedUint32ArrayMemory0 = null;
251
+
252
+ function getUint32ArrayMemory0() {
253
+ if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
254
+ cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
255
+ }
256
+ return cachedUint32ArrayMemory0;
257
+ }
258
+
259
+ function passArray32ToWasm0(arg, malloc) {
260
+ const ptr = malloc(arg.length * 4, 4) >>> 0;
261
+ getUint32ArrayMemory0().set(arg, ptr / 4);
262
+ WASM_VECTOR_LEN = arg.length;
263
+ return ptr;
264
+ }
281
265
  /**
282
266
  * Convert the given string to a QR code image uri
283
267
  *
@@ -310,28 +294,42 @@ exports.stringToQr = function(str, pixel_per_module) {
310
294
  }
311
295
  };
312
296
 
297
+ function passArrayJsValueToWasm0(array, malloc) {
298
+ const ptr = malloc(array.length * 4, 4) >>> 0;
299
+ for (let i = 0; i < array.length; i++) {
300
+ const add = addToExternrefTable0(array[i]);
301
+ getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
302
+ }
303
+ WASM_VECTOR_LEN = array.length;
304
+ return ptr;
305
+ }
306
+
307
+ function getArrayU32FromWasm0(ptr, len) {
308
+ ptr = ptr >>> 0;
309
+ return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
310
+ }
313
311
  function __wbg_adapter_6(arg0, arg1, arg2) {
314
- wasm.closure1965_externref_shim(arg0, arg1, arg2);
312
+ wasm.closure1315_externref_shim(arg0, arg1, arg2);
315
313
  }
316
314
 
317
- function __wbg_adapter_9(arg0, arg1, arg2) {
318
- wasm.closure1211_externref_shim(arg0, arg1, arg2);
315
+ function __wbg_adapter_11(arg0, arg1, arg2) {
316
+ wasm.closure748_externref_shim(arg0, arg1, arg2);
319
317
  }
320
318
 
321
319
  function __wbg_adapter_14(arg0, arg1) {
322
320
  wasm.wasm_bindgen__convert__closures_____invoke__h94f351489121fb87(arg0, arg1);
323
321
  }
324
322
 
325
- function __wbg_adapter_25(arg0, arg1) {
326
- wasm.wasm_bindgen__convert__closures_____invoke__h912986096667d3cb(arg0, arg1);
323
+ function __wbg_adapter_31(arg0, arg1, arg2) {
324
+ wasm.closure2094_externref_shim(arg0, arg1, arg2);
327
325
  }
328
326
 
329
- function __wbg_adapter_28(arg0, arg1, arg2) {
330
- wasm.closure855_externref_shim(arg0, arg1, arg2);
327
+ function __wbg_adapter_34(arg0, arg1) {
328
+ wasm.wasm_bindgen__convert__closures_____invoke__h912986096667d3cb(arg0, arg1);
331
329
  }
332
330
 
333
- function __wbg_adapter_678(arg0, arg1, arg2, arg3) {
334
- wasm.closure2742_externref_shim(arg0, arg1, arg2, arg3);
331
+ function __wbg_adapter_735(arg0, arg1, arg2, arg3) {
332
+ wasm.closure2881_externref_shim(arg0, arg1, arg2, arg3);
335
333
  }
336
334
 
337
335
  /**
@@ -763,7 +761,12 @@ class Amp0Connected {
763
761
  wasm.__wbg_amp0connected_free(ptr, 0);
764
762
  }
765
763
  /**
766
- * Connect and register to AMP0
764
+ * Connect and register to AMP0.
765
+ *
766
+ * Deprecated: use `connect()` instead.
767
+ *
768
+ * `wasm-bindgen` deprecated async constructors because they generate
769
+ * invalid TypeScript declarations. See https://github.com/wasm-bindgen/wasm-bindgen/pull/4402.
767
770
  * @param {Network} network
768
771
  * @param {Amp0SignerData} signer_data
769
772
  */
@@ -773,6 +776,18 @@ class Amp0Connected {
773
776
  const ret = wasm.amp0connected_new(network.__wbg_ptr, signer_data.__wbg_ptr);
774
777
  return ret;
775
778
  }
779
+ /**
780
+ * Connect and register to AMP0.
781
+ * @param {Network} network
782
+ * @param {Amp0SignerData} signer_data
783
+ * @returns {Promise<Amp0Connected>}
784
+ */
785
+ static connect(network, signer_data) {
786
+ _assertClass(network, Network);
787
+ _assertClass(signer_data, Amp0SignerData);
788
+ const ret = wasm.amp0connected_connect(network.__wbg_ptr, signer_data.__wbg_ptr);
789
+ return ret;
790
+ }
776
791
  /**
777
792
  * Obtain a login challenge
778
793
  *
@@ -1021,6 +1036,26 @@ class Amp2 {
1021
1036
  const ptr = this.__destroy_into_raw();
1022
1037
  wasm.__wbg_amp2_free(ptr, 0);
1023
1038
  }
1039
+ /**
1040
+ * Create a new AMP2 client
1041
+ *
1042
+ * * `server_key` - The keyorigin xpub of the AMP2 server key
1043
+ * * `url` - The URL of the AMP2 server
1044
+ * @param {string} server_key
1045
+ * @param {string} url
1046
+ * @returns {Amp2}
1047
+ */
1048
+ static new(server_key, url) {
1049
+ const ptr0 = passStringToWasm0(server_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1050
+ const len0 = WASM_VECTOR_LEN;
1051
+ const ptr1 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1052
+ const len1 = WASM_VECTOR_LEN;
1053
+ const ret = wasm.amp2_new(ptr0, len0, ptr1, len1);
1054
+ if (ret[2]) {
1055
+ throw takeFromExternrefTable0(ret[1]);
1056
+ }
1057
+ return Amp2.__wrap(ret[0]);
1058
+ }
1024
1059
  /**
1025
1060
  * Create a new AMP2 client with the default url and server key for the testnet network.
1026
1061
  * @returns {Amp2}
@@ -1032,12 +1067,15 @@ class Amp2 {
1032
1067
  /**
1033
1068
  * Get an AMP2 wallet descriptor from the keyorigin xpub string obtained from a signer
1034
1069
  * @param {string} keyorigin_xpub
1070
+ * @param {string} descriptor_blinding_key
1035
1071
  * @returns {Amp2Descriptor}
1036
1072
  */
1037
- descriptorFromStr(keyorigin_xpub) {
1073
+ descriptorFromStr(keyorigin_xpub, descriptor_blinding_key) {
1038
1074
  const ptr0 = passStringToWasm0(keyorigin_xpub, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1039
1075
  const len0 = WASM_VECTOR_LEN;
1040
- const ret = wasm.amp2_descriptorFromStr(this.__wbg_ptr, ptr0, len0);
1076
+ const ptr1 = passStringToWasm0(descriptor_blinding_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1077
+ const len1 = WASM_VECTOR_LEN;
1078
+ const ret = wasm.amp2_descriptorFromStr(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1041
1079
  if (ret[2]) {
1042
1080
  throw takeFromExternrefTable0(ret[1]);
1043
1081
  }
@@ -1170,6 +1208,104 @@ if (Symbol.dispose) AssetAmount.prototype[Symbol.dispose] = AssetAmount.prototyp
1170
1208
 
1171
1209
  exports.AssetAmount = AssetAmount;
1172
1210
 
1211
+ const AssetBlindingFactorFinalization = (typeof FinalizationRegistry === 'undefined')
1212
+ ? { register: () => {}, unregister: () => {} }
1213
+ : new FinalizationRegistry(ptr => wasm.__wbg_assetblindingfactor_free(ptr >>> 0, 1));
1214
+ /**
1215
+ * A blinding factor for asset commitments.
1216
+ */
1217
+ class AssetBlindingFactor {
1218
+
1219
+ static __wrap(ptr) {
1220
+ ptr = ptr >>> 0;
1221
+ const obj = Object.create(AssetBlindingFactor.prototype);
1222
+ obj.__wbg_ptr = ptr;
1223
+ AssetBlindingFactorFinalization.register(obj, obj.__wbg_ptr, obj);
1224
+ return obj;
1225
+ }
1226
+
1227
+ __destroy_into_raw() {
1228
+ const ptr = this.__wbg_ptr;
1229
+ this.__wbg_ptr = 0;
1230
+ AssetBlindingFactorFinalization.unregister(this);
1231
+ return ptr;
1232
+ }
1233
+
1234
+ free() {
1235
+ const ptr = this.__destroy_into_raw();
1236
+ wasm.__wbg_assetblindingfactor_free(ptr, 0);
1237
+ }
1238
+ /**
1239
+ * Creates an `AssetBlindingFactor` from a string.
1240
+ * @param {string} s
1241
+ * @returns {AssetBlindingFactor}
1242
+ */
1243
+ static fromString(s) {
1244
+ const ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1245
+ const len0 = WASM_VECTOR_LEN;
1246
+ const ret = wasm.assetblindingfactor_fromString(ptr0, len0);
1247
+ if (ret[2]) {
1248
+ throw takeFromExternrefTable0(ret[1]);
1249
+ }
1250
+ return AssetBlindingFactor.__wrap(ret[0]);
1251
+ }
1252
+ /**
1253
+ * Creates an `AssetBlindingFactor` from a byte slice.
1254
+ * @param {Uint8Array} bytes
1255
+ * @returns {AssetBlindingFactor}
1256
+ */
1257
+ static fromBytes(bytes) {
1258
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
1259
+ const len0 = WASM_VECTOR_LEN;
1260
+ const ret = wasm.assetblindingfactor_fromBytes(ptr0, len0);
1261
+ if (ret[2]) {
1262
+ throw takeFromExternrefTable0(ret[1]);
1263
+ }
1264
+ return AssetBlindingFactor.__wrap(ret[0]);
1265
+ }
1266
+ /**
1267
+ * Returns a zero asset blinding factor.
1268
+ * @returns {AssetBlindingFactor}
1269
+ */
1270
+ static zero() {
1271
+ const ret = wasm.assetblindingfactor_zero();
1272
+ return AssetBlindingFactor.__wrap(ret);
1273
+ }
1274
+ /**
1275
+ * Returns the bytes (32 bytes) in little-endian byte order.
1276
+ *
1277
+ * This is the internal representation used by secp256k1. The byte order is
1278
+ * reversed compared to the hex string representation (which uses big-endian,
1279
+ * following Bitcoin display conventions).
1280
+ * @returns {Uint8Array}
1281
+ */
1282
+ toBytes() {
1283
+ const ret = wasm.assetblindingfactor_toBytes(this.__wbg_ptr);
1284
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1285
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1286
+ return v1;
1287
+ }
1288
+ /**
1289
+ * Returns string representation of the ABF
1290
+ * @returns {string}
1291
+ */
1292
+ toString() {
1293
+ let deferred1_0;
1294
+ let deferred1_1;
1295
+ try {
1296
+ const ret = wasm.assetblindingfactor_toString(this.__wbg_ptr);
1297
+ deferred1_0 = ret[0];
1298
+ deferred1_1 = ret[1];
1299
+ return getStringFromWasm0(ret[0], ret[1]);
1300
+ } finally {
1301
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1302
+ }
1303
+ }
1304
+ }
1305
+ if (Symbol.dispose) AssetBlindingFactor.prototype[Symbol.dispose] = AssetBlindingFactor.prototype.free;
1306
+
1307
+ exports.AssetBlindingFactor = AssetBlindingFactor;
1308
+
1173
1309
  const AssetIdFinalization = (typeof FinalizationRegistry === 'undefined')
1174
1310
  ? { register: () => {}, unregister: () => {} }
1175
1311
  : new FinalizationRegistry(ptr => wasm.__wbg_assetid_free(ptr >>> 0, 1));
@@ -1201,6 +1337,8 @@ class AssetId {
1201
1337
  }
1202
1338
  /**
1203
1339
  * Creates an `AssetId`
1340
+ *
1341
+ * Deprecated: use `from_string()` instead
1204
1342
  * @param {string} asset_id
1205
1343
  */
1206
1344
  constructor(asset_id) {
@@ -1214,9 +1352,47 @@ class AssetId {
1214
1352
  AssetIdFinalization.register(this, this.__wbg_ptr, this);
1215
1353
  return this;
1216
1354
  }
1355
+ /**
1356
+ * Creates an `AssetId` from hex string
1357
+ * @param {string} s
1358
+ * @returns {AssetId}
1359
+ */
1360
+ static fromString(s) {
1361
+ const ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1362
+ const len0 = WASM_VECTOR_LEN;
1363
+ const ret = wasm.assetid_fromString(ptr0, len0);
1364
+ if (ret[2]) {
1365
+ throw takeFromExternrefTable0(ret[1]);
1366
+ }
1367
+ return AssetId.__wrap(ret[0]);
1368
+ }
1369
+ /**
1370
+ * Creates an `AssetId` from a bytes.
1371
+ * @param {Uint8Array} bytes
1372
+ * @returns {AssetId}
1373
+ */
1374
+ static fromBytes(bytes) {
1375
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
1376
+ const len0 = WASM_VECTOR_LEN;
1377
+ const ret = wasm.assetid_fromBytes(ptr0, len0);
1378
+ if (ret[2]) {
1379
+ throw takeFromExternrefTable0(ret[1]);
1380
+ }
1381
+ return AssetId.__wrap(ret[0]);
1382
+ }
1383
+ /**
1384
+ * Returns the `AssetId` bytes in little-endian byte order.
1385
+ * @returns {Uint8Array}
1386
+ */
1387
+ toBytes() {
1388
+ const ret = wasm.assetid_toBytes(this.__wbg_ptr);
1389
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1390
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1391
+ return v1;
1392
+ }
1217
1393
  /**
1218
1394
  * Return the string representation of the asset identifier (64 hex characters).
1219
- * This representation can be used to recreate the asset identifier via `new()`
1395
+ * This representation can be used to recreate the asset identifier via `fromString()`
1220
1396
  * @returns {string}
1221
1397
  */
1222
1398
  toString() {
@@ -2438,12 +2614,31 @@ class Jade {
2438
2614
  *
2439
2615
  * When filter is true, it will filter available serial with Blockstream released chips, use
2440
2616
  * false if you don't see your DYI jade
2617
+ *
2618
+ * Deprecated: use `fromSerial()` instead.
2619
+ *
2620
+ * `wasm-bindgen` deprecated async constructors because they generate
2621
+ * invalid TypeScript declarations. See https://github.com/wasm-bindgen/wasm-bindgen/pull/4402.
2441
2622
  * @param {Network} network
2442
2623
  * @param {boolean} filter
2443
2624
  */
2444
2625
  constructor(network, filter) {
2445
2626
  _assertClass(network, Network);
2446
- const ret = wasm.jade_from_serial(network.__wbg_ptr, filter);
2627
+ const ret = wasm.jade_new(network.__wbg_ptr, filter);
2628
+ return ret;
2629
+ }
2630
+ /**
2631
+ * Creates a Jade from Web Serial for the given network.
2632
+ *
2633
+ * When filter is true, it will filter available serial with Blockstream released chips, use
2634
+ * false if you don't see your DYI jade
2635
+ * @param {Network} network
2636
+ * @param {boolean} filter
2637
+ * @returns {Promise<Jade>}
2638
+ */
2639
+ static fromSerial(network, filter) {
2640
+ _assertClass(network, Network);
2641
+ const ret = wasm.jade_fromSerial(network.__wbg_ptr, filter);
2447
2642
  return ret;
2448
2643
  }
2449
2644
  /**
@@ -2592,6 +2787,11 @@ class JadeWebSocket {
2592
2787
  * Creates a Jade from WebSocket for the given network
2593
2788
  *
2594
2789
  * The url should point to your WebSocket bridge that connects to the Docker Jade emulator
2790
+ *
2791
+ * Deprecated: use `fromWebSocket()` instead.
2792
+ *
2793
+ * `wasm-bindgen` deprecated async constructors because they generate
2794
+ * invalid TypeScript declarations. See https://github.com/wasm-bindgen/wasm-bindgen/pull/4402.
2595
2795
  * @param {Network} network
2596
2796
  * @param {string} url
2597
2797
  */
@@ -2599,7 +2799,22 @@ class JadeWebSocket {
2599
2799
  _assertClass(network, Network);
2600
2800
  const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2601
2801
  const len0 = WASM_VECTOR_LEN;
2602
- const ret = wasm.jadewebsocket_from_websocket(network.__wbg_ptr, ptr0, len0);
2802
+ const ret = wasm.jadewebsocket_new(network.__wbg_ptr, ptr0, len0);
2803
+ return ret;
2804
+ }
2805
+ /**
2806
+ * Creates a Jade from WebSocket for the given network
2807
+ *
2808
+ * The url should point to your WebSocket bridge that connects to the Docker Jade emulator
2809
+ * @param {Network} network
2810
+ * @param {string} url
2811
+ * @returns {Promise<JadeWebSocket>}
2812
+ */
2813
+ static fromWebSocket(network, url) {
2814
+ _assertClass(network, Network);
2815
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2816
+ const len0 = WASM_VECTOR_LEN;
2817
+ const ret = wasm.jadewebsocket_fromWebSocket(network.__wbg_ptr, ptr0, len0);
2603
2818
  return ret;
2604
2819
  }
2605
2820
  /**
@@ -2739,7 +2954,8 @@ class JsStoreLink {
2739
2954
  /**
2740
2955
  * Create a new `JsStoreLink` from a JavaScript storage object.
2741
2956
  *
2742
- * The JS object must have `get(key)`, `put(key, value)`, and `remove(key)` methods.
2957
+ * The JS object must have `get(key)`, `put(key, value)`, `remove(key)`,
2958
+ * and `isPersisted()` methods.
2743
2959
  * @param {any} storage
2744
2960
  */
2745
2961
  constructor(storage) {
@@ -4924,47 +5140,28 @@ class Signer {
4924
5140
  wasm.__wbg_signer_free(ptr, 0);
4925
5141
  }
4926
5142
  /**
4927
- * Creates a `Signer`
4928
- * @param {Mnemonic} mnemonic
4929
- * @param {Network} network
4930
- */
4931
- constructor(mnemonic, network) {
4932
- _assertClass(mnemonic, Mnemonic);
4933
- _assertClass(network, Network);
4934
- const ret = wasm.signer_new(mnemonic.__wbg_ptr, network.__wbg_ptr);
4935
- if (ret[2]) {
4936
- throw takeFromExternrefTable0(ret[1]);
4937
- }
4938
- this.__wbg_ptr = ret[0] >>> 0;
4939
- SignerFinalization.register(this, this.__wbg_ptr, this);
4940
- return this;
4941
- }
4942
- /**
4943
- * Sign and consume the given PSET, returning the signed one
4944
- * @param {Pset} pset
4945
- * @returns {Pset}
5143
+ * AMP0 signer data for login
5144
+ * @returns {Amp0SignerData}
4946
5145
  */
4947
- sign(pset) {
4948
- _assertClass(pset, Pset);
4949
- var ptr0 = pset.__destroy_into_raw();
4950
- const ret = wasm.signer_sign(this.__wbg_ptr, ptr0);
5146
+ amp0SignerData() {
5147
+ const ret = wasm.signer_amp0SignerData(this.__wbg_ptr);
4951
5148
  if (ret[2]) {
4952
5149
  throw takeFromExternrefTable0(ret[1]);
4953
5150
  }
4954
- return Pset.__wrap(ret[0]);
5151
+ return Amp0SignerData.__wrap(ret[0]);
4955
5152
  }
4956
5153
  /**
4957
- * Sign a message with the master key, return the signature as a base64 string
4958
- * @param {string} message
5154
+ * AMP0 sign login challenge
5155
+ * @param {string} challenge
4959
5156
  * @returns {string}
4960
5157
  */
4961
- signMessage(message) {
5158
+ amp0SignChallenge(challenge) {
4962
5159
  let deferred3_0;
4963
5160
  let deferred3_1;
4964
5161
  try {
4965
- const ptr0 = passStringToWasm0(message, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5162
+ const ptr0 = passStringToWasm0(challenge, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4966
5163
  const len0 = WASM_VECTOR_LEN;
4967
- const ret = wasm.signer_signMessage(this.__wbg_ptr, ptr0, len0);
5164
+ const ret = wasm.signer_amp0SignChallenge(this.__wbg_ptr, ptr0, len0);
4968
5165
  var ptr2 = ret[0];
4969
5166
  var len2 = ret[1];
4970
5167
  if (ret[3]) {
@@ -4979,17 +5176,95 @@ class Signer {
4979
5176
  }
4980
5177
  }
4981
5178
  /**
4982
- * Return the witness public key hash, slip77 descriptor of this signer
4983
- * @returns {WolletDescriptor}
5179
+ * AMP0 account xpub
5180
+ * @param {number} account
5181
+ * @returns {string}
4984
5182
  */
4985
- wpkhSlip77Descriptor() {
4986
- const ret = wasm.signer_wpkhSlip77Descriptor(this.__wbg_ptr);
4987
- if (ret[2]) {
4988
- throw takeFromExternrefTable0(ret[1]);
4989
- }
4990
- return WolletDescriptor.__wrap(ret[0]);
4991
- }
4992
- /**
5183
+ amp0AccountXpub(account) {
5184
+ let deferred2_0;
5185
+ let deferred2_1;
5186
+ try {
5187
+ const ret = wasm.signer_amp0AccountXpub(this.__wbg_ptr, account);
5188
+ var ptr1 = ret[0];
5189
+ var len1 = ret[1];
5190
+ if (ret[3]) {
5191
+ ptr1 = 0; len1 = 0;
5192
+ throw takeFromExternrefTable0(ret[2]);
5193
+ }
5194
+ deferred2_0 = ptr1;
5195
+ deferred2_1 = len1;
5196
+ return getStringFromWasm0(ptr1, len1);
5197
+ } finally {
5198
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
5199
+ }
5200
+ }
5201
+ /**
5202
+ * Creates a `Signer`
5203
+ * @param {Mnemonic} mnemonic
5204
+ * @param {Network} network
5205
+ */
5206
+ constructor(mnemonic, network) {
5207
+ _assertClass(mnemonic, Mnemonic);
5208
+ _assertClass(network, Network);
5209
+ const ret = wasm.signer_new(mnemonic.__wbg_ptr, network.__wbg_ptr);
5210
+ if (ret[2]) {
5211
+ throw takeFromExternrefTable0(ret[1]);
5212
+ }
5213
+ this.__wbg_ptr = ret[0] >>> 0;
5214
+ SignerFinalization.register(this, this.__wbg_ptr, this);
5215
+ return this;
5216
+ }
5217
+ /**
5218
+ * Sign and consume the given PSET, returning the signed one
5219
+ * @param {Pset} pset
5220
+ * @returns {Pset}
5221
+ */
5222
+ sign(pset) {
5223
+ _assertClass(pset, Pset);
5224
+ var ptr0 = pset.__destroy_into_raw();
5225
+ const ret = wasm.signer_sign(this.__wbg_ptr, ptr0);
5226
+ if (ret[2]) {
5227
+ throw takeFromExternrefTable0(ret[1]);
5228
+ }
5229
+ return Pset.__wrap(ret[0]);
5230
+ }
5231
+ /**
5232
+ * Sign a message with the master key, return the signature as a base64 string
5233
+ * @param {string} message
5234
+ * @returns {string}
5235
+ */
5236
+ signMessage(message) {
5237
+ let deferred3_0;
5238
+ let deferred3_1;
5239
+ try {
5240
+ const ptr0 = passStringToWasm0(message, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5241
+ const len0 = WASM_VECTOR_LEN;
5242
+ const ret = wasm.signer_signMessage(this.__wbg_ptr, ptr0, len0);
5243
+ var ptr2 = ret[0];
5244
+ var len2 = ret[1];
5245
+ if (ret[3]) {
5246
+ ptr2 = 0; len2 = 0;
5247
+ throw takeFromExternrefTable0(ret[2]);
5248
+ }
5249
+ deferred3_0 = ptr2;
5250
+ deferred3_1 = len2;
5251
+ return getStringFromWasm0(ptr2, len2);
5252
+ } finally {
5253
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
5254
+ }
5255
+ }
5256
+ /**
5257
+ * Return the witness public key hash, slip77 descriptor of this signer
5258
+ * @returns {WolletDescriptor}
5259
+ */
5260
+ wpkhSlip77Descriptor() {
5261
+ const ret = wasm.signer_wpkhSlip77Descriptor(this.__wbg_ptr);
5262
+ if (ret[2]) {
5263
+ throw takeFromExternrefTable0(ret[1]);
5264
+ }
5265
+ return WolletDescriptor.__wrap(ret[0]);
5266
+ }
5267
+ /**
4993
5268
  * Return the extended public key of the signer
4994
5269
  * @returns {Xpub}
4995
5270
  */
@@ -5067,65 +5342,6 @@ class Signer {
5067
5342
  }
5068
5343
  return Mnemonic.__wrap(ret[0]);
5069
5344
  }
5070
- /**
5071
- * AMP0 signer data for login
5072
- * @returns {Amp0SignerData}
5073
- */
5074
- amp0SignerData() {
5075
- const ret = wasm.signer_amp0SignerData(this.__wbg_ptr);
5076
- if (ret[2]) {
5077
- throw takeFromExternrefTable0(ret[1]);
5078
- }
5079
- return Amp0SignerData.__wrap(ret[0]);
5080
- }
5081
- /**
5082
- * AMP0 sign login challenge
5083
- * @param {string} challenge
5084
- * @returns {string}
5085
- */
5086
- amp0SignChallenge(challenge) {
5087
- let deferred3_0;
5088
- let deferred3_1;
5089
- try {
5090
- const ptr0 = passStringToWasm0(challenge, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5091
- const len0 = WASM_VECTOR_LEN;
5092
- const ret = wasm.signer_amp0SignChallenge(this.__wbg_ptr, ptr0, len0);
5093
- var ptr2 = ret[0];
5094
- var len2 = ret[1];
5095
- if (ret[3]) {
5096
- ptr2 = 0; len2 = 0;
5097
- throw takeFromExternrefTable0(ret[2]);
5098
- }
5099
- deferred3_0 = ptr2;
5100
- deferred3_1 = len2;
5101
- return getStringFromWasm0(ptr2, len2);
5102
- } finally {
5103
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
5104
- }
5105
- }
5106
- /**
5107
- * AMP0 account xpub
5108
- * @param {number} account
5109
- * @returns {string}
5110
- */
5111
- amp0AccountXpub(account) {
5112
- let deferred2_0;
5113
- let deferred2_1;
5114
- try {
5115
- const ret = wasm.signer_amp0AccountXpub(this.__wbg_ptr, account);
5116
- var ptr1 = ret[0];
5117
- var len1 = ret[1];
5118
- if (ret[3]) {
5119
- ptr1 = 0; len1 = 0;
5120
- throw takeFromExternrefTable0(ret[2]);
5121
- }
5122
- deferred2_0 = ptr1;
5123
- deferred2_1 = len1;
5124
- return getStringFromWasm0(ptr1, len1);
5125
- } finally {
5126
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
5127
- }
5128
- }
5129
5345
  }
5130
5346
  if (Symbol.dispose) Signer.prototype[Symbol.dispose] = Signer.prototype.free;
5131
5347
 
@@ -5267,6 +5483,8 @@ class Transaction {
5267
5483
  }
5268
5484
  /**
5269
5485
  * Creates a `Transaction`
5486
+ *
5487
+ * Deprecated: use `fromString()` instead.
5270
5488
  * @param {string} tx_hex
5271
5489
  */
5272
5490
  constructor(tx_hex) {
@@ -5280,6 +5498,34 @@ class Transaction {
5280
5498
  TransactionFinalization.register(this, this.__wbg_ptr, this);
5281
5499
  return this;
5282
5500
  }
5501
+ /**
5502
+ * Creates a `Transaction` from hex-encoded consensus bytes.
5503
+ * @param {string} s
5504
+ * @returns {Transaction}
5505
+ */
5506
+ static fromString(s) {
5507
+ const ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5508
+ const len0 = WASM_VECTOR_LEN;
5509
+ const ret = wasm.transaction_fromString(ptr0, len0);
5510
+ if (ret[2]) {
5511
+ throw takeFromExternrefTable0(ret[1]);
5512
+ }
5513
+ return Transaction.__wrap(ret[0]);
5514
+ }
5515
+ /**
5516
+ * Creates a `Transaction` from consensus-encoded bytes.
5517
+ * @param {Uint8Array} bytes
5518
+ * @returns {Transaction}
5519
+ */
5520
+ static fromBytes(bytes) {
5521
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
5522
+ const len0 = WASM_VECTOR_LEN;
5523
+ const ret = wasm.transaction_fromBytes(ptr0, len0);
5524
+ if (ret[2]) {
5525
+ throw takeFromExternrefTable0(ret[1]);
5526
+ }
5527
+ return Transaction.__wrap(ret[0]);
5528
+ }
5283
5529
  /**
5284
5530
  * Return the transaction identifier.
5285
5531
  * @returns {Txid}
@@ -5292,6 +5538,18 @@ class Transaction {
5292
5538
  * Return the consensus encoded bytes of the transaction.
5293
5539
  * @returns {Uint8Array}
5294
5540
  */
5541
+ toBytes() {
5542
+ const ret = wasm.transaction_toBytes(this.__wbg_ptr);
5543
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
5544
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
5545
+ return v1;
5546
+ }
5547
+ /**
5548
+ * Return the consensus encoded bytes of the transaction.
5549
+ *
5550
+ * Deprecated: use `toBytes()` instead.
5551
+ * @returns {Uint8Array}
5552
+ */
5295
5553
  bytes() {
5296
5554
  const ret = wasm.transaction_bytes(this.__wbg_ptr);
5297
5555
  var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
@@ -5485,9 +5743,8 @@ class TxBuilder {
5485
5743
  addExplicitRecipient(address, satoshi, asset) {
5486
5744
  const ptr = this.__destroy_into_raw();
5487
5745
  _assertClass(address, Address);
5488
- var ptr0 = address.__destroy_into_raw();
5489
5746
  _assertClass(asset, AssetId);
5490
- const ret = wasm.txbuilder_addExplicitRecipient(ptr, ptr0, satoshi, asset.__wbg_ptr);
5747
+ const ret = wasm.txbuilder_addExplicitRecipient(ptr, address.__wbg_ptr, satoshi, asset.__wbg_ptr);
5491
5748
  if (ret[2]) {
5492
5749
  throw takeFromExternrefTable0(ret[1]);
5493
5750
  }
@@ -5557,18 +5814,17 @@ class TxBuilder {
5557
5814
  reissueAsset(asset_to_reissue, satoshi_to_reissue, asset_receiver, issuance_tx) {
5558
5815
  const ptr = this.__destroy_into_raw();
5559
5816
  _assertClass(asset_to_reissue, AssetId);
5560
- var ptr0 = asset_to_reissue.__destroy_into_raw();
5561
- let ptr1 = 0;
5817
+ let ptr0 = 0;
5562
5818
  if (!isLikeNone(asset_receiver)) {
5563
5819
  _assertClass(asset_receiver, Address);
5564
- ptr1 = asset_receiver.__destroy_into_raw();
5820
+ ptr0 = asset_receiver.__destroy_into_raw();
5565
5821
  }
5566
- let ptr2 = 0;
5822
+ let ptr1 = 0;
5567
5823
  if (!isLikeNone(issuance_tx)) {
5568
5824
  _assertClass(issuance_tx, Transaction);
5569
- ptr2 = issuance_tx.__destroy_into_raw();
5825
+ ptr1 = issuance_tx.__destroy_into_raw();
5570
5826
  }
5571
- const ret = wasm.txbuilder_reissueAsset(ptr, ptr0, satoshi_to_reissue, ptr1, ptr2);
5827
+ const ret = wasm.txbuilder_reissueAsset(ptr, asset_to_reissue.__wbg_ptr, satoshi_to_reissue, ptr0, ptr1);
5572
5828
  if (ret[2]) {
5573
5829
  throw takeFromExternrefTable0(ret[1]);
5574
5830
  }
@@ -5624,12 +5880,9 @@ class TxBuilder {
5624
5880
  liquidexMake(utxo, address, satoshi, asset_id) {
5625
5881
  const ptr = this.__destroy_into_raw();
5626
5882
  _assertClass(utxo, OutPoint);
5627
- var ptr0 = utxo.__destroy_into_raw();
5628
5883
  _assertClass(address, Address);
5629
- var ptr1 = address.__destroy_into_raw();
5630
5884
  _assertClass(asset_id, AssetId);
5631
- var ptr2 = asset_id.__destroy_into_raw();
5632
- const ret = wasm.txbuilder_liquidexMake(ptr, ptr0, ptr1, satoshi, ptr2);
5885
+ const ret = wasm.txbuilder_liquidexMake(ptr, utxo.__wbg_ptr, address.__wbg_ptr, satoshi, asset_id.__wbg_ptr);
5633
5886
  if (ret[2]) {
5634
5887
  throw takeFromExternrefTable0(ret[1]);
5635
5888
  }
@@ -5661,9 +5914,289 @@ class TxBuilder {
5661
5914
  return TxBuilder.__wrap(ret);
5662
5915
  }
5663
5916
  }
5664
- if (Symbol.dispose) TxBuilder.prototype[Symbol.dispose] = TxBuilder.prototype.free;
5917
+ if (Symbol.dispose) TxBuilder.prototype[Symbol.dispose] = TxBuilder.prototype.free;
5918
+
5919
+ exports.TxBuilder = TxBuilder;
5920
+
5921
+ const TxDetailsFinalization = (typeof FinalizationRegistry === 'undefined')
5922
+ ? { register: () => {}, unregister: () => {} }
5923
+ : new FinalizationRegistry(ptr => wasm.__wbg_txdetails_free(ptr >>> 0, 1));
5924
+ /**
5925
+ * Transaction details
5926
+ */
5927
+ class TxDetails {
5928
+
5929
+ static __wrap(ptr) {
5930
+ ptr = ptr >>> 0;
5931
+ const obj = Object.create(TxDetails.prototype);
5932
+ obj.__wbg_ptr = ptr;
5933
+ TxDetailsFinalization.register(obj, obj.__wbg_ptr, obj);
5934
+ return obj;
5935
+ }
5936
+
5937
+ __destroy_into_raw() {
5938
+ const ptr = this.__wbg_ptr;
5939
+ this.__wbg_ptr = 0;
5940
+ TxDetailsFinalization.unregister(this);
5941
+ return ptr;
5942
+ }
5943
+
5944
+ free() {
5945
+ const ptr = this.__destroy_into_raw();
5946
+ wasm.__wbg_txdetails_free(ptr, 0);
5947
+ }
5948
+ /**
5949
+ * Transaction
5950
+ * @returns {Transaction | undefined}
5951
+ */
5952
+ tx() {
5953
+ const ret = wasm.txdetails_tx(this.__wbg_ptr);
5954
+ return ret === 0 ? undefined : Transaction.__wrap(ret);
5955
+ }
5956
+ /**
5957
+ * Txid
5958
+ * @returns {Txid}
5959
+ */
5960
+ txid() {
5961
+ const ret = wasm.txdetails_txid(this.__wbg_ptr);
5962
+ return Txid.__wrap(ret);
5963
+ }
5964
+ /**
5965
+ * Blockchain height
5966
+ * @returns {number | undefined}
5967
+ */
5968
+ height() {
5969
+ const ret = wasm.txdetails_height(this.__wbg_ptr);
5970
+ return ret === 0x100000001 ? undefined : ret;
5971
+ }
5972
+ /**
5973
+ * Timestamp
5974
+ *
5975
+ * A reasonable timestamp, that however can be inaccurate.
5976
+ * If you need a precise timestamp, do not use this value.
5977
+ * @returns {number | undefined}
5978
+ */
5979
+ timestamp() {
5980
+ const ret = wasm.txdetails_timestamp(this.__wbg_ptr);
5981
+ return ret === 0x100000001 ? undefined : ret;
5982
+ }
5983
+ /**
5984
+ * Transaction type
5985
+ *
5986
+ * A tentative description of the transaction type, which
5987
+ * however might be inaccurate. Use this if you want a simple
5988
+ * description of what this transaction is doing, but do
5989
+ * not rely on the value returned.
5990
+ * @returns {string}
5991
+ */
5992
+ txType() {
5993
+ let deferred1_0;
5994
+ let deferred1_1;
5995
+ try {
5996
+ const ret = wasm.txdetails_txType(this.__wbg_ptr);
5997
+ deferred1_0 = ret[0];
5998
+ deferred1_1 = ret[1];
5999
+ return getStringFromWasm0(ret[0], ret[1]);
6000
+ } finally {
6001
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
6002
+ }
6003
+ }
6004
+ /**
6005
+ * Balance
6006
+ *
6007
+ * Net balance from the `Wollet` perspective
6008
+ * @returns {Balance}
6009
+ */
6010
+ balance() {
6011
+ const ret = wasm.txdetails_balance(this.__wbg_ptr);
6012
+ return Balance.__wrap(ret);
6013
+ }
6014
+ /**
6015
+ * Asset fees
6016
+ * @param {AssetId} asset
6017
+ * @returns {bigint}
6018
+ */
6019
+ feesAsset(asset) {
6020
+ _assertClass(asset, AssetId);
6021
+ const ret = wasm.txdetails_feesAsset(this.__wbg_ptr, asset.__wbg_ptr);
6022
+ return BigInt.asUintN(64, ret);
6023
+ }
6024
+ /**
6025
+ * Unblinded URL
6026
+ * @param {string} explorer_url
6027
+ * @returns {string}
6028
+ */
6029
+ unblindedUrl(explorer_url) {
6030
+ let deferred2_0;
6031
+ let deferred2_1;
6032
+ try {
6033
+ const ptr0 = passStringToWasm0(explorer_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6034
+ const len0 = WASM_VECTOR_LEN;
6035
+ const ret = wasm.txdetails_unblindedUrl(this.__wbg_ptr, ptr0, len0);
6036
+ deferred2_0 = ret[0];
6037
+ deferred2_1 = ret[1];
6038
+ return getStringFromWasm0(ret[0], ret[1]);
6039
+ } finally {
6040
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
6041
+ }
6042
+ }
6043
+ /**
6044
+ * Inputs
6045
+ * @returns {TxOutDetails[]}
6046
+ */
6047
+ inputs() {
6048
+ const ret = wasm.txdetails_inputs(this.__wbg_ptr);
6049
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
6050
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
6051
+ return v1;
6052
+ }
6053
+ /**
6054
+ * Outputs
6055
+ * @returns {TxOutDetails[]}
6056
+ */
6057
+ outputs() {
6058
+ const ret = wasm.txdetails_outputs(this.__wbg_ptr);
6059
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
6060
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
6061
+ return v1;
6062
+ }
6063
+ }
6064
+ if (Symbol.dispose) TxDetails.prototype[Symbol.dispose] = TxDetails.prototype.free;
6065
+
6066
+ exports.TxDetails = TxDetails;
6067
+
6068
+ const TxOptFinalization = (typeof FinalizationRegistry === 'undefined')
6069
+ ? { register: () => {}, unregister: () => {} }
6070
+ : new FinalizationRegistry(ptr => wasm.__wbg_txopt_free(ptr >>> 0, 1));
6071
+ /**
6072
+ * Options for transaction details
6073
+ */
6074
+ class TxOpt {
6075
+
6076
+ static __wrap(ptr) {
6077
+ ptr = ptr >>> 0;
6078
+ const obj = Object.create(TxOpt.prototype);
6079
+ obj.__wbg_ptr = ptr;
6080
+ TxOptFinalization.register(obj, obj.__wbg_ptr, obj);
6081
+ return obj;
6082
+ }
6083
+
6084
+ __destroy_into_raw() {
6085
+ const ptr = this.__wbg_ptr;
6086
+ this.__wbg_ptr = 0;
6087
+ TxOptFinalization.unregister(this);
6088
+ return ptr;
6089
+ }
6090
+
6091
+ free() {
6092
+ const ptr = this.__destroy_into_raw();
6093
+ wasm.__wbg_txopt_free(ptr, 0);
6094
+ }
6095
+ /**
6096
+ * @returns {TxOpt}
6097
+ */
6098
+ static default() {
6099
+ const ret = wasm.txopt_default();
6100
+ return TxOpt.__wrap(ret);
6101
+ }
6102
+ }
6103
+ if (Symbol.dispose) TxOpt.prototype[Symbol.dispose] = TxOpt.prototype.free;
6104
+
6105
+ exports.TxOpt = TxOpt;
6106
+
6107
+ const TxOutDetailsFinalization = (typeof FinalizationRegistry === 'undefined')
6108
+ ? { register: () => {}, unregister: () => {} }
6109
+ : new FinalizationRegistry(ptr => wasm.__wbg_txoutdetails_free(ptr >>> 0, 1));
6110
+ /**
6111
+ * Transaction output details
6112
+ */
6113
+ class TxOutDetails {
6114
+
6115
+ static __wrap(ptr) {
6116
+ ptr = ptr >>> 0;
6117
+ const obj = Object.create(TxOutDetails.prototype);
6118
+ obj.__wbg_ptr = ptr;
6119
+ TxOutDetailsFinalization.register(obj, obj.__wbg_ptr, obj);
6120
+ return obj;
6121
+ }
6122
+
6123
+ __destroy_into_raw() {
6124
+ const ptr = this.__wbg_ptr;
6125
+ this.__wbg_ptr = 0;
6126
+ TxOutDetailsFinalization.unregister(this);
6127
+ return ptr;
6128
+ }
6129
+
6130
+ free() {
6131
+ const ptr = this.__destroy_into_raw();
6132
+ wasm.__wbg_txoutdetails_free(ptr, 0);
6133
+ }
6134
+ /**
6135
+ * Outpoint
6136
+ * @returns {OutPoint}
6137
+ */
6138
+ outpoint() {
6139
+ const ret = wasm.txoutdetails_outpoint(this.__wbg_ptr);
6140
+ return OutPoint.__wrap(ret);
6141
+ }
6142
+ /**
6143
+ * Scriptpubkey
6144
+ * @returns {Script | undefined}
6145
+ */
6146
+ script_pubkey() {
6147
+ const ret = wasm.txoutdetails_script_pubkey(this.__wbg_ptr);
6148
+ return ret === 0 ? undefined : Script.__wrap(ret);
6149
+ }
6150
+ /**
6151
+ * Height
6152
+ * @returns {number | undefined}
6153
+ */
6154
+ height() {
6155
+ const ret = wasm.txoutdetails_height(this.__wbg_ptr);
6156
+ return ret === 0x100000001 ? undefined : ret;
6157
+ }
6158
+ /**
6159
+ * Address
6160
+ * @returns {Address | undefined}
6161
+ */
6162
+ address() {
6163
+ const ret = wasm.txoutdetails_address(this.__wbg_ptr);
6164
+ return ret === 0 ? undefined : Address.__wrap(ret);
6165
+ }
6166
+ /**
6167
+ * Unblinded values (asset, amount, blinders)
6168
+ * @returns {TxOutSecrets | undefined}
6169
+ */
6170
+ unblinded() {
6171
+ const ret = wasm.txoutdetails_unblinded(this.__wbg_ptr);
6172
+ return ret === 0 ? undefined : TxOutSecrets.__wrap(ret);
6173
+ }
6174
+ /**
6175
+ * Whether the transaction output is explicit
6176
+ * @returns {boolean}
6177
+ */
6178
+ is_explicit() {
6179
+ const ret = wasm.txoutdetails_is_explicit(this.__wbg_ptr);
6180
+ return ret !== 0;
6181
+ }
6182
+ /**
6183
+ * Whether the output is spent by a previously downloaded transaction
6184
+ *
6185
+ * Note: this value might be inaccurate. We compute this from downloaded
6186
+ * transactions, however we only download transactions relevant for the
6187
+ * wallet (i.e. if they include inputs or outputs that belong to the
6188
+ * wallet), thus for non-wallet outputs we might set this value
6189
+ * incorrectly. For wallet outputs, it can be outdated.
6190
+ * @returns {boolean}
6191
+ */
6192
+ is_spent() {
6193
+ const ret = wasm.txoutdetails_is_spent(this.__wbg_ptr);
6194
+ return ret !== 0;
6195
+ }
6196
+ }
6197
+ if (Symbol.dispose) TxOutDetails.prototype[Symbol.dispose] = TxOutDetails.prototype.free;
5665
6198
 
5666
- exports.TxBuilder = TxBuilder;
6199
+ exports.TxOutDetails = TxOutDetails;
5667
6200
 
5668
6201
  const TxOutSecretsFinalization = (typeof FinalizationRegistry === 'undefined')
5669
6202
  ? { register: () => {}, unregister: () => {} }
@@ -5714,20 +6247,12 @@ class TxOutSecrets {
5714
6247
  return AssetId.__wrap(ret);
5715
6248
  }
5716
6249
  /**
5717
- * Return the asset blinding factor as a hex string.
5718
- * @returns {string}
6250
+ * Return the asset blinding factor as a typed object.
6251
+ * @returns {AssetBlindingFactor}
5719
6252
  */
5720
6253
  assetBlindingFactor() {
5721
- let deferred1_0;
5722
- let deferred1_1;
5723
- try {
5724
- const ret = wasm.txoutsecrets_assetBlindingFactor(this.__wbg_ptr);
5725
- deferred1_0 = ret[0];
5726
- deferred1_1 = ret[1];
5727
- return getStringFromWasm0(ret[0], ret[1]);
5728
- } finally {
5729
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
5730
- }
6254
+ const ret = wasm.txoutsecrets_assetBlindingFactor(this.__wbg_ptr);
6255
+ return AssetBlindingFactor.__wrap(ret);
5731
6256
  }
5732
6257
  /**
5733
6258
  * Return the value of the output.
@@ -5738,20 +6263,12 @@ class TxOutSecrets {
5738
6263
  return BigInt.asUintN(64, ret);
5739
6264
  }
5740
6265
  /**
5741
- * Return the value blinding factor as a hex string.
5742
- * @returns {string}
6266
+ * Return the value blinding factor as a typed object.
6267
+ * @returns {ValueBlindingFactor}
5743
6268
  */
5744
6269
  valueBlindingFactor() {
5745
- let deferred1_0;
5746
- let deferred1_1;
5747
- try {
5748
- const ret = wasm.txoutsecrets_valueBlindingFactor(this.__wbg_ptr);
5749
- deferred1_0 = ret[0];
5750
- deferred1_1 = ret[1];
5751
- return getStringFromWasm0(ret[0], ret[1]);
5752
- } finally {
5753
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
5754
- }
6270
+ const ret = wasm.txoutsecrets_valueBlindingFactor(this.__wbg_ptr);
6271
+ return ValueBlindingFactor.__wrap(ret);
5755
6272
  }
5756
6273
  /**
5757
6274
  * Return true if the output is explicit (no blinding factors).
@@ -5868,6 +6385,54 @@ if (Symbol.dispose) Txid.prototype[Symbol.dispose] = Txid.prototype.free;
5868
6385
 
5869
6386
  exports.Txid = Txid;
5870
6387
 
6388
+ const TxsOptFinalization = (typeof FinalizationRegistry === 'undefined')
6389
+ ? { register: () => {}, unregister: () => {} }
6390
+ : new FinalizationRegistry(ptr => wasm.__wbg_txsopt_free(ptr >>> 0, 1));
6391
+ /**
6392
+ * Options for transaction details
6393
+ */
6394
+ class TxsOpt {
6395
+
6396
+ static __wrap(ptr) {
6397
+ ptr = ptr >>> 0;
6398
+ const obj = Object.create(TxsOpt.prototype);
6399
+ obj.__wbg_ptr = ptr;
6400
+ TxsOptFinalization.register(obj, obj.__wbg_ptr, obj);
6401
+ return obj;
6402
+ }
6403
+
6404
+ __destroy_into_raw() {
6405
+ const ptr = this.__wbg_ptr;
6406
+ this.__wbg_ptr = 0;
6407
+ TxsOptFinalization.unregister(this);
6408
+ return ptr;
6409
+ }
6410
+
6411
+ free() {
6412
+ const ptr = this.__destroy_into_raw();
6413
+ wasm.__wbg_txsopt_free(ptr, 0);
6414
+ }
6415
+ /**
6416
+ * @returns {TxsOpt}
6417
+ */
6418
+ static default() {
6419
+ const ret = wasm.txsopt_default();
6420
+ return TxsOpt.__wrap(ret);
6421
+ }
6422
+ /**
6423
+ * @param {number} offset
6424
+ * @param {number} limit
6425
+ * @returns {TxsOpt}
6426
+ */
6427
+ static withPagination(offset, limit) {
6428
+ const ret = wasm.txsopt_withPagination(offset, limit);
6429
+ return TxsOpt.__wrap(ret);
6430
+ }
6431
+ }
6432
+ if (Symbol.dispose) TxsOpt.prototype[Symbol.dispose] = TxsOpt.prototype.free;
6433
+
6434
+ exports.TxsOpt = TxsOpt;
6435
+
5871
6436
  const UnvalidatedLiquidexProposalFinalization = (typeof FinalizationRegistry === 'undefined')
5872
6437
  ? { register: () => {}, unregister: () => {} }
5873
6438
  : new FinalizationRegistry(ptr => wasm.__wbg_unvalidatedliquidexproposal_free(ptr >>> 0, 1));
@@ -6164,6 +6729,104 @@ if (Symbol.dispose) ValidatedLiquidexProposal.prototype[Symbol.dispose] = Valida
6164
6729
 
6165
6730
  exports.ValidatedLiquidexProposal = ValidatedLiquidexProposal;
6166
6731
 
6732
+ const ValueBlindingFactorFinalization = (typeof FinalizationRegistry === 'undefined')
6733
+ ? { register: () => {}, unregister: () => {} }
6734
+ : new FinalizationRegistry(ptr => wasm.__wbg_valueblindingfactor_free(ptr >>> 0, 1));
6735
+ /**
6736
+ * A blinding factor for value commitments.
6737
+ */
6738
+ class ValueBlindingFactor {
6739
+
6740
+ static __wrap(ptr) {
6741
+ ptr = ptr >>> 0;
6742
+ const obj = Object.create(ValueBlindingFactor.prototype);
6743
+ obj.__wbg_ptr = ptr;
6744
+ ValueBlindingFactorFinalization.register(obj, obj.__wbg_ptr, obj);
6745
+ return obj;
6746
+ }
6747
+
6748
+ __destroy_into_raw() {
6749
+ const ptr = this.__wbg_ptr;
6750
+ this.__wbg_ptr = 0;
6751
+ ValueBlindingFactorFinalization.unregister(this);
6752
+ return ptr;
6753
+ }
6754
+
6755
+ free() {
6756
+ const ptr = this.__destroy_into_raw();
6757
+ wasm.__wbg_valueblindingfactor_free(ptr, 0);
6758
+ }
6759
+ /**
6760
+ * Creates a `ValueBlindingFactor` from a string.
6761
+ * @param {string} s
6762
+ * @returns {ValueBlindingFactor}
6763
+ */
6764
+ static fromString(s) {
6765
+ const ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6766
+ const len0 = WASM_VECTOR_LEN;
6767
+ const ret = wasm.valueblindingfactor_fromString(ptr0, len0);
6768
+ if (ret[2]) {
6769
+ throw takeFromExternrefTable0(ret[1]);
6770
+ }
6771
+ return ValueBlindingFactor.__wrap(ret[0]);
6772
+ }
6773
+ /**
6774
+ * Creates a `ValueBlindingFactor` from a byte slice.
6775
+ * @param {Uint8Array} bytes
6776
+ * @returns {ValueBlindingFactor}
6777
+ */
6778
+ static fromBytes(bytes) {
6779
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
6780
+ const len0 = WASM_VECTOR_LEN;
6781
+ const ret = wasm.valueblindingfactor_fromBytes(ptr0, len0);
6782
+ if (ret[2]) {
6783
+ throw takeFromExternrefTable0(ret[1]);
6784
+ }
6785
+ return ValueBlindingFactor.__wrap(ret[0]);
6786
+ }
6787
+ /**
6788
+ * Returns a zero value blinding factor.
6789
+ * @returns {ValueBlindingFactor}
6790
+ */
6791
+ static zero() {
6792
+ const ret = wasm.valueblindingfactor_zero();
6793
+ return ValueBlindingFactor.__wrap(ret);
6794
+ }
6795
+ /**
6796
+ * Returns the bytes (32 bytes) in little-endian byte order.
6797
+ *
6798
+ * This is the internal representation used by secp256k1. The byte order is
6799
+ * reversed compared to the hex string representation (which uses big-endian,
6800
+ * following Bitcoin display conventions).
6801
+ * @returns {Uint8Array}
6802
+ */
6803
+ toBytes() {
6804
+ const ret = wasm.valueblindingfactor_toBytes(this.__wbg_ptr);
6805
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
6806
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
6807
+ return v1;
6808
+ }
6809
+ /**
6810
+ * Returns string representation of the VBF
6811
+ * @returns {string}
6812
+ */
6813
+ toString() {
6814
+ let deferred1_0;
6815
+ let deferred1_1;
6816
+ try {
6817
+ const ret = wasm.valueblindingfactor_toString(this.__wbg_ptr);
6818
+ deferred1_0 = ret[0];
6819
+ deferred1_1 = ret[1];
6820
+ return getStringFromWasm0(ret[0], ret[1]);
6821
+ } finally {
6822
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
6823
+ }
6824
+ }
6825
+ }
6826
+ if (Symbol.dispose) ValueBlindingFactor.prototype[Symbol.dispose] = ValueBlindingFactor.prototype.free;
6827
+
6828
+ exports.ValueBlindingFactor = ValueBlindingFactor;
6829
+
6167
6830
  const WalletTxFinalization = (typeof FinalizationRegistry === 'undefined')
6168
6831
  ? { register: () => {}, unregister: () => {} }
6169
6832
  : new FinalizationRegistry(ptr => wasm.__wbg_wallettx_free(ptr >>> 0, 1));
@@ -6421,6 +7084,51 @@ class Wollet {
6421
7084
  const ptr = this.__destroy_into_raw();
6422
7085
  wasm.__wbg_wollet_free(ptr, 0);
6423
7086
  }
7087
+ /**
7088
+ * Get the transaction list
7089
+ *
7090
+ * **Experimental**: This API may change without notice.
7091
+ * @param {TxsOpt} opt
7092
+ * @returns {TxDetails[]}
7093
+ */
7094
+ txs(opt) {
7095
+ _assertClass(opt, TxsOpt);
7096
+ const ret = wasm.wollet_txs(this.__wbg_ptr, opt.__wbg_ptr);
7097
+ if (ret[3]) {
7098
+ throw takeFromExternrefTable0(ret[2]);
7099
+ }
7100
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
7101
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
7102
+ return v1;
7103
+ }
7104
+ /**
7105
+ * Number of transactions
7106
+ * @returns {number}
7107
+ */
7108
+ numTxs() {
7109
+ const ret = wasm.wollet_numTxs(this.__wbg_ptr);
7110
+ if (ret[2]) {
7111
+ throw takeFromExternrefTable0(ret[1]);
7112
+ }
7113
+ return ret[0] >>> 0;
7114
+ }
7115
+ /**
7116
+ * Get the details of a transaction
7117
+ *
7118
+ * **Experimental**: This API may change without notice.
7119
+ * @param {Txid} txid
7120
+ * @param {TxOpt} opt
7121
+ * @returns {TxDetails | undefined}
7122
+ */
7123
+ txDetails(txid, opt) {
7124
+ _assertClass(txid, Txid);
7125
+ _assertClass(opt, TxOpt);
7126
+ const ret = wasm.wollet_txDetails(this.__wbg_ptr, txid.__wbg_ptr, opt.__wbg_ptr);
7127
+ if (ret[2]) {
7128
+ throw takeFromExternrefTable0(ret[1]);
7129
+ }
7130
+ return ret[0] === 0 ? undefined : TxDetails.__wrap(ret[0]);
7131
+ }
6424
7132
  /**
6425
7133
  * Create a `Wollet`
6426
7134
  * @param {Network} network
@@ -6565,7 +7273,7 @@ class Wollet {
6565
7273
  return AssetIds.__wrap(ret[0]);
6566
7274
  }
6567
7275
  /**
6568
- * Get the wallet transactions
7276
+ * Get the wallet transactions, sorted by height descending, then txid descending with unconfirmed first
6569
7277
  * @returns {WalletTx[]}
6570
7278
  */
6571
7279
  transactions() {
@@ -6577,6 +7285,21 @@ class Wollet {
6577
7285
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
6578
7286
  return v1;
6579
7287
  }
7288
+ /**
7289
+ * Get the wallet transactions with pagination sorted by height descending, then txid descending with unconfirmed first
7290
+ * @param {number} offset
7291
+ * @param {number} limit
7292
+ * @returns {WalletTx[]}
7293
+ */
7294
+ transactionsPaginated(offset, limit) {
7295
+ const ret = wasm.wollet_transactionsPaginated(this.__wbg_ptr, offset, limit);
7296
+ if (ret[3]) {
7297
+ throw takeFromExternrefTable0(ret[2]);
7298
+ }
7299
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
7300
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
7301
+ return v1;
7302
+ }
6580
7303
  /**
6581
7304
  * Get the unspent transaction outputs of the wallet
6582
7305
  * @returns {WalletTxOut[]}
@@ -6683,6 +7406,134 @@ if (Symbol.dispose) Wollet.prototype[Symbol.dispose] = Wollet.prototype.free;
6683
7406
 
6684
7407
  exports.Wollet = Wollet;
6685
7408
 
7409
+ const WolletBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
7410
+ ? { register: () => {}, unregister: () => {} }
7411
+ : new FinalizationRegistry(ptr => wasm.__wbg_wolletbuilder_free(ptr >>> 0, 1));
7412
+ /**
7413
+ * A builder for constructing [`Wollet`] instances.
7414
+ */
7415
+ class WolletBuilder {
7416
+
7417
+ static __wrap(ptr) {
7418
+ ptr = ptr >>> 0;
7419
+ const obj = Object.create(WolletBuilder.prototype);
7420
+ obj.__wbg_ptr = ptr;
7421
+ WolletBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
7422
+ return obj;
7423
+ }
7424
+
7425
+ __destroy_into_raw() {
7426
+ const ptr = this.__wbg_ptr;
7427
+ this.__wbg_ptr = 0;
7428
+ WolletBuilderFinalization.unregister(this);
7429
+ return ptr;
7430
+ }
7431
+
7432
+ free() {
7433
+ const ptr = this.__destroy_into_raw();
7434
+ wasm.__wbg_wolletbuilder_free(ptr, 0);
7435
+ }
7436
+ /**
7437
+ * Create a builder for a watch-only wallet.
7438
+ * @param {Network} network
7439
+ * @param {WolletDescriptor} descriptor
7440
+ */
7441
+ constructor(network, descriptor) {
7442
+ _assertClass(network, Network);
7443
+ _assertClass(descriptor, WolletDescriptor);
7444
+ const ret = wasm.wolletbuilder_new(network.__wbg_ptr, descriptor.__wbg_ptr);
7445
+ this.__wbg_ptr = ret >>> 0;
7446
+ WolletBuilderFinalization.register(this, this.__wbg_ptr, this);
7447
+ return this;
7448
+ }
7449
+ /**
7450
+ * Set the threshold used to merge persisted updates during build.
7451
+ *
7452
+ * **Experimental**: This API may change without notice.
7453
+ *
7454
+ * `None` disables merging (default behavior).
7455
+ * @param {number | null} [merge_threshold]
7456
+ * @returns {WolletBuilder}
7457
+ */
7458
+ withMergeThreshold(merge_threshold) {
7459
+ const ptr = this.__destroy_into_raw();
7460
+ const ret = wasm.wolletbuilder_withMergeThreshold(ptr, isLikeNone(merge_threshold) ? 0x100000001 : (merge_threshold) >>> 0);
7461
+ return WolletBuilder.__wrap(ret);
7462
+ }
7463
+ /**
7464
+ * Set the wallet as "utxo only".
7465
+ *
7466
+ * **Experimental**: This API may change without notice.
7467
+ * @param {boolean} utxo_only
7468
+ * @returns {WolletBuilder}
7469
+ */
7470
+ utxoOnly(utxo_only) {
7471
+ const ptr = this.__destroy_into_raw();
7472
+ const ret = wasm.wolletbuilder_utxoOnly(ptr, utxo_only);
7473
+ return WolletBuilder.__wrap(ret);
7474
+ }
7475
+ /**
7476
+ * Persist wallet updates in the given JavaScript storage object.
7477
+ *
7478
+ * **Experimental**: This API may change without notice.
7479
+ *
7480
+ * Wallet data is persisted in clear.
7481
+ *
7482
+ * The JS object must have `get(key)`, `put(key, value)`, and `remove(key)` methods.
7483
+ * @param {any} storage
7484
+ * @returns {WolletBuilder}
7485
+ */
7486
+ withExperimentalStore(storage) {
7487
+ const ptr = this.__destroy_into_raw();
7488
+ const ret = wasm.wolletbuilder_withExperimentalStore(ptr, storage);
7489
+ return WolletBuilder.__wrap(ret);
7490
+ }
7491
+ /**
7492
+ * Persist wallet transactions in the given JavaScript
7493
+ * storage object.
7494
+ *
7495
+ * **Experimental**: This API may change without notice.
7496
+ *
7497
+ * The JS object must have `get(key)`, `put(key, value)`, and `remove(key)` methods.
7498
+ * @param {any} storage
7499
+ * @returns {WolletBuilder}
7500
+ */
7501
+ withTxsStore(storage) {
7502
+ const ptr = this.__destroy_into_raw();
7503
+ const ret = wasm.wolletbuilder_withTxsStore(ptr, storage);
7504
+ return WolletBuilder.__wrap(ret);
7505
+ }
7506
+ /**
7507
+ * Set encryption for the transactions store.
7508
+ *
7509
+ * **Experimental**: This API may change without notice.
7510
+ *
7511
+ * Default: encrypted if the store is persisted.
7512
+ * @param {boolean} encrypt
7513
+ * @returns {WolletBuilder}
7514
+ */
7515
+ setEncryptionTxsStore(encrypt) {
7516
+ const ptr = this.__destroy_into_raw();
7517
+ const ret = wasm.wolletbuilder_setEncryptionTxsStore(ptr, encrypt);
7518
+ return WolletBuilder.__wrap(ret);
7519
+ }
7520
+ /**
7521
+ * Build the wallet from this builder.
7522
+ * @returns {Wollet}
7523
+ */
7524
+ build() {
7525
+ const ptr = this.__destroy_into_raw();
7526
+ const ret = wasm.wolletbuilder_build(ptr);
7527
+ if (ret[2]) {
7528
+ throw takeFromExternrefTable0(ret[1]);
7529
+ }
7530
+ return Wollet.__wrap(ret[0]);
7531
+ }
7532
+ }
7533
+ if (Symbol.dispose) WolletBuilder.prototype[Symbol.dispose] = WolletBuilder.prototype.free;
7534
+
7535
+ exports.WolletBuilder = WolletBuilder;
7536
+
6686
7537
  const WolletDescriptorFinalization = (typeof FinalizationRegistry === 'undefined')
6687
7538
  ? { register: () => {}, unregister: () => {} }
6688
7539
  : new FinalizationRegistry(ptr => wasm.__wbg_wolletdescriptor_free(ptr >>> 0, 1));
@@ -7077,7 +7928,7 @@ exports.__wbg_get_458e874b43b18b25 = function() { return handleError(function (a
7077
7928
  return ret;
7078
7929
  }, arguments) };
7079
7930
 
7080
- exports.__wbg_get_f73bb45577f88031 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
7931
+ exports.__wbg_get_51efc4293c4dd1d9 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
7081
7932
  const ret = arg1.get(getStringFromWasm0(arg2, arg3));
7082
7933
  var ptr1 = isLikeNone(ret) ? 0 : passArray8ToWasm0(ret, wasm.__wbindgen_malloc);
7083
7934
  var len1 = WASM_VECTOR_LEN;
@@ -7176,6 +8027,11 @@ exports.__wbg_isArray_030cce220591fb41 = function(arg0) {
7176
8027
  return ret;
7177
8028
  };
7178
8029
 
8030
+ exports.__wbg_isPersisted_d5ab844267f1abff = function() { return handleError(function (arg0) {
8031
+ const ret = arg0.isPersisted();
8032
+ return ret;
8033
+ }, arguments) };
8034
+
7179
8035
  exports.__wbg_issuance_new = function(arg0) {
7180
8036
  const ret = Issuance.__wrap(arg0);
7181
8037
  return ret;
@@ -7211,7 +8067,7 @@ exports.__wbg_length_6bb7e81f9d7713e4 = function(arg0) {
7211
8067
  return ret;
7212
8068
  };
7213
8069
 
7214
- exports.__wbg_log_7889594dfd0d33ca = function(arg0, arg1) {
8070
+ exports.__wbg_log_8528632c48f8c6bb = function(arg0, arg1) {
7215
8071
  console.log(getStringFromWasm0(arg0, arg1));
7216
8072
  };
7217
8073
 
@@ -7247,7 +8103,7 @@ exports.__wbg_new_2e3c58a15f39f5f9 = function(arg0, arg1) {
7247
8103
  const a = state0.a;
7248
8104
  state0.a = 0;
7249
8105
  try {
7250
- return __wbg_adapter_678(a, state0.b, arg0, arg1);
8106
+ return __wbg_adapter_735(a, state0.b, arg0, arg1);
7251
8107
  } finally {
7252
8108
  state0.a = a;
7253
8109
  }
@@ -7418,7 +8274,7 @@ exports.__wbg_push_330b2eb93e4e1212 = function(arg0, arg1) {
7418
8274
  return ret;
7419
8275
  };
7420
8276
 
7421
- exports.__wbg_put_cc75277821cdd6b8 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
8277
+ exports.__wbg_put_fe70093a1126561e = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
7422
8278
  arg0.put(getStringFromWasm0(arg1, arg2), getArrayU8FromWasm0(arg3, arg4));
7423
8279
  }, arguments) };
7424
8280
 
@@ -7468,7 +8324,7 @@ exports.__wbg_registry_new = function(arg0) {
7468
8324
  return ret;
7469
8325
  };
7470
8326
 
7471
- exports.__wbg_remove_d275ae23515119c8 = function() { return handleError(function (arg0, arg1, arg2) {
8327
+ exports.__wbg_remove_e4c99b92a84f8bdb = function() { return handleError(function (arg0, arg1, arg2) {
7472
8328
  arg0.remove(getStringFromWasm0(arg1, arg2));
7473
8329
  }, arguments) };
7474
8330
 
@@ -7684,11 +8540,21 @@ exports.__wbg_transaction_new = function(arg0) {
7684
8540
  return ret;
7685
8541
  };
7686
8542
 
8543
+ exports.__wbg_txdetails_new = function(arg0) {
8544
+ const ret = TxDetails.__wrap(arg0);
8545
+ return ret;
8546
+ };
8547
+
7687
8548
  exports.__wbg_txid_new = function(arg0) {
7688
8549
  const ret = Txid.__wrap(arg0);
7689
8550
  return ret;
7690
8551
  };
7691
8552
 
8553
+ exports.__wbg_txoutdetails_new = function(arg0) {
8554
+ const ret = TxOutDetails.__wrap(arg0);
8555
+ return ret;
8556
+ };
8557
+
7692
8558
  exports.__wbg_update_new = function(arg0) {
7693
8559
  const ret = Update.__wrap(arg0);
7694
8560
  return ret;
@@ -7799,9 +8665,15 @@ exports.__wbg_xpub_new = function(arg0) {
7799
8665
  return ret;
7800
8666
  };
7801
8667
 
7802
- exports.__wbindgen_cast_1cc4fdd2f159de97 = function(arg0, arg1) {
7803
- // Cast intrinsic for `Closure(Closure { dtor_idx: 1210, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 1211, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
7804
- const ret = makeMutClosure(arg0, arg1, 1210, __wbg_adapter_9);
8668
+ exports.__wbindgen_cast_05316810ffcd6eb2 = function(arg0, arg1) {
8669
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 1527, function: Function { arguments: [], shim_idx: 1528, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
8670
+ const ret = makeMutClosure(arg0, arg1, 1527, __wbg_adapter_34);
8671
+ return ret;
8672
+ };
8673
+
8674
+ exports.__wbindgen_cast_1321c3200b515ef0 = function(arg0, arg1) {
8675
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 2048, function: Function { arguments: [], shim_idx: 2049, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
8676
+ const ret = makeMutClosure(arg0, arg1, 2048, __wbg_adapter_14);
7805
8677
  return ret;
7806
8678
  };
7807
8679
 
@@ -7811,39 +8683,39 @@ exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
7811
8683
  return ret;
7812
8684
  };
7813
8685
 
7814
- exports.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
7815
- // Cast intrinsic for `U64 -> Externref`.
7816
- const ret = BigInt.asUintN(64, arg0);
8686
+ exports.__wbindgen_cast_2418b153fa6fc211 = function(arg0, arg1) {
8687
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 1234, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 1315, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
8688
+ const ret = makeMutClosure(arg0, arg1, 1234, __wbg_adapter_6);
7817
8689
  return ret;
7818
8690
  };
7819
8691
 
7820
- exports.__wbindgen_cast_4a32eb107c538612 = function(arg0, arg1) {
7821
- // Cast intrinsic for `Closure(Closure { dtor_idx: 854, function: Function { arguments: [NamedExternref("HIDInputReportEvent")], shim_idx: 855, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
7822
- const ret = makeMutClosure(arg0, arg1, 854, __wbg_adapter_28);
8692
+ exports.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
8693
+ // Cast intrinsic for `U64 -> Externref`.
8694
+ const ret = BigInt.asUintN(64, arg0);
7823
8695
  return ret;
7824
8696
  };
7825
8697
 
7826
- exports.__wbindgen_cast_82b35546cfba6ba9 = function(arg0, arg1) {
7827
- // Cast intrinsic for `Closure(Closure { dtor_idx: 1210, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 1211, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
7828
- const ret = makeMutClosure(arg0, arg1, 1210, __wbg_adapter_9);
8698
+ exports.__wbindgen_cast_472e36d4bc1d72dd = function(arg0, arg1) {
8699
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 464, function: Function { arguments: [NamedExternref("HIDInputReportEvent")], shim_idx: 748, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
8700
+ const ret = makeMutClosure(arg0, arg1, 464, __wbg_adapter_11);
7829
8701
  return ret;
7830
8702
  };
7831
8703
 
7832
- exports.__wbindgen_cast_82fca60108194369 = function(arg0, arg1) {
7833
- // Cast intrinsic for `Closure(Closure { dtor_idx: 1467, function: Function { arguments: [], shim_idx: 1468, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
7834
- const ret = makeMutClosure(arg0, arg1, 1467, __wbg_adapter_25);
8704
+ exports.__wbindgen_cast_5fb90d42c153401a = function(arg0, arg1) {
8705
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 1234, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 1315, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
8706
+ const ret = makeMutClosure(arg0, arg1, 1234, __wbg_adapter_6);
7835
8707
  return ret;
7836
8708
  };
7837
8709
 
7838
- exports.__wbindgen_cast_8c9414a833bf848b = function(arg0, arg1) {
7839
- // Cast intrinsic for `Closure(Closure { dtor_idx: 1919, function: Function { arguments: [], shim_idx: 1920, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
7840
- const ret = makeMutClosure(arg0, arg1, 1919, __wbg_adapter_14);
8710
+ exports.__wbindgen_cast_870f30505a964aa4 = function(arg0, arg1) {
8711
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 1234, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 1315, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
8712
+ const ret = makeMutClosure(arg0, arg1, 1234, __wbg_adapter_6);
7841
8713
  return ret;
7842
8714
  };
7843
8715
 
7844
- exports.__wbindgen_cast_95fb92c9f38f0051 = function(arg0, arg1) {
7845
- // Cast intrinsic for `Closure(Closure { dtor_idx: 1954, function: Function { arguments: [Externref], shim_idx: 1965, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
7846
- const ret = makeMutClosure(arg0, arg1, 1954, __wbg_adapter_6);
8716
+ exports.__wbindgen_cast_87b57fd7dc87a7a7 = function(arg0, arg1) {
8717
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 2083, function: Function { arguments: [Externref], shim_idx: 2094, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
8718
+ const ret = makeMutClosure(arg0, arg1, 2083, __wbg_adapter_31);
7847
8719
  return ret;
7848
8720
  };
7849
8721
 
@@ -7853,30 +8725,24 @@ exports.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
7853
8725
  return ret;
7854
8726
  };
7855
8727
 
7856
- exports.__wbindgen_cast_c19f87c9f32561d7 = function(arg0, arg1) {
7857
- // Cast intrinsic for `Closure(Closure { dtor_idx: 1210, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 1211, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
7858
- const ret = makeMutClosure(arg0, arg1, 1210, __wbg_adapter_9);
7859
- return ret;
7860
- };
7861
-
7862
8728
  exports.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
7863
8729
  // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
7864
8730
  const ret = getArrayU8FromWasm0(arg0, arg1);
7865
8731
  return ret;
7866
8732
  };
7867
8733
 
7868
- exports.__wbindgen_cast_d0dca845d4d81404 = function(arg0, arg1) {
7869
- // Cast intrinsic for `Closure(Closure { dtor_idx: 1210, function: Function { arguments: [NamedExternref("Event")], shim_idx: 1211, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
7870
- const ret = makeMutClosure(arg0, arg1, 1210, __wbg_adapter_9);
7871
- return ret;
7872
- };
7873
-
7874
8734
  exports.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
7875
8735
  // Cast intrinsic for `F64 -> Externref`.
7876
8736
  const ret = arg0;
7877
8737
  return ret;
7878
8738
  };
7879
8739
 
8740
+ exports.__wbindgen_cast_df70d36de82e387c = function(arg0, arg1) {
8741
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 1234, function: Function { arguments: [NamedExternref("Event")], shim_idx: 1315, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
8742
+ const ret = makeMutClosure(arg0, arg1, 1234, __wbg_adapter_6);
8743
+ return ret;
8744
+ };
8745
+
7880
8746
  exports.__wbindgen_init_externref_table = function() {
7881
8747
  const table = wasm.__wbindgen_export_4;
7882
8748
  const offset = table.grow(4);