lwk_node 0.16.0 → 0.17.1
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.d.ts +215 -8
- package/lwk_wasm.js +714 -98
- package/lwk_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/lwk_wasm.js
CHANGED
|
@@ -217,27 +217,24 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|
|
217
217
|
return real;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
function takeFromExternrefTable0(idx) {
|
|
221
|
-
const value = wasm.__wbindgen_export_4.get(idx);
|
|
222
|
-
wasm.__externref_table_dealloc(idx);
|
|
223
|
-
return value;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
220
|
function _assertClass(instance, klass) {
|
|
227
221
|
if (!(instance instanceof klass)) {
|
|
228
222
|
throw new Error(`expected instance of ${klass.name}`);
|
|
229
223
|
}
|
|
230
224
|
}
|
|
231
225
|
|
|
232
|
-
function
|
|
233
|
-
const
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
237
|
-
}
|
|
238
|
-
WASM_VECTOR_LEN = array.length;
|
|
239
|
-
return ptr;
|
|
226
|
+
function takeFromExternrefTable0(idx) {
|
|
227
|
+
const value = wasm.__wbindgen_export_4.get(idx);
|
|
228
|
+
wasm.__externref_table_dealloc(idx);
|
|
229
|
+
return value;
|
|
240
230
|
}
|
|
231
|
+
/**
|
|
232
|
+
* @returns {Promise<HIDDevice>}
|
|
233
|
+
*/
|
|
234
|
+
exports.searchLedgerDevice = function() {
|
|
235
|
+
const ret = wasm.searchLedgerDevice();
|
|
236
|
+
return ret;
|
|
237
|
+
};
|
|
241
238
|
|
|
242
239
|
function getArrayJsValueFromWasm0(ptr, len) {
|
|
243
240
|
ptr = ptr >>> 0;
|
|
@@ -265,14 +262,6 @@ function passArray32ToWasm0(arg, malloc) {
|
|
|
265
262
|
WASM_VECTOR_LEN = arg.length;
|
|
266
263
|
return ptr;
|
|
267
264
|
}
|
|
268
|
-
/**
|
|
269
|
-
* @returns {Promise<HIDDevice>}
|
|
270
|
-
*/
|
|
271
|
-
exports.searchLedgerDevice = function() {
|
|
272
|
-
const ret = wasm.searchLedgerDevice();
|
|
273
|
-
return ret;
|
|
274
|
-
};
|
|
275
|
-
|
|
276
265
|
/**
|
|
277
266
|
* Convert the given string to a QR code image uri
|
|
278
267
|
*
|
|
@@ -305,32 +294,42 @@ exports.stringToQr = function(str, pixel_per_module) {
|
|
|
305
294
|
}
|
|
306
295
|
};
|
|
307
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
|
+
|
|
308
307
|
function getArrayU32FromWasm0(ptr, len) {
|
|
309
308
|
ptr = ptr >>> 0;
|
|
310
309
|
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
311
310
|
}
|
|
312
|
-
function
|
|
313
|
-
wasm.
|
|
311
|
+
function __wbg_adapter_6(arg0, arg1, arg2) {
|
|
312
|
+
wasm.closure1312_externref_shim(arg0, arg1, arg2);
|
|
314
313
|
}
|
|
315
314
|
|
|
316
|
-
function
|
|
317
|
-
wasm.
|
|
315
|
+
function __wbg_adapter_9(arg0, arg1) {
|
|
316
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h94f351489121fb87(arg0, arg1);
|
|
318
317
|
}
|
|
319
318
|
|
|
320
|
-
function
|
|
321
|
-
wasm.
|
|
319
|
+
function __wbg_adapter_12(arg0, arg1, arg2) {
|
|
320
|
+
wasm.closure465_externref_shim(arg0, arg1, arg2);
|
|
322
321
|
}
|
|
323
322
|
|
|
324
|
-
function
|
|
325
|
-
wasm.
|
|
323
|
+
function __wbg_adapter_15(arg0, arg1, arg2) {
|
|
324
|
+
wasm.closure2091_externref_shim(arg0, arg1, arg2);
|
|
326
325
|
}
|
|
327
326
|
|
|
328
|
-
function
|
|
329
|
-
wasm.
|
|
327
|
+
function __wbg_adapter_28(arg0, arg1) {
|
|
328
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h912986096667d3cb(arg0, arg1);
|
|
330
329
|
}
|
|
331
330
|
|
|
332
|
-
function
|
|
333
|
-
wasm.
|
|
331
|
+
function __wbg_adapter_736(arg0, arg1, arg2, arg3) {
|
|
332
|
+
wasm.closure2878_externref_shim(arg0, arg1, arg2, arg3);
|
|
334
333
|
}
|
|
335
334
|
|
|
336
335
|
/**
|
|
@@ -762,7 +761,12 @@ class Amp0Connected {
|
|
|
762
761
|
wasm.__wbg_amp0connected_free(ptr, 0);
|
|
763
762
|
}
|
|
764
763
|
/**
|
|
765
|
-
* 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.
|
|
766
770
|
* @param {Network} network
|
|
767
771
|
* @param {Amp0SignerData} signer_data
|
|
768
772
|
*/
|
|
@@ -772,6 +776,18 @@ class Amp0Connected {
|
|
|
772
776
|
const ret = wasm.amp0connected_new(network.__wbg_ptr, signer_data.__wbg_ptr);
|
|
773
777
|
return ret;
|
|
774
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
|
+
}
|
|
775
791
|
/**
|
|
776
792
|
* Obtain a login challenge
|
|
777
793
|
*
|
|
@@ -1020,6 +1036,26 @@ class Amp2 {
|
|
|
1020
1036
|
const ptr = this.__destroy_into_raw();
|
|
1021
1037
|
wasm.__wbg_amp2_free(ptr, 0);
|
|
1022
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
|
+
}
|
|
1023
1059
|
/**
|
|
1024
1060
|
* Create a new AMP2 client with the default url and server key for the testnet network.
|
|
1025
1061
|
* @returns {Amp2}
|
|
@@ -1031,12 +1067,15 @@ class Amp2 {
|
|
|
1031
1067
|
/**
|
|
1032
1068
|
* Get an AMP2 wallet descriptor from the keyorigin xpub string obtained from a signer
|
|
1033
1069
|
* @param {string} keyorigin_xpub
|
|
1070
|
+
* @param {string} descriptor_blinding_key
|
|
1034
1071
|
* @returns {Amp2Descriptor}
|
|
1035
1072
|
*/
|
|
1036
|
-
descriptorFromStr(keyorigin_xpub) {
|
|
1073
|
+
descriptorFromStr(keyorigin_xpub, descriptor_blinding_key) {
|
|
1037
1074
|
const ptr0 = passStringToWasm0(keyorigin_xpub, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1038
1075
|
const len0 = WASM_VECTOR_LEN;
|
|
1039
|
-
const
|
|
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);
|
|
1040
1079
|
if (ret[2]) {
|
|
1041
1080
|
throw takeFromExternrefTable0(ret[1]);
|
|
1042
1081
|
}
|
|
@@ -2575,12 +2614,31 @@ class Jade {
|
|
|
2575
2614
|
*
|
|
2576
2615
|
* When filter is true, it will filter available serial with Blockstream released chips, use
|
|
2577
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.
|
|
2578
2622
|
* @param {Network} network
|
|
2579
2623
|
* @param {boolean} filter
|
|
2580
2624
|
*/
|
|
2581
2625
|
constructor(network, filter) {
|
|
2582
2626
|
_assertClass(network, Network);
|
|
2583
|
-
const ret = wasm.
|
|
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);
|
|
2584
2642
|
return ret;
|
|
2585
2643
|
}
|
|
2586
2644
|
/**
|
|
@@ -2729,6 +2787,11 @@ class JadeWebSocket {
|
|
|
2729
2787
|
* Creates a Jade from WebSocket for the given network
|
|
2730
2788
|
*
|
|
2731
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.
|
|
2732
2795
|
* @param {Network} network
|
|
2733
2796
|
* @param {string} url
|
|
2734
2797
|
*/
|
|
@@ -2736,7 +2799,22 @@ class JadeWebSocket {
|
|
|
2736
2799
|
_assertClass(network, Network);
|
|
2737
2800
|
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2738
2801
|
const len0 = WASM_VECTOR_LEN;
|
|
2739
|
-
const ret = wasm.
|
|
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);
|
|
2740
2818
|
return ret;
|
|
2741
2819
|
}
|
|
2742
2820
|
/**
|
|
@@ -2876,7 +2954,8 @@ class JsStoreLink {
|
|
|
2876
2954
|
/**
|
|
2877
2955
|
* Create a new `JsStoreLink` from a JavaScript storage object.
|
|
2878
2956
|
*
|
|
2879
|
-
* The JS object must have `get(key)`, `put(key, value)`,
|
|
2957
|
+
* The JS object must have `get(key)`, `put(key, value)`, `remove(key)`,
|
|
2958
|
+
* and `isPersisted()` methods.
|
|
2880
2959
|
* @param {any} storage
|
|
2881
2960
|
*/
|
|
2882
2961
|
constructor(storage) {
|
|
@@ -4180,6 +4259,17 @@ class Pset {
|
|
|
4180
4259
|
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
4181
4260
|
return v1;
|
|
4182
4261
|
}
|
|
4262
|
+
/**
|
|
4263
|
+
* Add wallet details to this PSET in place
|
|
4264
|
+
* @param {Wollet} wollet
|
|
4265
|
+
*/
|
|
4266
|
+
addDetails(wollet) {
|
|
4267
|
+
_assertClass(wollet, Wollet);
|
|
4268
|
+
const ret = wasm.pset_addDetails(this.__wbg_ptr, wollet.__wbg_ptr);
|
|
4269
|
+
if (ret[1]) {
|
|
4270
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
4271
|
+
}
|
|
4272
|
+
}
|
|
4183
4273
|
}
|
|
4184
4274
|
if (Symbol.dispose) Pset.prototype[Symbol.dispose] = Pset.prototype.free;
|
|
4185
4275
|
|
|
@@ -5664,9 +5754,8 @@ class TxBuilder {
|
|
|
5664
5754
|
addExplicitRecipient(address, satoshi, asset) {
|
|
5665
5755
|
const ptr = this.__destroy_into_raw();
|
|
5666
5756
|
_assertClass(address, Address);
|
|
5667
|
-
var ptr0 = address.__destroy_into_raw();
|
|
5668
5757
|
_assertClass(asset, AssetId);
|
|
5669
|
-
const ret = wasm.txbuilder_addExplicitRecipient(ptr,
|
|
5758
|
+
const ret = wasm.txbuilder_addExplicitRecipient(ptr, address.__wbg_ptr, satoshi, asset.__wbg_ptr);
|
|
5670
5759
|
if (ret[2]) {
|
|
5671
5760
|
throw takeFromExternrefTable0(ret[1]);
|
|
5672
5761
|
}
|
|
@@ -5736,18 +5825,17 @@ class TxBuilder {
|
|
|
5736
5825
|
reissueAsset(asset_to_reissue, satoshi_to_reissue, asset_receiver, issuance_tx) {
|
|
5737
5826
|
const ptr = this.__destroy_into_raw();
|
|
5738
5827
|
_assertClass(asset_to_reissue, AssetId);
|
|
5739
|
-
|
|
5740
|
-
let ptr1 = 0;
|
|
5828
|
+
let ptr0 = 0;
|
|
5741
5829
|
if (!isLikeNone(asset_receiver)) {
|
|
5742
5830
|
_assertClass(asset_receiver, Address);
|
|
5743
|
-
|
|
5831
|
+
ptr0 = asset_receiver.__destroy_into_raw();
|
|
5744
5832
|
}
|
|
5745
|
-
let
|
|
5833
|
+
let ptr1 = 0;
|
|
5746
5834
|
if (!isLikeNone(issuance_tx)) {
|
|
5747
5835
|
_assertClass(issuance_tx, Transaction);
|
|
5748
|
-
|
|
5836
|
+
ptr1 = issuance_tx.__destroy_into_raw();
|
|
5749
5837
|
}
|
|
5750
|
-
const ret = wasm.txbuilder_reissueAsset(ptr,
|
|
5838
|
+
const ret = wasm.txbuilder_reissueAsset(ptr, asset_to_reissue.__wbg_ptr, satoshi_to_reissue, ptr0, ptr1);
|
|
5751
5839
|
if (ret[2]) {
|
|
5752
5840
|
throw takeFromExternrefTable0(ret[1]);
|
|
5753
5841
|
}
|
|
@@ -5803,12 +5891,9 @@ class TxBuilder {
|
|
|
5803
5891
|
liquidexMake(utxo, address, satoshi, asset_id) {
|
|
5804
5892
|
const ptr = this.__destroy_into_raw();
|
|
5805
5893
|
_assertClass(utxo, OutPoint);
|
|
5806
|
-
var ptr0 = utxo.__destroy_into_raw();
|
|
5807
5894
|
_assertClass(address, Address);
|
|
5808
|
-
var ptr1 = address.__destroy_into_raw();
|
|
5809
5895
|
_assertClass(asset_id, AssetId);
|
|
5810
|
-
|
|
5811
|
-
const ret = wasm.txbuilder_liquidexMake(ptr, ptr0, ptr1, satoshi, ptr2);
|
|
5896
|
+
const ret = wasm.txbuilder_liquidexMake(ptr, utxo.__wbg_ptr, address.__wbg_ptr, satoshi, asset_id.__wbg_ptr);
|
|
5812
5897
|
if (ret[2]) {
|
|
5813
5898
|
throw takeFromExternrefTable0(ret[1]);
|
|
5814
5899
|
}
|
|
@@ -5844,6 +5929,286 @@ if (Symbol.dispose) TxBuilder.prototype[Symbol.dispose] = TxBuilder.prototype.fr
|
|
|
5844
5929
|
|
|
5845
5930
|
exports.TxBuilder = TxBuilder;
|
|
5846
5931
|
|
|
5932
|
+
const TxDetailsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5933
|
+
? { register: () => {}, unregister: () => {} }
|
|
5934
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_txdetails_free(ptr >>> 0, 1));
|
|
5935
|
+
/**
|
|
5936
|
+
* Transaction details
|
|
5937
|
+
*/
|
|
5938
|
+
class TxDetails {
|
|
5939
|
+
|
|
5940
|
+
static __wrap(ptr) {
|
|
5941
|
+
ptr = ptr >>> 0;
|
|
5942
|
+
const obj = Object.create(TxDetails.prototype);
|
|
5943
|
+
obj.__wbg_ptr = ptr;
|
|
5944
|
+
TxDetailsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
5945
|
+
return obj;
|
|
5946
|
+
}
|
|
5947
|
+
|
|
5948
|
+
__destroy_into_raw() {
|
|
5949
|
+
const ptr = this.__wbg_ptr;
|
|
5950
|
+
this.__wbg_ptr = 0;
|
|
5951
|
+
TxDetailsFinalization.unregister(this);
|
|
5952
|
+
return ptr;
|
|
5953
|
+
}
|
|
5954
|
+
|
|
5955
|
+
free() {
|
|
5956
|
+
const ptr = this.__destroy_into_raw();
|
|
5957
|
+
wasm.__wbg_txdetails_free(ptr, 0);
|
|
5958
|
+
}
|
|
5959
|
+
/**
|
|
5960
|
+
* Transaction
|
|
5961
|
+
* @returns {Transaction | undefined}
|
|
5962
|
+
*/
|
|
5963
|
+
tx() {
|
|
5964
|
+
const ret = wasm.txdetails_tx(this.__wbg_ptr);
|
|
5965
|
+
return ret === 0 ? undefined : Transaction.__wrap(ret);
|
|
5966
|
+
}
|
|
5967
|
+
/**
|
|
5968
|
+
* Txid
|
|
5969
|
+
* @returns {Txid}
|
|
5970
|
+
*/
|
|
5971
|
+
txid() {
|
|
5972
|
+
const ret = wasm.txdetails_txid(this.__wbg_ptr);
|
|
5973
|
+
return Txid.__wrap(ret);
|
|
5974
|
+
}
|
|
5975
|
+
/**
|
|
5976
|
+
* Blockchain height
|
|
5977
|
+
* @returns {number | undefined}
|
|
5978
|
+
*/
|
|
5979
|
+
height() {
|
|
5980
|
+
const ret = wasm.txdetails_height(this.__wbg_ptr);
|
|
5981
|
+
return ret === 0x100000001 ? undefined : ret;
|
|
5982
|
+
}
|
|
5983
|
+
/**
|
|
5984
|
+
* Timestamp
|
|
5985
|
+
*
|
|
5986
|
+
* A reasonable timestamp, that however can be inaccurate.
|
|
5987
|
+
* If you need a precise timestamp, do not use this value.
|
|
5988
|
+
* @returns {number | undefined}
|
|
5989
|
+
*/
|
|
5990
|
+
timestamp() {
|
|
5991
|
+
const ret = wasm.txdetails_timestamp(this.__wbg_ptr);
|
|
5992
|
+
return ret === 0x100000001 ? undefined : ret;
|
|
5993
|
+
}
|
|
5994
|
+
/**
|
|
5995
|
+
* Transaction type
|
|
5996
|
+
*
|
|
5997
|
+
* A tentative description of the transaction type, which
|
|
5998
|
+
* however might be inaccurate. Use this if you want a simple
|
|
5999
|
+
* description of what this transaction is doing, but do
|
|
6000
|
+
* not rely on the value returned.
|
|
6001
|
+
* @returns {string}
|
|
6002
|
+
*/
|
|
6003
|
+
txType() {
|
|
6004
|
+
let deferred1_0;
|
|
6005
|
+
let deferred1_1;
|
|
6006
|
+
try {
|
|
6007
|
+
const ret = wasm.txdetails_txType(this.__wbg_ptr);
|
|
6008
|
+
deferred1_0 = ret[0];
|
|
6009
|
+
deferred1_1 = ret[1];
|
|
6010
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
6011
|
+
} finally {
|
|
6012
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
6013
|
+
}
|
|
6014
|
+
}
|
|
6015
|
+
/**
|
|
6016
|
+
* Balance
|
|
6017
|
+
*
|
|
6018
|
+
* Net balance from the `Wollet` perspective
|
|
6019
|
+
* @returns {Balance}
|
|
6020
|
+
*/
|
|
6021
|
+
balance() {
|
|
6022
|
+
const ret = wasm.txdetails_balance(this.__wbg_ptr);
|
|
6023
|
+
return Balance.__wrap(ret);
|
|
6024
|
+
}
|
|
6025
|
+
/**
|
|
6026
|
+
* Asset fees
|
|
6027
|
+
* @param {AssetId} asset
|
|
6028
|
+
* @returns {bigint}
|
|
6029
|
+
*/
|
|
6030
|
+
feesAsset(asset) {
|
|
6031
|
+
_assertClass(asset, AssetId);
|
|
6032
|
+
const ret = wasm.txdetails_feesAsset(this.__wbg_ptr, asset.__wbg_ptr);
|
|
6033
|
+
return BigInt.asUintN(64, ret);
|
|
6034
|
+
}
|
|
6035
|
+
/**
|
|
6036
|
+
* Unblinded URL
|
|
6037
|
+
* @param {string} explorer_url
|
|
6038
|
+
* @returns {string}
|
|
6039
|
+
*/
|
|
6040
|
+
unblindedUrl(explorer_url) {
|
|
6041
|
+
let deferred2_0;
|
|
6042
|
+
let deferred2_1;
|
|
6043
|
+
try {
|
|
6044
|
+
const ptr0 = passStringToWasm0(explorer_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
6045
|
+
const len0 = WASM_VECTOR_LEN;
|
|
6046
|
+
const ret = wasm.txdetails_unblindedUrl(this.__wbg_ptr, ptr0, len0);
|
|
6047
|
+
deferred2_0 = ret[0];
|
|
6048
|
+
deferred2_1 = ret[1];
|
|
6049
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
6050
|
+
} finally {
|
|
6051
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
6052
|
+
}
|
|
6053
|
+
}
|
|
6054
|
+
/**
|
|
6055
|
+
* Inputs
|
|
6056
|
+
* @returns {TxOutDetails[]}
|
|
6057
|
+
*/
|
|
6058
|
+
inputs() {
|
|
6059
|
+
const ret = wasm.txdetails_inputs(this.__wbg_ptr);
|
|
6060
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
6061
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
6062
|
+
return v1;
|
|
6063
|
+
}
|
|
6064
|
+
/**
|
|
6065
|
+
* Outputs
|
|
6066
|
+
* @returns {TxOutDetails[]}
|
|
6067
|
+
*/
|
|
6068
|
+
outputs() {
|
|
6069
|
+
const ret = wasm.txdetails_outputs(this.__wbg_ptr);
|
|
6070
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
6071
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
6072
|
+
return v1;
|
|
6073
|
+
}
|
|
6074
|
+
}
|
|
6075
|
+
if (Symbol.dispose) TxDetails.prototype[Symbol.dispose] = TxDetails.prototype.free;
|
|
6076
|
+
|
|
6077
|
+
exports.TxDetails = TxDetails;
|
|
6078
|
+
|
|
6079
|
+
const TxOptFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6080
|
+
? { register: () => {}, unregister: () => {} }
|
|
6081
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_txopt_free(ptr >>> 0, 1));
|
|
6082
|
+
/**
|
|
6083
|
+
* Options for transaction details
|
|
6084
|
+
*/
|
|
6085
|
+
class TxOpt {
|
|
6086
|
+
|
|
6087
|
+
static __wrap(ptr) {
|
|
6088
|
+
ptr = ptr >>> 0;
|
|
6089
|
+
const obj = Object.create(TxOpt.prototype);
|
|
6090
|
+
obj.__wbg_ptr = ptr;
|
|
6091
|
+
TxOptFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
6092
|
+
return obj;
|
|
6093
|
+
}
|
|
6094
|
+
|
|
6095
|
+
__destroy_into_raw() {
|
|
6096
|
+
const ptr = this.__wbg_ptr;
|
|
6097
|
+
this.__wbg_ptr = 0;
|
|
6098
|
+
TxOptFinalization.unregister(this);
|
|
6099
|
+
return ptr;
|
|
6100
|
+
}
|
|
6101
|
+
|
|
6102
|
+
free() {
|
|
6103
|
+
const ptr = this.__destroy_into_raw();
|
|
6104
|
+
wasm.__wbg_txopt_free(ptr, 0);
|
|
6105
|
+
}
|
|
6106
|
+
/**
|
|
6107
|
+
* @returns {TxOpt}
|
|
6108
|
+
*/
|
|
6109
|
+
static default() {
|
|
6110
|
+
const ret = wasm.txopt_default();
|
|
6111
|
+
return TxOpt.__wrap(ret);
|
|
6112
|
+
}
|
|
6113
|
+
}
|
|
6114
|
+
if (Symbol.dispose) TxOpt.prototype[Symbol.dispose] = TxOpt.prototype.free;
|
|
6115
|
+
|
|
6116
|
+
exports.TxOpt = TxOpt;
|
|
6117
|
+
|
|
6118
|
+
const TxOutDetailsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6119
|
+
? { register: () => {}, unregister: () => {} }
|
|
6120
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_txoutdetails_free(ptr >>> 0, 1));
|
|
6121
|
+
/**
|
|
6122
|
+
* Transaction output details
|
|
6123
|
+
*/
|
|
6124
|
+
class TxOutDetails {
|
|
6125
|
+
|
|
6126
|
+
static __wrap(ptr) {
|
|
6127
|
+
ptr = ptr >>> 0;
|
|
6128
|
+
const obj = Object.create(TxOutDetails.prototype);
|
|
6129
|
+
obj.__wbg_ptr = ptr;
|
|
6130
|
+
TxOutDetailsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
6131
|
+
return obj;
|
|
6132
|
+
}
|
|
6133
|
+
|
|
6134
|
+
__destroy_into_raw() {
|
|
6135
|
+
const ptr = this.__wbg_ptr;
|
|
6136
|
+
this.__wbg_ptr = 0;
|
|
6137
|
+
TxOutDetailsFinalization.unregister(this);
|
|
6138
|
+
return ptr;
|
|
6139
|
+
}
|
|
6140
|
+
|
|
6141
|
+
free() {
|
|
6142
|
+
const ptr = this.__destroy_into_raw();
|
|
6143
|
+
wasm.__wbg_txoutdetails_free(ptr, 0);
|
|
6144
|
+
}
|
|
6145
|
+
/**
|
|
6146
|
+
* Outpoint
|
|
6147
|
+
* @returns {OutPoint}
|
|
6148
|
+
*/
|
|
6149
|
+
outpoint() {
|
|
6150
|
+
const ret = wasm.txoutdetails_outpoint(this.__wbg_ptr);
|
|
6151
|
+
return OutPoint.__wrap(ret);
|
|
6152
|
+
}
|
|
6153
|
+
/**
|
|
6154
|
+
* Scriptpubkey
|
|
6155
|
+
* @returns {Script | undefined}
|
|
6156
|
+
*/
|
|
6157
|
+
script_pubkey() {
|
|
6158
|
+
const ret = wasm.txoutdetails_script_pubkey(this.__wbg_ptr);
|
|
6159
|
+
return ret === 0 ? undefined : Script.__wrap(ret);
|
|
6160
|
+
}
|
|
6161
|
+
/**
|
|
6162
|
+
* Height
|
|
6163
|
+
* @returns {number | undefined}
|
|
6164
|
+
*/
|
|
6165
|
+
height() {
|
|
6166
|
+
const ret = wasm.txoutdetails_height(this.__wbg_ptr);
|
|
6167
|
+
return ret === 0x100000001 ? undefined : ret;
|
|
6168
|
+
}
|
|
6169
|
+
/**
|
|
6170
|
+
* Address
|
|
6171
|
+
* @returns {Address | undefined}
|
|
6172
|
+
*/
|
|
6173
|
+
address() {
|
|
6174
|
+
const ret = wasm.txoutdetails_address(this.__wbg_ptr);
|
|
6175
|
+
return ret === 0 ? undefined : Address.__wrap(ret);
|
|
6176
|
+
}
|
|
6177
|
+
/**
|
|
6178
|
+
* Unblinded values (asset, amount, blinders)
|
|
6179
|
+
* @returns {TxOutSecrets | undefined}
|
|
6180
|
+
*/
|
|
6181
|
+
unblinded() {
|
|
6182
|
+
const ret = wasm.txoutdetails_unblinded(this.__wbg_ptr);
|
|
6183
|
+
return ret === 0 ? undefined : TxOutSecrets.__wrap(ret);
|
|
6184
|
+
}
|
|
6185
|
+
/**
|
|
6186
|
+
* Whether the transaction output is explicit
|
|
6187
|
+
* @returns {boolean}
|
|
6188
|
+
*/
|
|
6189
|
+
is_explicit() {
|
|
6190
|
+
const ret = wasm.txoutdetails_is_explicit(this.__wbg_ptr);
|
|
6191
|
+
return ret !== 0;
|
|
6192
|
+
}
|
|
6193
|
+
/**
|
|
6194
|
+
* Whether the output is spent by a previously downloaded transaction
|
|
6195
|
+
*
|
|
6196
|
+
* Note: this value might be inaccurate. We compute this from downloaded
|
|
6197
|
+
* transactions, however we only download transactions relevant for the
|
|
6198
|
+
* wallet (i.e. if they include inputs or outputs that belong to the
|
|
6199
|
+
* wallet), thus for non-wallet outputs we might set this value
|
|
6200
|
+
* incorrectly. For wallet outputs, it can be outdated.
|
|
6201
|
+
* @returns {boolean}
|
|
6202
|
+
*/
|
|
6203
|
+
is_spent() {
|
|
6204
|
+
const ret = wasm.txoutdetails_is_spent(this.__wbg_ptr);
|
|
6205
|
+
return ret !== 0;
|
|
6206
|
+
}
|
|
6207
|
+
}
|
|
6208
|
+
if (Symbol.dispose) TxOutDetails.prototype[Symbol.dispose] = TxOutDetails.prototype.free;
|
|
6209
|
+
|
|
6210
|
+
exports.TxOutDetails = TxOutDetails;
|
|
6211
|
+
|
|
5847
6212
|
const TxOutSecretsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5848
6213
|
? { register: () => {}, unregister: () => {} }
|
|
5849
6214
|
: new FinalizationRegistry(ptr => wasm.__wbg_txoutsecrets_free(ptr >>> 0, 1));
|
|
@@ -6031,6 +6396,54 @@ if (Symbol.dispose) Txid.prototype[Symbol.dispose] = Txid.prototype.free;
|
|
|
6031
6396
|
|
|
6032
6397
|
exports.Txid = Txid;
|
|
6033
6398
|
|
|
6399
|
+
const TxsOptFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6400
|
+
? { register: () => {}, unregister: () => {} }
|
|
6401
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_txsopt_free(ptr >>> 0, 1));
|
|
6402
|
+
/**
|
|
6403
|
+
* Options for transaction details
|
|
6404
|
+
*/
|
|
6405
|
+
class TxsOpt {
|
|
6406
|
+
|
|
6407
|
+
static __wrap(ptr) {
|
|
6408
|
+
ptr = ptr >>> 0;
|
|
6409
|
+
const obj = Object.create(TxsOpt.prototype);
|
|
6410
|
+
obj.__wbg_ptr = ptr;
|
|
6411
|
+
TxsOptFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
6412
|
+
return obj;
|
|
6413
|
+
}
|
|
6414
|
+
|
|
6415
|
+
__destroy_into_raw() {
|
|
6416
|
+
const ptr = this.__wbg_ptr;
|
|
6417
|
+
this.__wbg_ptr = 0;
|
|
6418
|
+
TxsOptFinalization.unregister(this);
|
|
6419
|
+
return ptr;
|
|
6420
|
+
}
|
|
6421
|
+
|
|
6422
|
+
free() {
|
|
6423
|
+
const ptr = this.__destroy_into_raw();
|
|
6424
|
+
wasm.__wbg_txsopt_free(ptr, 0);
|
|
6425
|
+
}
|
|
6426
|
+
/**
|
|
6427
|
+
* @returns {TxsOpt}
|
|
6428
|
+
*/
|
|
6429
|
+
static default() {
|
|
6430
|
+
const ret = wasm.txsopt_default();
|
|
6431
|
+
return TxsOpt.__wrap(ret);
|
|
6432
|
+
}
|
|
6433
|
+
/**
|
|
6434
|
+
* @param {number} offset
|
|
6435
|
+
* @param {number} limit
|
|
6436
|
+
* @returns {TxsOpt}
|
|
6437
|
+
*/
|
|
6438
|
+
static withPagination(offset, limit) {
|
|
6439
|
+
const ret = wasm.txsopt_withPagination(offset, limit);
|
|
6440
|
+
return TxsOpt.__wrap(ret);
|
|
6441
|
+
}
|
|
6442
|
+
}
|
|
6443
|
+
if (Symbol.dispose) TxsOpt.prototype[Symbol.dispose] = TxsOpt.prototype.free;
|
|
6444
|
+
|
|
6445
|
+
exports.TxsOpt = TxsOpt;
|
|
6446
|
+
|
|
6034
6447
|
const UnvalidatedLiquidexProposalFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6035
6448
|
? { register: () => {}, unregister: () => {} }
|
|
6036
6449
|
: new FinalizationRegistry(ptr => wasm.__wbg_unvalidatedliquidexproposal_free(ptr >>> 0, 1));
|
|
@@ -6682,6 +7095,51 @@ class Wollet {
|
|
|
6682
7095
|
const ptr = this.__destroy_into_raw();
|
|
6683
7096
|
wasm.__wbg_wollet_free(ptr, 0);
|
|
6684
7097
|
}
|
|
7098
|
+
/**
|
|
7099
|
+
* Get the transaction list
|
|
7100
|
+
*
|
|
7101
|
+
* **Experimental**: This API may change without notice.
|
|
7102
|
+
* @param {TxsOpt} opt
|
|
7103
|
+
* @returns {TxDetails[]}
|
|
7104
|
+
*/
|
|
7105
|
+
txs(opt) {
|
|
7106
|
+
_assertClass(opt, TxsOpt);
|
|
7107
|
+
const ret = wasm.wollet_txs(this.__wbg_ptr, opt.__wbg_ptr);
|
|
7108
|
+
if (ret[3]) {
|
|
7109
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
7110
|
+
}
|
|
7111
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
7112
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
7113
|
+
return v1;
|
|
7114
|
+
}
|
|
7115
|
+
/**
|
|
7116
|
+
* Number of transactions
|
|
7117
|
+
* @returns {number}
|
|
7118
|
+
*/
|
|
7119
|
+
numTxs() {
|
|
7120
|
+
const ret = wasm.wollet_numTxs(this.__wbg_ptr);
|
|
7121
|
+
if (ret[2]) {
|
|
7122
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
7123
|
+
}
|
|
7124
|
+
return ret[0] >>> 0;
|
|
7125
|
+
}
|
|
7126
|
+
/**
|
|
7127
|
+
* Get the details of a transaction
|
|
7128
|
+
*
|
|
7129
|
+
* **Experimental**: This API may change without notice.
|
|
7130
|
+
* @param {Txid} txid
|
|
7131
|
+
* @param {TxOpt} opt
|
|
7132
|
+
* @returns {TxDetails | undefined}
|
|
7133
|
+
*/
|
|
7134
|
+
txDetails(txid, opt) {
|
|
7135
|
+
_assertClass(txid, Txid);
|
|
7136
|
+
_assertClass(opt, TxOpt);
|
|
7137
|
+
const ret = wasm.wollet_txDetails(this.__wbg_ptr, txid.__wbg_ptr, opt.__wbg_ptr);
|
|
7138
|
+
if (ret[2]) {
|
|
7139
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
7140
|
+
}
|
|
7141
|
+
return ret[0] === 0 ? undefined : TxDetails.__wrap(ret[0]);
|
|
7142
|
+
}
|
|
6685
7143
|
/**
|
|
6686
7144
|
* Create a `Wollet`
|
|
6687
7145
|
* @param {Network} network
|
|
@@ -6826,7 +7284,7 @@ class Wollet {
|
|
|
6826
7284
|
return AssetIds.__wrap(ret[0]);
|
|
6827
7285
|
}
|
|
6828
7286
|
/**
|
|
6829
|
-
* Get the wallet transactions
|
|
7287
|
+
* Get the wallet transactions, sorted by height descending, then txid descending with unconfirmed first
|
|
6830
7288
|
* @returns {WalletTx[]}
|
|
6831
7289
|
*/
|
|
6832
7290
|
transactions() {
|
|
@@ -6838,6 +7296,21 @@ class Wollet {
|
|
|
6838
7296
|
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
6839
7297
|
return v1;
|
|
6840
7298
|
}
|
|
7299
|
+
/**
|
|
7300
|
+
* Get the wallet transactions with pagination sorted by height descending, then txid descending with unconfirmed first
|
|
7301
|
+
* @param {number} offset
|
|
7302
|
+
* @param {number} limit
|
|
7303
|
+
* @returns {WalletTx[]}
|
|
7304
|
+
*/
|
|
7305
|
+
transactionsPaginated(offset, limit) {
|
|
7306
|
+
const ret = wasm.wollet_transactionsPaginated(this.__wbg_ptr, offset, limit);
|
|
7307
|
+
if (ret[3]) {
|
|
7308
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
7309
|
+
}
|
|
7310
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
7311
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
7312
|
+
return v1;
|
|
7313
|
+
}
|
|
6841
7314
|
/**
|
|
6842
7315
|
* Get the unspent transaction outputs of the wallet
|
|
6843
7316
|
* @returns {WalletTxOut[]}
|
|
@@ -6944,6 +7417,134 @@ if (Symbol.dispose) Wollet.prototype[Symbol.dispose] = Wollet.prototype.free;
|
|
|
6944
7417
|
|
|
6945
7418
|
exports.Wollet = Wollet;
|
|
6946
7419
|
|
|
7420
|
+
const WolletBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
7421
|
+
? { register: () => {}, unregister: () => {} }
|
|
7422
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wolletbuilder_free(ptr >>> 0, 1));
|
|
7423
|
+
/**
|
|
7424
|
+
* A builder for constructing [`Wollet`] instances.
|
|
7425
|
+
*/
|
|
7426
|
+
class WolletBuilder {
|
|
7427
|
+
|
|
7428
|
+
static __wrap(ptr) {
|
|
7429
|
+
ptr = ptr >>> 0;
|
|
7430
|
+
const obj = Object.create(WolletBuilder.prototype);
|
|
7431
|
+
obj.__wbg_ptr = ptr;
|
|
7432
|
+
WolletBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
7433
|
+
return obj;
|
|
7434
|
+
}
|
|
7435
|
+
|
|
7436
|
+
__destroy_into_raw() {
|
|
7437
|
+
const ptr = this.__wbg_ptr;
|
|
7438
|
+
this.__wbg_ptr = 0;
|
|
7439
|
+
WolletBuilderFinalization.unregister(this);
|
|
7440
|
+
return ptr;
|
|
7441
|
+
}
|
|
7442
|
+
|
|
7443
|
+
free() {
|
|
7444
|
+
const ptr = this.__destroy_into_raw();
|
|
7445
|
+
wasm.__wbg_wolletbuilder_free(ptr, 0);
|
|
7446
|
+
}
|
|
7447
|
+
/**
|
|
7448
|
+
* Create a builder for a watch-only wallet.
|
|
7449
|
+
* @param {Network} network
|
|
7450
|
+
* @param {WolletDescriptor} descriptor
|
|
7451
|
+
*/
|
|
7452
|
+
constructor(network, descriptor) {
|
|
7453
|
+
_assertClass(network, Network);
|
|
7454
|
+
_assertClass(descriptor, WolletDescriptor);
|
|
7455
|
+
const ret = wasm.wolletbuilder_new(network.__wbg_ptr, descriptor.__wbg_ptr);
|
|
7456
|
+
this.__wbg_ptr = ret >>> 0;
|
|
7457
|
+
WolletBuilderFinalization.register(this, this.__wbg_ptr, this);
|
|
7458
|
+
return this;
|
|
7459
|
+
}
|
|
7460
|
+
/**
|
|
7461
|
+
* Set the threshold used to merge persisted updates during build.
|
|
7462
|
+
*
|
|
7463
|
+
* **Experimental**: This API may change without notice.
|
|
7464
|
+
*
|
|
7465
|
+
* `None` disables merging (default behavior).
|
|
7466
|
+
* @param {number | null} [merge_threshold]
|
|
7467
|
+
* @returns {WolletBuilder}
|
|
7468
|
+
*/
|
|
7469
|
+
withMergeThreshold(merge_threshold) {
|
|
7470
|
+
const ptr = this.__destroy_into_raw();
|
|
7471
|
+
const ret = wasm.wolletbuilder_withMergeThreshold(ptr, isLikeNone(merge_threshold) ? 0x100000001 : (merge_threshold) >>> 0);
|
|
7472
|
+
return WolletBuilder.__wrap(ret);
|
|
7473
|
+
}
|
|
7474
|
+
/**
|
|
7475
|
+
* Set the wallet as "utxo only".
|
|
7476
|
+
*
|
|
7477
|
+
* **Experimental**: This API may change without notice.
|
|
7478
|
+
* @param {boolean} utxo_only
|
|
7479
|
+
* @returns {WolletBuilder}
|
|
7480
|
+
*/
|
|
7481
|
+
utxoOnly(utxo_only) {
|
|
7482
|
+
const ptr = this.__destroy_into_raw();
|
|
7483
|
+
const ret = wasm.wolletbuilder_utxoOnly(ptr, utxo_only);
|
|
7484
|
+
return WolletBuilder.__wrap(ret);
|
|
7485
|
+
}
|
|
7486
|
+
/**
|
|
7487
|
+
* Persist wallet updates in the given JavaScript storage object.
|
|
7488
|
+
*
|
|
7489
|
+
* **Experimental**: This API may change without notice.
|
|
7490
|
+
*
|
|
7491
|
+
* Wallet data is persisted in clear.
|
|
7492
|
+
*
|
|
7493
|
+
* The JS object must have `get(key)`, `put(key, value)`, and `remove(key)` methods.
|
|
7494
|
+
* @param {any} storage
|
|
7495
|
+
* @returns {WolletBuilder}
|
|
7496
|
+
*/
|
|
7497
|
+
withExperimentalStore(storage) {
|
|
7498
|
+
const ptr = this.__destroy_into_raw();
|
|
7499
|
+
const ret = wasm.wolletbuilder_withExperimentalStore(ptr, storage);
|
|
7500
|
+
return WolletBuilder.__wrap(ret);
|
|
7501
|
+
}
|
|
7502
|
+
/**
|
|
7503
|
+
* Persist wallet transactions in the given JavaScript
|
|
7504
|
+
* storage object.
|
|
7505
|
+
*
|
|
7506
|
+
* **Experimental**: This API may change without notice.
|
|
7507
|
+
*
|
|
7508
|
+
* The JS object must have `get(key)`, `put(key, value)`, and `remove(key)` methods.
|
|
7509
|
+
* @param {any} storage
|
|
7510
|
+
* @returns {WolletBuilder}
|
|
7511
|
+
*/
|
|
7512
|
+
withTxsStore(storage) {
|
|
7513
|
+
const ptr = this.__destroy_into_raw();
|
|
7514
|
+
const ret = wasm.wolletbuilder_withTxsStore(ptr, storage);
|
|
7515
|
+
return WolletBuilder.__wrap(ret);
|
|
7516
|
+
}
|
|
7517
|
+
/**
|
|
7518
|
+
* Set encryption for the transactions store.
|
|
7519
|
+
*
|
|
7520
|
+
* **Experimental**: This API may change without notice.
|
|
7521
|
+
*
|
|
7522
|
+
* Default: encrypted if the store is persisted.
|
|
7523
|
+
* @param {boolean} encrypt
|
|
7524
|
+
* @returns {WolletBuilder}
|
|
7525
|
+
*/
|
|
7526
|
+
setEncryptionTxsStore(encrypt) {
|
|
7527
|
+
const ptr = this.__destroy_into_raw();
|
|
7528
|
+
const ret = wasm.wolletbuilder_setEncryptionTxsStore(ptr, encrypt);
|
|
7529
|
+
return WolletBuilder.__wrap(ret);
|
|
7530
|
+
}
|
|
7531
|
+
/**
|
|
7532
|
+
* Build the wallet from this builder.
|
|
7533
|
+
* @returns {Wollet}
|
|
7534
|
+
*/
|
|
7535
|
+
build() {
|
|
7536
|
+
const ptr = this.__destroy_into_raw();
|
|
7537
|
+
const ret = wasm.wolletbuilder_build(ptr);
|
|
7538
|
+
if (ret[2]) {
|
|
7539
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
7540
|
+
}
|
|
7541
|
+
return Wollet.__wrap(ret[0]);
|
|
7542
|
+
}
|
|
7543
|
+
}
|
|
7544
|
+
if (Symbol.dispose) WolletBuilder.prototype[Symbol.dispose] = WolletBuilder.prototype.free;
|
|
7545
|
+
|
|
7546
|
+
exports.WolletBuilder = WolletBuilder;
|
|
7547
|
+
|
|
6947
7548
|
const WolletDescriptorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6948
7549
|
? { register: () => {}, unregister: () => {} }
|
|
6949
7550
|
: new FinalizationRegistry(ptr => wasm.__wbg_wolletdescriptor_free(ptr >>> 0, 1));
|
|
@@ -7333,7 +7934,12 @@ exports.__wbg_get_0da715ceaecea5c8 = function(arg0, arg1) {
|
|
|
7333
7934
|
return ret;
|
|
7334
7935
|
};
|
|
7335
7936
|
|
|
7336
|
-
exports.
|
|
7937
|
+
exports.__wbg_get_458e874b43b18b25 = function() { return handleError(function (arg0, arg1) {
|
|
7938
|
+
const ret = Reflect.get(arg0, arg1);
|
|
7939
|
+
return ret;
|
|
7940
|
+
}, arguments) };
|
|
7941
|
+
|
|
7942
|
+
exports.__wbg_get_ea60a3bcdaa2b333 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
7337
7943
|
const ret = arg1.get(getStringFromWasm0(arg2, arg3));
|
|
7338
7944
|
var ptr1 = isLikeNone(ret) ? 0 : passArray8ToWasm0(ret, wasm.__wbindgen_malloc);
|
|
7339
7945
|
var len1 = WASM_VECTOR_LEN;
|
|
@@ -7341,11 +7947,6 @@ exports.__wbg_get_39bedfef9433a446 = function() { return handleError(function (a
|
|
|
7341
7947
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
7342
7948
|
}, arguments) };
|
|
7343
7949
|
|
|
7344
|
-
exports.__wbg_get_458e874b43b18b25 = function() { return handleError(function (arg0, arg1) {
|
|
7345
|
-
const ret = Reflect.get(arg0, arg1);
|
|
7346
|
-
return ret;
|
|
7347
|
-
}, arguments) };
|
|
7348
|
-
|
|
7349
7950
|
exports.__wbg_has_b89e451f638123e3 = function() { return handleError(function (arg0, arg1) {
|
|
7350
7951
|
const ret = Reflect.has(arg0, arg1);
|
|
7351
7952
|
return ret;
|
|
@@ -7437,6 +8038,11 @@ exports.__wbg_isArray_030cce220591fb41 = function(arg0) {
|
|
|
7437
8038
|
return ret;
|
|
7438
8039
|
};
|
|
7439
8040
|
|
|
8041
|
+
exports.__wbg_isPersisted_a0739c119cc2a965 = function() { return handleError(function (arg0) {
|
|
8042
|
+
const ret = arg0.isPersisted();
|
|
8043
|
+
return ret;
|
|
8044
|
+
}, arguments) };
|
|
8045
|
+
|
|
7440
8046
|
exports.__wbg_issuance_new = function(arg0) {
|
|
7441
8047
|
const ret = Issuance.__wrap(arg0);
|
|
7442
8048
|
return ret;
|
|
@@ -7472,7 +8078,7 @@ exports.__wbg_length_6bb7e81f9d7713e4 = function(arg0) {
|
|
|
7472
8078
|
return ret;
|
|
7473
8079
|
};
|
|
7474
8080
|
|
|
7475
|
-
exports.
|
|
8081
|
+
exports.__wbg_log_f2e572499b94f3fc = function(arg0, arg1) {
|
|
7476
8082
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
7477
8083
|
};
|
|
7478
8084
|
|
|
@@ -7508,7 +8114,7 @@ exports.__wbg_new_2e3c58a15f39f5f9 = function(arg0, arg1) {
|
|
|
7508
8114
|
const a = state0.a;
|
|
7509
8115
|
state0.a = 0;
|
|
7510
8116
|
try {
|
|
7511
|
-
return
|
|
8117
|
+
return __wbg_adapter_736(a, state0.b, arg0, arg1);
|
|
7512
8118
|
} finally {
|
|
7513
8119
|
state0.a = a;
|
|
7514
8120
|
}
|
|
@@ -7679,7 +8285,7 @@ exports.__wbg_push_330b2eb93e4e1212 = function(arg0, arg1) {
|
|
|
7679
8285
|
return ret;
|
|
7680
8286
|
};
|
|
7681
8287
|
|
|
7682
|
-
exports.
|
|
8288
|
+
exports.__wbg_put_e16c8bb664081030 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
7683
8289
|
arg0.put(getStringFromWasm0(arg1, arg2), getArrayU8FromWasm0(arg3, arg4));
|
|
7684
8290
|
}, arguments) };
|
|
7685
8291
|
|
|
@@ -7729,7 +8335,7 @@ exports.__wbg_registry_new = function(arg0) {
|
|
|
7729
8335
|
return ret;
|
|
7730
8336
|
};
|
|
7731
8337
|
|
|
7732
|
-
exports.
|
|
8338
|
+
exports.__wbg_remove_2f18c0eff31e188a = function() { return handleError(function (arg0, arg1, arg2) {
|
|
7733
8339
|
arg0.remove(getStringFromWasm0(arg1, arg2));
|
|
7734
8340
|
}, arguments) };
|
|
7735
8341
|
|
|
@@ -7945,11 +8551,21 @@ exports.__wbg_transaction_new = function(arg0) {
|
|
|
7945
8551
|
return ret;
|
|
7946
8552
|
};
|
|
7947
8553
|
|
|
8554
|
+
exports.__wbg_txdetails_new = function(arg0) {
|
|
8555
|
+
const ret = TxDetails.__wrap(arg0);
|
|
8556
|
+
return ret;
|
|
8557
|
+
};
|
|
8558
|
+
|
|
7948
8559
|
exports.__wbg_txid_new = function(arg0) {
|
|
7949
8560
|
const ret = Txid.__wrap(arg0);
|
|
7950
8561
|
return ret;
|
|
7951
8562
|
};
|
|
7952
8563
|
|
|
8564
|
+
exports.__wbg_txoutdetails_new = function(arg0) {
|
|
8565
|
+
const ret = TxOutDetails.__wrap(arg0);
|
|
8566
|
+
return ret;
|
|
8567
|
+
};
|
|
8568
|
+
|
|
7953
8569
|
exports.__wbg_update_new = function(arg0) {
|
|
7954
8570
|
const ret = Update.__wrap(arg0);
|
|
7955
8571
|
return ret;
|
|
@@ -8066,75 +8682,75 @@ exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
|
8066
8682
|
return ret;
|
|
8067
8683
|
};
|
|
8068
8684
|
|
|
8069
|
-
exports.
|
|
8070
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
8071
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
8685
|
+
exports.__wbindgen_cast_392cad8582d6e5e7 = function(arg0, arg1) {
|
|
8686
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1231, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 1312, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
8687
|
+
const ret = makeMutClosure(arg0, arg1, 1231, __wbg_adapter_6);
|
|
8072
8688
|
return ret;
|
|
8073
8689
|
};
|
|
8074
8690
|
|
|
8075
|
-
exports.
|
|
8076
|
-
// Cast intrinsic for `
|
|
8077
|
-
const ret =
|
|
8691
|
+
exports.__wbindgen_cast_39f378bbfc1f694f = function(arg0, arg1) {
|
|
8692
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1231, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 1312, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
8693
|
+
const ret = makeMutClosure(arg0, arg1, 1231, __wbg_adapter_6);
|
|
8078
8694
|
return ret;
|
|
8079
8695
|
};
|
|
8080
8696
|
|
|
8081
|
-
exports.
|
|
8082
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
8083
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
8697
|
+
exports.__wbindgen_cast_3ec117c47760f617 = function(arg0, arg1) {
|
|
8698
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 464, function: Function { arguments: [NamedExternref("HIDInputReportEvent")], shim_idx: 465, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
8699
|
+
const ret = makeMutClosure(arg0, arg1, 464, __wbg_adapter_12);
|
|
8084
8700
|
return ret;
|
|
8085
8701
|
};
|
|
8086
8702
|
|
|
8087
|
-
exports.
|
|
8088
|
-
// Cast intrinsic for `
|
|
8089
|
-
const ret =
|
|
8703
|
+
exports.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
8704
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
8705
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
8090
8706
|
return ret;
|
|
8091
8707
|
};
|
|
8092
8708
|
|
|
8093
|
-
exports.
|
|
8094
|
-
// Cast intrinsic for `
|
|
8095
|
-
const ret = arg0;
|
|
8709
|
+
exports.__wbindgen_cast_64e682fa407cc89a = function(arg0, arg1) {
|
|
8710
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1524, function: Function { arguments: [], shim_idx: 1525, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
8711
|
+
const ret = makeMutClosure(arg0, arg1, 1524, __wbg_adapter_28);
|
|
8096
8712
|
return ret;
|
|
8097
8713
|
};
|
|
8098
8714
|
|
|
8099
|
-
exports.
|
|
8100
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
8101
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
8715
|
+
exports.__wbindgen_cast_6a4a8b8a96ccc6bc = function(arg0, arg1) {
|
|
8716
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1231, function: Function { arguments: [NamedExternref("Event")], shim_idx: 1312, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
8717
|
+
const ret = makeMutClosure(arg0, arg1, 1231, __wbg_adapter_6);
|
|
8102
8718
|
return ret;
|
|
8103
8719
|
};
|
|
8104
8720
|
|
|
8105
|
-
exports.
|
|
8106
|
-
// Cast intrinsic for `
|
|
8107
|
-
const ret =
|
|
8721
|
+
exports.__wbindgen_cast_93bc83e3a76266b4 = function(arg0, arg1) {
|
|
8722
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1231, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 1312, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
8723
|
+
const ret = makeMutClosure(arg0, arg1, 1231, __wbg_adapter_6);
|
|
8108
8724
|
return ret;
|
|
8109
8725
|
};
|
|
8110
8726
|
|
|
8111
|
-
exports.
|
|
8112
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
8113
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
8727
|
+
exports.__wbindgen_cast_9a974cdf9f42f656 = function(arg0, arg1) {
|
|
8728
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 2080, function: Function { arguments: [Externref], shim_idx: 2091, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
8729
|
+
const ret = makeMutClosure(arg0, arg1, 2080, __wbg_adapter_15);
|
|
8114
8730
|
return ret;
|
|
8115
8731
|
};
|
|
8116
8732
|
|
|
8117
|
-
exports.
|
|
8118
|
-
// Cast intrinsic for `
|
|
8733
|
+
exports.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
8734
|
+
// Cast intrinsic for `I64 -> Externref`.
|
|
8119
8735
|
const ret = arg0;
|
|
8120
8736
|
return ret;
|
|
8121
8737
|
};
|
|
8122
8738
|
|
|
8123
|
-
exports.
|
|
8124
|
-
// Cast intrinsic for `
|
|
8125
|
-
const ret =
|
|
8739
|
+
exports.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
|
|
8740
|
+
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
8741
|
+
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
8126
8742
|
return ret;
|
|
8127
8743
|
};
|
|
8128
8744
|
|
|
8129
|
-
exports.
|
|
8130
|
-
// Cast intrinsic for `
|
|
8131
|
-
const ret =
|
|
8745
|
+
exports.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|
|
8746
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
8747
|
+
const ret = arg0;
|
|
8132
8748
|
return ret;
|
|
8133
8749
|
};
|
|
8134
8750
|
|
|
8135
|
-
exports.
|
|
8136
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
8137
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
8751
|
+
exports.__wbindgen_cast_f02f4a8c093fe3f0 = function(arg0, arg1) {
|
|
8752
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 2045, function: Function { arguments: [], shim_idx: 2046, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
8753
|
+
const ret = makeMutClosure(arg0, arg1, 2045, __wbg_adapter_9);
|
|
8138
8754
|
return ret;
|
|
8139
8755
|
};
|
|
8140
8756
|
|