lwk_node 0.11.1 → 0.12.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/README.md +56 -1
- package/lwk_wasm.d.ts +715 -54
- package/lwk_wasm.js +767 -110
- package/lwk_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/lwk_wasm.js
CHANGED
|
@@ -236,22 +236,6 @@ module.exports.searchLedgerDevice = function() {
|
|
|
236
236
|
return ret;
|
|
237
237
|
};
|
|
238
238
|
|
|
239
|
-
let cachedUint32ArrayMemory0 = null;
|
|
240
|
-
|
|
241
|
-
function getUint32ArrayMemory0() {
|
|
242
|
-
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
243
|
-
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
244
|
-
}
|
|
245
|
-
return cachedUint32ArrayMemory0;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
function passArray32ToWasm0(arg, malloc) {
|
|
249
|
-
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
250
|
-
getUint32ArrayMemory0().set(arg, ptr / 4);
|
|
251
|
-
WASM_VECTOR_LEN = arg.length;
|
|
252
|
-
return ptr;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
239
|
function getArrayJsValueFromWasm0(ptr, len) {
|
|
256
240
|
ptr = ptr >>> 0;
|
|
257
241
|
const mem = getDataViewMemory0();
|
|
@@ -270,20 +254,36 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
270
254
|
return ptr;
|
|
271
255
|
}
|
|
272
256
|
|
|
257
|
+
let cachedUint32ArrayMemory0 = null;
|
|
258
|
+
|
|
259
|
+
function getUint32ArrayMemory0() {
|
|
260
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
261
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
262
|
+
}
|
|
263
|
+
return cachedUint32ArrayMemory0;
|
|
264
|
+
}
|
|
265
|
+
|
|
273
266
|
function getArrayU32FromWasm0(ptr, len) {
|
|
274
267
|
ptr = ptr >>> 0;
|
|
275
268
|
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
276
269
|
}
|
|
277
|
-
|
|
278
|
-
|
|
270
|
+
|
|
271
|
+
function passArray32ToWasm0(arg, malloc) {
|
|
272
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
273
|
+
getUint32ArrayMemory0().set(arg, ptr / 4);
|
|
274
|
+
WASM_VECTOR_LEN = arg.length;
|
|
275
|
+
return ptr;
|
|
276
|
+
}
|
|
277
|
+
function __wbg_adapter_34(arg0, arg1, arg2) {
|
|
278
|
+
wasm.closure444_externref_shim(arg0, arg1, arg2);
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
-
function
|
|
282
|
-
wasm.
|
|
281
|
+
function __wbg_adapter_41(arg0, arg1, arg2) {
|
|
282
|
+
wasm.closure1370_externref_shim(arg0, arg1, arg2);
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
-
function
|
|
286
|
-
wasm.
|
|
285
|
+
function __wbg_adapter_544(arg0, arg1, arg2, arg3) {
|
|
286
|
+
wasm.closure2130_externref_shim(arg0, arg1, arg2, arg3);
|
|
287
287
|
}
|
|
288
288
|
|
|
289
289
|
/**
|
|
@@ -312,7 +312,7 @@ const AddressFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
312
312
|
? { register: () => {}, unregister: () => {} }
|
|
313
313
|
: new FinalizationRegistry(ptr => wasm.__wbg_address_free(ptr >>> 0, 1));
|
|
314
314
|
/**
|
|
315
|
-
*
|
|
315
|
+
* An Elements (Liquid) address
|
|
316
316
|
*/
|
|
317
317
|
class Address {
|
|
318
318
|
|
|
@@ -338,7 +338,7 @@ class Address {
|
|
|
338
338
|
/**
|
|
339
339
|
* Creates an `Address`
|
|
340
340
|
*
|
|
341
|
-
* If you know the network, you can use
|
|
341
|
+
* If you know the network, you can use `parse()` to validate that the network is consistent.
|
|
342
342
|
* @param {string} s
|
|
343
343
|
*/
|
|
344
344
|
constructor(s) {
|
|
@@ -369,6 +369,7 @@ class Address {
|
|
|
369
369
|
return Address.__wrap(ret[0]);
|
|
370
370
|
}
|
|
371
371
|
/**
|
|
372
|
+
* Return the script pubkey of the address.
|
|
372
373
|
* @returns {Script}
|
|
373
374
|
*/
|
|
374
375
|
scriptPubkey() {
|
|
@@ -376,6 +377,7 @@ class Address {
|
|
|
376
377
|
return Script.__wrap(ret);
|
|
377
378
|
}
|
|
378
379
|
/**
|
|
380
|
+
* Return true if the address is blinded, in other words, if it has a blinding key.
|
|
379
381
|
* @returns {boolean}
|
|
380
382
|
*/
|
|
381
383
|
isBlinded() {
|
|
@@ -383,6 +385,7 @@ class Address {
|
|
|
383
385
|
return ret !== 0;
|
|
384
386
|
}
|
|
385
387
|
/**
|
|
388
|
+
* Return true if the address is for mainnet.
|
|
386
389
|
* @returns {boolean}
|
|
387
390
|
*/
|
|
388
391
|
isMainnet() {
|
|
@@ -390,6 +393,7 @@ class Address {
|
|
|
390
393
|
return ret !== 0;
|
|
391
394
|
}
|
|
392
395
|
/**
|
|
396
|
+
* Return the unconfidential address, in other words, the address without the blinding key.
|
|
393
397
|
* @returns {Address}
|
|
394
398
|
*/
|
|
395
399
|
toUnconfidential() {
|
|
@@ -397,6 +401,8 @@ class Address {
|
|
|
397
401
|
return Address.__wrap(ret);
|
|
398
402
|
}
|
|
399
403
|
/**
|
|
404
|
+
* Return the string representation of the address.
|
|
405
|
+
* This representation can be used to recreate the address via `new()`
|
|
400
406
|
* @returns {string}
|
|
401
407
|
*/
|
|
402
408
|
toString() {
|
|
@@ -469,7 +475,9 @@ const AddressResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
469
475
|
? { register: () => {}, unregister: () => {} }
|
|
470
476
|
: new FinalizationRegistry(ptr => wasm.__wbg_addressresult_free(ptr >>> 0, 1));
|
|
471
477
|
/**
|
|
472
|
-
*
|
|
478
|
+
* Value returned from asking an address to the wallet.
|
|
479
|
+
* Containing the confidential address and its
|
|
480
|
+
* derivation index (the last element in the derivation path)
|
|
473
481
|
*/
|
|
474
482
|
class AddressResult {
|
|
475
483
|
|
|
@@ -493,6 +501,7 @@ class AddressResult {
|
|
|
493
501
|
wasm.__wbg_addressresult_free(ptr, 0);
|
|
494
502
|
}
|
|
495
503
|
/**
|
|
504
|
+
* Return the address.
|
|
496
505
|
* @returns {Address}
|
|
497
506
|
*/
|
|
498
507
|
address() {
|
|
@@ -500,6 +509,7 @@ class AddressResult {
|
|
|
500
509
|
return Address.__wrap(ret);
|
|
501
510
|
}
|
|
502
511
|
/**
|
|
512
|
+
* Return the derivation index of the address.
|
|
503
513
|
* @returns {number}
|
|
504
514
|
*/
|
|
505
515
|
index() {
|
|
@@ -513,7 +523,26 @@ const Amp0Finalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
513
523
|
? { register: () => {}, unregister: () => {} }
|
|
514
524
|
: new FinalizationRegistry(ptr => wasm.__wbg_amp0_free(ptr >>> 0, 1));
|
|
515
525
|
/**
|
|
516
|
-
*
|
|
526
|
+
* Context for actions related to an AMP0 (sub)account
|
|
527
|
+
*
|
|
528
|
+
* <div class="warning">
|
|
529
|
+
* <b>WARNING:</b>
|
|
530
|
+
*
|
|
531
|
+
* AMP0 is based on a legacy system, and some things do not fit precisely the way LWK allows to do
|
|
532
|
+
* things.
|
|
533
|
+
*
|
|
534
|
+
* Callers must be careful with the following:
|
|
535
|
+
* * <b>Addresses: </b>
|
|
536
|
+
* to get addresses use [`Amp0::address()`]. This ensures
|
|
537
|
+
* that all addresses used are correctly monitored by the AMP0 server.
|
|
538
|
+
* * <b>Syncing: </b>
|
|
539
|
+
* to sync the AMP0 [`crate::Wollet`], use [`Amp0::last_index()`] and [`crate::clients::blocking::BlockchainBackend::full_scan_to_index()`]. This ensures that all utxos are synced, even if there are gaps between higher than the GAP LIMIT.
|
|
540
|
+
*
|
|
541
|
+
* <i>
|
|
542
|
+
* Failing to do the above might lead to inconsistent states, where funds are not shown or they
|
|
543
|
+
* cannot be spent!
|
|
544
|
+
* </i>
|
|
545
|
+
* </div>
|
|
517
546
|
*/
|
|
518
547
|
class Amp0 {
|
|
519
548
|
|
|
@@ -546,14 +575,13 @@ class Amp0 {
|
|
|
546
575
|
*/
|
|
547
576
|
static newWithNetwork(network, username, password, amp_id) {
|
|
548
577
|
_assertClass(network, Network);
|
|
549
|
-
|
|
550
|
-
const
|
|
578
|
+
const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
579
|
+
const len0 = WASM_VECTOR_LEN;
|
|
580
|
+
const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
551
581
|
const len1 = WASM_VECTOR_LEN;
|
|
552
|
-
const ptr2 = passStringToWasm0(
|
|
582
|
+
const ptr2 = passStringToWasm0(amp_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
553
583
|
const len2 = WASM_VECTOR_LEN;
|
|
554
|
-
const
|
|
555
|
-
const len3 = WASM_VECTOR_LEN;
|
|
556
|
-
const ret = wasm.amp0_newWithNetwork(ptr0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
584
|
+
const ret = wasm.amp0_newWithNetwork(network.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
557
585
|
return ret;
|
|
558
586
|
}
|
|
559
587
|
/**
|
|
@@ -651,11 +679,168 @@ class Amp0 {
|
|
|
651
679
|
}
|
|
652
680
|
module.exports.Amp0 = Amp0;
|
|
653
681
|
|
|
682
|
+
const Amp0ConnectedFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
683
|
+
? { register: () => {}, unregister: () => {} }
|
|
684
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_amp0connected_free(ptr >>> 0, 1));
|
|
685
|
+
/**
|
|
686
|
+
* Session connecting to AMP0
|
|
687
|
+
*/
|
|
688
|
+
class Amp0Connected {
|
|
689
|
+
|
|
690
|
+
static __wrap(ptr) {
|
|
691
|
+
ptr = ptr >>> 0;
|
|
692
|
+
const obj = Object.create(Amp0Connected.prototype);
|
|
693
|
+
obj.__wbg_ptr = ptr;
|
|
694
|
+
Amp0ConnectedFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
695
|
+
return obj;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
__destroy_into_raw() {
|
|
699
|
+
const ptr = this.__wbg_ptr;
|
|
700
|
+
this.__wbg_ptr = 0;
|
|
701
|
+
Amp0ConnectedFinalization.unregister(this);
|
|
702
|
+
return ptr;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
free() {
|
|
706
|
+
const ptr = this.__destroy_into_raw();
|
|
707
|
+
wasm.__wbg_amp0connected_free(ptr, 0);
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
710
|
+
* Connect and register to AMP0
|
|
711
|
+
* @param {Network} network
|
|
712
|
+
* @param {Amp0SignerData} signer_data
|
|
713
|
+
*/
|
|
714
|
+
constructor(network, signer_data) {
|
|
715
|
+
_assertClass(network, Network);
|
|
716
|
+
_assertClass(signer_data, Amp0SignerData);
|
|
717
|
+
const ret = wasm.amp0connected_new(network.__wbg_ptr, signer_data.__wbg_ptr);
|
|
718
|
+
return ret;
|
|
719
|
+
}
|
|
720
|
+
/**
|
|
721
|
+
* Obtain a login challenge
|
|
722
|
+
*
|
|
723
|
+
* This must be signed with [`amp0_sign_challenge()`].
|
|
724
|
+
* @returns {Promise<string>}
|
|
725
|
+
*/
|
|
726
|
+
getChallenge() {
|
|
727
|
+
const ret = wasm.amp0connected_getChallenge(this.__wbg_ptr);
|
|
728
|
+
return ret;
|
|
729
|
+
}
|
|
730
|
+
/**
|
|
731
|
+
* Log in
|
|
732
|
+
*
|
|
733
|
+
* `sig` must be obtained from [`amp0_sign_challenge()`] called with the value returned
|
|
734
|
+
* by [`Amp0Connected::get_challenge()`]
|
|
735
|
+
* @param {string} sig
|
|
736
|
+
* @returns {Promise<Amp0LoggedIn>}
|
|
737
|
+
*/
|
|
738
|
+
login(sig) {
|
|
739
|
+
const ptr = this.__destroy_into_raw();
|
|
740
|
+
const ptr0 = passStringToWasm0(sig, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
741
|
+
const len0 = WASM_VECTOR_LEN;
|
|
742
|
+
const ret = wasm.amp0connected_login(ptr, ptr0, len0);
|
|
743
|
+
return ret;
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
module.exports.Amp0Connected = Amp0Connected;
|
|
747
|
+
|
|
748
|
+
const Amp0LoggedInFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
749
|
+
? { register: () => {}, unregister: () => {} }
|
|
750
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_amp0loggedin_free(ptr >>> 0, 1));
|
|
751
|
+
/**
|
|
752
|
+
* Session logged in AMP0
|
|
753
|
+
*/
|
|
754
|
+
class Amp0LoggedIn {
|
|
755
|
+
|
|
756
|
+
static __wrap(ptr) {
|
|
757
|
+
ptr = ptr >>> 0;
|
|
758
|
+
const obj = Object.create(Amp0LoggedIn.prototype);
|
|
759
|
+
obj.__wbg_ptr = ptr;
|
|
760
|
+
Amp0LoggedInFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
761
|
+
return obj;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
__destroy_into_raw() {
|
|
765
|
+
const ptr = this.__wbg_ptr;
|
|
766
|
+
this.__wbg_ptr = 0;
|
|
767
|
+
Amp0LoggedInFinalization.unregister(this);
|
|
768
|
+
return ptr;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
free() {
|
|
772
|
+
const ptr = this.__destroy_into_raw();
|
|
773
|
+
wasm.__wbg_amp0loggedin_free(ptr, 0);
|
|
774
|
+
}
|
|
775
|
+
/**
|
|
776
|
+
* List of AMP IDs.
|
|
777
|
+
* @returns {string[]}
|
|
778
|
+
*/
|
|
779
|
+
getAmpIds() {
|
|
780
|
+
const ret = wasm.amp0loggedin_getAmpIds(this.__wbg_ptr);
|
|
781
|
+
if (ret[3]) {
|
|
782
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
783
|
+
}
|
|
784
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
785
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
786
|
+
return v1;
|
|
787
|
+
}
|
|
788
|
+
/**
|
|
789
|
+
* Get the next account for AMP0 account creation
|
|
790
|
+
*
|
|
791
|
+
* This must be given to [`amp0_account_xpub()`] to obtain the xpub to pass to
|
|
792
|
+
* [`Amp0LoggedIn::create_amp0_account()`]
|
|
793
|
+
* @returns {number}
|
|
794
|
+
*/
|
|
795
|
+
nextAccount() {
|
|
796
|
+
const ret = wasm.amp0loggedin_nextAccount(this.__wbg_ptr);
|
|
797
|
+
if (ret[2]) {
|
|
798
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
799
|
+
}
|
|
800
|
+
return ret[0] >>> 0;
|
|
801
|
+
}
|
|
802
|
+
/**
|
|
803
|
+
* Create a new AMP0 account
|
|
804
|
+
*
|
|
805
|
+
* `account_xpub` must be obtained from [`amp0_account_xpub()`] called with the value obtained from
|
|
806
|
+
* [`Amp0LoggedIn::next_account()`]
|
|
807
|
+
* @param {number} pointer
|
|
808
|
+
* @param {string} account_xpub
|
|
809
|
+
* @returns {Promise<string>}
|
|
810
|
+
*/
|
|
811
|
+
createAmp0Account(pointer, account_xpub) {
|
|
812
|
+
const ptr0 = passStringToWasm0(account_xpub, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
813
|
+
const len0 = WASM_VECTOR_LEN;
|
|
814
|
+
const ret = wasm.amp0loggedin_createAmp0Account(this.__wbg_ptr, pointer, ptr0, len0);
|
|
815
|
+
return ret;
|
|
816
|
+
}
|
|
817
|
+
/**
|
|
818
|
+
* Create a new Watch-Only entry for this wallet
|
|
819
|
+
* @param {string} username
|
|
820
|
+
* @param {string} password
|
|
821
|
+
* @returns {Promise<void>}
|
|
822
|
+
*/
|
|
823
|
+
createWatchOnly(username, password) {
|
|
824
|
+
const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
825
|
+
const len0 = WASM_VECTOR_LEN;
|
|
826
|
+
const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
827
|
+
const len1 = WASM_VECTOR_LEN;
|
|
828
|
+
const ret = wasm.amp0loggedin_createWatchOnly(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
829
|
+
return ret;
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
module.exports.Amp0LoggedIn = Amp0LoggedIn;
|
|
833
|
+
|
|
654
834
|
const Amp0PsetFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
655
835
|
? { register: () => {}, unregister: () => {} }
|
|
656
836
|
: new FinalizationRegistry(ptr => wasm.__wbg_amp0pset_free(ptr >>> 0, 1));
|
|
657
837
|
/**
|
|
658
|
-
*
|
|
838
|
+
* A PSET to use with AMP0
|
|
839
|
+
*
|
|
840
|
+
* When asking AMP0 to cosign, the caller must pass some extra data that does not belong to the
|
|
841
|
+
* PSET. This struct holds and manage the necessary data.
|
|
842
|
+
*
|
|
843
|
+
* If you're not dealing with AMP0, do not use this struct.
|
|
659
844
|
*/
|
|
660
845
|
class Amp0Pset {
|
|
661
846
|
|
|
@@ -717,11 +902,39 @@ class Amp0Pset {
|
|
|
717
902
|
}
|
|
718
903
|
module.exports.Amp0Pset = Amp0Pset;
|
|
719
904
|
|
|
905
|
+
const Amp0SignerDataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
906
|
+
? { register: () => {}, unregister: () => {} }
|
|
907
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_amp0signerdata_free(ptr >>> 0, 1));
|
|
908
|
+
|
|
909
|
+
class Amp0SignerData {
|
|
910
|
+
|
|
911
|
+
static __wrap(ptr) {
|
|
912
|
+
ptr = ptr >>> 0;
|
|
913
|
+
const obj = Object.create(Amp0SignerData.prototype);
|
|
914
|
+
obj.__wbg_ptr = ptr;
|
|
915
|
+
Amp0SignerDataFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
916
|
+
return obj;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
__destroy_into_raw() {
|
|
920
|
+
const ptr = this.__wbg_ptr;
|
|
921
|
+
this.__wbg_ptr = 0;
|
|
922
|
+
Amp0SignerDataFinalization.unregister(this);
|
|
923
|
+
return ptr;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
free() {
|
|
927
|
+
const ptr = this.__destroy_into_raw();
|
|
928
|
+
wasm.__wbg_amp0signerdata_free(ptr, 0);
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
module.exports.Amp0SignerData = Amp0SignerData;
|
|
932
|
+
|
|
720
933
|
const Amp2Finalization = (typeof FinalizationRegistry === 'undefined')
|
|
721
934
|
? { register: () => {}, unregister: () => {} }
|
|
722
935
|
: new FinalizationRegistry(ptr => wasm.__wbg_amp2_free(ptr >>> 0, 1));
|
|
723
936
|
/**
|
|
724
|
-
*
|
|
937
|
+
* Context for actions interacting with Asset Management Platform version 2
|
|
725
938
|
*/
|
|
726
939
|
class Amp2 {
|
|
727
940
|
|
|
@@ -745,6 +958,7 @@ class Amp2 {
|
|
|
745
958
|
wasm.__wbg_amp2_free(ptr, 0);
|
|
746
959
|
}
|
|
747
960
|
/**
|
|
961
|
+
* Create a new AMP2 client with the default url and server key for the testnet network.
|
|
748
962
|
* @returns {Amp2}
|
|
749
963
|
*/
|
|
750
964
|
static newTestnet() {
|
|
@@ -752,6 +966,7 @@ class Amp2 {
|
|
|
752
966
|
return Amp2.__wrap(ret);
|
|
753
967
|
}
|
|
754
968
|
/**
|
|
969
|
+
* Get an AMP2 wallet descriptor from the keyorigin xpub string obtained from a signer
|
|
755
970
|
* @param {string} keyorigin_xpub
|
|
756
971
|
* @returns {Amp2Descriptor}
|
|
757
972
|
*/
|
|
@@ -765,6 +980,7 @@ class Amp2 {
|
|
|
765
980
|
return Amp2Descriptor.__wrap(ret[0]);
|
|
766
981
|
}
|
|
767
982
|
/**
|
|
983
|
+
* Register an AMP2 wallet with the AMP2 server
|
|
768
984
|
* @param {Amp2Descriptor} desc
|
|
769
985
|
* @returns {Promise<string>}
|
|
770
986
|
*/
|
|
@@ -774,6 +990,7 @@ class Amp2 {
|
|
|
774
990
|
return ret;
|
|
775
991
|
}
|
|
776
992
|
/**
|
|
993
|
+
* Ask the AMP2 server to cosign a PSET
|
|
777
994
|
* @param {Pset} pset
|
|
778
995
|
* @returns {Promise<Pset>}
|
|
779
996
|
*/
|
|
@@ -789,7 +1006,7 @@ const Amp2DescriptorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
789
1006
|
? { register: () => {}, unregister: () => {} }
|
|
790
1007
|
: new FinalizationRegistry(ptr => wasm.__wbg_amp2descriptor_free(ptr >>> 0, 1));
|
|
791
1008
|
/**
|
|
792
|
-
*
|
|
1009
|
+
* An Asset Management Platform version 2 descriptor
|
|
793
1010
|
*/
|
|
794
1011
|
class Amp2Descriptor {
|
|
795
1012
|
|
|
@@ -813,6 +1030,7 @@ class Amp2Descriptor {
|
|
|
813
1030
|
wasm.__wbg_amp2descriptor_free(ptr, 0);
|
|
814
1031
|
}
|
|
815
1032
|
/**
|
|
1033
|
+
* Return the descriptor as a `WolletDescriptor`
|
|
816
1034
|
* @returns {WolletDescriptor}
|
|
817
1035
|
*/
|
|
818
1036
|
descriptor() {
|
|
@@ -820,6 +1038,7 @@ class Amp2Descriptor {
|
|
|
820
1038
|
return WolletDescriptor.__wrap(ret);
|
|
821
1039
|
}
|
|
822
1040
|
/**
|
|
1041
|
+
* Return the string representation of the descriptor.
|
|
823
1042
|
* @returns {string}
|
|
824
1043
|
*/
|
|
825
1044
|
toString() {
|
|
@@ -841,7 +1060,7 @@ const AssetAmountFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
841
1060
|
? { register: () => {}, unregister: () => {} }
|
|
842
1061
|
: new FinalizationRegistry(ptr => wasm.__wbg_assetamount_free(ptr >>> 0, 1));
|
|
843
1062
|
/**
|
|
844
|
-
*
|
|
1063
|
+
* An asset identifier and an amount in satoshi units
|
|
845
1064
|
*/
|
|
846
1065
|
class AssetAmount {
|
|
847
1066
|
|
|
@@ -885,7 +1104,7 @@ const AssetIdFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
885
1104
|
? { register: () => {}, unregister: () => {} }
|
|
886
1105
|
: new FinalizationRegistry(ptr => wasm.__wbg_assetid_free(ptr >>> 0, 1));
|
|
887
1106
|
/**
|
|
888
|
-
* A valid asset identifier.
|
|
1107
|
+
* A valid asset identifier.
|
|
889
1108
|
*
|
|
890
1109
|
* 32 bytes encoded as hex string.
|
|
891
1110
|
*/
|
|
@@ -926,6 +1145,8 @@ class AssetId {
|
|
|
926
1145
|
return this;
|
|
927
1146
|
}
|
|
928
1147
|
/**
|
|
1148
|
+
* Return the string representation of the asset identifier (64 hex characters).
|
|
1149
|
+
* This representation can be used to recreate the asset identifier via `new()`
|
|
929
1150
|
* @returns {string}
|
|
930
1151
|
*/
|
|
931
1152
|
toString() {
|
|
@@ -947,7 +1168,7 @@ const AssetIdsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
947
1168
|
? { register: () => {}, unregister: () => {} }
|
|
948
1169
|
: new FinalizationRegistry(ptr => wasm.__wbg_assetids_free(ptr >>> 0, 1));
|
|
949
1170
|
/**
|
|
950
|
-
*
|
|
1171
|
+
* An ordered collection of asset identifiers.
|
|
951
1172
|
*/
|
|
952
1173
|
class AssetIds {
|
|
953
1174
|
|
|
@@ -971,6 +1192,7 @@ class AssetIds {
|
|
|
971
1192
|
wasm.__wbg_assetids_free(ptr, 0);
|
|
972
1193
|
}
|
|
973
1194
|
/**
|
|
1195
|
+
* Return an empty list of asset identifiers.
|
|
974
1196
|
* @returns {AssetIds}
|
|
975
1197
|
*/
|
|
976
1198
|
static empty() {
|
|
@@ -981,6 +1203,7 @@ class AssetIds {
|
|
|
981
1203
|
return AssetIds.__wrap(ret[0]);
|
|
982
1204
|
}
|
|
983
1205
|
/**
|
|
1206
|
+
* Return the string representation of this list of asset identifiers.
|
|
984
1207
|
* @returns {string}
|
|
985
1208
|
*/
|
|
986
1209
|
toString() {
|
|
@@ -1001,7 +1224,11 @@ module.exports.AssetIds = AssetIds;
|
|
|
1001
1224
|
const AssetMetaFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1002
1225
|
? { register: () => {}, unregister: () => {} }
|
|
1003
1226
|
: new FinalizationRegistry(ptr => wasm.__wbg_assetmeta_free(ptr >>> 0, 1));
|
|
1004
|
-
|
|
1227
|
+
/**
|
|
1228
|
+
* Data related to an asset in the registry:
|
|
1229
|
+
* - contract: the contract of the asset
|
|
1230
|
+
* - tx: the issuance transaction of the asset
|
|
1231
|
+
*/
|
|
1005
1232
|
class AssetMeta {
|
|
1006
1233
|
|
|
1007
1234
|
static __wrap(ptr) {
|
|
@@ -1024,6 +1251,7 @@ class AssetMeta {
|
|
|
1024
1251
|
wasm.__wbg_assetmeta_free(ptr, 0);
|
|
1025
1252
|
}
|
|
1026
1253
|
/**
|
|
1254
|
+
* Return the contract of the asset.
|
|
1027
1255
|
* @returns {Contract}
|
|
1028
1256
|
*/
|
|
1029
1257
|
contract() {
|
|
@@ -1031,6 +1259,7 @@ class AssetMeta {
|
|
|
1031
1259
|
return Contract.__wrap(ret);
|
|
1032
1260
|
}
|
|
1033
1261
|
/**
|
|
1262
|
+
* Return the issuance transaction of the asset.
|
|
1034
1263
|
* @returns {Transaction}
|
|
1035
1264
|
*/
|
|
1036
1265
|
tx() {
|
|
@@ -1040,11 +1269,83 @@ class AssetMeta {
|
|
|
1040
1269
|
}
|
|
1041
1270
|
module.exports.AssetMeta = AssetMeta;
|
|
1042
1271
|
|
|
1272
|
+
const BalanceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1273
|
+
? { register: () => {}, unregister: () => {} }
|
|
1274
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_balance_free(ptr >>> 0, 1));
|
|
1275
|
+
/**
|
|
1276
|
+
* A signed balance of assets, to represent a balance with negative values such
|
|
1277
|
+
* as the results of a transaction from the perspective of a wallet.
|
|
1278
|
+
*/
|
|
1279
|
+
class Balance {
|
|
1280
|
+
|
|
1281
|
+
static __wrap(ptr) {
|
|
1282
|
+
ptr = ptr >>> 0;
|
|
1283
|
+
const obj = Object.create(Balance.prototype);
|
|
1284
|
+
obj.__wbg_ptr = ptr;
|
|
1285
|
+
BalanceFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1286
|
+
return obj;
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
__destroy_into_raw() {
|
|
1290
|
+
const ptr = this.__wbg_ptr;
|
|
1291
|
+
this.__wbg_ptr = 0;
|
|
1292
|
+
BalanceFinalization.unregister(this);
|
|
1293
|
+
return ptr;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
free() {
|
|
1297
|
+
const ptr = this.__destroy_into_raw();
|
|
1298
|
+
wasm.__wbg_balance_free(ptr, 0);
|
|
1299
|
+
}
|
|
1300
|
+
/**
|
|
1301
|
+
* Convert the balance to a JsValue for serialization
|
|
1302
|
+
*
|
|
1303
|
+
* Note: the amounts are strings since `JSON.stringify` cannot handle `BigInt`s.
|
|
1304
|
+
* Use `entries()` to get the raw data.
|
|
1305
|
+
* @returns {any}
|
|
1306
|
+
*/
|
|
1307
|
+
toJSON() {
|
|
1308
|
+
const ret = wasm.balance_toJSON(this.__wbg_ptr);
|
|
1309
|
+
if (ret[2]) {
|
|
1310
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1311
|
+
}
|
|
1312
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1313
|
+
}
|
|
1314
|
+
/**
|
|
1315
|
+
* Returns the balance as an array of [key, value] pairs.
|
|
1316
|
+
* @returns {any}
|
|
1317
|
+
*/
|
|
1318
|
+
entries() {
|
|
1319
|
+
const ret = wasm.balance_entries(this.__wbg_ptr);
|
|
1320
|
+
if (ret[2]) {
|
|
1321
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1322
|
+
}
|
|
1323
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1324
|
+
}
|
|
1325
|
+
/**
|
|
1326
|
+
* Return the string representation of the balance.
|
|
1327
|
+
* @returns {string}
|
|
1328
|
+
*/
|
|
1329
|
+
toString() {
|
|
1330
|
+
let deferred1_0;
|
|
1331
|
+
let deferred1_1;
|
|
1332
|
+
try {
|
|
1333
|
+
const ret = wasm.balance_toString(this.__wbg_ptr);
|
|
1334
|
+
deferred1_0 = ret[0];
|
|
1335
|
+
deferred1_1 = ret[1];
|
|
1336
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1337
|
+
} finally {
|
|
1338
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
module.exports.Balance = Balance;
|
|
1343
|
+
|
|
1043
1344
|
const BipFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1044
1345
|
? { register: () => {}, unregister: () => {} }
|
|
1045
1346
|
: new FinalizationRegistry(ptr => wasm.__wbg_bip_free(ptr >>> 0, 1));
|
|
1046
1347
|
/**
|
|
1047
|
-
*
|
|
1348
|
+
* The bip variant for a descriptor like specified in the bips (49, 84, 87)
|
|
1048
1349
|
*/
|
|
1049
1350
|
class Bip {
|
|
1050
1351
|
|
|
@@ -1092,6 +1393,7 @@ class Bip {
|
|
|
1092
1393
|
return Bip.__wrap(ret);
|
|
1093
1394
|
}
|
|
1094
1395
|
/**
|
|
1396
|
+
* Return the string representation of the bip variant, such as "bip49", "bip84" or "bip87"
|
|
1095
1397
|
* @returns {string}
|
|
1096
1398
|
*/
|
|
1097
1399
|
toString() {
|
|
@@ -1113,7 +1415,7 @@ const ContractFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
1113
1415
|
? { register: () => {}, unregister: () => {} }
|
|
1114
1416
|
: new FinalizationRegistry(ptr => wasm.__wbg_contract_free(ptr >>> 0, 1));
|
|
1115
1417
|
/**
|
|
1116
|
-
*
|
|
1418
|
+
* A contract defining metadata of an asset such the name and the ticker
|
|
1117
1419
|
*/
|
|
1118
1420
|
class Contract {
|
|
1119
1421
|
|
|
@@ -1163,6 +1465,7 @@ class Contract {
|
|
|
1163
1465
|
return this;
|
|
1164
1466
|
}
|
|
1165
1467
|
/**
|
|
1468
|
+
* Return the string representation of the contract.
|
|
1166
1469
|
* @returns {string}
|
|
1167
1470
|
*/
|
|
1168
1471
|
toString() {
|
|
@@ -1178,6 +1481,7 @@ class Contract {
|
|
|
1178
1481
|
}
|
|
1179
1482
|
}
|
|
1180
1483
|
/**
|
|
1484
|
+
* Return the domain of the issuer of the contract.
|
|
1181
1485
|
* @returns {string}
|
|
1182
1486
|
*/
|
|
1183
1487
|
domain() {
|
|
@@ -1193,6 +1497,10 @@ class Contract {
|
|
|
1193
1497
|
}
|
|
1194
1498
|
}
|
|
1195
1499
|
/**
|
|
1500
|
+
* Make a copy of the contract.
|
|
1501
|
+
*
|
|
1502
|
+
* This is needed to pass it to a function that requires a `Contract` (without borrowing)
|
|
1503
|
+
* but you need the same contract after that call.
|
|
1196
1504
|
* @returns {Contract}
|
|
1197
1505
|
*/
|
|
1198
1506
|
clone() {
|
|
@@ -1206,7 +1514,10 @@ const EsploraClientFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
1206
1514
|
? { register: () => {}, unregister: () => {} }
|
|
1207
1515
|
: new FinalizationRegistry(ptr => wasm.__wbg_esploraclient_free(ptr >>> 0, 1));
|
|
1208
1516
|
/**
|
|
1209
|
-
*
|
|
1517
|
+
* A blockchain backend implementation based on the
|
|
1518
|
+
* [esplora HTTP API](https://github.com/blockstream/esplora/blob/master/API.md).
|
|
1519
|
+
* But can also use the [waterfalls](https://github.com/RCasatta/waterfalls)
|
|
1520
|
+
* endpoint to speed up the scan if supported by the server.
|
|
1210
1521
|
*/
|
|
1211
1522
|
class EsploraClient {
|
|
1212
1523
|
|
|
@@ -1230,7 +1541,7 @@ class EsploraClient {
|
|
|
1230
1541
|
wasm.__wbg_esploraclient_free(ptr, 0);
|
|
1231
1542
|
}
|
|
1232
1543
|
/**
|
|
1233
|
-
* Creates
|
|
1544
|
+
* Creates an Esplora client with the given options
|
|
1234
1545
|
* @param {Network} network
|
|
1235
1546
|
* @param {string} url
|
|
1236
1547
|
* @param {boolean} waterfalls
|
|
@@ -1250,6 +1561,16 @@ class EsploraClient {
|
|
|
1250
1561
|
return this;
|
|
1251
1562
|
}
|
|
1252
1563
|
/**
|
|
1564
|
+
* Scan the blockchain for the scripts generated by a watch-only wallet
|
|
1565
|
+
*
|
|
1566
|
+
* This method scans both external and internal address chains, stopping after finding
|
|
1567
|
+
* 20 consecutive unused addresses (the gap limit) as recommended by
|
|
1568
|
+
* [BIP44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#address-gap-limit).
|
|
1569
|
+
*
|
|
1570
|
+
* Returns `Some(Update)` if any changes were found during scanning, or `None` if no changes
|
|
1571
|
+
* were detected.
|
|
1572
|
+
*
|
|
1573
|
+
* To scan beyond the gap limit use `full_scan_to_index()` instead.
|
|
1253
1574
|
* @param {Wollet} wollet
|
|
1254
1575
|
* @returns {Promise<Update | undefined>}
|
|
1255
1576
|
*/
|
|
@@ -1260,6 +1581,19 @@ class EsploraClient {
|
|
|
1260
1581
|
}
|
|
1261
1582
|
/**
|
|
1262
1583
|
* Scan the blockchain for the scripts generated by a watch-only wallet up to a specified derivation index
|
|
1584
|
+
*
|
|
1585
|
+
* While `full_scan()` stops after finding 20 consecutive unused addresses (the gap limit),
|
|
1586
|
+
* this method will scan at least up to the given derivation index. This is useful to prevent
|
|
1587
|
+
* missing funds in cases where outputs exist beyond the gap limit.
|
|
1588
|
+
*
|
|
1589
|
+
* Will scan both external and internal address chains up to the given index for maximum safety,
|
|
1590
|
+
* even though internal addresses may not need such deep scanning.
|
|
1591
|
+
*
|
|
1592
|
+
* If transactions are found beyond the gap limit during this scan, subsequent calls to
|
|
1593
|
+
* `full_scan()` will automatically scan up to the highest used index, preventing any
|
|
1594
|
+
* previously-found transactions from being missed.
|
|
1595
|
+
*
|
|
1596
|
+
* See `full_scan_to_index()` for a blocking version of this method.
|
|
1263
1597
|
* @param {Wollet} wollet
|
|
1264
1598
|
* @param {number} index
|
|
1265
1599
|
* @returns {Promise<Update | undefined>}
|
|
@@ -1270,6 +1604,7 @@ class EsploraClient {
|
|
|
1270
1604
|
return ret;
|
|
1271
1605
|
}
|
|
1272
1606
|
/**
|
|
1607
|
+
* Broadcast a transaction to the network so that a miner can include it in a block.
|
|
1273
1608
|
* @param {Transaction} tx
|
|
1274
1609
|
* @returns {Promise<Txid>}
|
|
1275
1610
|
*/
|
|
@@ -1279,6 +1614,7 @@ class EsploraClient {
|
|
|
1279
1614
|
return ret;
|
|
1280
1615
|
}
|
|
1281
1616
|
/**
|
|
1617
|
+
* Broadcast a PSET by extracting the transaction from the PSET and broadcasting it.
|
|
1282
1618
|
* @param {Pset} pset
|
|
1283
1619
|
* @returns {Promise<Txid>}
|
|
1284
1620
|
*/
|
|
@@ -1288,6 +1624,7 @@ class EsploraClient {
|
|
|
1288
1624
|
return ret;
|
|
1289
1625
|
}
|
|
1290
1626
|
/**
|
|
1627
|
+
* Set the waterfalls server recipient key. This is used to encrypt the descriptor when calling the waterfalls endpoint.
|
|
1291
1628
|
* @param {string} recipient
|
|
1292
1629
|
* @returns {Promise<void>}
|
|
1293
1630
|
*/
|
|
@@ -1304,7 +1641,7 @@ const IssuanceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
1304
1641
|
? { register: () => {}, unregister: () => {} }
|
|
1305
1642
|
: new FinalizationRegistry(ptr => wasm.__wbg_issuance_free(ptr >>> 0, 1));
|
|
1306
1643
|
/**
|
|
1307
|
-
*
|
|
1644
|
+
* The details of an issuance or reissuance.
|
|
1308
1645
|
*/
|
|
1309
1646
|
class Issuance {
|
|
1310
1647
|
|
|
@@ -1328,6 +1665,7 @@ class Issuance {
|
|
|
1328
1665
|
wasm.__wbg_issuance_free(ptr, 0);
|
|
1329
1666
|
}
|
|
1330
1667
|
/**
|
|
1668
|
+
* Return the asset id or None if it's a null issuance
|
|
1331
1669
|
* @returns {AssetId | undefined}
|
|
1332
1670
|
*/
|
|
1333
1671
|
asset() {
|
|
@@ -1335,6 +1673,7 @@ class Issuance {
|
|
|
1335
1673
|
return ret === 0 ? undefined : AssetId.__wrap(ret);
|
|
1336
1674
|
}
|
|
1337
1675
|
/**
|
|
1676
|
+
* Return the token id or None if it's a null issuance
|
|
1338
1677
|
* @returns {AssetId | undefined}
|
|
1339
1678
|
*/
|
|
1340
1679
|
token() {
|
|
@@ -1342,6 +1681,7 @@ class Issuance {
|
|
|
1342
1681
|
return ret === 0 ? undefined : AssetId.__wrap(ret);
|
|
1343
1682
|
}
|
|
1344
1683
|
/**
|
|
1684
|
+
* Return the previous output index or None if it's a null issuance
|
|
1345
1685
|
* @returns {number | undefined}
|
|
1346
1686
|
*/
|
|
1347
1687
|
prevVout() {
|
|
@@ -1349,6 +1689,7 @@ class Issuance {
|
|
|
1349
1689
|
return ret === 0x100000001 ? undefined : ret;
|
|
1350
1690
|
}
|
|
1351
1691
|
/**
|
|
1692
|
+
* Return the previous transaction id or None if it's a null issuance
|
|
1352
1693
|
* @returns {Txid | undefined}
|
|
1353
1694
|
*/
|
|
1354
1695
|
prevTxid() {
|
|
@@ -1356,6 +1697,7 @@ class Issuance {
|
|
|
1356
1697
|
return ret === 0 ? undefined : Txid.__wrap(ret);
|
|
1357
1698
|
}
|
|
1358
1699
|
/**
|
|
1700
|
+
* Return true if this is effectively an issuance
|
|
1359
1701
|
* @returns {boolean}
|
|
1360
1702
|
*/
|
|
1361
1703
|
isIssuance() {
|
|
@@ -1363,6 +1705,7 @@ class Issuance {
|
|
|
1363
1705
|
return ret !== 0;
|
|
1364
1706
|
}
|
|
1365
1707
|
/**
|
|
1708
|
+
* Return true if this is effectively a reissuance
|
|
1366
1709
|
* @returns {boolean}
|
|
1367
1710
|
*/
|
|
1368
1711
|
isReissuance() {
|
|
@@ -1376,7 +1719,7 @@ const JadeFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
1376
1719
|
? { register: () => {}, unregister: () => {} }
|
|
1377
1720
|
: new FinalizationRegistry(ptr => wasm.__wbg_jade_free(ptr >>> 0, 1));
|
|
1378
1721
|
/**
|
|
1379
|
-
*
|
|
1722
|
+
* A Jade hardware wallet usable via Web Serial
|
|
1380
1723
|
*/
|
|
1381
1724
|
class Jade {
|
|
1382
1725
|
|
|
@@ -1529,7 +1872,7 @@ const JadeWebSocketFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
1529
1872
|
? { register: () => {}, unregister: () => {} }
|
|
1530
1873
|
: new FinalizationRegistry(ptr => wasm.__wbg_jadewebsocket_free(ptr >>> 0, 1));
|
|
1531
1874
|
/**
|
|
1532
|
-
* WebSocket-based
|
|
1875
|
+
* WebSocket-based `Jade` useful for testing in the browser with the Jade emulator.
|
|
1533
1876
|
*/
|
|
1534
1877
|
class JadeWebSocket {
|
|
1535
1878
|
|
|
@@ -1774,7 +2117,9 @@ const MnemonicFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
1774
2117
|
? { register: () => {}, unregister: () => {} }
|
|
1775
2118
|
: new FinalizationRegistry(ptr => wasm.__wbg_mnemonic_free(ptr >>> 0, 1));
|
|
1776
2119
|
/**
|
|
1777
|
-
*
|
|
2120
|
+
* A mnemonic secret code used as a master secret for a bip39 wallet.
|
|
2121
|
+
*
|
|
2122
|
+
* Supported number of words are 12, 15, 18, 21, and 24.
|
|
1778
2123
|
*/
|
|
1779
2124
|
class Mnemonic {
|
|
1780
2125
|
|
|
@@ -1813,6 +2158,10 @@ class Mnemonic {
|
|
|
1813
2158
|
return this;
|
|
1814
2159
|
}
|
|
1815
2160
|
/**
|
|
2161
|
+
* Return the string representation of the Mnemonic.
|
|
2162
|
+
* This representation can be used to recreate the Mnemonic via `new()`
|
|
2163
|
+
*
|
|
2164
|
+
* Note this is secret information, do not log it.
|
|
1816
2165
|
* @returns {string}
|
|
1817
2166
|
*/
|
|
1818
2167
|
toString() {
|
|
@@ -1860,7 +2209,7 @@ const NetworkFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
1860
2209
|
? { register: () => {}, unregister: () => {} }
|
|
1861
2210
|
: new FinalizationRegistry(ptr => wasm.__wbg_network_free(ptr >>> 0, 1));
|
|
1862
2211
|
/**
|
|
1863
|
-
*
|
|
2212
|
+
* The network of the elements blockchain such as mainnet, testnet or regtest.
|
|
1864
2213
|
*/
|
|
1865
2214
|
class Network {
|
|
1866
2215
|
|
|
@@ -1918,6 +2267,7 @@ class Network {
|
|
|
1918
2267
|
return Network.__wrap(ret);
|
|
1919
2268
|
}
|
|
1920
2269
|
/**
|
|
2270
|
+
* Return the default esplora client for this network
|
|
1921
2271
|
* @returns {EsploraClient}
|
|
1922
2272
|
*/
|
|
1923
2273
|
defaultEsploraClient() {
|
|
@@ -1925,6 +2275,7 @@ class Network {
|
|
|
1925
2275
|
return EsploraClient.__wrap(ret);
|
|
1926
2276
|
}
|
|
1927
2277
|
/**
|
|
2278
|
+
* Return true if the network is a mainnet network
|
|
1928
2279
|
* @returns {boolean}
|
|
1929
2280
|
*/
|
|
1930
2281
|
isMainnet() {
|
|
@@ -1932,6 +2283,7 @@ class Network {
|
|
|
1932
2283
|
return ret !== 0;
|
|
1933
2284
|
}
|
|
1934
2285
|
/**
|
|
2286
|
+
* Return true if the network is a testnet network
|
|
1935
2287
|
* @returns {boolean}
|
|
1936
2288
|
*/
|
|
1937
2289
|
isTestnet() {
|
|
@@ -1939,6 +2291,7 @@ class Network {
|
|
|
1939
2291
|
return ret !== 0;
|
|
1940
2292
|
}
|
|
1941
2293
|
/**
|
|
2294
|
+
* Return true if the network is a regtest network
|
|
1942
2295
|
* @returns {boolean}
|
|
1943
2296
|
*/
|
|
1944
2297
|
isRegtest() {
|
|
@@ -1946,6 +2299,7 @@ class Network {
|
|
|
1946
2299
|
return ret !== 0;
|
|
1947
2300
|
}
|
|
1948
2301
|
/**
|
|
2302
|
+
* Return a string representation of the network, like "liquid", "liquid-testnet" or "liquid-regtest"
|
|
1949
2303
|
* @returns {string}
|
|
1950
2304
|
*/
|
|
1951
2305
|
toString() {
|
|
@@ -1961,6 +2315,7 @@ class Network {
|
|
|
1961
2315
|
}
|
|
1962
2316
|
}
|
|
1963
2317
|
/**
|
|
2318
|
+
* Return the policy asset for this network
|
|
1964
2319
|
* @returns {AssetId}
|
|
1965
2320
|
*/
|
|
1966
2321
|
policyAsset() {
|
|
@@ -1968,6 +2323,7 @@ class Network {
|
|
|
1968
2323
|
return AssetId.__wrap(ret);
|
|
1969
2324
|
}
|
|
1970
2325
|
/**
|
|
2326
|
+
* Return the transaction builder for this network
|
|
1971
2327
|
* @returns {TxBuilder}
|
|
1972
2328
|
*/
|
|
1973
2329
|
txBuilder() {
|
|
@@ -1975,6 +2331,7 @@ class Network {
|
|
|
1975
2331
|
return TxBuilder.__wrap(ret);
|
|
1976
2332
|
}
|
|
1977
2333
|
/**
|
|
2334
|
+
* Return the default explorer URL for this network
|
|
1978
2335
|
* @returns {string}
|
|
1979
2336
|
*/
|
|
1980
2337
|
defaultExplorerUrl() {
|
|
@@ -2021,6 +2378,7 @@ class OptionWalletTxOut {
|
|
|
2021
2378
|
wasm.__wbg_optionwallettxout_free(ptr, 0);
|
|
2022
2379
|
}
|
|
2023
2380
|
/**
|
|
2381
|
+
* Return a copy of the WalletTxOut if it exists, otherwise None
|
|
2024
2382
|
* @returns {WalletTxOut | undefined}
|
|
2025
2383
|
*/
|
|
2026
2384
|
get() {
|
|
@@ -2034,7 +2392,7 @@ const OutPointFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
2034
2392
|
? { register: () => {}, unregister: () => {} }
|
|
2035
2393
|
: new FinalizationRegistry(ptr => wasm.__wbg_outpoint_free(ptr >>> 0, 1));
|
|
2036
2394
|
/**
|
|
2037
|
-
*
|
|
2395
|
+
* A reference to a transaction output
|
|
2038
2396
|
*/
|
|
2039
2397
|
class OutPoint {
|
|
2040
2398
|
|
|
@@ -2080,6 +2438,7 @@ class OutPoint {
|
|
|
2080
2438
|
return this;
|
|
2081
2439
|
}
|
|
2082
2440
|
/**
|
|
2441
|
+
* Return the transaction identifier.
|
|
2083
2442
|
* @returns {Txid}
|
|
2084
2443
|
*/
|
|
2085
2444
|
txid() {
|
|
@@ -2087,6 +2446,7 @@ class OutPoint {
|
|
|
2087
2446
|
return Txid.__wrap(ret);
|
|
2088
2447
|
}
|
|
2089
2448
|
/**
|
|
2449
|
+
* Return the output index.
|
|
2090
2450
|
* @returns {number}
|
|
2091
2451
|
*/
|
|
2092
2452
|
vout() {
|
|
@@ -2100,7 +2460,9 @@ const PrecisionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
2100
2460
|
? { register: () => {}, unregister: () => {} }
|
|
2101
2461
|
: new FinalizationRegistry(ptr => wasm.__wbg_precision_free(ptr >>> 0, 1));
|
|
2102
2462
|
/**
|
|
2103
|
-
*
|
|
2463
|
+
* Helper to convert satoshi values of an asset to the value with the given precision and viceversa.
|
|
2464
|
+
*
|
|
2465
|
+
* For example 100 satoshi with precision 2 is "1.00"
|
|
2104
2466
|
*/
|
|
2105
2467
|
class Precision {
|
|
2106
2468
|
|
|
@@ -2116,7 +2478,8 @@ class Precision {
|
|
|
2116
2478
|
wasm.__wbg_precision_free(ptr, 0);
|
|
2117
2479
|
}
|
|
2118
2480
|
/**
|
|
2119
|
-
*
|
|
2481
|
+
* Create a new Precision, useful to encode e decode values for assets with precision.
|
|
2482
|
+
* erroring if the given precision is greater than the allowed maximum (8)
|
|
2120
2483
|
* @param {number} precision
|
|
2121
2484
|
*/
|
|
2122
2485
|
constructor(precision) {
|
|
@@ -2129,6 +2492,9 @@ class Precision {
|
|
|
2129
2492
|
return this;
|
|
2130
2493
|
}
|
|
2131
2494
|
/**
|
|
2495
|
+
* Convert the given satoshi value to the formatted value according to our precision
|
|
2496
|
+
*
|
|
2497
|
+
* For example 100 satoshi with precision 2 is "1.00"
|
|
2132
2498
|
* @param {bigint} sats
|
|
2133
2499
|
* @returns {string}
|
|
2134
2500
|
*/
|
|
@@ -2145,6 +2511,9 @@ class Precision {
|
|
|
2145
2511
|
}
|
|
2146
2512
|
}
|
|
2147
2513
|
/**
|
|
2514
|
+
* Convert the given string with precision to satoshi units.
|
|
2515
|
+
*
|
|
2516
|
+
* For example the string "1.00" of an asset with precision 2 is 100 satoshi.
|
|
2148
2517
|
* @param {string} sats
|
|
2149
2518
|
* @returns {bigint}
|
|
2150
2519
|
*/
|
|
@@ -2164,7 +2533,7 @@ const PsetFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
2164
2533
|
? { register: () => {}, unregister: () => {} }
|
|
2165
2534
|
: new FinalizationRegistry(ptr => wasm.__wbg_pset_free(ptr >>> 0, 1));
|
|
2166
2535
|
/**
|
|
2167
|
-
* Partially Signed Elements Transaction
|
|
2536
|
+
* Partially Signed Elements Transaction
|
|
2168
2537
|
*/
|
|
2169
2538
|
class Pset {
|
|
2170
2539
|
|
|
@@ -2188,7 +2557,7 @@ class Pset {
|
|
|
2188
2557
|
wasm.__wbg_pset_free(ptr, 0);
|
|
2189
2558
|
}
|
|
2190
2559
|
/**
|
|
2191
|
-
* Creates a `Pset`
|
|
2560
|
+
* Creates a `Pset` from its base64 string representation.
|
|
2192
2561
|
* @param {string} base64
|
|
2193
2562
|
*/
|
|
2194
2563
|
constructor(base64) {
|
|
@@ -2203,6 +2572,8 @@ class Pset {
|
|
|
2203
2572
|
return this;
|
|
2204
2573
|
}
|
|
2205
2574
|
/**
|
|
2575
|
+
* Return a base64 string representation of the Pset.
|
|
2576
|
+
* The string can be used to re-create the Pset via `new()`
|
|
2206
2577
|
* @returns {string}
|
|
2207
2578
|
*/
|
|
2208
2579
|
toString() {
|
|
@@ -2218,6 +2589,8 @@ class Pset {
|
|
|
2218
2589
|
}
|
|
2219
2590
|
}
|
|
2220
2591
|
/**
|
|
2592
|
+
* Extract the Transaction from a Pset by filling in
|
|
2593
|
+
* the available signature information in place.
|
|
2221
2594
|
* @returns {Transaction}
|
|
2222
2595
|
*/
|
|
2223
2596
|
extractTx() {
|
|
@@ -2228,6 +2601,7 @@ class Pset {
|
|
|
2228
2601
|
return Transaction.__wrap(ret[0]);
|
|
2229
2602
|
}
|
|
2230
2603
|
/**
|
|
2604
|
+
* Attempt to merge with another `Pset`.
|
|
2231
2605
|
* @param {Pset} other
|
|
2232
2606
|
*/
|
|
2233
2607
|
combine(other) {
|
|
@@ -2239,6 +2613,7 @@ class Pset {
|
|
|
2239
2613
|
}
|
|
2240
2614
|
}
|
|
2241
2615
|
/**
|
|
2616
|
+
* Return a copy of the inputs of this PSET
|
|
2242
2617
|
* @returns {PsetInput[]}
|
|
2243
2618
|
*/
|
|
2244
2619
|
inputs() {
|
|
@@ -2248,6 +2623,7 @@ class Pset {
|
|
|
2248
2623
|
return v1;
|
|
2249
2624
|
}
|
|
2250
2625
|
/**
|
|
2626
|
+
* Return a copy of the outputs of this PSET
|
|
2251
2627
|
* @returns {PsetOutput[]}
|
|
2252
2628
|
*/
|
|
2253
2629
|
outputs() {
|
|
@@ -2263,7 +2639,11 @@ const PsetBalanceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
2263
2639
|
? { register: () => {}, unregister: () => {} }
|
|
2264
2640
|
: new FinalizationRegistry(ptr => wasm.__wbg_psetbalance_free(ptr >>> 0, 1));
|
|
2265
2641
|
/**
|
|
2266
|
-
*
|
|
2642
|
+
* The details regarding balance and amounts in a PSET:
|
|
2643
|
+
*
|
|
2644
|
+
* - The fee of the transaction in the PSET
|
|
2645
|
+
* - The net balance of the assets in the PSET from the point of view of the wallet
|
|
2646
|
+
* - The outputs going out of the wallet
|
|
2267
2647
|
*/
|
|
2268
2648
|
class PsetBalance {
|
|
2269
2649
|
|
|
@@ -2295,14 +2675,11 @@ class PsetBalance {
|
|
|
2295
2675
|
}
|
|
2296
2676
|
/**
|
|
2297
2677
|
* The net balance for every asset with respect of the wallet asking the pset details
|
|
2298
|
-
* @returns {
|
|
2678
|
+
* @returns {Balance}
|
|
2299
2679
|
*/
|
|
2300
2680
|
balances() {
|
|
2301
2681
|
const ret = wasm.psetbalance_balances(this.__wbg_ptr);
|
|
2302
|
-
|
|
2303
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
2304
|
-
}
|
|
2305
|
-
return takeFromExternrefTable0(ret[0]);
|
|
2682
|
+
return Balance.__wrap(ret);
|
|
2306
2683
|
}
|
|
2307
2684
|
/**
|
|
2308
2685
|
* @returns {Recipient[]}
|
|
@@ -2320,7 +2697,11 @@ const PsetDetailsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
2320
2697
|
? { register: () => {}, unregister: () => {} }
|
|
2321
2698
|
: new FinalizationRegistry(ptr => wasm.__wbg_psetdetails_free(ptr >>> 0, 1));
|
|
2322
2699
|
/**
|
|
2323
|
-
*
|
|
2700
|
+
* The details of a Partially Signed Elements Transaction:
|
|
2701
|
+
*
|
|
2702
|
+
* - the net balance from the point of view of the wallet
|
|
2703
|
+
* - the available and missing signatures for each input
|
|
2704
|
+
* - for issuances and reissuances transactions contains the issuance or reissuance details
|
|
2324
2705
|
*/
|
|
2325
2706
|
class PsetDetails {
|
|
2326
2707
|
|
|
@@ -2344,6 +2725,8 @@ class PsetDetails {
|
|
|
2344
2725
|
wasm.__wbg_psetdetails_free(ptr, 0);
|
|
2345
2726
|
}
|
|
2346
2727
|
/**
|
|
2728
|
+
* Return the balance of the PSET from the point of view of the wallet
|
|
2729
|
+
* that generated this via `psetDetails()`
|
|
2347
2730
|
* @returns {PsetBalance}
|
|
2348
2731
|
*/
|
|
2349
2732
|
balance() {
|
|
@@ -2361,6 +2744,7 @@ class PsetDetails {
|
|
|
2361
2744
|
return v1;
|
|
2362
2745
|
}
|
|
2363
2746
|
/**
|
|
2747
|
+
* Set of fingerprints for which the PSET is missing a signature
|
|
2364
2748
|
* @returns {string[]}
|
|
2365
2749
|
*/
|
|
2366
2750
|
fingerprintsMissing() {
|
|
@@ -2370,6 +2754,7 @@ class PsetDetails {
|
|
|
2370
2754
|
return v1;
|
|
2371
2755
|
}
|
|
2372
2756
|
/**
|
|
2757
|
+
* List of fingerprints for which the PSET has a signature
|
|
2373
2758
|
* @returns {string[]}
|
|
2374
2759
|
*/
|
|
2375
2760
|
fingerprintsHas() {
|
|
@@ -2494,7 +2879,7 @@ const PsetSignaturesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
2494
2879
|
? { register: () => {}, unregister: () => {} }
|
|
2495
2880
|
: new FinalizationRegistry(ptr => wasm.__wbg_psetsignatures_free(ptr >>> 0, 1));
|
|
2496
2881
|
/**
|
|
2497
|
-
*
|
|
2882
|
+
* The details of the signatures in a PSET, divided in available and missing signatures.
|
|
2498
2883
|
*/
|
|
2499
2884
|
class PsetSignatures {
|
|
2500
2885
|
|
|
@@ -2596,7 +2981,9 @@ module.exports.Recipient = Recipient;
|
|
|
2596
2981
|
const RegistryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2597
2982
|
? { register: () => {}, unregister: () => {} }
|
|
2598
2983
|
: new FinalizationRegistry(ptr => wasm.__wbg_registry_free(ptr >>> 0, 1));
|
|
2599
|
-
|
|
2984
|
+
/**
|
|
2985
|
+
* A Registry, a repository to store and retrieve asset metadata, like the name or the ticker of an asset.
|
|
2986
|
+
*/
|
|
2600
2987
|
class Registry {
|
|
2601
2988
|
|
|
2602
2989
|
static __wrap(ptr) {
|
|
@@ -2619,6 +3006,9 @@ class Registry {
|
|
|
2619
3006
|
wasm.__wbg_registry_free(ptr, 0);
|
|
2620
3007
|
}
|
|
2621
3008
|
/**
|
|
3009
|
+
* Create a new registry cache specifying the URL of the registry,
|
|
3010
|
+
* fetch the assets metadata identified by the given asset ids and cache them for later local retrieval.
|
|
3011
|
+
* Use `default_for_network()` to get the default registry for the given network.
|
|
2622
3012
|
* @param {string} url
|
|
2623
3013
|
* @param {AssetIds} asset_ids
|
|
2624
3014
|
* @returns {Promise<Registry>}
|
|
@@ -2631,6 +3021,9 @@ class Registry {
|
|
|
2631
3021
|
return ret;
|
|
2632
3022
|
}
|
|
2633
3023
|
/**
|
|
3024
|
+
* Return the default registry for the given network,
|
|
3025
|
+
* fetch the assets metadata identified by the given asset ids and cache them for later local retrieval.
|
|
3026
|
+
* Use `new()` to specify a custom URL
|
|
2634
3027
|
* @param {Network} network
|
|
2635
3028
|
* @param {AssetIds} asset_ids
|
|
2636
3029
|
* @returns {Promise<Registry>}
|
|
@@ -2642,6 +3035,9 @@ class Registry {
|
|
|
2642
3035
|
return ret;
|
|
2643
3036
|
}
|
|
2644
3037
|
/**
|
|
3038
|
+
* Create a new registry cache, using only the hardcoded assets.
|
|
3039
|
+
*
|
|
3040
|
+
* Hardcoded assets are the policy assets (LBTC, tLBTC, rLBTC) and the USDT asset on mainnet.
|
|
2645
3041
|
* @param {Network} network
|
|
2646
3042
|
* @returns {Registry}
|
|
2647
3043
|
*/
|
|
@@ -2654,6 +3050,7 @@ class Registry {
|
|
|
2654
3050
|
return Registry.__wrap(ret[0]);
|
|
2655
3051
|
}
|
|
2656
3052
|
/**
|
|
3053
|
+
* Fetch the contract and the issuance transaction of the given asset id from the registry
|
|
2657
3054
|
* @param {AssetId} asset_id
|
|
2658
3055
|
* @param {EsploraClient} client
|
|
2659
3056
|
* @returns {Promise<AssetMeta>}
|
|
@@ -2665,6 +3062,7 @@ class Registry {
|
|
|
2665
3062
|
return ret;
|
|
2666
3063
|
}
|
|
2667
3064
|
/**
|
|
3065
|
+
* Post a contract to the registry for registration.
|
|
2668
3066
|
* @param {RegistryPost} data
|
|
2669
3067
|
* @returns {Promise<void>}
|
|
2670
3068
|
*/
|
|
@@ -2674,6 +3072,7 @@ class Registry {
|
|
|
2674
3072
|
return ret;
|
|
2675
3073
|
}
|
|
2676
3074
|
/**
|
|
3075
|
+
* Return the asset metadata related to the given asset id if it exists in this registry.
|
|
2677
3076
|
* @param {AssetId} asset_id
|
|
2678
3077
|
* @returns {RegistryData | undefined}
|
|
2679
3078
|
*/
|
|
@@ -2683,6 +3082,8 @@ class Registry {
|
|
|
2683
3082
|
return ret === 0 ? undefined : RegistryData.__wrap(ret);
|
|
2684
3083
|
}
|
|
2685
3084
|
/**
|
|
3085
|
+
* Return the asset metadata related to the given token id,
|
|
3086
|
+
* in other words `token_id` is the reissuance token of the returned asset
|
|
2686
3087
|
* @param {AssetId} token_id
|
|
2687
3088
|
* @returns {RegistryData | undefined}
|
|
2688
3089
|
*/
|
|
@@ -2692,6 +3093,10 @@ class Registry {
|
|
|
2692
3093
|
return ret === 0 ? undefined : RegistryData.__wrap(ret);
|
|
2693
3094
|
}
|
|
2694
3095
|
/**
|
|
3096
|
+
* Add the contracts information of the assets used in the Pset
|
|
3097
|
+
* if available in this registry.
|
|
3098
|
+
* Without the contract information, the partially signed transaction
|
|
3099
|
+
* is valid but will not show asset information when signed with an hardware wallet.
|
|
2695
3100
|
* @param {Pset} pset
|
|
2696
3101
|
* @returns {Pset}
|
|
2697
3102
|
*/
|
|
@@ -2790,7 +3195,9 @@ module.exports.RegistryData = RegistryData;
|
|
|
2790
3195
|
const RegistryPostFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2791
3196
|
? { register: () => {}, unregister: () => {} }
|
|
2792
3197
|
: new FinalizationRegistry(ptr => wasm.__wbg_registrypost_free(ptr >>> 0, 1));
|
|
2793
|
-
|
|
3198
|
+
/**
|
|
3199
|
+
* The data to post to the registry to publish a contract for an asset id
|
|
3200
|
+
*/
|
|
2794
3201
|
class RegistryPost {
|
|
2795
3202
|
|
|
2796
3203
|
__destroy_into_raw() {
|
|
@@ -2805,6 +3212,7 @@ class RegistryPost {
|
|
|
2805
3212
|
wasm.__wbg_registrypost_free(ptr, 0);
|
|
2806
3213
|
}
|
|
2807
3214
|
/**
|
|
3215
|
+
* Create a new registry post object to be used to publish a contract for an asset id in the registry.
|
|
2808
3216
|
* @param {Contract} contract
|
|
2809
3217
|
* @param {AssetId} asset_id
|
|
2810
3218
|
*/
|
|
@@ -2819,6 +3227,7 @@ class RegistryPost {
|
|
|
2819
3227
|
return this;
|
|
2820
3228
|
}
|
|
2821
3229
|
/**
|
|
3230
|
+
* Return a string representation of the registry post (mostly for debugging).
|
|
2822
3231
|
* @returns {string}
|
|
2823
3232
|
*/
|
|
2824
3233
|
toString() {
|
|
@@ -2840,7 +3249,7 @@ const ScriptFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
2840
3249
|
? { register: () => {}, unregister: () => {} }
|
|
2841
3250
|
: new FinalizationRegistry(ptr => wasm.__wbg_script_free(ptr >>> 0, 1));
|
|
2842
3251
|
/**
|
|
2843
|
-
*
|
|
3252
|
+
* An Elements (Liquid) script
|
|
2844
3253
|
*/
|
|
2845
3254
|
class Script {
|
|
2846
3255
|
|
|
@@ -2864,7 +3273,7 @@ class Script {
|
|
|
2864
3273
|
wasm.__wbg_script_free(ptr, 0);
|
|
2865
3274
|
}
|
|
2866
3275
|
/**
|
|
2867
|
-
* Creates a `Script`
|
|
3276
|
+
* Creates a `Script` from its hex string representation.
|
|
2868
3277
|
* @param {string} s
|
|
2869
3278
|
*/
|
|
2870
3279
|
constructor(s) {
|
|
@@ -2879,6 +3288,7 @@ class Script {
|
|
|
2879
3288
|
return this;
|
|
2880
3289
|
}
|
|
2881
3290
|
/**
|
|
3291
|
+
* Return the consensus encoded bytes of the script.
|
|
2882
3292
|
* @returns {Uint8Array}
|
|
2883
3293
|
*/
|
|
2884
3294
|
bytes() {
|
|
@@ -2888,6 +3298,9 @@ class Script {
|
|
|
2888
3298
|
return v1;
|
|
2889
3299
|
}
|
|
2890
3300
|
/**
|
|
3301
|
+
* Return the string of the script showing op codes and their arguments.
|
|
3302
|
+
*
|
|
3303
|
+
* For example: "OP_DUP OP_HASH160 OP_PUSHBYTES_20 088ac47276d105b91cf9aa27a00112421dd5f23c OP_EQUALVERIFY OP_CHECKSIG"
|
|
2891
3304
|
* @returns {string}
|
|
2892
3305
|
*/
|
|
2893
3306
|
asm() {
|
|
@@ -2903,6 +3316,8 @@ class Script {
|
|
|
2903
3316
|
}
|
|
2904
3317
|
}
|
|
2905
3318
|
/**
|
|
3319
|
+
* Return the string representation of the script (hex encoding of its consensus encoded bytes).
|
|
3320
|
+
* This representation can be used to recreate the script via `new()`
|
|
2906
3321
|
* @returns {string}
|
|
2907
3322
|
*/
|
|
2908
3323
|
toString() {
|
|
@@ -2924,7 +3339,7 @@ const SignerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
2924
3339
|
? { register: () => {}, unregister: () => {} }
|
|
2925
3340
|
: new FinalizationRegistry(ptr => wasm.__wbg_signer_free(ptr >>> 0, 1));
|
|
2926
3341
|
/**
|
|
2927
|
-
* A Software signer
|
|
3342
|
+
* A Software signer.
|
|
2928
3343
|
*/
|
|
2929
3344
|
class Signer {
|
|
2930
3345
|
|
|
@@ -2939,6 +3354,65 @@ class Signer {
|
|
|
2939
3354
|
const ptr = this.__destroy_into_raw();
|
|
2940
3355
|
wasm.__wbg_signer_free(ptr, 0);
|
|
2941
3356
|
}
|
|
3357
|
+
/**
|
|
3358
|
+
* AMP0 signer data for login
|
|
3359
|
+
* @returns {Amp0SignerData}
|
|
3360
|
+
*/
|
|
3361
|
+
amp0SignerData() {
|
|
3362
|
+
const ret = wasm.signer_amp0SignerData(this.__wbg_ptr);
|
|
3363
|
+
if (ret[2]) {
|
|
3364
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3365
|
+
}
|
|
3366
|
+
return Amp0SignerData.__wrap(ret[0]);
|
|
3367
|
+
}
|
|
3368
|
+
/**
|
|
3369
|
+
* AMP0 sign login challenge
|
|
3370
|
+
* @param {string} challenge
|
|
3371
|
+
* @returns {string}
|
|
3372
|
+
*/
|
|
3373
|
+
amp0SignChallenge(challenge) {
|
|
3374
|
+
let deferred3_0;
|
|
3375
|
+
let deferred3_1;
|
|
3376
|
+
try {
|
|
3377
|
+
const ptr0 = passStringToWasm0(challenge, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3378
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3379
|
+
const ret = wasm.signer_amp0SignChallenge(this.__wbg_ptr, ptr0, len0);
|
|
3380
|
+
var ptr2 = ret[0];
|
|
3381
|
+
var len2 = ret[1];
|
|
3382
|
+
if (ret[3]) {
|
|
3383
|
+
ptr2 = 0; len2 = 0;
|
|
3384
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
3385
|
+
}
|
|
3386
|
+
deferred3_0 = ptr2;
|
|
3387
|
+
deferred3_1 = len2;
|
|
3388
|
+
return getStringFromWasm0(ptr2, len2);
|
|
3389
|
+
} finally {
|
|
3390
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
3391
|
+
}
|
|
3392
|
+
}
|
|
3393
|
+
/**
|
|
3394
|
+
* AMP0 account xpub
|
|
3395
|
+
* @param {number} account
|
|
3396
|
+
* @returns {string}
|
|
3397
|
+
*/
|
|
3398
|
+
amp0AccountXpub(account) {
|
|
3399
|
+
let deferred2_0;
|
|
3400
|
+
let deferred2_1;
|
|
3401
|
+
try {
|
|
3402
|
+
const ret = wasm.signer_amp0AccountXpub(this.__wbg_ptr, account);
|
|
3403
|
+
var ptr1 = ret[0];
|
|
3404
|
+
var len1 = ret[1];
|
|
3405
|
+
if (ret[3]) {
|
|
3406
|
+
ptr1 = 0; len1 = 0;
|
|
3407
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
3408
|
+
}
|
|
3409
|
+
deferred2_0 = ptr1;
|
|
3410
|
+
deferred2_1 = len1;
|
|
3411
|
+
return getStringFromWasm0(ptr1, len1);
|
|
3412
|
+
} finally {
|
|
3413
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
3414
|
+
}
|
|
3415
|
+
}
|
|
2942
3416
|
/**
|
|
2943
3417
|
* Creates a `Signer`
|
|
2944
3418
|
* @param {Mnemonic} mnemonic
|
|
@@ -2995,6 +3469,7 @@ class Signer {
|
|
|
2995
3469
|
}
|
|
2996
3470
|
}
|
|
2997
3471
|
/**
|
|
3472
|
+
* Return the witness public key hash, slip77 descriptor of this signer
|
|
2998
3473
|
* @returns {WolletDescriptor}
|
|
2999
3474
|
*/
|
|
3000
3475
|
wpkhSlip77Descriptor() {
|
|
@@ -3005,6 +3480,7 @@ class Signer {
|
|
|
3005
3480
|
return WolletDescriptor.__wrap(ret[0]);
|
|
3006
3481
|
}
|
|
3007
3482
|
/**
|
|
3483
|
+
* Return the extended public key of the signer
|
|
3008
3484
|
* @returns {Xpub}
|
|
3009
3485
|
*/
|
|
3010
3486
|
getMasterXpub() {
|
|
@@ -3015,6 +3491,7 @@ class Signer {
|
|
|
3015
3491
|
return Xpub.__wrap(ret[0]);
|
|
3016
3492
|
}
|
|
3017
3493
|
/**
|
|
3494
|
+
* Return keyorigin and xpub, like "[73c5da0a/84h/1h/0h]tpub..."
|
|
3018
3495
|
* @param {Bip} bip
|
|
3019
3496
|
* @returns {string}
|
|
3020
3497
|
*/
|
|
@@ -3038,6 +3515,29 @@ class Signer {
|
|
|
3038
3515
|
}
|
|
3039
3516
|
}
|
|
3040
3517
|
/**
|
|
3518
|
+
* Return the signer fingerprint
|
|
3519
|
+
* @returns {string}
|
|
3520
|
+
*/
|
|
3521
|
+
fingerprint() {
|
|
3522
|
+
let deferred2_0;
|
|
3523
|
+
let deferred2_1;
|
|
3524
|
+
try {
|
|
3525
|
+
const ret = wasm.signer_fingerprint(this.__wbg_ptr);
|
|
3526
|
+
var ptr1 = ret[0];
|
|
3527
|
+
var len1 = ret[1];
|
|
3528
|
+
if (ret[3]) {
|
|
3529
|
+
ptr1 = 0; len1 = 0;
|
|
3530
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
3531
|
+
}
|
|
3532
|
+
deferred2_0 = ptr1;
|
|
3533
|
+
deferred2_1 = len1;
|
|
3534
|
+
return getStringFromWasm0(ptr1, len1);
|
|
3535
|
+
} finally {
|
|
3536
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
3537
|
+
}
|
|
3538
|
+
}
|
|
3539
|
+
/**
|
|
3540
|
+
* Return the mnemonic of the signer
|
|
3041
3541
|
* @returns {Mnemonic}
|
|
3042
3542
|
*/
|
|
3043
3543
|
mnemonic() {
|
|
@@ -3092,7 +3592,7 @@ const TipFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
3092
3592
|
? { register: () => {}, unregister: () => {} }
|
|
3093
3593
|
: new FinalizationRegistry(ptr => wasm.__wbg_tip_free(ptr >>> 0, 1));
|
|
3094
3594
|
/**
|
|
3095
|
-
*
|
|
3595
|
+
* Blockchain tip, the highest valid block in the blockchain
|
|
3096
3596
|
*/
|
|
3097
3597
|
class Tip {
|
|
3098
3598
|
|
|
@@ -3151,9 +3651,9 @@ const TransactionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
3151
3651
|
? { register: () => {}, unregister: () => {} }
|
|
3152
3652
|
: new FinalizationRegistry(ptr => wasm.__wbg_transaction_free(ptr >>> 0, 1));
|
|
3153
3653
|
/**
|
|
3154
|
-
* A Liquid transaction
|
|
3654
|
+
* A Liquid transaction
|
|
3155
3655
|
*
|
|
3156
|
-
* See
|
|
3656
|
+
* See `WalletTx` for the transaction as seen from the perspective of the wallet
|
|
3157
3657
|
* where you can actually see unblinded amounts and tx net-balance.
|
|
3158
3658
|
*/
|
|
3159
3659
|
class Transaction {
|
|
@@ -3193,6 +3693,7 @@ class Transaction {
|
|
|
3193
3693
|
return this;
|
|
3194
3694
|
}
|
|
3195
3695
|
/**
|
|
3696
|
+
* Return the transaction identifier.
|
|
3196
3697
|
* @returns {Txid}
|
|
3197
3698
|
*/
|
|
3198
3699
|
txid() {
|
|
@@ -3200,6 +3701,7 @@ class Transaction {
|
|
|
3200
3701
|
return Txid.__wrap(ret);
|
|
3201
3702
|
}
|
|
3202
3703
|
/**
|
|
3704
|
+
* Return the consensus encoded bytes of the transaction.
|
|
3203
3705
|
* @returns {Uint8Array}
|
|
3204
3706
|
*/
|
|
3205
3707
|
bytes() {
|
|
@@ -3209,6 +3711,8 @@ class Transaction {
|
|
|
3209
3711
|
return v1;
|
|
3210
3712
|
}
|
|
3211
3713
|
/**
|
|
3714
|
+
* Return the fee of the transaction in the given asset.
|
|
3715
|
+
* At the moment the only asset that can be used as fee is the policy asset (LBTC for mainnet).
|
|
3212
3716
|
* @param {AssetId} policy_asset
|
|
3213
3717
|
* @returns {bigint}
|
|
3214
3718
|
*/
|
|
@@ -3218,6 +3722,7 @@ class Transaction {
|
|
|
3218
3722
|
return BigInt.asUintN(64, ret);
|
|
3219
3723
|
}
|
|
3220
3724
|
/**
|
|
3725
|
+
* Return the hex representation of the transaction. More precisely, they are the consensus encoded bytes of the transaction converted in hex.
|
|
3221
3726
|
* @returns {string}
|
|
3222
3727
|
*/
|
|
3223
3728
|
toString() {
|
|
@@ -3239,7 +3744,7 @@ const TxBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
3239
3744
|
? { register: () => {}, unregister: () => {} }
|
|
3240
3745
|
: new FinalizationRegistry(ptr => wasm.__wbg_txbuilder_free(ptr >>> 0, 1));
|
|
3241
3746
|
/**
|
|
3242
|
-
*
|
|
3747
|
+
* A transaction builder
|
|
3243
3748
|
*/
|
|
3244
3749
|
class TxBuilder {
|
|
3245
3750
|
|
|
@@ -3399,7 +3904,18 @@ class TxBuilder {
|
|
|
3399
3904
|
return TxBuilder.__wrap(ret[0]);
|
|
3400
3905
|
}
|
|
3401
3906
|
/**
|
|
3402
|
-
* Issue an asset
|
|
3907
|
+
* Issue an asset
|
|
3908
|
+
*
|
|
3909
|
+
* There will be `asset_sats` units of this asset that will be received by
|
|
3910
|
+
* `asset_receiver` if it's set, otherwise to an address of the wallet generating the issuance.
|
|
3911
|
+
*
|
|
3912
|
+
* There will be `token_sats` reissuance tokens that allow token holder to reissue the created
|
|
3913
|
+
* asset. Reissuance token will be received by `token_receiver` if it's some, or to an
|
|
3914
|
+
* address of the wallet generating the issuance if none.
|
|
3915
|
+
*
|
|
3916
|
+
* If a `contract` is provided, it's metadata will be committed in the generated asset id.
|
|
3917
|
+
*
|
|
3918
|
+
* Can't be used if `reissue_asset` has been called
|
|
3403
3919
|
* @param {bigint} asset_sats
|
|
3404
3920
|
* @param {Address | null | undefined} asset_receiver
|
|
3405
3921
|
* @param {bigint} token_sats
|
|
@@ -3431,7 +3947,17 @@ class TxBuilder {
|
|
|
3431
3947
|
return TxBuilder.__wrap(ret[0]);
|
|
3432
3948
|
}
|
|
3433
3949
|
/**
|
|
3434
|
-
* Reissue an asset
|
|
3950
|
+
* Reissue an asset
|
|
3951
|
+
*
|
|
3952
|
+
* reissue the asset defined by `asset_to_reissue`, provided the reissuance token is owned
|
|
3953
|
+
* by the wallet generating te reissuance.
|
|
3954
|
+
*
|
|
3955
|
+
* Generated transaction will create `satoshi_to_reissue` new asset units, and they will be
|
|
3956
|
+
* sent to the provided `asset_receiver` address if some, or to an address from the wallet
|
|
3957
|
+
* generating the reissuance transaction if none.
|
|
3958
|
+
*
|
|
3959
|
+
* If the issuance transaction does not involve this wallet,
|
|
3960
|
+
* pass the issuance transaction in `issuance_tx`.
|
|
3435
3961
|
* @param {AssetId} asset_to_reissue
|
|
3436
3962
|
* @param {bigint} satoshi_to_reissue
|
|
3437
3963
|
* @param {Address | null} [asset_receiver]
|
|
@@ -3459,7 +3985,17 @@ class TxBuilder {
|
|
|
3459
3985
|
return TxBuilder.__wrap(ret[0]);
|
|
3460
3986
|
}
|
|
3461
3987
|
/**
|
|
3462
|
-
*
|
|
3988
|
+
* Switch to manual coin selection by giving a list of internal UTXOs to use.
|
|
3989
|
+
*
|
|
3990
|
+
* All passed UTXOs are added to the transaction.
|
|
3991
|
+
* No other wallet UTXO is added to the transaction, caller is supposed to add enough UTXOs to
|
|
3992
|
+
* cover for all recipients and fees.
|
|
3993
|
+
*
|
|
3994
|
+
* This method never fails, any error will be raised in [`TxBuilder::finish`].
|
|
3995
|
+
*
|
|
3996
|
+
* Possible errors:
|
|
3997
|
+
* * OutPoint doesn't belong to the wallet
|
|
3998
|
+
* * Insufficient funds (remember to include L-BTC utxos for fees)
|
|
3463
3999
|
* @param {OutPoint[]} outpoints
|
|
3464
4000
|
* @returns {TxBuilder}
|
|
3465
4001
|
*/
|
|
@@ -3471,6 +4007,7 @@ class TxBuilder {
|
|
|
3471
4007
|
return TxBuilder.__wrap(ret);
|
|
3472
4008
|
}
|
|
3473
4009
|
/**
|
|
4010
|
+
* Return a string representation of the transaction builder (mostly for debugging)
|
|
3474
4011
|
* @returns {string}
|
|
3475
4012
|
*/
|
|
3476
4013
|
toString() {
|
|
@@ -3486,6 +4023,8 @@ class TxBuilder {
|
|
|
3486
4023
|
}
|
|
3487
4024
|
}
|
|
3488
4025
|
/**
|
|
4026
|
+
* Set data to create a PSET from which you
|
|
4027
|
+
* can create a LiquiDEX proposal
|
|
3489
4028
|
* @param {OutPoint} utxo
|
|
3490
4029
|
* @param {Address} address
|
|
3491
4030
|
* @param {bigint} satoshi
|
|
@@ -3507,6 +4046,7 @@ class TxBuilder {
|
|
|
3507
4046
|
return TxBuilder.__wrap(ret[0]);
|
|
3508
4047
|
}
|
|
3509
4048
|
/**
|
|
4049
|
+
* Set data to take LiquiDEX proposals
|
|
3510
4050
|
* @param {ValidatedLiquidexProposal[]} proposals
|
|
3511
4051
|
* @returns {TxBuilder}
|
|
3512
4052
|
*/
|
|
@@ -3527,7 +4067,7 @@ const TxOutSecretsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
3527
4067
|
? { register: () => {}, unregister: () => {} }
|
|
3528
4068
|
: new FinalizationRegistry(ptr => wasm.__wbg_txoutsecrets_free(ptr >>> 0, 1));
|
|
3529
4069
|
/**
|
|
3530
|
-
*
|
|
4070
|
+
* Contains unblinded information such as the asset and the value of a transaction output
|
|
3531
4071
|
*/
|
|
3532
4072
|
class TxOutSecrets {
|
|
3533
4073
|
|
|
@@ -3551,6 +4091,7 @@ class TxOutSecrets {
|
|
|
3551
4091
|
wasm.__wbg_txoutsecrets_free(ptr, 0);
|
|
3552
4092
|
}
|
|
3553
4093
|
/**
|
|
4094
|
+
* Return the asset of the output.
|
|
3554
4095
|
* @returns {AssetId}
|
|
3555
4096
|
*/
|
|
3556
4097
|
asset() {
|
|
@@ -3558,6 +4099,7 @@ class TxOutSecrets {
|
|
|
3558
4099
|
return AssetId.__wrap(ret);
|
|
3559
4100
|
}
|
|
3560
4101
|
/**
|
|
4102
|
+
* Return the asset blinding factor as a hex string.
|
|
3561
4103
|
* @returns {string}
|
|
3562
4104
|
*/
|
|
3563
4105
|
assetBlindingFactor() {
|
|
@@ -3573,6 +4115,7 @@ class TxOutSecrets {
|
|
|
3573
4115
|
}
|
|
3574
4116
|
}
|
|
3575
4117
|
/**
|
|
4118
|
+
* Return the value of the output.
|
|
3576
4119
|
* @returns {bigint}
|
|
3577
4120
|
*/
|
|
3578
4121
|
value() {
|
|
@@ -3580,6 +4123,7 @@ class TxOutSecrets {
|
|
|
3580
4123
|
return BigInt.asUintN(64, ret);
|
|
3581
4124
|
}
|
|
3582
4125
|
/**
|
|
4126
|
+
* Return the value blinding factor as a hex string.
|
|
3583
4127
|
* @returns {string}
|
|
3584
4128
|
*/
|
|
3585
4129
|
valueBlindingFactor() {
|
|
@@ -3595,6 +4139,7 @@ class TxOutSecrets {
|
|
|
3595
4139
|
}
|
|
3596
4140
|
}
|
|
3597
4141
|
/**
|
|
4142
|
+
* Return true if the output is explicit (no blinding factors).
|
|
3598
4143
|
* @returns {boolean}
|
|
3599
4144
|
*/
|
|
3600
4145
|
isExplicit() {
|
|
@@ -3670,7 +4215,7 @@ class Txid {
|
|
|
3670
4215
|
wasm.__wbg_txid_free(ptr, 0);
|
|
3671
4216
|
}
|
|
3672
4217
|
/**
|
|
3673
|
-
* Creates a `Txid`
|
|
4218
|
+
* Creates a `Txid` from its hex string representation (64 characters).
|
|
3674
4219
|
* @param {string} tx_id
|
|
3675
4220
|
*/
|
|
3676
4221
|
constructor(tx_id) {
|
|
@@ -3685,6 +4230,8 @@ class Txid {
|
|
|
3685
4230
|
return this;
|
|
3686
4231
|
}
|
|
3687
4232
|
/**
|
|
4233
|
+
* Return the string representation of the transaction identifier as shown in the explorer.
|
|
4234
|
+
* This representation can be used to recreate the transaction identifier via `new()`
|
|
3688
4235
|
* @returns {string}
|
|
3689
4236
|
*/
|
|
3690
4237
|
toString() {
|
|
@@ -3706,7 +4253,16 @@ const UnvalidatedLiquidexProposalFinalization = (typeof FinalizationRegistry ===
|
|
|
3706
4253
|
? { register: () => {}, unregister: () => {} }
|
|
3707
4254
|
: new FinalizationRegistry(ptr => wasm.__wbg_unvalidatedliquidexproposal_free(ptr >>> 0, 1));
|
|
3708
4255
|
/**
|
|
3709
|
-
*
|
|
4256
|
+
* LiquiDEX swap proposal
|
|
4257
|
+
*
|
|
4258
|
+
* A LiquiDEX swap proposal is a transaction with one input and one output created by the "maker".
|
|
4259
|
+
* The transaction "swaps" the input for the output, meaning that the "maker" sends the input and
|
|
4260
|
+
* receives the output.
|
|
4261
|
+
* However the transaction is incomplete (unbalanced and without a fee output), thus it cannot be
|
|
4262
|
+
* broadcast.
|
|
4263
|
+
* The "taker" can "complete" the transaction (using [`crate::TxBuilder::liquidex_take()`]) by
|
|
4264
|
+
* adding more inputs and more outputs to balance the amounts, meaning that the "taker" sends the
|
|
4265
|
+
* output and receives the input.
|
|
3710
4266
|
*/
|
|
3711
4267
|
class UnvalidatedLiquidexProposal {
|
|
3712
4268
|
|
|
@@ -3802,7 +4358,8 @@ const UpdateFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
3802
4358
|
? { register: () => {}, unregister: () => {} }
|
|
3803
4359
|
: new FinalizationRegistry(ptr => wasm.__wbg_update_free(ptr >>> 0, 1));
|
|
3804
4360
|
/**
|
|
3805
|
-
*
|
|
4361
|
+
* An Update contains the delta of information to be applied to the wallet to reach the latest status.
|
|
4362
|
+
* It's created passing a reference to the wallet to the blockchain client
|
|
3806
4363
|
*/
|
|
3807
4364
|
class Update {
|
|
3808
4365
|
|
|
@@ -3841,6 +4398,7 @@ class Update {
|
|
|
3841
4398
|
return this;
|
|
3842
4399
|
}
|
|
3843
4400
|
/**
|
|
4401
|
+
* Serialize an update to a byte array
|
|
3844
4402
|
* @returns {Uint8Array}
|
|
3845
4403
|
*/
|
|
3846
4404
|
serialize() {
|
|
@@ -3853,6 +4411,9 @@ class Update {
|
|
|
3853
4411
|
return v1;
|
|
3854
4412
|
}
|
|
3855
4413
|
/**
|
|
4414
|
+
* Serialize an update to a base64 encoded string,
|
|
4415
|
+
* encrypted with a key derived from the descriptor.
|
|
4416
|
+
* Decrypt using `deserialize_decrypted_base64()`
|
|
3856
4417
|
* @param {WolletDescriptor} desc
|
|
3857
4418
|
* @returns {string}
|
|
3858
4419
|
*/
|
|
@@ -3876,6 +4437,9 @@ class Update {
|
|
|
3876
4437
|
}
|
|
3877
4438
|
}
|
|
3878
4439
|
/**
|
|
4440
|
+
* Deserialize an update from a base64 encoded string,
|
|
4441
|
+
* decrypted with a key derived from the descriptor.
|
|
4442
|
+
* Create the base64 using `serialize_encrypted_base64()`
|
|
3879
4443
|
* @param {string} base64
|
|
3880
4444
|
* @param {WolletDescriptor} desc
|
|
3881
4445
|
* @returns {Update}
|
|
@@ -3891,6 +4455,7 @@ class Update {
|
|
|
3891
4455
|
return Update.__wrap(ret[0]);
|
|
3892
4456
|
}
|
|
3893
4457
|
/**
|
|
4458
|
+
* Whether this update only changes the tip
|
|
3894
4459
|
* @returns {boolean}
|
|
3895
4460
|
*/
|
|
3896
4461
|
onlyTip() {
|
|
@@ -3898,6 +4463,7 @@ class Update {
|
|
|
3898
4463
|
return ret !== 0;
|
|
3899
4464
|
}
|
|
3900
4465
|
/**
|
|
4466
|
+
* Prune the update, removing unneeded data from transactions.
|
|
3901
4467
|
* @param {Wollet} wollet
|
|
3902
4468
|
*/
|
|
3903
4469
|
prune(wollet) {
|
|
@@ -3911,7 +4477,7 @@ const ValidatedLiquidexProposalFinalization = (typeof FinalizationRegistry === '
|
|
|
3911
4477
|
? { register: () => {}, unregister: () => {} }
|
|
3912
4478
|
: new FinalizationRegistry(ptr => wasm.__wbg_validatedliquidexproposal_free(ptr >>> 0, 1));
|
|
3913
4479
|
/**
|
|
3914
|
-
*
|
|
4480
|
+
* Created by validating `UnvalidatedLiquidexProposal` via `validate()` or `insecure_validate()`
|
|
3915
4481
|
*/
|
|
3916
4482
|
class ValidatedLiquidexProposal {
|
|
3917
4483
|
|
|
@@ -3977,7 +4543,9 @@ const WalletTxFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
3977
4543
|
? { register: () => {}, unregister: () => {} }
|
|
3978
4544
|
: new FinalizationRegistry(ptr => wasm.__wbg_wallettx_free(ptr >>> 0, 1));
|
|
3979
4545
|
/**
|
|
3980
|
-
*
|
|
4546
|
+
* Value returned by asking transactions to the wallet. Contains details about a transaction
|
|
4547
|
+
* from the perspective of the wallet, for example the net-balance of the transaction for the
|
|
4548
|
+
* wallet.
|
|
3981
4549
|
*/
|
|
3982
4550
|
class WalletTx {
|
|
3983
4551
|
|
|
@@ -4001,6 +4569,7 @@ class WalletTx {
|
|
|
4001
4569
|
wasm.__wbg_wallettx_free(ptr, 0);
|
|
4002
4570
|
}
|
|
4003
4571
|
/**
|
|
4572
|
+
* Return a copy of the transaction.
|
|
4004
4573
|
* @returns {Transaction}
|
|
4005
4574
|
*/
|
|
4006
4575
|
tx() {
|
|
@@ -4008,6 +4577,7 @@ class WalletTx {
|
|
|
4008
4577
|
return Transaction.__wrap(ret);
|
|
4009
4578
|
}
|
|
4010
4579
|
/**
|
|
4580
|
+
* Return the height of the block containing the transaction if it's confirmed.
|
|
4011
4581
|
* @returns {number | undefined}
|
|
4012
4582
|
*/
|
|
4013
4583
|
height() {
|
|
@@ -4015,16 +4585,15 @@ class WalletTx {
|
|
|
4015
4585
|
return ret === 0x100000001 ? undefined : ret;
|
|
4016
4586
|
}
|
|
4017
4587
|
/**
|
|
4018
|
-
*
|
|
4588
|
+
* Return the net balance of the transaction for the wallet.
|
|
4589
|
+
* @returns {Balance}
|
|
4019
4590
|
*/
|
|
4020
4591
|
balance() {
|
|
4021
4592
|
const ret = wasm.wallettx_balance(this.__wbg_ptr);
|
|
4022
|
-
|
|
4023
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
4024
|
-
}
|
|
4025
|
-
return takeFromExternrefTable0(ret[0]);
|
|
4593
|
+
return Balance.__wrap(ret);
|
|
4026
4594
|
}
|
|
4027
4595
|
/**
|
|
4596
|
+
* Return the transaction identifier.
|
|
4028
4597
|
* @returns {Txid}
|
|
4029
4598
|
*/
|
|
4030
4599
|
txid() {
|
|
@@ -4032,6 +4601,7 @@ class WalletTx {
|
|
|
4032
4601
|
return Txid.__wrap(ret);
|
|
4033
4602
|
}
|
|
4034
4603
|
/**
|
|
4604
|
+
* Return the fee of the transaction.
|
|
4035
4605
|
* @returns {bigint}
|
|
4036
4606
|
*/
|
|
4037
4607
|
fee() {
|
|
@@ -4039,6 +4609,7 @@ class WalletTx {
|
|
|
4039
4609
|
return BigInt.asUintN(64, ret);
|
|
4040
4610
|
}
|
|
4041
4611
|
/**
|
|
4612
|
+
* Return the type of the transaction. Can be "issuance", "reissuance", "burn", "redeposit", "incoming", "outgoing" or "unknown".
|
|
4042
4613
|
* @returns {string}
|
|
4043
4614
|
*/
|
|
4044
4615
|
txType() {
|
|
@@ -4054,6 +4625,7 @@ class WalletTx {
|
|
|
4054
4625
|
}
|
|
4055
4626
|
}
|
|
4056
4627
|
/**
|
|
4628
|
+
* Return the timestamp of the block containing the transaction if it's confirmed.
|
|
4057
4629
|
* @returns {number | undefined}
|
|
4058
4630
|
*/
|
|
4059
4631
|
timestamp() {
|
|
@@ -4061,6 +4633,9 @@ class WalletTx {
|
|
|
4061
4633
|
return ret === 0x100000001 ? undefined : ret;
|
|
4062
4634
|
}
|
|
4063
4635
|
/**
|
|
4636
|
+
* Return a list with the same number of elements as the inputs of the transaction.
|
|
4637
|
+
* The element in the list is a `WalletTxOut` (the output spent to create the input)
|
|
4638
|
+
* if it belongs to the wallet, while it is None for inputs owned by others
|
|
4064
4639
|
* @returns {OptionWalletTxOut[]}
|
|
4065
4640
|
*/
|
|
4066
4641
|
inputs() {
|
|
@@ -4070,6 +4645,9 @@ class WalletTx {
|
|
|
4070
4645
|
return v1;
|
|
4071
4646
|
}
|
|
4072
4647
|
/**
|
|
4648
|
+
* Return a list with the same number of elements as the outputs of the transaction.
|
|
4649
|
+
* The element in the list is a `WalletTxOut` if it belongs to the wallet,
|
|
4650
|
+
* while it is None for inputs owned by others
|
|
4073
4651
|
* @returns {OptionWalletTxOut[]}
|
|
4074
4652
|
*/
|
|
4075
4653
|
outputs() {
|
|
@@ -4079,6 +4657,8 @@ class WalletTx {
|
|
|
4079
4657
|
return v1;
|
|
4080
4658
|
}
|
|
4081
4659
|
/**
|
|
4660
|
+
* Return the URL to the transaction on the given explorer including the information
|
|
4661
|
+
* needed to unblind the transaction in the explorer UI.
|
|
4082
4662
|
* @param {string} explorer_url
|
|
4083
4663
|
* @returns {string}
|
|
4084
4664
|
*/
|
|
@@ -4103,7 +4683,7 @@ const WalletTxOutFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
4103
4683
|
? { register: () => {}, unregister: () => {} }
|
|
4104
4684
|
: new FinalizationRegistry(ptr => wasm.__wbg_wallettxout_free(ptr >>> 0, 1));
|
|
4105
4685
|
/**
|
|
4106
|
-
*
|
|
4686
|
+
* Details of a wallet transaction output used in `WalletTx`
|
|
4107
4687
|
*/
|
|
4108
4688
|
class WalletTxOut {
|
|
4109
4689
|
|
|
@@ -4127,6 +4707,7 @@ class WalletTxOut {
|
|
|
4127
4707
|
wasm.__wbg_wallettxout_free(ptr, 0);
|
|
4128
4708
|
}
|
|
4129
4709
|
/**
|
|
4710
|
+
* Return the outpoint (txid and vout) of this `WalletTxOut`.
|
|
4130
4711
|
* @returns {OutPoint}
|
|
4131
4712
|
*/
|
|
4132
4713
|
outpoint() {
|
|
@@ -4134,6 +4715,7 @@ class WalletTxOut {
|
|
|
4134
4715
|
return OutPoint.__wrap(ret);
|
|
4135
4716
|
}
|
|
4136
4717
|
/**
|
|
4718
|
+
* Return the script pubkey of the address of this `WalletTxOut`.
|
|
4137
4719
|
* @returns {Script}
|
|
4138
4720
|
*/
|
|
4139
4721
|
scriptPubkey() {
|
|
@@ -4141,6 +4723,7 @@ class WalletTxOut {
|
|
|
4141
4723
|
return Script.__wrap(ret);
|
|
4142
4724
|
}
|
|
4143
4725
|
/**
|
|
4726
|
+
* Return the height of the block containing this output if it's confirmed.
|
|
4144
4727
|
* @returns {number | undefined}
|
|
4145
4728
|
*/
|
|
4146
4729
|
height() {
|
|
@@ -4148,6 +4731,7 @@ class WalletTxOut {
|
|
|
4148
4731
|
return ret === 0x100000001 ? undefined : ret;
|
|
4149
4732
|
}
|
|
4150
4733
|
/**
|
|
4734
|
+
* Return the unblinded values of this `WalletTxOut`.
|
|
4151
4735
|
* @returns {TxOutSecrets}
|
|
4152
4736
|
*/
|
|
4153
4737
|
unblinded() {
|
|
@@ -4155,6 +4739,7 @@ class WalletTxOut {
|
|
|
4155
4739
|
return TxOutSecrets.__wrap(ret);
|
|
4156
4740
|
}
|
|
4157
4741
|
/**
|
|
4742
|
+
* Return the wildcard index used to derive the address of this `WalletTxOut`.
|
|
4158
4743
|
* @returns {number}
|
|
4159
4744
|
*/
|
|
4160
4745
|
wildcardIndex() {
|
|
@@ -4162,6 +4747,7 @@ class WalletTxOut {
|
|
|
4162
4747
|
return ret >>> 0;
|
|
4163
4748
|
}
|
|
4164
4749
|
/**
|
|
4750
|
+
* Return the chain of this `WalletTxOut`. Can be "Chain::External" or "Chain::Internal" (change).
|
|
4165
4751
|
* @returns {Chain}
|
|
4166
4752
|
*/
|
|
4167
4753
|
extInt() {
|
|
@@ -4169,6 +4755,7 @@ class WalletTxOut {
|
|
|
4169
4755
|
return ret;
|
|
4170
4756
|
}
|
|
4171
4757
|
/**
|
|
4758
|
+
* Return the address of this `WalletTxOut`.
|
|
4172
4759
|
* @returns {Address}
|
|
4173
4760
|
*/
|
|
4174
4761
|
address() {
|
|
@@ -4182,7 +4769,7 @@ const WolletFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
4182
4769
|
? { register: () => {}, unregister: () => {} }
|
|
4183
4770
|
: new FinalizationRegistry(ptr => wasm.__wbg_wollet_free(ptr >>> 0, 1));
|
|
4184
4771
|
/**
|
|
4185
|
-
*
|
|
4772
|
+
* A watch-only wallet defined by a CT descriptor.
|
|
4186
4773
|
*/
|
|
4187
4774
|
class Wollet {
|
|
4188
4775
|
|
|
@@ -4237,6 +4824,9 @@ class Wollet {
|
|
|
4237
4824
|
return AddressResult.__wrap(ret[0]);
|
|
4238
4825
|
}
|
|
4239
4826
|
/**
|
|
4827
|
+
* Get the full derivation path for an address
|
|
4828
|
+
*
|
|
4829
|
+
* Note: will be removed once we add the full path to lwk_wollet::AddressResult
|
|
4240
4830
|
* @param {number} index
|
|
4241
4831
|
* @returns {Uint32Array}
|
|
4242
4832
|
*/
|
|
@@ -4250,6 +4840,21 @@ class Wollet {
|
|
|
4250
4840
|
return v1;
|
|
4251
4841
|
}
|
|
4252
4842
|
/**
|
|
4843
|
+
* Apply an update containing blockchain data
|
|
4844
|
+
*
|
|
4845
|
+
* To update the wallet you need to first obtain the blockchain data relevant for the wallet.
|
|
4846
|
+
* This can be done using a `full_scan()`, which
|
|
4847
|
+
* returns an `Update` that contains new transaction and other data relevant for the
|
|
4848
|
+
* wallet.
|
|
4849
|
+
* The update must then be applied to the `Wollet` so that wollet methods such as
|
|
4850
|
+
* `balance()` or `transactions()` include the new data.
|
|
4851
|
+
*
|
|
4852
|
+
* However getting blockchain data involves network calls, so between the full scan start and
|
|
4853
|
+
* when the update is applied it might elapse a significant amount of time.
|
|
4854
|
+
* In that interval, applying any update, or any transaction using `apply_transaction()`,
|
|
4855
|
+
* will cause this function to return a `Error::UpdateOnDifferentStatus`.
|
|
4856
|
+
* Callers should either avoid applying updates and transactions, or they can catch the error
|
|
4857
|
+
* and wait for a new full scan to be completed and applied.
|
|
4253
4858
|
* @param {Update} update
|
|
4254
4859
|
*/
|
|
4255
4860
|
applyUpdate(update) {
|
|
@@ -4260,26 +4865,45 @@ class Wollet {
|
|
|
4260
4865
|
}
|
|
4261
4866
|
}
|
|
4262
4867
|
/**
|
|
4868
|
+
* Apply a transaction to the wallet state
|
|
4869
|
+
*
|
|
4870
|
+
* Wallet transactions are normally obtained using a `full_scan()`
|
|
4871
|
+
* and applying the result with `apply_update()`. However a
|
|
4872
|
+
* full scan involves network calls and it can take a significant amount of time.
|
|
4873
|
+
*
|
|
4874
|
+
* If the caller does not want to wait for a full scan containing the transaction, it can
|
|
4875
|
+
* apply the transaction to the wallet state using this function.
|
|
4876
|
+
*
|
|
4877
|
+
* Note: if this transaction is *not* returned by a next full scan, after `apply_update()` it will disappear from the
|
|
4878
|
+
* transactions list, will not be included in balance computations, and by the remaining
|
|
4879
|
+
* wollet methods.
|
|
4880
|
+
*
|
|
4881
|
+
* Calling this method, might cause `apply_update()` to fail with a
|
|
4882
|
+
* `Error::UpdateOnDifferentStatus`, make sure to either avoid it or handle the error properly.
|
|
4263
4883
|
* @param {Transaction} tx
|
|
4884
|
+
* @returns {Balance}
|
|
4264
4885
|
*/
|
|
4265
4886
|
applyTransaction(tx) {
|
|
4266
4887
|
_assertClass(tx, Transaction);
|
|
4267
4888
|
const ret = wasm.wollet_applyTransaction(this.__wbg_ptr, tx.__wbg_ptr);
|
|
4268
|
-
if (ret[
|
|
4269
|
-
throw takeFromExternrefTable0(ret[
|
|
4889
|
+
if (ret[2]) {
|
|
4890
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4270
4891
|
}
|
|
4892
|
+
return Balance.__wrap(ret[0]);
|
|
4271
4893
|
}
|
|
4272
4894
|
/**
|
|
4273
|
-
*
|
|
4895
|
+
* Get the wallet balance for each assets
|
|
4896
|
+
* @returns {Balance}
|
|
4274
4897
|
*/
|
|
4275
4898
|
balance() {
|
|
4276
4899
|
const ret = wasm.wollet_balance(this.__wbg_ptr);
|
|
4277
4900
|
if (ret[2]) {
|
|
4278
4901
|
throw takeFromExternrefTable0(ret[1]);
|
|
4279
4902
|
}
|
|
4280
|
-
return
|
|
4903
|
+
return Balance.__wrap(ret[0]);
|
|
4281
4904
|
}
|
|
4282
4905
|
/**
|
|
4906
|
+
* Get the asset identifiers owned by the wallet
|
|
4283
4907
|
* @returns {AssetIds}
|
|
4284
4908
|
*/
|
|
4285
4909
|
assetsOwned() {
|
|
@@ -4290,6 +4914,7 @@ class Wollet {
|
|
|
4290
4914
|
return AssetIds.__wrap(ret[0]);
|
|
4291
4915
|
}
|
|
4292
4916
|
/**
|
|
4917
|
+
* Get the wallet transactions
|
|
4293
4918
|
* @returns {WalletTx[]}
|
|
4294
4919
|
*/
|
|
4295
4920
|
transactions() {
|
|
@@ -4342,6 +4967,7 @@ class Wollet {
|
|
|
4342
4967
|
return Pset.__wrap(ret[0]);
|
|
4343
4968
|
}
|
|
4344
4969
|
/**
|
|
4970
|
+
* Get the PSET details with respect to the wallet
|
|
4345
4971
|
* @param {Pset} pset
|
|
4346
4972
|
* @returns {PsetDetails}
|
|
4347
4973
|
*/
|
|
@@ -4354,6 +4980,7 @@ class Wollet {
|
|
|
4354
4980
|
return PsetDetails.__wrap(ret[0]);
|
|
4355
4981
|
}
|
|
4356
4982
|
/**
|
|
4983
|
+
* Get a copy of the wallet descriptor of this wallet.
|
|
4357
4984
|
* @returns {WolletDescriptor}
|
|
4358
4985
|
*/
|
|
4359
4986
|
descriptor() {
|
|
@@ -4364,6 +4991,12 @@ class Wollet {
|
|
|
4364
4991
|
return WolletDescriptor.__wrap(ret[0]);
|
|
4365
4992
|
}
|
|
4366
4993
|
/**
|
|
4994
|
+
* A deterministic value derived from the descriptor, the config and the content of this wollet,
|
|
4995
|
+
* including what's in the wallet store (transactions etc)
|
|
4996
|
+
*
|
|
4997
|
+
* In this case, we don't need cryptographic assurance guaranteed by the std default hasher (siphash)
|
|
4998
|
+
* And we can use a much faster hasher, which is used also in the rust compiler.
|
|
4999
|
+
* ([source](https://nnethercote.github.io/2021/12/08/a-brutally-effective-hash-function-in-rust.html))
|
|
4367
5000
|
* @returns {bigint}
|
|
4368
5001
|
*/
|
|
4369
5002
|
status() {
|
|
@@ -4371,6 +5004,7 @@ class Wollet {
|
|
|
4371
5004
|
return BigInt.asUintN(64, ret);
|
|
4372
5005
|
}
|
|
4373
5006
|
/**
|
|
5007
|
+
* Get the blockchain tip at the time of the last update of this wollet.
|
|
4374
5008
|
* @returns {Tip}
|
|
4375
5009
|
*/
|
|
4376
5010
|
tip() {
|
|
@@ -4378,7 +5012,7 @@ class Wollet {
|
|
|
4378
5012
|
return Tip.__wrap(ret);
|
|
4379
5013
|
}
|
|
4380
5014
|
/**
|
|
4381
|
-
*
|
|
5015
|
+
* Returns true if this wollet has never received an updated applyed to it
|
|
4382
5016
|
* @returns {boolean}
|
|
4383
5017
|
*/
|
|
4384
5018
|
neverScanned() {
|
|
@@ -4400,7 +5034,7 @@ const WolletDescriptorFinalization = (typeof FinalizationRegistry === 'undefined
|
|
|
4400
5034
|
? { register: () => {}, unregister: () => {} }
|
|
4401
5035
|
: new FinalizationRegistry(ptr => wasm.__wbg_wolletdescriptor_free(ptr >>> 0, 1));
|
|
4402
5036
|
/**
|
|
4403
|
-
*
|
|
5037
|
+
* A wrapper that contains only the subset of CT descriptors handled by wollet
|
|
4404
5038
|
*/
|
|
4405
5039
|
class WolletDescriptor {
|
|
4406
5040
|
|
|
@@ -4439,6 +5073,8 @@ class WolletDescriptor {
|
|
|
4439
5073
|
return this;
|
|
4440
5074
|
}
|
|
4441
5075
|
/**
|
|
5076
|
+
* Return the string representation of the descriptor, including the checksum.
|
|
5077
|
+
* This representation can be used to recreate the descriptor via `new()`
|
|
4442
5078
|
* @returns {string}
|
|
4443
5079
|
*/
|
|
4444
5080
|
toString() {
|
|
@@ -4454,6 +5090,9 @@ class WolletDescriptor {
|
|
|
4454
5090
|
}
|
|
4455
5091
|
}
|
|
4456
5092
|
/**
|
|
5093
|
+
* Create a new multisig descriptor, where each participant is a keyorigin_xpub and it requires at least threshold signatures to spend.
|
|
5094
|
+
* Errors if the threshold is 0 or greater than the number of participants.
|
|
5095
|
+
* Uses slip77 for the blinding key.
|
|
4457
5096
|
* @param {number} threshold
|
|
4458
5097
|
* @param {string[]} participants
|
|
4459
5098
|
* @returns {WolletDescriptor}
|
|
@@ -4468,6 +5107,7 @@ class WolletDescriptor {
|
|
|
4468
5107
|
return WolletDescriptor.__wrap(ret[0]);
|
|
4469
5108
|
}
|
|
4470
5109
|
/**
|
|
5110
|
+
* Whether the descriptor is for mainnet
|
|
4471
5111
|
* @returns {boolean}
|
|
4472
5112
|
*/
|
|
4473
5113
|
isMainnet() {
|
|
@@ -4489,7 +5129,7 @@ const XpubFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
4489
5129
|
? { register: () => {}, unregister: () => {} }
|
|
4490
5130
|
: new FinalizationRegistry(ptr => wasm.__wbg_xpub_free(ptr >>> 0, 1));
|
|
4491
5131
|
/**
|
|
4492
|
-
*
|
|
5132
|
+
* An extended public key
|
|
4493
5133
|
*/
|
|
4494
5134
|
class Xpub {
|
|
4495
5135
|
|
|
@@ -4513,7 +5153,7 @@ class Xpub {
|
|
|
4513
5153
|
wasm.__wbg_xpub_free(ptr, 0);
|
|
4514
5154
|
}
|
|
4515
5155
|
/**
|
|
4516
|
-
* Creates a
|
|
5156
|
+
* Creates a Xpub
|
|
4517
5157
|
* @param {string} s
|
|
4518
5158
|
*/
|
|
4519
5159
|
constructor(s) {
|
|
@@ -4528,6 +5168,8 @@ class Xpub {
|
|
|
4528
5168
|
return this;
|
|
4529
5169
|
}
|
|
4530
5170
|
/**
|
|
5171
|
+
* Return the string representation of the Xpub.
|
|
5172
|
+
* This representation can be used to recreate the Xpub via `new()`
|
|
4531
5173
|
* @returns {string}
|
|
4532
5174
|
*/
|
|
4533
5175
|
toString() {
|
|
@@ -4543,6 +5185,8 @@ class Xpub {
|
|
|
4543
5185
|
}
|
|
4544
5186
|
}
|
|
4545
5187
|
/**
|
|
5188
|
+
* Return the identifier of the Xpub.
|
|
5189
|
+
* This is a 40 hex characters string (20 bytes).
|
|
4546
5190
|
* @returns {string}
|
|
4547
5191
|
*/
|
|
4548
5192
|
identifier() {
|
|
@@ -4558,6 +5202,8 @@ class Xpub {
|
|
|
4558
5202
|
}
|
|
4559
5203
|
}
|
|
4560
5204
|
/**
|
|
5205
|
+
* Return the first four bytes of the identifier as hex string
|
|
5206
|
+
* This is a 8 hex characters string (4 bytes).
|
|
4561
5207
|
* @returns {string}
|
|
4562
5208
|
*/
|
|
4563
5209
|
fingerprint() {
|
|
@@ -4573,7 +5219,8 @@ class Xpub {
|
|
|
4573
5219
|
}
|
|
4574
5220
|
}
|
|
4575
5221
|
/**
|
|
4576
|
-
* Returns true if the passed string is a valid xpub with a valid keyorigin if present
|
|
5222
|
+
* Returns true if the passed string is a valid xpub with a valid keyorigin if present.
|
|
5223
|
+
* For example: "[73c5da0a/84h/1h/0h]tpub..."
|
|
4577
5224
|
* @param {string} s
|
|
4578
5225
|
* @returns {boolean}
|
|
4579
5226
|
*/
|
|
@@ -4608,6 +5255,16 @@ module.exports.__wbg_amp0_new = function(arg0) {
|
|
|
4608
5255
|
return ret;
|
|
4609
5256
|
};
|
|
4610
5257
|
|
|
5258
|
+
module.exports.__wbg_amp0connected_new = function(arg0) {
|
|
5259
|
+
const ret = Amp0Connected.__wrap(arg0);
|
|
5260
|
+
return ret;
|
|
5261
|
+
};
|
|
5262
|
+
|
|
5263
|
+
module.exports.__wbg_amp0loggedin_new = function(arg0) {
|
|
5264
|
+
const ret = Amp0LoggedIn.__wrap(arg0);
|
|
5265
|
+
return ret;
|
|
5266
|
+
};
|
|
5267
|
+
|
|
4611
5268
|
module.exports.__wbg_append_8c7dd8d641a5f01b = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
4612
5269
|
arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
4613
5270
|
}, arguments) };
|
|
@@ -4652,6 +5309,11 @@ module.exports.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(fun
|
|
|
4652
5309
|
return ret;
|
|
4653
5310
|
}, arguments) };
|
|
4654
5311
|
|
|
5312
|
+
module.exports.__wbg_call_833bed5770ea2041 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
5313
|
+
const ret = arg0.call(arg1, arg2, arg3);
|
|
5314
|
+
return ret;
|
|
5315
|
+
}, arguments) };
|
|
5316
|
+
|
|
4655
5317
|
module.exports.__wbg_crypto_ed58b8e10a292839 = function(arg0) {
|
|
4656
5318
|
const ret = arg0.crypto;
|
|
4657
5319
|
return ret;
|
|
@@ -4821,7 +5483,7 @@ module.exports.__wbg_length_e2d2a49132c1b256 = function(arg0) {
|
|
|
4821
5483
|
return ret;
|
|
4822
5484
|
};
|
|
4823
5485
|
|
|
4824
|
-
module.exports.
|
|
5486
|
+
module.exports.__wbg_log_4dd7615accd2b3e2 = function(arg0, arg1) {
|
|
4825
5487
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
4826
5488
|
};
|
|
4827
5489
|
|
|
@@ -4852,7 +5514,7 @@ module.exports.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
|
|
|
4852
5514
|
const a = state0.a;
|
|
4853
5515
|
state0.a = 0;
|
|
4854
5516
|
try {
|
|
4855
|
-
return
|
|
5517
|
+
return __wbg_adapter_544(a, state0.b, arg0, arg1);
|
|
4856
5518
|
} finally {
|
|
4857
5519
|
state0.a = a;
|
|
4858
5520
|
}
|
|
@@ -5282,11 +5944,6 @@ module.exports.__wbindgen_bigint_from_i64 = function(arg0) {
|
|
|
5282
5944
|
return ret;
|
|
5283
5945
|
};
|
|
5284
5946
|
|
|
5285
|
-
module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
|
|
5286
|
-
const ret = BigInt.asUintN(64, arg0);
|
|
5287
|
-
return ret;
|
|
5288
|
-
};
|
|
5289
|
-
|
|
5290
5947
|
module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
5291
5948
|
const obj = arg0.original;
|
|
5292
5949
|
if (obj.cnt-- == 1) {
|
|
@@ -5297,23 +5954,23 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
|
5297
5954
|
return ret;
|
|
5298
5955
|
};
|
|
5299
5956
|
|
|
5300
|
-
module.exports.
|
|
5301
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
5957
|
+
module.exports.__wbindgen_closure_wrapper12924 = function(arg0, arg1, arg2) {
|
|
5958
|
+
const ret = makeMutClosure(arg0, arg1, 1371, __wbg_adapter_41);
|
|
5302
5959
|
return ret;
|
|
5303
5960
|
};
|
|
5304
5961
|
|
|
5305
|
-
module.exports.
|
|
5306
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
5962
|
+
module.exports.__wbindgen_closure_wrapper6187 = function(arg0, arg1, arg2) {
|
|
5963
|
+
const ret = makeMutClosure(arg0, arg1, 445, __wbg_adapter_34);
|
|
5307
5964
|
return ret;
|
|
5308
5965
|
};
|
|
5309
5966
|
|
|
5310
|
-
module.exports.
|
|
5311
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
5967
|
+
module.exports.__wbindgen_closure_wrapper6189 = function(arg0, arg1, arg2) {
|
|
5968
|
+
const ret = makeMutClosure(arg0, arg1, 446, __wbg_adapter_34);
|
|
5312
5969
|
return ret;
|
|
5313
5970
|
};
|
|
5314
5971
|
|
|
5315
|
-
module.exports.
|
|
5316
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
5972
|
+
module.exports.__wbindgen_closure_wrapper6191 = function(arg0, arg1, arg2) {
|
|
5973
|
+
const ret = makeMutClosure(arg0, arg1, 446, __wbg_adapter_34);
|
|
5317
5974
|
return ret;
|
|
5318
5975
|
};
|
|
5319
5976
|
|