react-native-bdk-sdk 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/BdkSdk.podspec +44 -0
  2. package/LICENSE +19 -0
  3. package/README.md +24 -0
  4. package/android/CMakeLists.txt +79 -0
  5. package/android/build.gradle +144 -0
  6. package/android/cpp-adapter.cpp +43 -0
  7. package/android/generated/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeBdkSdkSpec.java +41 -0
  8. package/android/generated/android/app/build/generated/source/codegen/jni/CMakeLists.txt +28 -0
  9. package/android/generated/android/app/build/generated/source/codegen/jni/RNBdkReactNativeSpec-generated.cpp +38 -0
  10. package/android/generated/android/app/build/generated/source/codegen/jni/RNBdkReactNativeSpec.h +31 -0
  11. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBdkReactNativeSpec/ComponentDescriptors.cpp +22 -0
  12. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBdkReactNativeSpec/ComponentDescriptors.h +24 -0
  13. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBdkReactNativeSpec/EventEmitters.cpp +16 -0
  14. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBdkReactNativeSpec/EventEmitters.h +17 -0
  15. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBdkReactNativeSpec/Props.cpp +19 -0
  16. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBdkReactNativeSpec/Props.h +18 -0
  17. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBdkReactNativeSpec/RNBdkReactNativeSpecJSI.h +45 -0
  18. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBdkReactNativeSpec/ShadowNodes.cpp +17 -0
  19. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBdkReactNativeSpec/ShadowNodes.h +23 -0
  20. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBdkReactNativeSpec/States.cpp +16 -0
  21. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBdkReactNativeSpec/States.h +20 -0
  22. package/android/src/main/AndroidManifest.xml +5 -0
  23. package/android/src/main/java/com/reactnativebdksdk/BdkSdkModule.kt +43 -0
  24. package/android/src/main/java/com/reactnativebdksdk/BdkSdkPackage.kt +34 -0
  25. package/app.plugin.js +1 -0
  26. package/cpp/generated/bdk_ffi.cpp +6761 -0
  27. package/cpp/generated/bdk_ffi.hpp +308 -0
  28. package/cpp/react-native-bdk-sdk.cpp +16 -0
  29. package/cpp/react-native-bdk-sdk.h +15 -0
  30. package/ios/BdkSdk.h +16 -0
  31. package/ios/BdkSdk.mm +66 -0
  32. package/ios/generated/build/generated/ios/ReactCodegen/RNBdkReactNativeSpec/RNBdkReactNativeSpec-generated.mm +46 -0
  33. package/ios/generated/build/generated/ios/ReactCodegen/RNBdkReactNativeSpec/RNBdkReactNativeSpec.h +63 -0
  34. package/ios/generated/build/generated/ios/ReactCodegen/RNBdkReactNativeSpecJSI.h +45 -0
  35. package/ios/generated/build/generated/ios/ReactCodegen/react/renderer/components/RNBdkReactNativeSpec/ComponentDescriptors.cpp +22 -0
  36. package/ios/generated/build/generated/ios/ReactCodegen/react/renderer/components/RNBdkReactNativeSpec/ComponentDescriptors.h +24 -0
  37. package/ios/generated/build/generated/ios/ReactCodegen/react/renderer/components/RNBdkReactNativeSpec/EventEmitters.cpp +16 -0
  38. package/ios/generated/build/generated/ios/ReactCodegen/react/renderer/components/RNBdkReactNativeSpec/EventEmitters.h +17 -0
  39. package/ios/generated/build/generated/ios/ReactCodegen/react/renderer/components/RNBdkReactNativeSpec/Props.cpp +19 -0
  40. package/ios/generated/build/generated/ios/ReactCodegen/react/renderer/components/RNBdkReactNativeSpec/Props.h +18 -0
  41. package/ios/generated/build/generated/ios/ReactCodegen/react/renderer/components/RNBdkReactNativeSpec/RCTComponentViewHelpers.h +18 -0
  42. package/ios/generated/build/generated/ios/ReactCodegen/react/renderer/components/RNBdkReactNativeSpec/ShadowNodes.cpp +17 -0
  43. package/ios/generated/build/generated/ios/ReactCodegen/react/renderer/components/RNBdkReactNativeSpec/ShadowNodes.h +23 -0
  44. package/ios/generated/build/generated/ios/ReactCodegen/react/renderer/components/RNBdkReactNativeSpec/States.cpp +16 -0
  45. package/ios/generated/build/generated/ios/ReactCodegen/react/renderer/components/RNBdkReactNativeSpec/States.h +20 -0
  46. package/lib/commonjs/NativeBdkSdk.js +10 -0
  47. package/lib/commonjs/NativeBdkSdk.js.map +1 -0
  48. package/lib/commonjs/generated/bdk_ffi-ffi.js +48 -0
  49. package/lib/commonjs/generated/bdk_ffi-ffi.js.map +1 -0
  50. package/lib/commonjs/generated/bdk_ffi.js +4117 -0
  51. package/lib/commonjs/generated/bdk_ffi.js.map +1 -0
  52. package/lib/commonjs/index.js +63 -0
  53. package/lib/commonjs/index.js.map +1 -0
  54. package/lib/commonjs/package.json +1 -0
  55. package/lib/module/NativeBdkSdk.js +7 -0
  56. package/lib/module/NativeBdkSdk.js.map +1 -0
  57. package/lib/module/generated/bdk_ffi-ffi.js +47 -0
  58. package/lib/module/generated/bdk_ffi-ffi.js.map +1 -0
  59. package/lib/module/generated/bdk_ffi.js +4100 -0
  60. package/lib/module/generated/bdk_ffi.js.map +1 -0
  61. package/lib/module/index.js +43 -0
  62. package/lib/module/index.js.map +1 -0
  63. package/lib/module/package.json +1 -0
  64. package/lib/typescript/commonjs/package.json +1 -0
  65. package/lib/typescript/commonjs/plugin/src/index.d.ts +7 -0
  66. package/lib/typescript/commonjs/plugin/src/index.d.ts.map +1 -0
  67. package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts +3 -0
  68. package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts.map +1 -0
  69. package/lib/typescript/commonjs/plugin/src/withIOS.d.ts +3 -0
  70. package/lib/typescript/commonjs/plugin/src/withIOS.d.ts.map +1 -0
  71. package/lib/typescript/commonjs/src/NativeBdkSdk.d.ts +8 -0
  72. package/lib/typescript/commonjs/src/NativeBdkSdk.d.ts.map +1 -0
  73. package/lib/typescript/commonjs/src/generated/bdk_ffi-ffi.d.ts +333 -0
  74. package/lib/typescript/commonjs/src/generated/bdk_ffi-ffi.d.ts.map +1 -0
  75. package/lib/typescript/commonjs/src/generated/bdk_ffi.d.ts +3816 -0
  76. package/lib/typescript/commonjs/src/generated/bdk_ffi.d.ts.map +1 -0
  77. package/lib/typescript/commonjs/src/index.d.ts +8 -0
  78. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  79. package/lib/typescript/module/package.json +1 -0
  80. package/lib/typescript/module/plugin/src/index.d.ts +7 -0
  81. package/lib/typescript/module/plugin/src/index.d.ts.map +1 -0
  82. package/lib/typescript/module/plugin/src/withAndroid.d.ts +3 -0
  83. package/lib/typescript/module/plugin/src/withAndroid.d.ts.map +1 -0
  84. package/lib/typescript/module/plugin/src/withIOS.d.ts +3 -0
  85. package/lib/typescript/module/plugin/src/withIOS.d.ts.map +1 -0
  86. package/lib/typescript/module/src/NativeBdkSdk.d.ts +8 -0
  87. package/lib/typescript/module/src/NativeBdkSdk.d.ts.map +1 -0
  88. package/lib/typescript/module/src/generated/bdk_ffi-ffi.d.ts +333 -0
  89. package/lib/typescript/module/src/generated/bdk_ffi-ffi.d.ts.map +1 -0
  90. package/lib/typescript/module/src/generated/bdk_ffi.d.ts +3816 -0
  91. package/lib/typescript/module/src/generated/bdk_ffi.d.ts.map +1 -0
  92. package/lib/typescript/module/src/index.d.ts +8 -0
  93. package/lib/typescript/module/src/index.d.ts.map +1 -0
  94. package/package.json +147 -0
  95. package/plugin/build/index.d.ts +6 -0
  96. package/plugin/build/index.js +14 -0
  97. package/plugin/build/withAndroid.d.ts +2 -0
  98. package/plugin/build/withAndroid.js +20 -0
  99. package/plugin/build/withIOS.d.ts +2 -0
  100. package/plugin/build/withIOS.js +8 -0
  101. package/plugin/tsconfig.json +9 -0
  102. package/plugin/tsconfig.tsbuildinfo +1 -0
  103. package/react-native.config.js +13 -0
  104. package/scripts/postinstall.js +229 -0
  105. package/src/NativeBdkSdk.ts +10 -0
  106. package/src/generated/bdk_ffi-ffi.ts +944 -0
  107. package/src/generated/bdk_ffi.ts +6864 -0
  108. package/src/index.tsx +41 -0
@@ -0,0 +1,4100 @@
1
+ "use strict";
2
+
3
+ // This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate.
4
+ // Trust me, you don't want to mess with it!
5
+
6
+ /* tslint:disable */
7
+ /* eslint-disable */
8
+ // @ts-nocheck
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";
11
+
12
+ // Get converters from the other files, if any.
13
+ const uniffiCaller = new UniffiRustCaller(() => ({
14
+ code: 0
15
+ }));
16
+ const uniffiIsDebug =
17
+ // @ts-ignore -- The process global might not be defined
18
+ typeof process !== "object" ||
19
+ // @ts-ignore -- The process global might not be defined
20
+ process?.env?.NODE_ENV !== "production" || false;
21
+ // Public interface members begin here.
22
+
23
+ /**
24
+ * Generate an output descriptor string from a mnemonic using a standard BIP template.
25
+ * Returns a descriptor like "wpkh([fingerprint/84'/0'/0']xprv.../0/*)" for BIP84.
26
+ * Uses Bip44/49/84/86 descriptor templates.
27
+ */
28
+ export function createDescriptor(mnemonic, template, keychain, network) /*throws*/{
29
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
30
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_func_create_descriptor(FfiConverterTypeMnemonic.lower(mnemonic), FfiConverterTypeDescriptorTemplate.lower(template), FfiConverterTypeKeychainKind.lower(keychain), FfiConverterTypeNetwork.lower(network), callStatus);
31
+ }, /*liftString:*/FfiConverterString.lift));
32
+ }
33
+ /**
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.
37
+ */
38
+ export function createPublicDescriptor(xpub, template, keychain, network) /*throws*/{
39
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
40
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_func_create_public_descriptor(FfiConverterString.lower(xpub), FfiConverterTypeDescriptorTemplate.lower(template), FfiConverterTypeKeychainKind.lower(keychain), FfiConverterTypeNetwork.lower(network), callStatus);
41
+ }, /*liftString:*/FfiConverterString.lift));
42
+ }
43
+ /**
44
+ * Generate a single-key descriptor from a key string.
45
+ * Uses P2Pkh, P2Wpkh, P2Wpkh_P2Sh, or P2TR templates.
46
+ */
47
+ export function createSingleKeyDescriptor(key, template, network) /*throws*/{
48
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
49
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_func_create_single_key_descriptor(FfiConverterString.lower(key), FfiConverterTypeSingleKeyDescriptorTemplate.lower(template), FfiConverterTypeNetwork.lower(network), callStatus);
50
+ }, /*liftString:*/FfiConverterString.lift));
51
+ }
52
+ /**
53
+ * Export a wallet in FullyNoded-compatible JSON format for backup.
54
+ * Mirrors bdk_wallet::export::FullyNodedExport.
55
+ */
56
+ export function exportWallet(wallet, label, includeBlockHeight) /*throws*/{
57
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
58
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_func_export_wallet(FfiConverterTypeWallet.lower(wallet), FfiConverterString.lower(label), FfiConverterBool.lower(includeBlockHeight), callStatus);
59
+ }, /*liftString:*/FfiConverterString.lift));
60
+ }
61
+ /**
62
+ * Returns true if the address string is valid for the given network.
63
+ */
64
+ export function isValidAddress(address, network) {
65
+ return FfiConverterBool.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
66
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_func_is_valid_address(FfiConverterString.lower(address), FfiConverterTypeNetwork.lower(network), callStatus);
67
+ }, /*liftString:*/FfiConverterString.lift));
68
+ }
69
+ /**
70
+ * Runtime version of the bdk_wallet crate.
71
+ */
72
+ export function version() {
73
+ return FfiConverterString.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
74
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_func_version(callStatus);
75
+ }, /*liftString:*/FfiConverterString.lift));
76
+ }
77
+ /**
78
+ * Compute a deterministic wallet name from its descriptors (useful for DB naming).
79
+ * Mirrors bdk_wallet::wallet_name_from_descriptor().
80
+ */
81
+ export function walletNameFromDescriptor(descriptor, changeDescriptor, network) /*throws*/{
82
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
83
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_func_wallet_name_from_descriptor(FfiConverterString.lower(descriptor), FfiConverterOptionalString.lower(changeDescriptor), FfiConverterTypeNetwork.lower(network), callStatus);
84
+ }, /*liftString:*/FfiConverterString.lift));
85
+ }
86
+
87
+ /**
88
+ * A derived address with its derivation index. Mirrors bdk_wallet::AddressInfo.
89
+ */
90
+
91
+ /**
92
+ * Generated factory for {@link AddressInfo} record objects.
93
+ */
94
+ export const AddressInfo = (() => {
95
+ const defaults = () => ({});
96
+ const create = (() => {
97
+ return uniffiCreateRecord(defaults);
98
+ })();
99
+ return Object.freeze({
100
+ /**
101
+ * Create a frozen instance of {@link AddressInfo}, with defaults specified
102
+ * in Rust, in the {@link bdk_ffi} crate.
103
+ */
104
+ create,
105
+ /**
106
+ * Create a frozen instance of {@link AddressInfo}, with defaults specified
107
+ * in Rust, in the {@link bdk_ffi} crate.
108
+ */
109
+ new: create,
110
+ /**
111
+ * Defaults specified in the {@link bdk_ffi} crate.
112
+ */
113
+ defaults: () => Object.freeze(defaults())
114
+ });
115
+ })();
116
+ const FfiConverterTypeAddressInfo = (() => {
117
+ class FFIConverter extends AbstractFfiConverterByteArray {
118
+ read(from) {
119
+ return {
120
+ index: FfiConverterUInt32.read(from),
121
+ address: FfiConverterString.read(from),
122
+ keychain: FfiConverterTypeKeychainKind.read(from)
123
+ };
124
+ }
125
+ write(value, into) {
126
+ FfiConverterUInt32.write(value.index, into);
127
+ FfiConverterString.write(value.address, into);
128
+ FfiConverterTypeKeychainKind.write(value.keychain, into);
129
+ }
130
+ allocationSize(value) {
131
+ return FfiConverterUInt32.allocationSize(value.index) + FfiConverterString.allocationSize(value.address) + FfiConverterTypeKeychainKind.allocationSize(value.keychain);
132
+ }
133
+ }
134
+ return new FFIConverter();
135
+ })();
136
+
137
+ /**
138
+ * Wallet balance split into categories. All values in satoshis.
139
+ * Mirrors bdk_wallet::Balance (re-exported from bdk_chain).
140
+ */
141
+
142
+ /**
143
+ * Generated factory for {@link Balance} record objects.
144
+ */
145
+ export const Balance = (() => {
146
+ const defaults = () => ({});
147
+ const create = (() => {
148
+ return uniffiCreateRecord(defaults);
149
+ })();
150
+ return Object.freeze({
151
+ /**
152
+ * Create a frozen instance of {@link Balance}, with defaults specified
153
+ * in Rust, in the {@link bdk_ffi} crate.
154
+ */
155
+ create,
156
+ /**
157
+ * Create a frozen instance of {@link Balance}, with defaults specified
158
+ * in Rust, in the {@link bdk_ffi} crate.
159
+ */
160
+ new: create,
161
+ /**
162
+ * Defaults specified in the {@link bdk_ffi} crate.
163
+ */
164
+ defaults: () => Object.freeze(defaults())
165
+ });
166
+ })();
167
+ const FfiConverterTypeBalance = (() => {
168
+ class FFIConverter extends AbstractFfiConverterByteArray {
169
+ read(from) {
170
+ return {
171
+ immature: FfiConverterUInt64.read(from),
172
+ trustedPending: FfiConverterUInt64.read(from),
173
+ untrustedPending: FfiConverterUInt64.read(from),
174
+ confirmed: FfiConverterUInt64.read(from),
175
+ trustedSpendable: FfiConverterUInt64.read(from),
176
+ total: FfiConverterUInt64.read(from)
177
+ };
178
+ }
179
+ write(value, into) {
180
+ FfiConverterUInt64.write(value.immature, into);
181
+ FfiConverterUInt64.write(value.trustedPending, into);
182
+ FfiConverterUInt64.write(value.untrustedPending, into);
183
+ FfiConverterUInt64.write(value.confirmed, into);
184
+ FfiConverterUInt64.write(value.trustedSpendable, into);
185
+ FfiConverterUInt64.write(value.total, into);
186
+ }
187
+ allocationSize(value) {
188
+ return FfiConverterUInt64.allocationSize(value.immature) + FfiConverterUInt64.allocationSize(value.trustedPending) + FfiConverterUInt64.allocationSize(value.untrustedPending) + FfiConverterUInt64.allocationSize(value.confirmed) + FfiConverterUInt64.allocationSize(value.trustedSpendable) + FfiConverterUInt64.allocationSize(value.total);
189
+ }
190
+ }
191
+ return new FFIConverter();
192
+ })();
193
+
194
+ /**
195
+ * A block identifier (height + hash). Mirrors bdk_chain::BlockId.
196
+ */
197
+
198
+ /**
199
+ * Generated factory for {@link BlockId} record objects.
200
+ */
201
+ export const BlockId = (() => {
202
+ const defaults = () => ({});
203
+ const create = (() => {
204
+ return uniffiCreateRecord(defaults);
205
+ })();
206
+ return Object.freeze({
207
+ /**
208
+ * Create a frozen instance of {@link BlockId}, with defaults specified
209
+ * in Rust, in the {@link bdk_ffi} crate.
210
+ */
211
+ create,
212
+ /**
213
+ * Create a frozen instance of {@link BlockId}, with defaults specified
214
+ * in Rust, in the {@link bdk_ffi} crate.
215
+ */
216
+ new: create,
217
+ /**
218
+ * Defaults specified in the {@link bdk_ffi} crate.
219
+ */
220
+ defaults: () => Object.freeze(defaults())
221
+ });
222
+ })();
223
+ const FfiConverterTypeBlockId = (() => {
224
+ class FFIConverter extends AbstractFfiConverterByteArray {
225
+ read(from) {
226
+ return {
227
+ height: FfiConverterUInt32.read(from),
228
+ hash: FfiConverterString.read(from)
229
+ };
230
+ }
231
+ write(value, into) {
232
+ FfiConverterUInt32.write(value.height, into);
233
+ FfiConverterString.write(value.hash, into);
234
+ }
235
+ allocationSize(value) {
236
+ return FfiConverterUInt32.allocationSize(value.height) + FfiConverterString.allocationSize(value.hash);
237
+ }
238
+ }
239
+ return new FFIConverter();
240
+ })();
241
+
242
+ /**
243
+ * Block position for a confirmed transaction/output.
244
+ * Mirrors bdk_chain::ConfirmationBlockTime.
245
+ */
246
+
247
+ /**
248
+ * Generated factory for {@link ConfirmationBlockTime} record objects.
249
+ */
250
+ export const ConfirmationBlockTime = (() => {
251
+ const defaults = () => ({});
252
+ const create = (() => {
253
+ return uniffiCreateRecord(defaults);
254
+ })();
255
+ return Object.freeze({
256
+ /**
257
+ * Create a frozen instance of {@link ConfirmationBlockTime}, with defaults specified
258
+ * in Rust, in the {@link bdk_ffi} crate.
259
+ */
260
+ create,
261
+ /**
262
+ * Create a frozen instance of {@link ConfirmationBlockTime}, with defaults specified
263
+ * in Rust, in the {@link bdk_ffi} crate.
264
+ */
265
+ new: create,
266
+ /**
267
+ * Defaults specified in the {@link bdk_ffi} crate.
268
+ */
269
+ defaults: () => Object.freeze(defaults())
270
+ });
271
+ })();
272
+ const FfiConverterTypeConfirmationBlockTime = (() => {
273
+ class FFIConverter extends AbstractFfiConverterByteArray {
274
+ read(from) {
275
+ return {
276
+ height: FfiConverterUInt32.read(from),
277
+ blockHash: FfiConverterString.read(from),
278
+ timestamp: FfiConverterUInt64.read(from)
279
+ };
280
+ }
281
+ write(value, into) {
282
+ FfiConverterUInt32.write(value.height, into);
283
+ FfiConverterString.write(value.blockHash, into);
284
+ FfiConverterUInt64.write(value.timestamp, into);
285
+ }
286
+ allocationSize(value) {
287
+ return FfiConverterUInt32.allocationSize(value.height) + FfiConverterString.allocationSize(value.blockHash) + FfiConverterUInt64.allocationSize(value.timestamp);
288
+ }
289
+ }
290
+ return new FFIConverter();
291
+ })();
292
+
293
+ /**
294
+ * Derivation info for a scriptPubKey belonging to the wallet.
295
+ */
296
+
297
+ /**
298
+ * Generated factory for {@link DerivationInfo} record objects.
299
+ */
300
+ export const DerivationInfo = (() => {
301
+ const defaults = () => ({});
302
+ const create = (() => {
303
+ return uniffiCreateRecord(defaults);
304
+ })();
305
+ return Object.freeze({
306
+ /**
307
+ * Create a frozen instance of {@link DerivationInfo}, with defaults specified
308
+ * in Rust, in the {@link bdk_ffi} crate.
309
+ */
310
+ create,
311
+ /**
312
+ * Create a frozen instance of {@link DerivationInfo}, with defaults specified
313
+ * in Rust, in the {@link bdk_ffi} crate.
314
+ */
315
+ new: create,
316
+ /**
317
+ * Defaults specified in the {@link bdk_ffi} crate.
318
+ */
319
+ defaults: () => Object.freeze(defaults())
320
+ });
321
+ })();
322
+ const FfiConverterTypeDerivationInfo = (() => {
323
+ class FFIConverter extends AbstractFfiConverterByteArray {
324
+ read(from) {
325
+ return {
326
+ keychain: FfiConverterTypeKeychainKind.read(from),
327
+ index: FfiConverterUInt32.read(from)
328
+ };
329
+ }
330
+ write(value, into) {
331
+ FfiConverterTypeKeychainKind.write(value.keychain, into);
332
+ FfiConverterUInt32.write(value.index, into);
333
+ }
334
+ allocationSize(value) {
335
+ return FfiConverterTypeKeychainKind.allocationSize(value.keychain) + FfiConverterUInt32.allocationSize(value.index);
336
+ }
337
+ }
338
+ return new FFIConverter();
339
+ })();
340
+
341
+ /**
342
+ * Info about a keychain and its associated descriptor.
343
+ */
344
+
345
+ /**
346
+ * Generated factory for {@link KeychainInfo} record objects.
347
+ */
348
+ export const KeychainInfo = (() => {
349
+ const defaults = () => ({});
350
+ const create = (() => {
351
+ return uniffiCreateRecord(defaults);
352
+ })();
353
+ return Object.freeze({
354
+ /**
355
+ * Create a frozen instance of {@link KeychainInfo}, with defaults specified
356
+ * in Rust, in the {@link bdk_ffi} crate.
357
+ */
358
+ create,
359
+ /**
360
+ * Create a frozen instance of {@link KeychainInfo}, with defaults specified
361
+ * in Rust, in the {@link bdk_ffi} crate.
362
+ */
363
+ new: create,
364
+ /**
365
+ * Defaults specified in the {@link bdk_ffi} crate.
366
+ */
367
+ defaults: () => Object.freeze(defaults())
368
+ });
369
+ })();
370
+ const FfiConverterTypeKeychainInfo = (() => {
371
+ class FFIConverter extends AbstractFfiConverterByteArray {
372
+ read(from) {
373
+ return {
374
+ keychain: FfiConverterTypeKeychainKind.read(from),
375
+ descriptor: FfiConverterString.read(from)
376
+ };
377
+ }
378
+ write(value, into) {
379
+ FfiConverterTypeKeychainKind.write(value.keychain, into);
380
+ FfiConverterString.write(value.descriptor, into);
381
+ }
382
+ allocationSize(value) {
383
+ return FfiConverterTypeKeychainKind.allocationSize(value.keychain) + FfiConverterString.allocationSize(value.descriptor);
384
+ }
385
+ }
386
+ return new FFIConverter();
387
+ })();
388
+
389
+ /**
390
+ * A wallet-owned output (spent or unspent). Mirrors bdk_wallet::LocalOutput.
391
+ */
392
+
393
+ /**
394
+ * Generated factory for {@link LocalOutput} record objects.
395
+ */
396
+ export const LocalOutput = (() => {
397
+ const defaults = () => ({});
398
+ const create = (() => {
399
+ return uniffiCreateRecord(defaults);
400
+ })();
401
+ return Object.freeze({
402
+ /**
403
+ * Create a frozen instance of {@link LocalOutput}, with defaults specified
404
+ * in Rust, in the {@link bdk_ffi} crate.
405
+ */
406
+ create,
407
+ /**
408
+ * Create a frozen instance of {@link LocalOutput}, with defaults specified
409
+ * in Rust, in the {@link bdk_ffi} crate.
410
+ */
411
+ new: create,
412
+ /**
413
+ * Defaults specified in the {@link bdk_ffi} crate.
414
+ */
415
+ defaults: () => Object.freeze(defaults())
416
+ });
417
+ })();
418
+ const FfiConverterTypeLocalOutput = (() => {
419
+ class FFIConverter extends AbstractFfiConverterByteArray {
420
+ read(from) {
421
+ return {
422
+ outpoint: FfiConverterTypeOutPoint.read(from),
423
+ txout: FfiConverterTypeTxOut.read(from),
424
+ keychain: FfiConverterTypeKeychainKind.read(from),
425
+ isSpent: FfiConverterBool.read(from),
426
+ derivationIndex: FfiConverterUInt32.read(from),
427
+ confirmationBlockTime: FfiConverterOptionalTypeConfirmationBlockTime.read(from)
428
+ };
429
+ }
430
+ write(value, into) {
431
+ FfiConverterTypeOutPoint.write(value.outpoint, into);
432
+ FfiConverterTypeTxOut.write(value.txout, into);
433
+ FfiConverterTypeKeychainKind.write(value.keychain, into);
434
+ FfiConverterBool.write(value.isSpent, into);
435
+ FfiConverterUInt32.write(value.derivationIndex, into);
436
+ FfiConverterOptionalTypeConfirmationBlockTime.write(value.confirmationBlockTime, into);
437
+ }
438
+ allocationSize(value) {
439
+ return FfiConverterTypeOutPoint.allocationSize(value.outpoint) + FfiConverterTypeTxOut.allocationSize(value.txout) + FfiConverterTypeKeychainKind.allocationSize(value.keychain) + FfiConverterBool.allocationSize(value.isSpent) + FfiConverterUInt32.allocationSize(value.derivationIndex) + FfiConverterOptionalTypeConfirmationBlockTime.allocationSize(value.confirmationBlockTime);
440
+ }
441
+ }
442
+ return new FFIConverter();
443
+ })();
444
+
445
+ /**
446
+ * Reference to a specific transaction output. Mirrors bitcoin::OutPoint.
447
+ */
448
+
449
+ /**
450
+ * Generated factory for {@link OutPoint} record objects.
451
+ */
452
+ export const OutPoint = (() => {
453
+ const defaults = () => ({});
454
+ const create = (() => {
455
+ return uniffiCreateRecord(defaults);
456
+ })();
457
+ return Object.freeze({
458
+ /**
459
+ * Create a frozen instance of {@link OutPoint}, with defaults specified
460
+ * in Rust, in the {@link bdk_ffi} crate.
461
+ */
462
+ create,
463
+ /**
464
+ * Create a frozen instance of {@link OutPoint}, with defaults specified
465
+ * in Rust, in the {@link bdk_ffi} crate.
466
+ */
467
+ new: create,
468
+ /**
469
+ * Defaults specified in the {@link bdk_ffi} crate.
470
+ */
471
+ defaults: () => Object.freeze(defaults())
472
+ });
473
+ })();
474
+ const FfiConverterTypeOutPoint = (() => {
475
+ class FFIConverter extends AbstractFfiConverterByteArray {
476
+ read(from) {
477
+ return {
478
+ txid: FfiConverterString.read(from),
479
+ vout: FfiConverterUInt32.read(from)
480
+ };
481
+ }
482
+ write(value, into) {
483
+ FfiConverterString.write(value.txid, into);
484
+ FfiConverterUInt32.write(value.vout, into);
485
+ }
486
+ allocationSize(value) {
487
+ return FfiConverterString.allocationSize(value.txid) + FfiConverterUInt32.allocationSize(value.vout);
488
+ }
489
+ }
490
+ return new FFIConverter();
491
+ })();
492
+
493
+ /**
494
+ * A single payment recipient.
495
+ */
496
+
497
+ /**
498
+ * Generated factory for {@link Recipient} record objects.
499
+ */
500
+ export const Recipient = (() => {
501
+ const defaults = () => ({});
502
+ const create = (() => {
503
+ return uniffiCreateRecord(defaults);
504
+ })();
505
+ return Object.freeze({
506
+ /**
507
+ * Create a frozen instance of {@link Recipient}, with defaults specified
508
+ * in Rust, in the {@link bdk_ffi} crate.
509
+ */
510
+ create,
511
+ /**
512
+ * Create a frozen instance of {@link Recipient}, with defaults specified
513
+ * in Rust, in the {@link bdk_ffi} crate.
514
+ */
515
+ new: create,
516
+ /**
517
+ * Defaults specified in the {@link bdk_ffi} crate.
518
+ */
519
+ defaults: () => Object.freeze(defaults())
520
+ });
521
+ })();
522
+ const FfiConverterTypeRecipient = (() => {
523
+ class FFIConverter extends AbstractFfiConverterByteArray {
524
+ read(from) {
525
+ return {
526
+ address: FfiConverterString.read(from),
527
+ amountSats: FfiConverterUInt64.read(from)
528
+ };
529
+ }
530
+ write(value, into) {
531
+ FfiConverterString.write(value.address, into);
532
+ FfiConverterUInt64.write(value.amountSats, into);
533
+ }
534
+ allocationSize(value) {
535
+ return FfiConverterString.allocationSize(value.address) + FfiConverterUInt64.allocationSize(value.amountSats);
536
+ }
537
+ }
538
+ return new FFIConverter();
539
+ })();
540
+
541
+ /**
542
+ * How much was sent from / received into the wallet for a given transaction.
543
+ */
544
+
545
+ /**
546
+ * Generated factory for {@link SentAndReceived} record objects.
547
+ */
548
+ export const SentAndReceived = (() => {
549
+ const defaults = () => ({});
550
+ const create = (() => {
551
+ return uniffiCreateRecord(defaults);
552
+ })();
553
+ return Object.freeze({
554
+ /**
555
+ * Create a frozen instance of {@link SentAndReceived}, with defaults specified
556
+ * in Rust, in the {@link bdk_ffi} crate.
557
+ */
558
+ create,
559
+ /**
560
+ * Create a frozen instance of {@link SentAndReceived}, with defaults specified
561
+ * in Rust, in the {@link bdk_ffi} crate.
562
+ */
563
+ new: create,
564
+ /**
565
+ * Defaults specified in the {@link bdk_ffi} crate.
566
+ */
567
+ defaults: () => Object.freeze(defaults())
568
+ });
569
+ })();
570
+ const FfiConverterTypeSentAndReceived = (() => {
571
+ class FFIConverter extends AbstractFfiConverterByteArray {
572
+ read(from) {
573
+ return {
574
+ sent: FfiConverterUInt64.read(from),
575
+ received: FfiConverterUInt64.read(from)
576
+ };
577
+ }
578
+ write(value, into) {
579
+ FfiConverterUInt64.write(value.sent, into);
580
+ FfiConverterUInt64.write(value.received, into);
581
+ }
582
+ allocationSize(value) {
583
+ return FfiConverterUInt64.allocationSize(value.sent) + FfiConverterUInt64.allocationSize(value.received);
584
+ }
585
+ }
586
+ return new FFIConverter();
587
+ })();
588
+
589
+ /**
590
+ * Full details of a wallet-relevant transaction. Mirrors bdk_wallet::TxDetails.
591
+ */
592
+
593
+ /**
594
+ * Generated factory for {@link TxDetails} record objects.
595
+ */
596
+ export const TxDetails = (() => {
597
+ const defaults = () => ({});
598
+ const create = (() => {
599
+ return uniffiCreateRecord(defaults);
600
+ })();
601
+ return Object.freeze({
602
+ /**
603
+ * Create a frozen instance of {@link TxDetails}, with defaults specified
604
+ * in Rust, in the {@link bdk_ffi} crate.
605
+ */
606
+ create,
607
+ /**
608
+ * Create a frozen instance of {@link TxDetails}, with defaults specified
609
+ * in Rust, in the {@link bdk_ffi} crate.
610
+ */
611
+ new: create,
612
+ /**
613
+ * Defaults specified in the {@link bdk_ffi} crate.
614
+ */
615
+ defaults: () => Object.freeze(defaults())
616
+ });
617
+ })();
618
+ const FfiConverterTypeTxDetails = (() => {
619
+ class FFIConverter extends AbstractFfiConverterByteArray {
620
+ read(from) {
621
+ return {
622
+ txid: FfiConverterString.read(from),
623
+ sent: FfiConverterUInt64.read(from),
624
+ received: FfiConverterUInt64.read(from),
625
+ fee: FfiConverterOptionalUInt64.read(from),
626
+ feeRate: FfiConverterOptionalFloat64.read(from),
627
+ balanceDelta: FfiConverterInt64.read(from),
628
+ confirmationBlockTime: FfiConverterOptionalTypeConfirmationBlockTime.read(from),
629
+ txHex: FfiConverterString.read(from)
630
+ };
631
+ }
632
+ write(value, into) {
633
+ FfiConverterString.write(value.txid, into);
634
+ FfiConverterUInt64.write(value.sent, into);
635
+ FfiConverterUInt64.write(value.received, into);
636
+ FfiConverterOptionalUInt64.write(value.fee, into);
637
+ FfiConverterOptionalFloat64.write(value.feeRate, into);
638
+ FfiConverterInt64.write(value.balanceDelta, into);
639
+ FfiConverterOptionalTypeConfirmationBlockTime.write(value.confirmationBlockTime, into);
640
+ FfiConverterString.write(value.txHex, into);
641
+ }
642
+ allocationSize(value) {
643
+ 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);
644
+ }
645
+ }
646
+ return new FFIConverter();
647
+ })();
648
+
649
+ /**
650
+ * A transaction output (value + locking script). Mirrors bitcoin::TxOut.
651
+ */
652
+
653
+ /**
654
+ * Generated factory for {@link TxOut} record objects.
655
+ */
656
+ export const TxOut = (() => {
657
+ const defaults = () => ({});
658
+ const create = (() => {
659
+ return uniffiCreateRecord(defaults);
660
+ })();
661
+ return Object.freeze({
662
+ /**
663
+ * Create a frozen instance of {@link TxOut}, with defaults specified
664
+ * in Rust, in the {@link bdk_ffi} crate.
665
+ */
666
+ create,
667
+ /**
668
+ * Create a frozen instance of {@link TxOut}, with defaults specified
669
+ * in Rust, in the {@link bdk_ffi} crate.
670
+ */
671
+ new: create,
672
+ /**
673
+ * Defaults specified in the {@link bdk_ffi} crate.
674
+ */
675
+ defaults: () => Object.freeze(defaults())
676
+ });
677
+ })();
678
+ const FfiConverterTypeTxOut = (() => {
679
+ class FFIConverter extends AbstractFfiConverterByteArray {
680
+ read(from) {
681
+ return {
682
+ value: FfiConverterUInt64.read(from),
683
+ scriptPubkeyHex: FfiConverterString.read(from)
684
+ };
685
+ }
686
+ write(value, into) {
687
+ FfiConverterUInt64.write(value.value, into);
688
+ FfiConverterString.write(value.scriptPubkeyHex, into);
689
+ }
690
+ allocationSize(value) {
691
+ return FfiConverterUInt64.allocationSize(value.value) + FfiConverterString.allocationSize(value.scriptPubkeyHex);
692
+ }
693
+ }
694
+ return new FFIConverter();
695
+ })();
696
+ const stringConverter = {
697
+ stringToBytes: s => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer(s, status)),
698
+ bytesToString: ab => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string(ab, status)),
699
+ stringByteLength: s => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length(s, status))
700
+ };
701
+ const FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
702
+
703
+ // Flat error type: BdkError
704
+ export let BdkError_Tags = /*#__PURE__*/function (BdkError_Tags) {
705
+ BdkError_Tags["InvalidDescriptor"] = "InvalidDescriptor";
706
+ BdkError_Tags["WalletCreationFailed"] = "WalletCreationFailed";
707
+ BdkError_Tags["WalletLoadFailed"] = "WalletLoadFailed";
708
+ BdkError_Tags["WalletLoadMismatch"] = "WalletLoadMismatch";
709
+ BdkError_Tags["PersistError"] = "PersistError";
710
+ BdkError_Tags["InvalidAddress"] = "InvalidAddress";
711
+ BdkError_Tags["InvalidScript"] = "InvalidScript";
712
+ BdkError_Tags["TransactionBuildFailed"] = "TransactionBuildFailed";
713
+ BdkError_Tags["NoRecipients"] = "NoRecipients";
714
+ BdkError_Tags["NoUtxosSelected"] = "NoUtxosSelected";
715
+ BdkError_Tags["OutputBelowDustLimit"] = "OutputBelowDustLimit";
716
+ BdkError_Tags["InsufficientFunds"] = "InsufficientFunds";
717
+ BdkError_Tags["FeeRateTooLow"] = "FeeRateTooLow";
718
+ BdkError_Tags["FeeTooLow"] = "FeeTooLow";
719
+ BdkError_Tags["LockTimeConflict"] = "LockTimeConflict";
720
+ BdkError_Tags["RbfSequenceConflict"] = "RbfSequenceConflict";
721
+ BdkError_Tags["VersionZero"] = "VersionZero";
722
+ BdkError_Tags["VersionOneCsv"] = "VersionOneCsv";
723
+ BdkError_Tags["SpendingPolicyRequired"] = "SpendingPolicyRequired";
724
+ BdkError_Tags["MissingKeyOrigin"] = "MissingKeyOrigin";
725
+ BdkError_Tags["MissingNonWitnessUtxo"] = "MissingNonWitnessUtxo";
726
+ BdkError_Tags["OutpointNotFound"] = "OutpointNotFound";
727
+ BdkError_Tags["FeeBumpTargetNotFound"] = "FeeBumpTargetNotFound";
728
+ BdkError_Tags["FeeBumpAlreadyConfirmed"] = "FeeBumpAlreadyConfirmed";
729
+ BdkError_Tags["FeeBumpIrreplaceable"] = "FeeBumpIrreplaceable";
730
+ BdkError_Tags["FeeBumpFeeRateUnavailable"] = "FeeBumpFeeRateUnavailable";
731
+ BdkError_Tags["FeeBumpInvalidOutputIndex"] = "FeeBumpInvalidOutputIndex";
732
+ BdkError_Tags["InvalidPsbt"] = "InvalidPsbt";
733
+ BdkError_Tags["SignFailed"] = "SignFailed";
734
+ BdkError_Tags["SignerMissingKey"] = "SignerMissingKey";
735
+ BdkError_Tags["SignerInvalidKey"] = "SignerInvalidKey";
736
+ BdkError_Tags["SignerUserCanceled"] = "SignerUserCanceled";
737
+ BdkError_Tags["SignerInputIndexOutOfRange"] = "SignerInputIndexOutOfRange";
738
+ BdkError_Tags["SignerMissingNonWitnessUtxo"] = "SignerMissingNonWitnessUtxo";
739
+ BdkError_Tags["SignerMissingWitnessUtxo"] = "SignerMissingWitnessUtxo";
740
+ BdkError_Tags["SignerMissingWitnessScript"] = "SignerMissingWitnessScript";
741
+ BdkError_Tags["SignerNonStandardSighash"] = "SignerNonStandardSighash";
742
+ BdkError_Tags["SignerInvalidSighash"] = "SignerInvalidSighash";
743
+ BdkError_Tags["SyncFailed"] = "SyncFailed";
744
+ BdkError_Tags["BroadcastFailed"] = "BroadcastFailed";
745
+ BdkError_Tags["InvalidTransaction"] = "InvalidTransaction";
746
+ BdkError_Tags["TransactionNotFound"] = "TransactionNotFound";
747
+ BdkError_Tags["CannotConnect"] = "CannotConnect";
748
+ BdkError_Tags["CalculateFeeError"] = "CalculateFeeError";
749
+ BdkError_Tags["InvalidMnemonic"] = "InvalidMnemonic";
750
+ BdkError_Tags["InvalidEntropy"] = "InvalidEntropy";
751
+ BdkError_Tags["KeyError"] = "KeyError";
752
+ BdkError_Tags["Generic"] = "Generic";
753
+ return BdkError_Tags;
754
+ }({});
755
+ export const BdkError = (() => {
756
+ class InvalidDescriptor extends UniffiError {
757
+ /**
758
+ * @private
759
+ * This field is private and should not be used.
760
+ */
761
+ [uniffiTypeNameSymbol] = "BdkError";
762
+ /**
763
+ * @private
764
+ * This field is private and should not be used.
765
+ */
766
+ [variantOrdinalSymbol] = 1;
767
+ tag = BdkError_Tags.InvalidDescriptor;
768
+ constructor(message) {
769
+ super("BdkError", "InvalidDescriptor", message);
770
+ }
771
+ static instanceOf(e) {
772
+ return instanceOf(e) && e[variantOrdinalSymbol] === 1;
773
+ }
774
+ }
775
+ class WalletCreationFailed extends UniffiError {
776
+ /**
777
+ * @private
778
+ * This field is private and should not be used.
779
+ */
780
+ [uniffiTypeNameSymbol] = "BdkError";
781
+ /**
782
+ * @private
783
+ * This field is private and should not be used.
784
+ */
785
+ [variantOrdinalSymbol] = 2;
786
+ tag = BdkError_Tags.WalletCreationFailed;
787
+ constructor(message) {
788
+ super("BdkError", "WalletCreationFailed", message);
789
+ }
790
+ static instanceOf(e) {
791
+ return instanceOf(e) && e[variantOrdinalSymbol] === 2;
792
+ }
793
+ }
794
+ class WalletLoadFailed extends UniffiError {
795
+ /**
796
+ * @private
797
+ * This field is private and should not be used.
798
+ */
799
+ [uniffiTypeNameSymbol] = "BdkError";
800
+ /**
801
+ * @private
802
+ * This field is private and should not be used.
803
+ */
804
+ [variantOrdinalSymbol] = 3;
805
+ tag = BdkError_Tags.WalletLoadFailed;
806
+ constructor(message) {
807
+ super("BdkError", "WalletLoadFailed", message);
808
+ }
809
+ static instanceOf(e) {
810
+ return instanceOf(e) && e[variantOrdinalSymbol] === 3;
811
+ }
812
+ }
813
+ class WalletLoadMismatch extends UniffiError {
814
+ /**
815
+ * @private
816
+ * This field is private and should not be used.
817
+ */
818
+ [uniffiTypeNameSymbol] = "BdkError";
819
+ /**
820
+ * @private
821
+ * This field is private and should not be used.
822
+ */
823
+ [variantOrdinalSymbol] = 4;
824
+ tag = BdkError_Tags.WalletLoadMismatch;
825
+ constructor(message) {
826
+ super("BdkError", "WalletLoadMismatch", message);
827
+ }
828
+ static instanceOf(e) {
829
+ return instanceOf(e) && e[variantOrdinalSymbol] === 4;
830
+ }
831
+ }
832
+ class PersistError extends UniffiError {
833
+ /**
834
+ * @private
835
+ * This field is private and should not be used.
836
+ */
837
+ [uniffiTypeNameSymbol] = "BdkError";
838
+ /**
839
+ * @private
840
+ * This field is private and should not be used.
841
+ */
842
+ [variantOrdinalSymbol] = 5;
843
+ tag = BdkError_Tags.PersistError;
844
+ constructor(message) {
845
+ super("BdkError", "PersistError", message);
846
+ }
847
+ static instanceOf(e) {
848
+ return instanceOf(e) && e[variantOrdinalSymbol] === 5;
849
+ }
850
+ }
851
+ class InvalidAddress extends UniffiError {
852
+ /**
853
+ * @private
854
+ * This field is private and should not be used.
855
+ */
856
+ [uniffiTypeNameSymbol] = "BdkError";
857
+ /**
858
+ * @private
859
+ * This field is private and should not be used.
860
+ */
861
+ [variantOrdinalSymbol] = 6;
862
+ tag = BdkError_Tags.InvalidAddress;
863
+ constructor(message) {
864
+ super("BdkError", "InvalidAddress", message);
865
+ }
866
+ static instanceOf(e) {
867
+ return instanceOf(e) && e[variantOrdinalSymbol] === 6;
868
+ }
869
+ }
870
+ class InvalidScript extends UniffiError {
871
+ /**
872
+ * @private
873
+ * This field is private and should not be used.
874
+ */
875
+ [uniffiTypeNameSymbol] = "BdkError";
876
+ /**
877
+ * @private
878
+ * This field is private and should not be used.
879
+ */
880
+ [variantOrdinalSymbol] = 7;
881
+ tag = BdkError_Tags.InvalidScript;
882
+ constructor(message) {
883
+ super("BdkError", "InvalidScript", message);
884
+ }
885
+ static instanceOf(e) {
886
+ return instanceOf(e) && e[variantOrdinalSymbol] === 7;
887
+ }
888
+ }
889
+ class TransactionBuildFailed extends UniffiError {
890
+ /**
891
+ * @private
892
+ * This field is private and should not be used.
893
+ */
894
+ [uniffiTypeNameSymbol] = "BdkError";
895
+ /**
896
+ * @private
897
+ * This field is private and should not be used.
898
+ */
899
+ [variantOrdinalSymbol] = 8;
900
+ tag = BdkError_Tags.TransactionBuildFailed;
901
+ constructor(message) {
902
+ super("BdkError", "TransactionBuildFailed", message);
903
+ }
904
+ static instanceOf(e) {
905
+ return instanceOf(e) && e[variantOrdinalSymbol] === 8;
906
+ }
907
+ }
908
+ class NoRecipients extends UniffiError {
909
+ /**
910
+ * @private
911
+ * This field is private and should not be used.
912
+ */
913
+ [uniffiTypeNameSymbol] = "BdkError";
914
+ /**
915
+ * @private
916
+ * This field is private and should not be used.
917
+ */
918
+ [variantOrdinalSymbol] = 9;
919
+ tag = BdkError_Tags.NoRecipients;
920
+ constructor(message) {
921
+ super("BdkError", "NoRecipients", message);
922
+ }
923
+ static instanceOf(e) {
924
+ return instanceOf(e) && e[variantOrdinalSymbol] === 9;
925
+ }
926
+ }
927
+ class NoUtxosSelected extends UniffiError {
928
+ /**
929
+ * @private
930
+ * This field is private and should not be used.
931
+ */
932
+ [uniffiTypeNameSymbol] = "BdkError";
933
+ /**
934
+ * @private
935
+ * This field is private and should not be used.
936
+ */
937
+ [variantOrdinalSymbol] = 10;
938
+ tag = BdkError_Tags.NoUtxosSelected;
939
+ constructor(message) {
940
+ super("BdkError", "NoUtxosSelected", message);
941
+ }
942
+ static instanceOf(e) {
943
+ return instanceOf(e) && e[variantOrdinalSymbol] === 10;
944
+ }
945
+ }
946
+ class OutputBelowDustLimit extends UniffiError {
947
+ /**
948
+ * @private
949
+ * This field is private and should not be used.
950
+ */
951
+ [uniffiTypeNameSymbol] = "BdkError";
952
+ /**
953
+ * @private
954
+ * This field is private and should not be used.
955
+ */
956
+ [variantOrdinalSymbol] = 11;
957
+ tag = BdkError_Tags.OutputBelowDustLimit;
958
+ constructor(message) {
959
+ super("BdkError", "OutputBelowDustLimit", message);
960
+ }
961
+ static instanceOf(e) {
962
+ return instanceOf(e) && e[variantOrdinalSymbol] === 11;
963
+ }
964
+ }
965
+ class InsufficientFunds extends UniffiError {
966
+ /**
967
+ * @private
968
+ * This field is private and should not be used.
969
+ */
970
+ [uniffiTypeNameSymbol] = "BdkError";
971
+ /**
972
+ * @private
973
+ * This field is private and should not be used.
974
+ */
975
+ [variantOrdinalSymbol] = 12;
976
+ tag = BdkError_Tags.InsufficientFunds;
977
+ constructor(message) {
978
+ super("BdkError", "InsufficientFunds", message);
979
+ }
980
+ static instanceOf(e) {
981
+ return instanceOf(e) && e[variantOrdinalSymbol] === 12;
982
+ }
983
+ }
984
+ class FeeRateTooLow extends UniffiError {
985
+ /**
986
+ * @private
987
+ * This field is private and should not be used.
988
+ */
989
+ [uniffiTypeNameSymbol] = "BdkError";
990
+ /**
991
+ * @private
992
+ * This field is private and should not be used.
993
+ */
994
+ [variantOrdinalSymbol] = 13;
995
+ tag = BdkError_Tags.FeeRateTooLow;
996
+ constructor(message) {
997
+ super("BdkError", "FeeRateTooLow", message);
998
+ }
999
+ static instanceOf(e) {
1000
+ return instanceOf(e) && e[variantOrdinalSymbol] === 13;
1001
+ }
1002
+ }
1003
+ class FeeTooLow extends UniffiError {
1004
+ /**
1005
+ * @private
1006
+ * This field is private and should not be used.
1007
+ */
1008
+ [uniffiTypeNameSymbol] = "BdkError";
1009
+ /**
1010
+ * @private
1011
+ * This field is private and should not be used.
1012
+ */
1013
+ [variantOrdinalSymbol] = 14;
1014
+ tag = BdkError_Tags.FeeTooLow;
1015
+ constructor(message) {
1016
+ super("BdkError", "FeeTooLow", message);
1017
+ }
1018
+ static instanceOf(e) {
1019
+ return instanceOf(e) && e[variantOrdinalSymbol] === 14;
1020
+ }
1021
+ }
1022
+ class LockTimeConflict extends UniffiError {
1023
+ /**
1024
+ * @private
1025
+ * This field is private and should not be used.
1026
+ */
1027
+ [uniffiTypeNameSymbol] = "BdkError";
1028
+ /**
1029
+ * @private
1030
+ * This field is private and should not be used.
1031
+ */
1032
+ [variantOrdinalSymbol] = 15;
1033
+ tag = BdkError_Tags.LockTimeConflict;
1034
+ constructor(message) {
1035
+ super("BdkError", "LockTimeConflict", message);
1036
+ }
1037
+ static instanceOf(e) {
1038
+ return instanceOf(e) && e[variantOrdinalSymbol] === 15;
1039
+ }
1040
+ }
1041
+ class RbfSequenceConflict extends UniffiError {
1042
+ /**
1043
+ * @private
1044
+ * This field is private and should not be used.
1045
+ */
1046
+ [uniffiTypeNameSymbol] = "BdkError";
1047
+ /**
1048
+ * @private
1049
+ * This field is private and should not be used.
1050
+ */
1051
+ [variantOrdinalSymbol] = 16;
1052
+ tag = BdkError_Tags.RbfSequenceConflict;
1053
+ constructor(message) {
1054
+ super("BdkError", "RbfSequenceConflict", message);
1055
+ }
1056
+ static instanceOf(e) {
1057
+ return instanceOf(e) && e[variantOrdinalSymbol] === 16;
1058
+ }
1059
+ }
1060
+ class VersionZero extends UniffiError {
1061
+ /**
1062
+ * @private
1063
+ * This field is private and should not be used.
1064
+ */
1065
+ [uniffiTypeNameSymbol] = "BdkError";
1066
+ /**
1067
+ * @private
1068
+ * This field is private and should not be used.
1069
+ */
1070
+ [variantOrdinalSymbol] = 17;
1071
+ tag = BdkError_Tags.VersionZero;
1072
+ constructor(message) {
1073
+ super("BdkError", "VersionZero", message);
1074
+ }
1075
+ static instanceOf(e) {
1076
+ return instanceOf(e) && e[variantOrdinalSymbol] === 17;
1077
+ }
1078
+ }
1079
+ class VersionOneCsv extends UniffiError {
1080
+ /**
1081
+ * @private
1082
+ * This field is private and should not be used.
1083
+ */
1084
+ [uniffiTypeNameSymbol] = "BdkError";
1085
+ /**
1086
+ * @private
1087
+ * This field is private and should not be used.
1088
+ */
1089
+ [variantOrdinalSymbol] = 18;
1090
+ tag = BdkError_Tags.VersionOneCsv;
1091
+ constructor(message) {
1092
+ super("BdkError", "VersionOneCsv", message);
1093
+ }
1094
+ static instanceOf(e) {
1095
+ return instanceOf(e) && e[variantOrdinalSymbol] === 18;
1096
+ }
1097
+ }
1098
+ class SpendingPolicyRequired extends UniffiError {
1099
+ /**
1100
+ * @private
1101
+ * This field is private and should not be used.
1102
+ */
1103
+ [uniffiTypeNameSymbol] = "BdkError";
1104
+ /**
1105
+ * @private
1106
+ * This field is private and should not be used.
1107
+ */
1108
+ [variantOrdinalSymbol] = 19;
1109
+ tag = BdkError_Tags.SpendingPolicyRequired;
1110
+ constructor(message) {
1111
+ super("BdkError", "SpendingPolicyRequired", message);
1112
+ }
1113
+ static instanceOf(e) {
1114
+ return instanceOf(e) && e[variantOrdinalSymbol] === 19;
1115
+ }
1116
+ }
1117
+ class MissingKeyOrigin extends UniffiError {
1118
+ /**
1119
+ * @private
1120
+ * This field is private and should not be used.
1121
+ */
1122
+ [uniffiTypeNameSymbol] = "BdkError";
1123
+ /**
1124
+ * @private
1125
+ * This field is private and should not be used.
1126
+ */
1127
+ [variantOrdinalSymbol] = 20;
1128
+ tag = BdkError_Tags.MissingKeyOrigin;
1129
+ constructor(message) {
1130
+ super("BdkError", "MissingKeyOrigin", message);
1131
+ }
1132
+ static instanceOf(e) {
1133
+ return instanceOf(e) && e[variantOrdinalSymbol] === 20;
1134
+ }
1135
+ }
1136
+ class MissingNonWitnessUtxo extends UniffiError {
1137
+ /**
1138
+ * @private
1139
+ * This field is private and should not be used.
1140
+ */
1141
+ [uniffiTypeNameSymbol] = "BdkError";
1142
+ /**
1143
+ * @private
1144
+ * This field is private and should not be used.
1145
+ */
1146
+ [variantOrdinalSymbol] = 21;
1147
+ tag = BdkError_Tags.MissingNonWitnessUtxo;
1148
+ constructor(message) {
1149
+ super("BdkError", "MissingNonWitnessUtxo", message);
1150
+ }
1151
+ static instanceOf(e) {
1152
+ return instanceOf(e) && e[variantOrdinalSymbol] === 21;
1153
+ }
1154
+ }
1155
+ class OutpointNotFound extends UniffiError {
1156
+ /**
1157
+ * @private
1158
+ * This field is private and should not be used.
1159
+ */
1160
+ [uniffiTypeNameSymbol] = "BdkError";
1161
+ /**
1162
+ * @private
1163
+ * This field is private and should not be used.
1164
+ */
1165
+ [variantOrdinalSymbol] = 22;
1166
+ tag = BdkError_Tags.OutpointNotFound;
1167
+ constructor(message) {
1168
+ super("BdkError", "OutpointNotFound", message);
1169
+ }
1170
+ static instanceOf(e) {
1171
+ return instanceOf(e) && e[variantOrdinalSymbol] === 22;
1172
+ }
1173
+ }
1174
+ class FeeBumpTargetNotFound extends UniffiError {
1175
+ /**
1176
+ * @private
1177
+ * This field is private and should not be used.
1178
+ */
1179
+ [uniffiTypeNameSymbol] = "BdkError";
1180
+ /**
1181
+ * @private
1182
+ * This field is private and should not be used.
1183
+ */
1184
+ [variantOrdinalSymbol] = 23;
1185
+ tag = BdkError_Tags.FeeBumpTargetNotFound;
1186
+ constructor(message) {
1187
+ super("BdkError", "FeeBumpTargetNotFound", message);
1188
+ }
1189
+ static instanceOf(e) {
1190
+ return instanceOf(e) && e[variantOrdinalSymbol] === 23;
1191
+ }
1192
+ }
1193
+ class FeeBumpAlreadyConfirmed extends UniffiError {
1194
+ /**
1195
+ * @private
1196
+ * This field is private and should not be used.
1197
+ */
1198
+ [uniffiTypeNameSymbol] = "BdkError";
1199
+ /**
1200
+ * @private
1201
+ * This field is private and should not be used.
1202
+ */
1203
+ [variantOrdinalSymbol] = 24;
1204
+ tag = BdkError_Tags.FeeBumpAlreadyConfirmed;
1205
+ constructor(message) {
1206
+ super("BdkError", "FeeBumpAlreadyConfirmed", message);
1207
+ }
1208
+ static instanceOf(e) {
1209
+ return instanceOf(e) && e[variantOrdinalSymbol] === 24;
1210
+ }
1211
+ }
1212
+ class FeeBumpIrreplaceable extends UniffiError {
1213
+ /**
1214
+ * @private
1215
+ * This field is private and should not be used.
1216
+ */
1217
+ [uniffiTypeNameSymbol] = "BdkError";
1218
+ /**
1219
+ * @private
1220
+ * This field is private and should not be used.
1221
+ */
1222
+ [variantOrdinalSymbol] = 25;
1223
+ tag = BdkError_Tags.FeeBumpIrreplaceable;
1224
+ constructor(message) {
1225
+ super("BdkError", "FeeBumpIrreplaceable", message);
1226
+ }
1227
+ static instanceOf(e) {
1228
+ return instanceOf(e) && e[variantOrdinalSymbol] === 25;
1229
+ }
1230
+ }
1231
+ class FeeBumpFeeRateUnavailable extends UniffiError {
1232
+ /**
1233
+ * @private
1234
+ * This field is private and should not be used.
1235
+ */
1236
+ [uniffiTypeNameSymbol] = "BdkError";
1237
+ /**
1238
+ * @private
1239
+ * This field is private and should not be used.
1240
+ */
1241
+ [variantOrdinalSymbol] = 26;
1242
+ tag = BdkError_Tags.FeeBumpFeeRateUnavailable;
1243
+ constructor(message) {
1244
+ super("BdkError", "FeeBumpFeeRateUnavailable", message);
1245
+ }
1246
+ static instanceOf(e) {
1247
+ return instanceOf(e) && e[variantOrdinalSymbol] === 26;
1248
+ }
1249
+ }
1250
+ class FeeBumpInvalidOutputIndex extends UniffiError {
1251
+ /**
1252
+ * @private
1253
+ * This field is private and should not be used.
1254
+ */
1255
+ [uniffiTypeNameSymbol] = "BdkError";
1256
+ /**
1257
+ * @private
1258
+ * This field is private and should not be used.
1259
+ */
1260
+ [variantOrdinalSymbol] = 27;
1261
+ tag = BdkError_Tags.FeeBumpInvalidOutputIndex;
1262
+ constructor(message) {
1263
+ super("BdkError", "FeeBumpInvalidOutputIndex", message);
1264
+ }
1265
+ static instanceOf(e) {
1266
+ return instanceOf(e) && e[variantOrdinalSymbol] === 27;
1267
+ }
1268
+ }
1269
+ class InvalidPsbt extends UniffiError {
1270
+ /**
1271
+ * @private
1272
+ * This field is private and should not be used.
1273
+ */
1274
+ [uniffiTypeNameSymbol] = "BdkError";
1275
+ /**
1276
+ * @private
1277
+ * This field is private and should not be used.
1278
+ */
1279
+ [variantOrdinalSymbol] = 28;
1280
+ tag = BdkError_Tags.InvalidPsbt;
1281
+ constructor(message) {
1282
+ super("BdkError", "InvalidPsbt", message);
1283
+ }
1284
+ static instanceOf(e) {
1285
+ return instanceOf(e) && e[variantOrdinalSymbol] === 28;
1286
+ }
1287
+ }
1288
+ class SignFailed extends UniffiError {
1289
+ /**
1290
+ * @private
1291
+ * This field is private and should not be used.
1292
+ */
1293
+ [uniffiTypeNameSymbol] = "BdkError";
1294
+ /**
1295
+ * @private
1296
+ * This field is private and should not be used.
1297
+ */
1298
+ [variantOrdinalSymbol] = 29;
1299
+ tag = BdkError_Tags.SignFailed;
1300
+ constructor(message) {
1301
+ super("BdkError", "SignFailed", message);
1302
+ }
1303
+ static instanceOf(e) {
1304
+ return instanceOf(e) && e[variantOrdinalSymbol] === 29;
1305
+ }
1306
+ }
1307
+ class SignerMissingKey extends UniffiError {
1308
+ /**
1309
+ * @private
1310
+ * This field is private and should not be used.
1311
+ */
1312
+ [uniffiTypeNameSymbol] = "BdkError";
1313
+ /**
1314
+ * @private
1315
+ * This field is private and should not be used.
1316
+ */
1317
+ [variantOrdinalSymbol] = 30;
1318
+ tag = BdkError_Tags.SignerMissingKey;
1319
+ constructor(message) {
1320
+ super("BdkError", "SignerMissingKey", message);
1321
+ }
1322
+ static instanceOf(e) {
1323
+ return instanceOf(e) && e[variantOrdinalSymbol] === 30;
1324
+ }
1325
+ }
1326
+ class SignerInvalidKey extends UniffiError {
1327
+ /**
1328
+ * @private
1329
+ * This field is private and should not be used.
1330
+ */
1331
+ [uniffiTypeNameSymbol] = "BdkError";
1332
+ /**
1333
+ * @private
1334
+ * This field is private and should not be used.
1335
+ */
1336
+ [variantOrdinalSymbol] = 31;
1337
+ tag = BdkError_Tags.SignerInvalidKey;
1338
+ constructor(message) {
1339
+ super("BdkError", "SignerInvalidKey", message);
1340
+ }
1341
+ static instanceOf(e) {
1342
+ return instanceOf(e) && e[variantOrdinalSymbol] === 31;
1343
+ }
1344
+ }
1345
+ class SignerUserCanceled extends UniffiError {
1346
+ /**
1347
+ * @private
1348
+ * This field is private and should not be used.
1349
+ */
1350
+ [uniffiTypeNameSymbol] = "BdkError";
1351
+ /**
1352
+ * @private
1353
+ * This field is private and should not be used.
1354
+ */
1355
+ [variantOrdinalSymbol] = 32;
1356
+ tag = BdkError_Tags.SignerUserCanceled;
1357
+ constructor(message) {
1358
+ super("BdkError", "SignerUserCanceled", message);
1359
+ }
1360
+ static instanceOf(e) {
1361
+ return instanceOf(e) && e[variantOrdinalSymbol] === 32;
1362
+ }
1363
+ }
1364
+ class SignerInputIndexOutOfRange extends UniffiError {
1365
+ /**
1366
+ * @private
1367
+ * This field is private and should not be used.
1368
+ */
1369
+ [uniffiTypeNameSymbol] = "BdkError";
1370
+ /**
1371
+ * @private
1372
+ * This field is private and should not be used.
1373
+ */
1374
+ [variantOrdinalSymbol] = 33;
1375
+ tag = BdkError_Tags.SignerInputIndexOutOfRange;
1376
+ constructor(message) {
1377
+ super("BdkError", "SignerInputIndexOutOfRange", message);
1378
+ }
1379
+ static instanceOf(e) {
1380
+ return instanceOf(e) && e[variantOrdinalSymbol] === 33;
1381
+ }
1382
+ }
1383
+ class SignerMissingNonWitnessUtxo extends UniffiError {
1384
+ /**
1385
+ * @private
1386
+ * This field is private and should not be used.
1387
+ */
1388
+ [uniffiTypeNameSymbol] = "BdkError";
1389
+ /**
1390
+ * @private
1391
+ * This field is private and should not be used.
1392
+ */
1393
+ [variantOrdinalSymbol] = 34;
1394
+ tag = BdkError_Tags.SignerMissingNonWitnessUtxo;
1395
+ constructor(message) {
1396
+ super("BdkError", "SignerMissingNonWitnessUtxo", message);
1397
+ }
1398
+ static instanceOf(e) {
1399
+ return instanceOf(e) && e[variantOrdinalSymbol] === 34;
1400
+ }
1401
+ }
1402
+ class SignerMissingWitnessUtxo extends UniffiError {
1403
+ /**
1404
+ * @private
1405
+ * This field is private and should not be used.
1406
+ */
1407
+ [uniffiTypeNameSymbol] = "BdkError";
1408
+ /**
1409
+ * @private
1410
+ * This field is private and should not be used.
1411
+ */
1412
+ [variantOrdinalSymbol] = 35;
1413
+ tag = BdkError_Tags.SignerMissingWitnessUtxo;
1414
+ constructor(message) {
1415
+ super("BdkError", "SignerMissingWitnessUtxo", message);
1416
+ }
1417
+ static instanceOf(e) {
1418
+ return instanceOf(e) && e[variantOrdinalSymbol] === 35;
1419
+ }
1420
+ }
1421
+ class SignerMissingWitnessScript extends UniffiError {
1422
+ /**
1423
+ * @private
1424
+ * This field is private and should not be used.
1425
+ */
1426
+ [uniffiTypeNameSymbol] = "BdkError";
1427
+ /**
1428
+ * @private
1429
+ * This field is private and should not be used.
1430
+ */
1431
+ [variantOrdinalSymbol] = 36;
1432
+ tag = BdkError_Tags.SignerMissingWitnessScript;
1433
+ constructor(message) {
1434
+ super("BdkError", "SignerMissingWitnessScript", message);
1435
+ }
1436
+ static instanceOf(e) {
1437
+ return instanceOf(e) && e[variantOrdinalSymbol] === 36;
1438
+ }
1439
+ }
1440
+ class SignerNonStandardSighash extends UniffiError {
1441
+ /**
1442
+ * @private
1443
+ * This field is private and should not be used.
1444
+ */
1445
+ [uniffiTypeNameSymbol] = "BdkError";
1446
+ /**
1447
+ * @private
1448
+ * This field is private and should not be used.
1449
+ */
1450
+ [variantOrdinalSymbol] = 37;
1451
+ tag = BdkError_Tags.SignerNonStandardSighash;
1452
+ constructor(message) {
1453
+ super("BdkError", "SignerNonStandardSighash", message);
1454
+ }
1455
+ static instanceOf(e) {
1456
+ return instanceOf(e) && e[variantOrdinalSymbol] === 37;
1457
+ }
1458
+ }
1459
+ class SignerInvalidSighash extends UniffiError {
1460
+ /**
1461
+ * @private
1462
+ * This field is private and should not be used.
1463
+ */
1464
+ [uniffiTypeNameSymbol] = "BdkError";
1465
+ /**
1466
+ * @private
1467
+ * This field is private and should not be used.
1468
+ */
1469
+ [variantOrdinalSymbol] = 38;
1470
+ tag = BdkError_Tags.SignerInvalidSighash;
1471
+ constructor(message) {
1472
+ super("BdkError", "SignerInvalidSighash", message);
1473
+ }
1474
+ static instanceOf(e) {
1475
+ return instanceOf(e) && e[variantOrdinalSymbol] === 38;
1476
+ }
1477
+ }
1478
+ class SyncFailed extends UniffiError {
1479
+ /**
1480
+ * @private
1481
+ * This field is private and should not be used.
1482
+ */
1483
+ [uniffiTypeNameSymbol] = "BdkError";
1484
+ /**
1485
+ * @private
1486
+ * This field is private and should not be used.
1487
+ */
1488
+ [variantOrdinalSymbol] = 39;
1489
+ tag = BdkError_Tags.SyncFailed;
1490
+ constructor(message) {
1491
+ super("BdkError", "SyncFailed", message);
1492
+ }
1493
+ static instanceOf(e) {
1494
+ return instanceOf(e) && e[variantOrdinalSymbol] === 39;
1495
+ }
1496
+ }
1497
+ class BroadcastFailed extends UniffiError {
1498
+ /**
1499
+ * @private
1500
+ * This field is private and should not be used.
1501
+ */
1502
+ [uniffiTypeNameSymbol] = "BdkError";
1503
+ /**
1504
+ * @private
1505
+ * This field is private and should not be used.
1506
+ */
1507
+ [variantOrdinalSymbol] = 40;
1508
+ tag = BdkError_Tags.BroadcastFailed;
1509
+ constructor(message) {
1510
+ super("BdkError", "BroadcastFailed", message);
1511
+ }
1512
+ static instanceOf(e) {
1513
+ return instanceOf(e) && e[variantOrdinalSymbol] === 40;
1514
+ }
1515
+ }
1516
+ class InvalidTransaction extends UniffiError {
1517
+ /**
1518
+ * @private
1519
+ * This field is private and should not be used.
1520
+ */
1521
+ [uniffiTypeNameSymbol] = "BdkError";
1522
+ /**
1523
+ * @private
1524
+ * This field is private and should not be used.
1525
+ */
1526
+ [variantOrdinalSymbol] = 41;
1527
+ tag = BdkError_Tags.InvalidTransaction;
1528
+ constructor(message) {
1529
+ super("BdkError", "InvalidTransaction", message);
1530
+ }
1531
+ static instanceOf(e) {
1532
+ return instanceOf(e) && e[variantOrdinalSymbol] === 41;
1533
+ }
1534
+ }
1535
+ class TransactionNotFound extends UniffiError {
1536
+ /**
1537
+ * @private
1538
+ * This field is private and should not be used.
1539
+ */
1540
+ [uniffiTypeNameSymbol] = "BdkError";
1541
+ /**
1542
+ * @private
1543
+ * This field is private and should not be used.
1544
+ */
1545
+ [variantOrdinalSymbol] = 42;
1546
+ tag = BdkError_Tags.TransactionNotFound;
1547
+ constructor(message) {
1548
+ super("BdkError", "TransactionNotFound", message);
1549
+ }
1550
+ static instanceOf(e) {
1551
+ return instanceOf(e) && e[variantOrdinalSymbol] === 42;
1552
+ }
1553
+ }
1554
+ class CannotConnect extends UniffiError {
1555
+ /**
1556
+ * @private
1557
+ * This field is private and should not be used.
1558
+ */
1559
+ [uniffiTypeNameSymbol] = "BdkError";
1560
+ /**
1561
+ * @private
1562
+ * This field is private and should not be used.
1563
+ */
1564
+ [variantOrdinalSymbol] = 43;
1565
+ tag = BdkError_Tags.CannotConnect;
1566
+ constructor(message) {
1567
+ super("BdkError", "CannotConnect", message);
1568
+ }
1569
+ static instanceOf(e) {
1570
+ return instanceOf(e) && e[variantOrdinalSymbol] === 43;
1571
+ }
1572
+ }
1573
+ class CalculateFeeError extends UniffiError {
1574
+ /**
1575
+ * @private
1576
+ * This field is private and should not be used.
1577
+ */
1578
+ [uniffiTypeNameSymbol] = "BdkError";
1579
+ /**
1580
+ * @private
1581
+ * This field is private and should not be used.
1582
+ */
1583
+ [variantOrdinalSymbol] = 44;
1584
+ tag = BdkError_Tags.CalculateFeeError;
1585
+ constructor(message) {
1586
+ super("BdkError", "CalculateFeeError", message);
1587
+ }
1588
+ static instanceOf(e) {
1589
+ return instanceOf(e) && e[variantOrdinalSymbol] === 44;
1590
+ }
1591
+ }
1592
+ class InvalidMnemonic extends UniffiError {
1593
+ /**
1594
+ * @private
1595
+ * This field is private and should not be used.
1596
+ */
1597
+ [uniffiTypeNameSymbol] = "BdkError";
1598
+ /**
1599
+ * @private
1600
+ * This field is private and should not be used.
1601
+ */
1602
+ [variantOrdinalSymbol] = 45;
1603
+ tag = BdkError_Tags.InvalidMnemonic;
1604
+ constructor(message) {
1605
+ super("BdkError", "InvalidMnemonic", message);
1606
+ }
1607
+ static instanceOf(e) {
1608
+ return instanceOf(e) && e[variantOrdinalSymbol] === 45;
1609
+ }
1610
+ }
1611
+ class InvalidEntropy extends UniffiError {
1612
+ /**
1613
+ * @private
1614
+ * This field is private and should not be used.
1615
+ */
1616
+ [uniffiTypeNameSymbol] = "BdkError";
1617
+ /**
1618
+ * @private
1619
+ * This field is private and should not be used.
1620
+ */
1621
+ [variantOrdinalSymbol] = 46;
1622
+ tag = BdkError_Tags.InvalidEntropy;
1623
+ constructor(message) {
1624
+ super("BdkError", "InvalidEntropy", message);
1625
+ }
1626
+ static instanceOf(e) {
1627
+ return instanceOf(e) && e[variantOrdinalSymbol] === 46;
1628
+ }
1629
+ }
1630
+ class KeyError extends UniffiError {
1631
+ /**
1632
+ * @private
1633
+ * This field is private and should not be used.
1634
+ */
1635
+ [uniffiTypeNameSymbol] = "BdkError";
1636
+ /**
1637
+ * @private
1638
+ * This field is private and should not be used.
1639
+ */
1640
+ [variantOrdinalSymbol] = 47;
1641
+ tag = BdkError_Tags.KeyError;
1642
+ constructor(message) {
1643
+ super("BdkError", "KeyError", message);
1644
+ }
1645
+ static instanceOf(e) {
1646
+ return instanceOf(e) && e[variantOrdinalSymbol] === 47;
1647
+ }
1648
+ }
1649
+ class Generic extends UniffiError {
1650
+ /**
1651
+ * @private
1652
+ * This field is private and should not be used.
1653
+ */
1654
+ [uniffiTypeNameSymbol] = "BdkError";
1655
+ /**
1656
+ * @private
1657
+ * This field is private and should not be used.
1658
+ */
1659
+ [variantOrdinalSymbol] = 48;
1660
+ tag = BdkError_Tags.Generic;
1661
+ constructor(message) {
1662
+ super("BdkError", "Generic", message);
1663
+ }
1664
+ static instanceOf(e) {
1665
+ return instanceOf(e) && e[variantOrdinalSymbol] === 48;
1666
+ }
1667
+ }
1668
+
1669
+ // Utility function which does not rely on instanceof.
1670
+ function instanceOf(e) {
1671
+ return e[uniffiTypeNameSymbol] === "BdkError";
1672
+ }
1673
+ return {
1674
+ InvalidDescriptor,
1675
+ WalletCreationFailed,
1676
+ WalletLoadFailed,
1677
+ WalletLoadMismatch,
1678
+ PersistError,
1679
+ InvalidAddress,
1680
+ InvalidScript,
1681
+ TransactionBuildFailed,
1682
+ NoRecipients,
1683
+ NoUtxosSelected,
1684
+ OutputBelowDustLimit,
1685
+ InsufficientFunds,
1686
+ FeeRateTooLow,
1687
+ FeeTooLow,
1688
+ LockTimeConflict,
1689
+ RbfSequenceConflict,
1690
+ VersionZero,
1691
+ VersionOneCsv,
1692
+ SpendingPolicyRequired,
1693
+ MissingKeyOrigin,
1694
+ MissingNonWitnessUtxo,
1695
+ OutpointNotFound,
1696
+ FeeBumpTargetNotFound,
1697
+ FeeBumpAlreadyConfirmed,
1698
+ FeeBumpIrreplaceable,
1699
+ FeeBumpFeeRateUnavailable,
1700
+ FeeBumpInvalidOutputIndex,
1701
+ InvalidPsbt,
1702
+ SignFailed,
1703
+ SignerMissingKey,
1704
+ SignerInvalidKey,
1705
+ SignerUserCanceled,
1706
+ SignerInputIndexOutOfRange,
1707
+ SignerMissingNonWitnessUtxo,
1708
+ SignerMissingWitnessUtxo,
1709
+ SignerMissingWitnessScript,
1710
+ SignerNonStandardSighash,
1711
+ SignerInvalidSighash,
1712
+ SyncFailed,
1713
+ BroadcastFailed,
1714
+ InvalidTransaction,
1715
+ TransactionNotFound,
1716
+ CannotConnect,
1717
+ CalculateFeeError,
1718
+ InvalidMnemonic,
1719
+ InvalidEntropy,
1720
+ KeyError,
1721
+ Generic,
1722
+ instanceOf
1723
+ };
1724
+ })();
1725
+
1726
+ // Union type for BdkError error type.
1727
+
1728
+ const FfiConverterTypeBdkError = (() => {
1729
+ const intConverter = FfiConverterInt32;
1730
+ class FfiConverter extends AbstractFfiConverterByteArray {
1731
+ read(from) {
1732
+ switch (intConverter.read(from)) {
1733
+ case 1:
1734
+ return new BdkError.InvalidDescriptor(FfiConverterString.read(from));
1735
+ case 2:
1736
+ return new BdkError.WalletCreationFailed(FfiConverterString.read(from));
1737
+ case 3:
1738
+ return new BdkError.WalletLoadFailed(FfiConverterString.read(from));
1739
+ case 4:
1740
+ return new BdkError.WalletLoadMismatch(FfiConverterString.read(from));
1741
+ case 5:
1742
+ return new BdkError.PersistError(FfiConverterString.read(from));
1743
+ case 6:
1744
+ return new BdkError.InvalidAddress(FfiConverterString.read(from));
1745
+ case 7:
1746
+ return new BdkError.InvalidScript(FfiConverterString.read(from));
1747
+ case 8:
1748
+ return new BdkError.TransactionBuildFailed(FfiConverterString.read(from));
1749
+ case 9:
1750
+ return new BdkError.NoRecipients(FfiConverterString.read(from));
1751
+ case 10:
1752
+ return new BdkError.NoUtxosSelected(FfiConverterString.read(from));
1753
+ case 11:
1754
+ return new BdkError.OutputBelowDustLimit(FfiConverterString.read(from));
1755
+ case 12:
1756
+ return new BdkError.InsufficientFunds(FfiConverterString.read(from));
1757
+ case 13:
1758
+ return new BdkError.FeeRateTooLow(FfiConverterString.read(from));
1759
+ case 14:
1760
+ return new BdkError.FeeTooLow(FfiConverterString.read(from));
1761
+ case 15:
1762
+ return new BdkError.LockTimeConflict(FfiConverterString.read(from));
1763
+ case 16:
1764
+ return new BdkError.RbfSequenceConflict(FfiConverterString.read(from));
1765
+ case 17:
1766
+ return new BdkError.VersionZero(FfiConverterString.read(from));
1767
+ case 18:
1768
+ return new BdkError.VersionOneCsv(FfiConverterString.read(from));
1769
+ case 19:
1770
+ return new BdkError.SpendingPolicyRequired(FfiConverterString.read(from));
1771
+ case 20:
1772
+ return new BdkError.MissingKeyOrigin(FfiConverterString.read(from));
1773
+ case 21:
1774
+ return new BdkError.MissingNonWitnessUtxo(FfiConverterString.read(from));
1775
+ case 22:
1776
+ return new BdkError.OutpointNotFound(FfiConverterString.read(from));
1777
+ case 23:
1778
+ return new BdkError.FeeBumpTargetNotFound(FfiConverterString.read(from));
1779
+ case 24:
1780
+ return new BdkError.FeeBumpAlreadyConfirmed(FfiConverterString.read(from));
1781
+ case 25:
1782
+ return new BdkError.FeeBumpIrreplaceable(FfiConverterString.read(from));
1783
+ case 26:
1784
+ return new BdkError.FeeBumpFeeRateUnavailable(FfiConverterString.read(from));
1785
+ case 27:
1786
+ return new BdkError.FeeBumpInvalidOutputIndex(FfiConverterString.read(from));
1787
+ case 28:
1788
+ return new BdkError.InvalidPsbt(FfiConverterString.read(from));
1789
+ case 29:
1790
+ return new BdkError.SignFailed(FfiConverterString.read(from));
1791
+ case 30:
1792
+ return new BdkError.SignerMissingKey(FfiConverterString.read(from));
1793
+ case 31:
1794
+ return new BdkError.SignerInvalidKey(FfiConverterString.read(from));
1795
+ case 32:
1796
+ return new BdkError.SignerUserCanceled(FfiConverterString.read(from));
1797
+ case 33:
1798
+ return new BdkError.SignerInputIndexOutOfRange(FfiConverterString.read(from));
1799
+ case 34:
1800
+ return new BdkError.SignerMissingNonWitnessUtxo(FfiConverterString.read(from));
1801
+ case 35:
1802
+ return new BdkError.SignerMissingWitnessUtxo(FfiConverterString.read(from));
1803
+ case 36:
1804
+ return new BdkError.SignerMissingWitnessScript(FfiConverterString.read(from));
1805
+ case 37:
1806
+ return new BdkError.SignerNonStandardSighash(FfiConverterString.read(from));
1807
+ case 38:
1808
+ return new BdkError.SignerInvalidSighash(FfiConverterString.read(from));
1809
+ case 39:
1810
+ return new BdkError.SyncFailed(FfiConverterString.read(from));
1811
+ case 40:
1812
+ return new BdkError.BroadcastFailed(FfiConverterString.read(from));
1813
+ case 41:
1814
+ return new BdkError.InvalidTransaction(FfiConverterString.read(from));
1815
+ case 42:
1816
+ return new BdkError.TransactionNotFound(FfiConverterString.read(from));
1817
+ case 43:
1818
+ return new BdkError.CannotConnect(FfiConverterString.read(from));
1819
+ case 44:
1820
+ return new BdkError.CalculateFeeError(FfiConverterString.read(from));
1821
+ case 45:
1822
+ return new BdkError.InvalidMnemonic(FfiConverterString.read(from));
1823
+ case 46:
1824
+ return new BdkError.InvalidEntropy(FfiConverterString.read(from));
1825
+ case 47:
1826
+ return new BdkError.KeyError(FfiConverterString.read(from));
1827
+ case 48:
1828
+ return new BdkError.Generic(FfiConverterString.read(from));
1829
+ default:
1830
+ throw new UniffiInternalError.UnexpectedEnumCase();
1831
+ }
1832
+ }
1833
+ write(value, into) {
1834
+ const obj = value;
1835
+ const index = obj[variantOrdinalSymbol];
1836
+ intConverter.write(index, into);
1837
+ }
1838
+ allocationSize(value) {
1839
+ return intConverter.allocationSize(0);
1840
+ }
1841
+ }
1842
+ return new FfiConverter();
1843
+ })();
1844
+
1845
+ /**
1846
+ * Controls which UTXOs the wallet may spend as change inputs.
1847
+ */
1848
+ export let ChangeSpendPolicy = /*#__PURE__*/function (ChangeSpendPolicy) {
1849
+ /**
1850
+ * Both change and non-change outputs may be spent (default).
1851
+ */
1852
+ ChangeSpendPolicy[ChangeSpendPolicy["ChangeAllowed"] = 0] = "ChangeAllowed";
1853
+ /**
1854
+ * Only change outputs may be spent as inputs.
1855
+ */
1856
+ ChangeSpendPolicy[ChangeSpendPolicy["OnlyChange"] = 1] = "OnlyChange";
1857
+ /**
1858
+ * Only non-change outputs may be spent as inputs.
1859
+ */
1860
+ ChangeSpendPolicy[ChangeSpendPolicy["ChangeForbidden"] = 2] = "ChangeForbidden";
1861
+ return ChangeSpendPolicy;
1862
+ }({});
1863
+ const FfiConverterTypeChangeSpendPolicy = (() => {
1864
+ const ordinalConverter = FfiConverterInt32;
1865
+ class FFIConverter extends AbstractFfiConverterByteArray {
1866
+ read(from) {
1867
+ switch (ordinalConverter.read(from)) {
1868
+ case 1:
1869
+ return ChangeSpendPolicy.ChangeAllowed;
1870
+ case 2:
1871
+ return ChangeSpendPolicy.OnlyChange;
1872
+ case 3:
1873
+ return ChangeSpendPolicy.ChangeForbidden;
1874
+ default:
1875
+ throw new UniffiInternalError.UnexpectedEnumCase();
1876
+ }
1877
+ }
1878
+ write(value, into) {
1879
+ switch (value) {
1880
+ case ChangeSpendPolicy.ChangeAllowed:
1881
+ return ordinalConverter.write(1, into);
1882
+ case ChangeSpendPolicy.OnlyChange:
1883
+ return ordinalConverter.write(2, into);
1884
+ case ChangeSpendPolicy.ChangeForbidden:
1885
+ return ordinalConverter.write(3, into);
1886
+ }
1887
+ }
1888
+ allocationSize(value) {
1889
+ return ordinalConverter.allocationSize(0);
1890
+ }
1891
+ }
1892
+ return new FFIConverter();
1893
+ })();
1894
+
1895
+ /**
1896
+ * Standard BIP descriptor templates for generating wallet descriptors
1897
+ * from a mnemonic/xprv (also usable for xpub via create_public_descriptor).
1898
+ * Mirrors descriptor::template::{Bip44, Bip49, Bip84, Bip86}.
1899
+ */
1900
+ export let DescriptorTemplate = /*#__PURE__*/function (DescriptorTemplate) {
1901
+ /**
1902
+ * BIP44 — Legacy P2PKH (1…)
1903
+ */
1904
+ DescriptorTemplate[DescriptorTemplate["Bip44"] = 0] = "Bip44";
1905
+ /**
1906
+ * BIP49 — Nested SegWit P2SH-P2WPKH (3…)
1907
+ */
1908
+ DescriptorTemplate[DescriptorTemplate["Bip49"] = 1] = "Bip49";
1909
+ /**
1910
+ * BIP84 — Native SegWit P2WPKH (bc1q…)
1911
+ */
1912
+ DescriptorTemplate[DescriptorTemplate["Bip84"] = 2] = "Bip84";
1913
+ /**
1914
+ * BIP86 — Taproot P2TR (bc1p…)
1915
+ */
1916
+ DescriptorTemplate[DescriptorTemplate["Bip86"] = 3] = "Bip86";
1917
+ return DescriptorTemplate;
1918
+ }({});
1919
+ const FfiConverterTypeDescriptorTemplate = (() => {
1920
+ const ordinalConverter = FfiConverterInt32;
1921
+ class FFIConverter extends AbstractFfiConverterByteArray {
1922
+ read(from) {
1923
+ switch (ordinalConverter.read(from)) {
1924
+ case 1:
1925
+ return DescriptorTemplate.Bip44;
1926
+ case 2:
1927
+ return DescriptorTemplate.Bip49;
1928
+ case 3:
1929
+ return DescriptorTemplate.Bip84;
1930
+ case 4:
1931
+ return DescriptorTemplate.Bip86;
1932
+ default:
1933
+ throw new UniffiInternalError.UnexpectedEnumCase();
1934
+ }
1935
+ }
1936
+ write(value, into) {
1937
+ switch (value) {
1938
+ case DescriptorTemplate.Bip44:
1939
+ return ordinalConverter.write(1, into);
1940
+ case DescriptorTemplate.Bip49:
1941
+ return ordinalConverter.write(2, into);
1942
+ case DescriptorTemplate.Bip84:
1943
+ return ordinalConverter.write(3, into);
1944
+ case DescriptorTemplate.Bip86:
1945
+ return ordinalConverter.write(4, into);
1946
+ }
1947
+ }
1948
+ allocationSize(value) {
1949
+ return ordinalConverter.allocationSize(0);
1950
+ }
1951
+ }
1952
+ return new FFIConverter();
1953
+ })();
1954
+ export let KeychainKind = /*#__PURE__*/function (KeychainKind) {
1955
+ /**
1956
+ * External keychain — used for deriving recipient addresses.
1957
+ */
1958
+ KeychainKind[KeychainKind["External"] = 0] = "External";
1959
+ /**
1960
+ * Internal keychain — used for deriving change addresses.
1961
+ */
1962
+ KeychainKind[KeychainKind["Internal"] = 1] = "Internal";
1963
+ return KeychainKind;
1964
+ }({});
1965
+ const FfiConverterTypeKeychainKind = (() => {
1966
+ const ordinalConverter = FfiConverterInt32;
1967
+ class FFIConverter extends AbstractFfiConverterByteArray {
1968
+ read(from) {
1969
+ switch (ordinalConverter.read(from)) {
1970
+ case 1:
1971
+ return KeychainKind.External;
1972
+ case 2:
1973
+ return KeychainKind.Internal;
1974
+ default:
1975
+ throw new UniffiInternalError.UnexpectedEnumCase();
1976
+ }
1977
+ }
1978
+ write(value, into) {
1979
+ switch (value) {
1980
+ case KeychainKind.External:
1981
+ return ordinalConverter.write(1, into);
1982
+ case KeychainKind.Internal:
1983
+ return ordinalConverter.write(2, into);
1984
+ }
1985
+ }
1986
+ allocationSize(value) {
1987
+ return ordinalConverter.allocationSize(0);
1988
+ }
1989
+ }
1990
+ return new FFIConverter();
1991
+ })();
1992
+
1993
+ /**
1994
+ * BIP-39 mnemonic language. Mirrors bip39::Language.
1995
+ * Requires `all-languages` feature on the bip39 crate.
1996
+ */
1997
+ export let Language = /*#__PURE__*/function (Language) {
1998
+ Language[Language["English"] = 0] = "English";
1999
+ Language[Language["SimplifiedChinese"] = 1] = "SimplifiedChinese";
2000
+ Language[Language["TraditionalChinese"] = 2] = "TraditionalChinese";
2001
+ Language[Language["Czech"] = 3] = "Czech";
2002
+ Language[Language["French"] = 4] = "French";
2003
+ Language[Language["Italian"] = 5] = "Italian";
2004
+ Language[Language["Japanese"] = 6] = "Japanese";
2005
+ Language[Language["Korean"] = 7] = "Korean";
2006
+ Language[Language["Portuguese"] = 8] = "Portuguese";
2007
+ Language[Language["Spanish"] = 9] = "Spanish";
2008
+ return Language;
2009
+ }({});
2010
+ const FfiConverterTypeLanguage = (() => {
2011
+ const ordinalConverter = FfiConverterInt32;
2012
+ class FFIConverter extends AbstractFfiConverterByteArray {
2013
+ read(from) {
2014
+ switch (ordinalConverter.read(from)) {
2015
+ case 1:
2016
+ return Language.English;
2017
+ case 2:
2018
+ return Language.SimplifiedChinese;
2019
+ case 3:
2020
+ return Language.TraditionalChinese;
2021
+ case 4:
2022
+ return Language.Czech;
2023
+ case 5:
2024
+ return Language.French;
2025
+ case 6:
2026
+ return Language.Italian;
2027
+ case 7:
2028
+ return Language.Japanese;
2029
+ case 8:
2030
+ return Language.Korean;
2031
+ case 9:
2032
+ return Language.Portuguese;
2033
+ case 10:
2034
+ return Language.Spanish;
2035
+ default:
2036
+ throw new UniffiInternalError.UnexpectedEnumCase();
2037
+ }
2038
+ }
2039
+ write(value, into) {
2040
+ switch (value) {
2041
+ case Language.English:
2042
+ return ordinalConverter.write(1, into);
2043
+ case Language.SimplifiedChinese:
2044
+ return ordinalConverter.write(2, into);
2045
+ case Language.TraditionalChinese:
2046
+ return ordinalConverter.write(3, into);
2047
+ case Language.Czech:
2048
+ return ordinalConverter.write(4, into);
2049
+ case Language.French:
2050
+ return ordinalConverter.write(5, into);
2051
+ case Language.Italian:
2052
+ return ordinalConverter.write(6, into);
2053
+ case Language.Japanese:
2054
+ return ordinalConverter.write(7, into);
2055
+ case Language.Korean:
2056
+ return ordinalConverter.write(8, into);
2057
+ case Language.Portuguese:
2058
+ return ordinalConverter.write(9, into);
2059
+ case Language.Spanish:
2060
+ return ordinalConverter.write(10, into);
2061
+ }
2062
+ }
2063
+ allocationSize(value) {
2064
+ return ordinalConverter.allocationSize(0);
2065
+ }
2066
+ }
2067
+ return new FFIConverter();
2068
+ })();
2069
+ export let Network = /*#__PURE__*/function (Network) {
2070
+ Network[Network["Bitcoin"] = 0] = "Bitcoin";
2071
+ Network[Network["Testnet"] = 1] = "Testnet";
2072
+ Network[Network["Signet"] = 2] = "Signet";
2073
+ Network[Network["Regtest"] = 3] = "Regtest";
2074
+ return Network;
2075
+ }({});
2076
+ const FfiConverterTypeNetwork = (() => {
2077
+ const ordinalConverter = FfiConverterInt32;
2078
+ class FFIConverter extends AbstractFfiConverterByteArray {
2079
+ read(from) {
2080
+ switch (ordinalConverter.read(from)) {
2081
+ case 1:
2082
+ return Network.Bitcoin;
2083
+ case 2:
2084
+ return Network.Testnet;
2085
+ case 3:
2086
+ return Network.Signet;
2087
+ case 4:
2088
+ return Network.Regtest;
2089
+ default:
2090
+ throw new UniffiInternalError.UnexpectedEnumCase();
2091
+ }
2092
+ }
2093
+ write(value, into) {
2094
+ switch (value) {
2095
+ case Network.Bitcoin:
2096
+ return ordinalConverter.write(1, into);
2097
+ case Network.Testnet:
2098
+ return ordinalConverter.write(2, into);
2099
+ case Network.Signet:
2100
+ return ordinalConverter.write(3, into);
2101
+ case Network.Regtest:
2102
+ return ordinalConverter.write(4, into);
2103
+ }
2104
+ }
2105
+ allocationSize(value) {
2106
+ return ordinalConverter.allocationSize(0);
2107
+ }
2108
+ }
2109
+ return new FFIConverter();
2110
+ })();
2111
+
2112
+ /**
2113
+ * Single-key descriptor templates.
2114
+ * Mirrors descriptor::template::{P2Pkh, P2Wpkh, P2Wpkh_P2Sh, P2TR}.
2115
+ */
2116
+ export let SingleKeyDescriptorTemplate = /*#__PURE__*/function (SingleKeyDescriptorTemplate) {
2117
+ /**
2118
+ * Pay-to-PubKey-Hash — Legacy (1…)
2119
+ */
2120
+ SingleKeyDescriptorTemplate[SingleKeyDescriptorTemplate["P2Pkh"] = 0] = "P2Pkh";
2121
+ /**
2122
+ * Pay-to-Witness-PubKey-Hash — Native SegWit (bc1q…)
2123
+ */
2124
+ SingleKeyDescriptorTemplate[SingleKeyDescriptorTemplate["P2Wpkh"] = 1] = "P2Wpkh";
2125
+ /**
2126
+ * P2Wpkh wrapped in P2SH — Nested SegWit (3…)
2127
+ */
2128
+ SingleKeyDescriptorTemplate[SingleKeyDescriptorTemplate["P2WpkhP2Sh"] = 2] = "P2WpkhP2Sh";
2129
+ /**
2130
+ * Pay-to-Taproot (bc1p…)
2131
+ */
2132
+ SingleKeyDescriptorTemplate[SingleKeyDescriptorTemplate["P2tr"] = 3] = "P2tr";
2133
+ return SingleKeyDescriptorTemplate;
2134
+ }({});
2135
+ const FfiConverterTypeSingleKeyDescriptorTemplate = (() => {
2136
+ const ordinalConverter = FfiConverterInt32;
2137
+ class FFIConverter extends AbstractFfiConverterByteArray {
2138
+ read(from) {
2139
+ switch (ordinalConverter.read(from)) {
2140
+ case 1:
2141
+ return SingleKeyDescriptorTemplate.P2Pkh;
2142
+ case 2:
2143
+ return SingleKeyDescriptorTemplate.P2Wpkh;
2144
+ case 3:
2145
+ return SingleKeyDescriptorTemplate.P2WpkhP2Sh;
2146
+ case 4:
2147
+ return SingleKeyDescriptorTemplate.P2tr;
2148
+ default:
2149
+ throw new UniffiInternalError.UnexpectedEnumCase();
2150
+ }
2151
+ }
2152
+ write(value, into) {
2153
+ switch (value) {
2154
+ case SingleKeyDescriptorTemplate.P2Pkh:
2155
+ return ordinalConverter.write(1, into);
2156
+ case SingleKeyDescriptorTemplate.P2Wpkh:
2157
+ return ordinalConverter.write(2, into);
2158
+ case SingleKeyDescriptorTemplate.P2WpkhP2Sh:
2159
+ return ordinalConverter.write(3, into);
2160
+ case SingleKeyDescriptorTemplate.P2tr:
2161
+ return ordinalConverter.write(4, into);
2162
+ }
2163
+ }
2164
+ allocationSize(value) {
2165
+ return ordinalConverter.allocationSize(0);
2166
+ }
2167
+ }
2168
+ return new FFIConverter();
2169
+ })();
2170
+
2171
+ /**
2172
+ * Ordering applied to inputs and outputs when building a transaction.
2173
+ * Note: bdk_wallet also has a Custom variant (with closures) that cannot cross FFI.
2174
+ */
2175
+ export let TxOrdering = /*#__PURE__*/function (TxOrdering) {
2176
+ /**
2177
+ * Randomise input and output order (default, good for privacy).
2178
+ */
2179
+ TxOrdering[TxOrdering["Shuffle"] = 0] = "Shuffle";
2180
+ /**
2181
+ * Preserve insertion order of recipients and manually added UTXOs.
2182
+ */
2183
+ TxOrdering[TxOrdering["Untouched"] = 1] = "Untouched";
2184
+ return TxOrdering;
2185
+ }({});
2186
+ const FfiConverterTypeTxOrdering = (() => {
2187
+ const ordinalConverter = FfiConverterInt32;
2188
+ class FFIConverter extends AbstractFfiConverterByteArray {
2189
+ read(from) {
2190
+ switch (ordinalConverter.read(from)) {
2191
+ case 1:
2192
+ return TxOrdering.Shuffle;
2193
+ case 2:
2194
+ return TxOrdering.Untouched;
2195
+ default:
2196
+ throw new UniffiInternalError.UnexpectedEnumCase();
2197
+ }
2198
+ }
2199
+ write(value, into) {
2200
+ switch (value) {
2201
+ case TxOrdering.Shuffle:
2202
+ return ordinalConverter.write(1, into);
2203
+ case TxOrdering.Untouched:
2204
+ return ordinalConverter.write(2, into);
2205
+ }
2206
+ }
2207
+ allocationSize(value) {
2208
+ return ordinalConverter.allocationSize(0);
2209
+ }
2210
+ }
2211
+ return new FFIConverter();
2212
+ })();
2213
+
2214
+ // Enum: WalletEvent
2215
+ export let WalletEvent_Tags = /*#__PURE__*/function (WalletEvent_Tags) {
2216
+ WalletEvent_Tags["ChainTipChanged"] = "ChainTipChanged";
2217
+ WalletEvent_Tags["TxConfirmed"] = "TxConfirmed";
2218
+ WalletEvent_Tags["TxUnconfirmed"] = "TxUnconfirmed";
2219
+ WalletEvent_Tags["TxReplaced"] = "TxReplaced";
2220
+ WalletEvent_Tags["TxDropped"] = "TxDropped";
2221
+ return WalletEvent_Tags;
2222
+ }({});
2223
+ /**
2224
+ * Events emitted when applying chain updates to the wallet.
2225
+ * Mirrors bdk_wallet::event::WalletEvent (non-exhaustive in upstream).
2226
+ */
2227
+ export const WalletEvent = (() => {
2228
+ /**
2229
+ * The local chain tip has changed.
2230
+ */
2231
+ class ChainTipChanged_ extends UniffiEnum {
2232
+ /**
2233
+ * @private
2234
+ * This field is private and should not be used, use `tag` instead.
2235
+ */
2236
+ [uniffiTypeNameSymbol] = "WalletEvent";
2237
+ tag = WalletEvent_Tags.ChainTipChanged;
2238
+ constructor(inner) {
2239
+ super("WalletEvent", "ChainTipChanged");
2240
+ this.inner = Object.freeze(inner);
2241
+ }
2242
+ static new(inner) {
2243
+ return new ChainTipChanged_(inner);
2244
+ }
2245
+ static instanceOf(obj) {
2246
+ return obj.tag === WalletEvent_Tags.ChainTipChanged;
2247
+ }
2248
+ }
2249
+ /**
2250
+ * A transaction has been confirmed.
2251
+ */
2252
+ class TxConfirmed_ extends UniffiEnum {
2253
+ /**
2254
+ * @private
2255
+ * This field is private and should not be used, use `tag` instead.
2256
+ */
2257
+ [uniffiTypeNameSymbol] = "WalletEvent";
2258
+ tag = WalletEvent_Tags.TxConfirmed;
2259
+ constructor(inner) {
2260
+ super("WalletEvent", "TxConfirmed");
2261
+ this.inner = Object.freeze(inner);
2262
+ }
2263
+ static new(inner) {
2264
+ return new TxConfirmed_(inner);
2265
+ }
2266
+ static instanceOf(obj) {
2267
+ return obj.tag === WalletEvent_Tags.TxConfirmed;
2268
+ }
2269
+ }
2270
+ /**
2271
+ * A previously confirmed transaction has been unconfirmed (reorg).
2272
+ */
2273
+ class TxUnconfirmed_ extends UniffiEnum {
2274
+ /**
2275
+ * @private
2276
+ * This field is private and should not be used, use `tag` instead.
2277
+ */
2278
+ [uniffiTypeNameSymbol] = "WalletEvent";
2279
+ tag = WalletEvent_Tags.TxUnconfirmed;
2280
+ constructor(inner) {
2281
+ super("WalletEvent", "TxUnconfirmed");
2282
+ this.inner = Object.freeze(inner);
2283
+ }
2284
+ static new(inner) {
2285
+ return new TxUnconfirmed_(inner);
2286
+ }
2287
+ static instanceOf(obj) {
2288
+ return obj.tag === WalletEvent_Tags.TxUnconfirmed;
2289
+ }
2290
+ }
2291
+ /**
2292
+ * A transaction has been replaced (RBF or conflict).
2293
+ */
2294
+ class TxReplaced_ extends UniffiEnum {
2295
+ /**
2296
+ * @private
2297
+ * This field is private and should not be used, use `tag` instead.
2298
+ */
2299
+ [uniffiTypeNameSymbol] = "WalletEvent";
2300
+ tag = WalletEvent_Tags.TxReplaced;
2301
+ constructor(inner) {
2302
+ super("WalletEvent", "TxReplaced");
2303
+ this.inner = Object.freeze(inner);
2304
+ }
2305
+ static new(inner) {
2306
+ return new TxReplaced_(inner);
2307
+ }
2308
+ static instanceOf(obj) {
2309
+ return obj.tag === WalletEvent_Tags.TxReplaced;
2310
+ }
2311
+ }
2312
+ /**
2313
+ * A transaction has been dropped from the mempool / evicted.
2314
+ */
2315
+ class TxDropped_ extends UniffiEnum {
2316
+ /**
2317
+ * @private
2318
+ * This field is private and should not be used, use `tag` instead.
2319
+ */
2320
+ [uniffiTypeNameSymbol] = "WalletEvent";
2321
+ tag = WalletEvent_Tags.TxDropped;
2322
+ constructor(inner) {
2323
+ super("WalletEvent", "TxDropped");
2324
+ this.inner = Object.freeze(inner);
2325
+ }
2326
+ static new(inner) {
2327
+ return new TxDropped_(inner);
2328
+ }
2329
+ static instanceOf(obj) {
2330
+ return obj.tag === WalletEvent_Tags.TxDropped;
2331
+ }
2332
+ }
2333
+ function instanceOf(obj) {
2334
+ return obj[uniffiTypeNameSymbol] === "WalletEvent";
2335
+ }
2336
+ return Object.freeze({
2337
+ instanceOf,
2338
+ ChainTipChanged: ChainTipChanged_,
2339
+ TxConfirmed: TxConfirmed_,
2340
+ TxUnconfirmed: TxUnconfirmed_,
2341
+ TxReplaced: TxReplaced_,
2342
+ TxDropped: TxDropped_
2343
+ });
2344
+ })();
2345
+
2346
+ /**
2347
+ * Events emitted when applying chain updates to the wallet.
2348
+ * Mirrors bdk_wallet::event::WalletEvent (non-exhaustive in upstream).
2349
+ */
2350
+
2351
+ // FfiConverter for enum WalletEvent
2352
+ const FfiConverterTypeWalletEvent = (() => {
2353
+ const ordinalConverter = FfiConverterInt32;
2354
+ class FFIConverter extends AbstractFfiConverterByteArray {
2355
+ read(from) {
2356
+ switch (ordinalConverter.read(from)) {
2357
+ case 1:
2358
+ return new WalletEvent.ChainTipChanged({
2359
+ oldTip: FfiConverterTypeBlockId.read(from),
2360
+ newTip: FfiConverterTypeBlockId.read(from)
2361
+ });
2362
+ case 2:
2363
+ return new WalletEvent.TxConfirmed({
2364
+ txid: FfiConverterString.read(from),
2365
+ blockTime: FfiConverterTypeConfirmationBlockTime.read(from)
2366
+ });
2367
+ case 3:
2368
+ return new WalletEvent.TxUnconfirmed({
2369
+ txid: FfiConverterString.read(from)
2370
+ });
2371
+ case 4:
2372
+ return new WalletEvent.TxReplaced({
2373
+ txid: FfiConverterString.read(from),
2374
+ conflictingTxids: FfiConverterArrayString.read(from)
2375
+ });
2376
+ case 5:
2377
+ return new WalletEvent.TxDropped({
2378
+ txid: FfiConverterString.read(from)
2379
+ });
2380
+ default:
2381
+ throw new UniffiInternalError.UnexpectedEnumCase();
2382
+ }
2383
+ }
2384
+ write(value, into) {
2385
+ switch (value.tag) {
2386
+ case WalletEvent_Tags.ChainTipChanged:
2387
+ {
2388
+ ordinalConverter.write(1, into);
2389
+ const inner = value.inner;
2390
+ FfiConverterTypeBlockId.write(inner.oldTip, into);
2391
+ FfiConverterTypeBlockId.write(inner.newTip, into);
2392
+ return;
2393
+ }
2394
+ case WalletEvent_Tags.TxConfirmed:
2395
+ {
2396
+ ordinalConverter.write(2, into);
2397
+ const inner = value.inner;
2398
+ FfiConverterString.write(inner.txid, into);
2399
+ FfiConverterTypeConfirmationBlockTime.write(inner.blockTime, into);
2400
+ return;
2401
+ }
2402
+ case WalletEvent_Tags.TxUnconfirmed:
2403
+ {
2404
+ ordinalConverter.write(3, into);
2405
+ const inner = value.inner;
2406
+ FfiConverterString.write(inner.txid, into);
2407
+ return;
2408
+ }
2409
+ case WalletEvent_Tags.TxReplaced:
2410
+ {
2411
+ ordinalConverter.write(4, into);
2412
+ const inner = value.inner;
2413
+ FfiConverterString.write(inner.txid, into);
2414
+ FfiConverterArrayString.write(inner.conflictingTxids, into);
2415
+ return;
2416
+ }
2417
+ case WalletEvent_Tags.TxDropped:
2418
+ {
2419
+ ordinalConverter.write(5, into);
2420
+ const inner = value.inner;
2421
+ FfiConverterString.write(inner.txid, into);
2422
+ return;
2423
+ }
2424
+ default:
2425
+ // Throwing from here means that WalletEvent_Tags hasn't matched an ordinal.
2426
+ throw new UniffiInternalError.UnexpectedEnumCase();
2427
+ }
2428
+ }
2429
+ allocationSize(value) {
2430
+ switch (value.tag) {
2431
+ case WalletEvent_Tags.ChainTipChanged:
2432
+ {
2433
+ const inner = value.inner;
2434
+ let size = ordinalConverter.allocationSize(1);
2435
+ size += FfiConverterTypeBlockId.allocationSize(inner.oldTip);
2436
+ size += FfiConverterTypeBlockId.allocationSize(inner.newTip);
2437
+ return size;
2438
+ }
2439
+ case WalletEvent_Tags.TxConfirmed:
2440
+ {
2441
+ const inner = value.inner;
2442
+ let size = ordinalConverter.allocationSize(2);
2443
+ size += FfiConverterString.allocationSize(inner.txid);
2444
+ size += FfiConverterTypeConfirmationBlockTime.allocationSize(inner.blockTime);
2445
+ return size;
2446
+ }
2447
+ case WalletEvent_Tags.TxUnconfirmed:
2448
+ {
2449
+ const inner = value.inner;
2450
+ let size = ordinalConverter.allocationSize(3);
2451
+ size += FfiConverterString.allocationSize(inner.txid);
2452
+ return size;
2453
+ }
2454
+ case WalletEvent_Tags.TxReplaced:
2455
+ {
2456
+ const inner = value.inner;
2457
+ let size = ordinalConverter.allocationSize(4);
2458
+ size += FfiConverterString.allocationSize(inner.txid);
2459
+ size += FfiConverterArrayString.allocationSize(inner.conflictingTxids);
2460
+ return size;
2461
+ }
2462
+ case WalletEvent_Tags.TxDropped:
2463
+ {
2464
+ const inner = value.inner;
2465
+ let size = ordinalConverter.allocationSize(5);
2466
+ size += FfiConverterString.allocationSize(inner.txid);
2467
+ return size;
2468
+ }
2469
+ default:
2470
+ throw new UniffiInternalError.UnexpectedEnumCase();
2471
+ }
2472
+ }
2473
+ }
2474
+ return new FFIConverter();
2475
+ })();
2476
+
2477
+ /**
2478
+ * BIP-39 mnemonic word count (determines entropy length).
2479
+ */
2480
+ export let WordCount = /*#__PURE__*/function (WordCount) {
2481
+ WordCount[WordCount["Words12"] = 0] = "Words12";
2482
+ WordCount[WordCount["Words15"] = 1] = "Words15";
2483
+ WordCount[WordCount["Words18"] = 2] = "Words18";
2484
+ WordCount[WordCount["Words21"] = 3] = "Words21";
2485
+ WordCount[WordCount["Words24"] = 4] = "Words24";
2486
+ return WordCount;
2487
+ }({});
2488
+ const FfiConverterTypeWordCount = (() => {
2489
+ const ordinalConverter = FfiConverterInt32;
2490
+ class FFIConverter extends AbstractFfiConverterByteArray {
2491
+ read(from) {
2492
+ switch (ordinalConverter.read(from)) {
2493
+ case 1:
2494
+ return WordCount.Words12;
2495
+ case 2:
2496
+ return WordCount.Words15;
2497
+ case 3:
2498
+ return WordCount.Words18;
2499
+ case 4:
2500
+ return WordCount.Words21;
2501
+ case 5:
2502
+ return WordCount.Words24;
2503
+ default:
2504
+ throw new UniffiInternalError.UnexpectedEnumCase();
2505
+ }
2506
+ }
2507
+ write(value, into) {
2508
+ switch (value) {
2509
+ case WordCount.Words12:
2510
+ return ordinalConverter.write(1, into);
2511
+ case WordCount.Words15:
2512
+ return ordinalConverter.write(2, into);
2513
+ case WordCount.Words18:
2514
+ return ordinalConverter.write(3, into);
2515
+ case WordCount.Words21:
2516
+ return ordinalConverter.write(4, into);
2517
+ case WordCount.Words24:
2518
+ return ordinalConverter.write(5, into);
2519
+ }
2520
+ }
2521
+ allocationSize(value) {
2522
+ return ordinalConverter.allocationSize(0);
2523
+ }
2524
+ }
2525
+ return new FFIConverter();
2526
+ })();
2527
+
2528
+ /**
2529
+ * BIP-39 mnemonic phrase for key generation.
2530
+ * Backed by bdk_wallet::keys::bip39::Mnemonic (requires `keys-bip39` feature).
2531
+ */
2532
+
2533
+ /**
2534
+ * BIP-39 mnemonic phrase for key generation.
2535
+ * Backed by bdk_wallet::keys::bip39::Mnemonic (requires `keys-bip39` feature).
2536
+ */
2537
+ export class Mnemonic extends UniffiAbstractObject {
2538
+ [uniffiTypeNameSymbol] = "Mnemonic";
2539
+ /**
2540
+ * Generate a new random mnemonic with the given word count (English).
2541
+ */
2542
+ constructor(wordCount) /*throws*/{
2543
+ super();
2544
+ const pointer = uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
2545
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_constructor_mnemonic_new(FfiConverterTypeWordCount.lower(wordCount), callStatus);
2546
+ }, /*liftString:*/FfiConverterString.lift);
2547
+ this[pointerLiteralSymbol] = pointer;
2548
+ this[destructorGuardSymbol] = uniffiTypeMnemonicObjectFactory.bless(pointer);
2549
+ }
2550
+
2551
+ /**
2552
+ * Create a mnemonic from raw entropy bytes (16–32 bytes).
2553
+ */
2554
+ static fromEntropy(entropy) /*throws*/{
2555
+ return FfiConverterTypeMnemonic.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
2556
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_constructor_mnemonic_from_entropy(FfiConverterArrayUInt8.lower(entropy), callStatus);
2557
+ }, /*liftString:*/FfiConverterString.lift));
2558
+ }
2559
+
2560
+ /**
2561
+ * Create a mnemonic from raw entropy bytes in a specific language.
2562
+ */
2563
+ static fromEntropyIn(entropy, language) /*throws*/{
2564
+ return FfiConverterTypeMnemonic.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
2565
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_constructor_mnemonic_from_entropy_in(FfiConverterArrayUInt8.lower(entropy), FfiConverterTypeLanguage.lower(language), callStatus);
2566
+ }, /*liftString:*/FfiConverterString.lift));
2567
+ }
2568
+
2569
+ /**
2570
+ * Parse an existing mnemonic string (auto-detects language).
2571
+ */
2572
+ static fromString(mnemonic) /*throws*/{
2573
+ return FfiConverterTypeMnemonic.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
2574
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_constructor_mnemonic_from_string(FfiConverterString.lower(mnemonic), callStatus);
2575
+ }, /*liftString:*/FfiConverterString.lift));
2576
+ }
2577
+
2578
+ /**
2579
+ * Parse a mnemonic string in a specific language.
2580
+ */
2581
+ static fromStringIn(mnemonic, language) /*throws*/{
2582
+ return FfiConverterTypeMnemonic.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
2583
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_constructor_mnemonic_from_string_in(FfiConverterString.lower(mnemonic), FfiConverterTypeLanguage.lower(language), callStatus);
2584
+ }, /*liftString:*/FfiConverterString.lift));
2585
+ }
2586
+
2587
+ /**
2588
+ * The language of this mnemonic.
2589
+ */
2590
+ language() {
2591
+ return FfiConverterTypeLanguage.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
2592
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_mnemonic_language(uniffiTypeMnemonicObjectFactory.clonePointer(this), callStatus);
2593
+ }, /*liftString:*/FfiConverterString.lift));
2594
+ }
2595
+
2596
+ /**
2597
+ * Derive the 64-byte seed as hex. Pass an empty string for no passphrase.
2598
+ */
2599
+ toSeedHex(passphrase) {
2600
+ return FfiConverterString.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
2601
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_mnemonic_to_seed_hex(uniffiTypeMnemonicObjectFactory.clonePointer(this), FfiConverterString.lower(passphrase), callStatus);
2602
+ }, /*liftString:*/FfiConverterString.lift));
2603
+ }
2604
+
2605
+ /**
2606
+ * The mnemonic as a space-separated word string.
2607
+ */
2608
+ toString() {
2609
+ return FfiConverterString.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
2610
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_mnemonic_to_string(uniffiTypeMnemonicObjectFactory.clonePointer(this), callStatus);
2611
+ }, /*liftString:*/FfiConverterString.lift));
2612
+ }
2613
+
2614
+ /**
2615
+ * Number of words (12, 15, 18, 21, or 24).
2616
+ */
2617
+ wordCount() {
2618
+ return FfiConverterUInt32.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
2619
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_mnemonic_word_count(uniffiTypeMnemonicObjectFactory.clonePointer(this), callStatus);
2620
+ }, /*liftString:*/FfiConverterString.lift));
2621
+ }
2622
+
2623
+ /**
2624
+ * List the individual words.
2625
+ */
2626
+ words() {
2627
+ return FfiConverterArrayString.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
2628
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_mnemonic_words(uniffiTypeMnemonicObjectFactory.clonePointer(this), callStatus);
2629
+ }, /*liftString:*/FfiConverterString.lift));
2630
+ }
2631
+
2632
+ /**
2633
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
2634
+ */
2635
+ uniffiDestroy() {
2636
+ const ptr = this[destructorGuardSymbol];
2637
+ if (ptr !== undefined) {
2638
+ const pointer = uniffiTypeMnemonicObjectFactory.pointer(this);
2639
+ uniffiTypeMnemonicObjectFactory.freePointer(pointer);
2640
+ uniffiTypeMnemonicObjectFactory.unbless(ptr);
2641
+ delete this[destructorGuardSymbol];
2642
+ }
2643
+ }
2644
+ static instanceOf(obj) {
2645
+ return uniffiTypeMnemonicObjectFactory.isConcreteType(obj);
2646
+ }
2647
+ }
2648
+ const uniffiTypeMnemonicObjectFactory = (() => {
2649
+ return {
2650
+ create(pointer) {
2651
+ const instance = Object.create(Mnemonic.prototype);
2652
+ instance[pointerLiteralSymbol] = pointer;
2653
+ instance[destructorGuardSymbol] = this.bless(pointer);
2654
+ instance[uniffiTypeNameSymbol] = "Mnemonic";
2655
+ return instance;
2656
+ },
2657
+ bless(p) {
2658
+ return uniffiCaller.rustCall(/*caller:*/status => nativeModule().ubrn_uniffi_internal_fn_method_mnemonic_ffi__bless_pointer(p, status), /*liftString:*/FfiConverterString.lift);
2659
+ },
2660
+ unbless(ptr) {
2661
+ ptr.markDestroyed();
2662
+ },
2663
+ pointer(obj) {
2664
+ if (obj[destructorGuardSymbol] === undefined) {
2665
+ throw new UniffiInternalError.UnexpectedNullPointer();
2666
+ }
2667
+ return obj[pointerLiteralSymbol];
2668
+ },
2669
+ clonePointer(obj) {
2670
+ const pointer = this.pointer(obj);
2671
+ return uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_bdk_ffi_fn_clone_mnemonic(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
2672
+ },
2673
+ freePointer(pointer) {
2674
+ uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_bdk_ffi_fn_free_mnemonic(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
2675
+ },
2676
+ isConcreteType(obj) {
2677
+ return obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === "Mnemonic";
2678
+ }
2679
+ };
2680
+ })();
2681
+ // FfiConverter for MnemonicInterface
2682
+ const FfiConverterTypeMnemonic = new FfiConverterObject(uniffiTypeMnemonicObjectFactory);
2683
+
2684
+ /**
2685
+ * A Partially Signed Bitcoin Transaction (BIP-174 / BIP-370).
2686
+ * Mirrors bitcoin::Psbt with added PsbtUtils trait methods.
2687
+ */
2688
+
2689
+ /**
2690
+ * A Partially Signed Bitcoin Transaction (BIP-174 / BIP-370).
2691
+ * Mirrors bitcoin::Psbt with added PsbtUtils trait methods.
2692
+ */
2693
+ export class Psbt extends UniffiAbstractObject {
2694
+ [uniffiTypeNameSymbol] = "Psbt";
2695
+ /**
2696
+ * Deserialize from a base64-encoded string.
2697
+ */
2698
+ constructor(psbtBase64) /*throws*/{
2699
+ super();
2700
+ const pointer = uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
2701
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_constructor_psbt_new(FfiConverterString.lower(psbtBase64), callStatus);
2702
+ }, /*liftString:*/FfiConverterString.lift);
2703
+ this[pointerLiteralSymbol] = pointer;
2704
+ this[destructorGuardSymbol] = uniffiTypePsbtObjectFactory.bless(pointer);
2705
+ }
2706
+
2707
+ /**
2708
+ * Extract the fully-signed transaction as raw hex.
2709
+ * Only valid after all inputs are finalized.
2710
+ */
2711
+ extractTxHex() /*throws*/{
2712
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
2713
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_psbt_extract_tx_hex(uniffiTypePsbtObjectFactory.clonePointer(this), callStatus);
2714
+ }, /*liftString:*/FfiConverterString.lift));
2715
+ }
2716
+
2717
+ /**
2718
+ * Total fee in satoshis. None if any input UTXO value is unknown.
2719
+ * From PsbtUtils::fee_amount().
2720
+ */
2721
+ feeAmount() {
2722
+ return FfiConverterOptionalUInt64.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
2723
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_psbt_fee_amount(uniffiTypePsbtObjectFactory.clonePointer(this), callStatus);
2724
+ }, /*liftString:*/FfiConverterString.lift));
2725
+ }
2726
+
2727
+ /**
2728
+ * Fee rate in sat/vbyte. None if any input UTXO value is unknown.
2729
+ * From PsbtUtils::fee_rate().
2730
+ */
2731
+ feeRate() {
2732
+ return FfiConverterOptionalFloat64.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
2733
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_psbt_fee_rate(uniffiTypePsbtObjectFactory.clonePointer(this), callStatus);
2734
+ }, /*liftString:*/FfiConverterString.lift));
2735
+ }
2736
+
2737
+ /**
2738
+ * Retrieve the UTXO for a given input index. Returns None if unavailable.
2739
+ * From PsbtUtils::get_utxo_for().
2740
+ */
2741
+ getUtxoFor(inputIndex) {
2742
+ return FfiConverterOptionalTypeTxOut.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
2743
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_psbt_get_utxo_for(uniffiTypePsbtObjectFactory.clonePointer(this), FfiConverterUInt64.lower(inputIndex), callStatus);
2744
+ }, /*liftString:*/FfiConverterString.lift));
2745
+ }
2746
+
2747
+ /**
2748
+ * Serialize to a base64-encoded string.
2749
+ */
2750
+ toBase64() {
2751
+ return FfiConverterString.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
2752
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_psbt_to_base64(uniffiTypePsbtObjectFactory.clonePointer(this), callStatus);
2753
+ }, /*liftString:*/FfiConverterString.lift));
2754
+ }
2755
+
2756
+ /**
2757
+ * The unsigned txid (available before finalization).
2758
+ */
2759
+ txid() /*throws*/{
2760
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
2761
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_psbt_txid(uniffiTypePsbtObjectFactory.clonePointer(this), callStatus);
2762
+ }, /*liftString:*/FfiConverterString.lift));
2763
+ }
2764
+
2765
+ /**
2766
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
2767
+ */
2768
+ uniffiDestroy() {
2769
+ const ptr = this[destructorGuardSymbol];
2770
+ if (ptr !== undefined) {
2771
+ const pointer = uniffiTypePsbtObjectFactory.pointer(this);
2772
+ uniffiTypePsbtObjectFactory.freePointer(pointer);
2773
+ uniffiTypePsbtObjectFactory.unbless(ptr);
2774
+ delete this[destructorGuardSymbol];
2775
+ }
2776
+ }
2777
+ static instanceOf(obj) {
2778
+ return uniffiTypePsbtObjectFactory.isConcreteType(obj);
2779
+ }
2780
+ }
2781
+ const uniffiTypePsbtObjectFactory = (() => {
2782
+ return {
2783
+ create(pointer) {
2784
+ const instance = Object.create(Psbt.prototype);
2785
+ instance[pointerLiteralSymbol] = pointer;
2786
+ instance[destructorGuardSymbol] = this.bless(pointer);
2787
+ instance[uniffiTypeNameSymbol] = "Psbt";
2788
+ return instance;
2789
+ },
2790
+ bless(p) {
2791
+ return uniffiCaller.rustCall(/*caller:*/status => nativeModule().ubrn_uniffi_internal_fn_method_psbt_ffi__bless_pointer(p, status), /*liftString:*/FfiConverterString.lift);
2792
+ },
2793
+ unbless(ptr) {
2794
+ ptr.markDestroyed();
2795
+ },
2796
+ pointer(obj) {
2797
+ if (obj[destructorGuardSymbol] === undefined) {
2798
+ throw new UniffiInternalError.UnexpectedNullPointer();
2799
+ }
2800
+ return obj[pointerLiteralSymbol];
2801
+ },
2802
+ clonePointer(obj) {
2803
+ const pointer = this.pointer(obj);
2804
+ return uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_bdk_ffi_fn_clone_psbt(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
2805
+ },
2806
+ freePointer(pointer) {
2807
+ uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_bdk_ffi_fn_free_psbt(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
2808
+ },
2809
+ isConcreteType(obj) {
2810
+ return obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === "Psbt";
2811
+ }
2812
+ };
2813
+ })();
2814
+ // FfiConverter for PsbtInterface
2815
+ const FfiConverterTypePsbt = new FfiConverterObject(uniffiTypePsbtObjectFactory);
2816
+
2817
+ /**
2818
+ * Fluent builder for constructing Bitcoin transactions.
2819
+ * Create one, configure it, then call finish(wallet) to produce a PSBT.
2820
+ * Mirrors bdk_wallet::TxBuilder (without lifetime / generic coin selection).
2821
+ */
2822
+
2823
+ /**
2824
+ * Fluent builder for constructing Bitcoin transactions.
2825
+ * Create one, configure it, then call finish(wallet) to produce a PSBT.
2826
+ * Mirrors bdk_wallet::TxBuilder (without lifetime / generic coin selection).
2827
+ */
2828
+ export class TxBuilder extends UniffiAbstractObject {
2829
+ [uniffiTypeNameSymbol] = "TxBuilder";
2830
+ constructor() {
2831
+ super();
2832
+ const pointer = uniffiCaller.rustCall(/*caller:*/callStatus => {
2833
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_constructor_txbuilder_new(callStatus);
2834
+ }, /*liftString:*/FfiConverterString.lift);
2835
+ this[pointerLiteralSymbol] = pointer;
2836
+ this[destructorGuardSymbol] = uniffiTypeTxBuilderObjectFactory.bless(pointer);
2837
+ }
2838
+
2839
+ /**
2840
+ * Attach OP_RETURN data to the transaction.
2841
+ */
2842
+ addData(data) {
2843
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
2844
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_add_data(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterArrayUInt8.lower(data), callStatus);
2845
+ }, /*liftString:*/FfiConverterString.lift);
2846
+ }
2847
+
2848
+ /**
2849
+ * Include BIP-32 global xpubs in the PSBT.
2850
+ */
2851
+ addGlobalXpubs() {
2852
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
2853
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_add_global_xpubs(uniffiTypeTxBuilderObjectFactory.clonePointer(this), callStatus);
2854
+ }, /*liftString:*/FfiConverterString.lift);
2855
+ }
2856
+
2857
+ /**
2858
+ * Add a single recipient (address + amount).
2859
+ */
2860
+ addRecipient(address, amountSats) {
2861
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
2862
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_add_recipient(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterString.lower(address), FfiConverterUInt64.lower(amountSats), callStatus);
2863
+ }, /*liftString:*/FfiConverterString.lift);
2864
+ }
2865
+
2866
+ /**
2867
+ * Mark a single UTXO as unspendable.
2868
+ */
2869
+ addUnspendable(outpoint) {
2870
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
2871
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_add_unspendable(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterTypeOutPoint.lower(outpoint), callStatus);
2872
+ }, /*liftString:*/FfiConverterString.lift);
2873
+ }
2874
+
2875
+ /**
2876
+ * Add a specific UTXO to spend.
2877
+ */
2878
+ addUtxo(outpoint) /*throws*/{
2879
+ uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
2880
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_add_utxo(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterTypeOutPoint.lower(outpoint), callStatus);
2881
+ }, /*liftString:*/FfiConverterString.lift);
2882
+ }
2883
+
2884
+ /**
2885
+ * Add multiple specific UTXOs to spend.
2886
+ */
2887
+ addUtxos(outpoints) /*throws*/{
2888
+ uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
2889
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_add_utxos(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterArrayTypeOutPoint.lower(outpoints), callStatus);
2890
+ }, /*liftString:*/FfiConverterString.lift);
2891
+ }
2892
+
2893
+ /**
2894
+ * Allow outputs below the dust threshold.
2895
+ */
2896
+ allowDust(allow) {
2897
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
2898
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_allow_dust(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterBool.lower(allow), callStatus);
2899
+ }, /*liftString:*/FfiConverterString.lift);
2900
+ }
2901
+
2902
+ /**
2903
+ * Set the change spend policy explicitly.
2904
+ */
2905
+ changePolicy(policy) {
2906
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
2907
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_change_policy(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterTypeChangeSpendPolicy.lower(policy), callStatus);
2908
+ }, /*liftString:*/FfiConverterString.lift);
2909
+ }
2910
+
2911
+ /**
2912
+ * Set the assumed current block height (for relative timelock evaluation).
2913
+ */
2914
+ currentHeight(height) {
2915
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
2916
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_current_height(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterUInt32.lower(height), callStatus);
2917
+ }, /*liftString:*/FfiConverterString.lift);
2918
+ }
2919
+
2920
+ /**
2921
+ * Forbid spending from change outputs.
2922
+ */
2923
+ doNotSpendChange() {
2924
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
2925
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_do_not_spend_change(uniffiTypeTxBuilderObjectFactory.clonePointer(this), callStatus);
2926
+ }, /*liftString:*/FfiConverterString.lift);
2927
+ }
2928
+
2929
+ /**
2930
+ * Set the script to receive the remaining change (use with drain_wallet).
2931
+ */
2932
+ drainTo(address) /*throws*/{
2933
+ uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
2934
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_drain_to(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterString.lower(address), callStatus);
2935
+ }, /*liftString:*/FfiConverterString.lift);
2936
+ }
2937
+
2938
+ /**
2939
+ * Spend all spendable UTXOs (send remaining to the drain_to address).
2940
+ */
2941
+ drainWallet() {
2942
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
2943
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_drain_wallet(uniffiTypeTxBuilderObjectFactory.clonePointer(this), callStatus);
2944
+ }, /*liftString:*/FfiConverterString.lift);
2945
+ }
2946
+
2947
+ /**
2948
+ * Enable RBF signalling with the default nSequence (0xFFFFFFFD).
2949
+ */
2950
+ enableRbf() {
2951
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
2952
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_enable_rbf(uniffiTypeTxBuilderObjectFactory.clonePointer(this), callStatus);
2953
+ }, /*liftString:*/FfiConverterString.lift);
2954
+ }
2955
+
2956
+ /**
2957
+ * Enable RBF signalling with a specific nSequence value (must be < 0xFFFFFFFE).
2958
+ */
2959
+ enableRbfWithSequence(nsequence) {
2960
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
2961
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_enable_rbf_with_sequence(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterUInt32.lower(nsequence), callStatus);
2962
+ }, /*liftString:*/FfiConverterString.lift);
2963
+ }
2964
+
2965
+ /**
2966
+ * Exclude UTXOs with fewer than min_confirms confirmations.
2967
+ */
2968
+ excludeBelowConfirmations(minConfirms) {
2969
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
2970
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_exclude_below_confirmations(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterUInt32.lower(minConfirms), callStatus);
2971
+ }, /*liftString:*/FfiConverterString.lift);
2972
+ }
2973
+
2974
+ /**
2975
+ * Exclude all unconfirmed UTXOs.
2976
+ */
2977
+ excludeUnconfirmed() {
2978
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
2979
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_exclude_unconfirmed(uniffiTypeTxBuilderObjectFactory.clonePointer(this), callStatus);
2980
+ }, /*liftString:*/FfiConverterString.lift);
2981
+ }
2982
+
2983
+ /**
2984
+ * Set an absolute fee in satoshis (overrides fee_rate).
2985
+ */
2986
+ feeAbsolute(feeSats) {
2987
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
2988
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_fee_absolute(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterUInt64.lower(feeSats), callStatus);
2989
+ }, /*liftString:*/FfiConverterString.lift);
2990
+ }
2991
+
2992
+ /**
2993
+ * Set a fee rate target in sat/vbyte.
2994
+ */
2995
+ feeRate(satPerVbyte) {
2996
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
2997
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_fee_rate(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterFloat64.lower(satPerVbyte), callStatus);
2998
+ }, /*liftString:*/FfiConverterString.lift);
2999
+ }
3000
+
3001
+ /**
3002
+ * Build the transaction into a PSBT. The wallet is used for coin
3003
+ * selection and script resolution — the PSBT is NOT signed here.
3004
+ */
3005
+ finish(wallet) /*throws*/{
3006
+ return FfiConverterTypePsbt.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3007
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_finish(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterTypeWallet.lower(wallet), callStatus);
3008
+ }, /*liftString:*/FfiConverterString.lift));
3009
+ }
3010
+
3011
+ /**
3012
+ * Include the redeemScript / witnessScript in PSBT outputs.
3013
+ */
3014
+ includeOutputRedeemWitnessScript() {
3015
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
3016
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_include_output_redeem_witness_script(uniffiTypeTxBuilderObjectFactory.clonePointer(this), callStatus);
3017
+ }, /*liftString:*/FfiConverterString.lift);
3018
+ }
3019
+
3020
+ /**
3021
+ * Only use the UTXOs explicitly added with add_utxo / add_utxos.
3022
+ */
3023
+ manuallySelectedOnly() {
3024
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
3025
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_manually_selected_only(uniffiTypeTxBuilderObjectFactory.clonePointer(this), callStatus);
3026
+ }, /*liftString:*/FfiConverterString.lift);
3027
+ }
3028
+
3029
+ /**
3030
+ * Set an explicit nLockTime (as a block height).
3031
+ */
3032
+ nlocktime(lockHeight) {
3033
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
3034
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_nlocktime(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterUInt32.lower(lockHeight), callStatus);
3035
+ }, /*liftString:*/FfiConverterString.lift);
3036
+ }
3037
+
3038
+ /**
3039
+ * Only spend from change outputs.
3040
+ */
3041
+ onlySpendChange() {
3042
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
3043
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_only_spend_change(uniffiTypeTxBuilderObjectFactory.clonePointer(this), callStatus);
3044
+ }, /*liftString:*/FfiConverterString.lift);
3045
+ }
3046
+
3047
+ /**
3048
+ * Include only witness UTXO in PSBT inputs (reduced size, less validation).
3049
+ */
3050
+ onlyWitnessUtxo() {
3051
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
3052
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_only_witness_utxo(uniffiTypeTxBuilderObjectFactory.clonePointer(this), callStatus);
3053
+ }, /*liftString:*/FfiConverterString.lift);
3054
+ }
3055
+
3056
+ /**
3057
+ * Set the input/output ordering strategy.
3058
+ */
3059
+ ordering(ordering) {
3060
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
3061
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_ordering(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterTypeTxOrdering.lower(ordering), callStatus);
3062
+ }, /*liftString:*/FfiConverterString.lift);
3063
+ }
3064
+
3065
+ /**
3066
+ * Supply a policy path for complex descriptors (multisig, timelocks).
3067
+ * path_map is a JSON-encoded BTreeMap<String, Vec<usize>>.
3068
+ */
3069
+ policyPath(pathMapJson, keychain) {
3070
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
3071
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_policy_path(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterString.lower(pathMapJson), FfiConverterTypeKeychainKind.lower(keychain), callStatus);
3072
+ }, /*liftString:*/FfiConverterString.lift);
3073
+ }
3074
+
3075
+ /**
3076
+ * Set an exact nSequence value for all inputs.
3077
+ */
3078
+ setExactSequence(nsequence) {
3079
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
3080
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_set_exact_sequence(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterUInt32.lower(nsequence), callStatus);
3081
+ }, /*liftString:*/FfiConverterString.lift);
3082
+ }
3083
+
3084
+ /**
3085
+ * Replace the entire recipient list.
3086
+ */
3087
+ setRecipients(recipients) {
3088
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
3089
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_set_recipients(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterArrayTypeRecipient.lower(recipients), callStatus);
3090
+ }, /*liftString:*/FfiConverterString.lift);
3091
+ }
3092
+
3093
+ /**
3094
+ * Set the sighash type for all inputs.
3095
+ */
3096
+ sighash(sighashType) {
3097
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
3098
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_sighash(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterUInt32.lower(sighashType), callStatus);
3099
+ }, /*liftString:*/FfiConverterString.lift);
3100
+ }
3101
+
3102
+ /**
3103
+ * Set the transaction version (1 or 2).
3104
+ */
3105
+ txVersion(version) {
3106
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
3107
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_tx_version(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterInt32.lower(version), callStatus);
3108
+ }, /*liftString:*/FfiConverterString.lift);
3109
+ }
3110
+
3111
+ /**
3112
+ * Mark UTXOs as unspendable (excluded from coin selection).
3113
+ */
3114
+ unspendable(outpoints) {
3115
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
3116
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_txbuilder_unspendable(uniffiTypeTxBuilderObjectFactory.clonePointer(this), FfiConverterArrayTypeOutPoint.lower(outpoints), callStatus);
3117
+ }, /*liftString:*/FfiConverterString.lift);
3118
+ }
3119
+
3120
+ /**
3121
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
3122
+ */
3123
+ uniffiDestroy() {
3124
+ const ptr = this[destructorGuardSymbol];
3125
+ if (ptr !== undefined) {
3126
+ const pointer = uniffiTypeTxBuilderObjectFactory.pointer(this);
3127
+ uniffiTypeTxBuilderObjectFactory.freePointer(pointer);
3128
+ uniffiTypeTxBuilderObjectFactory.unbless(ptr);
3129
+ delete this[destructorGuardSymbol];
3130
+ }
3131
+ }
3132
+ static instanceOf(obj) {
3133
+ return uniffiTypeTxBuilderObjectFactory.isConcreteType(obj);
3134
+ }
3135
+ }
3136
+ const uniffiTypeTxBuilderObjectFactory = (() => {
3137
+ return {
3138
+ create(pointer) {
3139
+ const instance = Object.create(TxBuilder.prototype);
3140
+ instance[pointerLiteralSymbol] = pointer;
3141
+ instance[destructorGuardSymbol] = this.bless(pointer);
3142
+ instance[uniffiTypeNameSymbol] = "TxBuilder";
3143
+ return instance;
3144
+ },
3145
+ bless(p) {
3146
+ return uniffiCaller.rustCall(/*caller:*/status => nativeModule().ubrn_uniffi_internal_fn_method_txbuilder_ffi__bless_pointer(p, status), /*liftString:*/FfiConverterString.lift);
3147
+ },
3148
+ unbless(ptr) {
3149
+ ptr.markDestroyed();
3150
+ },
3151
+ pointer(obj) {
3152
+ if (obj[destructorGuardSymbol] === undefined) {
3153
+ throw new UniffiInternalError.UnexpectedNullPointer();
3154
+ }
3155
+ return obj[pointerLiteralSymbol];
3156
+ },
3157
+ clonePointer(obj) {
3158
+ const pointer = this.pointer(obj);
3159
+ return uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_bdk_ffi_fn_clone_txbuilder(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
3160
+ },
3161
+ freePointer(pointer) {
3162
+ uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_bdk_ffi_fn_free_txbuilder(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
3163
+ },
3164
+ isConcreteType(obj) {
3165
+ return obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === "TxBuilder";
3166
+ }
3167
+ };
3168
+ })();
3169
+ // FfiConverter for TxBuilderInterface
3170
+ const FfiConverterTypeTxBuilder = new FfiConverterObject(uniffiTypeTxBuilderObjectFactory);
3171
+ export class Wallet extends UniffiAbstractObject {
3172
+ [uniffiTypeNameSymbol] = "Wallet";
3173
+ /**
3174
+ * Create or load a persisted wallet.
3175
+ * descriptor / change_descriptor: output descriptor strings (e.g. "wpkh(tprv…/84'/1'/0'/0/*)")
3176
+ * db_path: file path for the SQLite persistence database.
3177
+ */
3178
+ constructor(descriptor, changeDescriptor, network, dbPath) /*throws*/{
3179
+ super();
3180
+ const pointer = uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3181
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_constructor_wallet_new(FfiConverterString.lower(descriptor), FfiConverterString.lower(changeDescriptor), FfiConverterTypeNetwork.lower(network), FfiConverterString.lower(dbPath), callStatus);
3182
+ }, /*liftString:*/FfiConverterString.lift);
3183
+ this[pointerLiteralSymbol] = pointer;
3184
+ this[destructorGuardSymbol] = uniffiTypeWalletObjectFactory.bless(pointer);
3185
+ }
3186
+
3187
+ /**
3188
+ * Broadcast a finalized PSBT via Electrum. Returns the txid.
3189
+ */
3190
+ broadcastWithElectrum(url, psbt) /*throws*/{
3191
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3192
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_broadcast_with_electrum(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(url), FfiConverterTypePsbt.lower(psbt), callStatus);
3193
+ }, /*liftString:*/FfiConverterString.lift));
3194
+ }
3195
+
3196
+ /**
3197
+ * Broadcast a finalized PSBT via Esplora. Returns the txid.
3198
+ */
3199
+ async broadcastWithEsplora(url, psbt, asyncOpts_) /*throws*/{
3200
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
3201
+ try {
3202
+ return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
3203
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_broadcast_with_esplora(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(url), FfiConverterTypePsbt.lower(psbt));
3204
+ }, /*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));
3205
+ } catch (__error) {
3206
+ if (uniffiIsDebug && __error instanceof Error) {
3207
+ __error.stack = __stack;
3208
+ }
3209
+ throw __error;
3210
+ }
3211
+ }
3212
+
3213
+ /**
3214
+ * Build an RBF fee-bump PSBT for an unconfirmed transaction.
3215
+ * Mirrors Wallet::build_fee_bump().
3216
+ */
3217
+ buildFeeBump(txid, newFeeRate) /*throws*/{
3218
+ return FfiConverterTypePsbt.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3219
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_build_fee_bump(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(txid), FfiConverterFloat64.lower(newFeeRate), callStatus);
3220
+ }, /*liftString:*/FfiConverterString.lift));
3221
+ }
3222
+
3223
+ /**
3224
+ * Calculate the fee paid by a raw transaction (hex). Returns satoshis.
3225
+ * Mirrors Wallet::calculate_fee().
3226
+ */
3227
+ calculateFee(txHex) /*throws*/{
3228
+ return FfiConverterUInt64.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3229
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_calculate_fee(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(txHex), callStatus);
3230
+ }, /*liftString:*/FfiConverterString.lift));
3231
+ }
3232
+
3233
+ /**
3234
+ * Calculate the fee rate for a raw transaction (hex). Returns sat/vbyte.
3235
+ * Mirrors Wallet::calculate_fee_rate().
3236
+ */
3237
+ calculateFeeRate(txHex) /*throws*/{
3238
+ return FfiConverterFloat64.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3239
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_calculate_fee_rate(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(txHex), callStatus);
3240
+ }, /*liftString:*/FfiConverterString.lift));
3241
+ }
3242
+
3243
+ /**
3244
+ * Cancel (evict) a transaction from the wallet's view.
3245
+ * Mirrors Wallet::cancel_tx().
3246
+ */
3247
+ cancelTx(txHex) /*throws*/{
3248
+ uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3249
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_cancel_tx(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(txHex), callStatus);
3250
+ }, /*liftString:*/FfiConverterString.lift);
3251
+ }
3252
+
3253
+ /**
3254
+ * All checkpoints in the local chain, ordered by height descending.
3255
+ * Mirrors Wallet::checkpoints().
3256
+ */
3257
+ checkpoints() {
3258
+ return FfiConverterArrayTypeBlockId.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
3259
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_checkpoints(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
3260
+ }, /*liftString:*/FfiConverterString.lift));
3261
+ }
3262
+
3263
+ /**
3264
+ * The highest derivation index that has been revealed, or null if none.
3265
+ * Mirrors Wallet::derivation_index().
3266
+ */
3267
+ derivationIndex(keychain) {
3268
+ return FfiConverterOptionalUInt32.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
3269
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_derivation_index(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeKeychainKind.lower(keychain), callStatus);
3270
+ }, /*liftString:*/FfiConverterString.lift));
3271
+ }
3272
+
3273
+ /**
3274
+ * Find the keychain and derivation index for a scriptPubKey (hex).
3275
+ * Returns null if the script does not belong to this wallet.
3276
+ * Mirrors Wallet::derivation_of_spk().
3277
+ */
3278
+ derivationOfSpk(scriptHex) {
3279
+ return FfiConverterOptionalTypeDerivationInfo.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
3280
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_derivation_of_spk(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(scriptHex), callStatus);
3281
+ }, /*liftString:*/FfiConverterString.lift));
3282
+ }
3283
+
3284
+ /**
3285
+ * The descriptor checksum for the given keychain.
3286
+ * Mirrors Wallet::descriptor_checksum().
3287
+ */
3288
+ descriptorChecksum(keychain) /*throws*/{
3289
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3290
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_descriptor_checksum(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeKeychainKind.lower(keychain), callStatus);
3291
+ }, /*liftString:*/FfiConverterString.lift));
3292
+ }
3293
+
3294
+ /**
3295
+ * Drain the entire wallet to an address. Returns txid.
3296
+ */
3297
+ async drain(address, feeRate, esploraUrl, asyncOpts_) /*throws*/{
3298
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
3299
+ try {
3300
+ return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
3301
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_drain(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(address), FfiConverterFloat64.lower(feeRate), FfiConverterString.lower(esploraUrl));
3302
+ }, /*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));
3303
+ } catch (__error) {
3304
+ if (uniffiIsDebug && __error instanceof Error) {
3305
+ __error.stack = __stack;
3306
+ }
3307
+ throw __error;
3308
+ }
3309
+ }
3310
+
3311
+ /**
3312
+ * Sign and attempt to finalize all inputs.
3313
+ * Returns true if fully finalized.
3314
+ * Mirrors Wallet::finalize_psbt() with default SignOptions.
3315
+ */
3316
+ finalizePsbt(psbt) /*throws*/{
3317
+ return FfiConverterBool.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3318
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_finalize_psbt(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypePsbt.lower(psbt), callStatus);
3319
+ }, /*liftString:*/FfiConverterString.lift));
3320
+ }
3321
+
3322
+ /**
3323
+ * Full scan via an Electrum TCP/TLS server.
3324
+ */
3325
+ fullScanWithElectrum(url, stopGap) /*throws*/{
3326
+ uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3327
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_full_scan_with_electrum(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(url), FfiConverterUInt64.lower(stopGap), callStatus);
3328
+ }, /*liftString:*/FfiConverterString.lift);
3329
+ }
3330
+
3331
+ /**
3332
+ * Full scan via an Esplora HTTP server (discovers all used addresses).
3333
+ * Uses Wallet::start_full_scan() + bdk_esplora client internally.
3334
+ * stop_gap: how many consecutive unused addresses to scan before stopping.
3335
+ */
3336
+ async fullScanWithEsplora(url, stopGap, asyncOpts_) /*throws*/{
3337
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
3338
+ try {
3339
+ return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
3340
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_full_scan_with_esplora(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(url), FfiConverterUInt64.lower(stopGap));
3341
+ }, /*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));
3342
+ } catch (__error) {
3343
+ if (uniffiIsDebug && __error instanceof Error) {
3344
+ __error.stack = __stack;
3345
+ }
3346
+ throw __error;
3347
+ }
3348
+ }
3349
+
3350
+ /**
3351
+ * Get the wallet balance. Mirrors Wallet::balance().
3352
+ */
3353
+ getBalance() /*throws*/{
3354
+ return FfiConverterTypeBalance.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3355
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_get_balance(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
3356
+ }, /*liftString:*/FfiConverterString.lift));
3357
+ }
3358
+
3359
+ /**
3360
+ * Returns the raw transaction hex for a given txid. Null if not found.
3361
+ * Mirrors Wallet::get_tx().
3362
+ */
3363
+ getTx(txid) /*throws*/{
3364
+ return FfiConverterOptionalString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3365
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_get_tx(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(txid), callStatus);
3366
+ }, /*liftString:*/FfiConverterString.lift));
3367
+ }
3368
+
3369
+ /**
3370
+ * Get a specific UTXO. Returns null if not found. Mirrors Wallet::get_utxo().
3371
+ */
3372
+ getUtxo(outpoint) /*throws*/{
3373
+ return FfiConverterOptionalTypeLocalOutput.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3374
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_get_utxo(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeOutPoint.lower(outpoint), callStatus);
3375
+ }, /*liftString:*/FfiConverterString.lift));
3376
+ }
3377
+
3378
+ /**
3379
+ * Manually insert a TxOut (e.g. for tracking external outputs).
3380
+ * Mirrors Wallet::insert_txout().
3381
+ */
3382
+ insertTxout(outpoint, txout) {
3383
+ uniffiCaller.rustCall(/*caller:*/callStatus => {
3384
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_insert_txout(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeOutPoint.lower(outpoint), FfiConverterTypeTxOut.lower(txout), callStatus);
3385
+ }, /*liftString:*/FfiConverterString.lift);
3386
+ }
3387
+
3388
+ /**
3389
+ * Return true if the given scriptPubKey (hex) belongs to this wallet.
3390
+ * Mirrors Wallet::is_mine().
3391
+ */
3392
+ isMine(scriptHex) {
3393
+ return FfiConverterBool.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
3394
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_is_mine(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(scriptHex), callStatus);
3395
+ }, /*liftString:*/FfiConverterString.lift));
3396
+ }
3397
+
3398
+ /**
3399
+ * List all keychains and their public descriptors.
3400
+ * Mirrors Wallet::keychains().
3401
+ */
3402
+ keychains() {
3403
+ return FfiConverterArrayTypeKeychainInfo.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
3404
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_keychains(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
3405
+ }, /*liftString:*/FfiConverterString.lift));
3406
+ }
3407
+
3408
+ /**
3409
+ * The latest checkpoint (tip of the local chain). Null if no blocks applied yet.
3410
+ * Mirrors Wallet::latest_checkpoint().
3411
+ */
3412
+ latestCheckpoint() {
3413
+ return FfiConverterOptionalTypeBlockId.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
3414
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_latest_checkpoint(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
3415
+ }, /*liftString:*/FfiConverterString.lift));
3416
+ }
3417
+
3418
+ /**
3419
+ * List all wallet outputs (spent and unspent). Mirrors Wallet::list_output().
3420
+ */
3421
+ listOutput() /*throws*/{
3422
+ return FfiConverterArrayTypeLocalOutput.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3423
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_list_output(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
3424
+ }, /*liftString:*/FfiConverterString.lift));
3425
+ }
3426
+
3427
+ /**
3428
+ * List all unspent wallet outputs. Mirrors Wallet::list_unspent().
3429
+ */
3430
+ listUnspent() /*throws*/{
3431
+ return FfiConverterArrayTypeLocalOutput.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3432
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_list_unspent(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
3433
+ }, /*liftString:*/FfiConverterString.lift));
3434
+ }
3435
+
3436
+ /**
3437
+ * List all addresses that have been revealed but not yet received funds.
3438
+ * Mirrors Wallet::list_unused_addresses().
3439
+ */
3440
+ listUnusedAddresses(keychain) /*throws*/{
3441
+ return FfiConverterArrayTypeAddressInfo.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3442
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_list_unused_addresses(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeKeychainKind.lower(keychain), callStatus);
3443
+ }, /*liftString:*/FfiConverterString.lift));
3444
+ }
3445
+
3446
+ /**
3447
+ * Mark an address index as used (returns true if previously unused).
3448
+ * Mirrors Wallet::mark_used().
3449
+ */
3450
+ markUsed(keychain, index) {
3451
+ return FfiConverterBool.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
3452
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_mark_used(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeKeychainKind.lower(keychain), FfiConverterUInt32.lower(index), callStatus);
3453
+ }, /*liftString:*/FfiConverterString.lift));
3454
+ }
3455
+
3456
+ /**
3457
+ * The network this wallet is configured for.
3458
+ * Mirrors Wallet::network().
3459
+ */
3460
+ network() {
3461
+ return FfiConverterTypeNetwork.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
3462
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_network(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
3463
+ }, /*liftString:*/FfiConverterString.lift));
3464
+ }
3465
+
3466
+ /**
3467
+ * The next derivation index that will be revealed.
3468
+ * Mirrors Wallet::next_derivation_index().
3469
+ */
3470
+ nextDerivationIndex(keychain) {
3471
+ return FfiConverterUInt32.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
3472
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_next_derivation_index(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeKeychainKind.lower(keychain), callStatus);
3473
+ }, /*liftString:*/FfiConverterString.lift));
3474
+ }
3475
+
3476
+ /**
3477
+ * Return the next address that has not yet received funds.
3478
+ * Mirrors Wallet::next_unused_address().
3479
+ */
3480
+ nextUnusedAddress(keychain) /*throws*/{
3481
+ return FfiConverterTypeAddressInfo.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3482
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_next_unused_address(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeKeychainKind.lower(keychain), callStatus);
3483
+ }, /*liftString:*/FfiConverterString.lift));
3484
+ }
3485
+
3486
+ /**
3487
+ * Peek at a specific derivation index without advancing the counter.
3488
+ * Mirrors Wallet::peek_address().
3489
+ */
3490
+ peekAddress(keychain, index) /*throws*/{
3491
+ return FfiConverterTypeAddressInfo.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3492
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_peek_address(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeKeychainKind.lower(keychain), FfiConverterUInt32.lower(index), callStatus);
3493
+ }, /*liftString:*/FfiConverterString.lift));
3494
+ }
3495
+
3496
+ /**
3497
+ * Persist any staged changes to the database.
3498
+ * Our FFI wraps PersistedWallet; this calls persist() internally.
3499
+ */
3500
+ persist() /*throws*/{
3501
+ return FfiConverterBool.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3502
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_persist(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
3503
+ }, /*liftString:*/FfiConverterString.lift));
3504
+ }
3505
+
3506
+ /**
3507
+ * Spending policies for a given keychain, returned as a JSON string.
3508
+ * Returns null if the descriptor has no policy.
3509
+ * Mirrors Wallet::policies() — serialized because the Policy tree is complex.
3510
+ */
3511
+ policies(keychain) /*throws*/{
3512
+ return FfiConverterOptionalString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3513
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_policies(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeKeychainKind.lower(keychain), callStatus);
3514
+ }, /*liftString:*/FfiConverterString.lift));
3515
+ }
3516
+
3517
+ /**
3518
+ * The public-only descriptor for the given keychain as a string.
3519
+ * Mirrors Wallet::public_descriptor().
3520
+ */
3521
+ publicDescriptor(keychain) /*throws*/{
3522
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3523
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_public_descriptor(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeKeychainKind.lower(keychain), callStatus);
3524
+ }, /*liftString:*/FfiConverterString.lift));
3525
+ }
3526
+
3527
+ /**
3528
+ * Reveal all addresses up to and including the given derivation index.
3529
+ * Mirrors Wallet::reveal_addresses_to().
3530
+ */
3531
+ revealAddressesTo(keychain, index) /*throws*/{
3532
+ return FfiConverterArrayTypeAddressInfo.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3533
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_reveal_addresses_to(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeKeychainKind.lower(keychain), FfiConverterUInt32.lower(index), callStatus);
3534
+ }, /*liftString:*/FfiConverterString.lift));
3535
+ }
3536
+
3537
+ /**
3538
+ * Reveal and return the next address at the next derivation index,
3539
+ * incrementing the index even if previous addresses are unused.
3540
+ * Mirrors Wallet::reveal_next_address().
3541
+ */
3542
+ revealNextAddress(keychain) /*throws*/{
3543
+ return FfiConverterTypeAddressInfo.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3544
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_reveal_next_address(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeKeychainKind.lower(keychain), callStatus);
3545
+ }, /*liftString:*/FfiConverterString.lift));
3546
+ }
3547
+
3548
+ /**
3549
+ * Build, sign, and broadcast a simple payment in one call. Returns txid.
3550
+ * Combines build_tx → sign → broadcast via Esplora.
3551
+ */
3552
+ async send(address, amountSats, feeRate, esploraUrl, asyncOpts_) /*throws*/{
3553
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
3554
+ try {
3555
+ return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
3556
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_send(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(address), FfiConverterUInt64.lower(amountSats), FfiConverterFloat64.lower(feeRate), FfiConverterString.lower(esploraUrl));
3557
+ }, /*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));
3558
+ } catch (__error) {
3559
+ if (uniffiIsDebug && __error instanceof Error) {
3560
+ __error.stack = __stack;
3561
+ }
3562
+ throw __error;
3563
+ }
3564
+ }
3565
+
3566
+ /**
3567
+ * How much was sent from / received into the wallet for a raw tx (hex).
3568
+ * Mirrors Wallet::sent_and_received().
3569
+ */
3570
+ sentAndReceived(txHex) /*throws*/{
3571
+ return FfiConverterTypeSentAndReceived.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3572
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_sent_and_received(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(txHex), callStatus);
3573
+ }, /*liftString:*/FfiConverterString.lift));
3574
+ }
3575
+
3576
+ /**
3577
+ * Sign all inputs in the PSBT that this wallet can sign.
3578
+ * Returns true if the PSBT is fully finalized after signing.
3579
+ * Mirrors Wallet::sign() with default SignOptions.
3580
+ */
3581
+ sign(psbt) /*throws*/{
3582
+ return FfiConverterBool.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3583
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_sign(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypePsbt.lower(psbt), callStatus);
3584
+ }, /*liftString:*/FfiConverterString.lift));
3585
+ }
3586
+
3587
+ /**
3588
+ * Incremental sync via Electrum.
3589
+ */
3590
+ syncWithElectrum(url, stopGap) /*throws*/{
3591
+ uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3592
+ nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_sync_with_electrum(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(url), FfiConverterUInt64.lower(stopGap), callStatus);
3593
+ }, /*liftString:*/FfiConverterString.lift);
3594
+ }
3595
+
3596
+ /**
3597
+ * Incremental sync via Esplora (only checks revealed SPKs + UTXOs + unconfirmed).
3598
+ * Uses Wallet::start_sync_with_revealed_spks() + bdk_esplora client internally.
3599
+ */
3600
+ async syncWithEsplora(url, stopGap, asyncOpts_) /*throws*/{
3601
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
3602
+ try {
3603
+ return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
3604
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_sync_with_esplora(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(url), FfiConverterUInt64.lower(stopGap));
3605
+ }, /*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));
3606
+ } catch (__error) {
3607
+ if (uniffiIsDebug && __error instanceof Error) {
3608
+ __error.stack = __stack;
3609
+ }
3610
+ throw __error;
3611
+ }
3612
+ }
3613
+
3614
+ /**
3615
+ * All wallet-relevant canonical transactions.
3616
+ * Mirrors Wallet::transactions() → mapped to TxDetails.
3617
+ */
3618
+ transactions() /*throws*/{
3619
+ return FfiConverterArrayTypeTxDetails.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3620
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_transactions(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
3621
+ }, /*liftString:*/FfiConverterString.lift));
3622
+ }
3623
+
3624
+ /**
3625
+ * Details for a single transaction. Returns null if not found.
3626
+ * Mirrors Wallet::tx_details().
3627
+ */
3628
+ txDetails(txid) /*throws*/{
3629
+ return FfiConverterOptionalTypeTxDetails.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBdkError.lift.bind(FfiConverterTypeBdkError), /*caller:*/callStatus => {
3630
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_tx_details(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(txid), callStatus);
3631
+ }, /*liftString:*/FfiConverterString.lift));
3632
+ }
3633
+
3634
+ /**
3635
+ * Mark an address index as unused (returns true if previously used).
3636
+ * Mirrors Wallet::unmark_used().
3637
+ */
3638
+ unmarkUsed(keychain, index) {
3639
+ return FfiConverterBool.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
3640
+ return nativeModule().ubrn_uniffi_bdk_ffi_fn_method_wallet_unmark_used(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeKeychainKind.lower(keychain), FfiConverterUInt32.lower(index), callStatus);
3641
+ }, /*liftString:*/FfiConverterString.lift));
3642
+ }
3643
+
3644
+ /**
3645
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
3646
+ */
3647
+ uniffiDestroy() {
3648
+ const ptr = this[destructorGuardSymbol];
3649
+ if (ptr !== undefined) {
3650
+ const pointer = uniffiTypeWalletObjectFactory.pointer(this);
3651
+ uniffiTypeWalletObjectFactory.freePointer(pointer);
3652
+ uniffiTypeWalletObjectFactory.unbless(ptr);
3653
+ delete this[destructorGuardSymbol];
3654
+ }
3655
+ }
3656
+ static instanceOf(obj) {
3657
+ return uniffiTypeWalletObjectFactory.isConcreteType(obj);
3658
+ }
3659
+ }
3660
+ const uniffiTypeWalletObjectFactory = (() => {
3661
+ return {
3662
+ create(pointer) {
3663
+ const instance = Object.create(Wallet.prototype);
3664
+ instance[pointerLiteralSymbol] = pointer;
3665
+ instance[destructorGuardSymbol] = this.bless(pointer);
3666
+ instance[uniffiTypeNameSymbol] = "Wallet";
3667
+ return instance;
3668
+ },
3669
+ bless(p) {
3670
+ return uniffiCaller.rustCall(/*caller:*/status => nativeModule().ubrn_uniffi_internal_fn_method_wallet_ffi__bless_pointer(p, status), /*liftString:*/FfiConverterString.lift);
3671
+ },
3672
+ unbless(ptr) {
3673
+ ptr.markDestroyed();
3674
+ },
3675
+ pointer(obj) {
3676
+ if (obj[destructorGuardSymbol] === undefined) {
3677
+ throw new UniffiInternalError.UnexpectedNullPointer();
3678
+ }
3679
+ return obj[pointerLiteralSymbol];
3680
+ },
3681
+ clonePointer(obj) {
3682
+ const pointer = this.pointer(obj);
3683
+ return uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_bdk_ffi_fn_clone_wallet(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
3684
+ },
3685
+ freePointer(pointer) {
3686
+ uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_bdk_ffi_fn_free_wallet(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
3687
+ },
3688
+ isConcreteType(obj) {
3689
+ return obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === "Wallet";
3690
+ }
3691
+ };
3692
+ })();
3693
+ // FfiConverter for WalletInterface
3694
+ const FfiConverterTypeWallet = new FfiConverterObject(uniffiTypeWalletObjectFactory);
3695
+
3696
+ // FfiConverter for /*f64*/number | undefined
3697
+ const FfiConverterOptionalFloat64 = new FfiConverterOptional(FfiConverterFloat64);
3698
+
3699
+ // FfiConverter for BlockId | undefined
3700
+ const FfiConverterOptionalTypeBlockId = new FfiConverterOptional(FfiConverterTypeBlockId);
3701
+
3702
+ // FfiConverter for ConfirmationBlockTime | undefined
3703
+ const FfiConverterOptionalTypeConfirmationBlockTime = new FfiConverterOptional(FfiConverterTypeConfirmationBlockTime);
3704
+
3705
+ // FfiConverter for DerivationInfo | undefined
3706
+ const FfiConverterOptionalTypeDerivationInfo = new FfiConverterOptional(FfiConverterTypeDerivationInfo);
3707
+
3708
+ // FfiConverter for LocalOutput | undefined
3709
+ const FfiConverterOptionalTypeLocalOutput = new FfiConverterOptional(FfiConverterTypeLocalOutput);
3710
+
3711
+ // FfiConverter for TxDetails | undefined
3712
+ const FfiConverterOptionalTypeTxDetails = new FfiConverterOptional(FfiConverterTypeTxDetails);
3713
+
3714
+ // FfiConverter for TxOut | undefined
3715
+ const FfiConverterOptionalTypeTxOut = new FfiConverterOptional(FfiConverterTypeTxOut);
3716
+
3717
+ // FfiConverter for string | undefined
3718
+ const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
3719
+
3720
+ // FfiConverter for /*u32*/number | undefined
3721
+ const FfiConverterOptionalUInt32 = new FfiConverterOptional(FfiConverterUInt32);
3722
+
3723
+ // FfiConverter for /*u64*/bigint | undefined
3724
+ const FfiConverterOptionalUInt64 = new FfiConverterOptional(FfiConverterUInt64);
3725
+
3726
+ // FfiConverter for Array<AddressInfo>
3727
+ const FfiConverterArrayTypeAddressInfo = new FfiConverterArray(FfiConverterTypeAddressInfo);
3728
+
3729
+ // FfiConverter for Array<BlockId>
3730
+ const FfiConverterArrayTypeBlockId = new FfiConverterArray(FfiConverterTypeBlockId);
3731
+
3732
+ // FfiConverter for Array<KeychainInfo>
3733
+ const FfiConverterArrayTypeKeychainInfo = new FfiConverterArray(FfiConverterTypeKeychainInfo);
3734
+
3735
+ // FfiConverter for Array<LocalOutput>
3736
+ const FfiConverterArrayTypeLocalOutput = new FfiConverterArray(FfiConverterTypeLocalOutput);
3737
+
3738
+ // FfiConverter for Array<OutPoint>
3739
+ const FfiConverterArrayTypeOutPoint = new FfiConverterArray(FfiConverterTypeOutPoint);
3740
+
3741
+ // FfiConverter for Array<Recipient>
3742
+ const FfiConverterArrayTypeRecipient = new FfiConverterArray(FfiConverterTypeRecipient);
3743
+
3744
+ // FfiConverter for Array<TxDetails>
3745
+ const FfiConverterArrayTypeTxDetails = new FfiConverterArray(FfiConverterTypeTxDetails);
3746
+
3747
+ // FfiConverter for Array<string>
3748
+ const FfiConverterArrayString = new FfiConverterArray(FfiConverterString);
3749
+
3750
+ // FfiConverter for Array</*u8*/number>
3751
+ const FfiConverterArrayUInt8 = new FfiConverterArray(FfiConverterUInt8);
3752
+
3753
+ /**
3754
+ * This should be called before anything else.
3755
+ *
3756
+ * It is likely that this is being done for you by the library's `index.ts`.
3757
+ *
3758
+ * It checks versions of uniffi between when the Rust scaffolding was generated
3759
+ * and when the bindings were generated.
3760
+ *
3761
+ * It also initializes the machinery to enable Rust to talk back to Javascript.
3762
+ */
3763
+ function uniffiEnsureInitialized() {
3764
+ // Get the bindings contract version from our ComponentInterface
3765
+ const bindingsContractVersion = 30;
3766
+ // Get the scaffolding contract version by calling the into the dylib
3767
+ const scaffoldingContractVersion = nativeModule().ubrn_ffi_bdk_ffi_uniffi_contract_version();
3768
+ if (bindingsContractVersion !== scaffoldingContractVersion) {
3769
+ throw new UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
3770
+ }
3771
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_func_create_descriptor() !== 166) {
3772
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_func_create_descriptor");
3773
+ }
3774
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_func_create_public_descriptor() !== 10610) {
3775
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_func_create_public_descriptor");
3776
+ }
3777
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_func_create_single_key_descriptor() !== 56046) {
3778
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_func_create_single_key_descriptor");
3779
+ }
3780
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_func_export_wallet() !== 53701) {
3781
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_func_export_wallet");
3782
+ }
3783
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_func_is_valid_address() !== 14593) {
3784
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_func_is_valid_address");
3785
+ }
3786
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_func_version() !== 5205) {
3787
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_func_version");
3788
+ }
3789
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_func_wallet_name_from_descriptor() !== 14974) {
3790
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_func_wallet_name_from_descriptor");
3791
+ }
3792
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_mnemonic_language() !== 21218) {
3793
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_mnemonic_language");
3794
+ }
3795
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_mnemonic_to_seed_hex() !== 4827) {
3796
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_mnemonic_to_seed_hex");
3797
+ }
3798
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_mnemonic_to_string() !== 9706) {
3799
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_mnemonic_to_string");
3800
+ }
3801
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_mnemonic_word_count() !== 43660) {
3802
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_mnemonic_word_count");
3803
+ }
3804
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_mnemonic_words() !== 43060) {
3805
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_mnemonic_words");
3806
+ }
3807
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_psbt_extract_tx_hex() !== 55644) {
3808
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_psbt_extract_tx_hex");
3809
+ }
3810
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_psbt_fee_amount() !== 56607) {
3811
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_psbt_fee_amount");
3812
+ }
3813
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_psbt_fee_rate() !== 60372) {
3814
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_psbt_fee_rate");
3815
+ }
3816
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_psbt_get_utxo_for() !== 21092) {
3817
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_psbt_get_utxo_for");
3818
+ }
3819
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_psbt_to_base64() !== 51389) {
3820
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_psbt_to_base64");
3821
+ }
3822
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_psbt_txid() !== 48234) {
3823
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_psbt_txid");
3824
+ }
3825
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_add_data() !== 24171) {
3826
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_add_data");
3827
+ }
3828
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_add_global_xpubs() !== 49750) {
3829
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_add_global_xpubs");
3830
+ }
3831
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_add_recipient() !== 4691) {
3832
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_add_recipient");
3833
+ }
3834
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_add_unspendable() !== 34998) {
3835
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_add_unspendable");
3836
+ }
3837
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_add_utxo() !== 20705) {
3838
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_add_utxo");
3839
+ }
3840
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_add_utxos() !== 35571) {
3841
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_add_utxos");
3842
+ }
3843
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_allow_dust() !== 56022) {
3844
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_allow_dust");
3845
+ }
3846
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_change_policy() !== 46342) {
3847
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_change_policy");
3848
+ }
3849
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_current_height() !== 46986) {
3850
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_current_height");
3851
+ }
3852
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_do_not_spend_change() !== 50138) {
3853
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_do_not_spend_change");
3854
+ }
3855
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_drain_to() !== 33757) {
3856
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_drain_to");
3857
+ }
3858
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_drain_wallet() !== 46414) {
3859
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_drain_wallet");
3860
+ }
3861
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_enable_rbf() !== 16464) {
3862
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_enable_rbf");
3863
+ }
3864
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_enable_rbf_with_sequence() !== 21779) {
3865
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_enable_rbf_with_sequence");
3866
+ }
3867
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_exclude_below_confirmations() !== 8223) {
3868
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_exclude_below_confirmations");
3869
+ }
3870
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_exclude_unconfirmed() !== 63153) {
3871
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_exclude_unconfirmed");
3872
+ }
3873
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_fee_absolute() !== 18715) {
3874
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_fee_absolute");
3875
+ }
3876
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_fee_rate() !== 61803) {
3877
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_fee_rate");
3878
+ }
3879
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_finish() !== 34471) {
3880
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_finish");
3881
+ }
3882
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_include_output_redeem_witness_script() !== 41756) {
3883
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_include_output_redeem_witness_script");
3884
+ }
3885
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_manually_selected_only() !== 61274) {
3886
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_manually_selected_only");
3887
+ }
3888
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_nlocktime() !== 33063) {
3889
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_nlocktime");
3890
+ }
3891
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_only_spend_change() !== 4190) {
3892
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_only_spend_change");
3893
+ }
3894
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_only_witness_utxo() !== 16994) {
3895
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_only_witness_utxo");
3896
+ }
3897
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_ordering() !== 46942) {
3898
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_ordering");
3899
+ }
3900
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_policy_path() !== 3595) {
3901
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_policy_path");
3902
+ }
3903
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_set_exact_sequence() !== 63261) {
3904
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_set_exact_sequence");
3905
+ }
3906
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_set_recipients() !== 28721) {
3907
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_set_recipients");
3908
+ }
3909
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_sighash() !== 22878) {
3910
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_sighash");
3911
+ }
3912
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_tx_version() !== 13770) {
3913
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_tx_version");
3914
+ }
3915
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_txbuilder_unspendable() !== 28900) {
3916
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_txbuilder_unspendable");
3917
+ }
3918
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_broadcast_with_electrum() !== 14979) {
3919
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_broadcast_with_electrum");
3920
+ }
3921
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_broadcast_with_esplora() !== 28791) {
3922
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_broadcast_with_esplora");
3923
+ }
3924
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_build_fee_bump() !== 47809) {
3925
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_build_fee_bump");
3926
+ }
3927
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_calculate_fee() !== 46069) {
3928
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_calculate_fee");
3929
+ }
3930
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_calculate_fee_rate() !== 23249) {
3931
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_calculate_fee_rate");
3932
+ }
3933
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_cancel_tx() !== 58967) {
3934
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_cancel_tx");
3935
+ }
3936
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_checkpoints() !== 55082) {
3937
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_checkpoints");
3938
+ }
3939
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_derivation_index() !== 63256) {
3940
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_derivation_index");
3941
+ }
3942
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_derivation_of_spk() !== 22939) {
3943
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_derivation_of_spk");
3944
+ }
3945
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_descriptor_checksum() !== 64735) {
3946
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_descriptor_checksum");
3947
+ }
3948
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_drain() !== 24840) {
3949
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_drain");
3950
+ }
3951
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_finalize_psbt() !== 22273) {
3952
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_finalize_psbt");
3953
+ }
3954
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_full_scan_with_electrum() !== 15611) {
3955
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_full_scan_with_electrum");
3956
+ }
3957
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_full_scan_with_esplora() !== 43655) {
3958
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_full_scan_with_esplora");
3959
+ }
3960
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_get_balance() !== 18605) {
3961
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_get_balance");
3962
+ }
3963
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_get_tx() !== 58042) {
3964
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_get_tx");
3965
+ }
3966
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_get_utxo() !== 47916) {
3967
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_get_utxo");
3968
+ }
3969
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_insert_txout() !== 33605) {
3970
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_insert_txout");
3971
+ }
3972
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_is_mine() !== 27949) {
3973
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_is_mine");
3974
+ }
3975
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_keychains() !== 1009) {
3976
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_keychains");
3977
+ }
3978
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_latest_checkpoint() !== 5951) {
3979
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_latest_checkpoint");
3980
+ }
3981
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_list_output() !== 35186) {
3982
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_list_output");
3983
+ }
3984
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_list_unspent() !== 590) {
3985
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_list_unspent");
3986
+ }
3987
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_list_unused_addresses() !== 63031) {
3988
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_list_unused_addresses");
3989
+ }
3990
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_mark_used() !== 53427) {
3991
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_mark_used");
3992
+ }
3993
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_network() !== 18889) {
3994
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_network");
3995
+ }
3996
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_next_derivation_index() !== 28145) {
3997
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_next_derivation_index");
3998
+ }
3999
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_next_unused_address() !== 58812) {
4000
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_next_unused_address");
4001
+ }
4002
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_peek_address() !== 56579) {
4003
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_peek_address");
4004
+ }
4005
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_persist() !== 18685) {
4006
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_persist");
4007
+ }
4008
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_policies() !== 64896) {
4009
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_policies");
4010
+ }
4011
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_public_descriptor() !== 19031) {
4012
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_public_descriptor");
4013
+ }
4014
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_reveal_addresses_to() !== 55968) {
4015
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_reveal_addresses_to");
4016
+ }
4017
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_reveal_next_address() !== 61535) {
4018
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_reveal_next_address");
4019
+ }
4020
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_send() !== 51484) {
4021
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_send");
4022
+ }
4023
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_sent_and_received() !== 31024) {
4024
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_sent_and_received");
4025
+ }
4026
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_sign() !== 49926) {
4027
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_sign");
4028
+ }
4029
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_sync_with_electrum() !== 58815) {
4030
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_sync_with_electrum");
4031
+ }
4032
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_sync_with_esplora() !== 55793) {
4033
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_sync_with_esplora");
4034
+ }
4035
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_transactions() !== 13072) {
4036
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_transactions");
4037
+ }
4038
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_tx_details() !== 60609) {
4039
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_tx_details");
4040
+ }
4041
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_method_wallet_unmark_used() !== 25591) {
4042
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_method_wallet_unmark_used");
4043
+ }
4044
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_constructor_mnemonic_from_entropy() !== 37039) {
4045
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_constructor_mnemonic_from_entropy");
4046
+ }
4047
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_constructor_mnemonic_from_entropy_in() !== 31703) {
4048
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_constructor_mnemonic_from_entropy_in");
4049
+ }
4050
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_constructor_mnemonic_from_string() !== 55849) {
4051
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_constructor_mnemonic_from_string");
4052
+ }
4053
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_constructor_mnemonic_from_string_in() !== 62725) {
4054
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_constructor_mnemonic_from_string_in");
4055
+ }
4056
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_constructor_mnemonic_new() !== 48608) {
4057
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_constructor_mnemonic_new");
4058
+ }
4059
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_constructor_psbt_new() !== 53610) {
4060
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_constructor_psbt_new");
4061
+ }
4062
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_constructor_txbuilder_new() !== 16691) {
4063
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_constructor_txbuilder_new");
4064
+ }
4065
+ if (nativeModule().ubrn_uniffi_bdk_ffi_checksum_constructor_wallet_new() !== 38801) {
4066
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bdk_ffi_checksum_constructor_wallet_new");
4067
+ }
4068
+ }
4069
+ export default Object.freeze({
4070
+ initialize: uniffiEnsureInitialized,
4071
+ converters: {
4072
+ FfiConverterTypeAddressInfo,
4073
+ FfiConverterTypeBalance,
4074
+ FfiConverterTypeBdkError,
4075
+ FfiConverterTypeBlockId,
4076
+ FfiConverterTypeChangeSpendPolicy,
4077
+ FfiConverterTypeConfirmationBlockTime,
4078
+ FfiConverterTypeDerivationInfo,
4079
+ FfiConverterTypeDescriptorTemplate,
4080
+ FfiConverterTypeKeychainInfo,
4081
+ FfiConverterTypeKeychainKind,
4082
+ FfiConverterTypeLanguage,
4083
+ FfiConverterTypeLocalOutput,
4084
+ FfiConverterTypeMnemonic,
4085
+ FfiConverterTypeNetwork,
4086
+ FfiConverterTypeOutPoint,
4087
+ FfiConverterTypePsbt,
4088
+ FfiConverterTypeRecipient,
4089
+ FfiConverterTypeSentAndReceived,
4090
+ FfiConverterTypeSingleKeyDescriptorTemplate,
4091
+ FfiConverterTypeTxBuilder,
4092
+ FfiConverterTypeTxDetails,
4093
+ FfiConverterTypeTxOrdering,
4094
+ FfiConverterTypeTxOut,
4095
+ FfiConverterTypeWallet,
4096
+ FfiConverterTypeWalletEvent,
4097
+ FfiConverterTypeWordCount
4098
+ }
4099
+ });
4100
+ //# sourceMappingURL=bdk_ffi.js.map