react-native-bdk-sdk 0.1.4 → 0.1.6

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