@bennyblader/ddk-rn 0.1.4

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 (60) hide show
  1. package/DdkRn.podspec +44 -0
  2. package/LICENSE +20 -0
  3. package/README.md +33 -0
  4. package/android/CMakeLists.txt +76 -0
  5. package/android/build.gradle +144 -0
  6. package/android/cpp-adapter.cpp +63 -0
  7. package/android/gradle.properties +5 -0
  8. package/android/proguard-rules.pro +4 -0
  9. package/android/src/main/AndroidManifest.xml +5 -0
  10. package/android/src/main/AndroidManifestNew.xml +2 -0
  11. package/android/src/main/java/com/ddkrn/DdkRnModule.kt +43 -0
  12. package/android/src/main/java/com/ddkrn/DdkRnPackage.kt +34 -0
  13. package/cpp/bennyblader-ddk-rn.cpp +16 -0
  14. package/cpp/bennyblader-ddk-rn.h +15 -0
  15. package/cpp/ddk_ffi.cpp +2557 -0
  16. package/cpp/ddk_ffi.hpp +78 -0
  17. package/ios/DdkRn.h +16 -0
  18. package/ios/DdkRn.mm +66 -0
  19. package/lib/commonjs/NativeDdkRn.js +10 -0
  20. package/lib/commonjs/NativeDdkRn.js.map +1 -0
  21. package/lib/commonjs/ddk_ffi-ffi.js +44 -0
  22. package/lib/commonjs/ddk_ffi-ffi.js.map +1 -0
  23. package/lib/commonjs/ddk_ffi.js +1072 -0
  24. package/lib/commonjs/ddk_ffi.js.map +1 -0
  25. package/lib/commonjs/index.js +63 -0
  26. package/lib/commonjs/index.js.map +1 -0
  27. package/lib/commonjs/package.json +1 -0
  28. package/lib/module/NativeDdkRn.js +7 -0
  29. package/lib/module/NativeDdkRn.js.map +1 -0
  30. package/lib/module/ddk_ffi-ffi.js +43 -0
  31. package/lib/module/ddk_ffi-ffi.js.map +1 -0
  32. package/lib/module/ddk_ffi.js +1052 -0
  33. package/lib/module/ddk_ffi.js.map +1 -0
  34. package/lib/module/index.js +43 -0
  35. package/lib/module/index.js.map +1 -0
  36. package/lib/module/package.json +1 -0
  37. package/lib/typescript/commonjs/package.json +1 -0
  38. package/lib/typescript/commonjs/src/NativeDdkRn.d.ts +8 -0
  39. package/lib/typescript/commonjs/src/NativeDdkRn.d.ts.map +1 -0
  40. package/lib/typescript/commonjs/src/ddk_ffi-ffi.d.ts +108 -0
  41. package/lib/typescript/commonjs/src/ddk_ffi-ffi.d.ts.map +1 -0
  42. package/lib/typescript/commonjs/src/ddk_ffi.d.ts +773 -0
  43. package/lib/typescript/commonjs/src/ddk_ffi.d.ts.map +1 -0
  44. package/lib/typescript/commonjs/src/index.d.ts +8 -0
  45. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  46. package/lib/typescript/module/package.json +1 -0
  47. package/lib/typescript/module/src/NativeDdkRn.d.ts +8 -0
  48. package/lib/typescript/module/src/NativeDdkRn.d.ts.map +1 -0
  49. package/lib/typescript/module/src/ddk_ffi-ffi.d.ts +108 -0
  50. package/lib/typescript/module/src/ddk_ffi-ffi.d.ts.map +1 -0
  51. package/lib/typescript/module/src/ddk_ffi.d.ts +773 -0
  52. package/lib/typescript/module/src/ddk_ffi.d.ts.map +1 -0
  53. package/lib/typescript/module/src/index.d.ts +8 -0
  54. package/lib/typescript/module/src/index.d.ts.map +1 -0
  55. package/package.json +206 -0
  56. package/scripts/postinstall.js +130 -0
  57. package/src/NativeDdkRn.ts +10 -0
  58. package/src/ddk_ffi-ffi.ts +307 -0
  59. package/src/ddk_ffi.ts +1743 -0
  60. package/src/index.tsx +41 -0
@@ -0,0 +1,1072 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TxOutput = exports.TxInputInfo = exports.TxInput = exports.Transaction = exports.Payout = exports.PartyParams = exports.OracleInfo = exports.DlcTransactions = exports.DlcOutcome = exports.DlcInputInfo = exports.DlcError_Tags = exports.DlcError = exports.ChangeOutputAndFees = exports.AdaptorSignature = void 0;
7
+ exports.createCet = createCet;
8
+ exports.createCetAdaptorSignatureFromOracleInfo = createCetAdaptorSignatureFromOracleInfo;
9
+ exports.createCets = createCets;
10
+ exports.createDlcTransactions = createDlcTransactions;
11
+ exports.createFundTxLockingScript = createFundTxLockingScript;
12
+ exports.createRefundTransaction = createRefundTransaction;
13
+ exports.createSplicedDlcTransactions = createSplicedDlcTransactions;
14
+ exports.default = void 0;
15
+ exports.getChangeOutputAndFees = getChangeOutputAndFees;
16
+ exports.getRawFundingTransactionInputSignature = getRawFundingTransactionInputSignature;
17
+ exports.getTotalInputVsize = getTotalInputVsize;
18
+ exports.isDustOutput = isDustOutput;
19
+ exports.signFundTransactionInput = signFundTransactionInput;
20
+ exports.verifyFundTxSignature = verifyFundTxSignature;
21
+ exports.version = version;
22
+ var _ddk_ffiFfi = _interopRequireDefault(require("./ddk_ffi-ffi.js"));
23
+ var _uniffiBindgenReactNative = require("uniffi-bindgen-react-native");
24
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
25
+ // This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate.
26
+ // Trust me, you don't want to mess with it!
27
+
28
+ // Get converters from the other files, if any.
29
+ const uniffiCaller = new _uniffiBindgenReactNative.UniffiRustCaller(() => ({
30
+ code: 0
31
+ }));
32
+ const uniffiIsDebug =
33
+ // @ts-ignore -- The process global might not be defined
34
+ typeof process !== 'object' ||
35
+ // @ts-ignore -- The process global might not be defined
36
+ process?.env?.NODE_ENV !== 'production' || true;
37
+ // Public interface members begin here.
38
+
39
+ function createCet(localOutput, localPayoutSerialId, remoteOutput, remotePayoutSerialId, fundTxId, fundVout, lockTime) /*throws*/{
40
+ return FfiConverterTypeTransaction.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
41
+ return (() => {
42
+ console.debug(`-- uniffi_ddk_ffi_fn_func_create_cet`);
43
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_cet;
44
+ })()(FfiConverterTypeTxOutput.lower(localOutput), _uniffiBindgenReactNative.FfiConverterUInt64.lower(localPayoutSerialId), FfiConverterTypeTxOutput.lower(remoteOutput), _uniffiBindgenReactNative.FfiConverterUInt64.lower(remotePayoutSerialId), FfiConverterString.lower(fundTxId), _uniffiBindgenReactNative.FfiConverterUInt32.lower(fundVout), _uniffiBindgenReactNative.FfiConverterUInt32.lower(lockTime), callStatus);
45
+ }, /*liftString:*/FfiConverterString.lift));
46
+ }
47
+ function createCetAdaptorSignatureFromOracleInfo(cet, oracleInfo, fundingSk, fundingScriptPubkey, totalCollateral, msgs) /*throws*/{
48
+ return FfiConverterTypeAdaptorSignature.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
49
+ return (() => {
50
+ console.debug(`-- uniffi_ddk_ffi_fn_func_create_cet_adaptor_signature_from_oracle_info`);
51
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_signature_from_oracle_info;
52
+ })()(FfiConverterTypeTransaction.lower(cet), FfiConverterTypeOracleInfo.lower(oracleInfo), FfiConverterArrayUInt8.lower(fundingSk), FfiConverterArrayUInt8.lower(fundingScriptPubkey), _uniffiBindgenReactNative.FfiConverterUInt64.lower(totalCollateral), FfiConverterArrayArrayUInt8.lower(msgs), callStatus);
53
+ }, /*liftString:*/FfiConverterString.lift));
54
+ }
55
+ function createCets(fundTxId, fundVout, localFinalScriptPubkey, remoteFinalScriptPubkey, outcomes, lockTime, localSerialId, remoteSerialId) /*throws*/{
56
+ return FfiConverterArrayTypeTransaction.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
57
+ return (() => {
58
+ console.debug(`-- uniffi_ddk_ffi_fn_func_create_cets`);
59
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_cets;
60
+ })()(FfiConverterString.lower(fundTxId), _uniffiBindgenReactNative.FfiConverterUInt32.lower(fundVout), FfiConverterArrayUInt8.lower(localFinalScriptPubkey), FfiConverterArrayUInt8.lower(remoteFinalScriptPubkey), FfiConverterArrayTypeDlcOutcome.lower(outcomes), _uniffiBindgenReactNative.FfiConverterUInt32.lower(lockTime), _uniffiBindgenReactNative.FfiConverterUInt64.lower(localSerialId), _uniffiBindgenReactNative.FfiConverterUInt64.lower(remoteSerialId), callStatus);
61
+ }, /*liftString:*/FfiConverterString.lift));
62
+ }
63
+ function createDlcTransactions(outcomes, localParams, remoteParams, refundLocktime, feeRate, fundLockTime, cetLockTime, fundOutputSerialId) /*throws*/{
64
+ return FfiConverterTypeDlcTransactions.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
65
+ return (() => {
66
+ console.debug(`-- uniffi_ddk_ffi_fn_func_create_dlc_transactions`);
67
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_dlc_transactions;
68
+ })()(FfiConverterArrayTypeDlcOutcome.lower(outcomes), FfiConverterTypePartyParams.lower(localParams), FfiConverterTypePartyParams.lower(remoteParams), _uniffiBindgenReactNative.FfiConverterUInt32.lower(refundLocktime), _uniffiBindgenReactNative.FfiConverterUInt64.lower(feeRate), _uniffiBindgenReactNative.FfiConverterUInt32.lower(fundLockTime), _uniffiBindgenReactNative.FfiConverterUInt32.lower(cetLockTime), _uniffiBindgenReactNative.FfiConverterUInt64.lower(fundOutputSerialId), callStatus);
69
+ }, /*liftString:*/FfiConverterString.lift));
70
+ }
71
+ function createFundTxLockingScript(localFundPubkey, remoteFundPubkey) /*throws*/{
72
+ return FfiConverterArrayUInt8.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
73
+ return (() => {
74
+ console.debug(`-- uniffi_ddk_ffi_fn_func_create_fund_tx_locking_script`);
75
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_fund_tx_locking_script;
76
+ })()(FfiConverterArrayUInt8.lower(localFundPubkey), FfiConverterArrayUInt8.lower(remoteFundPubkey), callStatus);
77
+ }, /*liftString:*/FfiConverterString.lift));
78
+ }
79
+ function createRefundTransaction(localFinalScriptPubkey, remoteFinalScriptPubkey, localAmount, remoteAmount, lockTime, fundTxId, fundVout) /*throws*/{
80
+ return FfiConverterTypeTransaction.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
81
+ return (() => {
82
+ console.debug(`-- uniffi_ddk_ffi_fn_func_create_refund_transaction`);
83
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_refund_transaction;
84
+ })()(FfiConverterArrayUInt8.lower(localFinalScriptPubkey), FfiConverterArrayUInt8.lower(remoteFinalScriptPubkey), _uniffiBindgenReactNative.FfiConverterUInt64.lower(localAmount), _uniffiBindgenReactNative.FfiConverterUInt64.lower(remoteAmount), _uniffiBindgenReactNative.FfiConverterUInt32.lower(lockTime), FfiConverterString.lower(fundTxId), _uniffiBindgenReactNative.FfiConverterUInt32.lower(fundVout), callStatus);
85
+ }, /*liftString:*/FfiConverterString.lift));
86
+ }
87
+ function createSplicedDlcTransactions(outcomes, localParams, remoteParams, refundLocktime, feeRate, fundLockTime, cetLockTime, fundOutputSerialId) /*throws*/{
88
+ return FfiConverterTypeDlcTransactions.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
89
+ return (() => {
90
+ console.debug(`-- uniffi_ddk_ffi_fn_func_create_spliced_dlc_transactions`);
91
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_spliced_dlc_transactions;
92
+ })()(FfiConverterArrayTypeDlcOutcome.lower(outcomes), FfiConverterTypePartyParams.lower(localParams), FfiConverterTypePartyParams.lower(remoteParams), _uniffiBindgenReactNative.FfiConverterUInt32.lower(refundLocktime), _uniffiBindgenReactNative.FfiConverterUInt64.lower(feeRate), _uniffiBindgenReactNative.FfiConverterUInt32.lower(fundLockTime), _uniffiBindgenReactNative.FfiConverterUInt32.lower(cetLockTime), _uniffiBindgenReactNative.FfiConverterUInt64.lower(fundOutputSerialId), callStatus);
93
+ }, /*liftString:*/FfiConverterString.lift));
94
+ }
95
+ function getChangeOutputAndFees(params, feeRate) /*throws*/{
96
+ return FfiConverterTypeChangeOutputAndFees.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
97
+ return (() => {
98
+ console.debug(`-- uniffi_ddk_ffi_fn_func_get_change_output_and_fees`);
99
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_get_change_output_and_fees;
100
+ })()(FfiConverterTypePartyParams.lower(params), _uniffiBindgenReactNative.FfiConverterUInt64.lower(feeRate), callStatus);
101
+ }, /*liftString:*/FfiConverterString.lift));
102
+ }
103
+ function getRawFundingTransactionInputSignature(fundingTransaction, privkey, prevTxId, prevTxVout, value) /*throws*/{
104
+ return FfiConverterArrayUInt8.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
105
+ return (() => {
106
+ console.debug(`-- uniffi_ddk_ffi_fn_func_get_raw_funding_transaction_input_signature`);
107
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_get_raw_funding_transaction_input_signature;
108
+ })()(FfiConverterTypeTransaction.lower(fundingTransaction), FfiConverterArrayUInt8.lower(privkey), FfiConverterString.lower(prevTxId), _uniffiBindgenReactNative.FfiConverterUInt32.lower(prevTxVout), _uniffiBindgenReactNative.FfiConverterUInt64.lower(value), callStatus);
109
+ }, /*liftString:*/FfiConverterString.lift));
110
+ }
111
+ function getTotalInputVsize(inputs) {
112
+ return _uniffiBindgenReactNative.FfiConverterUInt32.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
113
+ return (() => {
114
+ console.debug(`-- uniffi_ddk_ffi_fn_func_get_total_input_vsize`);
115
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_get_total_input_vsize;
116
+ })()(FfiConverterArrayTypeTxInputInfo.lower(inputs), callStatus);
117
+ }, /*liftString:*/FfiConverterString.lift));
118
+ }
119
+ function isDustOutput(output) {
120
+ return _uniffiBindgenReactNative.FfiConverterBool.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
121
+ return (() => {
122
+ console.debug(`-- uniffi_ddk_ffi_fn_func_is_dust_output`);
123
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_is_dust_output;
124
+ })()(FfiConverterTypeTxOutput.lower(output), callStatus);
125
+ }, /*liftString:*/FfiConverterString.lift));
126
+ }
127
+ function signFundTransactionInput(fundTransaction, privkey, prevTxId, prevTxVout, value) /*throws*/{
128
+ return FfiConverterTypeTransaction.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
129
+ return (() => {
130
+ console.debug(`-- uniffi_ddk_ffi_fn_func_sign_fund_transaction_input`);
131
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_sign_fund_transaction_input;
132
+ })()(FfiConverterTypeTransaction.lower(fundTransaction), FfiConverterArrayUInt8.lower(privkey), FfiConverterString.lower(prevTxId), _uniffiBindgenReactNative.FfiConverterUInt32.lower(prevTxVout), _uniffiBindgenReactNative.FfiConverterUInt64.lower(value), callStatus);
133
+ }, /*liftString:*/FfiConverterString.lift));
134
+ }
135
+ function verifyFundTxSignature(fundTx, signature, pubkey, txid, vout, inputAmount) /*throws*/{
136
+ return _uniffiBindgenReactNative.FfiConverterBool.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
137
+ return (() => {
138
+ console.debug(`-- uniffi_ddk_ffi_fn_func_verify_fund_tx_signature`);
139
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_verify_fund_tx_signature;
140
+ })()(FfiConverterTypeTransaction.lower(fundTx), FfiConverterArrayUInt8.lower(signature), FfiConverterArrayUInt8.lower(pubkey), FfiConverterString.lower(txid), _uniffiBindgenReactNative.FfiConverterUInt32.lower(vout), _uniffiBindgenReactNative.FfiConverterUInt64.lower(inputAmount), callStatus);
141
+ }, /*liftString:*/FfiConverterString.lift));
142
+ }
143
+ function version() {
144
+ return FfiConverterString.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
145
+ return (() => {
146
+ console.debug(`-- uniffi_ddk_ffi_fn_func_version`);
147
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_version;
148
+ })()(callStatus);
149
+ }, /*liftString:*/FfiConverterString.lift));
150
+ }
151
+ /**
152
+ * Generated factory for {@link AdaptorSignature} record objects.
153
+ */
154
+ const AdaptorSignature = exports.AdaptorSignature = (() => {
155
+ const defaults = () => ({});
156
+ const create = (() => {
157
+ return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(defaults);
158
+ })();
159
+ return Object.freeze({
160
+ /**
161
+ * Create a frozen instance of {@link AdaptorSignature}, with defaults specified
162
+ * in Rust, in the {@link ddk_ffi} crate.
163
+ */
164
+ create,
165
+ /**
166
+ * Create a frozen instance of {@link AdaptorSignature}, with defaults specified
167
+ * in Rust, in the {@link ddk_ffi} crate.
168
+ */
169
+ new: create,
170
+ /**
171
+ * Defaults specified in the {@link ddk_ffi} crate.
172
+ */
173
+ defaults: () => Object.freeze(defaults())
174
+ });
175
+ })();
176
+ const FfiConverterTypeAdaptorSignature = (() => {
177
+ class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
178
+ read(from) {
179
+ return {
180
+ signature: FfiConverterArrayUInt8.read(from),
181
+ proof: FfiConverterArrayUInt8.read(from)
182
+ };
183
+ }
184
+ write(value, into) {
185
+ FfiConverterArrayUInt8.write(value.signature, into);
186
+ FfiConverterArrayUInt8.write(value.proof, into);
187
+ }
188
+ allocationSize(value) {
189
+ return FfiConverterArrayUInt8.allocationSize(value.signature) + FfiConverterArrayUInt8.allocationSize(value.proof);
190
+ }
191
+ }
192
+ return new FFIConverter();
193
+ })();
194
+ /**
195
+ * Generated factory for {@link ChangeOutputAndFees} record objects.
196
+ */
197
+ const ChangeOutputAndFees = exports.ChangeOutputAndFees = (() => {
198
+ const defaults = () => ({});
199
+ const create = (() => {
200
+ return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(defaults);
201
+ })();
202
+ return Object.freeze({
203
+ /**
204
+ * Create a frozen instance of {@link ChangeOutputAndFees}, with defaults specified
205
+ * in Rust, in the {@link ddk_ffi} crate.
206
+ */
207
+ create,
208
+ /**
209
+ * Create a frozen instance of {@link ChangeOutputAndFees}, with defaults specified
210
+ * in Rust, in the {@link ddk_ffi} crate.
211
+ */
212
+ new: create,
213
+ /**
214
+ * Defaults specified in the {@link ddk_ffi} crate.
215
+ */
216
+ defaults: () => Object.freeze(defaults())
217
+ });
218
+ })();
219
+ const FfiConverterTypeChangeOutputAndFees = (() => {
220
+ class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
221
+ read(from) {
222
+ return {
223
+ changeOutput: FfiConverterTypeTxOutput.read(from),
224
+ fundFee: _uniffiBindgenReactNative.FfiConverterUInt64.read(from),
225
+ cetFee: _uniffiBindgenReactNative.FfiConverterUInt64.read(from)
226
+ };
227
+ }
228
+ write(value, into) {
229
+ FfiConverterTypeTxOutput.write(value.changeOutput, into);
230
+ _uniffiBindgenReactNative.FfiConverterUInt64.write(value.fundFee, into);
231
+ _uniffiBindgenReactNative.FfiConverterUInt64.write(value.cetFee, into);
232
+ }
233
+ allocationSize(value) {
234
+ return FfiConverterTypeTxOutput.allocationSize(value.changeOutput) + _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.fundFee) + _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.cetFee);
235
+ }
236
+ }
237
+ return new FFIConverter();
238
+ })();
239
+ /**
240
+ * Generated factory for {@link DlcInputInfo} record objects.
241
+ */
242
+ const DlcInputInfo = exports.DlcInputInfo = (() => {
243
+ const defaults = () => ({});
244
+ const create = (() => {
245
+ return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(defaults);
246
+ })();
247
+ return Object.freeze({
248
+ /**
249
+ * Create a frozen instance of {@link DlcInputInfo}, with defaults specified
250
+ * in Rust, in the {@link ddk_ffi} crate.
251
+ */
252
+ create,
253
+ /**
254
+ * Create a frozen instance of {@link DlcInputInfo}, with defaults specified
255
+ * in Rust, in the {@link ddk_ffi} crate.
256
+ */
257
+ new: create,
258
+ /**
259
+ * Defaults specified in the {@link ddk_ffi} crate.
260
+ */
261
+ defaults: () => Object.freeze(defaults())
262
+ });
263
+ })();
264
+ const FfiConverterTypeDlcInputInfo = (() => {
265
+ class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
266
+ read(from) {
267
+ return {
268
+ fundTx: FfiConverterTypeTransaction.read(from),
269
+ fundVout: _uniffiBindgenReactNative.FfiConverterUInt32.read(from),
270
+ localFundPubkey: FfiConverterArrayUInt8.read(from),
271
+ remoteFundPubkey: FfiConverterArrayUInt8.read(from),
272
+ fundAmount: _uniffiBindgenReactNative.FfiConverterUInt64.read(from),
273
+ maxWitnessLen: _uniffiBindgenReactNative.FfiConverterUInt32.read(from),
274
+ inputSerialId: _uniffiBindgenReactNative.FfiConverterUInt64.read(from),
275
+ contractId: FfiConverterArrayUInt8.read(from)
276
+ };
277
+ }
278
+ write(value, into) {
279
+ FfiConverterTypeTransaction.write(value.fundTx, into);
280
+ _uniffiBindgenReactNative.FfiConverterUInt32.write(value.fundVout, into);
281
+ FfiConverterArrayUInt8.write(value.localFundPubkey, into);
282
+ FfiConverterArrayUInt8.write(value.remoteFundPubkey, into);
283
+ _uniffiBindgenReactNative.FfiConverterUInt64.write(value.fundAmount, into);
284
+ _uniffiBindgenReactNative.FfiConverterUInt32.write(value.maxWitnessLen, into);
285
+ _uniffiBindgenReactNative.FfiConverterUInt64.write(value.inputSerialId, into);
286
+ FfiConverterArrayUInt8.write(value.contractId, into);
287
+ }
288
+ allocationSize(value) {
289
+ return FfiConverterTypeTransaction.allocationSize(value.fundTx) + _uniffiBindgenReactNative.FfiConverterUInt32.allocationSize(value.fundVout) + FfiConverterArrayUInt8.allocationSize(value.localFundPubkey) + FfiConverterArrayUInt8.allocationSize(value.remoteFundPubkey) + _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.fundAmount) + _uniffiBindgenReactNative.FfiConverterUInt32.allocationSize(value.maxWitnessLen) + _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.inputSerialId) + FfiConverterArrayUInt8.allocationSize(value.contractId);
290
+ }
291
+ }
292
+ return new FFIConverter();
293
+ })();
294
+ /**
295
+ * Generated factory for {@link DlcOutcome} record objects.
296
+ */
297
+ const DlcOutcome = exports.DlcOutcome = (() => {
298
+ const defaults = () => ({});
299
+ const create = (() => {
300
+ return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(defaults);
301
+ })();
302
+ return Object.freeze({
303
+ /**
304
+ * Create a frozen instance of {@link DlcOutcome}, with defaults specified
305
+ * in Rust, in the {@link ddk_ffi} crate.
306
+ */
307
+ create,
308
+ /**
309
+ * Create a frozen instance of {@link DlcOutcome}, with defaults specified
310
+ * in Rust, in the {@link ddk_ffi} crate.
311
+ */
312
+ new: create,
313
+ /**
314
+ * Defaults specified in the {@link ddk_ffi} crate.
315
+ */
316
+ defaults: () => Object.freeze(defaults())
317
+ });
318
+ })();
319
+ const FfiConverterTypeDlcOutcome = (() => {
320
+ class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
321
+ read(from) {
322
+ return {
323
+ localPayout: _uniffiBindgenReactNative.FfiConverterUInt64.read(from),
324
+ remotePayout: _uniffiBindgenReactNative.FfiConverterUInt64.read(from)
325
+ };
326
+ }
327
+ write(value, into) {
328
+ _uniffiBindgenReactNative.FfiConverterUInt64.write(value.localPayout, into);
329
+ _uniffiBindgenReactNative.FfiConverterUInt64.write(value.remotePayout, into);
330
+ }
331
+ allocationSize(value) {
332
+ return _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.localPayout) + _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.remotePayout);
333
+ }
334
+ }
335
+ return new FFIConverter();
336
+ })();
337
+ /**
338
+ * Generated factory for {@link DlcTransactions} record objects.
339
+ */
340
+ const DlcTransactions = exports.DlcTransactions = (() => {
341
+ const defaults = () => ({});
342
+ const create = (() => {
343
+ return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(defaults);
344
+ })();
345
+ return Object.freeze({
346
+ /**
347
+ * Create a frozen instance of {@link DlcTransactions}, with defaults specified
348
+ * in Rust, in the {@link ddk_ffi} crate.
349
+ */
350
+ create,
351
+ /**
352
+ * Create a frozen instance of {@link DlcTransactions}, with defaults specified
353
+ * in Rust, in the {@link ddk_ffi} crate.
354
+ */
355
+ new: create,
356
+ /**
357
+ * Defaults specified in the {@link ddk_ffi} crate.
358
+ */
359
+ defaults: () => Object.freeze(defaults())
360
+ });
361
+ })();
362
+ const FfiConverterTypeDlcTransactions = (() => {
363
+ class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
364
+ read(from) {
365
+ return {
366
+ fund: FfiConverterTypeTransaction.read(from),
367
+ cets: FfiConverterArrayTypeTransaction.read(from),
368
+ refund: FfiConverterTypeTransaction.read(from),
369
+ fundingScriptPubkey: FfiConverterArrayUInt8.read(from)
370
+ };
371
+ }
372
+ write(value, into) {
373
+ FfiConverterTypeTransaction.write(value.fund, into);
374
+ FfiConverterArrayTypeTransaction.write(value.cets, into);
375
+ FfiConverterTypeTransaction.write(value.refund, into);
376
+ FfiConverterArrayUInt8.write(value.fundingScriptPubkey, into);
377
+ }
378
+ allocationSize(value) {
379
+ return FfiConverterTypeTransaction.allocationSize(value.fund) + FfiConverterArrayTypeTransaction.allocationSize(value.cets) + FfiConverterTypeTransaction.allocationSize(value.refund) + FfiConverterArrayUInt8.allocationSize(value.fundingScriptPubkey);
380
+ }
381
+ }
382
+ return new FFIConverter();
383
+ })();
384
+ /**
385
+ * Generated factory for {@link OracleInfo} record objects.
386
+ */
387
+ const OracleInfo = exports.OracleInfo = (() => {
388
+ const defaults = () => ({});
389
+ const create = (() => {
390
+ return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(defaults);
391
+ })();
392
+ return Object.freeze({
393
+ /**
394
+ * Create a frozen instance of {@link OracleInfo}, with defaults specified
395
+ * in Rust, in the {@link ddk_ffi} crate.
396
+ */
397
+ create,
398
+ /**
399
+ * Create a frozen instance of {@link OracleInfo}, with defaults specified
400
+ * in Rust, in the {@link ddk_ffi} crate.
401
+ */
402
+ new: create,
403
+ /**
404
+ * Defaults specified in the {@link ddk_ffi} crate.
405
+ */
406
+ defaults: () => Object.freeze(defaults())
407
+ });
408
+ })();
409
+ const FfiConverterTypeOracleInfo = (() => {
410
+ class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
411
+ read(from) {
412
+ return {
413
+ publicKey: FfiConverterArrayUInt8.read(from),
414
+ nonces: FfiConverterArrayArrayUInt8.read(from)
415
+ };
416
+ }
417
+ write(value, into) {
418
+ FfiConverterArrayUInt8.write(value.publicKey, into);
419
+ FfiConverterArrayArrayUInt8.write(value.nonces, into);
420
+ }
421
+ allocationSize(value) {
422
+ return FfiConverterArrayUInt8.allocationSize(value.publicKey) + FfiConverterArrayArrayUInt8.allocationSize(value.nonces);
423
+ }
424
+ }
425
+ return new FFIConverter();
426
+ })();
427
+ /**
428
+ * Generated factory for {@link PartyParams} record objects.
429
+ */
430
+ const PartyParams = exports.PartyParams = (() => {
431
+ const defaults = () => ({});
432
+ const create = (() => {
433
+ return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(defaults);
434
+ })();
435
+ return Object.freeze({
436
+ /**
437
+ * Create a frozen instance of {@link PartyParams}, with defaults specified
438
+ * in Rust, in the {@link ddk_ffi} crate.
439
+ */
440
+ create,
441
+ /**
442
+ * Create a frozen instance of {@link PartyParams}, with defaults specified
443
+ * in Rust, in the {@link ddk_ffi} crate.
444
+ */
445
+ new: create,
446
+ /**
447
+ * Defaults specified in the {@link ddk_ffi} crate.
448
+ */
449
+ defaults: () => Object.freeze(defaults())
450
+ });
451
+ })();
452
+ const FfiConverterTypePartyParams = (() => {
453
+ class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
454
+ read(from) {
455
+ return {
456
+ fundPubkey: FfiConverterArrayUInt8.read(from),
457
+ changeScriptPubkey: FfiConverterArrayUInt8.read(from),
458
+ changeSerialId: _uniffiBindgenReactNative.FfiConverterUInt64.read(from),
459
+ payoutScriptPubkey: FfiConverterArrayUInt8.read(from),
460
+ payoutSerialId: _uniffiBindgenReactNative.FfiConverterUInt64.read(from),
461
+ inputs: FfiConverterArrayTypeTxInputInfo.read(from),
462
+ inputAmount: _uniffiBindgenReactNative.FfiConverterUInt64.read(from),
463
+ collateral: _uniffiBindgenReactNative.FfiConverterUInt64.read(from),
464
+ dlcInputs: FfiConverterArrayTypeDlcInputInfo.read(from)
465
+ };
466
+ }
467
+ write(value, into) {
468
+ FfiConverterArrayUInt8.write(value.fundPubkey, into);
469
+ FfiConverterArrayUInt8.write(value.changeScriptPubkey, into);
470
+ _uniffiBindgenReactNative.FfiConverterUInt64.write(value.changeSerialId, into);
471
+ FfiConverterArrayUInt8.write(value.payoutScriptPubkey, into);
472
+ _uniffiBindgenReactNative.FfiConverterUInt64.write(value.payoutSerialId, into);
473
+ FfiConverterArrayTypeTxInputInfo.write(value.inputs, into);
474
+ _uniffiBindgenReactNative.FfiConverterUInt64.write(value.inputAmount, into);
475
+ _uniffiBindgenReactNative.FfiConverterUInt64.write(value.collateral, into);
476
+ FfiConverterArrayTypeDlcInputInfo.write(value.dlcInputs, into);
477
+ }
478
+ allocationSize(value) {
479
+ return FfiConverterArrayUInt8.allocationSize(value.fundPubkey) + FfiConverterArrayUInt8.allocationSize(value.changeScriptPubkey) + _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.changeSerialId) + FfiConverterArrayUInt8.allocationSize(value.payoutScriptPubkey) + _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.payoutSerialId) + FfiConverterArrayTypeTxInputInfo.allocationSize(value.inputs) + _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.inputAmount) + _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.collateral) + FfiConverterArrayTypeDlcInputInfo.allocationSize(value.dlcInputs);
480
+ }
481
+ }
482
+ return new FFIConverter();
483
+ })();
484
+ /**
485
+ * Generated factory for {@link Payout} record objects.
486
+ */
487
+ const Payout = exports.Payout = (() => {
488
+ const defaults = () => ({});
489
+ const create = (() => {
490
+ return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(defaults);
491
+ })();
492
+ return Object.freeze({
493
+ /**
494
+ * Create a frozen instance of {@link Payout}, with defaults specified
495
+ * in Rust, in the {@link ddk_ffi} crate.
496
+ */
497
+ create,
498
+ /**
499
+ * Create a frozen instance of {@link Payout}, with defaults specified
500
+ * in Rust, in the {@link ddk_ffi} crate.
501
+ */
502
+ new: create,
503
+ /**
504
+ * Defaults specified in the {@link ddk_ffi} crate.
505
+ */
506
+ defaults: () => Object.freeze(defaults())
507
+ });
508
+ })();
509
+ const FfiConverterTypePayout = (() => {
510
+ class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
511
+ read(from) {
512
+ return {
513
+ offer: _uniffiBindgenReactNative.FfiConverterUInt64.read(from),
514
+ accept: _uniffiBindgenReactNative.FfiConverterUInt64.read(from)
515
+ };
516
+ }
517
+ write(value, into) {
518
+ _uniffiBindgenReactNative.FfiConverterUInt64.write(value.offer, into);
519
+ _uniffiBindgenReactNative.FfiConverterUInt64.write(value.accept, into);
520
+ }
521
+ allocationSize(value) {
522
+ return _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.offer) + _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.accept);
523
+ }
524
+ }
525
+ return new FFIConverter();
526
+ })();
527
+ /**
528
+ * Generated factory for {@link Transaction} record objects.
529
+ */
530
+ const Transaction = exports.Transaction = (() => {
531
+ const defaults = () => ({});
532
+ const create = (() => {
533
+ return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(defaults);
534
+ })();
535
+ return Object.freeze({
536
+ /**
537
+ * Create a frozen instance of {@link Transaction}, with defaults specified
538
+ * in Rust, in the {@link ddk_ffi} crate.
539
+ */
540
+ create,
541
+ /**
542
+ * Create a frozen instance of {@link Transaction}, with defaults specified
543
+ * in Rust, in the {@link ddk_ffi} crate.
544
+ */
545
+ new: create,
546
+ /**
547
+ * Defaults specified in the {@link ddk_ffi} crate.
548
+ */
549
+ defaults: () => Object.freeze(defaults())
550
+ });
551
+ })();
552
+ const FfiConverterTypeTransaction = (() => {
553
+ class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
554
+ read(from) {
555
+ return {
556
+ version: _uniffiBindgenReactNative.FfiConverterInt32.read(from),
557
+ lockTime: _uniffiBindgenReactNative.FfiConverterUInt32.read(from),
558
+ inputs: FfiConverterArrayTypeTxInput.read(from),
559
+ outputs: FfiConverterArrayTypeTxOutput.read(from),
560
+ rawBytes: FfiConverterArrayUInt8.read(from)
561
+ };
562
+ }
563
+ write(value, into) {
564
+ _uniffiBindgenReactNative.FfiConverterInt32.write(value.version, into);
565
+ _uniffiBindgenReactNative.FfiConverterUInt32.write(value.lockTime, into);
566
+ FfiConverterArrayTypeTxInput.write(value.inputs, into);
567
+ FfiConverterArrayTypeTxOutput.write(value.outputs, into);
568
+ FfiConverterArrayUInt8.write(value.rawBytes, into);
569
+ }
570
+ allocationSize(value) {
571
+ return _uniffiBindgenReactNative.FfiConverterInt32.allocationSize(value.version) + _uniffiBindgenReactNative.FfiConverterUInt32.allocationSize(value.lockTime) + FfiConverterArrayTypeTxInput.allocationSize(value.inputs) + FfiConverterArrayTypeTxOutput.allocationSize(value.outputs) + FfiConverterArrayUInt8.allocationSize(value.rawBytes);
572
+ }
573
+ }
574
+ return new FFIConverter();
575
+ })();
576
+ /**
577
+ * Generated factory for {@link TxInput} record objects.
578
+ */
579
+ const TxInput = exports.TxInput = (() => {
580
+ const defaults = () => ({});
581
+ const create = (() => {
582
+ return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(defaults);
583
+ })();
584
+ return Object.freeze({
585
+ /**
586
+ * Create a frozen instance of {@link TxInput}, with defaults specified
587
+ * in Rust, in the {@link ddk_ffi} crate.
588
+ */
589
+ create,
590
+ /**
591
+ * Create a frozen instance of {@link TxInput}, with defaults specified
592
+ * in Rust, in the {@link ddk_ffi} crate.
593
+ */
594
+ new: create,
595
+ /**
596
+ * Defaults specified in the {@link ddk_ffi} crate.
597
+ */
598
+ defaults: () => Object.freeze(defaults())
599
+ });
600
+ })();
601
+ const FfiConverterTypeTxInput = (() => {
602
+ class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
603
+ read(from) {
604
+ return {
605
+ txid: FfiConverterString.read(from),
606
+ vout: _uniffiBindgenReactNative.FfiConverterUInt32.read(from),
607
+ scriptSig: FfiConverterArrayUInt8.read(from),
608
+ sequence: _uniffiBindgenReactNative.FfiConverterUInt32.read(from),
609
+ witness: FfiConverterArrayArrayUInt8.read(from)
610
+ };
611
+ }
612
+ write(value, into) {
613
+ FfiConverterString.write(value.txid, into);
614
+ _uniffiBindgenReactNative.FfiConverterUInt32.write(value.vout, into);
615
+ FfiConverterArrayUInt8.write(value.scriptSig, into);
616
+ _uniffiBindgenReactNative.FfiConverterUInt32.write(value.sequence, into);
617
+ FfiConverterArrayArrayUInt8.write(value.witness, into);
618
+ }
619
+ allocationSize(value) {
620
+ return FfiConverterString.allocationSize(value.txid) + _uniffiBindgenReactNative.FfiConverterUInt32.allocationSize(value.vout) + FfiConverterArrayUInt8.allocationSize(value.scriptSig) + _uniffiBindgenReactNative.FfiConverterUInt32.allocationSize(value.sequence) + FfiConverterArrayArrayUInt8.allocationSize(value.witness);
621
+ }
622
+ }
623
+ return new FFIConverter();
624
+ })();
625
+ /**
626
+ * Generated factory for {@link TxInputInfo} record objects.
627
+ */
628
+ const TxInputInfo = exports.TxInputInfo = (() => {
629
+ const defaults = () => ({});
630
+ const create = (() => {
631
+ return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(defaults);
632
+ })();
633
+ return Object.freeze({
634
+ /**
635
+ * Create a frozen instance of {@link TxInputInfo}, with defaults specified
636
+ * in Rust, in the {@link ddk_ffi} crate.
637
+ */
638
+ create,
639
+ /**
640
+ * Create a frozen instance of {@link TxInputInfo}, with defaults specified
641
+ * in Rust, in the {@link ddk_ffi} crate.
642
+ */
643
+ new: create,
644
+ /**
645
+ * Defaults specified in the {@link ddk_ffi} crate.
646
+ */
647
+ defaults: () => Object.freeze(defaults())
648
+ });
649
+ })();
650
+ const FfiConverterTypeTxInputInfo = (() => {
651
+ class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
652
+ read(from) {
653
+ return {
654
+ txid: FfiConverterString.read(from),
655
+ vout: _uniffiBindgenReactNative.FfiConverterUInt32.read(from),
656
+ scriptSig: FfiConverterArrayUInt8.read(from),
657
+ maxWitnessLength: _uniffiBindgenReactNative.FfiConverterUInt32.read(from),
658
+ serialId: _uniffiBindgenReactNative.FfiConverterUInt64.read(from)
659
+ };
660
+ }
661
+ write(value, into) {
662
+ FfiConverterString.write(value.txid, into);
663
+ _uniffiBindgenReactNative.FfiConverterUInt32.write(value.vout, into);
664
+ FfiConverterArrayUInt8.write(value.scriptSig, into);
665
+ _uniffiBindgenReactNative.FfiConverterUInt32.write(value.maxWitnessLength, into);
666
+ _uniffiBindgenReactNative.FfiConverterUInt64.write(value.serialId, into);
667
+ }
668
+ allocationSize(value) {
669
+ return FfiConverterString.allocationSize(value.txid) + _uniffiBindgenReactNative.FfiConverterUInt32.allocationSize(value.vout) + FfiConverterArrayUInt8.allocationSize(value.scriptSig) + _uniffiBindgenReactNative.FfiConverterUInt32.allocationSize(value.maxWitnessLength) + _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.serialId);
670
+ }
671
+ }
672
+ return new FFIConverter();
673
+ })();
674
+ /**
675
+ * Generated factory for {@link TxOutput} record objects.
676
+ */
677
+ const TxOutput = exports.TxOutput = (() => {
678
+ const defaults = () => ({});
679
+ const create = (() => {
680
+ return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(defaults);
681
+ })();
682
+ return Object.freeze({
683
+ /**
684
+ * Create a frozen instance of {@link TxOutput}, with defaults specified
685
+ * in Rust, in the {@link ddk_ffi} crate.
686
+ */
687
+ create,
688
+ /**
689
+ * Create a frozen instance of {@link TxOutput}, with defaults specified
690
+ * in Rust, in the {@link ddk_ffi} crate.
691
+ */
692
+ new: create,
693
+ /**
694
+ * Defaults specified in the {@link ddk_ffi} crate.
695
+ */
696
+ defaults: () => Object.freeze(defaults())
697
+ });
698
+ })();
699
+ const FfiConverterTypeTxOutput = (() => {
700
+ class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
701
+ read(from) {
702
+ return {
703
+ value: _uniffiBindgenReactNative.FfiConverterUInt64.read(from),
704
+ scriptPubkey: FfiConverterArrayUInt8.read(from)
705
+ };
706
+ }
707
+ write(value, into) {
708
+ _uniffiBindgenReactNative.FfiConverterUInt64.write(value.value, into);
709
+ FfiConverterArrayUInt8.write(value.scriptPubkey, into);
710
+ }
711
+ allocationSize(value) {
712
+ return _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.value) + FfiConverterArrayUInt8.allocationSize(value.scriptPubkey);
713
+ }
714
+ }
715
+ return new FFIConverter();
716
+ })();
717
+ const stringConverter = {
718
+ stringToBytes: s => uniffiCaller.rustCall(status => (0, _ddk_ffiFfi.default)().ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer(s, status)),
719
+ bytesToString: ab => uniffiCaller.rustCall(status => (0, _ddk_ffiFfi.default)().ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string(ab, status)),
720
+ stringByteLength: s => uniffiCaller.rustCall(status => (0, _ddk_ffiFfi.default)().ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length(s, status))
721
+ };
722
+ const FfiConverterString = (0, _uniffiBindgenReactNative.uniffiCreateFfiConverterString)(stringConverter);
723
+
724
+ // Flat error type: DlcError
725
+ let DlcError_Tags = exports.DlcError_Tags = /*#__PURE__*/function (DlcError_Tags) {
726
+ DlcError_Tags["InvalidSignature"] = "InvalidSignature";
727
+ DlcError_Tags["InvalidPublicKey"] = "InvalidPublicKey";
728
+ DlcError_Tags["InvalidTransaction"] = "InvalidTransaction";
729
+ DlcError_Tags["InsufficientFunds"] = "InsufficientFunds";
730
+ DlcError_Tags["InvalidArgument"] = "InvalidArgument";
731
+ DlcError_Tags["SerializationError"] = "SerializationError";
732
+ DlcError_Tags["Secp256k1Error"] = "Secp256k1Error";
733
+ DlcError_Tags["MiniscriptError"] = "MiniscriptError";
734
+ DlcError_Tags["NetworkError"] = "NetworkError";
735
+ return DlcError_Tags;
736
+ }({});
737
+ const DlcError = exports.DlcError = (() => {
738
+ class InvalidSignature extends _uniffiBindgenReactNative.UniffiError {
739
+ /**
740
+ * @private
741
+ * This field is private and should not be used.
742
+ */
743
+ [_uniffiBindgenReactNative.uniffiTypeNameSymbol] = 'DlcError';
744
+ /**
745
+ * @private
746
+ * This field is private and should not be used.
747
+ */
748
+ [_uniffiBindgenReactNative.variantOrdinalSymbol] = 1;
749
+ tag = DlcError_Tags.InvalidSignature;
750
+ constructor(message) {
751
+ super('DlcError', 'InvalidSignature', message);
752
+ }
753
+ static instanceOf(e) {
754
+ return instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 1;
755
+ }
756
+ }
757
+ class InvalidPublicKey extends _uniffiBindgenReactNative.UniffiError {
758
+ /**
759
+ * @private
760
+ * This field is private and should not be used.
761
+ */
762
+ [_uniffiBindgenReactNative.uniffiTypeNameSymbol] = 'DlcError';
763
+ /**
764
+ * @private
765
+ * This field is private and should not be used.
766
+ */
767
+ [_uniffiBindgenReactNative.variantOrdinalSymbol] = 2;
768
+ tag = DlcError_Tags.InvalidPublicKey;
769
+ constructor(message) {
770
+ super('DlcError', 'InvalidPublicKey', message);
771
+ }
772
+ static instanceOf(e) {
773
+ return instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 2;
774
+ }
775
+ }
776
+ class InvalidTransaction extends _uniffiBindgenReactNative.UniffiError {
777
+ /**
778
+ * @private
779
+ * This field is private and should not be used.
780
+ */
781
+ [_uniffiBindgenReactNative.uniffiTypeNameSymbol] = 'DlcError';
782
+ /**
783
+ * @private
784
+ * This field is private and should not be used.
785
+ */
786
+ [_uniffiBindgenReactNative.variantOrdinalSymbol] = 3;
787
+ tag = DlcError_Tags.InvalidTransaction;
788
+ constructor(message) {
789
+ super('DlcError', 'InvalidTransaction', message);
790
+ }
791
+ static instanceOf(e) {
792
+ return instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 3;
793
+ }
794
+ }
795
+ class InsufficientFunds extends _uniffiBindgenReactNative.UniffiError {
796
+ /**
797
+ * @private
798
+ * This field is private and should not be used.
799
+ */
800
+ [_uniffiBindgenReactNative.uniffiTypeNameSymbol] = 'DlcError';
801
+ /**
802
+ * @private
803
+ * This field is private and should not be used.
804
+ */
805
+ [_uniffiBindgenReactNative.variantOrdinalSymbol] = 4;
806
+ tag = DlcError_Tags.InsufficientFunds;
807
+ constructor(message) {
808
+ super('DlcError', 'InsufficientFunds', message);
809
+ }
810
+ static instanceOf(e) {
811
+ return instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 4;
812
+ }
813
+ }
814
+ class InvalidArgument extends _uniffiBindgenReactNative.UniffiError {
815
+ /**
816
+ * @private
817
+ * This field is private and should not be used.
818
+ */
819
+ [_uniffiBindgenReactNative.uniffiTypeNameSymbol] = 'DlcError';
820
+ /**
821
+ * @private
822
+ * This field is private and should not be used.
823
+ */
824
+ [_uniffiBindgenReactNative.variantOrdinalSymbol] = 5;
825
+ tag = DlcError_Tags.InvalidArgument;
826
+ constructor(message) {
827
+ super('DlcError', 'InvalidArgument', message);
828
+ }
829
+ static instanceOf(e) {
830
+ return instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 5;
831
+ }
832
+ }
833
+ class SerializationError extends _uniffiBindgenReactNative.UniffiError {
834
+ /**
835
+ * @private
836
+ * This field is private and should not be used.
837
+ */
838
+ [_uniffiBindgenReactNative.uniffiTypeNameSymbol] = 'DlcError';
839
+ /**
840
+ * @private
841
+ * This field is private and should not be used.
842
+ */
843
+ [_uniffiBindgenReactNative.variantOrdinalSymbol] = 6;
844
+ tag = DlcError_Tags.SerializationError;
845
+ constructor(message) {
846
+ super('DlcError', 'SerializationError', message);
847
+ }
848
+ static instanceOf(e) {
849
+ return instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 6;
850
+ }
851
+ }
852
+ class Secp256k1Error extends _uniffiBindgenReactNative.UniffiError {
853
+ /**
854
+ * @private
855
+ * This field is private and should not be used.
856
+ */
857
+ [_uniffiBindgenReactNative.uniffiTypeNameSymbol] = 'DlcError';
858
+ /**
859
+ * @private
860
+ * This field is private and should not be used.
861
+ */
862
+ [_uniffiBindgenReactNative.variantOrdinalSymbol] = 7;
863
+ tag = DlcError_Tags.Secp256k1Error;
864
+ constructor(message) {
865
+ super('DlcError', 'Secp256k1Error', message);
866
+ }
867
+ static instanceOf(e) {
868
+ return instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 7;
869
+ }
870
+ }
871
+ class MiniscriptError extends _uniffiBindgenReactNative.UniffiError {
872
+ /**
873
+ * @private
874
+ * This field is private and should not be used.
875
+ */
876
+ [_uniffiBindgenReactNative.uniffiTypeNameSymbol] = 'DlcError';
877
+ /**
878
+ * @private
879
+ * This field is private and should not be used.
880
+ */
881
+ [_uniffiBindgenReactNative.variantOrdinalSymbol] = 8;
882
+ tag = DlcError_Tags.MiniscriptError;
883
+ constructor(message) {
884
+ super('DlcError', 'MiniscriptError', message);
885
+ }
886
+ static instanceOf(e) {
887
+ return instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 8;
888
+ }
889
+ }
890
+ class NetworkError extends _uniffiBindgenReactNative.UniffiError {
891
+ /**
892
+ * @private
893
+ * This field is private and should not be used.
894
+ */
895
+ [_uniffiBindgenReactNative.uniffiTypeNameSymbol] = 'DlcError';
896
+ /**
897
+ * @private
898
+ * This field is private and should not be used.
899
+ */
900
+ [_uniffiBindgenReactNative.variantOrdinalSymbol] = 9;
901
+ tag = DlcError_Tags.NetworkError;
902
+ constructor(message) {
903
+ super('DlcError', 'NetworkError', message);
904
+ }
905
+ static instanceOf(e) {
906
+ return instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 9;
907
+ }
908
+ }
909
+
910
+ // Utility function which does not rely on instanceof.
911
+ function instanceOf(e) {
912
+ return e[_uniffiBindgenReactNative.uniffiTypeNameSymbol] === 'DlcError';
913
+ }
914
+ return {
915
+ InvalidSignature,
916
+ InvalidPublicKey,
917
+ InvalidTransaction,
918
+ InsufficientFunds,
919
+ InvalidArgument,
920
+ SerializationError,
921
+ Secp256k1Error,
922
+ MiniscriptError,
923
+ NetworkError,
924
+ instanceOf
925
+ };
926
+ })();
927
+
928
+ // Union type for DlcError error type.
929
+
930
+ const FfiConverterTypeDLCError = (() => {
931
+ const intConverter = _uniffiBindgenReactNative.FfiConverterInt32;
932
+ class FfiConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
933
+ read(from) {
934
+ switch (intConverter.read(from)) {
935
+ case 1:
936
+ return new DlcError.InvalidSignature(FfiConverterString.read(from));
937
+ case 2:
938
+ return new DlcError.InvalidPublicKey(FfiConverterString.read(from));
939
+ case 3:
940
+ return new DlcError.InvalidTransaction(FfiConverterString.read(from));
941
+ case 4:
942
+ return new DlcError.InsufficientFunds(FfiConverterString.read(from));
943
+ case 5:
944
+ return new DlcError.InvalidArgument(FfiConverterString.read(from));
945
+ case 6:
946
+ return new DlcError.SerializationError(FfiConverterString.read(from));
947
+ case 7:
948
+ return new DlcError.Secp256k1Error(FfiConverterString.read(from));
949
+ case 8:
950
+ return new DlcError.MiniscriptError(FfiConverterString.read(from));
951
+ case 9:
952
+ return new DlcError.NetworkError(FfiConverterString.read(from));
953
+ default:
954
+ throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
955
+ }
956
+ }
957
+ write(value, into) {
958
+ const obj = value;
959
+ const index = obj[_uniffiBindgenReactNative.variantOrdinalSymbol];
960
+ intConverter.write(index, into);
961
+ }
962
+ allocationSize(value) {
963
+ return intConverter.allocationSize(0);
964
+ }
965
+ }
966
+ return new FfiConverter();
967
+ })();
968
+
969
+ // FfiConverter for Array<DlcInputInfo>
970
+ const FfiConverterArrayTypeDlcInputInfo = new _uniffiBindgenReactNative.FfiConverterArray(FfiConverterTypeDlcInputInfo);
971
+
972
+ // FfiConverter for Array<DlcOutcome>
973
+ const FfiConverterArrayTypeDlcOutcome = new _uniffiBindgenReactNative.FfiConverterArray(FfiConverterTypeDlcOutcome);
974
+
975
+ // FfiConverter for Array<Transaction>
976
+ const FfiConverterArrayTypeTransaction = new _uniffiBindgenReactNative.FfiConverterArray(FfiConverterTypeTransaction);
977
+
978
+ // FfiConverter for Array<TxInput>
979
+ const FfiConverterArrayTypeTxInput = new _uniffiBindgenReactNative.FfiConverterArray(FfiConverterTypeTxInput);
980
+
981
+ // FfiConverter for Array<TxInputInfo>
982
+ const FfiConverterArrayTypeTxInputInfo = new _uniffiBindgenReactNative.FfiConverterArray(FfiConverterTypeTxInputInfo);
983
+
984
+ // FfiConverter for Array<TxOutput>
985
+ const FfiConverterArrayTypeTxOutput = new _uniffiBindgenReactNative.FfiConverterArray(FfiConverterTypeTxOutput);
986
+
987
+ // FfiConverter for Array</*u8*/number>
988
+ const FfiConverterArrayUInt8 = new _uniffiBindgenReactNative.FfiConverterArray(_uniffiBindgenReactNative.FfiConverterUInt8);
989
+
990
+ // FfiConverter for Array<Array</*u8*/number>>
991
+ const FfiConverterArrayArrayUInt8 = new _uniffiBindgenReactNative.FfiConverterArray(FfiConverterArrayUInt8);
992
+
993
+ /**
994
+ * This should be called before anything else.
995
+ *
996
+ * It is likely that this is being done for you by the library's `index.ts`.
997
+ *
998
+ * It checks versions of uniffi between when the Rust scaffolding was generated
999
+ * and when the bindings were generated.
1000
+ *
1001
+ * It also initializes the machinery to enable Rust to talk back to Javascript.
1002
+ */
1003
+ function uniffiEnsureInitialized() {
1004
+ // Get the bindings contract version from our ComponentInterface
1005
+ const bindingsContractVersion = 29;
1006
+ // Get the scaffolding contract version by calling the into the dylib
1007
+ const scaffoldingContractVersion = (0, _ddk_ffiFfi.default)().ubrn_ffi_ddk_ffi_uniffi_contract_version();
1008
+ if (bindingsContractVersion !== scaffoldingContractVersion) {
1009
+ throw new _uniffiBindgenReactNative.UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
1010
+ }
1011
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_cet() !== 23081) {
1012
+ throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_cet');
1013
+ }
1014
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_signature_from_oracle_info() !== 65174) {
1015
+ throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_cet_adaptor_signature_from_oracle_info');
1016
+ }
1017
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_cets() !== 45293) {
1018
+ throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_cets');
1019
+ }
1020
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_dlc_transactions() !== 9500) {
1021
+ throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_dlc_transactions');
1022
+ }
1023
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_fund_tx_locking_script() !== 2761) {
1024
+ throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_fund_tx_locking_script');
1025
+ }
1026
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_refund_transaction() !== 57261) {
1027
+ throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_refund_transaction');
1028
+ }
1029
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions() !== 51059) {
1030
+ throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions');
1031
+ }
1032
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_get_change_output_and_fees() !== 44150) {
1033
+ throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_get_change_output_and_fees');
1034
+ }
1035
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_get_raw_funding_transaction_input_signature() !== 35708) {
1036
+ throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_get_raw_funding_transaction_input_signature');
1037
+ }
1038
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_get_total_input_vsize() !== 38213) {
1039
+ throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_get_total_input_vsize');
1040
+ }
1041
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_is_dust_output() !== 64174) {
1042
+ throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_is_dust_output');
1043
+ }
1044
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_sign_fund_transaction_input() !== 50531) {
1045
+ throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_sign_fund_transaction_input');
1046
+ }
1047
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_verify_fund_tx_signature() !== 27316) {
1048
+ throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_verify_fund_tx_signature');
1049
+ }
1050
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_version() !== 22317) {
1051
+ throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_version');
1052
+ }
1053
+ }
1054
+ var _default = exports.default = Object.freeze({
1055
+ initialize: uniffiEnsureInitialized,
1056
+ converters: {
1057
+ FfiConverterTypeAdaptorSignature,
1058
+ FfiConverterTypeChangeOutputAndFees,
1059
+ FfiConverterTypeDLCError,
1060
+ FfiConverterTypeDlcInputInfo,
1061
+ FfiConverterTypeDlcOutcome,
1062
+ FfiConverterTypeDlcTransactions,
1063
+ FfiConverterTypeOracleInfo,
1064
+ FfiConverterTypePartyParams,
1065
+ FfiConverterTypePayout,
1066
+ FfiConverterTypeTransaction,
1067
+ FfiConverterTypeTxInput,
1068
+ FfiConverterTypeTxInputInfo,
1069
+ FfiConverterTypeTxOutput
1070
+ }
1071
+ });
1072
+ //# sourceMappingURL=ddk_ffi.js.map