@secondts/bark-react-native 0.1.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/BarkReactNative.podspec +44 -0
  2. package/README.md +46 -0
  3. package/android/CMakeLists.txt +76 -0
  4. package/android/build.gradle +144 -0
  5. package/android/cpp-adapter.cpp +42 -0
  6. package/android/generated/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeBarkReactNativeSpec.java +41 -0
  7. package/android/generated/android/app/build/generated/source/codegen/jni/CMakeLists.txt +36 -0
  8. package/android/generated/android/app/build/generated/source/codegen/jni/RNBarkReactNativeSpec-generated.cpp +38 -0
  9. package/android/generated/android/app/build/generated/source/codegen/jni/RNBarkReactNativeSpec.h +31 -0
  10. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/ComponentDescriptors.cpp +22 -0
  11. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/ComponentDescriptors.h +24 -0
  12. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/EventEmitters.cpp +16 -0
  13. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/EventEmitters.h +17 -0
  14. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/Props.cpp +19 -0
  15. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/Props.h +18 -0
  16. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/RNBarkReactNativeSpecJSI-generated.cpp +32 -0
  17. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/RNBarkReactNativeSpecJSI.h +76 -0
  18. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/ShadowNodes.cpp +17 -0
  19. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/ShadowNodes.h +23 -0
  20. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/States.cpp +16 -0
  21. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBarkReactNativeSpec/States.h +19 -0
  22. package/android/src/main/AndroidManifest.xml +5 -0
  23. package/android/src/main/java/com/barkreactnative/BarkReactNativeModule.kt +43 -0
  24. package/android/src/main/java/com/barkreactnative/BarkReactNativePackage.kt +34 -0
  25. package/app.plugin.js +1 -0
  26. package/cpp/bark-react-native.cpp +16 -0
  27. package/cpp/bark-react-native.h +15 -0
  28. package/cpp/generated/bark.cpp +6665 -0
  29. package/cpp/generated/bark.hpp +212 -0
  30. package/cpp/secondts-bark-react-native.cpp +16 -0
  31. package/cpp/secondts-bark-react-native.h +15 -0
  32. package/ios/BarkReactNative.h +16 -0
  33. package/ios/BarkReactNative.mm +66 -0
  34. package/ios/generated/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm +2321 -0
  35. package/ios/generated/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h +2761 -0
  36. package/ios/generated/build/generated/ios/FBReactNativeSpecJSI-generated.cpp +2923 -0
  37. package/ios/generated/build/generated/ios/FBReactNativeSpecJSI.h +7718 -0
  38. package/ios/generated/build/generated/ios/RCTModulesConformingToProtocolsProvider.h +18 -0
  39. package/ios/generated/build/generated/ios/RCTModulesConformingToProtocolsProvider.mm +33 -0
  40. package/ios/generated/build/generated/ios/RNBarkReactNativeSpec/RNBarkReactNativeSpec-generated.mm +46 -0
  41. package/ios/generated/build/generated/ios/RNBarkReactNativeSpec/RNBarkReactNativeSpec.h +60 -0
  42. package/ios/generated/build/generated/ios/RNBarkReactNativeSpecJSI-generated.cpp +32 -0
  43. package/ios/generated/build/generated/ios/RNBarkReactNativeSpecJSI.h +76 -0
  44. package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/ComponentDescriptors.cpp +22 -0
  45. package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/ComponentDescriptors.h +24 -0
  46. package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/EventEmitters.cpp +16 -0
  47. package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/EventEmitters.h +17 -0
  48. package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/Props.cpp +19 -0
  49. package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/Props.h +18 -0
  50. package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/RCTComponentViewHelpers.h +18 -0
  51. package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/ShadowNodes.cpp +17 -0
  52. package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/ShadowNodes.h +23 -0
  53. package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/States.cpp +16 -0
  54. package/ios/generated/build/generated/ios/react/renderer/components/RNBarkReactNativeSpec/States.h +19 -0
  55. package/lib/commonjs/NativeBarkReactNative.js +10 -0
  56. package/lib/commonjs/NativeBarkReactNative.js.map +1 -0
  57. package/lib/commonjs/generated/bark-ffi.js +44 -0
  58. package/lib/commonjs/generated/bark-ffi.js.map +1 -0
  59. package/lib/commonjs/generated/bark.js +3175 -0
  60. package/lib/commonjs/generated/bark.js.map +1 -0
  61. package/lib/commonjs/index.js +63 -0
  62. package/lib/commonjs/index.js.map +1 -0
  63. package/lib/commonjs/package.json +1 -0
  64. package/lib/module/NativeBarkReactNative.js +7 -0
  65. package/lib/module/NativeBarkReactNative.js.map +1 -0
  66. package/lib/module/generated/bark-ffi.js +43 -0
  67. package/lib/module/generated/bark-ffi.js.map +1 -0
  68. package/lib/module/generated/bark.js +3164 -0
  69. package/lib/module/generated/bark.js.map +1 -0
  70. package/lib/module/index.js +43 -0
  71. package/lib/module/index.js.map +1 -0
  72. package/lib/module/package.json +1 -0
  73. package/lib/typescript/commonjs/package.json +1 -0
  74. package/lib/typescript/commonjs/plugin/src/index.d.ts +11 -0
  75. package/lib/typescript/commonjs/plugin/src/index.d.ts.map +1 -0
  76. package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts +6 -0
  77. package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts.map +1 -0
  78. package/lib/typescript/commonjs/plugin/src/withIOS.d.ts +7 -0
  79. package/lib/typescript/commonjs/plugin/src/withIOS.d.ts.map +1 -0
  80. package/lib/typescript/commonjs/src/NativeBarkReactNative.d.ts +8 -0
  81. package/lib/typescript/commonjs/src/NativeBarkReactNative.d.ts.map +1 -0
  82. package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts +264 -0
  83. package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts.map +1 -0
  84. package/lib/typescript/commonjs/src/generated/bark.d.ts +2963 -0
  85. package/lib/typescript/commonjs/src/generated/bark.d.ts.map +1 -0
  86. package/lib/typescript/commonjs/src/index.d.ts +8 -0
  87. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  88. package/lib/typescript/module/package.json +1 -0
  89. package/lib/typescript/module/plugin/src/index.d.ts +11 -0
  90. package/lib/typescript/module/plugin/src/index.d.ts.map +1 -0
  91. package/lib/typescript/module/plugin/src/withAndroid.d.ts +6 -0
  92. package/lib/typescript/module/plugin/src/withAndroid.d.ts.map +1 -0
  93. package/lib/typescript/module/plugin/src/withIOS.d.ts +7 -0
  94. package/lib/typescript/module/plugin/src/withIOS.d.ts.map +1 -0
  95. package/lib/typescript/module/src/NativeBarkReactNative.d.ts +8 -0
  96. package/lib/typescript/module/src/NativeBarkReactNative.d.ts.map +1 -0
  97. package/lib/typescript/module/src/generated/bark-ffi.d.ts +264 -0
  98. package/lib/typescript/module/src/generated/bark-ffi.d.ts.map +1 -0
  99. package/lib/typescript/module/src/generated/bark.d.ts +2963 -0
  100. package/lib/typescript/module/src/generated/bark.d.ts.map +1 -0
  101. package/lib/typescript/module/src/index.d.ts +8 -0
  102. package/lib/typescript/module/src/index.d.ts.map +1 -0
  103. package/package.json +154 -0
  104. package/plugin/build/index.d.ts +10 -0
  105. package/plugin/build/index.js +16 -0
  106. package/plugin/build/withAndroid.d.ts +5 -0
  107. package/plugin/build/withAndroid.js +26 -0
  108. package/plugin/build/withIOS.d.ts +6 -0
  109. package/plugin/build/withIOS.js +13 -0
  110. package/plugin/tsconfig.json +9 -0
  111. package/plugin/tsconfig.tsbuildinfo +1 -0
  112. package/react-native.config.js +12 -0
  113. package/scripts/postinstall.js +233 -0
  114. package/src/NativeBarkReactNative.ts +10 -0
  115. package/src/generated/bark-ffi.ts +694 -0
  116. package/src/generated/bark.ts +6068 -0
  117. package/src/index.tsx +41 -0
@@ -0,0 +1,3164 @@
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
+ import nativeModule from "./bark-ffi.js";
6
+ import { AbstractFfiConverterByteArray, FfiConverterArray, FfiConverterBool, FfiConverterCallback, FfiConverterInt32, FfiConverterInt64, FfiConverterObject, FfiConverterOptional, FfiConverterUInt16, FfiConverterUInt32, FfiConverterUInt64, UniffiAbstractObject, UniffiError, UniffiInternalError, UniffiResult, UniffiRustCaller, destructorGuardSymbol, pointerLiteralSymbol, uniffiCreateFfiConverterString, uniffiCreateRecord, uniffiTraitInterfaceCallWithError, uniffiTypeNameSymbol } from "uniffi-bindgen-react-native";
7
+
8
+ // Get converters from the other files, if any.
9
+ const uniffiCaller = new UniffiRustCaller(() => ({
10
+ code: 0
11
+ }));
12
+ const uniffiIsDebug =
13
+ // @ts-ignore -- The process global might not be defined
14
+ typeof process !== "object" ||
15
+ // @ts-ignore -- The process global might not be defined
16
+ process?.env?.NODE_ENV !== "production" || false;
17
+ // Public interface members begin here.
18
+
19
+ export function extractTxFromPsbt(psbtBase64) /*throws*/{
20
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
21
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_func_extract_tx_from_psbt(FfiConverterString.lower(psbtBase64), callStatus);
22
+ }, /*liftString:*/FfiConverterString.lift));
23
+ }
24
+ export function generateMnemonic() /*throws*/{
25
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
26
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_func_generate_mnemonic(callStatus);
27
+ }, /*liftString:*/FfiConverterString.lift));
28
+ }
29
+ export function validateArkAddress(address) /*throws*/{
30
+ return FfiConverterBool.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
31
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_func_validate_ark_address(FfiConverterString.lower(address), callStatus);
32
+ }, /*liftString:*/FfiConverterString.lift));
33
+ }
34
+ export function validateMnemonic(mnemonic) /*throws*/{
35
+ return FfiConverterBool.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
36
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_func_validate_mnemonic(FfiConverterString.lower(mnemonic), callStatus);
37
+ }, /*liftString:*/FfiConverterString.lift));
38
+ }
39
+
40
+ /**
41
+ * Callback interface for custom onchain wallet implementations
42
+ *
43
+ * Implement this interface in Dart/Swift/Kotlin to provide your own wallet.
44
+ */
45
+
46
+ // Put the implementation in a struct so we don't pollute the top-level namespace
47
+ const uniffiCallbackInterfaceCustomOnchainWalletCallbacks = {
48
+ // Create the VTable using a series of closures.
49
+ // ts automatically converts these into C callback functions.
50
+ vtable: {
51
+ getBalance: uniffiHandle => {
52
+ const uniffiMakeCall = () => {
53
+ const jsCallback = FfiConverterTypeCustomOnchainWalletCallbacks.lift(uniffiHandle);
54
+ return jsCallback.getBalance();
55
+ };
56
+ const uniffiResult = UniffiResult.ready();
57
+ const uniffiHandleSuccess = obj => {
58
+ UniffiResult.writeSuccess(uniffiResult, FfiConverterUInt64.lower(obj));
59
+ };
60
+ const uniffiHandleError = (code, errBuf) => {
61
+ UniffiResult.writeError(uniffiResult, code, errBuf);
62
+ };
63
+ uniffiTraitInterfaceCallWithError(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/BarkError.instanceOf, /*lowerError:*/FfiConverterTypeBarkError.lower.bind(FfiConverterTypeBarkError), /*lowerString:*/FfiConverterString.lower);
64
+ return uniffiResult;
65
+ },
66
+ prepareTx: (uniffiHandle, destinations, feeRateSatPerVb) => {
67
+ const uniffiMakeCall = () => {
68
+ const jsCallback = FfiConverterTypeCustomOnchainWalletCallbacks.lift(uniffiHandle);
69
+ return jsCallback.prepareTx(FfiConverterArrayTypeDestination.lift(destinations), FfiConverterUInt64.lift(feeRateSatPerVb));
70
+ };
71
+ const uniffiResult = UniffiResult.ready();
72
+ const uniffiHandleSuccess = obj => {
73
+ UniffiResult.writeSuccess(uniffiResult, FfiConverterString.lower(obj));
74
+ };
75
+ const uniffiHandleError = (code, errBuf) => {
76
+ UniffiResult.writeError(uniffiResult, code, errBuf);
77
+ };
78
+ uniffiTraitInterfaceCallWithError(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/BarkError.instanceOf, /*lowerError:*/FfiConverterTypeBarkError.lower.bind(FfiConverterTypeBarkError), /*lowerString:*/FfiConverterString.lower);
79
+ return uniffiResult;
80
+ },
81
+ prepareDrainTx: (uniffiHandle, address, feeRateSatPerVb) => {
82
+ const uniffiMakeCall = () => {
83
+ const jsCallback = FfiConverterTypeCustomOnchainWalletCallbacks.lift(uniffiHandle);
84
+ return jsCallback.prepareDrainTx(FfiConverterString.lift(address), FfiConverterUInt64.lift(feeRateSatPerVb));
85
+ };
86
+ const uniffiResult = UniffiResult.ready();
87
+ const uniffiHandleSuccess = obj => {
88
+ UniffiResult.writeSuccess(uniffiResult, FfiConverterString.lower(obj));
89
+ };
90
+ const uniffiHandleError = (code, errBuf) => {
91
+ UniffiResult.writeError(uniffiResult, code, errBuf);
92
+ };
93
+ uniffiTraitInterfaceCallWithError(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/BarkError.instanceOf, /*lowerError:*/FfiConverterTypeBarkError.lower.bind(FfiConverterTypeBarkError), /*lowerString:*/FfiConverterString.lower);
94
+ return uniffiResult;
95
+ },
96
+ finishTx: (uniffiHandle, psbtBase64) => {
97
+ const uniffiMakeCall = () => {
98
+ const jsCallback = FfiConverterTypeCustomOnchainWalletCallbacks.lift(uniffiHandle);
99
+ return jsCallback.finishTx(FfiConverterString.lift(psbtBase64));
100
+ };
101
+ const uniffiResult = UniffiResult.ready();
102
+ const uniffiHandleSuccess = obj => {
103
+ UniffiResult.writeSuccess(uniffiResult, FfiConverterString.lower(obj));
104
+ };
105
+ const uniffiHandleError = (code, errBuf) => {
106
+ UniffiResult.writeError(uniffiResult, code, errBuf);
107
+ };
108
+ uniffiTraitInterfaceCallWithError(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/BarkError.instanceOf, /*lowerError:*/FfiConverterTypeBarkError.lower.bind(FfiConverterTypeBarkError), /*lowerString:*/FfiConverterString.lower);
109
+ return uniffiResult;
110
+ },
111
+ getWalletTx: (uniffiHandle, txid) => {
112
+ const uniffiMakeCall = () => {
113
+ const jsCallback = FfiConverterTypeCustomOnchainWalletCallbacks.lift(uniffiHandle);
114
+ return jsCallback.getWalletTx(FfiConverterString.lift(txid));
115
+ };
116
+ const uniffiResult = UniffiResult.ready();
117
+ const uniffiHandleSuccess = obj => {
118
+ UniffiResult.writeSuccess(uniffiResult, FfiConverterOptionalString.lower(obj));
119
+ };
120
+ const uniffiHandleError = (code, errBuf) => {
121
+ UniffiResult.writeError(uniffiResult, code, errBuf);
122
+ };
123
+ uniffiTraitInterfaceCallWithError(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/BarkError.instanceOf, /*lowerError:*/FfiConverterTypeBarkError.lower.bind(FfiConverterTypeBarkError), /*lowerString:*/FfiConverterString.lower);
124
+ return uniffiResult;
125
+ },
126
+ getWalletTxConfirmedBlock: (uniffiHandle, txid) => {
127
+ const uniffiMakeCall = () => {
128
+ const jsCallback = FfiConverterTypeCustomOnchainWalletCallbacks.lift(uniffiHandle);
129
+ return jsCallback.getWalletTxConfirmedBlock(FfiConverterString.lift(txid));
130
+ };
131
+ const uniffiResult = UniffiResult.ready();
132
+ const uniffiHandleSuccess = obj => {
133
+ UniffiResult.writeSuccess(uniffiResult, FfiConverterOptionalTypeBlockRef.lower(obj));
134
+ };
135
+ const uniffiHandleError = (code, errBuf) => {
136
+ UniffiResult.writeError(uniffiResult, code, errBuf);
137
+ };
138
+ uniffiTraitInterfaceCallWithError(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/BarkError.instanceOf, /*lowerError:*/FfiConverterTypeBarkError.lower.bind(FfiConverterTypeBarkError), /*lowerString:*/FfiConverterString.lower);
139
+ return uniffiResult;
140
+ },
141
+ getSpendingTx: (uniffiHandle, outpoint) => {
142
+ const uniffiMakeCall = () => {
143
+ const jsCallback = FfiConverterTypeCustomOnchainWalletCallbacks.lift(uniffiHandle);
144
+ return jsCallback.getSpendingTx(FfiConverterTypeOutPoint.lift(outpoint));
145
+ };
146
+ const uniffiResult = UniffiResult.ready();
147
+ const uniffiHandleSuccess = obj => {
148
+ UniffiResult.writeSuccess(uniffiResult, FfiConverterOptionalString.lower(obj));
149
+ };
150
+ const uniffiHandleError = (code, errBuf) => {
151
+ UniffiResult.writeError(uniffiResult, code, errBuf);
152
+ };
153
+ uniffiTraitInterfaceCallWithError(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/BarkError.instanceOf, /*lowerError:*/FfiConverterTypeBarkError.lower.bind(FfiConverterTypeBarkError), /*lowerString:*/FfiConverterString.lower);
154
+ return uniffiResult;
155
+ },
156
+ makeSignedP2aCpfp: (uniffiHandle, params) => {
157
+ const uniffiMakeCall = () => {
158
+ const jsCallback = FfiConverterTypeCustomOnchainWalletCallbacks.lift(uniffiHandle);
159
+ return jsCallback.makeSignedP2aCpfp(FfiConverterTypeCpfpParams.lift(params));
160
+ };
161
+ const uniffiResult = UniffiResult.ready();
162
+ const uniffiHandleSuccess = obj => {
163
+ UniffiResult.writeSuccess(uniffiResult, FfiConverterString.lower(obj));
164
+ };
165
+ const uniffiHandleError = (code, errBuf) => {
166
+ UniffiResult.writeError(uniffiResult, code, errBuf);
167
+ };
168
+ uniffiTraitInterfaceCallWithError(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/BarkError.instanceOf, /*lowerError:*/FfiConverterTypeBarkError.lower.bind(FfiConverterTypeBarkError), /*lowerString:*/FfiConverterString.lower);
169
+ return uniffiResult;
170
+ },
171
+ storeSignedP2aCpfp: (uniffiHandle, txHex) => {
172
+ const uniffiMakeCall = () => {
173
+ const jsCallback = FfiConverterTypeCustomOnchainWalletCallbacks.lift(uniffiHandle);
174
+ return jsCallback.storeSignedP2aCpfp(FfiConverterString.lift(txHex));
175
+ };
176
+ const uniffiResult = UniffiResult.ready();
177
+ const uniffiHandleSuccess = obj => {};
178
+ const uniffiHandleError = (code, errBuf) => {
179
+ UniffiResult.writeError(uniffiResult, code, errBuf);
180
+ };
181
+ uniffiTraitInterfaceCallWithError(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/BarkError.instanceOf, /*lowerError:*/FfiConverterTypeBarkError.lower.bind(FfiConverterTypeBarkError), /*lowerString:*/FfiConverterString.lower);
182
+ return uniffiResult;
183
+ },
184
+ uniffiFree: uniffiHandle => {
185
+ // CustomOnchainWalletCallbacks: this will throw a stale handle error if the handle isn't found.
186
+ FfiConverterTypeCustomOnchainWalletCallbacks.drop(uniffiHandle);
187
+ }
188
+ },
189
+ register: () => {
190
+ nativeModule().ubrn_uniffi_bark_ffi_fn_init_callback_vtable_customonchainwalletcallbacks(uniffiCallbackInterfaceCustomOnchainWalletCallbacks.vtable);
191
+ }
192
+ };
193
+
194
+ // FfiConverter protocol for callback interfaces
195
+ const FfiConverterTypeCustomOnchainWalletCallbacks = new FfiConverterCallback();
196
+
197
+ /**
198
+ * An Ark address with its derivation index
199
+ */
200
+
201
+ /**
202
+ * Generated factory for {@link AddressWithIndex} record objects.
203
+ */
204
+ export const AddressWithIndex = (() => {
205
+ const defaults = () => ({});
206
+ const create = (() => {
207
+ return uniffiCreateRecord(defaults);
208
+ })();
209
+ return Object.freeze({
210
+ /**
211
+ * Create a frozen instance of {@link AddressWithIndex}, with defaults specified
212
+ * in Rust, in the {@link bark} crate.
213
+ */
214
+ create,
215
+ /**
216
+ * Create a frozen instance of {@link AddressWithIndex}, with defaults specified
217
+ * in Rust, in the {@link bark} crate.
218
+ */
219
+ new: create,
220
+ /**
221
+ * Defaults specified in the {@link bark} crate.
222
+ */
223
+ defaults: () => Object.freeze(defaults())
224
+ });
225
+ })();
226
+ const FfiConverterTypeAddressWithIndex = (() => {
227
+ class FFIConverter extends AbstractFfiConverterByteArray {
228
+ read(from) {
229
+ return {
230
+ address: FfiConverterString.read(from),
231
+ index: FfiConverterUInt32.read(from)
232
+ };
233
+ }
234
+ write(value, into) {
235
+ FfiConverterString.write(value.address, into);
236
+ FfiConverterUInt32.write(value.index, into);
237
+ }
238
+ allocationSize(value) {
239
+ return FfiConverterString.allocationSize(value.address) + FfiConverterUInt32.allocationSize(value.index);
240
+ }
241
+ }
242
+ return new FFIConverter();
243
+ })();
244
+
245
+ /**
246
+ * Ark server configuration information
247
+ */
248
+
249
+ /**
250
+ * Generated factory for {@link ArkInfo} record objects.
251
+ */
252
+ export const ArkInfo = (() => {
253
+ const defaults = () => ({});
254
+ const create = (() => {
255
+ return uniffiCreateRecord(defaults);
256
+ })();
257
+ return Object.freeze({
258
+ /**
259
+ * Create a frozen instance of {@link ArkInfo}, with defaults specified
260
+ * in Rust, in the {@link bark} crate.
261
+ */
262
+ create,
263
+ /**
264
+ * Create a frozen instance of {@link ArkInfo}, with defaults specified
265
+ * in Rust, in the {@link bark} crate.
266
+ */
267
+ new: create,
268
+ /**
269
+ * Defaults specified in the {@link bark} crate.
270
+ */
271
+ defaults: () => Object.freeze(defaults())
272
+ });
273
+ })();
274
+ const FfiConverterTypeArkInfo = (() => {
275
+ class FFIConverter extends AbstractFfiConverterByteArray {
276
+ read(from) {
277
+ return {
278
+ network: FfiConverterTypeNetwork.read(from),
279
+ serverPubkey: FfiConverterString.read(from),
280
+ roundIntervalSecs: FfiConverterUInt64.read(from),
281
+ nbRoundNonces: FfiConverterUInt32.read(from),
282
+ vtxoExitDelta: FfiConverterUInt32.read(from),
283
+ vtxoExpiryDelta: FfiConverterUInt32.read(from),
284
+ htlcSendExpiryDelta: FfiConverterUInt32.read(from),
285
+ htlcExpiryDelta: FfiConverterUInt32.read(from),
286
+ maxVtxoAmountSats: FfiConverterOptionalUInt64.read(from),
287
+ requiredBoardConfirmations: FfiConverterUInt32.read(from),
288
+ maxUserInvoiceCltvDelta: FfiConverterUInt16.read(from),
289
+ minBoardAmountSats: FfiConverterUInt64.read(from),
290
+ offboardFeerateSatPerVb: FfiConverterUInt64.read(from),
291
+ lnReceiveAntiDosRequired: FfiConverterBool.read(from)
292
+ };
293
+ }
294
+ write(value, into) {
295
+ FfiConverterTypeNetwork.write(value.network, into);
296
+ FfiConverterString.write(value.serverPubkey, into);
297
+ FfiConverterUInt64.write(value.roundIntervalSecs, into);
298
+ FfiConverterUInt32.write(value.nbRoundNonces, into);
299
+ FfiConverterUInt32.write(value.vtxoExitDelta, into);
300
+ FfiConverterUInt32.write(value.vtxoExpiryDelta, into);
301
+ FfiConverterUInt32.write(value.htlcSendExpiryDelta, into);
302
+ FfiConverterUInt32.write(value.htlcExpiryDelta, into);
303
+ FfiConverterOptionalUInt64.write(value.maxVtxoAmountSats, into);
304
+ FfiConverterUInt32.write(value.requiredBoardConfirmations, into);
305
+ FfiConverterUInt16.write(value.maxUserInvoiceCltvDelta, into);
306
+ FfiConverterUInt64.write(value.minBoardAmountSats, into);
307
+ FfiConverterUInt64.write(value.offboardFeerateSatPerVb, into);
308
+ FfiConverterBool.write(value.lnReceiveAntiDosRequired, into);
309
+ }
310
+ allocationSize(value) {
311
+ return FfiConverterTypeNetwork.allocationSize(value.network) + FfiConverterString.allocationSize(value.serverPubkey) + FfiConverterUInt64.allocationSize(value.roundIntervalSecs) + FfiConverterUInt32.allocationSize(value.nbRoundNonces) + FfiConverterUInt32.allocationSize(value.vtxoExitDelta) + FfiConverterUInt32.allocationSize(value.vtxoExpiryDelta) + FfiConverterUInt32.allocationSize(value.htlcSendExpiryDelta) + FfiConverterUInt32.allocationSize(value.htlcExpiryDelta) + FfiConverterOptionalUInt64.allocationSize(value.maxVtxoAmountSats) + FfiConverterUInt32.allocationSize(value.requiredBoardConfirmations) + FfiConverterUInt16.allocationSize(value.maxUserInvoiceCltvDelta) + FfiConverterUInt64.allocationSize(value.minBoardAmountSats) + FfiConverterUInt64.allocationSize(value.offboardFeerateSatPerVb) + FfiConverterBool.allocationSize(value.lnReceiveAntiDosRequired);
312
+ }
313
+ }
314
+ return new FFIConverter();
315
+ })();
316
+
317
+ /**
318
+ * Detailed balance breakdown of the wallet
319
+ */
320
+
321
+ /**
322
+ * Generated factory for {@link Balance} record objects.
323
+ */
324
+ export const Balance = (() => {
325
+ const defaults = () => ({});
326
+ const create = (() => {
327
+ return uniffiCreateRecord(defaults);
328
+ })();
329
+ return Object.freeze({
330
+ /**
331
+ * Create a frozen instance of {@link Balance}, with defaults specified
332
+ * in Rust, in the {@link bark} crate.
333
+ */
334
+ create,
335
+ /**
336
+ * Create a frozen instance of {@link Balance}, with defaults specified
337
+ * in Rust, in the {@link bark} crate.
338
+ */
339
+ new: create,
340
+ /**
341
+ * Defaults specified in the {@link bark} crate.
342
+ */
343
+ defaults: () => Object.freeze(defaults())
344
+ });
345
+ })();
346
+ const FfiConverterTypeBalance = (() => {
347
+ class FFIConverter extends AbstractFfiConverterByteArray {
348
+ read(from) {
349
+ return {
350
+ spendableSats: FfiConverterUInt64.read(from),
351
+ pendingInRoundSats: FfiConverterUInt64.read(from),
352
+ pendingExitSats: FfiConverterUInt64.read(from),
353
+ pendingLightningSendSats: FfiConverterUInt64.read(from),
354
+ claimableLightningReceiveSats: FfiConverterUInt64.read(from),
355
+ pendingBoardSats: FfiConverterUInt64.read(from)
356
+ };
357
+ }
358
+ write(value, into) {
359
+ FfiConverterUInt64.write(value.spendableSats, into);
360
+ FfiConverterUInt64.write(value.pendingInRoundSats, into);
361
+ FfiConverterUInt64.write(value.pendingExitSats, into);
362
+ FfiConverterUInt64.write(value.pendingLightningSendSats, into);
363
+ FfiConverterUInt64.write(value.claimableLightningReceiveSats, into);
364
+ FfiConverterUInt64.write(value.pendingBoardSats, into);
365
+ }
366
+ allocationSize(value) {
367
+ return FfiConverterUInt64.allocationSize(value.spendableSats) + FfiConverterUInt64.allocationSize(value.pendingInRoundSats) + FfiConverterUInt64.allocationSize(value.pendingExitSats) + FfiConverterUInt64.allocationSize(value.pendingLightningSendSats) + FfiConverterUInt64.allocationSize(value.claimableLightningReceiveSats) + FfiConverterUInt64.allocationSize(value.pendingBoardSats);
368
+ }
369
+ }
370
+ return new FFIConverter();
371
+ })();
372
+
373
+ /**
374
+ * Reference to a block in the blockchain
375
+ */
376
+
377
+ /**
378
+ * Generated factory for {@link BlockRef} record objects.
379
+ */
380
+ export const BlockRef = (() => {
381
+ const defaults = () => ({});
382
+ const create = (() => {
383
+ return uniffiCreateRecord(defaults);
384
+ })();
385
+ return Object.freeze({
386
+ /**
387
+ * Create a frozen instance of {@link BlockRef}, with defaults specified
388
+ * in Rust, in the {@link bark} crate.
389
+ */
390
+ create,
391
+ /**
392
+ * Create a frozen instance of {@link BlockRef}, with defaults specified
393
+ * in Rust, in the {@link bark} crate.
394
+ */
395
+ new: create,
396
+ /**
397
+ * Defaults specified in the {@link bark} crate.
398
+ */
399
+ defaults: () => Object.freeze(defaults())
400
+ });
401
+ })();
402
+ const FfiConverterTypeBlockRef = (() => {
403
+ class FFIConverter extends AbstractFfiConverterByteArray {
404
+ read(from) {
405
+ return {
406
+ height: FfiConverterUInt32.read(from),
407
+ hash: FfiConverterString.read(from)
408
+ };
409
+ }
410
+ write(value, into) {
411
+ FfiConverterUInt32.write(value.height, into);
412
+ FfiConverterString.write(value.hash, into);
413
+ }
414
+ allocationSize(value) {
415
+ return FfiConverterUInt32.allocationSize(value.height) + FfiConverterString.allocationSize(value.hash);
416
+ }
417
+ }
418
+ return new FFIConverter();
419
+ })();
420
+
421
+ /**
422
+ * Configuration for creating/opening a Bark wallet
423
+ */
424
+
425
+ /**
426
+ * Generated factory for {@link Config} record objects.
427
+ */
428
+ export const Config = (() => {
429
+ const defaults = () => ({});
430
+ const create = (() => {
431
+ return uniffiCreateRecord(defaults);
432
+ })();
433
+ return Object.freeze({
434
+ /**
435
+ * Create a frozen instance of {@link Config}, with defaults specified
436
+ * in Rust, in the {@link bark} crate.
437
+ */
438
+ create,
439
+ /**
440
+ * Create a frozen instance of {@link Config}, with defaults specified
441
+ * in Rust, in the {@link bark} crate.
442
+ */
443
+ new: create,
444
+ /**
445
+ * Defaults specified in the {@link bark} crate.
446
+ */
447
+ defaults: () => Object.freeze(defaults())
448
+ });
449
+ })();
450
+ const FfiConverterTypeConfig = (() => {
451
+ class FFIConverter extends AbstractFfiConverterByteArray {
452
+ read(from) {
453
+ return {
454
+ serverAddress: FfiConverterString.read(from),
455
+ esploraAddress: FfiConverterOptionalString.read(from),
456
+ bitcoindAddress: FfiConverterOptionalString.read(from),
457
+ bitcoindCookiefile: FfiConverterOptionalString.read(from),
458
+ bitcoindUser: FfiConverterOptionalString.read(from),
459
+ bitcoindPass: FfiConverterOptionalString.read(from),
460
+ network: FfiConverterTypeNetwork.read(from),
461
+ vtxoRefreshExpiryThreshold: FfiConverterOptionalUInt32.read(from),
462
+ vtxoExitMargin: FfiConverterOptionalUInt16.read(from),
463
+ htlcRecvClaimDelta: FfiConverterOptionalUInt16.read(from),
464
+ fallbackFeeRate: FfiConverterOptionalUInt64.read(from),
465
+ roundTxRequiredConfirmations: FfiConverterOptionalUInt32.read(from)
466
+ };
467
+ }
468
+ write(value, into) {
469
+ FfiConverterString.write(value.serverAddress, into);
470
+ FfiConverterOptionalString.write(value.esploraAddress, into);
471
+ FfiConverterOptionalString.write(value.bitcoindAddress, into);
472
+ FfiConverterOptionalString.write(value.bitcoindCookiefile, into);
473
+ FfiConverterOptionalString.write(value.bitcoindUser, into);
474
+ FfiConverterOptionalString.write(value.bitcoindPass, into);
475
+ FfiConverterTypeNetwork.write(value.network, into);
476
+ FfiConverterOptionalUInt32.write(value.vtxoRefreshExpiryThreshold, into);
477
+ FfiConverterOptionalUInt16.write(value.vtxoExitMargin, into);
478
+ FfiConverterOptionalUInt16.write(value.htlcRecvClaimDelta, into);
479
+ FfiConverterOptionalUInt64.write(value.fallbackFeeRate, into);
480
+ FfiConverterOptionalUInt32.write(value.roundTxRequiredConfirmations, into);
481
+ }
482
+ allocationSize(value) {
483
+ return FfiConverterString.allocationSize(value.serverAddress) + FfiConverterOptionalString.allocationSize(value.esploraAddress) + FfiConverterOptionalString.allocationSize(value.bitcoindAddress) + FfiConverterOptionalString.allocationSize(value.bitcoindCookiefile) + FfiConverterOptionalString.allocationSize(value.bitcoindUser) + FfiConverterOptionalString.allocationSize(value.bitcoindPass) + FfiConverterTypeNetwork.allocationSize(value.network) + FfiConverterOptionalUInt32.allocationSize(value.vtxoRefreshExpiryThreshold) + FfiConverterOptionalUInt16.allocationSize(value.vtxoExitMargin) + FfiConverterOptionalUInt16.allocationSize(value.htlcRecvClaimDelta) + FfiConverterOptionalUInt64.allocationSize(value.fallbackFeeRate) + FfiConverterOptionalUInt32.allocationSize(value.roundTxRequiredConfirmations);
484
+ }
485
+ }
486
+ return new FFIConverter();
487
+ })();
488
+
489
+ /**
490
+ * Parameters for creating a CPFP (Child Pays For Parent) transaction
491
+ */
492
+
493
+ /**
494
+ * Generated factory for {@link CpfpParams} record objects.
495
+ */
496
+ export const CpfpParams = (() => {
497
+ const defaults = () => ({});
498
+ const create = (() => {
499
+ return uniffiCreateRecord(defaults);
500
+ })();
501
+ return Object.freeze({
502
+ /**
503
+ * Create a frozen instance of {@link CpfpParams}, with defaults specified
504
+ * in Rust, in the {@link bark} crate.
505
+ */
506
+ create,
507
+ /**
508
+ * Create a frozen instance of {@link CpfpParams}, with defaults specified
509
+ * in Rust, in the {@link bark} crate.
510
+ */
511
+ new: create,
512
+ /**
513
+ * Defaults specified in the {@link bark} crate.
514
+ */
515
+ defaults: () => Object.freeze(defaults())
516
+ });
517
+ })();
518
+ const FfiConverterTypeCpfpParams = (() => {
519
+ class FFIConverter extends AbstractFfiConverterByteArray {
520
+ read(from) {
521
+ return {
522
+ txHex: FfiConverterString.read(from),
523
+ feesType: FfiConverterString.read(from),
524
+ effectiveFeeRateSatPerVb: FfiConverterUInt64.read(from),
525
+ currentPackageFeeSats: FfiConverterOptionalUInt64.read(from)
526
+ };
527
+ }
528
+ write(value, into) {
529
+ FfiConverterString.write(value.txHex, into);
530
+ FfiConverterString.write(value.feesType, into);
531
+ FfiConverterUInt64.write(value.effectiveFeeRateSatPerVb, into);
532
+ FfiConverterOptionalUInt64.write(value.currentPackageFeeSats, into);
533
+ }
534
+ allocationSize(value) {
535
+ return FfiConverterString.allocationSize(value.txHex) + FfiConverterString.allocationSize(value.feesType) + FfiConverterUInt64.allocationSize(value.effectiveFeeRateSatPerVb) + FfiConverterOptionalUInt64.allocationSize(value.currentPackageFeeSats);
536
+ }
537
+ }
538
+ return new FFIConverter();
539
+ })();
540
+
541
+ /**
542
+ * A Bitcoin transaction output destination
543
+ */
544
+
545
+ /**
546
+ * Generated factory for {@link Destination} record objects.
547
+ */
548
+ export const Destination = (() => {
549
+ const defaults = () => ({});
550
+ const create = (() => {
551
+ return uniffiCreateRecord(defaults);
552
+ })();
553
+ return Object.freeze({
554
+ /**
555
+ * Create a frozen instance of {@link Destination}, with defaults specified
556
+ * in Rust, in the {@link bark} crate.
557
+ */
558
+ create,
559
+ /**
560
+ * Create a frozen instance of {@link Destination}, with defaults specified
561
+ * in Rust, in the {@link bark} crate.
562
+ */
563
+ new: create,
564
+ /**
565
+ * Defaults specified in the {@link bark} crate.
566
+ */
567
+ defaults: () => Object.freeze(defaults())
568
+ });
569
+ })();
570
+ const FfiConverterTypeDestination = (() => {
571
+ class FFIConverter extends AbstractFfiConverterByteArray {
572
+ read(from) {
573
+ return {
574
+ address: FfiConverterString.read(from),
575
+ amountSats: FfiConverterUInt64.read(from)
576
+ };
577
+ }
578
+ write(value, into) {
579
+ FfiConverterString.write(value.address, into);
580
+ FfiConverterUInt64.write(value.amountSats, into);
581
+ }
582
+ allocationSize(value) {
583
+ return FfiConverterString.allocationSize(value.address) + FfiConverterUInt64.allocationSize(value.amountSats);
584
+ }
585
+ }
586
+ return new FFIConverter();
587
+ })();
588
+
589
+ /**
590
+ * Claim transaction for exited funds
591
+ */
592
+
593
+ /**
594
+ * Generated factory for {@link ExitClaimTransaction} record objects.
595
+ */
596
+ export const ExitClaimTransaction = (() => {
597
+ const defaults = () => ({});
598
+ const create = (() => {
599
+ return uniffiCreateRecord(defaults);
600
+ })();
601
+ return Object.freeze({
602
+ /**
603
+ * Create a frozen instance of {@link ExitClaimTransaction}, with defaults specified
604
+ * in Rust, in the {@link bark} crate.
605
+ */
606
+ create,
607
+ /**
608
+ * Create a frozen instance of {@link ExitClaimTransaction}, with defaults specified
609
+ * in Rust, in the {@link bark} crate.
610
+ */
611
+ new: create,
612
+ /**
613
+ * Defaults specified in the {@link bark} crate.
614
+ */
615
+ defaults: () => Object.freeze(defaults())
616
+ });
617
+ })();
618
+ const FfiConverterTypeExitClaimTransaction = (() => {
619
+ class FFIConverter extends AbstractFfiConverterByteArray {
620
+ read(from) {
621
+ return {
622
+ psbtBase64: FfiConverterString.read(from),
623
+ feeSats: FfiConverterUInt64.read(from)
624
+ };
625
+ }
626
+ write(value, into) {
627
+ FfiConverterString.write(value.psbtBase64, into);
628
+ FfiConverterUInt64.write(value.feeSats, into);
629
+ }
630
+ allocationSize(value) {
631
+ return FfiConverterString.allocationSize(value.psbtBase64) + FfiConverterUInt64.allocationSize(value.feeSats);
632
+ }
633
+ }
634
+ return new FFIConverter();
635
+ })();
636
+
637
+ /**
638
+ * Status of an exit progression
639
+ */
640
+
641
+ /**
642
+ * Generated factory for {@link ExitProgressStatus} record objects.
643
+ */
644
+ export const ExitProgressStatus = (() => {
645
+ const defaults = () => ({});
646
+ const create = (() => {
647
+ return uniffiCreateRecord(defaults);
648
+ })();
649
+ return Object.freeze({
650
+ /**
651
+ * Create a frozen instance of {@link ExitProgressStatus}, with defaults specified
652
+ * in Rust, in the {@link bark} crate.
653
+ */
654
+ create,
655
+ /**
656
+ * Create a frozen instance of {@link ExitProgressStatus}, with defaults specified
657
+ * in Rust, in the {@link bark} crate.
658
+ */
659
+ new: create,
660
+ /**
661
+ * Defaults specified in the {@link bark} crate.
662
+ */
663
+ defaults: () => Object.freeze(defaults())
664
+ });
665
+ })();
666
+ const FfiConverterTypeExitProgressStatus = (() => {
667
+ class FFIConverter extends AbstractFfiConverterByteArray {
668
+ read(from) {
669
+ return {
670
+ vtxoId: FfiConverterString.read(from),
671
+ state: FfiConverterString.read(from),
672
+ error: FfiConverterOptionalString.read(from)
673
+ };
674
+ }
675
+ write(value, into) {
676
+ FfiConverterString.write(value.vtxoId, into);
677
+ FfiConverterString.write(value.state, into);
678
+ FfiConverterOptionalString.write(value.error, into);
679
+ }
680
+ allocationSize(value) {
681
+ return FfiConverterString.allocationSize(value.vtxoId) + FfiConverterString.allocationSize(value.state) + FfiConverterOptionalString.allocationSize(value.error);
682
+ }
683
+ }
684
+ return new FFIConverter();
685
+ })();
686
+
687
+ /**
688
+ * Detailed status of an exit transaction
689
+ */
690
+
691
+ /**
692
+ * Generated factory for {@link ExitTransactionStatus} record objects.
693
+ */
694
+ export const ExitTransactionStatus = (() => {
695
+ const defaults = () => ({});
696
+ const create = (() => {
697
+ return uniffiCreateRecord(defaults);
698
+ })();
699
+ return Object.freeze({
700
+ /**
701
+ * Create a frozen instance of {@link ExitTransactionStatus}, with defaults specified
702
+ * in Rust, in the {@link bark} crate.
703
+ */
704
+ create,
705
+ /**
706
+ * Create a frozen instance of {@link ExitTransactionStatus}, with defaults specified
707
+ * in Rust, in the {@link bark} crate.
708
+ */
709
+ new: create,
710
+ /**
711
+ * Defaults specified in the {@link bark} crate.
712
+ */
713
+ defaults: () => Object.freeze(defaults())
714
+ });
715
+ })();
716
+ const FfiConverterTypeExitTransactionStatus = (() => {
717
+ class FFIConverter extends AbstractFfiConverterByteArray {
718
+ read(from) {
719
+ return {
720
+ vtxoId: FfiConverterString.read(from),
721
+ state: FfiConverterString.read(from),
722
+ history: FfiConverterOptionalArrayString.read(from),
723
+ transactionCount: FfiConverterUInt32.read(from)
724
+ };
725
+ }
726
+ write(value, into) {
727
+ FfiConverterString.write(value.vtxoId, into);
728
+ FfiConverterString.write(value.state, into);
729
+ FfiConverterOptionalArrayString.write(value.history, into);
730
+ FfiConverterUInt32.write(value.transactionCount, into);
731
+ }
732
+ allocationSize(value) {
733
+ return FfiConverterString.allocationSize(value.vtxoId) + FfiConverterString.allocationSize(value.state) + FfiConverterOptionalArrayString.allocationSize(value.history) + FfiConverterUInt32.allocationSize(value.transactionCount);
734
+ }
735
+ }
736
+ return new FFIConverter();
737
+ })();
738
+
739
+ /**
740
+ * A VTXO in the exit process
741
+ */
742
+
743
+ /**
744
+ * Generated factory for {@link ExitVtxo} record objects.
745
+ */
746
+ export const ExitVtxo = (() => {
747
+ const defaults = () => ({});
748
+ const create = (() => {
749
+ return uniffiCreateRecord(defaults);
750
+ })();
751
+ return Object.freeze({
752
+ /**
753
+ * Create a frozen instance of {@link ExitVtxo}, with defaults specified
754
+ * in Rust, in the {@link bark} crate.
755
+ */
756
+ create,
757
+ /**
758
+ * Create a frozen instance of {@link ExitVtxo}, with defaults specified
759
+ * in Rust, in the {@link bark} crate.
760
+ */
761
+ new: create,
762
+ /**
763
+ * Defaults specified in the {@link bark} crate.
764
+ */
765
+ defaults: () => Object.freeze(defaults())
766
+ });
767
+ })();
768
+ const FfiConverterTypeExitVtxo = (() => {
769
+ class FFIConverter extends AbstractFfiConverterByteArray {
770
+ read(from) {
771
+ return {
772
+ vtxoId: FfiConverterString.read(from),
773
+ amountSats: FfiConverterUInt64.read(from),
774
+ state: FfiConverterString.read(from),
775
+ isClaimable: FfiConverterBool.read(from)
776
+ };
777
+ }
778
+ write(value, into) {
779
+ FfiConverterString.write(value.vtxoId, into);
780
+ FfiConverterUInt64.write(value.amountSats, into);
781
+ FfiConverterString.write(value.state, into);
782
+ FfiConverterBool.write(value.isClaimable, into);
783
+ }
784
+ allocationSize(value) {
785
+ return FfiConverterString.allocationSize(value.vtxoId) + FfiConverterUInt64.allocationSize(value.amountSats) + FfiConverterString.allocationSize(value.state) + FfiConverterBool.allocationSize(value.isClaimable);
786
+ }
787
+ }
788
+ return new FFIConverter();
789
+ })();
790
+
791
+ /**
792
+ * Result of creating a BOLT11 invoice
793
+ */
794
+
795
+ /**
796
+ * Generated factory for {@link LightningInvoice} record objects.
797
+ */
798
+ export const LightningInvoice = (() => {
799
+ const defaults = () => ({});
800
+ const create = (() => {
801
+ return uniffiCreateRecord(defaults);
802
+ })();
803
+ return Object.freeze({
804
+ /**
805
+ * Create a frozen instance of {@link LightningInvoice}, with defaults specified
806
+ * in Rust, in the {@link bark} crate.
807
+ */
808
+ create,
809
+ /**
810
+ * Create a frozen instance of {@link LightningInvoice}, with defaults specified
811
+ * in Rust, in the {@link bark} crate.
812
+ */
813
+ new: create,
814
+ /**
815
+ * Defaults specified in the {@link bark} crate.
816
+ */
817
+ defaults: () => Object.freeze(defaults())
818
+ });
819
+ })();
820
+ const FfiConverterTypeLightningInvoice = (() => {
821
+ class FFIConverter extends AbstractFfiConverterByteArray {
822
+ read(from) {
823
+ return {
824
+ invoice: FfiConverterString.read(from),
825
+ amountSats: FfiConverterUInt64.read(from)
826
+ };
827
+ }
828
+ write(value, into) {
829
+ FfiConverterString.write(value.invoice, into);
830
+ FfiConverterUInt64.write(value.amountSats, into);
831
+ }
832
+ allocationSize(value) {
833
+ return FfiConverterString.allocationSize(value.invoice) + FfiConverterUInt64.allocationSize(value.amountSats);
834
+ }
835
+ }
836
+ return new FFIConverter();
837
+ })();
838
+
839
+ /**
840
+ * Status of a pending Lightning receive
841
+ */
842
+
843
+ /**
844
+ * Generated factory for {@link LightningReceive} record objects.
845
+ */
846
+ export const LightningReceive = (() => {
847
+ const defaults = () => ({});
848
+ const create = (() => {
849
+ return uniffiCreateRecord(defaults);
850
+ })();
851
+ return Object.freeze({
852
+ /**
853
+ * Create a frozen instance of {@link LightningReceive}, with defaults specified
854
+ * in Rust, in the {@link bark} crate.
855
+ */
856
+ create,
857
+ /**
858
+ * Create a frozen instance of {@link LightningReceive}, with defaults specified
859
+ * in Rust, in the {@link bark} crate.
860
+ */
861
+ new: create,
862
+ /**
863
+ * Defaults specified in the {@link bark} crate.
864
+ */
865
+ defaults: () => Object.freeze(defaults())
866
+ });
867
+ })();
868
+ const FfiConverterTypeLightningReceive = (() => {
869
+ class FFIConverter extends AbstractFfiConverterByteArray {
870
+ read(from) {
871
+ return {
872
+ paymentHash: FfiConverterString.read(from),
873
+ invoice: FfiConverterString.read(from),
874
+ amountSats: FfiConverterUInt64.read(from),
875
+ hasHtlcVtxos: FfiConverterBool.read(from),
876
+ preimageRevealed: FfiConverterBool.read(from)
877
+ };
878
+ }
879
+ write(value, into) {
880
+ FfiConverterString.write(value.paymentHash, into);
881
+ FfiConverterString.write(value.invoice, into);
882
+ FfiConverterUInt64.write(value.amountSats, into);
883
+ FfiConverterBool.write(value.hasHtlcVtxos, into);
884
+ FfiConverterBool.write(value.preimageRevealed, into);
885
+ }
886
+ allocationSize(value) {
887
+ return FfiConverterString.allocationSize(value.paymentHash) + FfiConverterString.allocationSize(value.invoice) + FfiConverterUInt64.allocationSize(value.amountSats) + FfiConverterBool.allocationSize(value.hasHtlcVtxos) + FfiConverterBool.allocationSize(value.preimageRevealed);
888
+ }
889
+ }
890
+ return new FFIConverter();
891
+ })();
892
+
893
+ /**
894
+ * Lightning send payment information
895
+ */
896
+
897
+ /**
898
+ * Generated factory for {@link LightningSend} record objects.
899
+ */
900
+ export const LightningSend = (() => {
901
+ const defaults = () => ({});
902
+ const create = (() => {
903
+ return uniffiCreateRecord(defaults);
904
+ })();
905
+ return Object.freeze({
906
+ /**
907
+ * Create a frozen instance of {@link LightningSend}, with defaults specified
908
+ * in Rust, in the {@link bark} crate.
909
+ */
910
+ create,
911
+ /**
912
+ * Create a frozen instance of {@link LightningSend}, with defaults specified
913
+ * in Rust, in the {@link bark} crate.
914
+ */
915
+ new: create,
916
+ /**
917
+ * Defaults specified in the {@link bark} crate.
918
+ */
919
+ defaults: () => Object.freeze(defaults())
920
+ });
921
+ })();
922
+ const FfiConverterTypeLightningSend = (() => {
923
+ class FFIConverter extends AbstractFfiConverterByteArray {
924
+ read(from) {
925
+ return {
926
+ invoice: FfiConverterString.read(from),
927
+ amountSats: FfiConverterUInt64.read(from),
928
+ htlcVtxoCount: FfiConverterUInt32.read(from),
929
+ preimage: FfiConverterOptionalString.read(from)
930
+ };
931
+ }
932
+ write(value, into) {
933
+ FfiConverterString.write(value.invoice, into);
934
+ FfiConverterUInt64.write(value.amountSats, into);
935
+ FfiConverterUInt32.write(value.htlcVtxoCount, into);
936
+ FfiConverterOptionalString.write(value.preimage, into);
937
+ }
938
+ allocationSize(value) {
939
+ return FfiConverterString.allocationSize(value.invoice) + FfiConverterUInt64.allocationSize(value.amountSats) + FfiConverterUInt32.allocationSize(value.htlcVtxoCount) + FfiConverterOptionalString.allocationSize(value.preimage);
940
+ }
941
+ }
942
+ return new FFIConverter();
943
+ })();
944
+
945
+ /**
946
+ * Wallet movement/transaction record
947
+ */
948
+
949
+ /**
950
+ * Generated factory for {@link Movement} record objects.
951
+ */
952
+ export const Movement = (() => {
953
+ const defaults = () => ({});
954
+ const create = (() => {
955
+ return uniffiCreateRecord(defaults);
956
+ })();
957
+ return Object.freeze({
958
+ /**
959
+ * Create a frozen instance of {@link Movement}, with defaults specified
960
+ * in Rust, in the {@link bark} crate.
961
+ */
962
+ create,
963
+ /**
964
+ * Create a frozen instance of {@link Movement}, with defaults specified
965
+ * in Rust, in the {@link bark} crate.
966
+ */
967
+ new: create,
968
+ /**
969
+ * Defaults specified in the {@link bark} crate.
970
+ */
971
+ defaults: () => Object.freeze(defaults())
972
+ });
973
+ })();
974
+ const FfiConverterTypeMovement = (() => {
975
+ class FFIConverter extends AbstractFfiConverterByteArray {
976
+ read(from) {
977
+ return {
978
+ id: FfiConverterUInt32.read(from),
979
+ status: FfiConverterString.read(from),
980
+ subsystemName: FfiConverterString.read(from),
981
+ subsystemKind: FfiConverterString.read(from),
982
+ metadataJson: FfiConverterString.read(from),
983
+ intendedBalanceSats: FfiConverterInt64.read(from),
984
+ effectiveBalanceSats: FfiConverterInt64.read(from),
985
+ offchainFeeSats: FfiConverterUInt64.read(from),
986
+ sentToAddresses: FfiConverterArrayString.read(from),
987
+ receivedOnAddresses: FfiConverterArrayString.read(from),
988
+ inputVtxoIds: FfiConverterArrayString.read(from),
989
+ outputVtxoIds: FfiConverterArrayString.read(from),
990
+ exitedVtxoIds: FfiConverterArrayString.read(from),
991
+ createdAt: FfiConverterString.read(from),
992
+ updatedAt: FfiConverterString.read(from),
993
+ completedAt: FfiConverterOptionalString.read(from)
994
+ };
995
+ }
996
+ write(value, into) {
997
+ FfiConverterUInt32.write(value.id, into);
998
+ FfiConverterString.write(value.status, into);
999
+ FfiConverterString.write(value.subsystemName, into);
1000
+ FfiConverterString.write(value.subsystemKind, into);
1001
+ FfiConverterString.write(value.metadataJson, into);
1002
+ FfiConverterInt64.write(value.intendedBalanceSats, into);
1003
+ FfiConverterInt64.write(value.effectiveBalanceSats, into);
1004
+ FfiConverterUInt64.write(value.offchainFeeSats, into);
1005
+ FfiConverterArrayString.write(value.sentToAddresses, into);
1006
+ FfiConverterArrayString.write(value.receivedOnAddresses, into);
1007
+ FfiConverterArrayString.write(value.inputVtxoIds, into);
1008
+ FfiConverterArrayString.write(value.outputVtxoIds, into);
1009
+ FfiConverterArrayString.write(value.exitedVtxoIds, into);
1010
+ FfiConverterString.write(value.createdAt, into);
1011
+ FfiConverterString.write(value.updatedAt, into);
1012
+ FfiConverterOptionalString.write(value.completedAt, into);
1013
+ }
1014
+ allocationSize(value) {
1015
+ return FfiConverterUInt32.allocationSize(value.id) + FfiConverterString.allocationSize(value.status) + FfiConverterString.allocationSize(value.subsystemName) + FfiConverterString.allocationSize(value.subsystemKind) + FfiConverterString.allocationSize(value.metadataJson) + FfiConverterInt64.allocationSize(value.intendedBalanceSats) + FfiConverterInt64.allocationSize(value.effectiveBalanceSats) + FfiConverterUInt64.allocationSize(value.offchainFeeSats) + FfiConverterArrayString.allocationSize(value.sentToAddresses) + FfiConverterArrayString.allocationSize(value.receivedOnAddresses) + FfiConverterArrayString.allocationSize(value.inputVtxoIds) + FfiConverterArrayString.allocationSize(value.outputVtxoIds) + FfiConverterArrayString.allocationSize(value.exitedVtxoIds) + FfiConverterString.allocationSize(value.createdAt) + FfiConverterString.allocationSize(value.updatedAt) + FfiConverterOptionalString.allocationSize(value.completedAt);
1016
+ }
1017
+ }
1018
+ return new FFIConverter();
1019
+ })();
1020
+
1021
+ /**
1022
+ * Result of an offboard operation
1023
+ */
1024
+
1025
+ /**
1026
+ * Generated factory for {@link OffboardResult} record objects.
1027
+ */
1028
+ export const OffboardResult = (() => {
1029
+ const defaults = () => ({});
1030
+ const create = (() => {
1031
+ return uniffiCreateRecord(defaults);
1032
+ })();
1033
+ return Object.freeze({
1034
+ /**
1035
+ * Create a frozen instance of {@link OffboardResult}, with defaults specified
1036
+ * in Rust, in the {@link bark} crate.
1037
+ */
1038
+ create,
1039
+ /**
1040
+ * Create a frozen instance of {@link OffboardResult}, with defaults specified
1041
+ * in Rust, in the {@link bark} crate.
1042
+ */
1043
+ new: create,
1044
+ /**
1045
+ * Defaults specified in the {@link bark} crate.
1046
+ */
1047
+ defaults: () => Object.freeze(defaults())
1048
+ });
1049
+ })();
1050
+ const FfiConverterTypeOffboardResult = (() => {
1051
+ class FFIConverter extends AbstractFfiConverterByteArray {
1052
+ read(from) {
1053
+ return {
1054
+ roundId: FfiConverterString.read(from)
1055
+ };
1056
+ }
1057
+ write(value, into) {
1058
+ FfiConverterString.write(value.roundId, into);
1059
+ }
1060
+ allocationSize(value) {
1061
+ return FfiConverterString.allocationSize(value.roundId);
1062
+ }
1063
+ }
1064
+ return new FFIConverter();
1065
+ })();
1066
+
1067
+ /**
1068
+ * Onchain Bitcoin wallet balance
1069
+ */
1070
+
1071
+ /**
1072
+ * Generated factory for {@link OnchainBalance} record objects.
1073
+ */
1074
+ export const OnchainBalance = (() => {
1075
+ const defaults = () => ({});
1076
+ const create = (() => {
1077
+ return uniffiCreateRecord(defaults);
1078
+ })();
1079
+ return Object.freeze({
1080
+ /**
1081
+ * Create a frozen instance of {@link OnchainBalance}, with defaults specified
1082
+ * in Rust, in the {@link bark} crate.
1083
+ */
1084
+ create,
1085
+ /**
1086
+ * Create a frozen instance of {@link OnchainBalance}, with defaults specified
1087
+ * in Rust, in the {@link bark} crate.
1088
+ */
1089
+ new: create,
1090
+ /**
1091
+ * Defaults specified in the {@link bark} crate.
1092
+ */
1093
+ defaults: () => Object.freeze(defaults())
1094
+ });
1095
+ })();
1096
+ const FfiConverterTypeOnchainBalance = (() => {
1097
+ class FFIConverter extends AbstractFfiConverterByteArray {
1098
+ read(from) {
1099
+ return {
1100
+ confirmedSats: FfiConverterUInt64.read(from),
1101
+ pendingSats: FfiConverterUInt64.read(from),
1102
+ totalSats: FfiConverterUInt64.read(from)
1103
+ };
1104
+ }
1105
+ write(value, into) {
1106
+ FfiConverterUInt64.write(value.confirmedSats, into);
1107
+ FfiConverterUInt64.write(value.pendingSats, into);
1108
+ FfiConverterUInt64.write(value.totalSats, into);
1109
+ }
1110
+ allocationSize(value) {
1111
+ return FfiConverterUInt64.allocationSize(value.confirmedSats) + FfiConverterUInt64.allocationSize(value.pendingSats) + FfiConverterUInt64.allocationSize(value.totalSats);
1112
+ }
1113
+ }
1114
+ return new FFIConverter();
1115
+ })();
1116
+
1117
+ /**
1118
+ * A Bitcoin transaction outpoint (reference to a previous output)
1119
+ */
1120
+
1121
+ /**
1122
+ * Generated factory for {@link OutPoint} record objects.
1123
+ */
1124
+ export const OutPoint = (() => {
1125
+ const defaults = () => ({});
1126
+ const create = (() => {
1127
+ return uniffiCreateRecord(defaults);
1128
+ })();
1129
+ return Object.freeze({
1130
+ /**
1131
+ * Create a frozen instance of {@link OutPoint}, with defaults specified
1132
+ * in Rust, in the {@link bark} crate.
1133
+ */
1134
+ create,
1135
+ /**
1136
+ * Create a frozen instance of {@link OutPoint}, with defaults specified
1137
+ * in Rust, in the {@link bark} crate.
1138
+ */
1139
+ new: create,
1140
+ /**
1141
+ * Defaults specified in the {@link bark} crate.
1142
+ */
1143
+ defaults: () => Object.freeze(defaults())
1144
+ });
1145
+ })();
1146
+ const FfiConverterTypeOutPoint = (() => {
1147
+ class FFIConverter extends AbstractFfiConverterByteArray {
1148
+ read(from) {
1149
+ return {
1150
+ txid: FfiConverterString.read(from),
1151
+ vout: FfiConverterUInt32.read(from)
1152
+ };
1153
+ }
1154
+ write(value, into) {
1155
+ FfiConverterString.write(value.txid, into);
1156
+ FfiConverterUInt32.write(value.vout, into);
1157
+ }
1158
+ allocationSize(value) {
1159
+ return FfiConverterString.allocationSize(value.txid) + FfiConverterUInt32.allocationSize(value.vout);
1160
+ }
1161
+ }
1162
+ return new FFIConverter();
1163
+ })();
1164
+
1165
+ /**
1166
+ * Pending board transaction information
1167
+ */
1168
+
1169
+ /**
1170
+ * Generated factory for {@link PendingBoard} record objects.
1171
+ */
1172
+ export const PendingBoard = (() => {
1173
+ const defaults = () => ({});
1174
+ const create = (() => {
1175
+ return uniffiCreateRecord(defaults);
1176
+ })();
1177
+ return Object.freeze({
1178
+ /**
1179
+ * Create a frozen instance of {@link PendingBoard}, with defaults specified
1180
+ * in Rust, in the {@link bark} crate.
1181
+ */
1182
+ create,
1183
+ /**
1184
+ * Create a frozen instance of {@link PendingBoard}, with defaults specified
1185
+ * in Rust, in the {@link bark} crate.
1186
+ */
1187
+ new: create,
1188
+ /**
1189
+ * Defaults specified in the {@link bark} crate.
1190
+ */
1191
+ defaults: () => Object.freeze(defaults())
1192
+ });
1193
+ })();
1194
+ const FfiConverterTypePendingBoard = (() => {
1195
+ class FFIConverter extends AbstractFfiConverterByteArray {
1196
+ read(from) {
1197
+ return {
1198
+ vtxoId: FfiConverterString.read(from),
1199
+ amountSats: FfiConverterUInt64.read(from),
1200
+ txid: FfiConverterString.read(from)
1201
+ };
1202
+ }
1203
+ write(value, into) {
1204
+ FfiConverterString.write(value.vtxoId, into);
1205
+ FfiConverterUInt64.write(value.amountSats, into);
1206
+ FfiConverterString.write(value.txid, into);
1207
+ }
1208
+ allocationSize(value) {
1209
+ return FfiConverterString.allocationSize(value.vtxoId) + FfiConverterUInt64.allocationSize(value.amountSats) + FfiConverterString.allocationSize(value.txid);
1210
+ }
1211
+ }
1212
+ return new FFIConverter();
1213
+ })();
1214
+
1215
+ /**
1216
+ * A pending round state
1217
+ */
1218
+
1219
+ /**
1220
+ * Generated factory for {@link RoundState} record objects.
1221
+ */
1222
+ export const RoundState = (() => {
1223
+ const defaults = () => ({});
1224
+ const create = (() => {
1225
+ return uniffiCreateRecord(defaults);
1226
+ })();
1227
+ return Object.freeze({
1228
+ /**
1229
+ * Create a frozen instance of {@link RoundState}, with defaults specified
1230
+ * in Rust, in the {@link bark} crate.
1231
+ */
1232
+ create,
1233
+ /**
1234
+ * Create a frozen instance of {@link RoundState}, with defaults specified
1235
+ * in Rust, in the {@link bark} crate.
1236
+ */
1237
+ new: create,
1238
+ /**
1239
+ * Defaults specified in the {@link bark} crate.
1240
+ */
1241
+ defaults: () => Object.freeze(defaults())
1242
+ });
1243
+ })();
1244
+ const FfiConverterTypeRoundState = (() => {
1245
+ class FFIConverter extends AbstractFfiConverterByteArray {
1246
+ read(from) {
1247
+ return {
1248
+ id: FfiConverterUInt32.read(from),
1249
+ ongoing: FfiConverterBool.read(from)
1250
+ };
1251
+ }
1252
+ write(value, into) {
1253
+ FfiConverterUInt32.write(value.id, into);
1254
+ FfiConverterBool.write(value.ongoing, into);
1255
+ }
1256
+ allocationSize(value) {
1257
+ return FfiConverterUInt32.allocationSize(value.id) + FfiConverterBool.allocationSize(value.ongoing);
1258
+ }
1259
+ }
1260
+ return new FFIConverter();
1261
+ })();
1262
+
1263
+ /**
1264
+ * Simplified view of a VTXO
1265
+ */
1266
+
1267
+ /**
1268
+ * Generated factory for {@link Vtxo} record objects.
1269
+ */
1270
+ export const Vtxo = (() => {
1271
+ const defaults = () => ({});
1272
+ const create = (() => {
1273
+ return uniffiCreateRecord(defaults);
1274
+ })();
1275
+ return Object.freeze({
1276
+ /**
1277
+ * Create a frozen instance of {@link Vtxo}, with defaults specified
1278
+ * in Rust, in the {@link bark} crate.
1279
+ */
1280
+ create,
1281
+ /**
1282
+ * Create a frozen instance of {@link Vtxo}, with defaults specified
1283
+ * in Rust, in the {@link bark} crate.
1284
+ */
1285
+ new: create,
1286
+ /**
1287
+ * Defaults specified in the {@link bark} crate.
1288
+ */
1289
+ defaults: () => Object.freeze(defaults())
1290
+ });
1291
+ })();
1292
+ const FfiConverterTypeVtxo = (() => {
1293
+ class FFIConverter extends AbstractFfiConverterByteArray {
1294
+ read(from) {
1295
+ return {
1296
+ id: FfiConverterString.read(from),
1297
+ amountSats: FfiConverterUInt64.read(from),
1298
+ expiryHeight: FfiConverterUInt32.read(from),
1299
+ kind: FfiConverterString.read(from),
1300
+ state: FfiConverterString.read(from)
1301
+ };
1302
+ }
1303
+ write(value, into) {
1304
+ FfiConverterString.write(value.id, into);
1305
+ FfiConverterUInt64.write(value.amountSats, into);
1306
+ FfiConverterUInt32.write(value.expiryHeight, into);
1307
+ FfiConverterString.write(value.kind, into);
1308
+ FfiConverterString.write(value.state, into);
1309
+ }
1310
+ allocationSize(value) {
1311
+ return FfiConverterString.allocationSize(value.id) + FfiConverterUInt64.allocationSize(value.amountSats) + FfiConverterUInt32.allocationSize(value.expiryHeight) + FfiConverterString.allocationSize(value.kind) + FfiConverterString.allocationSize(value.state);
1312
+ }
1313
+ }
1314
+ return new FFIConverter();
1315
+ })();
1316
+
1317
+ /**
1318
+ * Read-only properties of the wallet
1319
+ */
1320
+
1321
+ /**
1322
+ * Generated factory for {@link WalletProperties} record objects.
1323
+ */
1324
+ export const WalletProperties = (() => {
1325
+ const defaults = () => ({});
1326
+ const create = (() => {
1327
+ return uniffiCreateRecord(defaults);
1328
+ })();
1329
+ return Object.freeze({
1330
+ /**
1331
+ * Create a frozen instance of {@link WalletProperties}, with defaults specified
1332
+ * in Rust, in the {@link bark} crate.
1333
+ */
1334
+ create,
1335
+ /**
1336
+ * Create a frozen instance of {@link WalletProperties}, with defaults specified
1337
+ * in Rust, in the {@link bark} crate.
1338
+ */
1339
+ new: create,
1340
+ /**
1341
+ * Defaults specified in the {@link bark} crate.
1342
+ */
1343
+ defaults: () => Object.freeze(defaults())
1344
+ });
1345
+ })();
1346
+ const FfiConverterTypeWalletProperties = (() => {
1347
+ class FFIConverter extends AbstractFfiConverterByteArray {
1348
+ read(from) {
1349
+ return {
1350
+ network: FfiConverterTypeNetwork.read(from),
1351
+ fingerprint: FfiConverterString.read(from)
1352
+ };
1353
+ }
1354
+ write(value, into) {
1355
+ FfiConverterTypeNetwork.write(value.network, into);
1356
+ FfiConverterString.write(value.fingerprint, into);
1357
+ }
1358
+ allocationSize(value) {
1359
+ return FfiConverterTypeNetwork.allocationSize(value.network) + FfiConverterString.allocationSize(value.fingerprint);
1360
+ }
1361
+ }
1362
+ return new FFIConverter();
1363
+ })();
1364
+ const stringConverter = {
1365
+ stringToBytes: s => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer(s, status)),
1366
+ bytesToString: ab => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string(ab, status)),
1367
+ stringByteLength: s => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length(s, status))
1368
+ };
1369
+ const FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
1370
+
1371
+ // Error type: BarkError
1372
+
1373
+ // Enum: BarkError
1374
+ export let BarkError_Tags = /*#__PURE__*/function (BarkError_Tags) {
1375
+ BarkError_Tags["Network"] = "Network";
1376
+ BarkError_Tags["Database"] = "Database";
1377
+ BarkError_Tags["InvalidMnemonic"] = "InvalidMnemonic";
1378
+ BarkError_Tags["InvalidAddress"] = "InvalidAddress";
1379
+ BarkError_Tags["InvalidInvoice"] = "InvalidInvoice";
1380
+ BarkError_Tags["InvalidPsbt"] = "InvalidPsbt";
1381
+ BarkError_Tags["InvalidTransaction"] = "InvalidTransaction";
1382
+ BarkError_Tags["InsufficientFunds"] = "InsufficientFunds";
1383
+ BarkError_Tags["NotFound"] = "NotFound";
1384
+ BarkError_Tags["ServerConnection"] = "ServerConnection";
1385
+ BarkError_Tags["Internal"] = "Internal";
1386
+ BarkError_Tags["OnchainWalletRequired"] = "OnchainWalletRequired";
1387
+ return BarkError_Tags;
1388
+ }({});
1389
+ /**
1390
+ * Error types that can occur when using the Bark wallet
1391
+ */
1392
+ export const BarkError = (() => {
1393
+ class Network_ extends UniffiError {
1394
+ /**
1395
+ * @private
1396
+ * This field is private and should not be used, use `tag` instead.
1397
+ */
1398
+ [uniffiTypeNameSymbol] = "BarkError";
1399
+ tag = BarkError_Tags.Network;
1400
+ constructor(inner) {
1401
+ super("BarkError", "Network");
1402
+ this.inner = Object.freeze(inner);
1403
+ }
1404
+ static new(inner) {
1405
+ return new Network_(inner);
1406
+ }
1407
+ static instanceOf(obj) {
1408
+ return obj.tag === BarkError_Tags.Network;
1409
+ }
1410
+ static hasInner(obj) {
1411
+ return Network_.instanceOf(obj);
1412
+ }
1413
+ static getInner(obj) {
1414
+ return obj.inner;
1415
+ }
1416
+ }
1417
+ class Database_ extends UniffiError {
1418
+ /**
1419
+ * @private
1420
+ * This field is private and should not be used, use `tag` instead.
1421
+ */
1422
+ [uniffiTypeNameSymbol] = "BarkError";
1423
+ tag = BarkError_Tags.Database;
1424
+ constructor(inner) {
1425
+ super("BarkError", "Database");
1426
+ this.inner = Object.freeze(inner);
1427
+ }
1428
+ static new(inner) {
1429
+ return new Database_(inner);
1430
+ }
1431
+ static instanceOf(obj) {
1432
+ return obj.tag === BarkError_Tags.Database;
1433
+ }
1434
+ static hasInner(obj) {
1435
+ return Database_.instanceOf(obj);
1436
+ }
1437
+ static getInner(obj) {
1438
+ return obj.inner;
1439
+ }
1440
+ }
1441
+ class InvalidMnemonic_ extends UniffiError {
1442
+ /**
1443
+ * @private
1444
+ * This field is private and should not be used, use `tag` instead.
1445
+ */
1446
+ [uniffiTypeNameSymbol] = "BarkError";
1447
+ tag = BarkError_Tags.InvalidMnemonic;
1448
+ constructor(inner) {
1449
+ super("BarkError", "InvalidMnemonic");
1450
+ this.inner = Object.freeze(inner);
1451
+ }
1452
+ static new(inner) {
1453
+ return new InvalidMnemonic_(inner);
1454
+ }
1455
+ static instanceOf(obj) {
1456
+ return obj.tag === BarkError_Tags.InvalidMnemonic;
1457
+ }
1458
+ static hasInner(obj) {
1459
+ return InvalidMnemonic_.instanceOf(obj);
1460
+ }
1461
+ static getInner(obj) {
1462
+ return obj.inner;
1463
+ }
1464
+ }
1465
+ class InvalidAddress_ extends UniffiError {
1466
+ /**
1467
+ * @private
1468
+ * This field is private and should not be used, use `tag` instead.
1469
+ */
1470
+ [uniffiTypeNameSymbol] = "BarkError";
1471
+ tag = BarkError_Tags.InvalidAddress;
1472
+ constructor(inner) {
1473
+ super("BarkError", "InvalidAddress");
1474
+ this.inner = Object.freeze(inner);
1475
+ }
1476
+ static new(inner) {
1477
+ return new InvalidAddress_(inner);
1478
+ }
1479
+ static instanceOf(obj) {
1480
+ return obj.tag === BarkError_Tags.InvalidAddress;
1481
+ }
1482
+ static hasInner(obj) {
1483
+ return InvalidAddress_.instanceOf(obj);
1484
+ }
1485
+ static getInner(obj) {
1486
+ return obj.inner;
1487
+ }
1488
+ }
1489
+ class InvalidInvoice_ extends UniffiError {
1490
+ /**
1491
+ * @private
1492
+ * This field is private and should not be used, use `tag` instead.
1493
+ */
1494
+ [uniffiTypeNameSymbol] = "BarkError";
1495
+ tag = BarkError_Tags.InvalidInvoice;
1496
+ constructor(inner) {
1497
+ super("BarkError", "InvalidInvoice");
1498
+ this.inner = Object.freeze(inner);
1499
+ }
1500
+ static new(inner) {
1501
+ return new InvalidInvoice_(inner);
1502
+ }
1503
+ static instanceOf(obj) {
1504
+ return obj.tag === BarkError_Tags.InvalidInvoice;
1505
+ }
1506
+ static hasInner(obj) {
1507
+ return InvalidInvoice_.instanceOf(obj);
1508
+ }
1509
+ static getInner(obj) {
1510
+ return obj.inner;
1511
+ }
1512
+ }
1513
+ class InvalidPsbt_ extends UniffiError {
1514
+ /**
1515
+ * @private
1516
+ * This field is private and should not be used, use `tag` instead.
1517
+ */
1518
+ [uniffiTypeNameSymbol] = "BarkError";
1519
+ tag = BarkError_Tags.InvalidPsbt;
1520
+ constructor(inner) {
1521
+ super("BarkError", "InvalidPsbt");
1522
+ this.inner = Object.freeze(inner);
1523
+ }
1524
+ static new(inner) {
1525
+ return new InvalidPsbt_(inner);
1526
+ }
1527
+ static instanceOf(obj) {
1528
+ return obj.tag === BarkError_Tags.InvalidPsbt;
1529
+ }
1530
+ static hasInner(obj) {
1531
+ return InvalidPsbt_.instanceOf(obj);
1532
+ }
1533
+ static getInner(obj) {
1534
+ return obj.inner;
1535
+ }
1536
+ }
1537
+ class InvalidTransaction_ extends UniffiError {
1538
+ /**
1539
+ * @private
1540
+ * This field is private and should not be used, use `tag` instead.
1541
+ */
1542
+ [uniffiTypeNameSymbol] = "BarkError";
1543
+ tag = BarkError_Tags.InvalidTransaction;
1544
+ constructor(inner) {
1545
+ super("BarkError", "InvalidTransaction");
1546
+ this.inner = Object.freeze(inner);
1547
+ }
1548
+ static new(inner) {
1549
+ return new InvalidTransaction_(inner);
1550
+ }
1551
+ static instanceOf(obj) {
1552
+ return obj.tag === BarkError_Tags.InvalidTransaction;
1553
+ }
1554
+ static hasInner(obj) {
1555
+ return InvalidTransaction_.instanceOf(obj);
1556
+ }
1557
+ static getInner(obj) {
1558
+ return obj.inner;
1559
+ }
1560
+ }
1561
+ class InsufficientFunds_ extends UniffiError {
1562
+ /**
1563
+ * @private
1564
+ * This field is private and should not be used, use `tag` instead.
1565
+ */
1566
+ [uniffiTypeNameSymbol] = "BarkError";
1567
+ tag = BarkError_Tags.InsufficientFunds;
1568
+ constructor(inner) {
1569
+ super("BarkError", "InsufficientFunds");
1570
+ this.inner = Object.freeze(inner);
1571
+ }
1572
+ static new(inner) {
1573
+ return new InsufficientFunds_(inner);
1574
+ }
1575
+ static instanceOf(obj) {
1576
+ return obj.tag === BarkError_Tags.InsufficientFunds;
1577
+ }
1578
+ static hasInner(obj) {
1579
+ return InsufficientFunds_.instanceOf(obj);
1580
+ }
1581
+ static getInner(obj) {
1582
+ return obj.inner;
1583
+ }
1584
+ }
1585
+ class NotFound_ extends UniffiError {
1586
+ /**
1587
+ * @private
1588
+ * This field is private and should not be used, use `tag` instead.
1589
+ */
1590
+ [uniffiTypeNameSymbol] = "BarkError";
1591
+ tag = BarkError_Tags.NotFound;
1592
+ constructor(inner) {
1593
+ super("BarkError", "NotFound");
1594
+ this.inner = Object.freeze(inner);
1595
+ }
1596
+ static new(inner) {
1597
+ return new NotFound_(inner);
1598
+ }
1599
+ static instanceOf(obj) {
1600
+ return obj.tag === BarkError_Tags.NotFound;
1601
+ }
1602
+ static hasInner(obj) {
1603
+ return NotFound_.instanceOf(obj);
1604
+ }
1605
+ static getInner(obj) {
1606
+ return obj.inner;
1607
+ }
1608
+ }
1609
+ class ServerConnection_ extends UniffiError {
1610
+ /**
1611
+ * @private
1612
+ * This field is private and should not be used, use `tag` instead.
1613
+ */
1614
+ [uniffiTypeNameSymbol] = "BarkError";
1615
+ tag = BarkError_Tags.ServerConnection;
1616
+ constructor(inner) {
1617
+ super("BarkError", "ServerConnection");
1618
+ this.inner = Object.freeze(inner);
1619
+ }
1620
+ static new(inner) {
1621
+ return new ServerConnection_(inner);
1622
+ }
1623
+ static instanceOf(obj) {
1624
+ return obj.tag === BarkError_Tags.ServerConnection;
1625
+ }
1626
+ static hasInner(obj) {
1627
+ return ServerConnection_.instanceOf(obj);
1628
+ }
1629
+ static getInner(obj) {
1630
+ return obj.inner;
1631
+ }
1632
+ }
1633
+ class Internal_ extends UniffiError {
1634
+ /**
1635
+ * @private
1636
+ * This field is private and should not be used, use `tag` instead.
1637
+ */
1638
+ [uniffiTypeNameSymbol] = "BarkError";
1639
+ tag = BarkError_Tags.Internal;
1640
+ constructor(inner) {
1641
+ super("BarkError", "Internal");
1642
+ this.inner = Object.freeze(inner);
1643
+ }
1644
+ static new(inner) {
1645
+ return new Internal_(inner);
1646
+ }
1647
+ static instanceOf(obj) {
1648
+ return obj.tag === BarkError_Tags.Internal;
1649
+ }
1650
+ static hasInner(obj) {
1651
+ return Internal_.instanceOf(obj);
1652
+ }
1653
+ static getInner(obj) {
1654
+ return obj.inner;
1655
+ }
1656
+ }
1657
+ class OnchainWalletRequired_ extends UniffiError {
1658
+ /**
1659
+ * @private
1660
+ * This field is private and should not be used, use `tag` instead.
1661
+ */
1662
+ [uniffiTypeNameSymbol] = "BarkError";
1663
+ tag = BarkError_Tags.OnchainWalletRequired;
1664
+ constructor(inner) {
1665
+ super("BarkError", "OnchainWalletRequired");
1666
+ this.inner = Object.freeze(inner);
1667
+ }
1668
+ static new(inner) {
1669
+ return new OnchainWalletRequired_(inner);
1670
+ }
1671
+ static instanceOf(obj) {
1672
+ return obj.tag === BarkError_Tags.OnchainWalletRequired;
1673
+ }
1674
+ static hasInner(obj) {
1675
+ return OnchainWalletRequired_.instanceOf(obj);
1676
+ }
1677
+ static getInner(obj) {
1678
+ return obj.inner;
1679
+ }
1680
+ }
1681
+ function instanceOf(obj) {
1682
+ return obj[uniffiTypeNameSymbol] === "BarkError";
1683
+ }
1684
+ return Object.freeze({
1685
+ instanceOf,
1686
+ Network: Network_,
1687
+ Database: Database_,
1688
+ InvalidMnemonic: InvalidMnemonic_,
1689
+ InvalidAddress: InvalidAddress_,
1690
+ InvalidInvoice: InvalidInvoice_,
1691
+ InvalidPsbt: InvalidPsbt_,
1692
+ InvalidTransaction: InvalidTransaction_,
1693
+ InsufficientFunds: InsufficientFunds_,
1694
+ NotFound: NotFound_,
1695
+ ServerConnection: ServerConnection_,
1696
+ Internal: Internal_,
1697
+ OnchainWalletRequired: OnchainWalletRequired_
1698
+ });
1699
+ })();
1700
+
1701
+ /**
1702
+ * Error types that can occur when using the Bark wallet
1703
+ */
1704
+
1705
+ // FfiConverter for enum BarkError
1706
+ const FfiConverterTypeBarkError = (() => {
1707
+ const ordinalConverter = FfiConverterInt32;
1708
+ class FFIConverter extends AbstractFfiConverterByteArray {
1709
+ read(from) {
1710
+ switch (ordinalConverter.read(from)) {
1711
+ case 1:
1712
+ return new BarkError.Network({
1713
+ errorMessage: FfiConverterString.read(from)
1714
+ });
1715
+ case 2:
1716
+ return new BarkError.Database({
1717
+ errorMessage: FfiConverterString.read(from)
1718
+ });
1719
+ case 3:
1720
+ return new BarkError.InvalidMnemonic({
1721
+ errorMessage: FfiConverterString.read(from)
1722
+ });
1723
+ case 4:
1724
+ return new BarkError.InvalidAddress({
1725
+ errorMessage: FfiConverterString.read(from)
1726
+ });
1727
+ case 5:
1728
+ return new BarkError.InvalidInvoice({
1729
+ errorMessage: FfiConverterString.read(from)
1730
+ });
1731
+ case 6:
1732
+ return new BarkError.InvalidPsbt({
1733
+ errorMessage: FfiConverterString.read(from)
1734
+ });
1735
+ case 7:
1736
+ return new BarkError.InvalidTransaction({
1737
+ errorMessage: FfiConverterString.read(from)
1738
+ });
1739
+ case 8:
1740
+ return new BarkError.InsufficientFunds({
1741
+ errorMessage: FfiConverterString.read(from)
1742
+ });
1743
+ case 9:
1744
+ return new BarkError.NotFound({
1745
+ errorMessage: FfiConverterString.read(from)
1746
+ });
1747
+ case 10:
1748
+ return new BarkError.ServerConnection({
1749
+ errorMessage: FfiConverterString.read(from)
1750
+ });
1751
+ case 11:
1752
+ return new BarkError.Internal({
1753
+ errorMessage: FfiConverterString.read(from)
1754
+ });
1755
+ case 12:
1756
+ return new BarkError.OnchainWalletRequired({
1757
+ errorMessage: FfiConverterString.read(from)
1758
+ });
1759
+ default:
1760
+ throw new UniffiInternalError.UnexpectedEnumCase();
1761
+ }
1762
+ }
1763
+ write(value, into) {
1764
+ switch (value.tag) {
1765
+ case BarkError_Tags.Network:
1766
+ {
1767
+ ordinalConverter.write(1, into);
1768
+ const inner = value.inner;
1769
+ FfiConverterString.write(inner.errorMessage, into);
1770
+ return;
1771
+ }
1772
+ case BarkError_Tags.Database:
1773
+ {
1774
+ ordinalConverter.write(2, into);
1775
+ const inner = value.inner;
1776
+ FfiConverterString.write(inner.errorMessage, into);
1777
+ return;
1778
+ }
1779
+ case BarkError_Tags.InvalidMnemonic:
1780
+ {
1781
+ ordinalConverter.write(3, into);
1782
+ const inner = value.inner;
1783
+ FfiConverterString.write(inner.errorMessage, into);
1784
+ return;
1785
+ }
1786
+ case BarkError_Tags.InvalidAddress:
1787
+ {
1788
+ ordinalConverter.write(4, into);
1789
+ const inner = value.inner;
1790
+ FfiConverterString.write(inner.errorMessage, into);
1791
+ return;
1792
+ }
1793
+ case BarkError_Tags.InvalidInvoice:
1794
+ {
1795
+ ordinalConverter.write(5, into);
1796
+ const inner = value.inner;
1797
+ FfiConverterString.write(inner.errorMessage, into);
1798
+ return;
1799
+ }
1800
+ case BarkError_Tags.InvalidPsbt:
1801
+ {
1802
+ ordinalConverter.write(6, into);
1803
+ const inner = value.inner;
1804
+ FfiConverterString.write(inner.errorMessage, into);
1805
+ return;
1806
+ }
1807
+ case BarkError_Tags.InvalidTransaction:
1808
+ {
1809
+ ordinalConverter.write(7, into);
1810
+ const inner = value.inner;
1811
+ FfiConverterString.write(inner.errorMessage, into);
1812
+ return;
1813
+ }
1814
+ case BarkError_Tags.InsufficientFunds:
1815
+ {
1816
+ ordinalConverter.write(8, into);
1817
+ const inner = value.inner;
1818
+ FfiConverterString.write(inner.errorMessage, into);
1819
+ return;
1820
+ }
1821
+ case BarkError_Tags.NotFound:
1822
+ {
1823
+ ordinalConverter.write(9, into);
1824
+ const inner = value.inner;
1825
+ FfiConverterString.write(inner.errorMessage, into);
1826
+ return;
1827
+ }
1828
+ case BarkError_Tags.ServerConnection:
1829
+ {
1830
+ ordinalConverter.write(10, into);
1831
+ const inner = value.inner;
1832
+ FfiConverterString.write(inner.errorMessage, into);
1833
+ return;
1834
+ }
1835
+ case BarkError_Tags.Internal:
1836
+ {
1837
+ ordinalConverter.write(11, into);
1838
+ const inner = value.inner;
1839
+ FfiConverterString.write(inner.errorMessage, into);
1840
+ return;
1841
+ }
1842
+ case BarkError_Tags.OnchainWalletRequired:
1843
+ {
1844
+ ordinalConverter.write(12, into);
1845
+ const inner = value.inner;
1846
+ FfiConverterString.write(inner.errorMessage, into);
1847
+ return;
1848
+ }
1849
+ default:
1850
+ // Throwing from here means that BarkError_Tags hasn't matched an ordinal.
1851
+ throw new UniffiInternalError.UnexpectedEnumCase();
1852
+ }
1853
+ }
1854
+ allocationSize(value) {
1855
+ switch (value.tag) {
1856
+ case BarkError_Tags.Network:
1857
+ {
1858
+ const inner = value.inner;
1859
+ let size = ordinalConverter.allocationSize(1);
1860
+ size += FfiConverterString.allocationSize(inner.errorMessage);
1861
+ return size;
1862
+ }
1863
+ case BarkError_Tags.Database:
1864
+ {
1865
+ const inner = value.inner;
1866
+ let size = ordinalConverter.allocationSize(2);
1867
+ size += FfiConverterString.allocationSize(inner.errorMessage);
1868
+ return size;
1869
+ }
1870
+ case BarkError_Tags.InvalidMnemonic:
1871
+ {
1872
+ const inner = value.inner;
1873
+ let size = ordinalConverter.allocationSize(3);
1874
+ size += FfiConverterString.allocationSize(inner.errorMessage);
1875
+ return size;
1876
+ }
1877
+ case BarkError_Tags.InvalidAddress:
1878
+ {
1879
+ const inner = value.inner;
1880
+ let size = ordinalConverter.allocationSize(4);
1881
+ size += FfiConverterString.allocationSize(inner.errorMessage);
1882
+ return size;
1883
+ }
1884
+ case BarkError_Tags.InvalidInvoice:
1885
+ {
1886
+ const inner = value.inner;
1887
+ let size = ordinalConverter.allocationSize(5);
1888
+ size += FfiConverterString.allocationSize(inner.errorMessage);
1889
+ return size;
1890
+ }
1891
+ case BarkError_Tags.InvalidPsbt:
1892
+ {
1893
+ const inner = value.inner;
1894
+ let size = ordinalConverter.allocationSize(6);
1895
+ size += FfiConverterString.allocationSize(inner.errorMessage);
1896
+ return size;
1897
+ }
1898
+ case BarkError_Tags.InvalidTransaction:
1899
+ {
1900
+ const inner = value.inner;
1901
+ let size = ordinalConverter.allocationSize(7);
1902
+ size += FfiConverterString.allocationSize(inner.errorMessage);
1903
+ return size;
1904
+ }
1905
+ case BarkError_Tags.InsufficientFunds:
1906
+ {
1907
+ const inner = value.inner;
1908
+ let size = ordinalConverter.allocationSize(8);
1909
+ size += FfiConverterString.allocationSize(inner.errorMessage);
1910
+ return size;
1911
+ }
1912
+ case BarkError_Tags.NotFound:
1913
+ {
1914
+ const inner = value.inner;
1915
+ let size = ordinalConverter.allocationSize(9);
1916
+ size += FfiConverterString.allocationSize(inner.errorMessage);
1917
+ return size;
1918
+ }
1919
+ case BarkError_Tags.ServerConnection:
1920
+ {
1921
+ const inner = value.inner;
1922
+ let size = ordinalConverter.allocationSize(10);
1923
+ size += FfiConverterString.allocationSize(inner.errorMessage);
1924
+ return size;
1925
+ }
1926
+ case BarkError_Tags.Internal:
1927
+ {
1928
+ const inner = value.inner;
1929
+ let size = ordinalConverter.allocationSize(11);
1930
+ size += FfiConverterString.allocationSize(inner.errorMessage);
1931
+ return size;
1932
+ }
1933
+ case BarkError_Tags.OnchainWalletRequired:
1934
+ {
1935
+ const inner = value.inner;
1936
+ let size = ordinalConverter.allocationSize(12);
1937
+ size += FfiConverterString.allocationSize(inner.errorMessage);
1938
+ return size;
1939
+ }
1940
+ default:
1941
+ throw new UniffiInternalError.UnexpectedEnumCase();
1942
+ }
1943
+ }
1944
+ }
1945
+ return new FFIConverter();
1946
+ })();
1947
+
1948
+ /**
1949
+ * Bitcoin network types
1950
+ */
1951
+ export let Network = /*#__PURE__*/function (Network) {
1952
+ Network[Network["Bitcoin"] = 0] = "Bitcoin";
1953
+ Network[Network["Testnet"] = 1] = "Testnet";
1954
+ Network[Network["Signet"] = 2] = "Signet";
1955
+ Network[Network["Regtest"] = 3] = "Regtest";
1956
+ return Network;
1957
+ }({});
1958
+ const FfiConverterTypeNetwork = (() => {
1959
+ const ordinalConverter = FfiConverterInt32;
1960
+ class FFIConverter extends AbstractFfiConverterByteArray {
1961
+ read(from) {
1962
+ switch (ordinalConverter.read(from)) {
1963
+ case 1:
1964
+ return Network.Bitcoin;
1965
+ case 2:
1966
+ return Network.Testnet;
1967
+ case 3:
1968
+ return Network.Signet;
1969
+ case 4:
1970
+ return Network.Regtest;
1971
+ default:
1972
+ throw new UniffiInternalError.UnexpectedEnumCase();
1973
+ }
1974
+ }
1975
+ write(value, into) {
1976
+ switch (value) {
1977
+ case Network.Bitcoin:
1978
+ return ordinalConverter.write(1, into);
1979
+ case Network.Testnet:
1980
+ return ordinalConverter.write(2, into);
1981
+ case Network.Signet:
1982
+ return ordinalConverter.write(3, into);
1983
+ case Network.Regtest:
1984
+ return ordinalConverter.write(4, into);
1985
+ }
1986
+ }
1987
+ allocationSize(value) {
1988
+ return ordinalConverter.allocationSize(0);
1989
+ }
1990
+ }
1991
+ return new FFIConverter();
1992
+ })();
1993
+
1994
+ /**
1995
+ * Onchain Bitcoin wallet for boarding and exits
1996
+ *
1997
+ * Supports two implementations:
1998
+ * - Default: BDK-based wallet (built-in)
1999
+ * - Custom: Your own wallet implementation via callbacks
2000
+ */
2001
+
2002
+ /**
2003
+ * Onchain Bitcoin wallet for boarding and exits
2004
+ *
2005
+ * Supports two implementations:
2006
+ * - Default: BDK-based wallet (built-in)
2007
+ * - Custom: Your own wallet implementation via callbacks
2008
+ */
2009
+ export class OnchainWallet extends UniffiAbstractObject {
2010
+ [uniffiTypeNameSymbol] = "OnchainWallet";
2011
+ // No primary constructor declared for this class.
2012
+ constructor(pointer) {
2013
+ super();
2014
+ this[pointerLiteralSymbol] = pointer;
2015
+ this[destructorGuardSymbol] = uniffiTypeOnchainWalletObjectFactory.bless(pointer);
2016
+ }
2017
+
2018
+ /**
2019
+ * Create an onchain wallet using a custom implementation
2020
+ *
2021
+ * Use this when you have an existing wallet implementation in your language
2022
+ * (Dart/Swift/Kotlin) and want to integrate it with Bark for boarding and exits.
2023
+ * Your implementation must handle all wallet operations via the callbacks interface.
2024
+ */
2025
+ static custom(callbacks) /*throws*/{
2026
+ return FfiConverterTypeOnchainWallet.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2027
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_constructor_onchainwallet_custom(FfiConverterTypeCustomOnchainWalletCallbacks.lower(callbacks), callStatus);
2028
+ }, /*liftString:*/FfiConverterString.lift));
2029
+ }
2030
+
2031
+ /**
2032
+ * Create or load an onchain wallet using a default BDK implementation shipped with Bark
2033
+ *
2034
+ * The wallet uses BDK for onchain operations
2035
+ * and the same chain source configuration as the Bark wallet (esplora_address or bitcoind_*).
2036
+ */
2037
+ static default_(mnemonic, config, datadir) /*throws*/{
2038
+ return FfiConverterTypeOnchainWallet.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2039
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_constructor_onchainwallet_default(FfiConverterString.lower(mnemonic), FfiConverterTypeConfig.lower(config), FfiConverterString.lower(datadir), callStatus);
2040
+ }, /*liftString:*/FfiConverterString.lift));
2041
+ }
2042
+
2043
+ /**
2044
+ * Get the onchain wallet balance
2045
+ */
2046
+ balance() /*throws*/{
2047
+ return FfiConverterTypeOnchainBalance.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2048
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_onchainwallet_balance(uniffiTypeOnchainWalletObjectFactory.clonePointer(this), callStatus);
2049
+ }, /*liftString:*/FfiConverterString.lift));
2050
+ }
2051
+
2052
+ /**
2053
+ * Generate a new Bitcoin address
2054
+ */
2055
+ newAddress() /*throws*/{
2056
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2057
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_onchainwallet_new_address(uniffiTypeOnchainWalletObjectFactory.clonePointer(this), callStatus);
2058
+ }, /*liftString:*/FfiConverterString.lift));
2059
+ }
2060
+
2061
+ /**
2062
+ * Send Bitcoin to an address
2063
+ * Returns the transaction ID
2064
+ */
2065
+ send(address, amountSats, feeRateSatPerVb) /*throws*/{
2066
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2067
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_onchainwallet_send(uniffiTypeOnchainWalletObjectFactory.clonePointer(this), FfiConverterString.lower(address), FfiConverterUInt64.lower(amountSats), FfiConverterUInt64.lower(feeRateSatPerVb), callStatus);
2068
+ }, /*liftString:*/FfiConverterString.lift));
2069
+ }
2070
+
2071
+ /**
2072
+ * Sync the onchain wallet with the blockchain
2073
+ * Returns the amount synced in satoshis
2074
+ */
2075
+ sync() /*throws*/{
2076
+ return FfiConverterUInt64.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2077
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_onchainwallet_sync(uniffiTypeOnchainWalletObjectFactory.clonePointer(this), callStatus);
2078
+ }, /*liftString:*/FfiConverterString.lift));
2079
+ }
2080
+
2081
+ /**
2082
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
2083
+ */
2084
+ uniffiDestroy() {
2085
+ const ptr = this[destructorGuardSymbol];
2086
+ if (ptr !== undefined) {
2087
+ const pointer = uniffiTypeOnchainWalletObjectFactory.pointer(this);
2088
+ uniffiTypeOnchainWalletObjectFactory.freePointer(pointer);
2089
+ uniffiTypeOnchainWalletObjectFactory.unbless(ptr);
2090
+ delete this[destructorGuardSymbol];
2091
+ }
2092
+ }
2093
+ static instanceOf(obj) {
2094
+ return uniffiTypeOnchainWalletObjectFactory.isConcreteType(obj);
2095
+ }
2096
+ }
2097
+ const uniffiTypeOnchainWalletObjectFactory = (() => {
2098
+ return {
2099
+ create(pointer) {
2100
+ const instance = Object.create(OnchainWallet.prototype);
2101
+ instance[pointerLiteralSymbol] = pointer;
2102
+ instance[destructorGuardSymbol] = this.bless(pointer);
2103
+ instance[uniffiTypeNameSymbol] = "OnchainWallet";
2104
+ return instance;
2105
+ },
2106
+ bless(p) {
2107
+ return uniffiCaller.rustCall(/*caller:*/status => nativeModule().ubrn_uniffi_internal_fn_method_onchainwallet_ffi__bless_pointer(p, status), /*liftString:*/FfiConverterString.lift);
2108
+ },
2109
+ unbless(ptr) {
2110
+ ptr.markDestroyed();
2111
+ },
2112
+ pointer(obj) {
2113
+ if (obj[destructorGuardSymbol] === undefined) {
2114
+ throw new UniffiInternalError.UnexpectedNullPointer();
2115
+ }
2116
+ return obj[pointerLiteralSymbol];
2117
+ },
2118
+ clonePointer(obj) {
2119
+ const pointer = this.pointer(obj);
2120
+ return uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_bark_ffi_fn_clone_onchainwallet(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
2121
+ },
2122
+ freePointer(pointer) {
2123
+ uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_bark_ffi_fn_free_onchainwallet(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
2124
+ },
2125
+ isConcreteType(obj) {
2126
+ return obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === "OnchainWallet";
2127
+ }
2128
+ };
2129
+ })();
2130
+ // FfiConverter for OnchainWalletInterface
2131
+ const FfiConverterTypeOnchainWallet = new FfiConverterObject(uniffiTypeOnchainWalletObjectFactory);
2132
+
2133
+ /**
2134
+ * The main Bark wallet interface for Ark operations
2135
+ */
2136
+
2137
+ /**
2138
+ * The main Bark wallet interface for Ark operations
2139
+ */
2140
+ export class Wallet extends UniffiAbstractObject {
2141
+ [uniffiTypeNameSymbol] = "Wallet";
2142
+ // No primary constructor declared for this class.
2143
+ constructor(pointer) {
2144
+ super();
2145
+ this[pointerLiteralSymbol] = pointer;
2146
+ this[destructorGuardSymbol] = uniffiTypeWalletObjectFactory.bless(pointer);
2147
+ }
2148
+
2149
+ /**
2150
+ * Create a new Bark wallet
2151
+ */
2152
+ static create(mnemonic, config, datadir, forceRescan) /*throws*/{
2153
+ return FfiConverterTypeWallet.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2154
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_constructor_wallet_create(FfiConverterString.lower(mnemonic), FfiConverterTypeConfig.lower(config), FfiConverterString.lower(datadir), FfiConverterBool.lower(forceRescan), callStatus);
2155
+ }, /*liftString:*/FfiConverterString.lift));
2156
+ }
2157
+
2158
+ /**
2159
+ * Create a new Bark wallet WITH onchain capabilities
2160
+ */
2161
+ static createWithOnchain(mnemonic, config, datadir, onchainWallet, forceRescan) /*throws*/{
2162
+ return FfiConverterTypeWallet.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2163
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_constructor_wallet_create_with_onchain(FfiConverterString.lower(mnemonic), FfiConverterTypeConfig.lower(config), FfiConverterString.lower(datadir), FfiConverterTypeOnchainWallet.lower(onchainWallet), FfiConverterBool.lower(forceRescan), callStatus);
2164
+ }, /*liftString:*/FfiConverterString.lift));
2165
+ }
2166
+
2167
+ /**
2168
+ * Open an existing Bark wallet
2169
+ */
2170
+ static open(mnemonic, config, datadir) /*throws*/{
2171
+ return FfiConverterTypeWallet.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2172
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_constructor_wallet_open(FfiConverterString.lower(mnemonic), FfiConverterTypeConfig.lower(config), FfiConverterString.lower(datadir), callStatus);
2173
+ }, /*liftString:*/FfiConverterString.lift));
2174
+ }
2175
+
2176
+ /**
2177
+ * Open an existing Bark wallet WITH onchain capabilities
2178
+ */
2179
+ static openWithOnchain(mnemonic, config, datadir, onchainWallet) /*throws*/{
2180
+ return FfiConverterTypeWallet.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2181
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_constructor_wallet_open_with_onchain(FfiConverterString.lower(mnemonic), FfiConverterTypeConfig.lower(config), FfiConverterString.lower(datadir), FfiConverterTypeOnchainWallet.lower(onchainWallet), callStatus);
2182
+ }, /*liftString:*/FfiConverterString.lift));
2183
+ }
2184
+
2185
+ /**
2186
+ * Get earliest block height when all exits will be claimable
2187
+ *
2188
+ * Returns null if no exits or any exit has undetermined claimability.
2189
+ */
2190
+ allExitsClaimableAtHeight() /*throws*/{
2191
+ return FfiConverterOptionalUInt32.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2192
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_all_exits_claimable_at_height(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2193
+ }, /*liftString:*/FfiConverterString.lift));
2194
+ }
2195
+
2196
+ /**
2197
+ * Get all VTXOs (including spent)
2198
+ */
2199
+ allVtxos() /*throws*/{
2200
+ return FfiConverterArrayTypeVtxo.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2201
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_all_vtxos(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2202
+ }, /*liftString:*/FfiConverterString.lift));
2203
+ }
2204
+
2205
+ /**
2206
+ * Get Ark server info (null if not connected)
2207
+ */
2208
+ arkInfo() {
2209
+ return FfiConverterOptionalTypeArkInfo.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
2210
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_ark_info(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2211
+ }, /*liftString:*/FfiConverterString.lift));
2212
+ }
2213
+ balance() /*throws*/{
2214
+ return FfiConverterTypeBalance.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2215
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_balance(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2216
+ }, /*liftString:*/FfiConverterString.lift));
2217
+ }
2218
+
2219
+ /**
2220
+ * Board all funds from onchain wallet into Ark
2221
+ */
2222
+ boardAll(onchainWallet) /*throws*/{
2223
+ return FfiConverterTypePendingBoard.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2224
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_board_all(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeOnchainWallet.lower(onchainWallet), callStatus);
2225
+ }, /*liftString:*/FfiConverterString.lift));
2226
+ }
2227
+
2228
+ /**
2229
+ * Board a specific amount from onchain wallet into Ark
2230
+ */
2231
+ boardAmount(onchainWallet, amountSats) /*throws*/{
2232
+ return FfiConverterTypePendingBoard.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2233
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_board_amount(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeOnchainWallet.lower(onchainWallet), FfiConverterUInt64.lower(amountSats), callStatus);
2234
+ }, /*liftString:*/FfiConverterString.lift));
2235
+ }
2236
+ bolt11Invoice(amountSats) /*throws*/{
2237
+ return FfiConverterTypeLightningInvoice.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2238
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_bolt11_invoice(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterUInt64.lower(amountSats), callStatus);
2239
+ }, /*liftString:*/FfiConverterString.lift));
2240
+ }
2241
+
2242
+ /**
2243
+ * Broadcast a signed transaction to the Bitcoin network
2244
+ *
2245
+ * Takes a hex-encoded transaction and broadcasts it via the wallet's chain source.
2246
+ * This is useful after extracting a transaction from a PSBT using extract_tx_from_psbt.
2247
+ *
2248
+ * # Arguments
2249
+ *
2250
+ * * `tx_hex` - Hex-encoded signed transaction
2251
+ *
2252
+ * Returns the transaction ID (txid) of the broadcasted transaction
2253
+ */
2254
+ broadcastTx(txHex) /*throws*/{
2255
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2256
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_broadcast_tx(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(txHex), callStatus);
2257
+ }, /*liftString:*/FfiConverterString.lift));
2258
+ }
2259
+
2260
+ /**
2261
+ * Cancel all pending rounds
2262
+ */
2263
+ cancelAllPendingRounds() /*throws*/{
2264
+ uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2265
+ nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_cancel_all_pending_rounds(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2266
+ }, /*liftString:*/FfiConverterString.lift);
2267
+ }
2268
+
2269
+ /**
2270
+ * Cancel a specific pending round
2271
+ */
2272
+ cancelPendingRound(roundId) /*throws*/{
2273
+ uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2274
+ nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_cancel_pending_round(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterUInt32.lower(roundId), callStatus);
2275
+ }, /*liftString:*/FfiConverterString.lift);
2276
+ }
2277
+
2278
+ /**
2279
+ * Check lightning payment status by payment hash
2280
+ *
2281
+ * # Arguments
2282
+ *
2283
+ * * `payment_hash` - Payment hash as hex string
2284
+ * * `wait` - Whether to wait for the payment to complete
2285
+ *
2286
+ * Returns the preimage if payment is successful, null if still pending
2287
+ */
2288
+ checkLightningPayment(paymentHash, wait) /*throws*/{
2289
+ return FfiConverterOptionalString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2290
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_check_lightning_payment(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(paymentHash), FfiConverterBool.lower(wait), callStatus);
2291
+ }, /*liftString:*/FfiConverterString.lift));
2292
+ }
2293
+
2294
+ /**
2295
+ * Get claimable lightning receive balance
2296
+ */
2297
+ claimableLightningReceiveBalanceSats() /*throws*/{
2298
+ return FfiConverterUInt64.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2299
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_claimable_lightning_receive_balance_sats(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2300
+ }, /*liftString:*/FfiConverterString.lift));
2301
+ }
2302
+
2303
+ /**
2304
+ * Get wallet config
2305
+ */
2306
+ config() {
2307
+ return FfiConverterTypeConfig.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
2308
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_config(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2309
+ }, /*liftString:*/FfiConverterString.lift));
2310
+ }
2311
+
2312
+ /**
2313
+ * Drain claimable exits to an address
2314
+ *
2315
+ * Builds a signed PSBT that claims exited funds and sends them to the address.
2316
+ * The PSBT can be broadcast directly or modified before broadcasting.
2317
+ *
2318
+ * # Arguments
2319
+ *
2320
+ * * `vtxo_ids` - List of claimable VTXO IDs to drain (empty = drain all)
2321
+ * * `address` - Bitcoin address to send claimed funds to
2322
+ * * `fee_rate_sat_per_vb` - Optional fee rate override in sats/vB
2323
+ */
2324
+ drainExits(vtxoIds, address, feeRateSatPerVb) /*throws*/{
2325
+ return FfiConverterTypeExitClaimTransaction.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2326
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_drain_exits(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterArrayString.lower(vtxoIds), FfiConverterString.lower(address), FfiConverterOptionalUInt64.lower(feeRateSatPerVb), callStatus);
2327
+ }, /*liftString:*/FfiConverterString.lift));
2328
+ }
2329
+
2330
+ /**
2331
+ * Get detailed exit status for a specific VTXO
2332
+ *
2333
+ * Returns detailed status including current state, history, and transactions.
2334
+ *
2335
+ * # Arguments
2336
+ *
2337
+ * * `vtxo_id` - The VTXO ID to check
2338
+ * * `include_history` - Whether to include full state machine history
2339
+ * * `include_transactions` - Whether to include transaction details
2340
+ */
2341
+ getExitStatus(vtxoId, includeHistory, includeTransactions) /*throws*/{
2342
+ return FfiConverterOptionalTypeExitTransactionStatus.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2343
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_get_exit_status(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(vtxoId), FfiConverterBool.lower(includeHistory), FfiConverterBool.lower(includeTransactions), callStatus);
2344
+ }, /*liftString:*/FfiConverterString.lift));
2345
+ }
2346
+
2347
+ /**
2348
+ * Get all VTXOs currently in exit process
2349
+ */
2350
+ getExitVtxos() /*throws*/{
2351
+ return FfiConverterArrayTypeExitVtxo.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2352
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_get_exit_vtxos(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2353
+ }, /*liftString:*/FfiConverterString.lift));
2354
+ }
2355
+
2356
+ /**
2357
+ * Get VTXOs expiring within threshold blocks
2358
+ */
2359
+ getExpiringVtxos(thresholdBlocks) /*throws*/{
2360
+ return FfiConverterArrayTypeVtxo.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2361
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_get_expiring_vtxos(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterUInt32.lower(thresholdBlocks), callStatus);
2362
+ }, /*liftString:*/FfiConverterString.lift));
2363
+ }
2364
+
2365
+ /**
2366
+ * Get the block height of the first expiring VTXO
2367
+ *
2368
+ * Returns null if there are no spendable VTXOs.
2369
+ */
2370
+ getFirstExpiringVtxoBlockheight() /*throws*/{
2371
+ return FfiConverterOptionalUInt32.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2372
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_get_first_expiring_vtxo_blockheight(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2373
+ }, /*liftString:*/FfiConverterString.lift));
2374
+ }
2375
+
2376
+ /**
2377
+ * Get the next block height when a refresh should be performed
2378
+ *
2379
+ * This is calculated as the first expiring VTXO height minus the refresh threshold.
2380
+ * Returns null if there are no VTXOs to refresh.
2381
+ */
2382
+ getNextRequiredRefreshBlockheight() /*throws*/{
2383
+ return FfiConverterOptionalUInt32.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2384
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_get_next_required_refresh_blockheight(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2385
+ }, /*liftString:*/FfiConverterString.lift));
2386
+ }
2387
+
2388
+ /**
2389
+ * Get a specific VTXO by ID
2390
+ */
2391
+ getVtxoById(vtxoId) /*throws*/{
2392
+ return FfiConverterTypeVtxo.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2393
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_get_vtxo_by_id(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(vtxoId), callStatus);
2394
+ }, /*liftString:*/FfiConverterString.lift));
2395
+ }
2396
+
2397
+ /**
2398
+ * Get VTXOs that should be refreshed
2399
+ */
2400
+ getVtxosToRefresh() /*throws*/{
2401
+ return FfiConverterArrayTypeVtxo.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2402
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_get_vtxos_to_refresh(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2403
+ }, /*liftString:*/FfiConverterString.lift));
2404
+ }
2405
+
2406
+ /**
2407
+ * Check if any exits are pending
2408
+ */
2409
+ hasPendingExits() /*throws*/{
2410
+ return FfiConverterBool.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2411
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_has_pending_exits(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2412
+ }, /*liftString:*/FfiConverterString.lift));
2413
+ }
2414
+
2415
+ /**
2416
+ * Get all wallet movements (transaction history)
2417
+ */
2418
+ history() /*throws*/{
2419
+ return FfiConverterArrayTypeMovement.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2420
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_history(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2421
+ }, /*liftString:*/FfiConverterString.lift));
2422
+ }
2423
+
2424
+ /**
2425
+ * Get lightning receive status by payment hash
2426
+ *
2427
+ * # Arguments
2428
+ *
2429
+ * * `payment_hash` - Payment hash as hex string
2430
+ */
2431
+ lightningReceiveStatus(paymentHash) /*throws*/{
2432
+ return FfiConverterOptionalTypeLightningReceive.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2433
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_lightning_receive_status(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(paymentHash), callStatus);
2434
+ }, /*liftString:*/FfiConverterString.lift));
2435
+ }
2436
+
2437
+ /**
2438
+ * List all exits that are claimable
2439
+ *
2440
+ * Returns exits ready to be drained to onchain wallet.
2441
+ */
2442
+ listClaimableExits() /*throws*/{
2443
+ return FfiConverterArrayTypeExitVtxo.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2444
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_list_claimable_exits(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2445
+ }, /*liftString:*/FfiConverterString.lift));
2446
+ }
2447
+ maintenance() /*throws*/{
2448
+ uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2449
+ nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_maintenance(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2450
+ }, /*liftString:*/FfiConverterString.lift);
2451
+ }
2452
+
2453
+ /**
2454
+ * Perform maintenance refresh
2455
+ */
2456
+ maintenanceRefresh() /*throws*/{
2457
+ return FfiConverterOptionalString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2458
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_maintenance_refresh(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2459
+ }, /*liftString:*/FfiConverterString.lift));
2460
+ }
2461
+
2462
+ /**
2463
+ * Full maintenance including onchain wallet sync
2464
+ *
2465
+ * More thorough than maintenance() - also syncs onchain wallet and exits.
2466
+ */
2467
+ maintenanceWithOnchain(onchainWallet) /*throws*/{
2468
+ uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2469
+ nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_maintenance_with_onchain(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeOnchainWallet.lower(onchainWallet), callStatus);
2470
+ }, /*liftString:*/FfiConverterString.lift);
2471
+ }
2472
+
2473
+ /**
2474
+ * Schedule a maintenance refresh if VTXOs need refreshing
2475
+ *
2476
+ * Returns the round ID if a refresh was scheduled, null otherwise.
2477
+ */
2478
+ maybeScheduleMaintenanceRefresh() /*throws*/{
2479
+ return FfiConverterOptionalUInt32.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2480
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_maybe_schedule_maintenance_refresh(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2481
+ }, /*liftString:*/FfiConverterString.lift));
2482
+ }
2483
+ newAddress() /*throws*/{
2484
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2485
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_new_address(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2486
+ }, /*liftString:*/FfiConverterString.lift));
2487
+ }
2488
+
2489
+ /**
2490
+ * Generate a new address and return it with its index
2491
+ */
2492
+ newAddressWithIndex() /*throws*/{
2493
+ return FfiConverterTypeAddressWithIndex.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2494
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_new_address_with_index(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2495
+ }, /*liftString:*/FfiConverterString.lift));
2496
+ }
2497
+ offboardAll(bitcoinAddress) /*throws*/{
2498
+ return FfiConverterTypeOffboardResult.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2499
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_offboard_all(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(bitcoinAddress), callStatus);
2500
+ }, /*liftString:*/FfiConverterString.lift));
2501
+ }
2502
+
2503
+ /**
2504
+ * Offboard specific VTXOs to a Bitcoin address
2505
+ */
2506
+ offboardVtxos(vtxoIds, bitcoinAddress) /*throws*/{
2507
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2508
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_offboard_vtxos(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterArrayString.lower(vtxoIds), FfiConverterString.lower(bitcoinAddress), callStatus);
2509
+ }, /*liftString:*/FfiConverterString.lift));
2510
+ }
2511
+ payLightningAddress(lightningAddress, amountSats, comment) /*throws*/{
2512
+ return FfiConverterTypeLightningSend.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2513
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_pay_lightning_address(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(lightningAddress), FfiConverterUInt64.lower(amountSats), FfiConverterOptionalString.lower(comment), callStatus);
2514
+ }, /*liftString:*/FfiConverterString.lift));
2515
+ }
2516
+ payLightningInvoice(invoice, amountSats) /*throws*/{
2517
+ return FfiConverterTypeLightningSend.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2518
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_pay_lightning_invoice(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(invoice), FfiConverterOptionalUInt64.lower(amountSats), callStatus);
2519
+ }, /*liftString:*/FfiConverterString.lift));
2520
+ }
2521
+
2522
+ /**
2523
+ * Pay a BOLT12 lightning offer
2524
+ *
2525
+ * # Arguments
2526
+ *
2527
+ * * `offer` - BOLT12 offer string
2528
+ * * `amount_sats` - Optional amount in sats (required if offer doesn't specify amount)
2529
+ */
2530
+ payLightningOffer(offer, amountSats) /*throws*/{
2531
+ return FfiConverterTypeLightningSend.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2532
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_pay_lightning_offer(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(offer), FfiConverterOptionalUInt64.lower(amountSats), callStatus);
2533
+ }, /*liftString:*/FfiConverterString.lift));
2534
+ }
2535
+
2536
+ /**
2537
+ * Peek at an address at a specific index
2538
+ */
2539
+ peakAddress(index) /*throws*/{
2540
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2541
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_peak_address(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterUInt32.lower(index), callStatus);
2542
+ }, /*liftString:*/FfiConverterString.lift));
2543
+ }
2544
+
2545
+ /**
2546
+ * Get total amount in pending exits (sats)
2547
+ */
2548
+ pendingExitsTotalSats() /*throws*/{
2549
+ return FfiConverterUInt64.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2550
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_pending_exits_total_sats(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2551
+ }, /*liftString:*/FfiConverterString.lift));
2552
+ }
2553
+
2554
+ /**
2555
+ * Get all pending lightning receives
2556
+ */
2557
+ pendingLightningReceives() /*throws*/{
2558
+ return FfiConverterArrayTypeLightningReceive.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2559
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_pending_lightning_receives(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2560
+ }, /*liftString:*/FfiConverterString.lift));
2561
+ }
2562
+
2563
+ /**
2564
+ * Get all pending lightning sends
2565
+ */
2566
+ pendingLightningSends() /*throws*/{
2567
+ return FfiConverterArrayTypeLightningSend.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2568
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_pending_lightning_sends(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2569
+ }, /*liftString:*/FfiConverterString.lift));
2570
+ }
2571
+
2572
+ /**
2573
+ * Get all pending round states
2574
+ */
2575
+ pendingRoundStates() /*throws*/{
2576
+ return FfiConverterArrayTypeRoundState.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2577
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_pending_round_states(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2578
+ }, /*liftString:*/FfiConverterString.lift));
2579
+ }
2580
+
2581
+ /**
2582
+ * Progress unilateral exits (broadcast, fee bump, advance state machine)
2583
+ *
2584
+ * This is the critical method for actually moving exits forward.
2585
+ * Call periodically after starting exits.
2586
+ *
2587
+ * # Arguments
2588
+ *
2589
+ * * `onchain_wallet` - Onchain wallet for building exit transactions
2590
+ * * `fee_rate_sat_per_vb` - Optional fee rate override in sats/vB
2591
+ */
2592
+ progressExits(onchainWallet, feeRateSatPerVb) /*throws*/{
2593
+ return FfiConverterArrayTypeExitProgressStatus.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2594
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_progress_exits(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeOnchainWallet.lower(onchainWallet), FfiConverterOptionalUInt64.lower(feeRateSatPerVb), callStatus);
2595
+ }, /*liftString:*/FfiConverterString.lift));
2596
+ }
2597
+
2598
+ /**
2599
+ * Progress pending rounds
2600
+ *
2601
+ * Advances the state of all pending rounds. Call periodically.
2602
+ */
2603
+ progressPendingRounds() /*throws*/{
2604
+ uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2605
+ nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_progress_pending_rounds(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2606
+ }, /*liftString:*/FfiConverterString.lift);
2607
+ }
2608
+ properties() /*throws*/{
2609
+ return FfiConverterTypeWalletProperties.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2610
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_properties(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2611
+ }, /*liftString:*/FfiConverterString.lift));
2612
+ }
2613
+
2614
+ /**
2615
+ * Refresh the Ark server connection
2616
+ *
2617
+ * Re-establishes connection if it was lost.
2618
+ */
2619
+ refreshServer() /*throws*/{
2620
+ uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2621
+ nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_refresh_server(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2622
+ }, /*liftString:*/FfiConverterString.lift);
2623
+ }
2624
+
2625
+ /**
2626
+ * Refresh specific VTXOs
2627
+ */
2628
+ refreshVtxos(vtxoIds) /*throws*/{
2629
+ return FfiConverterOptionalString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2630
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_refresh_vtxos(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterArrayString.lower(vtxoIds), callStatus);
2631
+ }, /*liftString:*/FfiConverterString.lift));
2632
+ }
2633
+ sendArkoorPayment(arkAddress, amountSats) /*throws*/{
2634
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2635
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_send_arkoor_payment(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(arkAddress), FfiConverterUInt64.lower(amountSats), callStatus);
2636
+ }, /*liftString:*/FfiConverterString.lift));
2637
+ }
2638
+
2639
+ /**
2640
+ * Send an onchain payment during a round
2641
+ */
2642
+ sendRoundOnchainPayment(address, amountSats) /*throws*/{
2643
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2644
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_send_round_onchain_payment(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(address), FfiConverterUInt64.lower(amountSats), callStatus);
2645
+ }, /*liftString:*/FfiConverterString.lift));
2646
+ }
2647
+
2648
+ /**
2649
+ * Sign exit claim inputs in an external PSBT
2650
+ *
2651
+ * This is useful if you want to combine exit claims with other inputs
2652
+ * in a single transaction.
2653
+ *
2654
+ * # Arguments
2655
+ *
2656
+ * * `psbt_base64` - Base64-encoded PSBT to sign
2657
+ *
2658
+ * Returns the signed PSBT
2659
+ */
2660
+ signExitClaimInputs(psbtBase64) /*throws*/{
2661
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2662
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_sign_exit_claim_inputs(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(psbtBase64), callStatus);
2663
+ }, /*liftString:*/FfiConverterString.lift));
2664
+ }
2665
+
2666
+ /**
2667
+ * Get all spendable VTXOs
2668
+ */
2669
+ spendableVtxos() /*throws*/{
2670
+ return FfiConverterArrayTypeVtxo.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2671
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_spendable_vtxos(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2672
+ }, /*liftString:*/FfiConverterString.lift));
2673
+ }
2674
+
2675
+ /**
2676
+ * Start unilateral exit for the entire wallet
2677
+ */
2678
+ startExitForEntireWallet() /*throws*/{
2679
+ uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2680
+ nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_start_exit_for_entire_wallet(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2681
+ }, /*liftString:*/FfiConverterString.lift);
2682
+ }
2683
+
2684
+ /**
2685
+ * Start unilateral exit for specific VTXOs
2686
+ *
2687
+ * Marks specific VTXOs for exit. Call progress_exits() to actually advance them.
2688
+ */
2689
+ startExitForVtxos(vtxoIds) /*throws*/{
2690
+ uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2691
+ nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_start_exit_for_vtxos(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterArrayString.lower(vtxoIds), callStatus);
2692
+ }, /*liftString:*/FfiConverterString.lift);
2693
+ }
2694
+
2695
+ /**
2696
+ * Lightweight sync with Ark server and blockchain
2697
+ * Note: Bark's sync() handles errors internally with logging.
2698
+ * The Throws annotation is for forward compatibility only.
2699
+ */
2700
+ sync() /*throws*/{
2701
+ uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2702
+ nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_sync(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2703
+ }, /*liftString:*/FfiConverterString.lift);
2704
+ }
2705
+
2706
+ /**
2707
+ * Sync exit state (checks status but doesn't progress)
2708
+ */
2709
+ syncExits(onchainWallet) /*throws*/{
2710
+ uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2711
+ nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_sync_exits(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterTypeOnchainWallet.lower(onchainWallet), callStatus);
2712
+ }, /*liftString:*/FfiConverterString.lift);
2713
+ }
2714
+
2715
+ /**
2716
+ * Sync pending board transactions
2717
+ */
2718
+ syncPendingBoards() /*throws*/{
2719
+ uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2720
+ nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_sync_pending_boards(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2721
+ }, /*liftString:*/FfiConverterString.lift);
2722
+ }
2723
+ tryClaimAllLightningReceives(wait) /*throws*/{
2724
+ uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2725
+ nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_try_claim_all_lightning_receives(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterBool.lower(wait), callStatus);
2726
+ }, /*liftString:*/FfiConverterString.lift);
2727
+ }
2728
+
2729
+ /**
2730
+ * Try to claim a specific lightning receive by payment hash
2731
+ *
2732
+ * # Arguments
2733
+ *
2734
+ * * `payment_hash` - Payment hash as hex string
2735
+ * * `wait` - Whether to wait for claim to complete
2736
+ */
2737
+ tryClaimLightningReceive(paymentHash, wait) /*throws*/{
2738
+ uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2739
+ nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_try_claim_lightning_receive(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(paymentHash), FfiConverterBool.lower(wait), callStatus);
2740
+ }, /*liftString:*/FfiConverterString.lift);
2741
+ }
2742
+
2743
+ /**
2744
+ * Validate an Ark address against the connected server
2745
+ *
2746
+ * This performs full validation including checking if the address
2747
+ * belongs to the currently connected Ark server.
2748
+ * For basic format validation only, use validate_ark_address() instead.
2749
+ */
2750
+ validateArkoorAddress(address) /*throws*/{
2751
+ return FfiConverterBool.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2752
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_validate_arkoor_address(uniffiTypeWalletObjectFactory.clonePointer(this), FfiConverterString.lower(address), callStatus);
2753
+ }, /*liftString:*/FfiConverterString.lift));
2754
+ }
2755
+ vtxos() /*throws*/{
2756
+ return FfiConverterArrayTypeVtxo.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBarkError.lift.bind(FfiConverterTypeBarkError), /*caller:*/callStatus => {
2757
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_vtxos(uniffiTypeWalletObjectFactory.clonePointer(this), callStatus);
2758
+ }, /*liftString:*/FfiConverterString.lift));
2759
+ }
2760
+
2761
+ /**
2762
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
2763
+ */
2764
+ uniffiDestroy() {
2765
+ const ptr = this[destructorGuardSymbol];
2766
+ if (ptr !== undefined) {
2767
+ const pointer = uniffiTypeWalletObjectFactory.pointer(this);
2768
+ uniffiTypeWalletObjectFactory.freePointer(pointer);
2769
+ uniffiTypeWalletObjectFactory.unbless(ptr);
2770
+ delete this[destructorGuardSymbol];
2771
+ }
2772
+ }
2773
+ static instanceOf(obj) {
2774
+ return uniffiTypeWalletObjectFactory.isConcreteType(obj);
2775
+ }
2776
+ }
2777
+ const uniffiTypeWalletObjectFactory = (() => {
2778
+ return {
2779
+ create(pointer) {
2780
+ const instance = Object.create(Wallet.prototype);
2781
+ instance[pointerLiteralSymbol] = pointer;
2782
+ instance[destructorGuardSymbol] = this.bless(pointer);
2783
+ instance[uniffiTypeNameSymbol] = "Wallet";
2784
+ return instance;
2785
+ },
2786
+ bless(p) {
2787
+ return uniffiCaller.rustCall(/*caller:*/status => nativeModule().ubrn_uniffi_internal_fn_method_wallet_ffi__bless_pointer(p, status), /*liftString:*/FfiConverterString.lift);
2788
+ },
2789
+ unbless(ptr) {
2790
+ ptr.markDestroyed();
2791
+ },
2792
+ pointer(obj) {
2793
+ if (obj[destructorGuardSymbol] === undefined) {
2794
+ throw new UniffiInternalError.UnexpectedNullPointer();
2795
+ }
2796
+ return obj[pointerLiteralSymbol];
2797
+ },
2798
+ clonePointer(obj) {
2799
+ const pointer = this.pointer(obj);
2800
+ return uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_bark_ffi_fn_clone_wallet(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
2801
+ },
2802
+ freePointer(pointer) {
2803
+ uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_bark_ffi_fn_free_wallet(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
2804
+ },
2805
+ isConcreteType(obj) {
2806
+ return obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === "Wallet";
2807
+ }
2808
+ };
2809
+ })();
2810
+ // FfiConverter for WalletInterface
2811
+ const FfiConverterTypeWallet = new FfiConverterObject(uniffiTypeWalletObjectFactory);
2812
+
2813
+ // FfiConverter for ArkInfo | undefined
2814
+ const FfiConverterOptionalTypeArkInfo = new FfiConverterOptional(FfiConverterTypeArkInfo);
2815
+
2816
+ // FfiConverter for BlockRef | undefined
2817
+ const FfiConverterOptionalTypeBlockRef = new FfiConverterOptional(FfiConverterTypeBlockRef);
2818
+
2819
+ // FfiConverter for ExitTransactionStatus | undefined
2820
+ const FfiConverterOptionalTypeExitTransactionStatus = new FfiConverterOptional(FfiConverterTypeExitTransactionStatus);
2821
+
2822
+ // FfiConverter for LightningReceive | undefined
2823
+ const FfiConverterOptionalTypeLightningReceive = new FfiConverterOptional(FfiConverterTypeLightningReceive);
2824
+
2825
+ // FfiConverter for string | undefined
2826
+ const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
2827
+
2828
+ // FfiConverter for /*u16*/number | undefined
2829
+ const FfiConverterOptionalUInt16 = new FfiConverterOptional(FfiConverterUInt16);
2830
+
2831
+ // FfiConverter for /*u32*/number | undefined
2832
+ const FfiConverterOptionalUInt32 = new FfiConverterOptional(FfiConverterUInt32);
2833
+
2834
+ // FfiConverter for /*u64*/bigint | undefined
2835
+ const FfiConverterOptionalUInt64 = new FfiConverterOptional(FfiConverterUInt64);
2836
+
2837
+ // FfiConverter for Array<Destination>
2838
+ const FfiConverterArrayTypeDestination = new FfiConverterArray(FfiConverterTypeDestination);
2839
+
2840
+ // FfiConverter for Array<ExitProgressStatus>
2841
+ const FfiConverterArrayTypeExitProgressStatus = new FfiConverterArray(FfiConverterTypeExitProgressStatus);
2842
+
2843
+ // FfiConverter for Array<ExitVtxo>
2844
+ const FfiConverterArrayTypeExitVtxo = new FfiConverterArray(FfiConverterTypeExitVtxo);
2845
+
2846
+ // FfiConverter for Array<LightningReceive>
2847
+ const FfiConverterArrayTypeLightningReceive = new FfiConverterArray(FfiConverterTypeLightningReceive);
2848
+
2849
+ // FfiConverter for Array<LightningSend>
2850
+ const FfiConverterArrayTypeLightningSend = new FfiConverterArray(FfiConverterTypeLightningSend);
2851
+
2852
+ // FfiConverter for Array<Movement>
2853
+ const FfiConverterArrayTypeMovement = new FfiConverterArray(FfiConverterTypeMovement);
2854
+
2855
+ // FfiConverter for Array<RoundState>
2856
+ const FfiConverterArrayTypeRoundState = new FfiConverterArray(FfiConverterTypeRoundState);
2857
+
2858
+ // FfiConverter for Array<Vtxo>
2859
+ const FfiConverterArrayTypeVtxo = new FfiConverterArray(FfiConverterTypeVtxo);
2860
+
2861
+ // FfiConverter for Array<string>
2862
+ const FfiConverterArrayString = new FfiConverterArray(FfiConverterString);
2863
+
2864
+ // FfiConverter for Array<string> | undefined
2865
+ const FfiConverterOptionalArrayString = new FfiConverterOptional(FfiConverterArrayString);
2866
+
2867
+ /**
2868
+ * This should be called before anything else.
2869
+ *
2870
+ * It is likely that this is being done for you by the library's `index.ts`.
2871
+ *
2872
+ * It checks versions of uniffi between when the Rust scaffolding was generated
2873
+ * and when the bindings were generated.
2874
+ *
2875
+ * It also initializes the machinery to enable Rust to talk back to Javascript.
2876
+ */
2877
+ function uniffiEnsureInitialized() {
2878
+ // Get the bindings contract version from our ComponentInterface
2879
+ const bindingsContractVersion = 29;
2880
+ // Get the scaffolding contract version by calling the into the dylib
2881
+ const scaffoldingContractVersion = nativeModule().ubrn_ffi_bark_ffi_uniffi_contract_version();
2882
+ if (bindingsContractVersion !== scaffoldingContractVersion) {
2883
+ throw new UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
2884
+ }
2885
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_func_extract_tx_from_psbt() !== 6799) {
2886
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_func_extract_tx_from_psbt");
2887
+ }
2888
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_func_generate_mnemonic() !== 49933) {
2889
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_func_generate_mnemonic");
2890
+ }
2891
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_func_validate_ark_address() !== 49932) {
2892
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_func_validate_ark_address");
2893
+ }
2894
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_func_validate_mnemonic() !== 2707) {
2895
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_func_validate_mnemonic");
2896
+ }
2897
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_balance() !== 43979) {
2898
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_onchainwallet_balance");
2899
+ }
2900
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_new_address() !== 25417) {
2901
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_onchainwallet_new_address");
2902
+ }
2903
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_send() !== 10499) {
2904
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_onchainwallet_send");
2905
+ }
2906
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_sync() !== 16855) {
2907
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_onchainwallet_sync");
2908
+ }
2909
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_all_exits_claimable_at_height() !== 30496) {
2910
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_all_exits_claimable_at_height");
2911
+ }
2912
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_all_vtxos() !== 36339) {
2913
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_all_vtxos");
2914
+ }
2915
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_ark_info() !== 6789) {
2916
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_ark_info");
2917
+ }
2918
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_balance() !== 50185) {
2919
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_balance");
2920
+ }
2921
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_board_all() !== 9249) {
2922
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_board_all");
2923
+ }
2924
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_board_amount() !== 6984) {
2925
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_board_amount");
2926
+ }
2927
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_bolt11_invoice() !== 50261) {
2928
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_bolt11_invoice");
2929
+ }
2930
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_broadcast_tx() !== 14471) {
2931
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_broadcast_tx");
2932
+ }
2933
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_cancel_all_pending_rounds() !== 18107) {
2934
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_cancel_all_pending_rounds");
2935
+ }
2936
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_cancel_pending_round() !== 4859) {
2937
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_cancel_pending_round");
2938
+ }
2939
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_check_lightning_payment() !== 8903) {
2940
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_check_lightning_payment");
2941
+ }
2942
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_claimable_lightning_receive_balance_sats() !== 47596) {
2943
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_claimable_lightning_receive_balance_sats");
2944
+ }
2945
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_config() !== 63421) {
2946
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_config");
2947
+ }
2948
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_drain_exits() !== 63428) {
2949
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_drain_exits");
2950
+ }
2951
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_get_exit_status() !== 13877) {
2952
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_get_exit_status");
2953
+ }
2954
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_get_exit_vtxos() !== 55034) {
2955
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_get_exit_vtxos");
2956
+ }
2957
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_get_expiring_vtxos() !== 151) {
2958
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_get_expiring_vtxos");
2959
+ }
2960
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_get_first_expiring_vtxo_blockheight() !== 58234) {
2961
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_get_first_expiring_vtxo_blockheight");
2962
+ }
2963
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_get_next_required_refresh_blockheight() !== 59124) {
2964
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_get_next_required_refresh_blockheight");
2965
+ }
2966
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_get_vtxo_by_id() !== 45689) {
2967
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_get_vtxo_by_id");
2968
+ }
2969
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_get_vtxos_to_refresh() !== 24989) {
2970
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_get_vtxos_to_refresh");
2971
+ }
2972
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_has_pending_exits() !== 60454) {
2973
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_has_pending_exits");
2974
+ }
2975
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_history() !== 4822) {
2976
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_history");
2977
+ }
2978
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_lightning_receive_status() !== 14282) {
2979
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_lightning_receive_status");
2980
+ }
2981
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_list_claimable_exits() !== 51047) {
2982
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_list_claimable_exits");
2983
+ }
2984
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_maintenance() !== 21349) {
2985
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_maintenance");
2986
+ }
2987
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_maintenance_refresh() !== 17108) {
2988
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_maintenance_refresh");
2989
+ }
2990
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_maintenance_with_onchain() !== 13241) {
2991
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_maintenance_with_onchain");
2992
+ }
2993
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_maybe_schedule_maintenance_refresh() !== 30042) {
2994
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_maybe_schedule_maintenance_refresh");
2995
+ }
2996
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_new_address() !== 23909) {
2997
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_new_address");
2998
+ }
2999
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_new_address_with_index() !== 42180) {
3000
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_new_address_with_index");
3001
+ }
3002
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_offboard_all() !== 9225) {
3003
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_offboard_all");
3004
+ }
3005
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_offboard_vtxos() !== 53819) {
3006
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_offboard_vtxos");
3007
+ }
3008
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pay_lightning_address() !== 14966) {
3009
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_pay_lightning_address");
3010
+ }
3011
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pay_lightning_invoice() !== 10704) {
3012
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_pay_lightning_invoice");
3013
+ }
3014
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pay_lightning_offer() !== 32875) {
3015
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_pay_lightning_offer");
3016
+ }
3017
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_peak_address() !== 9176) {
3018
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_peak_address");
3019
+ }
3020
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pending_exits_total_sats() !== 50026) {
3021
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_pending_exits_total_sats");
3022
+ }
3023
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pending_lightning_receives() !== 22341) {
3024
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_pending_lightning_receives");
3025
+ }
3026
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pending_lightning_sends() !== 363) {
3027
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_pending_lightning_sends");
3028
+ }
3029
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pending_round_states() !== 20536) {
3030
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_pending_round_states");
3031
+ }
3032
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_progress_exits() !== 4371) {
3033
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_progress_exits");
3034
+ }
3035
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_progress_pending_rounds() !== 13446) {
3036
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_progress_pending_rounds");
3037
+ }
3038
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_properties() !== 49722) {
3039
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_properties");
3040
+ }
3041
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_refresh_server() !== 25816) {
3042
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_refresh_server");
3043
+ }
3044
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_refresh_vtxos() !== 19664) {
3045
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_refresh_vtxos");
3046
+ }
3047
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_send_arkoor_payment() !== 56067) {
3048
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_send_arkoor_payment");
3049
+ }
3050
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_send_round_onchain_payment() !== 47652) {
3051
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_send_round_onchain_payment");
3052
+ }
3053
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_sign_exit_claim_inputs() !== 19527) {
3054
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_sign_exit_claim_inputs");
3055
+ }
3056
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_spendable_vtxos() !== 44569) {
3057
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_spendable_vtxos");
3058
+ }
3059
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_start_exit_for_entire_wallet() !== 56070) {
3060
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_start_exit_for_entire_wallet");
3061
+ }
3062
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_start_exit_for_vtxos() !== 34429) {
3063
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_start_exit_for_vtxos");
3064
+ }
3065
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_sync() !== 44981) {
3066
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_sync");
3067
+ }
3068
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_sync_exits() !== 40932) {
3069
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_sync_exits");
3070
+ }
3071
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_sync_pending_boards() !== 23775) {
3072
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_sync_pending_boards");
3073
+ }
3074
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_try_claim_all_lightning_receives() !== 44879) {
3075
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_try_claim_all_lightning_receives");
3076
+ }
3077
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_try_claim_lightning_receive() !== 57107) {
3078
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_try_claim_lightning_receive");
3079
+ }
3080
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_validate_arkoor_address() !== 45893) {
3081
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_validate_arkoor_address");
3082
+ }
3083
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_vtxos() !== 21445) {
3084
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_wallet_vtxos");
3085
+ }
3086
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_constructor_onchainwallet_custom() !== 33851) {
3087
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_constructor_onchainwallet_custom");
3088
+ }
3089
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_constructor_onchainwallet_default() !== 27781) {
3090
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_constructor_onchainwallet_default");
3091
+ }
3092
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_constructor_wallet_create() !== 28953) {
3093
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_constructor_wallet_create");
3094
+ }
3095
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_constructor_wallet_create_with_onchain() !== 8743) {
3096
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_constructor_wallet_create_with_onchain");
3097
+ }
3098
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_constructor_wallet_open() !== 34910) {
3099
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_constructor_wallet_open");
3100
+ }
3101
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_constructor_wallet_open_with_onchain() !== 2455) {
3102
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_constructor_wallet_open_with_onchain");
3103
+ }
3104
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_get_balance() !== 59833) {
3105
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_get_balance");
3106
+ }
3107
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_prepare_tx() !== 7923) {
3108
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_prepare_tx");
3109
+ }
3110
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_prepare_drain_tx() !== 35049) {
3111
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_prepare_drain_tx");
3112
+ }
3113
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_finish_tx() !== 13359) {
3114
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_finish_tx");
3115
+ }
3116
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_get_wallet_tx() !== 30315) {
3117
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_get_wallet_tx");
3118
+ }
3119
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_get_wallet_tx_confirmed_block() !== 45270) {
3120
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_get_wallet_tx_confirmed_block");
3121
+ }
3122
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_get_spending_tx() !== 32028) {
3123
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_get_spending_tx");
3124
+ }
3125
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_make_signed_p2a_cpfp() !== 48670) {
3126
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_make_signed_p2a_cpfp");
3127
+ }
3128
+ if (nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_store_signed_p2a_cpfp() !== 57492) {
3129
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_store_signed_p2a_cpfp");
3130
+ }
3131
+ uniffiCallbackInterfaceCustomOnchainWalletCallbacks.register();
3132
+ }
3133
+ export default Object.freeze({
3134
+ initialize: uniffiEnsureInitialized,
3135
+ converters: {
3136
+ FfiConverterTypeAddressWithIndex,
3137
+ FfiConverterTypeArkInfo,
3138
+ FfiConverterTypeBalance,
3139
+ FfiConverterTypeBarkError,
3140
+ FfiConverterTypeBlockRef,
3141
+ FfiConverterTypeConfig,
3142
+ FfiConverterTypeCpfpParams,
3143
+ FfiConverterTypeDestination,
3144
+ FfiConverterTypeExitClaimTransaction,
3145
+ FfiConverterTypeExitProgressStatus,
3146
+ FfiConverterTypeExitTransactionStatus,
3147
+ FfiConverterTypeExitVtxo,
3148
+ FfiConverterTypeLightningInvoice,
3149
+ FfiConverterTypeLightningReceive,
3150
+ FfiConverterTypeLightningSend,
3151
+ FfiConverterTypeMovement,
3152
+ FfiConverterTypeNetwork,
3153
+ FfiConverterTypeOffboardResult,
3154
+ FfiConverterTypeOnchainBalance,
3155
+ FfiConverterTypeOnchainWallet,
3156
+ FfiConverterTypeOutPoint,
3157
+ FfiConverterTypePendingBoard,
3158
+ FfiConverterTypeRoundState,
3159
+ FfiConverterTypeVtxo,
3160
+ FfiConverterTypeWallet,
3161
+ FfiConverterTypeWalletProperties
3162
+ }
3163
+ });
3164
+ //# sourceMappingURL=bark.js.map