react-native-bdk-sdk 0.1.4 → 0.1.5

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.
@@ -7,7 +7,7 @@
7
7
  /* eslint-disable */
8
8
  // @ts-nocheck
9
9
  import nativeModule from "./bdk_ffi-ffi.js";
10
- import { AbstractFfiConverterByteArray, FfiConverterArray, FfiConverterBool, FfiConverterFloat64, FfiConverterInt32, FfiConverterInt64, FfiConverterObject, FfiConverterOptional, FfiConverterUInt32, FfiConverterUInt64, FfiConverterUInt8, UniffiAbstractObject, UniffiEnum, UniffiError, UniffiInternalError, UniffiRustCaller, destructorGuardSymbol, pointerLiteralSymbol, uniffiCreateFfiConverterString, uniffiCreateRecord, uniffiRustCallAsync, uniffiTypeNameSymbol, variantOrdinalSymbol } from "uniffi-bindgen-react-native";
10
+ import { AbstractFfiConverterByteArray, FfiConverterArray, FfiConverterBool, FfiConverterFloat64, FfiConverterInt32, FfiConverterInt64, FfiConverterObject, FfiConverterOptional, FfiConverterUInt32, FfiConverterUInt64, FfiConverterUInt8, UniffiAbstractObject, UniffiEnum, UniffiError, UniffiInternalError, UniffiRustCaller, destructorGuardSymbol, pointerLiteralSymbol, uniffiCreateFfiConverterString, uniffiCreateRecord, uniffiRustCallAsync, uniffiTypeNameSymbol } from "uniffi-bindgen-react-native";
11
11
 
12
12
  // Get converters from the other files, if any.
13
13
  const uniffiCaller = new UniffiRustCaller(() => ({
@@ -22,8 +22,6 @@ process?.env?.NODE_ENV !== "production" || false;
22
22
 
23
23
  /**
24
24
  * Generate an output descriptor string from a mnemonic using a standard BIP template.
25
- * Returns a descriptor like "wpkh([fingerprint/84'/0'/0']xprv.../0/*)" for BIP84.
26
- * Uses Bip44/49/84/86 descriptor templates.
27
25
  */
28
26
  export function createDescriptor(mnemonic, template, keychain, network) /*throws*/{
29
27
  return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
@@ -31,9 +29,7 @@ export function createDescriptor(mnemonic, template, keychain, network) /*throws
31
29
  }, /*liftString:*/FfiConverterString.lift));
32
30
  }
33
31
  /**
34
- * Generate a public (watch-only) descriptor from an xpub string using a standard BIP template.
35
- * Returns a descriptor like "wpkh([fingerprint/84'/0'/0']xpub.../0/*)" for BIP84.
36
- * Uses Bip44Public/49Public/84Public/86Public descriptor templates.
32
+ * Generate a public (watch-only) descriptor from an xpub string.
37
33
  */
38
34
  export function createPublicDescriptor(xpub, template, keychain, network) /*throws*/{
39
35
  return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
@@ -42,16 +38,30 @@ export function createPublicDescriptor(xpub, template, keychain, network) /*thro
42
38
  }
43
39
  /**
44
40
  * Generate a single-key descriptor from a key string.
45
- * Uses P2Pkh, P2Wpkh, P2Wpkh_P2Sh, or P2TR templates.
46
41
  */
47
42
  export function createSingleKeyDescriptor(key, template, network) /*throws*/{
48
43
  return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
49
44
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_func_create_single_key_descriptor(FfiConverterString.lower(key), FfiConverterTypeSingleKeyDescriptorTemplate.lower(template), FfiConverterTypeNetwork.lower(network), callStatus);
50
45
  }, /*liftString:*/FfiConverterString.lift));
51
46
  }
47
+ /**
48
+ * Async wallet factory — creates or loads a wallet without blocking the JS thread.
49
+ */
50
+ export async function createWallet(descriptor, changeDescriptor, network, dbPath, asyncOpts_) /*throws*/{
51
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
52
+ try {
53
+ return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
54
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_func_create_wallet(FfiConverterString.lower(descriptor), FfiConverterString.lower(changeDescriptor), FfiConverterTypeNetwork.lower(network), FfiConverterString.lower(dbPath));
55
+ }, /*pollFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_poll_u64, /*cancelFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_cancel_u64, /*completeFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_complete_u64, /*freeFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_free_u64, /*liftFunc:*/FfiConverterTypeWallet.lift.bind(FfiConverterTypeWallet), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError));
56
+ } catch (__error) {
57
+ if (uniffiIsDebug && __error instanceof Error) {
58
+ __error.stack = __stack;
59
+ }
60
+ throw __error;
61
+ }
62
+ }
52
63
  /**
53
64
  * Export a wallet in FullyNoded-compatible JSON format for backup.
54
- * Mirrors bdk_wallet::export::FullyNodedExport.
55
65
  */
56
66
  export function exportWallet(wallet, label, includeBlockHeight) /*throws*/{
57
67
  return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
@@ -75,19 +85,13 @@ export function version() {
75
85
  }, /*liftString:*/FfiConverterString.lift));
76
86
  }
77
87
  /**
78
- * Compute a deterministic wallet name from its descriptors (useful for DB naming).
79
- * Mirrors bdk_wallet::wallet_name_from_descriptor().
88
+ * Compute a deterministic wallet name from its descriptors.
80
89
  */
81
90
  export function walletNameFromDescriptor(descriptor, changeDescriptor, network) /*throws*/{
82
91
  return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
83
92
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_func_wallet_name_from_descriptor(FfiConverterString.lower(descriptor), FfiConverterOptionalString.lower(changeDescriptor), FfiConverterTypeNetwork.lower(network), callStatus);
84
93
  }, /*liftString:*/FfiConverterString.lift));
85
94
  }
86
-
87
- /**
88
- * A derived address with its derivation index. Mirrors bdk_wallet::AddressInfo.
89
- */
90
-
91
95
  /**
92
96
  * Generated factory for {@link AddressInfo} record objects.
93
97
  */
@@ -122,12 +126,6 @@ const FfiConverterTypeAddressInfo = (() => {
122
126
  }
123
127
  return new FFIConverter();
124
128
  })();
125
-
126
- /**
127
- * Wallet balance split into categories. All values in satoshis.
128
- * Mirrors bdk_wallet::Balance (re-exported from bdk_chain).
129
- */
130
-
131
129
  /**
132
130
  * Generated factory for {@link Balance} record objects.
133
131
  */
@@ -168,11 +166,6 @@ const FfiConverterTypeBalance = (() => {
168
166
  }
169
167
  return new FFIConverter();
170
168
  })();
171
-
172
- /**
173
- * A block identifier (height + hash). Mirrors bdk_chain::BlockId.
174
- */
175
-
176
169
  /**
177
170
  * Generated factory for {@link BlockId} record objects.
178
171
  */
@@ -205,12 +198,6 @@ const FfiConverterTypeBlockId = (() => {
205
198
  }
206
199
  return new FFIConverter();
207
200
  })();
208
-
209
- /**
210
- * Block position for a confirmed transaction/output.
211
- * Mirrors bdk_chain::ConfirmationBlockTime.
212
- */
213
-
214
201
  /**
215
202
  * Generated factory for {@link ConfirmationBlockTime} record objects.
216
203
  */
@@ -245,11 +232,6 @@ const FfiConverterTypeConfirmationBlockTime = (() => {
245
232
  }
246
233
  return new FFIConverter();
247
234
  })();
248
-
249
- /**
250
- * Derivation info for a scriptPubKey belonging to the wallet.
251
- */
252
-
253
235
  /**
254
236
  * Generated factory for {@link DerivationInfo} record objects.
255
237
  */
@@ -282,11 +264,6 @@ const FfiConverterTypeDerivationInfo = (() => {
282
264
  }
283
265
  return new FFIConverter();
284
266
  })();
285
-
286
- /**
287
- * Info about a keychain and its associated descriptor.
288
- */
289
-
290
267
  /**
291
268
  * Generated factory for {@link KeychainInfo} record objects.
292
269
  */
@@ -319,11 +296,6 @@ const FfiConverterTypeKeychainInfo = (() => {
319
296
  }
320
297
  return new FFIConverter();
321
298
  })();
322
-
323
- /**
324
- * A wallet-owned output (spent or unspent). Mirrors bdk_wallet::LocalOutput.
325
- */
326
-
327
299
  /**
328
300
  * Generated factory for {@link LocalOutput} record objects.
329
301
  */
@@ -364,11 +336,6 @@ const FfiConverterTypeLocalOutput = (() => {
364
336
  }
365
337
  return new FFIConverter();
366
338
  })();
367
-
368
- /**
369
- * Reference to a specific transaction output. Mirrors bitcoin::OutPoint.
370
- */
371
-
372
339
  /**
373
340
  * Generated factory for {@link OutPoint} record objects.
374
341
  */
@@ -401,11 +368,6 @@ const FfiConverterTypeOutPoint = (() => {
401
368
  }
402
369
  return new FFIConverter();
403
370
  })();
404
-
405
- /**
406
- * A single payment recipient.
407
- */
408
-
409
371
  /**
410
372
  * Generated factory for {@link Recipient} record objects.
411
373
  */
@@ -438,11 +400,6 @@ const FfiConverterTypeRecipient = (() => {
438
400
  }
439
401
  return new FFIConverter();
440
402
  })();
441
-
442
- /**
443
- * How much was sent from / received into the wallet for a given transaction.
444
- */
445
-
446
403
  /**
447
404
  * Generated factory for {@link SentAndReceived} record objects.
448
405
  */
@@ -475,11 +432,6 @@ const FfiConverterTypeSentAndReceived = (() => {
475
432
  }
476
433
  return new FFIConverter();
477
434
  })();
478
-
479
- /**
480
- * Full details of a wallet-relevant transaction. Mirrors bdk_wallet::TxDetails.
481
- */
482
-
483
435
  /**
484
436
  * Generated factory for {@link TxDetails} record objects.
485
437
  */
@@ -524,11 +476,6 @@ const FfiConverterTypeTxDetails = (() => {
524
476
  }
525
477
  return new FFIConverter();
526
478
  })();
527
-
528
- /**
529
- * A transaction output (value + locking script). Mirrors bitcoin::TxOut.
530
- */
531
-
532
479
  /**
533
480
  * Generated factory for {@link TxOut} record objects.
534
481
  */
@@ -568,7 +515,9 @@ const stringConverter = {
568
515
  };
569
516
  const FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
570
517
 
571
- // Flat error type: BdkError
518
+ // Error type: BdkError
519
+
520
+ // Enum: BdkError
572
521
  export let BdkError_Tags = /*#__PURE__*/function (BdkError_Tags) {
573
522
  BdkError_Tags["InvalidDescriptor"] = "InvalidDescriptor";
574
523
  BdkError_Tags["WalletCreationFailed"] = "WalletCreationFailed";
@@ -621,1110 +570,2106 @@ export let BdkError_Tags = /*#__PURE__*/function (BdkError_Tags) {
621
570
  return BdkError_Tags;
622
571
  }({});
623
572
  export const BdkError = (() => {
624
- class InvalidDescriptor extends UniffiError {
573
+ class InvalidDescriptor_ extends UniffiError {
625
574
  /**
626
575
  * @private
627
- * This field is private and should not be used.
576
+ * This field is private and should not be used, use `tag` instead.
628
577
  */
629
578
  [uniffiTypeNameSymbol] = "BdkError";
630
- /**
631
- * @private
632
- * This field is private and should not be used.
633
- */
634
- [variantOrdinalSymbol] = 1;
635
579
  tag = BdkError_Tags.InvalidDescriptor;
636
- constructor(message) {
637
- super("BdkError", "InvalidDescriptor", message);
580
+ constructor(inner) {
581
+ super("BdkError", "InvalidDescriptor");
582
+ this.inner = Object.freeze(inner);
583
+ }
584
+ static new(inner) {
585
+ return new InvalidDescriptor_(inner);
586
+ }
587
+ static instanceOf(obj) {
588
+ return obj.tag === BdkError_Tags.InvalidDescriptor;
589
+ }
590
+ static hasInner(obj) {
591
+ return InvalidDescriptor_.instanceOf(obj);
638
592
  }
639
- static instanceOf(e) {
640
- return instanceOf(e) && e[variantOrdinalSymbol] === 1;
593
+ static getInner(obj) {
594
+ return obj.inner;
641
595
  }
642
596
  }
643
- class WalletCreationFailed extends UniffiError {
597
+ class WalletCreationFailed_ extends UniffiError {
644
598
  /**
645
599
  * @private
646
- * This field is private and should not be used.
600
+ * This field is private and should not be used, use `tag` instead.
647
601
  */
648
602
  [uniffiTypeNameSymbol] = "BdkError";
649
- /**
650
- * @private
651
- * This field is private and should not be used.
652
- */
653
- [variantOrdinalSymbol] = 2;
654
603
  tag = BdkError_Tags.WalletCreationFailed;
655
- constructor(message) {
656
- super("BdkError", "WalletCreationFailed", message);
604
+ constructor(inner) {
605
+ super("BdkError", "WalletCreationFailed");
606
+ this.inner = Object.freeze(inner);
607
+ }
608
+ static new(inner) {
609
+ return new WalletCreationFailed_(inner);
657
610
  }
658
- static instanceOf(e) {
659
- return instanceOf(e) && e[variantOrdinalSymbol] === 2;
611
+ static instanceOf(obj) {
612
+ return obj.tag === BdkError_Tags.WalletCreationFailed;
613
+ }
614
+ static hasInner(obj) {
615
+ return WalletCreationFailed_.instanceOf(obj);
616
+ }
617
+ static getInner(obj) {
618
+ return obj.inner;
660
619
  }
661
620
  }
662
- class WalletLoadFailed extends UniffiError {
621
+ class WalletLoadFailed_ extends UniffiError {
663
622
  /**
664
623
  * @private
665
- * This field is private and should not be used.
624
+ * This field is private and should not be used, use `tag` instead.
666
625
  */
667
626
  [uniffiTypeNameSymbol] = "BdkError";
668
- /**
669
- * @private
670
- * This field is private and should not be used.
671
- */
672
- [variantOrdinalSymbol] = 3;
673
627
  tag = BdkError_Tags.WalletLoadFailed;
674
- constructor(message) {
675
- super("BdkError", "WalletLoadFailed", message);
628
+ constructor(inner) {
629
+ super("BdkError", "WalletLoadFailed");
630
+ this.inner = Object.freeze(inner);
631
+ }
632
+ static new(inner) {
633
+ return new WalletLoadFailed_(inner);
634
+ }
635
+ static instanceOf(obj) {
636
+ return obj.tag === BdkError_Tags.WalletLoadFailed;
637
+ }
638
+ static hasInner(obj) {
639
+ return WalletLoadFailed_.instanceOf(obj);
676
640
  }
677
- static instanceOf(e) {
678
- return instanceOf(e) && e[variantOrdinalSymbol] === 3;
641
+ static getInner(obj) {
642
+ return obj.inner;
679
643
  }
680
644
  }
681
- class WalletLoadMismatch extends UniffiError {
645
+ class WalletLoadMismatch_ extends UniffiError {
682
646
  /**
683
647
  * @private
684
- * This field is private and should not be used.
648
+ * This field is private and should not be used, use `tag` instead.
685
649
  */
686
650
  [uniffiTypeNameSymbol] = "BdkError";
687
- /**
688
- * @private
689
- * This field is private and should not be used.
690
- */
691
- [variantOrdinalSymbol] = 4;
692
651
  tag = BdkError_Tags.WalletLoadMismatch;
693
- constructor(message) {
694
- super("BdkError", "WalletLoadMismatch", message);
652
+ constructor(inner) {
653
+ super("BdkError", "WalletLoadMismatch");
654
+ this.inner = Object.freeze(inner);
655
+ }
656
+ static new(inner) {
657
+ return new WalletLoadMismatch_(inner);
658
+ }
659
+ static instanceOf(obj) {
660
+ return obj.tag === BdkError_Tags.WalletLoadMismatch;
695
661
  }
696
- static instanceOf(e) {
697
- return instanceOf(e) && e[variantOrdinalSymbol] === 4;
662
+ static hasInner(obj) {
663
+ return WalletLoadMismatch_.instanceOf(obj);
664
+ }
665
+ static getInner(obj) {
666
+ return obj.inner;
698
667
  }
699
668
  }
700
- class PersistError extends UniffiError {
669
+ class PersistError_ extends UniffiError {
701
670
  /**
702
671
  * @private
703
- * This field is private and should not be used.
672
+ * This field is private and should not be used, use `tag` instead.
704
673
  */
705
674
  [uniffiTypeNameSymbol] = "BdkError";
706
- /**
707
- * @private
708
- * This field is private and should not be used.
709
- */
710
- [variantOrdinalSymbol] = 5;
711
675
  tag = BdkError_Tags.PersistError;
712
- constructor(message) {
713
- super("BdkError", "PersistError", message);
676
+ constructor(inner) {
677
+ super("BdkError", "PersistError");
678
+ this.inner = Object.freeze(inner);
679
+ }
680
+ static new(inner) {
681
+ return new PersistError_(inner);
682
+ }
683
+ static instanceOf(obj) {
684
+ return obj.tag === BdkError_Tags.PersistError;
685
+ }
686
+ static hasInner(obj) {
687
+ return PersistError_.instanceOf(obj);
714
688
  }
715
- static instanceOf(e) {
716
- return instanceOf(e) && e[variantOrdinalSymbol] === 5;
689
+ static getInner(obj) {
690
+ return obj.inner;
717
691
  }
718
692
  }
719
- class InvalidAddress extends UniffiError {
693
+ class InvalidAddress_ extends UniffiError {
720
694
  /**
721
695
  * @private
722
- * This field is private and should not be used.
696
+ * This field is private and should not be used, use `tag` instead.
723
697
  */
724
698
  [uniffiTypeNameSymbol] = "BdkError";
725
- /**
726
- * @private
727
- * This field is private and should not be used.
728
- */
729
- [variantOrdinalSymbol] = 6;
730
699
  tag = BdkError_Tags.InvalidAddress;
731
- constructor(message) {
732
- super("BdkError", "InvalidAddress", message);
700
+ constructor(inner) {
701
+ super("BdkError", "InvalidAddress");
702
+ this.inner = Object.freeze(inner);
703
+ }
704
+ static new(inner) {
705
+ return new InvalidAddress_(inner);
733
706
  }
734
- static instanceOf(e) {
735
- return instanceOf(e) && e[variantOrdinalSymbol] === 6;
707
+ static instanceOf(obj) {
708
+ return obj.tag === BdkError_Tags.InvalidAddress;
709
+ }
710
+ static hasInner(obj) {
711
+ return InvalidAddress_.instanceOf(obj);
712
+ }
713
+ static getInner(obj) {
714
+ return obj.inner;
736
715
  }
737
716
  }
738
- class InvalidScript extends UniffiError {
717
+ class InvalidScript_ extends UniffiError {
739
718
  /**
740
719
  * @private
741
- * This field is private and should not be used.
720
+ * This field is private and should not be used, use `tag` instead.
742
721
  */
743
722
  [uniffiTypeNameSymbol] = "BdkError";
744
- /**
745
- * @private
746
- * This field is private and should not be used.
747
- */
748
- [variantOrdinalSymbol] = 7;
749
723
  tag = BdkError_Tags.InvalidScript;
750
- constructor(message) {
751
- super("BdkError", "InvalidScript", message);
724
+ constructor(inner) {
725
+ super("BdkError", "InvalidScript");
726
+ this.inner = Object.freeze(inner);
727
+ }
728
+ static new(inner) {
729
+ return new InvalidScript_(inner);
730
+ }
731
+ static instanceOf(obj) {
732
+ return obj.tag === BdkError_Tags.InvalidScript;
733
+ }
734
+ static hasInner(obj) {
735
+ return InvalidScript_.instanceOf(obj);
752
736
  }
753
- static instanceOf(e) {
754
- return instanceOf(e) && e[variantOrdinalSymbol] === 7;
737
+ static getInner(obj) {
738
+ return obj.inner;
755
739
  }
756
740
  }
757
- class TransactionBuildFailed extends UniffiError {
741
+ class TransactionBuildFailed_ extends UniffiError {
758
742
  /**
759
743
  * @private
760
- * This field is private and should not be used.
744
+ * This field is private and should not be used, use `tag` instead.
761
745
  */
762
746
  [uniffiTypeNameSymbol] = "BdkError";
763
- /**
764
- * @private
765
- * This field is private and should not be used.
766
- */
767
- [variantOrdinalSymbol] = 8;
768
747
  tag = BdkError_Tags.TransactionBuildFailed;
769
- constructor(message) {
770
- super("BdkError", "TransactionBuildFailed", message);
748
+ constructor(inner) {
749
+ super("BdkError", "TransactionBuildFailed");
750
+ this.inner = Object.freeze(inner);
771
751
  }
772
- static instanceOf(e) {
773
- return instanceOf(e) && e[variantOrdinalSymbol] === 8;
752
+ static new(inner) {
753
+ return new TransactionBuildFailed_(inner);
754
+ }
755
+ static instanceOf(obj) {
756
+ return obj.tag === BdkError_Tags.TransactionBuildFailed;
757
+ }
758
+ static hasInner(obj) {
759
+ return TransactionBuildFailed_.instanceOf(obj);
760
+ }
761
+ static getInner(obj) {
762
+ return obj.inner;
774
763
  }
775
764
  }
776
- class NoRecipients extends UniffiError {
765
+ class NoRecipients_ extends UniffiError {
777
766
  /**
778
767
  * @private
779
- * This field is private and should not be used.
768
+ * This field is private and should not be used, use `tag` instead.
780
769
  */
781
770
  [uniffiTypeNameSymbol] = "BdkError";
782
- /**
783
- * @private
784
- * This field is private and should not be used.
785
- */
786
- [variantOrdinalSymbol] = 9;
787
771
  tag = BdkError_Tags.NoRecipients;
788
- constructor(message) {
789
- super("BdkError", "NoRecipients", message);
772
+ constructor(inner) {
773
+ super("BdkError", "NoRecipients");
774
+ this.inner = Object.freeze(inner);
775
+ }
776
+ static new(inner) {
777
+ return new NoRecipients_(inner);
778
+ }
779
+ static instanceOf(obj) {
780
+ return obj.tag === BdkError_Tags.NoRecipients;
781
+ }
782
+ static hasInner(obj) {
783
+ return NoRecipients_.instanceOf(obj);
790
784
  }
791
- static instanceOf(e) {
792
- return instanceOf(e) && e[variantOrdinalSymbol] === 9;
785
+ static getInner(obj) {
786
+ return obj.inner;
793
787
  }
794
788
  }
795
- class NoUtxosSelected extends UniffiError {
789
+ class NoUtxosSelected_ extends UniffiError {
796
790
  /**
797
791
  * @private
798
- * This field is private and should not be used.
792
+ * This field is private and should not be used, use `tag` instead.
799
793
  */
800
794
  [uniffiTypeNameSymbol] = "BdkError";
801
- /**
802
- * @private
803
- * This field is private and should not be used.
804
- */
805
- [variantOrdinalSymbol] = 10;
806
795
  tag = BdkError_Tags.NoUtxosSelected;
807
- constructor(message) {
808
- super("BdkError", "NoUtxosSelected", message);
796
+ constructor(inner) {
797
+ super("BdkError", "NoUtxosSelected");
798
+ this.inner = Object.freeze(inner);
799
+ }
800
+ static new(inner) {
801
+ return new NoUtxosSelected_(inner);
809
802
  }
810
- static instanceOf(e) {
811
- return instanceOf(e) && e[variantOrdinalSymbol] === 10;
803
+ static instanceOf(obj) {
804
+ return obj.tag === BdkError_Tags.NoUtxosSelected;
805
+ }
806
+ static hasInner(obj) {
807
+ return NoUtxosSelected_.instanceOf(obj);
808
+ }
809
+ static getInner(obj) {
810
+ return obj.inner;
812
811
  }
813
812
  }
814
- class OutputBelowDustLimit extends UniffiError {
813
+ class OutputBelowDustLimit_ extends UniffiError {
815
814
  /**
816
815
  * @private
817
- * This field is private and should not be used.
816
+ * This field is private and should not be used, use `tag` instead.
818
817
  */
819
818
  [uniffiTypeNameSymbol] = "BdkError";
820
- /**
821
- * @private
822
- * This field is private and should not be used.
823
- */
824
- [variantOrdinalSymbol] = 11;
825
819
  tag = BdkError_Tags.OutputBelowDustLimit;
826
- constructor(message) {
827
- super("BdkError", "OutputBelowDustLimit", message);
820
+ constructor(inner) {
821
+ super("BdkError", "OutputBelowDustLimit");
822
+ this.inner = Object.freeze(inner);
823
+ }
824
+ static new(inner) {
825
+ return new OutputBelowDustLimit_(inner);
826
+ }
827
+ static instanceOf(obj) {
828
+ return obj.tag === BdkError_Tags.OutputBelowDustLimit;
829
+ }
830
+ static hasInner(obj) {
831
+ return OutputBelowDustLimit_.instanceOf(obj);
828
832
  }
829
- static instanceOf(e) {
830
- return instanceOf(e) && e[variantOrdinalSymbol] === 11;
833
+ static getInner(obj) {
834
+ return obj.inner;
831
835
  }
832
836
  }
833
- class InsufficientFunds extends UniffiError {
837
+ class InsufficientFunds_ extends UniffiError {
834
838
  /**
835
839
  * @private
836
- * This field is private and should not be used.
840
+ * This field is private and should not be used, use `tag` instead.
837
841
  */
838
842
  [uniffiTypeNameSymbol] = "BdkError";
839
- /**
840
- * @private
841
- * This field is private and should not be used.
842
- */
843
- [variantOrdinalSymbol] = 12;
844
843
  tag = BdkError_Tags.InsufficientFunds;
845
- constructor(message) {
846
- super("BdkError", "InsufficientFunds", message);
844
+ constructor(inner) {
845
+ super("BdkError", "InsufficientFunds");
846
+ this.inner = Object.freeze(inner);
847
+ }
848
+ static new(inner) {
849
+ return new InsufficientFunds_(inner);
850
+ }
851
+ static instanceOf(obj) {
852
+ return obj.tag === BdkError_Tags.InsufficientFunds;
847
853
  }
848
- static instanceOf(e) {
849
- return instanceOf(e) && e[variantOrdinalSymbol] === 12;
854
+ static hasInner(obj) {
855
+ return InsufficientFunds_.instanceOf(obj);
856
+ }
857
+ static getInner(obj) {
858
+ return obj.inner;
850
859
  }
851
860
  }
852
- class FeeRateTooLow extends UniffiError {
861
+ class FeeRateTooLow_ extends UniffiError {
853
862
  /**
854
863
  * @private
855
- * This field is private and should not be used.
864
+ * This field is private and should not be used, use `tag` instead.
856
865
  */
857
866
  [uniffiTypeNameSymbol] = "BdkError";
858
- /**
859
- * @private
860
- * This field is private and should not be used.
861
- */
862
- [variantOrdinalSymbol] = 13;
863
867
  tag = BdkError_Tags.FeeRateTooLow;
864
- constructor(message) {
865
- super("BdkError", "FeeRateTooLow", message);
868
+ constructor(inner) {
869
+ super("BdkError", "FeeRateTooLow");
870
+ this.inner = Object.freeze(inner);
871
+ }
872
+ static new(inner) {
873
+ return new FeeRateTooLow_(inner);
874
+ }
875
+ static instanceOf(obj) {
876
+ return obj.tag === BdkError_Tags.FeeRateTooLow;
877
+ }
878
+ static hasInner(obj) {
879
+ return FeeRateTooLow_.instanceOf(obj);
866
880
  }
867
- static instanceOf(e) {
868
- return instanceOf(e) && e[variantOrdinalSymbol] === 13;
881
+ static getInner(obj) {
882
+ return obj.inner;
869
883
  }
870
884
  }
871
- class FeeTooLow extends UniffiError {
885
+ class FeeTooLow_ extends UniffiError {
872
886
  /**
873
887
  * @private
874
- * This field is private and should not be used.
888
+ * This field is private and should not be used, use `tag` instead.
875
889
  */
876
890
  [uniffiTypeNameSymbol] = "BdkError";
877
- /**
878
- * @private
879
- * This field is private and should not be used.
880
- */
881
- [variantOrdinalSymbol] = 14;
882
891
  tag = BdkError_Tags.FeeTooLow;
883
- constructor(message) {
884
- super("BdkError", "FeeTooLow", message);
892
+ constructor(inner) {
893
+ super("BdkError", "FeeTooLow");
894
+ this.inner = Object.freeze(inner);
895
+ }
896
+ static new(inner) {
897
+ return new FeeTooLow_(inner);
885
898
  }
886
- static instanceOf(e) {
887
- return instanceOf(e) && e[variantOrdinalSymbol] === 14;
899
+ static instanceOf(obj) {
900
+ return obj.tag === BdkError_Tags.FeeTooLow;
901
+ }
902
+ static hasInner(obj) {
903
+ return FeeTooLow_.instanceOf(obj);
904
+ }
905
+ static getInner(obj) {
906
+ return obj.inner;
888
907
  }
889
908
  }
890
- class LockTimeConflict extends UniffiError {
909
+ class LockTimeConflict_ extends UniffiError {
891
910
  /**
892
911
  * @private
893
- * This field is private and should not be used.
912
+ * This field is private and should not be used, use `tag` instead.
894
913
  */
895
914
  [uniffiTypeNameSymbol] = "BdkError";
896
- /**
897
- * @private
898
- * This field is private and should not be used.
899
- */
900
- [variantOrdinalSymbol] = 15;
901
915
  tag = BdkError_Tags.LockTimeConflict;
902
- constructor(message) {
903
- super("BdkError", "LockTimeConflict", message);
916
+ constructor(inner) {
917
+ super("BdkError", "LockTimeConflict");
918
+ this.inner = Object.freeze(inner);
919
+ }
920
+ static new(inner) {
921
+ return new LockTimeConflict_(inner);
922
+ }
923
+ static instanceOf(obj) {
924
+ return obj.tag === BdkError_Tags.LockTimeConflict;
925
+ }
926
+ static hasInner(obj) {
927
+ return LockTimeConflict_.instanceOf(obj);
904
928
  }
905
- static instanceOf(e) {
906
- return instanceOf(e) && e[variantOrdinalSymbol] === 15;
929
+ static getInner(obj) {
930
+ return obj.inner;
907
931
  }
908
932
  }
909
- class RbfSequenceConflict extends UniffiError {
933
+ class RbfSequenceConflict_ extends UniffiError {
910
934
  /**
911
935
  * @private
912
- * This field is private and should not be used.
936
+ * This field is private and should not be used, use `tag` instead.
913
937
  */
914
938
  [uniffiTypeNameSymbol] = "BdkError";
915
- /**
916
- * @private
917
- * This field is private and should not be used.
918
- */
919
- [variantOrdinalSymbol] = 16;
920
939
  tag = BdkError_Tags.RbfSequenceConflict;
921
- constructor(message) {
922
- super("BdkError", "RbfSequenceConflict", message);
940
+ constructor(inner) {
941
+ super("BdkError", "RbfSequenceConflict");
942
+ this.inner = Object.freeze(inner);
923
943
  }
924
- static instanceOf(e) {
925
- return instanceOf(e) && e[variantOrdinalSymbol] === 16;
944
+ static new(inner) {
945
+ return new RbfSequenceConflict_(inner);
946
+ }
947
+ static instanceOf(obj) {
948
+ return obj.tag === BdkError_Tags.RbfSequenceConflict;
949
+ }
950
+ static hasInner(obj) {
951
+ return RbfSequenceConflict_.instanceOf(obj);
952
+ }
953
+ static getInner(obj) {
954
+ return obj.inner;
926
955
  }
927
956
  }
928
- class VersionZero extends UniffiError {
957
+ class VersionZero_ extends UniffiError {
929
958
  /**
930
959
  * @private
931
- * This field is private and should not be used.
960
+ * This field is private and should not be used, use `tag` instead.
932
961
  */
933
962
  [uniffiTypeNameSymbol] = "BdkError";
934
- /**
935
- * @private
936
- * This field is private and should not be used.
937
- */
938
- [variantOrdinalSymbol] = 17;
939
963
  tag = BdkError_Tags.VersionZero;
940
- constructor(message) {
941
- super("BdkError", "VersionZero", message);
964
+ constructor(inner) {
965
+ super("BdkError", "VersionZero");
966
+ this.inner = Object.freeze(inner);
967
+ }
968
+ static new(inner) {
969
+ return new VersionZero_(inner);
970
+ }
971
+ static instanceOf(obj) {
972
+ return obj.tag === BdkError_Tags.VersionZero;
973
+ }
974
+ static hasInner(obj) {
975
+ return VersionZero_.instanceOf(obj);
942
976
  }
943
- static instanceOf(e) {
944
- return instanceOf(e) && e[variantOrdinalSymbol] === 17;
977
+ static getInner(obj) {
978
+ return obj.inner;
945
979
  }
946
980
  }
947
- class VersionOneCsv extends UniffiError {
981
+ class VersionOneCsv_ extends UniffiError {
948
982
  /**
949
983
  * @private
950
- * This field is private and should not be used.
984
+ * This field is private and should not be used, use `tag` instead.
951
985
  */
952
986
  [uniffiTypeNameSymbol] = "BdkError";
953
- /**
954
- * @private
955
- * This field is private and should not be used.
956
- */
957
- [variantOrdinalSymbol] = 18;
958
987
  tag = BdkError_Tags.VersionOneCsv;
959
- constructor(message) {
960
- super("BdkError", "VersionOneCsv", message);
988
+ constructor(inner) {
989
+ super("BdkError", "VersionOneCsv");
990
+ this.inner = Object.freeze(inner);
991
+ }
992
+ static new(inner) {
993
+ return new VersionOneCsv_(inner);
961
994
  }
962
- static instanceOf(e) {
963
- return instanceOf(e) && e[variantOrdinalSymbol] === 18;
995
+ static instanceOf(obj) {
996
+ return obj.tag === BdkError_Tags.VersionOneCsv;
997
+ }
998
+ static hasInner(obj) {
999
+ return VersionOneCsv_.instanceOf(obj);
1000
+ }
1001
+ static getInner(obj) {
1002
+ return obj.inner;
964
1003
  }
965
1004
  }
966
- class SpendingPolicyRequired extends UniffiError {
1005
+ class SpendingPolicyRequired_ extends UniffiError {
967
1006
  /**
968
1007
  * @private
969
- * This field is private and should not be used.
1008
+ * This field is private and should not be used, use `tag` instead.
970
1009
  */
971
1010
  [uniffiTypeNameSymbol] = "BdkError";
972
- /**
973
- * @private
974
- * This field is private and should not be used.
975
- */
976
- [variantOrdinalSymbol] = 19;
977
1011
  tag = BdkError_Tags.SpendingPolicyRequired;
978
- constructor(message) {
979
- super("BdkError", "SpendingPolicyRequired", message);
980
- }
981
- static instanceOf(e) {
982
- return instanceOf(e) && e[variantOrdinalSymbol] === 19;
1012
+ constructor(inner) {
1013
+ super("BdkError", "SpendingPolicyRequired");
1014
+ this.inner = Object.freeze(inner);
1015
+ }
1016
+ static new(inner) {
1017
+ return new SpendingPolicyRequired_(inner);
1018
+ }
1019
+ static instanceOf(obj) {
1020
+ return obj.tag === BdkError_Tags.SpendingPolicyRequired;
1021
+ }
1022
+ static hasInner(obj) {
1023
+ return SpendingPolicyRequired_.instanceOf(obj);
1024
+ }
1025
+ static getInner(obj) {
1026
+ return obj.inner;
983
1027
  }
984
1028
  }
985
- class MissingKeyOrigin extends UniffiError {
1029
+ class MissingKeyOrigin_ extends UniffiError {
986
1030
  /**
987
1031
  * @private
988
- * This field is private and should not be used.
1032
+ * This field is private and should not be used, use `tag` instead.
989
1033
  */
990
1034
  [uniffiTypeNameSymbol] = "BdkError";
991
- /**
992
- * @private
993
- * This field is private and should not be used.
994
- */
995
- [variantOrdinalSymbol] = 20;
996
1035
  tag = BdkError_Tags.MissingKeyOrigin;
997
- constructor(message) {
998
- super("BdkError", "MissingKeyOrigin", message);
1036
+ constructor(inner) {
1037
+ super("BdkError", "MissingKeyOrigin");
1038
+ this.inner = Object.freeze(inner);
1039
+ }
1040
+ static new(inner) {
1041
+ return new MissingKeyOrigin_(inner);
999
1042
  }
1000
- static instanceOf(e) {
1001
- return instanceOf(e) && e[variantOrdinalSymbol] === 20;
1043
+ static instanceOf(obj) {
1044
+ return obj.tag === BdkError_Tags.MissingKeyOrigin;
1045
+ }
1046
+ static hasInner(obj) {
1047
+ return MissingKeyOrigin_.instanceOf(obj);
1048
+ }
1049
+ static getInner(obj) {
1050
+ return obj.inner;
1002
1051
  }
1003
1052
  }
1004
- class MissingNonWitnessUtxo extends UniffiError {
1053
+ class MissingNonWitnessUtxo_ extends UniffiError {
1005
1054
  /**
1006
1055
  * @private
1007
- * This field is private and should not be used.
1056
+ * This field is private and should not be used, use `tag` instead.
1008
1057
  */
1009
1058
  [uniffiTypeNameSymbol] = "BdkError";
1010
- /**
1011
- * @private
1012
- * This field is private and should not be used.
1013
- */
1014
- [variantOrdinalSymbol] = 21;
1015
1059
  tag = BdkError_Tags.MissingNonWitnessUtxo;
1016
- constructor(message) {
1017
- super("BdkError", "MissingNonWitnessUtxo", message);
1060
+ constructor(inner) {
1061
+ super("BdkError", "MissingNonWitnessUtxo");
1062
+ this.inner = Object.freeze(inner);
1063
+ }
1064
+ static new(inner) {
1065
+ return new MissingNonWitnessUtxo_(inner);
1066
+ }
1067
+ static instanceOf(obj) {
1068
+ return obj.tag === BdkError_Tags.MissingNonWitnessUtxo;
1069
+ }
1070
+ static hasInner(obj) {
1071
+ return MissingNonWitnessUtxo_.instanceOf(obj);
1018
1072
  }
1019
- static instanceOf(e) {
1020
- return instanceOf(e) && e[variantOrdinalSymbol] === 21;
1073
+ static getInner(obj) {
1074
+ return obj.inner;
1021
1075
  }
1022
1076
  }
1023
- class OutpointNotFound extends UniffiError {
1077
+ class OutpointNotFound_ extends UniffiError {
1024
1078
  /**
1025
1079
  * @private
1026
- * This field is private and should not be used.
1080
+ * This field is private and should not be used, use `tag` instead.
1027
1081
  */
1028
1082
  [uniffiTypeNameSymbol] = "BdkError";
1029
- /**
1030
- * @private
1031
- * This field is private and should not be used.
1032
- */
1033
- [variantOrdinalSymbol] = 22;
1034
1083
  tag = BdkError_Tags.OutpointNotFound;
1035
- constructor(message) {
1036
- super("BdkError", "OutpointNotFound", message);
1084
+ constructor(inner) {
1085
+ super("BdkError", "OutpointNotFound");
1086
+ this.inner = Object.freeze(inner);
1087
+ }
1088
+ static new(inner) {
1089
+ return new OutpointNotFound_(inner);
1090
+ }
1091
+ static instanceOf(obj) {
1092
+ return obj.tag === BdkError_Tags.OutpointNotFound;
1037
1093
  }
1038
- static instanceOf(e) {
1039
- return instanceOf(e) && e[variantOrdinalSymbol] === 22;
1094
+ static hasInner(obj) {
1095
+ return OutpointNotFound_.instanceOf(obj);
1096
+ }
1097
+ static getInner(obj) {
1098
+ return obj.inner;
1040
1099
  }
1041
1100
  }
1042
- class FeeBumpTargetNotFound extends UniffiError {
1101
+ class FeeBumpTargetNotFound_ extends UniffiError {
1043
1102
  /**
1044
1103
  * @private
1045
- * This field is private and should not be used.
1104
+ * This field is private and should not be used, use `tag` instead.
1046
1105
  */
1047
1106
  [uniffiTypeNameSymbol] = "BdkError";
1048
- /**
1049
- * @private
1050
- * This field is private and should not be used.
1051
- */
1052
- [variantOrdinalSymbol] = 23;
1053
1107
  tag = BdkError_Tags.FeeBumpTargetNotFound;
1054
- constructor(message) {
1055
- super("BdkError", "FeeBumpTargetNotFound", message);
1108
+ constructor(inner) {
1109
+ super("BdkError", "FeeBumpTargetNotFound");
1110
+ this.inner = Object.freeze(inner);
1111
+ }
1112
+ static new(inner) {
1113
+ return new FeeBumpTargetNotFound_(inner);
1114
+ }
1115
+ static instanceOf(obj) {
1116
+ return obj.tag === BdkError_Tags.FeeBumpTargetNotFound;
1117
+ }
1118
+ static hasInner(obj) {
1119
+ return FeeBumpTargetNotFound_.instanceOf(obj);
1056
1120
  }
1057
- static instanceOf(e) {
1058
- return instanceOf(e) && e[variantOrdinalSymbol] === 23;
1121
+ static getInner(obj) {
1122
+ return obj.inner;
1059
1123
  }
1060
1124
  }
1061
- class FeeBumpAlreadyConfirmed extends UniffiError {
1125
+ class FeeBumpAlreadyConfirmed_ extends UniffiError {
1062
1126
  /**
1063
1127
  * @private
1064
- * This field is private and should not be used.
1128
+ * This field is private and should not be used, use `tag` instead.
1065
1129
  */
1066
1130
  [uniffiTypeNameSymbol] = "BdkError";
1067
- /**
1068
- * @private
1069
- * This field is private and should not be used.
1070
- */
1071
- [variantOrdinalSymbol] = 24;
1072
1131
  tag = BdkError_Tags.FeeBumpAlreadyConfirmed;
1073
- constructor(message) {
1074
- super("BdkError", "FeeBumpAlreadyConfirmed", message);
1132
+ constructor(inner) {
1133
+ super("BdkError", "FeeBumpAlreadyConfirmed");
1134
+ this.inner = Object.freeze(inner);
1135
+ }
1136
+ static new(inner) {
1137
+ return new FeeBumpAlreadyConfirmed_(inner);
1075
1138
  }
1076
- static instanceOf(e) {
1077
- return instanceOf(e) && e[variantOrdinalSymbol] === 24;
1139
+ static instanceOf(obj) {
1140
+ return obj.tag === BdkError_Tags.FeeBumpAlreadyConfirmed;
1141
+ }
1142
+ static hasInner(obj) {
1143
+ return FeeBumpAlreadyConfirmed_.instanceOf(obj);
1144
+ }
1145
+ static getInner(obj) {
1146
+ return obj.inner;
1078
1147
  }
1079
1148
  }
1080
- class FeeBumpIrreplaceable extends UniffiError {
1149
+ class FeeBumpIrreplaceable_ extends UniffiError {
1081
1150
  /**
1082
1151
  * @private
1083
- * This field is private and should not be used.
1152
+ * This field is private and should not be used, use `tag` instead.
1084
1153
  */
1085
1154
  [uniffiTypeNameSymbol] = "BdkError";
1086
- /**
1087
- * @private
1088
- * This field is private and should not be used.
1089
- */
1090
- [variantOrdinalSymbol] = 25;
1091
1155
  tag = BdkError_Tags.FeeBumpIrreplaceable;
1092
- constructor(message) {
1093
- super("BdkError", "FeeBumpIrreplaceable", message);
1156
+ constructor(inner) {
1157
+ super("BdkError", "FeeBumpIrreplaceable");
1158
+ this.inner = Object.freeze(inner);
1159
+ }
1160
+ static new(inner) {
1161
+ return new FeeBumpIrreplaceable_(inner);
1162
+ }
1163
+ static instanceOf(obj) {
1164
+ return obj.tag === BdkError_Tags.FeeBumpIrreplaceable;
1165
+ }
1166
+ static hasInner(obj) {
1167
+ return FeeBumpIrreplaceable_.instanceOf(obj);
1094
1168
  }
1095
- static instanceOf(e) {
1096
- return instanceOf(e) && e[variantOrdinalSymbol] === 25;
1169
+ static getInner(obj) {
1170
+ return obj.inner;
1097
1171
  }
1098
1172
  }
1099
- class FeeBumpFeeRateUnavailable extends UniffiError {
1173
+ class FeeBumpFeeRateUnavailable_ extends UniffiError {
1100
1174
  /**
1101
1175
  * @private
1102
- * This field is private and should not be used.
1176
+ * This field is private and should not be used, use `tag` instead.
1103
1177
  */
1104
1178
  [uniffiTypeNameSymbol] = "BdkError";
1105
- /**
1106
- * @private
1107
- * This field is private and should not be used.
1108
- */
1109
- [variantOrdinalSymbol] = 26;
1110
1179
  tag = BdkError_Tags.FeeBumpFeeRateUnavailable;
1111
- constructor(message) {
1112
- super("BdkError", "FeeBumpFeeRateUnavailable", message);
1180
+ constructor(inner) {
1181
+ super("BdkError", "FeeBumpFeeRateUnavailable");
1182
+ this.inner = Object.freeze(inner);
1113
1183
  }
1114
- static instanceOf(e) {
1115
- return instanceOf(e) && e[variantOrdinalSymbol] === 26;
1184
+ static new(inner) {
1185
+ return new FeeBumpFeeRateUnavailable_(inner);
1186
+ }
1187
+ static instanceOf(obj) {
1188
+ return obj.tag === BdkError_Tags.FeeBumpFeeRateUnavailable;
1189
+ }
1190
+ static hasInner(obj) {
1191
+ return FeeBumpFeeRateUnavailable_.instanceOf(obj);
1192
+ }
1193
+ static getInner(obj) {
1194
+ return obj.inner;
1116
1195
  }
1117
1196
  }
1118
- class FeeBumpInvalidOutputIndex extends UniffiError {
1197
+ class FeeBumpInvalidOutputIndex_ extends UniffiError {
1119
1198
  /**
1120
1199
  * @private
1121
- * This field is private and should not be used.
1200
+ * This field is private and should not be used, use `tag` instead.
1122
1201
  */
1123
1202
  [uniffiTypeNameSymbol] = "BdkError";
1124
- /**
1125
- * @private
1126
- * This field is private and should not be used.
1127
- */
1128
- [variantOrdinalSymbol] = 27;
1129
1203
  tag = BdkError_Tags.FeeBumpInvalidOutputIndex;
1130
- constructor(message) {
1131
- super("BdkError", "FeeBumpInvalidOutputIndex", message);
1204
+ constructor(inner) {
1205
+ super("BdkError", "FeeBumpInvalidOutputIndex");
1206
+ this.inner = Object.freeze(inner);
1207
+ }
1208
+ static new(inner) {
1209
+ return new FeeBumpInvalidOutputIndex_(inner);
1210
+ }
1211
+ static instanceOf(obj) {
1212
+ return obj.tag === BdkError_Tags.FeeBumpInvalidOutputIndex;
1213
+ }
1214
+ static hasInner(obj) {
1215
+ return FeeBumpInvalidOutputIndex_.instanceOf(obj);
1132
1216
  }
1133
- static instanceOf(e) {
1134
- return instanceOf(e) && e[variantOrdinalSymbol] === 27;
1217
+ static getInner(obj) {
1218
+ return obj.inner;
1135
1219
  }
1136
1220
  }
1137
- class InvalidPsbt extends UniffiError {
1221
+ class InvalidPsbt_ extends UniffiError {
1138
1222
  /**
1139
1223
  * @private
1140
- * This field is private and should not be used.
1224
+ * This field is private and should not be used, use `tag` instead.
1141
1225
  */
1142
1226
  [uniffiTypeNameSymbol] = "BdkError";
1143
- /**
1144
- * @private
1145
- * This field is private and should not be used.
1146
- */
1147
- [variantOrdinalSymbol] = 28;
1148
1227
  tag = BdkError_Tags.InvalidPsbt;
1149
- constructor(message) {
1150
- super("BdkError", "InvalidPsbt", message);
1228
+ constructor(inner) {
1229
+ super("BdkError", "InvalidPsbt");
1230
+ this.inner = Object.freeze(inner);
1231
+ }
1232
+ static new(inner) {
1233
+ return new InvalidPsbt_(inner);
1151
1234
  }
1152
- static instanceOf(e) {
1153
- return instanceOf(e) && e[variantOrdinalSymbol] === 28;
1235
+ static instanceOf(obj) {
1236
+ return obj.tag === BdkError_Tags.InvalidPsbt;
1237
+ }
1238
+ static hasInner(obj) {
1239
+ return InvalidPsbt_.instanceOf(obj);
1240
+ }
1241
+ static getInner(obj) {
1242
+ return obj.inner;
1154
1243
  }
1155
1244
  }
1156
- class SignFailed extends UniffiError {
1245
+ class SignFailed_ extends UniffiError {
1157
1246
  /**
1158
1247
  * @private
1159
- * This field is private and should not be used.
1248
+ * This field is private and should not be used, use `tag` instead.
1160
1249
  */
1161
1250
  [uniffiTypeNameSymbol] = "BdkError";
1162
- /**
1163
- * @private
1164
- * This field is private and should not be used.
1165
- */
1166
- [variantOrdinalSymbol] = 29;
1167
1251
  tag = BdkError_Tags.SignFailed;
1168
- constructor(message) {
1169
- super("BdkError", "SignFailed", message);
1252
+ constructor(inner) {
1253
+ super("BdkError", "SignFailed");
1254
+ this.inner = Object.freeze(inner);
1255
+ }
1256
+ static new(inner) {
1257
+ return new SignFailed_(inner);
1258
+ }
1259
+ static instanceOf(obj) {
1260
+ return obj.tag === BdkError_Tags.SignFailed;
1261
+ }
1262
+ static hasInner(obj) {
1263
+ return SignFailed_.instanceOf(obj);
1170
1264
  }
1171
- static instanceOf(e) {
1172
- return instanceOf(e) && e[variantOrdinalSymbol] === 29;
1265
+ static getInner(obj) {
1266
+ return obj.inner;
1173
1267
  }
1174
1268
  }
1175
- class SignerMissingKey extends UniffiError {
1269
+ class SignerMissingKey_ extends UniffiError {
1176
1270
  /**
1177
1271
  * @private
1178
- * This field is private and should not be used.
1272
+ * This field is private and should not be used, use `tag` instead.
1179
1273
  */
1180
1274
  [uniffiTypeNameSymbol] = "BdkError";
1181
- /**
1182
- * @private
1183
- * This field is private and should not be used.
1184
- */
1185
- [variantOrdinalSymbol] = 30;
1186
1275
  tag = BdkError_Tags.SignerMissingKey;
1187
- constructor(message) {
1188
- super("BdkError", "SignerMissingKey", message);
1276
+ constructor(inner) {
1277
+ super("BdkError", "SignerMissingKey");
1278
+ this.inner = Object.freeze(inner);
1279
+ }
1280
+ static new(inner) {
1281
+ return new SignerMissingKey_(inner);
1282
+ }
1283
+ static instanceOf(obj) {
1284
+ return obj.tag === BdkError_Tags.SignerMissingKey;
1189
1285
  }
1190
- static instanceOf(e) {
1191
- return instanceOf(e) && e[variantOrdinalSymbol] === 30;
1286
+ static hasInner(obj) {
1287
+ return SignerMissingKey_.instanceOf(obj);
1288
+ }
1289
+ static getInner(obj) {
1290
+ return obj.inner;
1192
1291
  }
1193
1292
  }
1194
- class SignerInvalidKey extends UniffiError {
1293
+ class SignerInvalidKey_ extends UniffiError {
1195
1294
  /**
1196
1295
  * @private
1197
- * This field is private and should not be used.
1296
+ * This field is private and should not be used, use `tag` instead.
1198
1297
  */
1199
1298
  [uniffiTypeNameSymbol] = "BdkError";
1200
- /**
1201
- * @private
1202
- * This field is private and should not be used.
1203
- */
1204
- [variantOrdinalSymbol] = 31;
1205
1299
  tag = BdkError_Tags.SignerInvalidKey;
1206
- constructor(message) {
1207
- super("BdkError", "SignerInvalidKey", message);
1300
+ constructor(inner) {
1301
+ super("BdkError", "SignerInvalidKey");
1302
+ this.inner = Object.freeze(inner);
1303
+ }
1304
+ static new(inner) {
1305
+ return new SignerInvalidKey_(inner);
1306
+ }
1307
+ static instanceOf(obj) {
1308
+ return obj.tag === BdkError_Tags.SignerInvalidKey;
1309
+ }
1310
+ static hasInner(obj) {
1311
+ return SignerInvalidKey_.instanceOf(obj);
1208
1312
  }
1209
- static instanceOf(e) {
1210
- return instanceOf(e) && e[variantOrdinalSymbol] === 31;
1313
+ static getInner(obj) {
1314
+ return obj.inner;
1211
1315
  }
1212
1316
  }
1213
- class SignerUserCanceled extends UniffiError {
1317
+ class SignerUserCanceled_ extends UniffiError {
1214
1318
  /**
1215
1319
  * @private
1216
- * This field is private and should not be used.
1320
+ * This field is private and should not be used, use `tag` instead.
1217
1321
  */
1218
1322
  [uniffiTypeNameSymbol] = "BdkError";
1219
- /**
1220
- * @private
1221
- * This field is private and should not be used.
1222
- */
1223
- [variantOrdinalSymbol] = 32;
1224
1323
  tag = BdkError_Tags.SignerUserCanceled;
1225
- constructor(message) {
1226
- super("BdkError", "SignerUserCanceled", message);
1324
+ constructor(inner) {
1325
+ super("BdkError", "SignerUserCanceled");
1326
+ this.inner = Object.freeze(inner);
1327
+ }
1328
+ static new(inner) {
1329
+ return new SignerUserCanceled_(inner);
1227
1330
  }
1228
- static instanceOf(e) {
1229
- return instanceOf(e) && e[variantOrdinalSymbol] === 32;
1331
+ static instanceOf(obj) {
1332
+ return obj.tag === BdkError_Tags.SignerUserCanceled;
1333
+ }
1334
+ static hasInner(obj) {
1335
+ return SignerUserCanceled_.instanceOf(obj);
1336
+ }
1337
+ static getInner(obj) {
1338
+ return obj.inner;
1230
1339
  }
1231
1340
  }
1232
- class SignerInputIndexOutOfRange extends UniffiError {
1341
+ class SignerInputIndexOutOfRange_ extends UniffiError {
1233
1342
  /**
1234
1343
  * @private
1235
- * This field is private and should not be used.
1344
+ * This field is private and should not be used, use `tag` instead.
1236
1345
  */
1237
1346
  [uniffiTypeNameSymbol] = "BdkError";
1238
- /**
1239
- * @private
1240
- * This field is private and should not be used.
1241
- */
1242
- [variantOrdinalSymbol] = 33;
1243
1347
  tag = BdkError_Tags.SignerInputIndexOutOfRange;
1244
- constructor(message) {
1245
- super("BdkError", "SignerInputIndexOutOfRange", message);
1348
+ constructor(inner) {
1349
+ super("BdkError", "SignerInputIndexOutOfRange");
1350
+ this.inner = Object.freeze(inner);
1351
+ }
1352
+ static new(inner) {
1353
+ return new SignerInputIndexOutOfRange_(inner);
1354
+ }
1355
+ static instanceOf(obj) {
1356
+ return obj.tag === BdkError_Tags.SignerInputIndexOutOfRange;
1357
+ }
1358
+ static hasInner(obj) {
1359
+ return SignerInputIndexOutOfRange_.instanceOf(obj);
1246
1360
  }
1247
- static instanceOf(e) {
1248
- return instanceOf(e) && e[variantOrdinalSymbol] === 33;
1361
+ static getInner(obj) {
1362
+ return obj.inner;
1249
1363
  }
1250
1364
  }
1251
- class SignerMissingNonWitnessUtxo extends UniffiError {
1365
+ class SignerMissingNonWitnessUtxo_ extends UniffiError {
1252
1366
  /**
1253
1367
  * @private
1254
- * This field is private and should not be used.
1368
+ * This field is private and should not be used, use `tag` instead.
1255
1369
  */
1256
1370
  [uniffiTypeNameSymbol] = "BdkError";
1257
- /**
1258
- * @private
1259
- * This field is private and should not be used.
1260
- */
1261
- [variantOrdinalSymbol] = 34;
1262
1371
  tag = BdkError_Tags.SignerMissingNonWitnessUtxo;
1263
- constructor(message) {
1264
- super("BdkError", "SignerMissingNonWitnessUtxo", message);
1372
+ constructor(inner) {
1373
+ super("BdkError", "SignerMissingNonWitnessUtxo");
1374
+ this.inner = Object.freeze(inner);
1265
1375
  }
1266
- static instanceOf(e) {
1267
- return instanceOf(e) && e[variantOrdinalSymbol] === 34;
1376
+ static new(inner) {
1377
+ return new SignerMissingNonWitnessUtxo_(inner);
1378
+ }
1379
+ static instanceOf(obj) {
1380
+ return obj.tag === BdkError_Tags.SignerMissingNonWitnessUtxo;
1381
+ }
1382
+ static hasInner(obj) {
1383
+ return SignerMissingNonWitnessUtxo_.instanceOf(obj);
1384
+ }
1385
+ static getInner(obj) {
1386
+ return obj.inner;
1268
1387
  }
1269
1388
  }
1270
- class SignerMissingWitnessUtxo extends UniffiError {
1389
+ class SignerMissingWitnessUtxo_ extends UniffiError {
1271
1390
  /**
1272
1391
  * @private
1273
- * This field is private and should not be used.
1392
+ * This field is private and should not be used, use `tag` instead.
1274
1393
  */
1275
1394
  [uniffiTypeNameSymbol] = "BdkError";
1276
- /**
1277
- * @private
1278
- * This field is private and should not be used.
1279
- */
1280
- [variantOrdinalSymbol] = 35;
1281
1395
  tag = BdkError_Tags.SignerMissingWitnessUtxo;
1282
- constructor(message) {
1283
- super("BdkError", "SignerMissingWitnessUtxo", message);
1396
+ constructor(inner) {
1397
+ super("BdkError", "SignerMissingWitnessUtxo");
1398
+ this.inner = Object.freeze(inner);
1399
+ }
1400
+ static new(inner) {
1401
+ return new SignerMissingWitnessUtxo_(inner);
1402
+ }
1403
+ static instanceOf(obj) {
1404
+ return obj.tag === BdkError_Tags.SignerMissingWitnessUtxo;
1405
+ }
1406
+ static hasInner(obj) {
1407
+ return SignerMissingWitnessUtxo_.instanceOf(obj);
1284
1408
  }
1285
- static instanceOf(e) {
1286
- return instanceOf(e) && e[variantOrdinalSymbol] === 35;
1409
+ static getInner(obj) {
1410
+ return obj.inner;
1287
1411
  }
1288
1412
  }
1289
- class SignerMissingWitnessScript extends UniffiError {
1413
+ class SignerMissingWitnessScript_ extends UniffiError {
1290
1414
  /**
1291
1415
  * @private
1292
- * This field is private and should not be used.
1416
+ * This field is private and should not be used, use `tag` instead.
1293
1417
  */
1294
1418
  [uniffiTypeNameSymbol] = "BdkError";
1295
- /**
1296
- * @private
1297
- * This field is private and should not be used.
1298
- */
1299
- [variantOrdinalSymbol] = 36;
1300
1419
  tag = BdkError_Tags.SignerMissingWitnessScript;
1301
- constructor(message) {
1302
- super("BdkError", "SignerMissingWitnessScript", message);
1420
+ constructor(inner) {
1421
+ super("BdkError", "SignerMissingWitnessScript");
1422
+ this.inner = Object.freeze(inner);
1423
+ }
1424
+ static new(inner) {
1425
+ return new SignerMissingWitnessScript_(inner);
1303
1426
  }
1304
- static instanceOf(e) {
1305
- return instanceOf(e) && e[variantOrdinalSymbol] === 36;
1427
+ static instanceOf(obj) {
1428
+ return obj.tag === BdkError_Tags.SignerMissingWitnessScript;
1429
+ }
1430
+ static hasInner(obj) {
1431
+ return SignerMissingWitnessScript_.instanceOf(obj);
1432
+ }
1433
+ static getInner(obj) {
1434
+ return obj.inner;
1306
1435
  }
1307
1436
  }
1308
- class SignerNonStandardSighash extends UniffiError {
1437
+ class SignerNonStandardSighash_ extends UniffiError {
1309
1438
  /**
1310
1439
  * @private
1311
- * This field is private and should not be used.
1440
+ * This field is private and should not be used, use `tag` instead.
1312
1441
  */
1313
1442
  [uniffiTypeNameSymbol] = "BdkError";
1314
- /**
1315
- * @private
1316
- * This field is private and should not be used.
1317
- */
1318
- [variantOrdinalSymbol] = 37;
1319
1443
  tag = BdkError_Tags.SignerNonStandardSighash;
1320
- constructor(message) {
1321
- super("BdkError", "SignerNonStandardSighash", message);
1444
+ constructor(inner) {
1445
+ super("BdkError", "SignerNonStandardSighash");
1446
+ this.inner = Object.freeze(inner);
1447
+ }
1448
+ static new(inner) {
1449
+ return new SignerNonStandardSighash_(inner);
1450
+ }
1451
+ static instanceOf(obj) {
1452
+ return obj.tag === BdkError_Tags.SignerNonStandardSighash;
1453
+ }
1454
+ static hasInner(obj) {
1455
+ return SignerNonStandardSighash_.instanceOf(obj);
1322
1456
  }
1323
- static instanceOf(e) {
1324
- return instanceOf(e) && e[variantOrdinalSymbol] === 37;
1457
+ static getInner(obj) {
1458
+ return obj.inner;
1325
1459
  }
1326
1460
  }
1327
- class SignerInvalidSighash extends UniffiError {
1461
+ class SignerInvalidSighash_ extends UniffiError {
1328
1462
  /**
1329
1463
  * @private
1330
- * This field is private and should not be used.
1464
+ * This field is private and should not be used, use `tag` instead.
1331
1465
  */
1332
1466
  [uniffiTypeNameSymbol] = "BdkError";
1333
- /**
1334
- * @private
1335
- * This field is private and should not be used.
1336
- */
1337
- [variantOrdinalSymbol] = 38;
1338
1467
  tag = BdkError_Tags.SignerInvalidSighash;
1339
- constructor(message) {
1340
- super("BdkError", "SignerInvalidSighash", message);
1468
+ constructor(inner) {
1469
+ super("BdkError", "SignerInvalidSighash");
1470
+ this.inner = Object.freeze(inner);
1471
+ }
1472
+ static new(inner) {
1473
+ return new SignerInvalidSighash_(inner);
1474
+ }
1475
+ static instanceOf(obj) {
1476
+ return obj.tag === BdkError_Tags.SignerInvalidSighash;
1341
1477
  }
1342
- static instanceOf(e) {
1343
- return instanceOf(e) && e[variantOrdinalSymbol] === 38;
1478
+ static hasInner(obj) {
1479
+ return SignerInvalidSighash_.instanceOf(obj);
1480
+ }
1481
+ static getInner(obj) {
1482
+ return obj.inner;
1344
1483
  }
1345
1484
  }
1346
- class SyncFailed extends UniffiError {
1485
+ class SyncFailed_ extends UniffiError {
1347
1486
  /**
1348
1487
  * @private
1349
- * This field is private and should not be used.
1488
+ * This field is private and should not be used, use `tag` instead.
1350
1489
  */
1351
1490
  [uniffiTypeNameSymbol] = "BdkError";
1352
- /**
1353
- * @private
1354
- * This field is private and should not be used.
1355
- */
1356
- [variantOrdinalSymbol] = 39;
1357
1491
  tag = BdkError_Tags.SyncFailed;
1358
- constructor(message) {
1359
- super("BdkError", "SyncFailed", message);
1492
+ constructor(inner) {
1493
+ super("BdkError", "SyncFailed");
1494
+ this.inner = Object.freeze(inner);
1495
+ }
1496
+ static new(inner) {
1497
+ return new SyncFailed_(inner);
1498
+ }
1499
+ static instanceOf(obj) {
1500
+ return obj.tag === BdkError_Tags.SyncFailed;
1501
+ }
1502
+ static hasInner(obj) {
1503
+ return SyncFailed_.instanceOf(obj);
1360
1504
  }
1361
- static instanceOf(e) {
1362
- return instanceOf(e) && e[variantOrdinalSymbol] === 39;
1505
+ static getInner(obj) {
1506
+ return obj.inner;
1363
1507
  }
1364
1508
  }
1365
- class BroadcastFailed extends UniffiError {
1509
+ class BroadcastFailed_ extends UniffiError {
1366
1510
  /**
1367
1511
  * @private
1368
- * This field is private and should not be used.
1512
+ * This field is private and should not be used, use `tag` instead.
1369
1513
  */
1370
1514
  [uniffiTypeNameSymbol] = "BdkError";
1371
- /**
1372
- * @private
1373
- * This field is private and should not be used.
1374
- */
1375
- [variantOrdinalSymbol] = 40;
1376
1515
  tag = BdkError_Tags.BroadcastFailed;
1377
- constructor(message) {
1378
- super("BdkError", "BroadcastFailed", message);
1516
+ constructor(inner) {
1517
+ super("BdkError", "BroadcastFailed");
1518
+ this.inner = Object.freeze(inner);
1519
+ }
1520
+ static new(inner) {
1521
+ return new BroadcastFailed_(inner);
1379
1522
  }
1380
- static instanceOf(e) {
1381
- return instanceOf(e) && e[variantOrdinalSymbol] === 40;
1523
+ static instanceOf(obj) {
1524
+ return obj.tag === BdkError_Tags.BroadcastFailed;
1525
+ }
1526
+ static hasInner(obj) {
1527
+ return BroadcastFailed_.instanceOf(obj);
1528
+ }
1529
+ static getInner(obj) {
1530
+ return obj.inner;
1382
1531
  }
1383
1532
  }
1384
- class InvalidTransaction extends UniffiError {
1533
+ class InvalidTransaction_ extends UniffiError {
1385
1534
  /**
1386
1535
  * @private
1387
- * This field is private and should not be used.
1536
+ * This field is private and should not be used, use `tag` instead.
1388
1537
  */
1389
1538
  [uniffiTypeNameSymbol] = "BdkError";
1390
- /**
1391
- * @private
1392
- * This field is private and should not be used.
1393
- */
1394
- [variantOrdinalSymbol] = 41;
1395
1539
  tag = BdkError_Tags.InvalidTransaction;
1396
- constructor(message) {
1397
- super("BdkError", "InvalidTransaction", message);
1540
+ constructor(inner) {
1541
+ super("BdkError", "InvalidTransaction");
1542
+ this.inner = Object.freeze(inner);
1543
+ }
1544
+ static new(inner) {
1545
+ return new InvalidTransaction_(inner);
1546
+ }
1547
+ static instanceOf(obj) {
1548
+ return obj.tag === BdkError_Tags.InvalidTransaction;
1549
+ }
1550
+ static hasInner(obj) {
1551
+ return InvalidTransaction_.instanceOf(obj);
1398
1552
  }
1399
- static instanceOf(e) {
1400
- return instanceOf(e) && e[variantOrdinalSymbol] === 41;
1553
+ static getInner(obj) {
1554
+ return obj.inner;
1401
1555
  }
1402
1556
  }
1403
- class TransactionNotFound extends UniffiError {
1557
+ class TransactionNotFound_ extends UniffiError {
1404
1558
  /**
1405
1559
  * @private
1406
- * This field is private and should not be used.
1560
+ * This field is private and should not be used, use `tag` instead.
1407
1561
  */
1408
1562
  [uniffiTypeNameSymbol] = "BdkError";
1409
- /**
1410
- * @private
1411
- * This field is private and should not be used.
1412
- */
1413
- [variantOrdinalSymbol] = 42;
1414
1563
  tag = BdkError_Tags.TransactionNotFound;
1415
- constructor(message) {
1416
- super("BdkError", "TransactionNotFound", message);
1564
+ constructor(inner) {
1565
+ super("BdkError", "TransactionNotFound");
1566
+ this.inner = Object.freeze(inner);
1417
1567
  }
1418
- static instanceOf(e) {
1419
- return instanceOf(e) && e[variantOrdinalSymbol] === 42;
1568
+ static new(inner) {
1569
+ return new TransactionNotFound_(inner);
1570
+ }
1571
+ static instanceOf(obj) {
1572
+ return obj.tag === BdkError_Tags.TransactionNotFound;
1573
+ }
1574
+ static hasInner(obj) {
1575
+ return TransactionNotFound_.instanceOf(obj);
1576
+ }
1577
+ static getInner(obj) {
1578
+ return obj.inner;
1420
1579
  }
1421
1580
  }
1422
- class CannotConnect extends UniffiError {
1581
+ class CannotConnect_ extends UniffiError {
1423
1582
  /**
1424
1583
  * @private
1425
- * This field is private and should not be used.
1584
+ * This field is private and should not be used, use `tag` instead.
1426
1585
  */
1427
1586
  [uniffiTypeNameSymbol] = "BdkError";
1428
- /**
1429
- * @private
1430
- * This field is private and should not be used.
1431
- */
1432
- [variantOrdinalSymbol] = 43;
1433
1587
  tag = BdkError_Tags.CannotConnect;
1434
- constructor(message) {
1435
- super("BdkError", "CannotConnect", message);
1588
+ constructor(inner) {
1589
+ super("BdkError", "CannotConnect");
1590
+ this.inner = Object.freeze(inner);
1591
+ }
1592
+ static new(inner) {
1593
+ return new CannotConnect_(inner);
1594
+ }
1595
+ static instanceOf(obj) {
1596
+ return obj.tag === BdkError_Tags.CannotConnect;
1436
1597
  }
1437
- static instanceOf(e) {
1438
- return instanceOf(e) && e[variantOrdinalSymbol] === 43;
1598
+ static hasInner(obj) {
1599
+ return CannotConnect_.instanceOf(obj);
1600
+ }
1601
+ static getInner(obj) {
1602
+ return obj.inner;
1439
1603
  }
1440
1604
  }
1441
- class CalculateFeeError extends UniffiError {
1605
+ class CalculateFeeError_ extends UniffiError {
1442
1606
  /**
1443
1607
  * @private
1444
- * This field is private and should not be used.
1608
+ * This field is private and should not be used, use `tag` instead.
1445
1609
  */
1446
1610
  [uniffiTypeNameSymbol] = "BdkError";
1447
- /**
1448
- * @private
1449
- * This field is private and should not be used.
1450
- */
1451
- [variantOrdinalSymbol] = 44;
1452
1611
  tag = BdkError_Tags.CalculateFeeError;
1453
- constructor(message) {
1454
- super("BdkError", "CalculateFeeError", message);
1612
+ constructor(inner) {
1613
+ super("BdkError", "CalculateFeeError");
1614
+ this.inner = Object.freeze(inner);
1455
1615
  }
1456
- static instanceOf(e) {
1457
- return instanceOf(e) && e[variantOrdinalSymbol] === 44;
1616
+ static new(inner) {
1617
+ return new CalculateFeeError_(inner);
1618
+ }
1619
+ static instanceOf(obj) {
1620
+ return obj.tag === BdkError_Tags.CalculateFeeError;
1621
+ }
1622
+ static hasInner(obj) {
1623
+ return CalculateFeeError_.instanceOf(obj);
1624
+ }
1625
+ static getInner(obj) {
1626
+ return obj.inner;
1458
1627
  }
1459
1628
  }
1460
- class InvalidMnemonic extends UniffiError {
1629
+ class InvalidMnemonic_ extends UniffiError {
1461
1630
  /**
1462
1631
  * @private
1463
- * This field is private and should not be used.
1632
+ * This field is private and should not be used, use `tag` instead.
1464
1633
  */
1465
1634
  [uniffiTypeNameSymbol] = "BdkError";
1466
- /**
1467
- * @private
1468
- * This field is private and should not be used.
1469
- */
1470
- [variantOrdinalSymbol] = 45;
1471
1635
  tag = BdkError_Tags.InvalidMnemonic;
1472
- constructor(message) {
1473
- super("BdkError", "InvalidMnemonic", message);
1636
+ constructor(inner) {
1637
+ super("BdkError", "InvalidMnemonic");
1638
+ this.inner = Object.freeze(inner);
1639
+ }
1640
+ static new(inner) {
1641
+ return new InvalidMnemonic_(inner);
1642
+ }
1643
+ static instanceOf(obj) {
1644
+ return obj.tag === BdkError_Tags.InvalidMnemonic;
1474
1645
  }
1475
- static instanceOf(e) {
1476
- return instanceOf(e) && e[variantOrdinalSymbol] === 45;
1646
+ static hasInner(obj) {
1647
+ return InvalidMnemonic_.instanceOf(obj);
1648
+ }
1649
+ static getInner(obj) {
1650
+ return obj.inner;
1477
1651
  }
1478
1652
  }
1479
- class InvalidEntropy extends UniffiError {
1653
+ class InvalidEntropy_ extends UniffiError {
1480
1654
  /**
1481
1655
  * @private
1482
- * This field is private and should not be used.
1656
+ * This field is private and should not be used, use `tag` instead.
1483
1657
  */
1484
1658
  [uniffiTypeNameSymbol] = "BdkError";
1485
- /**
1486
- * @private
1487
- * This field is private and should not be used.
1488
- */
1489
- [variantOrdinalSymbol] = 46;
1490
1659
  tag = BdkError_Tags.InvalidEntropy;
1491
- constructor(message) {
1492
- super("BdkError", "InvalidEntropy", message);
1660
+ constructor(inner) {
1661
+ super("BdkError", "InvalidEntropy");
1662
+ this.inner = Object.freeze(inner);
1493
1663
  }
1494
- static instanceOf(e) {
1495
- return instanceOf(e) && e[variantOrdinalSymbol] === 46;
1664
+ static new(inner) {
1665
+ return new InvalidEntropy_(inner);
1666
+ }
1667
+ static instanceOf(obj) {
1668
+ return obj.tag === BdkError_Tags.InvalidEntropy;
1669
+ }
1670
+ static hasInner(obj) {
1671
+ return InvalidEntropy_.instanceOf(obj);
1672
+ }
1673
+ static getInner(obj) {
1674
+ return obj.inner;
1496
1675
  }
1497
1676
  }
1498
- class KeyError extends UniffiError {
1677
+ class KeyError_ extends UniffiError {
1499
1678
  /**
1500
1679
  * @private
1501
- * This field is private and should not be used.
1680
+ * This field is private and should not be used, use `tag` instead.
1502
1681
  */
1503
1682
  [uniffiTypeNameSymbol] = "BdkError";
1504
- /**
1505
- * @private
1506
- * This field is private and should not be used.
1507
- */
1508
- [variantOrdinalSymbol] = 47;
1509
1683
  tag = BdkError_Tags.KeyError;
1510
- constructor(message) {
1511
- super("BdkError", "KeyError", message);
1684
+ constructor(inner) {
1685
+ super("BdkError", "KeyError");
1686
+ this.inner = Object.freeze(inner);
1512
1687
  }
1513
- static instanceOf(e) {
1514
- return instanceOf(e) && e[variantOrdinalSymbol] === 47;
1688
+ static new(inner) {
1689
+ return new KeyError_(inner);
1690
+ }
1691
+ static instanceOf(obj) {
1692
+ return obj.tag === BdkError_Tags.KeyError;
1693
+ }
1694
+ static hasInner(obj) {
1695
+ return KeyError_.instanceOf(obj);
1696
+ }
1697
+ static getInner(obj) {
1698
+ return obj.inner;
1515
1699
  }
1516
1700
  }
1517
- class Generic extends UniffiError {
1701
+ class Generic_ extends UniffiError {
1518
1702
  /**
1519
1703
  * @private
1520
- * This field is private and should not be used.
1704
+ * This field is private and should not be used, use `tag` instead.
1521
1705
  */
1522
1706
  [uniffiTypeNameSymbol] = "BdkError";
1523
- /**
1524
- * @private
1525
- * This field is private and should not be used.
1526
- */
1527
- [variantOrdinalSymbol] = 48;
1528
1707
  tag = BdkError_Tags.Generic;
1529
- constructor(message) {
1530
- super("BdkError", "Generic", message);
1708
+ constructor(inner) {
1709
+ super("BdkError", "Generic");
1710
+ this.inner = Object.freeze(inner);
1531
1711
  }
1532
- static instanceOf(e) {
1533
- return instanceOf(e) && e[variantOrdinalSymbol] === 48;
1712
+ static new(inner) {
1713
+ return new Generic_(inner);
1714
+ }
1715
+ static instanceOf(obj) {
1716
+ return obj.tag === BdkError_Tags.Generic;
1717
+ }
1718
+ static hasInner(obj) {
1719
+ return Generic_.instanceOf(obj);
1720
+ }
1721
+ static getInner(obj) {
1722
+ return obj.inner;
1534
1723
  }
1535
1724
  }
1536
-
1537
- // Utility function which does not rely on instanceof.
1538
- function instanceOf(e) {
1539
- return e[uniffiTypeNameSymbol] === "BdkError";
1725
+ function instanceOf(obj) {
1726
+ return obj[uniffiTypeNameSymbol] === "BdkError";
1540
1727
  }
1541
- return {
1542
- InvalidDescriptor,
1543
- WalletCreationFailed,
1544
- WalletLoadFailed,
1545
- WalletLoadMismatch,
1546
- PersistError,
1547
- InvalidAddress,
1548
- InvalidScript,
1549
- TransactionBuildFailed,
1550
- NoRecipients,
1551
- NoUtxosSelected,
1552
- OutputBelowDustLimit,
1553
- InsufficientFunds,
1554
- FeeRateTooLow,
1555
- FeeTooLow,
1556
- LockTimeConflict,
1557
- RbfSequenceConflict,
1558
- VersionZero,
1559
- VersionOneCsv,
1560
- SpendingPolicyRequired,
1561
- MissingKeyOrigin,
1562
- MissingNonWitnessUtxo,
1563
- OutpointNotFound,
1564
- FeeBumpTargetNotFound,
1565
- FeeBumpAlreadyConfirmed,
1566
- FeeBumpIrreplaceable,
1567
- FeeBumpFeeRateUnavailable,
1568
- FeeBumpInvalidOutputIndex,
1569
- InvalidPsbt,
1570
- SignFailed,
1571
- SignerMissingKey,
1572
- SignerInvalidKey,
1573
- SignerUserCanceled,
1574
- SignerInputIndexOutOfRange,
1575
- SignerMissingNonWitnessUtxo,
1576
- SignerMissingWitnessUtxo,
1577
- SignerMissingWitnessScript,
1578
- SignerNonStandardSighash,
1579
- SignerInvalidSighash,
1580
- SyncFailed,
1581
- BroadcastFailed,
1582
- InvalidTransaction,
1583
- TransactionNotFound,
1584
- CannotConnect,
1585
- CalculateFeeError,
1586
- InvalidMnemonic,
1587
- InvalidEntropy,
1588
- KeyError,
1589
- Generic,
1590
- instanceOf
1591
- };
1728
+ return Object.freeze({
1729
+ instanceOf,
1730
+ InvalidDescriptor: InvalidDescriptor_,
1731
+ WalletCreationFailed: WalletCreationFailed_,
1732
+ WalletLoadFailed: WalletLoadFailed_,
1733
+ WalletLoadMismatch: WalletLoadMismatch_,
1734
+ PersistError: PersistError_,
1735
+ InvalidAddress: InvalidAddress_,
1736
+ InvalidScript: InvalidScript_,
1737
+ TransactionBuildFailed: TransactionBuildFailed_,
1738
+ NoRecipients: NoRecipients_,
1739
+ NoUtxosSelected: NoUtxosSelected_,
1740
+ OutputBelowDustLimit: OutputBelowDustLimit_,
1741
+ InsufficientFunds: InsufficientFunds_,
1742
+ FeeRateTooLow: FeeRateTooLow_,
1743
+ FeeTooLow: FeeTooLow_,
1744
+ LockTimeConflict: LockTimeConflict_,
1745
+ RbfSequenceConflict: RbfSequenceConflict_,
1746
+ VersionZero: VersionZero_,
1747
+ VersionOneCsv: VersionOneCsv_,
1748
+ SpendingPolicyRequired: SpendingPolicyRequired_,
1749
+ MissingKeyOrigin: MissingKeyOrigin_,
1750
+ MissingNonWitnessUtxo: MissingNonWitnessUtxo_,
1751
+ OutpointNotFound: OutpointNotFound_,
1752
+ FeeBumpTargetNotFound: FeeBumpTargetNotFound_,
1753
+ FeeBumpAlreadyConfirmed: FeeBumpAlreadyConfirmed_,
1754
+ FeeBumpIrreplaceable: FeeBumpIrreplaceable_,
1755
+ FeeBumpFeeRateUnavailable: FeeBumpFeeRateUnavailable_,
1756
+ FeeBumpInvalidOutputIndex: FeeBumpInvalidOutputIndex_,
1757
+ InvalidPsbt: InvalidPsbt_,
1758
+ SignFailed: SignFailed_,
1759
+ SignerMissingKey: SignerMissingKey_,
1760
+ SignerInvalidKey: SignerInvalidKey_,
1761
+ SignerUserCanceled: SignerUserCanceled_,
1762
+ SignerInputIndexOutOfRange: SignerInputIndexOutOfRange_,
1763
+ SignerMissingNonWitnessUtxo: SignerMissingNonWitnessUtxo_,
1764
+ SignerMissingWitnessUtxo: SignerMissingWitnessUtxo_,
1765
+ SignerMissingWitnessScript: SignerMissingWitnessScript_,
1766
+ SignerNonStandardSighash: SignerNonStandardSighash_,
1767
+ SignerInvalidSighash: SignerInvalidSighash_,
1768
+ SyncFailed: SyncFailed_,
1769
+ BroadcastFailed: BroadcastFailed_,
1770
+ InvalidTransaction: InvalidTransaction_,
1771
+ TransactionNotFound: TransactionNotFound_,
1772
+ CannotConnect: CannotConnect_,
1773
+ CalculateFeeError: CalculateFeeError_,
1774
+ InvalidMnemonic: InvalidMnemonic_,
1775
+ InvalidEntropy: InvalidEntropy_,
1776
+ KeyError: KeyError_,
1777
+ Generic: Generic_
1778
+ });
1592
1779
  })();
1593
-
1594
- // Union type for BdkError error type.
1595
-
1780
+ // FfiConverter for enum BdkError
1596
1781
  const FfiConverterTypeBdkError = (() => {
1597
- const intConverter = FfiConverterInt32;
1598
- class FfiConverter extends AbstractFfiConverterByteArray {
1782
+ const ordinalConverter = FfiConverterInt32;
1783
+ class FFIConverter extends AbstractFfiConverterByteArray {
1599
1784
  read(from) {
1600
- switch (intConverter.read(from)) {
1785
+ switch (ordinalConverter.read(from)) {
1601
1786
  case 1:
1602
- return new BdkError.InvalidDescriptor(FfiConverterString.read(from));
1787
+ return new BdkError.InvalidDescriptor({
1788
+ message: FfiConverterString.read(from)
1789
+ });
1603
1790
  case 2:
1604
- return new BdkError.WalletCreationFailed(FfiConverterString.read(from));
1791
+ return new BdkError.WalletCreationFailed({
1792
+ message: FfiConverterString.read(from)
1793
+ });
1605
1794
  case 3:
1606
- return new BdkError.WalletLoadFailed(FfiConverterString.read(from));
1795
+ return new BdkError.WalletLoadFailed({
1796
+ message: FfiConverterString.read(from)
1797
+ });
1607
1798
  case 4:
1608
- return new BdkError.WalletLoadMismatch(FfiConverterString.read(from));
1799
+ return new BdkError.WalletLoadMismatch({
1800
+ message: FfiConverterString.read(from)
1801
+ });
1609
1802
  case 5:
1610
- return new BdkError.PersistError(FfiConverterString.read(from));
1803
+ return new BdkError.PersistError({
1804
+ message: FfiConverterString.read(from)
1805
+ });
1611
1806
  case 6:
1612
- return new BdkError.InvalidAddress(FfiConverterString.read(from));
1807
+ return new BdkError.InvalidAddress({
1808
+ message: FfiConverterString.read(from)
1809
+ });
1613
1810
  case 7:
1614
- return new BdkError.InvalidScript(FfiConverterString.read(from));
1811
+ return new BdkError.InvalidScript({
1812
+ message: FfiConverterString.read(from)
1813
+ });
1615
1814
  case 8:
1616
- return new BdkError.TransactionBuildFailed(FfiConverterString.read(from));
1815
+ return new BdkError.TransactionBuildFailed({
1816
+ message: FfiConverterString.read(from)
1817
+ });
1617
1818
  case 9:
1618
- return new BdkError.NoRecipients(FfiConverterString.read(from));
1819
+ return new BdkError.NoRecipients({
1820
+ message: FfiConverterString.read(from)
1821
+ });
1619
1822
  case 10:
1620
- return new BdkError.NoUtxosSelected(FfiConverterString.read(from));
1823
+ return new BdkError.NoUtxosSelected({
1824
+ message: FfiConverterString.read(from)
1825
+ });
1621
1826
  case 11:
1622
- return new BdkError.OutputBelowDustLimit(FfiConverterString.read(from));
1827
+ return new BdkError.OutputBelowDustLimit({
1828
+ message: FfiConverterString.read(from)
1829
+ });
1623
1830
  case 12:
1624
- return new BdkError.InsufficientFunds(FfiConverterString.read(from));
1831
+ return new BdkError.InsufficientFunds({
1832
+ message: FfiConverterString.read(from)
1833
+ });
1625
1834
  case 13:
1626
- return new BdkError.FeeRateTooLow(FfiConverterString.read(from));
1835
+ return new BdkError.FeeRateTooLow({
1836
+ message: FfiConverterString.read(from)
1837
+ });
1627
1838
  case 14:
1628
- return new BdkError.FeeTooLow(FfiConverterString.read(from));
1839
+ return new BdkError.FeeTooLow({
1840
+ message: FfiConverterString.read(from)
1841
+ });
1629
1842
  case 15:
1630
- return new BdkError.LockTimeConflict(FfiConverterString.read(from));
1843
+ return new BdkError.LockTimeConflict({
1844
+ message: FfiConverterString.read(from)
1845
+ });
1631
1846
  case 16:
1632
- return new BdkError.RbfSequenceConflict(FfiConverterString.read(from));
1847
+ return new BdkError.RbfSequenceConflict({
1848
+ message: FfiConverterString.read(from)
1849
+ });
1633
1850
  case 17:
1634
- return new BdkError.VersionZero(FfiConverterString.read(from));
1851
+ return new BdkError.VersionZero({
1852
+ message: FfiConverterString.read(from)
1853
+ });
1635
1854
  case 18:
1636
- return new BdkError.VersionOneCsv(FfiConverterString.read(from));
1855
+ return new BdkError.VersionOneCsv({
1856
+ message: FfiConverterString.read(from)
1857
+ });
1637
1858
  case 19:
1638
- return new BdkError.SpendingPolicyRequired(FfiConverterString.read(from));
1859
+ return new BdkError.SpendingPolicyRequired({
1860
+ message: FfiConverterString.read(from)
1861
+ });
1639
1862
  case 20:
1640
- return new BdkError.MissingKeyOrigin(FfiConverterString.read(from));
1863
+ return new BdkError.MissingKeyOrigin({
1864
+ message: FfiConverterString.read(from)
1865
+ });
1641
1866
  case 21:
1642
- return new BdkError.MissingNonWitnessUtxo(FfiConverterString.read(from));
1867
+ return new BdkError.MissingNonWitnessUtxo({
1868
+ message: FfiConverterString.read(from)
1869
+ });
1643
1870
  case 22:
1644
- return new BdkError.OutpointNotFound(FfiConverterString.read(from));
1871
+ return new BdkError.OutpointNotFound({
1872
+ message: FfiConverterString.read(from)
1873
+ });
1645
1874
  case 23:
1646
- return new BdkError.FeeBumpTargetNotFound(FfiConverterString.read(from));
1875
+ return new BdkError.FeeBumpTargetNotFound({
1876
+ message: FfiConverterString.read(from)
1877
+ });
1647
1878
  case 24:
1648
- return new BdkError.FeeBumpAlreadyConfirmed(FfiConverterString.read(from));
1879
+ return new BdkError.FeeBumpAlreadyConfirmed({
1880
+ message: FfiConverterString.read(from)
1881
+ });
1649
1882
  case 25:
1650
- return new BdkError.FeeBumpIrreplaceable(FfiConverterString.read(from));
1883
+ return new BdkError.FeeBumpIrreplaceable({
1884
+ message: FfiConverterString.read(from)
1885
+ });
1651
1886
  case 26:
1652
- return new BdkError.FeeBumpFeeRateUnavailable(FfiConverterString.read(from));
1887
+ return new BdkError.FeeBumpFeeRateUnavailable({
1888
+ message: FfiConverterString.read(from)
1889
+ });
1653
1890
  case 27:
1654
- return new BdkError.FeeBumpInvalidOutputIndex(FfiConverterString.read(from));
1891
+ return new BdkError.FeeBumpInvalidOutputIndex({
1892
+ message: FfiConverterString.read(from)
1893
+ });
1655
1894
  case 28:
1656
- return new BdkError.InvalidPsbt(FfiConverterString.read(from));
1895
+ return new BdkError.InvalidPsbt({
1896
+ message: FfiConverterString.read(from)
1897
+ });
1657
1898
  case 29:
1658
- return new BdkError.SignFailed(FfiConverterString.read(from));
1899
+ return new BdkError.SignFailed({
1900
+ message: FfiConverterString.read(from)
1901
+ });
1659
1902
  case 30:
1660
- return new BdkError.SignerMissingKey(FfiConverterString.read(from));
1903
+ return new BdkError.SignerMissingKey({
1904
+ message: FfiConverterString.read(from)
1905
+ });
1661
1906
  case 31:
1662
- return new BdkError.SignerInvalidKey(FfiConverterString.read(from));
1907
+ return new BdkError.SignerInvalidKey({
1908
+ message: FfiConverterString.read(from)
1909
+ });
1663
1910
  case 32:
1664
- return new BdkError.SignerUserCanceled(FfiConverterString.read(from));
1911
+ return new BdkError.SignerUserCanceled({
1912
+ message: FfiConverterString.read(from)
1913
+ });
1665
1914
  case 33:
1666
- return new BdkError.SignerInputIndexOutOfRange(FfiConverterString.read(from));
1915
+ return new BdkError.SignerInputIndexOutOfRange({
1916
+ message: FfiConverterString.read(from)
1917
+ });
1667
1918
  case 34:
1668
- return new BdkError.SignerMissingNonWitnessUtxo(FfiConverterString.read(from));
1919
+ return new BdkError.SignerMissingNonWitnessUtxo({
1920
+ message: FfiConverterString.read(from)
1921
+ });
1669
1922
  case 35:
1670
- return new BdkError.SignerMissingWitnessUtxo(FfiConverterString.read(from));
1923
+ return new BdkError.SignerMissingWitnessUtxo({
1924
+ message: FfiConverterString.read(from)
1925
+ });
1671
1926
  case 36:
1672
- return new BdkError.SignerMissingWitnessScript(FfiConverterString.read(from));
1927
+ return new BdkError.SignerMissingWitnessScript({
1928
+ message: FfiConverterString.read(from)
1929
+ });
1673
1930
  case 37:
1674
- return new BdkError.SignerNonStandardSighash(FfiConverterString.read(from));
1931
+ return new BdkError.SignerNonStandardSighash({
1932
+ message: FfiConverterString.read(from)
1933
+ });
1675
1934
  case 38:
1676
- return new BdkError.SignerInvalidSighash(FfiConverterString.read(from));
1935
+ return new BdkError.SignerInvalidSighash({
1936
+ message: FfiConverterString.read(from)
1937
+ });
1677
1938
  case 39:
1678
- return new BdkError.SyncFailed(FfiConverterString.read(from));
1939
+ return new BdkError.SyncFailed({
1940
+ message: FfiConverterString.read(from)
1941
+ });
1679
1942
  case 40:
1680
- return new BdkError.BroadcastFailed(FfiConverterString.read(from));
1943
+ return new BdkError.BroadcastFailed({
1944
+ message: FfiConverterString.read(from)
1945
+ });
1681
1946
  case 41:
1682
- return new BdkError.InvalidTransaction(FfiConverterString.read(from));
1947
+ return new BdkError.InvalidTransaction({
1948
+ message: FfiConverterString.read(from)
1949
+ });
1683
1950
  case 42:
1684
- return new BdkError.TransactionNotFound(FfiConverterString.read(from));
1951
+ return new BdkError.TransactionNotFound({
1952
+ message: FfiConverterString.read(from)
1953
+ });
1685
1954
  case 43:
1686
- return new BdkError.CannotConnect(FfiConverterString.read(from));
1955
+ return new BdkError.CannotConnect({
1956
+ message: FfiConverterString.read(from)
1957
+ });
1687
1958
  case 44:
1688
- return new BdkError.CalculateFeeError(FfiConverterString.read(from));
1959
+ return new BdkError.CalculateFeeError({
1960
+ message: FfiConverterString.read(from)
1961
+ });
1689
1962
  case 45:
1690
- return new BdkError.InvalidMnemonic(FfiConverterString.read(from));
1963
+ return new BdkError.InvalidMnemonic({
1964
+ message: FfiConverterString.read(from)
1965
+ });
1691
1966
  case 46:
1692
- return new BdkError.InvalidEntropy(FfiConverterString.read(from));
1967
+ return new BdkError.InvalidEntropy({
1968
+ message: FfiConverterString.read(from)
1969
+ });
1693
1970
  case 47:
1694
- return new BdkError.KeyError(FfiConverterString.read(from));
1971
+ return new BdkError.KeyError({
1972
+ message: FfiConverterString.read(from)
1973
+ });
1695
1974
  case 48:
1696
- return new BdkError.Generic(FfiConverterString.read(from));
1975
+ return new BdkError.Generic({
1976
+ message: FfiConverterString.read(from)
1977
+ });
1978
+ default:
1979
+ throw new UniffiInternalError.UnexpectedEnumCase();
1980
+ }
1981
+ }
1982
+ write(value, into) {
1983
+ switch (value.tag) {
1984
+ case BdkError_Tags.InvalidDescriptor:
1985
+ {
1986
+ ordinalConverter.write(1, into);
1987
+ const inner = value.inner;
1988
+ FfiConverterString.write(inner.message, into);
1989
+ return;
1990
+ }
1991
+ case BdkError_Tags.WalletCreationFailed:
1992
+ {
1993
+ ordinalConverter.write(2, into);
1994
+ const inner = value.inner;
1995
+ FfiConverterString.write(inner.message, into);
1996
+ return;
1997
+ }
1998
+ case BdkError_Tags.WalletLoadFailed:
1999
+ {
2000
+ ordinalConverter.write(3, into);
2001
+ const inner = value.inner;
2002
+ FfiConverterString.write(inner.message, into);
2003
+ return;
2004
+ }
2005
+ case BdkError_Tags.WalletLoadMismatch:
2006
+ {
2007
+ ordinalConverter.write(4, into);
2008
+ const inner = value.inner;
2009
+ FfiConverterString.write(inner.message, into);
2010
+ return;
2011
+ }
2012
+ case BdkError_Tags.PersistError:
2013
+ {
2014
+ ordinalConverter.write(5, into);
2015
+ const inner = value.inner;
2016
+ FfiConverterString.write(inner.message, into);
2017
+ return;
2018
+ }
2019
+ case BdkError_Tags.InvalidAddress:
2020
+ {
2021
+ ordinalConverter.write(6, into);
2022
+ const inner = value.inner;
2023
+ FfiConverterString.write(inner.message, into);
2024
+ return;
2025
+ }
2026
+ case BdkError_Tags.InvalidScript:
2027
+ {
2028
+ ordinalConverter.write(7, into);
2029
+ const inner = value.inner;
2030
+ FfiConverterString.write(inner.message, into);
2031
+ return;
2032
+ }
2033
+ case BdkError_Tags.TransactionBuildFailed:
2034
+ {
2035
+ ordinalConverter.write(8, into);
2036
+ const inner = value.inner;
2037
+ FfiConverterString.write(inner.message, into);
2038
+ return;
2039
+ }
2040
+ case BdkError_Tags.NoRecipients:
2041
+ {
2042
+ ordinalConverter.write(9, into);
2043
+ const inner = value.inner;
2044
+ FfiConverterString.write(inner.message, into);
2045
+ return;
2046
+ }
2047
+ case BdkError_Tags.NoUtxosSelected:
2048
+ {
2049
+ ordinalConverter.write(10, into);
2050
+ const inner = value.inner;
2051
+ FfiConverterString.write(inner.message, into);
2052
+ return;
2053
+ }
2054
+ case BdkError_Tags.OutputBelowDustLimit:
2055
+ {
2056
+ ordinalConverter.write(11, into);
2057
+ const inner = value.inner;
2058
+ FfiConverterString.write(inner.message, into);
2059
+ return;
2060
+ }
2061
+ case BdkError_Tags.InsufficientFunds:
2062
+ {
2063
+ ordinalConverter.write(12, into);
2064
+ const inner = value.inner;
2065
+ FfiConverterString.write(inner.message, into);
2066
+ return;
2067
+ }
2068
+ case BdkError_Tags.FeeRateTooLow:
2069
+ {
2070
+ ordinalConverter.write(13, into);
2071
+ const inner = value.inner;
2072
+ FfiConverterString.write(inner.message, into);
2073
+ return;
2074
+ }
2075
+ case BdkError_Tags.FeeTooLow:
2076
+ {
2077
+ ordinalConverter.write(14, into);
2078
+ const inner = value.inner;
2079
+ FfiConverterString.write(inner.message, into);
2080
+ return;
2081
+ }
2082
+ case BdkError_Tags.LockTimeConflict:
2083
+ {
2084
+ ordinalConverter.write(15, into);
2085
+ const inner = value.inner;
2086
+ FfiConverterString.write(inner.message, into);
2087
+ return;
2088
+ }
2089
+ case BdkError_Tags.RbfSequenceConflict:
2090
+ {
2091
+ ordinalConverter.write(16, into);
2092
+ const inner = value.inner;
2093
+ FfiConverterString.write(inner.message, into);
2094
+ return;
2095
+ }
2096
+ case BdkError_Tags.VersionZero:
2097
+ {
2098
+ ordinalConverter.write(17, into);
2099
+ const inner = value.inner;
2100
+ FfiConverterString.write(inner.message, into);
2101
+ return;
2102
+ }
2103
+ case BdkError_Tags.VersionOneCsv:
2104
+ {
2105
+ ordinalConverter.write(18, into);
2106
+ const inner = value.inner;
2107
+ FfiConverterString.write(inner.message, into);
2108
+ return;
2109
+ }
2110
+ case BdkError_Tags.SpendingPolicyRequired:
2111
+ {
2112
+ ordinalConverter.write(19, into);
2113
+ const inner = value.inner;
2114
+ FfiConverterString.write(inner.message, into);
2115
+ return;
2116
+ }
2117
+ case BdkError_Tags.MissingKeyOrigin:
2118
+ {
2119
+ ordinalConverter.write(20, into);
2120
+ const inner = value.inner;
2121
+ FfiConverterString.write(inner.message, into);
2122
+ return;
2123
+ }
2124
+ case BdkError_Tags.MissingNonWitnessUtxo:
2125
+ {
2126
+ ordinalConverter.write(21, into);
2127
+ const inner = value.inner;
2128
+ FfiConverterString.write(inner.message, into);
2129
+ return;
2130
+ }
2131
+ case BdkError_Tags.OutpointNotFound:
2132
+ {
2133
+ ordinalConverter.write(22, into);
2134
+ const inner = value.inner;
2135
+ FfiConverterString.write(inner.message, into);
2136
+ return;
2137
+ }
2138
+ case BdkError_Tags.FeeBumpTargetNotFound:
2139
+ {
2140
+ ordinalConverter.write(23, into);
2141
+ const inner = value.inner;
2142
+ FfiConverterString.write(inner.message, into);
2143
+ return;
2144
+ }
2145
+ case BdkError_Tags.FeeBumpAlreadyConfirmed:
2146
+ {
2147
+ ordinalConverter.write(24, into);
2148
+ const inner = value.inner;
2149
+ FfiConverterString.write(inner.message, into);
2150
+ return;
2151
+ }
2152
+ case BdkError_Tags.FeeBumpIrreplaceable:
2153
+ {
2154
+ ordinalConverter.write(25, into);
2155
+ const inner = value.inner;
2156
+ FfiConverterString.write(inner.message, into);
2157
+ return;
2158
+ }
2159
+ case BdkError_Tags.FeeBumpFeeRateUnavailable:
2160
+ {
2161
+ ordinalConverter.write(26, into);
2162
+ const inner = value.inner;
2163
+ FfiConverterString.write(inner.message, into);
2164
+ return;
2165
+ }
2166
+ case BdkError_Tags.FeeBumpInvalidOutputIndex:
2167
+ {
2168
+ ordinalConverter.write(27, into);
2169
+ const inner = value.inner;
2170
+ FfiConverterString.write(inner.message, into);
2171
+ return;
2172
+ }
2173
+ case BdkError_Tags.InvalidPsbt:
2174
+ {
2175
+ ordinalConverter.write(28, into);
2176
+ const inner = value.inner;
2177
+ FfiConverterString.write(inner.message, into);
2178
+ return;
2179
+ }
2180
+ case BdkError_Tags.SignFailed:
2181
+ {
2182
+ ordinalConverter.write(29, into);
2183
+ const inner = value.inner;
2184
+ FfiConverterString.write(inner.message, into);
2185
+ return;
2186
+ }
2187
+ case BdkError_Tags.SignerMissingKey:
2188
+ {
2189
+ ordinalConverter.write(30, into);
2190
+ const inner = value.inner;
2191
+ FfiConverterString.write(inner.message, into);
2192
+ return;
2193
+ }
2194
+ case BdkError_Tags.SignerInvalidKey:
2195
+ {
2196
+ ordinalConverter.write(31, into);
2197
+ const inner = value.inner;
2198
+ FfiConverterString.write(inner.message, into);
2199
+ return;
2200
+ }
2201
+ case BdkError_Tags.SignerUserCanceled:
2202
+ {
2203
+ ordinalConverter.write(32, into);
2204
+ const inner = value.inner;
2205
+ FfiConverterString.write(inner.message, into);
2206
+ return;
2207
+ }
2208
+ case BdkError_Tags.SignerInputIndexOutOfRange:
2209
+ {
2210
+ ordinalConverter.write(33, into);
2211
+ const inner = value.inner;
2212
+ FfiConverterString.write(inner.message, into);
2213
+ return;
2214
+ }
2215
+ case BdkError_Tags.SignerMissingNonWitnessUtxo:
2216
+ {
2217
+ ordinalConverter.write(34, into);
2218
+ const inner = value.inner;
2219
+ FfiConverterString.write(inner.message, into);
2220
+ return;
2221
+ }
2222
+ case BdkError_Tags.SignerMissingWitnessUtxo:
2223
+ {
2224
+ ordinalConverter.write(35, into);
2225
+ const inner = value.inner;
2226
+ FfiConverterString.write(inner.message, into);
2227
+ return;
2228
+ }
2229
+ case BdkError_Tags.SignerMissingWitnessScript:
2230
+ {
2231
+ ordinalConverter.write(36, into);
2232
+ const inner = value.inner;
2233
+ FfiConverterString.write(inner.message, into);
2234
+ return;
2235
+ }
2236
+ case BdkError_Tags.SignerNonStandardSighash:
2237
+ {
2238
+ ordinalConverter.write(37, into);
2239
+ const inner = value.inner;
2240
+ FfiConverterString.write(inner.message, into);
2241
+ return;
2242
+ }
2243
+ case BdkError_Tags.SignerInvalidSighash:
2244
+ {
2245
+ ordinalConverter.write(38, into);
2246
+ const inner = value.inner;
2247
+ FfiConverterString.write(inner.message, into);
2248
+ return;
2249
+ }
2250
+ case BdkError_Tags.SyncFailed:
2251
+ {
2252
+ ordinalConverter.write(39, into);
2253
+ const inner = value.inner;
2254
+ FfiConverterString.write(inner.message, into);
2255
+ return;
2256
+ }
2257
+ case BdkError_Tags.BroadcastFailed:
2258
+ {
2259
+ ordinalConverter.write(40, into);
2260
+ const inner = value.inner;
2261
+ FfiConverterString.write(inner.message, into);
2262
+ return;
2263
+ }
2264
+ case BdkError_Tags.InvalidTransaction:
2265
+ {
2266
+ ordinalConverter.write(41, into);
2267
+ const inner = value.inner;
2268
+ FfiConverterString.write(inner.message, into);
2269
+ return;
2270
+ }
2271
+ case BdkError_Tags.TransactionNotFound:
2272
+ {
2273
+ ordinalConverter.write(42, into);
2274
+ const inner = value.inner;
2275
+ FfiConverterString.write(inner.message, into);
2276
+ return;
2277
+ }
2278
+ case BdkError_Tags.CannotConnect:
2279
+ {
2280
+ ordinalConverter.write(43, into);
2281
+ const inner = value.inner;
2282
+ FfiConverterString.write(inner.message, into);
2283
+ return;
2284
+ }
2285
+ case BdkError_Tags.CalculateFeeError:
2286
+ {
2287
+ ordinalConverter.write(44, into);
2288
+ const inner = value.inner;
2289
+ FfiConverterString.write(inner.message, into);
2290
+ return;
2291
+ }
2292
+ case BdkError_Tags.InvalidMnemonic:
2293
+ {
2294
+ ordinalConverter.write(45, into);
2295
+ const inner = value.inner;
2296
+ FfiConverterString.write(inner.message, into);
2297
+ return;
2298
+ }
2299
+ case BdkError_Tags.InvalidEntropy:
2300
+ {
2301
+ ordinalConverter.write(46, into);
2302
+ const inner = value.inner;
2303
+ FfiConverterString.write(inner.message, into);
2304
+ return;
2305
+ }
2306
+ case BdkError_Tags.KeyError:
2307
+ {
2308
+ ordinalConverter.write(47, into);
2309
+ const inner = value.inner;
2310
+ FfiConverterString.write(inner.message, into);
2311
+ return;
2312
+ }
2313
+ case BdkError_Tags.Generic:
2314
+ {
2315
+ ordinalConverter.write(48, into);
2316
+ const inner = value.inner;
2317
+ FfiConverterString.write(inner.message, into);
2318
+ return;
2319
+ }
2320
+ default:
2321
+ // Throwing from here means that BdkError_Tags hasn't matched an ordinal.
2322
+ throw new UniffiInternalError.UnexpectedEnumCase();
2323
+ }
2324
+ }
2325
+ allocationSize(value) {
2326
+ switch (value.tag) {
2327
+ case BdkError_Tags.InvalidDescriptor:
2328
+ {
2329
+ const inner = value.inner;
2330
+ let size = ordinalConverter.allocationSize(1);
2331
+ size += FfiConverterString.allocationSize(inner.message);
2332
+ return size;
2333
+ }
2334
+ case BdkError_Tags.WalletCreationFailed:
2335
+ {
2336
+ const inner = value.inner;
2337
+ let size = ordinalConverter.allocationSize(2);
2338
+ size += FfiConverterString.allocationSize(inner.message);
2339
+ return size;
2340
+ }
2341
+ case BdkError_Tags.WalletLoadFailed:
2342
+ {
2343
+ const inner = value.inner;
2344
+ let size = ordinalConverter.allocationSize(3);
2345
+ size += FfiConverterString.allocationSize(inner.message);
2346
+ return size;
2347
+ }
2348
+ case BdkError_Tags.WalletLoadMismatch:
2349
+ {
2350
+ const inner = value.inner;
2351
+ let size = ordinalConverter.allocationSize(4);
2352
+ size += FfiConverterString.allocationSize(inner.message);
2353
+ return size;
2354
+ }
2355
+ case BdkError_Tags.PersistError:
2356
+ {
2357
+ const inner = value.inner;
2358
+ let size = ordinalConverter.allocationSize(5);
2359
+ size += FfiConverterString.allocationSize(inner.message);
2360
+ return size;
2361
+ }
2362
+ case BdkError_Tags.InvalidAddress:
2363
+ {
2364
+ const inner = value.inner;
2365
+ let size = ordinalConverter.allocationSize(6);
2366
+ size += FfiConverterString.allocationSize(inner.message);
2367
+ return size;
2368
+ }
2369
+ case BdkError_Tags.InvalidScript:
2370
+ {
2371
+ const inner = value.inner;
2372
+ let size = ordinalConverter.allocationSize(7);
2373
+ size += FfiConverterString.allocationSize(inner.message);
2374
+ return size;
2375
+ }
2376
+ case BdkError_Tags.TransactionBuildFailed:
2377
+ {
2378
+ const inner = value.inner;
2379
+ let size = ordinalConverter.allocationSize(8);
2380
+ size += FfiConverterString.allocationSize(inner.message);
2381
+ return size;
2382
+ }
2383
+ case BdkError_Tags.NoRecipients:
2384
+ {
2385
+ const inner = value.inner;
2386
+ let size = ordinalConverter.allocationSize(9);
2387
+ size += FfiConverterString.allocationSize(inner.message);
2388
+ return size;
2389
+ }
2390
+ case BdkError_Tags.NoUtxosSelected:
2391
+ {
2392
+ const inner = value.inner;
2393
+ let size = ordinalConverter.allocationSize(10);
2394
+ size += FfiConverterString.allocationSize(inner.message);
2395
+ return size;
2396
+ }
2397
+ case BdkError_Tags.OutputBelowDustLimit:
2398
+ {
2399
+ const inner = value.inner;
2400
+ let size = ordinalConverter.allocationSize(11);
2401
+ size += FfiConverterString.allocationSize(inner.message);
2402
+ return size;
2403
+ }
2404
+ case BdkError_Tags.InsufficientFunds:
2405
+ {
2406
+ const inner = value.inner;
2407
+ let size = ordinalConverter.allocationSize(12);
2408
+ size += FfiConverterString.allocationSize(inner.message);
2409
+ return size;
2410
+ }
2411
+ case BdkError_Tags.FeeRateTooLow:
2412
+ {
2413
+ const inner = value.inner;
2414
+ let size = ordinalConverter.allocationSize(13);
2415
+ size += FfiConverterString.allocationSize(inner.message);
2416
+ return size;
2417
+ }
2418
+ case BdkError_Tags.FeeTooLow:
2419
+ {
2420
+ const inner = value.inner;
2421
+ let size = ordinalConverter.allocationSize(14);
2422
+ size += FfiConverterString.allocationSize(inner.message);
2423
+ return size;
2424
+ }
2425
+ case BdkError_Tags.LockTimeConflict:
2426
+ {
2427
+ const inner = value.inner;
2428
+ let size = ordinalConverter.allocationSize(15);
2429
+ size += FfiConverterString.allocationSize(inner.message);
2430
+ return size;
2431
+ }
2432
+ case BdkError_Tags.RbfSequenceConflict:
2433
+ {
2434
+ const inner = value.inner;
2435
+ let size = ordinalConverter.allocationSize(16);
2436
+ size += FfiConverterString.allocationSize(inner.message);
2437
+ return size;
2438
+ }
2439
+ case BdkError_Tags.VersionZero:
2440
+ {
2441
+ const inner = value.inner;
2442
+ let size = ordinalConverter.allocationSize(17);
2443
+ size += FfiConverterString.allocationSize(inner.message);
2444
+ return size;
2445
+ }
2446
+ case BdkError_Tags.VersionOneCsv:
2447
+ {
2448
+ const inner = value.inner;
2449
+ let size = ordinalConverter.allocationSize(18);
2450
+ size += FfiConverterString.allocationSize(inner.message);
2451
+ return size;
2452
+ }
2453
+ case BdkError_Tags.SpendingPolicyRequired:
2454
+ {
2455
+ const inner = value.inner;
2456
+ let size = ordinalConverter.allocationSize(19);
2457
+ size += FfiConverterString.allocationSize(inner.message);
2458
+ return size;
2459
+ }
2460
+ case BdkError_Tags.MissingKeyOrigin:
2461
+ {
2462
+ const inner = value.inner;
2463
+ let size = ordinalConverter.allocationSize(20);
2464
+ size += FfiConverterString.allocationSize(inner.message);
2465
+ return size;
2466
+ }
2467
+ case BdkError_Tags.MissingNonWitnessUtxo:
2468
+ {
2469
+ const inner = value.inner;
2470
+ let size = ordinalConverter.allocationSize(21);
2471
+ size += FfiConverterString.allocationSize(inner.message);
2472
+ return size;
2473
+ }
2474
+ case BdkError_Tags.OutpointNotFound:
2475
+ {
2476
+ const inner = value.inner;
2477
+ let size = ordinalConverter.allocationSize(22);
2478
+ size += FfiConverterString.allocationSize(inner.message);
2479
+ return size;
2480
+ }
2481
+ case BdkError_Tags.FeeBumpTargetNotFound:
2482
+ {
2483
+ const inner = value.inner;
2484
+ let size = ordinalConverter.allocationSize(23);
2485
+ size += FfiConverterString.allocationSize(inner.message);
2486
+ return size;
2487
+ }
2488
+ case BdkError_Tags.FeeBumpAlreadyConfirmed:
2489
+ {
2490
+ const inner = value.inner;
2491
+ let size = ordinalConverter.allocationSize(24);
2492
+ size += FfiConverterString.allocationSize(inner.message);
2493
+ return size;
2494
+ }
2495
+ case BdkError_Tags.FeeBumpIrreplaceable:
2496
+ {
2497
+ const inner = value.inner;
2498
+ let size = ordinalConverter.allocationSize(25);
2499
+ size += FfiConverterString.allocationSize(inner.message);
2500
+ return size;
2501
+ }
2502
+ case BdkError_Tags.FeeBumpFeeRateUnavailable:
2503
+ {
2504
+ const inner = value.inner;
2505
+ let size = ordinalConverter.allocationSize(26);
2506
+ size += FfiConverterString.allocationSize(inner.message);
2507
+ return size;
2508
+ }
2509
+ case BdkError_Tags.FeeBumpInvalidOutputIndex:
2510
+ {
2511
+ const inner = value.inner;
2512
+ let size = ordinalConverter.allocationSize(27);
2513
+ size += FfiConverterString.allocationSize(inner.message);
2514
+ return size;
2515
+ }
2516
+ case BdkError_Tags.InvalidPsbt:
2517
+ {
2518
+ const inner = value.inner;
2519
+ let size = ordinalConverter.allocationSize(28);
2520
+ size += FfiConverterString.allocationSize(inner.message);
2521
+ return size;
2522
+ }
2523
+ case BdkError_Tags.SignFailed:
2524
+ {
2525
+ const inner = value.inner;
2526
+ let size = ordinalConverter.allocationSize(29);
2527
+ size += FfiConverterString.allocationSize(inner.message);
2528
+ return size;
2529
+ }
2530
+ case BdkError_Tags.SignerMissingKey:
2531
+ {
2532
+ const inner = value.inner;
2533
+ let size = ordinalConverter.allocationSize(30);
2534
+ size += FfiConverterString.allocationSize(inner.message);
2535
+ return size;
2536
+ }
2537
+ case BdkError_Tags.SignerInvalidKey:
2538
+ {
2539
+ const inner = value.inner;
2540
+ let size = ordinalConverter.allocationSize(31);
2541
+ size += FfiConverterString.allocationSize(inner.message);
2542
+ return size;
2543
+ }
2544
+ case BdkError_Tags.SignerUserCanceled:
2545
+ {
2546
+ const inner = value.inner;
2547
+ let size = ordinalConverter.allocationSize(32);
2548
+ size += FfiConverterString.allocationSize(inner.message);
2549
+ return size;
2550
+ }
2551
+ case BdkError_Tags.SignerInputIndexOutOfRange:
2552
+ {
2553
+ const inner = value.inner;
2554
+ let size = ordinalConverter.allocationSize(33);
2555
+ size += FfiConverterString.allocationSize(inner.message);
2556
+ return size;
2557
+ }
2558
+ case BdkError_Tags.SignerMissingNonWitnessUtxo:
2559
+ {
2560
+ const inner = value.inner;
2561
+ let size = ordinalConverter.allocationSize(34);
2562
+ size += FfiConverterString.allocationSize(inner.message);
2563
+ return size;
2564
+ }
2565
+ case BdkError_Tags.SignerMissingWitnessUtxo:
2566
+ {
2567
+ const inner = value.inner;
2568
+ let size = ordinalConverter.allocationSize(35);
2569
+ size += FfiConverterString.allocationSize(inner.message);
2570
+ return size;
2571
+ }
2572
+ case BdkError_Tags.SignerMissingWitnessScript:
2573
+ {
2574
+ const inner = value.inner;
2575
+ let size = ordinalConverter.allocationSize(36);
2576
+ size += FfiConverterString.allocationSize(inner.message);
2577
+ return size;
2578
+ }
2579
+ case BdkError_Tags.SignerNonStandardSighash:
2580
+ {
2581
+ const inner = value.inner;
2582
+ let size = ordinalConverter.allocationSize(37);
2583
+ size += FfiConverterString.allocationSize(inner.message);
2584
+ return size;
2585
+ }
2586
+ case BdkError_Tags.SignerInvalidSighash:
2587
+ {
2588
+ const inner = value.inner;
2589
+ let size = ordinalConverter.allocationSize(38);
2590
+ size += FfiConverterString.allocationSize(inner.message);
2591
+ return size;
2592
+ }
2593
+ case BdkError_Tags.SyncFailed:
2594
+ {
2595
+ const inner = value.inner;
2596
+ let size = ordinalConverter.allocationSize(39);
2597
+ size += FfiConverterString.allocationSize(inner.message);
2598
+ return size;
2599
+ }
2600
+ case BdkError_Tags.BroadcastFailed:
2601
+ {
2602
+ const inner = value.inner;
2603
+ let size = ordinalConverter.allocationSize(40);
2604
+ size += FfiConverterString.allocationSize(inner.message);
2605
+ return size;
2606
+ }
2607
+ case BdkError_Tags.InvalidTransaction:
2608
+ {
2609
+ const inner = value.inner;
2610
+ let size = ordinalConverter.allocationSize(41);
2611
+ size += FfiConverterString.allocationSize(inner.message);
2612
+ return size;
2613
+ }
2614
+ case BdkError_Tags.TransactionNotFound:
2615
+ {
2616
+ const inner = value.inner;
2617
+ let size = ordinalConverter.allocationSize(42);
2618
+ size += FfiConverterString.allocationSize(inner.message);
2619
+ return size;
2620
+ }
2621
+ case BdkError_Tags.CannotConnect:
2622
+ {
2623
+ const inner = value.inner;
2624
+ let size = ordinalConverter.allocationSize(43);
2625
+ size += FfiConverterString.allocationSize(inner.message);
2626
+ return size;
2627
+ }
2628
+ case BdkError_Tags.CalculateFeeError:
2629
+ {
2630
+ const inner = value.inner;
2631
+ let size = ordinalConverter.allocationSize(44);
2632
+ size += FfiConverterString.allocationSize(inner.message);
2633
+ return size;
2634
+ }
2635
+ case BdkError_Tags.InvalidMnemonic:
2636
+ {
2637
+ const inner = value.inner;
2638
+ let size = ordinalConverter.allocationSize(45);
2639
+ size += FfiConverterString.allocationSize(inner.message);
2640
+ return size;
2641
+ }
2642
+ case BdkError_Tags.InvalidEntropy:
2643
+ {
2644
+ const inner = value.inner;
2645
+ let size = ordinalConverter.allocationSize(46);
2646
+ size += FfiConverterString.allocationSize(inner.message);
2647
+ return size;
2648
+ }
2649
+ case BdkError_Tags.KeyError:
2650
+ {
2651
+ const inner = value.inner;
2652
+ let size = ordinalConverter.allocationSize(47);
2653
+ size += FfiConverterString.allocationSize(inner.message);
2654
+ return size;
2655
+ }
2656
+ case BdkError_Tags.Generic:
2657
+ {
2658
+ const inner = value.inner;
2659
+ let size = ordinalConverter.allocationSize(48);
2660
+ size += FfiConverterString.allocationSize(inner.message);
2661
+ return size;
2662
+ }
1697
2663
  default:
1698
2664
  throw new UniffiInternalError.UnexpectedEnumCase();
1699
2665
  }
1700
2666
  }
1701
- write(value, into) {
1702
- const obj = value;
1703
- const index = obj[variantOrdinalSymbol];
1704
- intConverter.write(index, into);
1705
- }
1706
- allocationSize(value) {
1707
- return intConverter.allocationSize(0);
1708
- }
1709
2667
  }
1710
- return new FfiConverter();
2668
+ return new FFIConverter();
1711
2669
  })();
1712
-
1713
- /**
1714
- * Controls which UTXOs the wallet may spend as change inputs.
1715
- */
1716
2670
  export let ChangeSpendPolicy = /*#__PURE__*/function (ChangeSpendPolicy) {
1717
- /**
1718
- * Both change and non-change outputs may be spent (default).
1719
- */
1720
2671
  ChangeSpendPolicy[ChangeSpendPolicy["ChangeAllowed"] = 0] = "ChangeAllowed";
1721
- /**
1722
- * Only change outputs may be spent as inputs.
1723
- */
1724
2672
  ChangeSpendPolicy[ChangeSpendPolicy["OnlyChange"] = 1] = "OnlyChange";
1725
- /**
1726
- * Only non-change outputs may be spent as inputs.
1727
- */
1728
2673
  ChangeSpendPolicy[ChangeSpendPolicy["ChangeForbidden"] = 2] = "ChangeForbidden";
1729
2674
  return ChangeSpendPolicy;
1730
2675
  }({});
@@ -1759,28 +2704,10 @@ const FfiConverterTypeChangeSpendPolicy = (() => {
1759
2704
  }
1760
2705
  return new FFIConverter();
1761
2706
  })();
1762
-
1763
- /**
1764
- * Standard BIP descriptor templates for generating wallet descriptors
1765
- * from a mnemonic/xprv (also usable for xpub via create_public_descriptor).
1766
- * Mirrors descriptor::template::{Bip44, Bip49, Bip84, Bip86}.
1767
- */
1768
2707
  export let DescriptorTemplate = /*#__PURE__*/function (DescriptorTemplate) {
1769
- /**
1770
- * BIP44 — Legacy P2PKH (1…)
1771
- */
1772
2708
  DescriptorTemplate[DescriptorTemplate["Bip44"] = 0] = "Bip44";
1773
- /**
1774
- * BIP49 — Nested SegWit P2SH-P2WPKH (3…)
1775
- */
1776
2709
  DescriptorTemplate[DescriptorTemplate["Bip49"] = 1] = "Bip49";
1777
- /**
1778
- * BIP84 — Native SegWit P2WPKH (bc1q…)
1779
- */
1780
2710
  DescriptorTemplate[DescriptorTemplate["Bip84"] = 2] = "Bip84";
1781
- /**
1782
- * BIP86 — Taproot P2TR (bc1p…)
1783
- */
1784
2711
  DescriptorTemplate[DescriptorTemplate["Bip86"] = 3] = "Bip86";
1785
2712
  return DescriptorTemplate;
1786
2713
  }({});
@@ -1820,13 +2747,7 @@ const FfiConverterTypeDescriptorTemplate = (() => {
1820
2747
  return new FFIConverter();
1821
2748
  })();
1822
2749
  export let KeychainKind = /*#__PURE__*/function (KeychainKind) {
1823
- /**
1824
- * External keychain — used for deriving recipient addresses.
1825
- */
1826
2750
  KeychainKind[KeychainKind["External"] = 0] = "External";
1827
- /**
1828
- * Internal keychain — used for deriving change addresses.
1829
- */
1830
2751
  KeychainKind[KeychainKind["Internal"] = 1] = "Internal";
1831
2752
  return KeychainKind;
1832
2753
  }({});
@@ -1857,11 +2778,6 @@ const FfiConverterTypeKeychainKind = (() => {
1857
2778
  }
1858
2779
  return new FFIConverter();
1859
2780
  })();
1860
-
1861
- /**
1862
- * BIP-39 mnemonic language. Mirrors bip39::Language.
1863
- * Requires `all-languages` feature on the bip39 crate.
1864
- */
1865
2781
  export let Language = /*#__PURE__*/function (Language) {
1866
2782
  Language[Language["English"] = 0] = "English";
1867
2783
  Language[Language["SimplifiedChinese"] = 1] = "SimplifiedChinese";
@@ -1976,27 +2892,10 @@ const FfiConverterTypeNetwork = (() => {
1976
2892
  }
1977
2893
  return new FFIConverter();
1978
2894
  })();
1979
-
1980
- /**
1981
- * Single-key descriptor templates.
1982
- * Mirrors descriptor::template::{P2Pkh, P2Wpkh, P2Wpkh_P2Sh, P2TR}.
1983
- */
1984
2895
  export let SingleKeyDescriptorTemplate = /*#__PURE__*/function (SingleKeyDescriptorTemplate) {
1985
- /**
1986
- * Pay-to-PubKey-Hash — Legacy (1…)
1987
- */
1988
2896
  SingleKeyDescriptorTemplate[SingleKeyDescriptorTemplate["P2Pkh"] = 0] = "P2Pkh";
1989
- /**
1990
- * Pay-to-Witness-PubKey-Hash — Native SegWit (bc1q…)
1991
- */
1992
2897
  SingleKeyDescriptorTemplate[SingleKeyDescriptorTemplate["P2Wpkh"] = 1] = "P2Wpkh";
1993
- /**
1994
- * P2Wpkh wrapped in P2SH — Nested SegWit (3…)
1995
- */
1996
2898
  SingleKeyDescriptorTemplate[SingleKeyDescriptorTemplate["P2WpkhP2Sh"] = 2] = "P2WpkhP2Sh";
1997
- /**
1998
- * Pay-to-Taproot (bc1p…)
1999
- */
2000
2899
  SingleKeyDescriptorTemplate[SingleKeyDescriptorTemplate["P2tr"] = 3] = "P2tr";
2001
2900
  return SingleKeyDescriptorTemplate;
2002
2901
  }({});
@@ -2035,19 +2934,8 @@ const FfiConverterTypeSingleKeyDescriptorTemplate = (() => {
2035
2934
  }
2036
2935
  return new FFIConverter();
2037
2936
  })();
2038
-
2039
- /**
2040
- * Ordering applied to inputs and outputs when building a transaction.
2041
- * Note: bdk_wallet also has a Custom variant (with closures) that cannot cross FFI.
2042
- */
2043
2937
  export let TxOrdering = /*#__PURE__*/function (TxOrdering) {
2044
- /**
2045
- * Randomise input and output order (default, good for privacy).
2046
- */
2047
2938
  TxOrdering[TxOrdering["Shuffle"] = 0] = "Shuffle";
2048
- /**
2049
- * Preserve insertion order of recipients and manually added UTXOs.
2050
- */
2051
2939
  TxOrdering[TxOrdering["Untouched"] = 1] = "Untouched";
2052
2940
  return TxOrdering;
2053
2941
  }({});
@@ -2088,14 +2976,7 @@ export let WalletEvent_Tags = /*#__PURE__*/function (WalletEvent_Tags) {
2088
2976
  WalletEvent_Tags["TxDropped"] = "TxDropped";
2089
2977
  return WalletEvent_Tags;
2090
2978
  }({});
2091
- /**
2092
- * Events emitted when applying chain updates to the wallet.
2093
- * Mirrors bdk_wallet::event::WalletEvent (non-exhaustive in upstream).
2094
- */
2095
2979
  export const WalletEvent = (() => {
2096
- /**
2097
- * The local chain tip has changed.
2098
- */
2099
2980
  class ChainTipChanged_ extends UniffiEnum {
2100
2981
  /**
2101
2982
  * @private
@@ -2114,9 +2995,6 @@ export const WalletEvent = (() => {
2114
2995
  return obj.tag === WalletEvent_Tags.ChainTipChanged;
2115
2996
  }
2116
2997
  }
2117
- /**
2118
- * A transaction has been confirmed.
2119
- */
2120
2998
  class TxConfirmed_ extends UniffiEnum {
2121
2999
  /**
2122
3000
  * @private
@@ -2135,9 +3013,6 @@ export const WalletEvent = (() => {
2135
3013
  return obj.tag === WalletEvent_Tags.TxConfirmed;
2136
3014
  }
2137
3015
  }
2138
- /**
2139
- * A previously confirmed transaction has been unconfirmed (reorg).
2140
- */
2141
3016
  class TxUnconfirmed_ extends UniffiEnum {
2142
3017
  /**
2143
3018
  * @private
@@ -2156,9 +3031,6 @@ export const WalletEvent = (() => {
2156
3031
  return obj.tag === WalletEvent_Tags.TxUnconfirmed;
2157
3032
  }
2158
3033
  }
2159
- /**
2160
- * A transaction has been replaced (RBF or conflict).
2161
- */
2162
3034
  class TxReplaced_ extends UniffiEnum {
2163
3035
  /**
2164
3036
  * @private
@@ -2177,9 +3049,6 @@ export const WalletEvent = (() => {
2177
3049
  return obj.tag === WalletEvent_Tags.TxReplaced;
2178
3050
  }
2179
3051
  }
2180
- /**
2181
- * A transaction has been dropped from the mempool / evicted.
2182
- */
2183
3052
  class TxDropped_ extends UniffiEnum {
2184
3053
  /**
2185
3054
  * @private
@@ -2210,12 +3079,6 @@ export const WalletEvent = (() => {
2210
3079
  TxDropped: TxDropped_
2211
3080
  });
2212
3081
  })();
2213
-
2214
- /**
2215
- * Events emitted when applying chain updates to the wallet.
2216
- * Mirrors bdk_wallet::event::WalletEvent (non-exhaustive in upstream).
2217
- */
2218
-
2219
3082
  // FfiConverter for enum WalletEvent
2220
3083
  const FfiConverterTypeWalletEvent = (() => {
2221
3084
  const ordinalConverter = FfiConverterInt32;
@@ -2341,10 +3204,6 @@ const FfiConverterTypeWalletEvent = (() => {
2341
3204
  }
2342
3205
  return new FFIConverter();
2343
3206
  })();
2344
-
2345
- /**
2346
- * BIP-39 mnemonic word count (determines entropy length).
2347
- */
2348
3207
  export let WordCount = /*#__PURE__*/function (WordCount) {
2349
3208
  WordCount[WordCount["Words12"] = 0] = "Words12";
2350
3209
  WordCount[WordCount["Words15"] = 1] = "Words15";
@@ -2394,107 +3253,136 @@ const FfiConverterTypeWordCount = (() => {
2394
3253
  })();
2395
3254
 
2396
3255
  /**
2397
- * BIP-39 mnemonic phrase for key generation.
2398
- * Backed by bdk_wallet::keys::bip39::Mnemonic (requires `keys-bip39` feature).
3256
+ * A reusable Electrum client that holds a persistent TCP/TLS connection.
2399
3257
  */
2400
3258
 
2401
3259
  /**
2402
- * @deprecated Use `MnemonicLike` instead.
3260
+ * @deprecated Use `ElectrumClientLike` instead.
2403
3261
  */
2404
3262
 
2405
3263
  /**
2406
- * BIP-39 mnemonic phrase for key generation.
2407
- * Backed by bdk_wallet::keys::bip39::Mnemonic (requires `keys-bip39` feature).
3264
+ * A reusable Electrum client that holds a persistent TCP/TLS connection.
2408
3265
  */
2409
- export class Mnemonic extends UniffiAbstractObject {
2410
- [uniffiTypeNameSymbol] = "Mnemonic";
3266
+ export class ElectrumClient extends UniffiAbstractObject {
3267
+ [uniffiTypeNameSymbol] = "ElectrumClient";
2411
3268
  /**
2412
- * Generate a new random mnemonic with the given word count (English).
3269
+ * Connect to an Electrum server.
2413
3270
  */
2414
- constructor(wordCount) /*throws*/{
3271
+ constructor(url) /*throws*/{
2415
3272
  super();
2416
3273
  const pointer = uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
2417
- return nativeModule().ubrn_uniffi_bdk_ffi_fn_constructor_mnemonic_new(FfiConverterTypeWordCount.lower(wordCount), callStatus);
3274
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_constructor_electrumclient_new(FfiConverterString.lower(url), callStatus);
2418
3275
  }, /*liftString:*/FfiConverterString.lift);
2419
3276
  this[pointerLiteralSymbol] = pointer;
2420
- this[destructorGuardSymbol] = uniffiTypeMnemonicObjectFactory.bless(pointer);
3277
+ this[destructorGuardSymbol] = uniffiTypeElectrumClientObjectFactory.bless(pointer);
2421
3278
  }
2422
3279
 
2423
3280
  /**
2424
- * Create a mnemonic from raw entropy bytes (16–32 bytes).
3281
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
2425
3282
  */
3283
+ uniffiDestroy() {
3284
+ const ptr = this[destructorGuardSymbol];
3285
+ if (ptr !== undefined) {
3286
+ const pointer = uniffiTypeElectrumClientObjectFactory.pointer(this);
3287
+ uniffiTypeElectrumClientObjectFactory.freePointer(pointer);
3288
+ uniffiTypeElectrumClientObjectFactory.unbless(ptr);
3289
+ delete this[destructorGuardSymbol];
3290
+ }
3291
+ }
3292
+ static instanceOf(obj) {
3293
+ return uniffiTypeElectrumClientObjectFactory.isConcreteType(obj);
3294
+ }
3295
+ }
3296
+ const uniffiTypeElectrumClientObjectFactory = (() => {
3297
+ return {
3298
+ create(pointer) {
3299
+ const instance = Object.create(ElectrumClient.prototype);
3300
+ instance[pointerLiteralSymbol] = pointer;
3301
+ instance[destructorGuardSymbol] = this.bless(pointer);
3302
+ instance[uniffiTypeNameSymbol] = "ElectrumClient";
3303
+ return instance;
3304
+ },
3305
+ bless(p) {
3306
+ return uniffiCaller.rustCall(/*caller:*/status => nativeModule().ubrn_uniffi_internal_fn_method_electrumclient_ffi__bless_pointer(p, status), /*liftString:*/FfiConverterString.lift);
3307
+ },
3308
+ unbless(ptr) {
3309
+ ptr.markDestroyed();
3310
+ },
3311
+ pointer(obj) {
3312
+ if (obj[destructorGuardSymbol] === undefined) {
3313
+ throw new UniffiInternalError.UnexpectedNullPointer();
3314
+ }
3315
+ return obj[pointerLiteralSymbol];
3316
+ },
3317
+ clonePointer(obj) {
3318
+ const pointer = this.pointer(obj);
3319
+ return uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_bdk_ffi_fn_clone_electrumclient(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
3320
+ },
3321
+ freePointer(pointer) {
3322
+ uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_bdk_ffi_fn_free_electrumclient(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
3323
+ },
3324
+ isConcreteType(obj) {
3325
+ return obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === "ElectrumClient";
3326
+ }
3327
+ };
3328
+ })();
3329
+ // FfiConverter for ElectrumClientLike
3330
+ const FfiConverterTypeElectrumClient = new FfiConverterObject(uniffiTypeElectrumClientObjectFactory);
3331
+
3332
+ /**
3333
+ * @deprecated Use `MnemonicLike` instead.
3334
+ */
3335
+
3336
+ export class Mnemonic extends UniffiAbstractObject {
3337
+ [uniffiTypeNameSymbol] = "Mnemonic";
3338
+ constructor(wordCount) /*throws*/{
3339
+ super();
3340
+ const pointer = uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3341
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_constructor_mnemonic_new(FfiConverterTypeWordCount.lower(wordCount), callStatus);
3342
+ }, /*liftString:*/FfiConverterString.lift);
3343
+ this[pointerLiteralSymbol] = pointer;
3344
+ this[destructorGuardSymbol] = uniffiTypeMnemonicObjectFactory.bless(pointer);
3345
+ }
2426
3346
  static fromEntropy(entropy) /*throws*/{
2427
3347
  return FfiConverterTypeMnemonic.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
2428
3348
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_constructor_mnemonic_from_entropy(FfiConverterArrayUInt8.lower(entropy), callStatus);
2429
3349
  }, /*liftString:*/FfiConverterString.lift));
2430
3350
  }
2431
-
2432
- /**
2433
- * Create a mnemonic from raw entropy bytes in a specific language.
2434
- */
2435
3351
  static fromEntropyIn(entropy, language) /*throws*/{
2436
3352
  return FfiConverterTypeMnemonic.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
2437
3353
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_constructor_mnemonic_from_entropy_in(FfiConverterArrayUInt8.lower(entropy), FfiConverterTypeLanguage.lower(language), callStatus);
2438
3354
  }, /*liftString:*/FfiConverterString.lift));
2439
3355
  }
2440
-
2441
- /**
2442
- * Parse an existing mnemonic string (auto-detects language).
2443
- */
2444
3356
  static fromString(mnemonic) /*throws*/{
2445
3357
  return FfiConverterTypeMnemonic.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
2446
3358
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_constructor_mnemonic_from_string(FfiConverterString.lower(mnemonic), callStatus);
2447
3359
  }, /*liftString:*/FfiConverterString.lift));
2448
3360
  }
2449
-
2450
- /**
2451
- * Parse a mnemonic string in a specific language.
2452
- */
2453
3361
  static fromStringIn(mnemonic, language) /*throws*/{
2454
3362
  return FfiConverterTypeMnemonic.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
2455
3363
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_constructor_mnemonic_from_string_in(FfiConverterString.lower(mnemonic), FfiConverterTypeLanguage.lower(language), callStatus);
2456
3364
  }, /*liftString:*/FfiConverterString.lift));
2457
3365
  }
2458
-
2459
- /**
2460
- * The language of this mnemonic.
2461
- */
2462
3366
  language() {
2463
3367
  return FfiConverterTypeLanguage.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
2464
3368
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_mnemonic_language(uniffiTypeMnemonicObjectFactory.clonePointer(this), callStatus);
2465
3369
  }, /*liftString:*/FfiConverterString.lift));
2466
3370
  }
2467
-
2468
- /**
2469
- * Derive the 64-byte seed as hex. Pass an empty string for no passphrase.
2470
- */
2471
3371
  toSeedHex(passphrase) {
2472
3372
  return FfiConverterString.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
2473
3373
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_mnemonic_to_seed_hex(uniffiTypeMnemonicObjectFactory.clonePointer(this), FfiConverterString.lower(passphrase), callStatus);
2474
3374
  }, /*liftString:*/FfiConverterString.lift));
2475
3375
  }
2476
-
2477
- /**
2478
- * The mnemonic as a space-separated word string.
2479
- */
2480
3376
  toString() {
2481
3377
  return FfiConverterString.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
2482
3378
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_mnemonic_to_string(uniffiTypeMnemonicObjectFactory.clonePointer(this), callStatus);
2483
3379
  }, /*liftString:*/FfiConverterString.lift));
2484
3380
  }
2485
-
2486
- /**
2487
- * Number of words (12, 15, 18, 21, or 24).
2488
- */
2489
3381
  wordCount() {
2490
3382
  return FfiConverterUInt32.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
2491
3383
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_mnemonic_word_count(uniffiTypeMnemonicObjectFactory.clonePointer(this), callStatus);
2492
3384
  }, /*liftString:*/FfiConverterString.lift));
2493
3385
  }
2494
-
2495
- /**
2496
- * List the individual words.
2497
- */
2498
3386
  words() {
2499
3387
  return FfiConverterArrayString.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
2500
3388
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_mnemonic_words(uniffiTypeMnemonicObjectFactory.clonePointer(this), callStatus);
@@ -2553,24 +3441,12 @@ const uniffiTypeMnemonicObjectFactory = (() => {
2553
3441
  // FfiConverter for MnemonicLike
2554
3442
  const FfiConverterTypeMnemonic = new FfiConverterObject(uniffiTypeMnemonicObjectFactory);
2555
3443
 
2556
- /**
2557
- * A Partially Signed Bitcoin Transaction (BIP-174 / BIP-370).
2558
- * Mirrors bitcoin::Psbt with added PsbtUtils trait methods.
2559
- */
2560
-
2561
3444
  /**
2562
3445
  * @deprecated Use `PsbtLike` instead.
2563
3446
  */
2564
3447
 
2565
- /**
2566
- * A Partially Signed Bitcoin Transaction (BIP-174 / BIP-370).
2567
- * Mirrors bitcoin::Psbt with added PsbtUtils trait methods.
2568
- */
2569
3448
  export class Psbt extends UniffiAbstractObject {
2570
3449
  [uniffiTypeNameSymbol] = "Psbt";
2571
- /**
2572
- * Deserialize from a base64-encoded string.
2573
- */
2574
3450
  constructor(psbtBase64) /*throws*/{
2575
3451
  super();
2576
3452
  const pointer = uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
@@ -2579,59 +3455,31 @@ export class Psbt extends UniffiAbstractObject {
2579
3455
  this[pointerLiteralSymbol] = pointer;
2580
3456
  this[destructorGuardSymbol] = uniffiTypePsbtObjectFactory.bless(pointer);
2581
3457
  }
2582
-
2583
- /**
2584
- * Extract the fully-signed transaction as raw hex.
2585
- * Only valid after all inputs are finalized.
2586
- */
2587
3458
  extractTxHex() /*throws*/{
2588
3459
  return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
2589
3460
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_psbt_extract_tx_hex(uniffiTypePsbtObjectFactory.clonePointer(this), callStatus);
2590
3461
  }, /*liftString:*/FfiConverterString.lift));
2591
3462
  }
2592
-
2593
- /**
2594
- * Total fee in satoshis. None if any input UTXO value is unknown.
2595
- * From PsbtUtils::fee_amount().
2596
- */
2597
3463
  feeAmount() {
2598
3464
  return FfiConverterOptionalUInt64.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
2599
3465
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_psbt_fee_amount(uniffiTypePsbtObjectFactory.clonePointer(this), callStatus);
2600
3466
  }, /*liftString:*/FfiConverterString.lift));
2601
3467
  }
2602
-
2603
- /**
2604
- * Fee rate in sat/vbyte. None if any input UTXO value is unknown.
2605
- * From PsbtUtils::fee_rate().
2606
- */
2607
3468
  feeRate() {
2608
3469
  return FfiConverterOptionalFloat64.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
2609
3470
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_psbt_fee_rate(uniffiTypePsbtObjectFactory.clonePointer(this), callStatus);
2610
3471
  }, /*liftString:*/FfiConverterString.lift));
2611
3472
  }
2612
-
2613
- /**
2614
- * Retrieve the UTXO for a given input index. Returns None if unavailable.
2615
- * From PsbtUtils::get_utxo_for().
2616
- */
2617
3473
  getUtxoFor(inputIndex) {
2618
3474
  return FfiConverterOptionalTypeTxOut.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
2619
3475
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_psbt_get_utxo_for(uniffiTypePsbtObjectFactory.clonePointer(this), FfiConverterUInt64.lower(inputIndex), callStatus);
2620
3476
  }, /*liftString:*/FfiConverterString.lift));
2621
3477
  }
2622
-
2623
- /**
2624
- * Serialize to a base64-encoded string.
2625
- */
2626
3478
  toBase64() {
2627
3479
  return FfiConverterString.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
2628
3480
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_psbt_to_base64(uniffiTypePsbtObjectFactory.clonePointer(this), callStatus);
2629
3481
  }, /*liftString:*/FfiConverterString.lift));
2630
3482
  }
2631
-
2632
- /**
2633
- * The unsigned txid (available before finalization).
2634
- */
2635
3483
  txid() /*throws*/{
2636
3484
  return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
2637
3485
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_psbt_txid(uniffiTypePsbtObjectFactory.clonePointer(this), callStatus);
@@ -2688,23 +3536,12 @@ const uniffiTypePsbtObjectFactory = (() => {
2688
3536
  };
2689
3537
  })();
2690
3538
  // FfiConverter for PsbtLike
2691
- const FfiConverterTypePsbt = new FfiConverterObject(uniffiTypePsbtObjectFactory);
2692
-
2693
- /**
2694
- * Fluent builder for constructing Bitcoin transactions.
2695
- * Create one, configure it, then call finish(wallet) to produce a PSBT.
2696
- * Mirrors bdk_wallet::TxBuilder (without lifetime / generic coin selection).
2697
- */
3539
+ const FfiConverterTypePsbt = new FfiConverterObject(uniffiTypePsbtObjectFactory);
2698
3540
 
2699
3541
  /**
2700
3542
  * @deprecated Use `TxBuilderLike` instead.
2701
3543
  */
2702
3544
 
2703
- /**
2704
- * Fluent builder for constructing Bitcoin transactions.
2705
- * Create one, configure it, then call finish(wallet) to produce a PSBT.
2706
- * Mirrors bdk_wallet::TxBuilder (without lifetime / generic coin selection).
2707
- */
2708
3545
  export class TxBuilder extends UniffiAbstractObject {
2709
3546
  [uniffiTypeNameSymbol] = "TxBuilder";
2710
3547
  constructor() {
@@ -2715,163 +3552,91 @@ export class TxBuilder extends UniffiAbstractObject {
2715
3552
  this[pointerLiteralSymbol] = pointer;
2716
3553
  this[destructorGuardSymbol] = uniffiTypeTxBuilderObjectFactory.bless(pointer);
2717
3554
  }
2718
-
2719
- /**
2720
- * Attach OP_RETURN data to the transaction.
2721
- */
2722
3555
  addData(data) {
2723
3556
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2724
3557
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_add_data(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterArrayUInt8.lower(data), callStatus);
2725
3558
  }, /*liftString:*/FfiConverterString.lift);
2726
3559
  }
2727
-
2728
- /**
2729
- * Include BIP-32 global xpubs in the PSBT.
2730
- */
2731
3560
  addGlobalXpubs() {
2732
3561
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2733
3562
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_add_global_xpubs(uniffiTypeTxBuilderObjectFactory.clonePointer(this), callStatus);
2734
3563
  }, /*liftString:*/FfiConverterString.lift);
2735
3564
  }
2736
-
2737
- /**
2738
- * Add a single recipient (address + amount).
2739
- */
2740
3565
  addRecipient(address, amountSats) {
2741
3566
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2742
3567
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_add_recipient(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterString.lower(address), FfiConverterUInt64.lower(amountSats), callStatus);
2743
3568
  }, /*liftString:*/FfiConverterString.lift);
2744
3569
  }
2745
-
2746
- /**
2747
- * Mark a single UTXO as unspendable.
2748
- */
2749
3570
  addUnspendable(outpoint) {
2750
3571
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2751
3572
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_add_unspendable(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterTypeOutPoint.lower(outpoint), callStatus);
2752
3573
  }, /*liftString:*/FfiConverterString.lift);
2753
3574
  }
2754
-
2755
- /**
2756
- * Add a specific UTXO to spend.
2757
- */
2758
3575
  addUtxo(outpoint) /*throws*/{
2759
3576
  uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
2760
3577
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_add_utxo(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterTypeOutPoint.lower(outpoint), callStatus);
2761
3578
  }, /*liftString:*/FfiConverterString.lift);
2762
3579
  }
2763
-
2764
- /**
2765
- * Add multiple specific UTXOs to spend.
2766
- */
2767
3580
  addUtxos(outpoints) /*throws*/{
2768
3581
  uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
2769
3582
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_add_utxos(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterArrayTypeOutPoint.lower(outpoints), callStatus);
2770
3583
  }, /*liftString:*/FfiConverterString.lift);
2771
3584
  }
2772
-
2773
- /**
2774
- * Allow outputs below the dust threshold.
2775
- */
2776
3585
  allowDust(allow) {
2777
3586
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2778
3587
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_allow_dust(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterBool.lower(allow), callStatus);
2779
3588
  }, /*liftString:*/FfiConverterString.lift);
2780
3589
  }
2781
-
2782
- /**
2783
- * Set the change spend policy explicitly.
2784
- */
2785
3590
  changePolicy(policy) {
2786
3591
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2787
3592
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_change_policy(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterTypeChangeSpendPolicy.lower(policy), callStatus);
2788
3593
  }, /*liftString:*/FfiConverterString.lift);
2789
3594
  }
2790
-
2791
- /**
2792
- * Set the assumed current block height (for relative timelock evaluation).
2793
- */
2794
3595
  currentHeight(height) {
2795
3596
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2796
3597
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_current_height(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterUInt32.lower(height), callStatus);
2797
3598
  }, /*liftString:*/FfiConverterString.lift);
2798
3599
  }
2799
-
2800
- /**
2801
- * Forbid spending from change outputs.
2802
- */
2803
3600
  doNotSpendChange() {
2804
3601
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2805
3602
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_do_not_spend_change(uniffiTypeTxBuilderObjectFactory.clonePointer(this), callStatus);
2806
3603
  }, /*liftString:*/FfiConverterString.lift);
2807
3604
  }
2808
-
2809
- /**
2810
- * Set the script to receive the remaining change (use with drain_wallet).
2811
- */
2812
3605
  drainTo(address) /*throws*/{
2813
3606
  uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
2814
3607
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_drain_to(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterString.lower(address), callStatus);
2815
3608
  }, /*liftString:*/FfiConverterString.lift);
2816
3609
  }
2817
-
2818
- /**
2819
- * Spend all spendable UTXOs (send remaining to the drain_to address).
2820
- */
2821
3610
  drainWallet() {
2822
3611
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2823
3612
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_drain_wallet(uniffiTypeTxBuilderObjectFactory.clonePointer(this), callStatus);
2824
3613
  }, /*liftString:*/FfiConverterString.lift);
2825
3614
  }
2826
-
2827
- /**
2828
- * Enable RBF signalling with the default nSequence (0xFFFFFFFD).
2829
- */
2830
3615
  enableRbf() {
2831
3616
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2832
3617
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_enable_rbf(uniffiTypeTxBuilderObjectFactory.clonePointer(this), callStatus);
2833
3618
  }, /*liftString:*/FfiConverterString.lift);
2834
3619
  }
2835
-
2836
- /**
2837
- * Enable RBF signalling with a specific nSequence value (must be < 0xFFFFFFFE).
2838
- */
2839
3620
  enableRbfWithSequence(nsequence) {
2840
3621
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2841
3622
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_enable_rbf_with_sequence(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterUInt32.lower(nsequence), callStatus);
2842
3623
  }, /*liftString:*/FfiConverterString.lift);
2843
3624
  }
2844
-
2845
- /**
2846
- * Exclude UTXOs with fewer than min_confirms confirmations.
2847
- */
2848
3625
  excludeBelowConfirmations(minConfirms) {
2849
3626
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2850
3627
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_exclude_below_confirmations(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterUInt32.lower(minConfirms), callStatus);
2851
3628
  }, /*liftString:*/FfiConverterString.lift);
2852
3629
  }
2853
-
2854
- /**
2855
- * Exclude all unconfirmed UTXOs.
2856
- */
2857
3630
  excludeUnconfirmed() {
2858
3631
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2859
3632
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_exclude_unconfirmed(uniffiTypeTxBuilderObjectFactory.clonePointer(this), callStatus);
2860
3633
  }, /*liftString:*/FfiConverterString.lift);
2861
3634
  }
2862
-
2863
- /**
2864
- * Set an absolute fee in satoshis (overrides fee_rate).
2865
- */
2866
3635
  feeAbsolute(feeSats) {
2867
3636
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2868
3637
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_fee_absolute(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterUInt64.lower(feeSats), callStatus);
2869
3638
  }, /*liftString:*/FfiConverterString.lift);
2870
3639
  }
2871
-
2872
- /**
2873
- * Set a fee rate target in sat/vbyte.
2874
- */
2875
3640
  feeRate(satPerVbyte) {
2876
3641
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2877
3642
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_fee_rate(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterFloat64.lower(satPerVbyte), callStatus);
@@ -2879,118 +3644,76 @@ export class TxBuilder extends UniffiAbstractObject {
2879
3644
  }
2880
3645
 
2881
3646
  /**
2882
- * Build the transaction into a PSBT. The wallet is used for coin
2883
- * selection and script resolution — the PSBT is NOT signed here.
3647
+ * Build the transaction into a PSBT (async runs on background thread).
2884
3648
  */
2885
- finish(wallet) /*throws*/{
2886
- return FfiConverterTypePsbt.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
2887
- return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_finish(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterTypeWallet.lower(wallet), callStatus);
2888
- }, /*liftString:*/FfiConverterString.lift));
3649
+ async finish(wallet, asyncOpts_) /*throws*/{
3650
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
3651
+ try {
3652
+ return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
3653
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_finish(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterTypeWallet.lower(wallet));
3654
+ }, /*pollFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_poll_u64, /*cancelFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_cancel_u64, /*completeFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_complete_u64, /*freeFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_free_u64, /*liftFunc:*/FfiConverterTypePsbt.lift.bind(FfiConverterTypePsbt), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError));
3655
+ } catch (__error) {
3656
+ if (uniffiIsDebug && __error instanceof Error) {
3657
+ __error.stack = __stack;
3658
+ }
3659
+ throw __error;
3660
+ }
2889
3661
  }
2890
-
2891
- /**
2892
- * Include the redeemScript / witnessScript in PSBT outputs.
2893
- */
2894
3662
  includeOutputRedeemWitnessScript() {
2895
3663
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2896
3664
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_include_output_redeem_witness_script(uniffiTypeTxBuilderObjectFactory.clonePointer(this), callStatus);
2897
3665
  }, /*liftString:*/FfiConverterString.lift);
2898
3666
  }
2899
-
2900
- /**
2901
- * Only use the UTXOs explicitly added with add_utxo / add_utxos.
2902
- */
2903
3667
  manuallySelectedOnly() {
2904
3668
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2905
3669
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_manually_selected_only(uniffiTypeTxBuilderObjectFactory.clonePointer(this), callStatus);
2906
3670
  }, /*liftString:*/FfiConverterString.lift);
2907
3671
  }
2908
-
2909
- /**
2910
- * Set an explicit nLockTime (as a block height).
2911
- */
2912
3672
  nlocktime(lockHeight) {
2913
3673
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2914
3674
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_nlocktime(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterUInt32.lower(lockHeight), callStatus);
2915
3675
  }, /*liftString:*/FfiConverterString.lift);
2916
3676
  }
2917
-
2918
- /**
2919
- * Only spend from change outputs.
2920
- */
2921
3677
  onlySpendChange() {
2922
3678
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2923
3679
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_only_spend_change(uniffiTypeTxBuilderObjectFactory.clonePointer(this), callStatus);
2924
3680
  }, /*liftString:*/FfiConverterString.lift);
2925
3681
  }
2926
-
2927
- /**
2928
- * Include only witness UTXO in PSBT inputs (reduced size, less validation).
2929
- */
2930
3682
  onlyWitnessUtxo() {
2931
3683
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2932
3684
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_only_witness_utxo(uniffiTypeTxBuilderObjectFactory.clonePointer(this), callStatus);
2933
3685
  }, /*liftString:*/FfiConverterString.lift);
2934
3686
  }
2935
-
2936
- /**
2937
- * Set the input/output ordering strategy.
2938
- */
2939
3687
  ordering(ordering) {
2940
3688
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2941
3689
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_ordering(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterTypeTxOrdering.lower(ordering), callStatus);
2942
3690
  }, /*liftString:*/FfiConverterString.lift);
2943
3691
  }
2944
-
2945
- /**
2946
- * Supply a policy path for complex descriptors (multisig, timelocks).
2947
- * path_map is a JSON-encoded BTreeMap<String, Vec<usize>>.
2948
- */
2949
3692
  policyPath(pathMapJson, keychain) {
2950
3693
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2951
3694
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_policy_path(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterString.lower(pathMapJson), FfiConverterTypeKeychainKind.lower(keychain), callStatus);
2952
3695
  }, /*liftString:*/FfiConverterString.lift);
2953
3696
  }
2954
-
2955
- /**
2956
- * Set an exact nSequence value for all inputs.
2957
- */
2958
3697
  setExactSequence(nsequence) {
2959
3698
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2960
3699
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_set_exact_sequence(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterUInt32.lower(nsequence), callStatus);
2961
3700
  }, /*liftString:*/FfiConverterString.lift);
2962
3701
  }
2963
-
2964
- /**
2965
- * Replace the entire recipient list.
2966
- */
2967
3702
  setRecipients(recipients) {
2968
3703
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2969
3704
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_set_recipients(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterArrayTypeRecipient.lower(recipients), callStatus);
2970
3705
  }, /*liftString:*/FfiConverterString.lift);
2971
3706
  }
2972
-
2973
- /**
2974
- * Set the sighash type for all inputs.
2975
- */
2976
3707
  sighash(sighashType) {
2977
3708
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2978
3709
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_sighash(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterUInt32.lower(sighashType), callStatus);
2979
3710
  }, /*liftString:*/FfiConverterString.lift);
2980
3711
  }
2981
-
2982
- /**
2983
- * Set the transaction version (1 or 2).
2984
- */
2985
3712
  txVersion(version) {
2986
3713
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2987
3714
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_tx_version(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterInt32.lower(version), callStatus);
2988
3715
  }, /*liftString:*/FfiConverterString.lift);
2989
3716
  }
2990
-
2991
- /**
2992
- * Mark UTXOs as unspendable (excluded from coin selection).
2993
- */
2994
3717
  unspendable(outpoints) {
2995
3718
  uniffiCaller.rustCall(/*caller:*/callStatus => {
2996
3719
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_unspendable(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterArrayTypeOutPoint.lower(outpoints), callStatus);
@@ -3056,9 +3779,7 @@ const FfiConverterTypeTxBuilder = new FfiConverterObject(uniffiTypeTxBuilderObje
3056
3779
  export class Wallet extends UniffiAbstractObject {
3057
3780
  [uniffiTypeNameSymbol] = "Wallet";
3058
3781
  /**
3059
- * Create or load a persisted wallet.
3060
- * descriptor / change_descriptor: output descriptor strings (e.g. "wpkh(tprv…/84'/1'/0'/0/*)")
3061
- * db_path: file path for the SQLite persistence database.
3782
+ * Create or load a persisted wallet (sync — for async use create_wallet()).
3062
3783
  */
3063
3784
  constructor(descriptor, changeDescriptor, network, dbPath) /*throws*/{
3064
3785
  super();
@@ -3068,15 +3789,11 @@ export class Wallet extends UniffiAbstractObject {
3068
3789
  this[pointerLiteralSymbol] = pointer;
3069
3790
  this[destructorGuardSymbol] = uniffiTypeWalletObjectFactory.bless(pointer);
3070
3791
  }
3071
-
3072
- /**
3073
- * Broadcast a finalized PSBT via Electrum. Returns the txid.
3074
- */
3075
- async broadcastWithElectrum(url, psbt, asyncOpts_) /*throws*/{
3792
+ async broadcastWithElectrum(client, psbt, asyncOpts_) /*throws*/{
3076
3793
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
3077
3794
  try {
3078
3795
  return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
3079
- return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_broadcast_with_electrum(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(url), FfiConverterTypePsbt.lower(psbt));
3796
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_broadcast_with_electrum(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeElectrumClient.lower(client), FfiConverterTypePsbt.lower(psbt));
3080
3797
  }, /*pollFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterString.lift.bind(FfiConverterString), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError));
3081
3798
  } catch (__error) {
3082
3799
  if (uniffiIsDebug && __error instanceof Error) {
@@ -3085,10 +3802,6 @@ export class Wallet extends UniffiAbstractObject {
3085
3802
  throw __error;
3086
3803
  }
3087
3804
  }
3088
-
3089
- /**
3090
- * Broadcast a finalized PSBT via Esplora. Returns the txid.
3091
- */
3092
3805
  async broadcastWithEsplora(url, psbt, asyncOpts_) /*throws*/{
3093
3806
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
3094
3807
  try {
@@ -3102,91 +3815,46 @@ export class Wallet extends UniffiAbstractObject {
3102
3815
  throw __error;
3103
3816
  }
3104
3817
  }
3105
-
3106
- /**
3107
- * Build an RBF fee-bump PSBT for an unconfirmed transaction.
3108
- * Mirrors Wallet::build_fee_bump().
3109
- */
3110
3818
  buildFeeBump(txid, newFeeRate) /*throws*/{
3111
3819
  return FfiConverterTypePsbt.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3112
3820
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_build_fee_bump(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(txid), FfiConverterFloat64.lower(newFeeRate), callStatus);
3113
3821
  }, /*liftString:*/FfiConverterString.lift));
3114
3822
  }
3115
-
3116
- /**
3117
- * Calculate the fee paid by a raw transaction (hex). Returns satoshis.
3118
- * Mirrors Wallet::calculate_fee().
3119
- */
3120
3823
  calculateFee(txHex) /*throws*/{
3121
3824
  return FfiConverterUInt64.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3122
3825
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_calculate_fee(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(txHex), callStatus);
3123
3826
  }, /*liftString:*/FfiConverterString.lift));
3124
3827
  }
3125
-
3126
- /**
3127
- * Calculate the fee rate for a raw transaction (hex). Returns sat/vbyte.
3128
- * Mirrors Wallet::calculate_fee_rate().
3129
- */
3130
3828
  calculateFeeRate(txHex) /*throws*/{
3131
3829
  return FfiConverterFloat64.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3132
3830
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_calculate_fee_rate(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(txHex), callStatus);
3133
3831
  }, /*liftString:*/FfiConverterString.lift));
3134
3832
  }
3135
-
3136
- /**
3137
- * Cancel (evict) a transaction from the wallet's view.
3138
- * Mirrors Wallet::cancel_tx().
3139
- */
3140
3833
  cancelTx(txHex) /*throws*/{
3141
3834
  uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3142
3835
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_cancel_tx(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(txHex), callStatus);
3143
3836
  }, /*liftString:*/FfiConverterString.lift);
3144
3837
  }
3145
-
3146
- /**
3147
- * All checkpoints in the local chain, ordered by height descending.
3148
- * Mirrors Wallet::checkpoints().
3149
- */
3150
3838
  checkpoints() {
3151
3839
  return FfiConverterArrayTypeBlockId.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
3152
3840
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_checkpoints(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
3153
3841
  }, /*liftString:*/FfiConverterString.lift));
3154
3842
  }
3155
-
3156
- /**
3157
- * The highest derivation index that has been revealed, or null if none.
3158
- * Mirrors Wallet::derivation_index().
3159
- */
3160
3843
  derivationIndex(keychain) {
3161
3844
  return FfiConverterOptionalUInt32.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
3162
3845
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_derivation_index(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeKeychainKind.lower(keychain), callStatus);
3163
3846
  }, /*liftString:*/FfiConverterString.lift));
3164
3847
  }
3165
-
3166
- /**
3167
- * Find the keychain and derivation index for a scriptPubKey (hex).
3168
- * Returns null if the script does not belong to this wallet.
3169
- * Mirrors Wallet::derivation_of_spk().
3170
- */
3171
3848
  derivationOfSpk(scriptHex) {
3172
3849
  return FfiConverterOptionalTypeDerivationInfo.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
3173
3850
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_derivation_of_spk(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(scriptHex), callStatus);
3174
3851
  }, /*liftString:*/FfiConverterString.lift));
3175
3852
  }
3176
-
3177
- /**
3178
- * The descriptor checksum for the given keychain.
3179
- * Mirrors Wallet::descriptor_checksum().
3180
- */
3181
3853
  descriptorChecksum(keychain) /*throws*/{
3182
3854
  return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3183
3855
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_descriptor_checksum(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeKeychainKind.lower(keychain), callStatus);
3184
3856
  }, /*liftString:*/FfiConverterString.lift));
3185
3857
  }
3186
-
3187
- /**
3188
- * Drain the entire wallet to an address. Returns txid.
3189
- */
3190
3858
  async drain(address, feeRate, esploraUrl, asyncOpts_) /*throws*/{
3191
3859
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
3192
3860
  try {
@@ -3200,26 +3868,29 @@ export class Wallet extends UniffiAbstractObject {
3200
3868
  throw __error;
3201
3869
  }
3202
3870
  }
3203
-
3204
- /**
3205
- * Sign and attempt to finalize all inputs.
3206
- * Returns true if fully finalized.
3207
- * Mirrors Wallet::finalize_psbt() with default SignOptions.
3208
- */
3871
+ async drainWithElectrum(address, feeRate, client, asyncOpts_) /*throws*/{
3872
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
3873
+ try {
3874
+ return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
3875
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_drain_with_electrum(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(address), FfiConverterFloat64.lower(feeRate), FfiConverterTypeElectrumClient.lower(client));
3876
+ }, /*pollFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterString.lift.bind(FfiConverterString), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError));
3877
+ } catch (__error) {
3878
+ if (uniffiIsDebug && __error instanceof Error) {
3879
+ __error.stack = __stack;
3880
+ }
3881
+ throw __error;
3882
+ }
3883
+ }
3209
3884
  finalizePsbt(psbt) /*throws*/{
3210
3885
  return FfiConverterBool.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3211
3886
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_finalize_psbt(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypePsbt.lower(psbt), callStatus);
3212
3887
  }, /*liftString:*/FfiConverterString.lift));
3213
3888
  }
3214
-
3215
- /**
3216
- * Full scan via an Electrum TCP/TLS server.
3217
- */
3218
- async fullScanWithElectrum(url, stopGap, asyncOpts_) /*throws*/{
3889
+ async fullScanWithElectrum(client, stopGap, asyncOpts_) /*throws*/{
3219
3890
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
3220
3891
  try {
3221
3892
  return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
3222
- return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_full_scan_with_electrum(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(url), FfiConverterUInt64.lower(stopGap));
3893
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_full_scan_with_electrum(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeElectrumClient.lower(client), FfiConverterUInt64.lower(stopGap));
3223
3894
  }, /*pollFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_poll_void, /*cancelFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_cancel_void, /*completeFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_complete_void, /*freeFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_free_void, /*liftFunc:*/_v => {}, /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError));
3224
3895
  } catch (__error) {
3225
3896
  if (uniffiIsDebug && __error instanceof Error) {
@@ -3228,12 +3899,6 @@ export class Wallet extends UniffiAbstractObject {
3228
3899
  throw __error;
3229
3900
  }
3230
3901
  }
3231
-
3232
- /**
3233
- * Full scan via an Esplora HTTP server (discovers all used addresses).
3234
- * Uses Wallet::start_full_scan() + bdk_esplora client internally.
3235
- * stop_gap: how many consecutive unused addresses to scan before stopping.
3236
- */
3237
3902
  async fullScanWithEsplora(url, stopGap, asyncOpts_) /*throws*/{
3238
3903
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
3239
3904
  try {
@@ -3247,209 +3912,106 @@ export class Wallet extends UniffiAbstractObject {
3247
3912
  throw __error;
3248
3913
  }
3249
3914
  }
3250
-
3251
- /**
3252
- * Get the wallet balance. Mirrors Wallet::balance().
3253
- */
3254
3915
  getBalance() /*throws*/{
3255
3916
  return FfiConverterTypeBalance.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3256
3917
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_get_balance(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
3257
3918
  }, /*liftString:*/FfiConverterString.lift));
3258
3919
  }
3259
-
3260
- /**
3261
- * Returns the raw transaction hex for a given txid. Null if not found.
3262
- * Mirrors Wallet::get_tx().
3263
- */
3264
3920
  getTx(txid) /*throws*/{
3265
3921
  return FfiConverterOptionalString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3266
3922
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_get_tx(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(txid), callStatus);
3267
3923
  }, /*liftString:*/FfiConverterString.lift));
3268
3924
  }
3269
-
3270
- /**
3271
- * Get a specific UTXO. Returns null if not found. Mirrors Wallet::get_utxo().
3272
- */
3273
3925
  getUtxo(outpoint) /*throws*/{
3274
3926
  return FfiConverterOptionalTypeLocalOutput.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3275
3927
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_get_utxo(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeOutPoint.lower(outpoint), callStatus);
3276
3928
  }, /*liftString:*/FfiConverterString.lift));
3277
3929
  }
3278
-
3279
- /**
3280
- * Manually insert a TxOut (e.g. for tracking external outputs).
3281
- * Mirrors Wallet::insert_txout().
3282
- */
3283
3930
  insertTxout(outpoint, txout) {
3284
3931
  uniffiCaller.rustCall(/*caller:*/callStatus => {
3285
3932
  nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_insert_txout(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeOutPoint.lower(outpoint), FfiConverterTypeTxOut.lower(txout), callStatus);
3286
3933
  }, /*liftString:*/FfiConverterString.lift);
3287
3934
  }
3288
-
3289
- /**
3290
- * Return true if the given scriptPubKey (hex) belongs to this wallet.
3291
- * Mirrors Wallet::is_mine().
3292
- */
3293
3935
  isMine(scriptHex) {
3294
3936
  return FfiConverterBool.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
3295
3937
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_is_mine(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(scriptHex), callStatus);
3296
3938
  }, /*liftString:*/FfiConverterString.lift));
3297
3939
  }
3298
-
3299
- /**
3300
- * List all keychains and their public descriptors.
3301
- * Mirrors Wallet::keychains().
3302
- */
3303
3940
  keychains() {
3304
3941
  return FfiConverterArrayTypeKeychainInfo.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
3305
3942
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_keychains(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
3306
3943
  }, /*liftString:*/FfiConverterString.lift));
3307
3944
  }
3308
-
3309
- /**
3310
- * The latest checkpoint (tip of the local chain). Null if no blocks applied yet.
3311
- * Mirrors Wallet::latest_checkpoint().
3312
- */
3313
3945
  latestCheckpoint() {
3314
3946
  return FfiConverterOptionalTypeBlockId.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
3315
3947
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_latest_checkpoint(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
3316
3948
  }, /*liftString:*/FfiConverterString.lift));
3317
3949
  }
3318
-
3319
- /**
3320
- * List all wallet outputs (spent and unspent). Mirrors Wallet::list_output().
3321
- */
3322
3950
  listOutput() /*throws*/{
3323
3951
  return FfiConverterArrayTypeLocalOutput.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3324
3952
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_list_output(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
3325
3953
  }, /*liftString:*/FfiConverterString.lift));
3326
3954
  }
3327
-
3328
- /**
3329
- * List all unspent wallet outputs. Mirrors Wallet::list_unspent().
3330
- */
3331
3955
  listUnspent() /*throws*/{
3332
3956
  return FfiConverterArrayTypeLocalOutput.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3333
3957
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_list_unspent(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
3334
3958
  }, /*liftString:*/FfiConverterString.lift));
3335
3959
  }
3336
-
3337
- /**
3338
- * List all addresses that have been revealed but not yet received funds.
3339
- * Mirrors Wallet::list_unused_addresses().
3340
- */
3341
3960
  listUnusedAddresses(keychain) /*throws*/{
3342
3961
  return FfiConverterArrayTypeAddressInfo.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3343
3962
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_list_unused_addresses(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeKeychainKind.lower(keychain), callStatus);
3344
3963
  }, /*liftString:*/FfiConverterString.lift));
3345
3964
  }
3346
-
3347
- /**
3348
- * Mark an address index as used (returns true if previously unused).
3349
- * Mirrors Wallet::mark_used().
3350
- */
3351
3965
  markUsed(keychain, index) {
3352
3966
  return FfiConverterBool.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
3353
3967
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_mark_used(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeKeychainKind.lower(keychain), FfiConverterUInt32.lower(index), callStatus);
3354
3968
  }, /*liftString:*/FfiConverterString.lift));
3355
3969
  }
3356
-
3357
- /**
3358
- * The network this wallet is configured for.
3359
- * Mirrors Wallet::network().
3360
- */
3361
3970
  network() {
3362
3971
  return FfiConverterTypeNetwork.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
3363
3972
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_network(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
3364
3973
  }, /*liftString:*/FfiConverterString.lift));
3365
3974
  }
3366
-
3367
- /**
3368
- * The next derivation index that will be revealed.
3369
- * Mirrors Wallet::next_derivation_index().
3370
- */
3371
3975
  nextDerivationIndex(keychain) {
3372
3976
  return FfiConverterUInt32.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
3373
3977
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_next_derivation_index(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeKeychainKind.lower(keychain), callStatus);
3374
3978
  }, /*liftString:*/FfiConverterString.lift));
3375
3979
  }
3376
-
3377
- /**
3378
- * Return the next address that has not yet received funds.
3379
- * Mirrors Wallet::next_unused_address().
3380
- */
3381
3980
  nextUnusedAddress(keychain) /*throws*/{
3382
3981
  return FfiConverterTypeAddressInfo.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3383
3982
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_next_unused_address(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeKeychainKind.lower(keychain), callStatus);
3384
3983
  }, /*liftString:*/FfiConverterString.lift));
3385
3984
  }
3386
-
3387
- /**
3388
- * Peek at a specific derivation index without advancing the counter.
3389
- * Mirrors Wallet::peek_address().
3390
- */
3391
3985
  peekAddress(keychain, index) /*throws*/{
3392
3986
  return FfiConverterTypeAddressInfo.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3393
3987
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_peek_address(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeKeychainKind.lower(keychain), FfiConverterUInt32.lower(index), callStatus);
3394
3988
  }, /*liftString:*/FfiConverterString.lift));
3395
3989
  }
3396
-
3397
- /**
3398
- * Persist any staged changes to the database.
3399
- * Our FFI wraps PersistedWallet; this calls persist() internally.
3400
- */
3401
3990
  persist() /*throws*/{
3402
3991
  return FfiConverterBool.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3403
3992
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_persist(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
3404
3993
  }, /*liftString:*/FfiConverterString.lift));
3405
3994
  }
3406
-
3407
- /**
3408
- * Spending policies for a given keychain, returned as a JSON string.
3409
- * Returns null if the descriptor has no policy.
3410
- * Mirrors Wallet::policies() — serialized because the Policy tree is complex.
3411
- */
3412
3995
  policies(keychain) /*throws*/{
3413
3996
  return FfiConverterOptionalString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3414
3997
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_policies(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeKeychainKind.lower(keychain), callStatus);
3415
3998
  }, /*liftString:*/FfiConverterString.lift));
3416
3999
  }
3417
-
3418
- /**
3419
- * The public-only descriptor for the given keychain as a string.
3420
- * Mirrors Wallet::public_descriptor().
3421
- */
3422
4000
  publicDescriptor(keychain) /*throws*/{
3423
4001
  return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3424
4002
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_public_descriptor(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeKeychainKind.lower(keychain), callStatus);
3425
4003
  }, /*liftString:*/FfiConverterString.lift));
3426
4004
  }
3427
-
3428
- /**
3429
- * Reveal all addresses up to and including the given derivation index.
3430
- * Mirrors Wallet::reveal_addresses_to().
3431
- */
3432
4005
  revealAddressesTo(keychain, index) /*throws*/{
3433
4006
  return FfiConverterArrayTypeAddressInfo.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3434
4007
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_reveal_addresses_to(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeKeychainKind.lower(keychain), FfiConverterUInt32.lower(index), callStatus);
3435
4008
  }, /*liftString:*/FfiConverterString.lift));
3436
4009
  }
3437
-
3438
- /**
3439
- * Reveal and return the next address at the next derivation index,
3440
- * incrementing the index even if previous addresses are unused.
3441
- * Mirrors Wallet::reveal_next_address().
3442
- */
3443
4010
  revealNextAddress(keychain) /*throws*/{
3444
4011
  return FfiConverterTypeAddressInfo.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3445
4012
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_reveal_next_address(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeKeychainKind.lower(keychain), callStatus);
3446
4013
  }, /*liftString:*/FfiConverterString.lift));
3447
4014
  }
3448
-
3449
- /**
3450
- * Build, sign, and broadcast a simple payment in one call. Returns txid.
3451
- * Combines build_tx → sign → broadcast via Esplora.
3452
- */
3453
4015
  async send(address, amountSats, feeRate, esploraUrl, asyncOpts_) /*throws*/{
3454
4016
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
3455
4017
  try {
@@ -3463,36 +4025,34 @@ export class Wallet extends UniffiAbstractObject {
3463
4025
  throw __error;
3464
4026
  }
3465
4027
  }
3466
-
3467
- /**
3468
- * How much was sent from / received into the wallet for a raw tx (hex).
3469
- * Mirrors Wallet::sent_and_received().
3470
- */
4028
+ async sendWithElectrum(address, amountSats, feeRate, client, asyncOpts_) /*throws*/{
4029
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
4030
+ try {
4031
+ return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
4032
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_send_with_electrum(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(address), FfiConverterUInt64.lower(amountSats), FfiConverterFloat64.lower(feeRate), FfiConverterTypeElectrumClient.lower(client));
4033
+ }, /*pollFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterString.lift.bind(FfiConverterString), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError));
4034
+ } catch (__error) {
4035
+ if (uniffiIsDebug && __error instanceof Error) {
4036
+ __error.stack = __stack;
4037
+ }
4038
+ throw __error;
4039
+ }
4040
+ }
3471
4041
  sentAndReceived(txHex) /*throws*/{
3472
4042
  return FfiConverterTypeSentAndReceived.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3473
4043
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_sent_and_received(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(txHex), callStatus);
3474
4044
  }, /*liftString:*/FfiConverterString.lift));
3475
4045
  }
3476
-
3477
- /**
3478
- * Sign all inputs in the PSBT that this wallet can sign.
3479
- * Returns true if the PSBT is fully finalized after signing.
3480
- * Mirrors Wallet::sign() with default SignOptions.
3481
- */
3482
4046
  sign(psbt) /*throws*/{
3483
4047
  return FfiConverterBool.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3484
4048
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_sign(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypePsbt.lower(psbt), callStatus);
3485
4049
  }, /*liftString:*/FfiConverterString.lift));
3486
4050
  }
3487
-
3488
- /**
3489
- * Incremental sync via Electrum.
3490
- */
3491
- async syncWithElectrum(url, stopGap, asyncOpts_) /*throws*/{
4051
+ async syncWithElectrum(client, stopGap, asyncOpts_) /*throws*/{
3492
4052
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
3493
4053
  try {
3494
4054
  return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
3495
- return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_sync_with_electrum(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(url), FfiConverterUInt64.lower(stopGap));
4055
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_sync_with_electrum(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeElectrumClient.lower(client), FfiConverterUInt64.lower(stopGap));
3496
4056
  }, /*pollFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_poll_void, /*cancelFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_cancel_void, /*completeFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_complete_void, /*freeFunc:*/nativeModule().ubrn_ffi_bdk_ffi_rust_future_free_void, /*liftFunc:*/_v => {}, /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError));
3497
4057
  } catch (__error) {
3498
4058
  if (uniffiIsDebug && __error instanceof Error) {
@@ -3501,11 +4061,6 @@ export class Wallet extends UniffiAbstractObject {
3501
4061
  throw __error;
3502
4062
  }
3503
4063
  }
3504
-
3505
- /**
3506
- * Incremental sync via Esplora (only checks revealed SPKs + UTXOs + unconfirmed).
3507
- * Uses Wallet::start_sync_with_revealed_spks() + bdk_esplora client internally.
3508
- */
3509
4064
  async syncWithEsplora(url, stopGap, asyncOpts_) /*throws*/{
3510
4065
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
3511
4066
  try {
@@ -3519,31 +4074,16 @@ export class Wallet extends UniffiAbstractObject {
3519
4074
  throw __error;
3520
4075
  }
3521
4076
  }
3522
-
3523
- /**
3524
- * All wallet-relevant canonical transactions.
3525
- * Mirrors Wallet::transactions() → mapped to TxDetails.
3526
- */
3527
4077
  transactions() /*throws*/{
3528
4078
  return FfiConverterArrayTypeTxDetails.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3529
4079
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_transactions(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
3530
4080
  }, /*liftString:*/FfiConverterString.lift));
3531
4081
  }
3532
-
3533
- /**
3534
- * Details for a single transaction. Returns null if not found.
3535
- * Mirrors Wallet::tx_details().
3536
- */
3537
4082
  txDetails(txid) /*throws*/{
3538
4083
  return FfiConverterOptionalTypeTxDetails.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3539
4084
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_tx_details(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(txid), callStatus);
3540
4085
  }, /*liftString:*/FfiConverterString.lift));
3541
4086
  }
3542
-
3543
- /**
3544
- * Mark an address index as unused (returns true if previously used).
3545
- * Mirrors Wallet::unmark_used().
3546
- */
3547
4087
  unmarkUsed(keychain, index) {
3548
4088
  return FfiConverterBool.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
3549
4089
  return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_unmark_used(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeKeychainKind.lower(keychain), FfiConverterUInt32.lower(index), callStatus);
@@ -3686,6 +4226,9 @@ function uniffiEnsureInitialized() {
3686
4226
  if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_func_create_single_key_descriptor() !== 56046) {
3687
4227
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_func_create_single_key_descriptor");
3688
4228
  }
4229
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_func_create_wallet() !== 63339) {
4230
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_func_create_wallet");
4231
+ }
3689
4232
  if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_func_export_wallet() !== 53701) {
3690
4233
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_func_export_wallet");
3691
4234
  }
@@ -3785,7 +4328,7 @@ function uniffiEnsureInitialized() {
3785
4328
  if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_fee_rate() !== 2789) {
3786
4329
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_fee_rate");
3787
4330
  }
3788
- if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_finish() !== 35410) {
4331
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_finish() !== 23648) {
3789
4332
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_finish");
3790
4333
  }
3791
4334
  if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_include_output_redeem_witness_script() !== 1428) {
@@ -3824,7 +4367,7 @@ function uniffiEnsureInitialized() {
3824
4367
  if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_unspendable() !== 10665) {
3825
4368
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_unspendable");
3826
4369
  }
3827
- if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_broadcast_with_electrum() !== 60979) {
4370
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_broadcast_with_electrum() !== 26438) {
3828
4371
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_broadcast_with_electrum");
3829
4372
  }
3830
4373
  if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_broadcast_with_esplora() !== 37423) {
@@ -3857,10 +4400,13 @@ function uniffiEnsureInitialized() {
3857
4400
  if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_drain() !== 47076) {
3858
4401
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_drain");
3859
4402
  }
4403
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_drain_with_electrum() !== 42924) {
4404
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_drain_with_electrum");
4405
+ }
3860
4406
  if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_finalize_psbt() !== 43414) {
3861
4407
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_finalize_psbt");
3862
4408
  }
3863
- if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_full_scan_with_electrum() !== 45470) {
4409
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_full_scan_with_electrum() !== 40837) {
3864
4410
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_full_scan_with_electrum");
3865
4411
  }
3866
4412
  if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_full_scan_with_esplora() !== 39717) {
@@ -3929,13 +4475,16 @@ function uniffiEnsureInitialized() {
3929
4475
  if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_send() !== 4457) {
3930
4476
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_send");
3931
4477
  }
4478
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_send_with_electrum() !== 23570) {
4479
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_send_with_electrum");
4480
+ }
3932
4481
  if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_sent_and_received() !== 949) {
3933
4482
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_sent_and_received");
3934
4483
  }
3935
4484
  if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_sign() !== 32193) {
3936
4485
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_sign");
3937
4486
  }
3938
- if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_sync_with_electrum() !== 38866) {
4487
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_sync_with_electrum() !== 17015) {
3939
4488
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_sync_with_electrum");
3940
4489
  }
3941
4490
  if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_sync_with_esplora() !== 28111) {
@@ -3950,6 +4499,9 @@ function uniffiEnsureInitialized() {
3950
4499
  if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_unmark_used() !== 46731) {
3951
4500
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_unmark_used");
3952
4501
  }
4502
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_constructor_electrumclient_new() !== 63288) {
4503
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_constructor_electrumclient_new");
4504
+ }
3953
4505
  if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_constructor_mnemonic_from_entropy() !== 37039) {
3954
4506
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_constructor_mnemonic_from_entropy");
3955
4507
  }
@@ -3986,6 +4538,7 @@ export default Object.freeze({
3986
4538
  FfiConverterTypeConfirmationBlockTime,
3987
4539
  FfiConverterTypeDerivationInfo,
3988
4540
  FfiConverterTypeDescriptorTemplate,
4541
+ FfiConverterTypeElectrumClient,
3989
4542
  FfiConverterTypeKeychainInfo,
3990
4543
  FfiConverterTypeKeychainKind,
3991
4544
  FfiConverterTypeLanguage,