@bennyblader/ddk-rn 0.3.42 → 0.4.0

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 (46) hide show
  1. package/DdkRn.podspec +1 -1
  2. package/README.md +14 -0
  3. package/android/CMakeLists.txt +6 -3
  4. package/android/build.gradle +0 -1
  5. package/android/cpp-adapter.cpp +6 -26
  6. package/android/src/main/jniLibs/arm64-v8a/libddk_ffi.so +0 -0
  7. package/android/src/main/jniLibs/armeabi-v7a/libddk_ffi.so +0 -0
  8. package/android/src/main/jniLibs/x86/libddk_ffi.so +0 -0
  9. package/android/src/main/jniLibs/x86_64/libddk_ffi.so +0 -0
  10. package/cpp/bennyblader-ddk-rn.cpp +1 -1
  11. package/cpp/ddk_ffi.cpp +2361 -2671
  12. package/cpp/ddk_ffi.hpp +86 -255
  13. package/ios/DdkRn.xcframework/Info.plist +43 -0
  14. package/ios/DdkRn.xcframework/ios-arm64/libddk_ffi.a +0 -0
  15. package/ios/DdkRn.xcframework/ios-arm64-simulator/libddk_ffi.a +0 -0
  16. package/lib/commonjs/ddk_ffi-ffi.js +6 -29
  17. package/lib/commonjs/ddk_ffi-ffi.js.map +1 -1
  18. package/lib/commonjs/ddk_ffi.js +961 -944
  19. package/lib/commonjs/ddk_ffi.js.map +1 -1
  20. package/lib/module/ddk_ffi-ffi.js +6 -29
  21. package/lib/module/ddk_ffi-ffi.js.map +1 -1
  22. package/lib/module/ddk_ffi.js +924 -896
  23. package/lib/module/ddk_ffi.js.map +1 -1
  24. package/lib/typescript/commonjs/src/ddk_ffi-ffi.d.ts +71 -96
  25. package/lib/typescript/commonjs/src/ddk_ffi-ffi.d.ts.map +1 -1
  26. package/lib/typescript/commonjs/src/ddk_ffi.d.ts +500 -471
  27. package/lib/typescript/commonjs/src/ddk_ffi.d.ts.map +1 -1
  28. package/lib/typescript/module/src/ddk_ffi-ffi.d.ts +71 -96
  29. package/lib/typescript/module/src/ddk_ffi-ffi.d.ts.map +1 -1
  30. package/lib/typescript/module/src/ddk_ffi.d.ts +500 -471
  31. package/lib/typescript/module/src/ddk_ffi.d.ts.map +1 -1
  32. package/package.json +8 -38
  33. package/src/ddk_ffi-ffi.ts +419 -170
  34. package/src/ddk_ffi.ts +2648 -1939
  35. package/ubrn.config.yaml +18 -1
  36. package/ddk-ffi/Cargo.lock +0 -1013
  37. package/ddk-ffi/Cargo.toml +0 -36
  38. package/ddk-ffi/build.rs +0 -3
  39. package/ddk-ffi/rust-toolchain.toml +0 -10
  40. package/ddk-ffi/src/ddk_ffi.udl +0 -376
  41. package/ddk-ffi/src/lib.rs +0 -2509
  42. package/ddk-ffi/src/uniffi-bindgen.rs +0 -3
  43. package/ddk-ffi/uniffi.toml +0 -18
  44. package/scripts/apply-hotfix.js +0 -96
  45. package/scripts/postinstall.js +0 -298
  46. package/scripts/prepare-rust-src.js +0 -51
@@ -2,267 +2,275 @@
2
2
 
3
3
  // This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate.
4
4
  // Trust me, you don't want to mess with it!
5
+ /* tslint:disable */
6
+ /* eslint-disable */
7
+ // @ts-nocheck
5
8
  import nativeModule from "./ddk_ffi-ffi.js";
6
- import { AbstractFfiConverterByteArray, FfiConverterArray, FfiConverterBool, FfiConverterInt32, FfiConverterOptional, FfiConverterUInt32, FfiConverterUInt64, FfiConverterUInt8, UniffiError, UniffiInternalError, UniffiRustCaller, uniffiCreateFfiConverterString, uniffiCreateRecord, uniffiTypeNameSymbol, variantOrdinalSymbol } from "uniffi-bindgen-react-native";
7
-
8
- // Get converters from the other files, if any.
9
+ import { AbstractFfiConverterByteArray, FfiConverterArray, FfiConverterArrayBuffer, FfiConverterBool, FfiConverterInt32, FfiConverterOptional, FfiConverterUInt32, FfiConverterUInt64, FfiConverterUInt8, UniffiError, UniffiInternalError, UniffiRustCaller, uniffiCreateFfiConverterString, uniffiCreateRecord, uniffiTypeNameSymbol } from '@ubjs/core';
9
10
  const uniffiCaller = new UniffiRustCaller(() => ({
10
11
  code: 0
11
12
  }));
12
13
  const uniffiIsDebug =
13
14
  // @ts-ignore -- The process global might not be defined
14
- typeof process !== "object" ||
15
+ typeof process !== 'object' ||
15
16
  // @ts-ignore -- The process global might not be defined
16
- process?.env?.NODE_ENV !== "production" || true;
17
+ process?.env?.NODE_ENV !== 'production' || false;
18
+
17
19
  // Public interface members begin here.
18
20
 
19
- export function addSignatureToTransaction(tx, signature, pubkey, inputIndex) /*throws*/{
20
- return FfiConverterTypeTransaction.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
21
- return (() => {
22
- console.debug(`-- uniffi_ddk_ffi_fn_func_add_signature_to_transaction`);
23
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_add_signature_to_transaction;
24
- })()(FfiConverterTypeTransaction.lower(tx), FfiConverterArrayUInt8.lower(signature), FfiConverterArrayUInt8.lower(pubkey), FfiConverterUInt32.lower(inputIndex), callStatus);
25
- }, /*liftString:*/FfiConverterString.lift));
26
- }
27
21
  export function convertMnemonicToSeed(mnemonic, passphrase) /*throws*/{
28
- return FfiConverterArrayUInt8.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
29
- return (() => {
30
- console.debug(`-- uniffi_ddk_ffi_fn_func_convert_mnemonic_to_seed`);
31
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_convert_mnemonic_to_seed;
32
- })()(FfiConverterString.lower(mnemonic), FfiConverterOptionalString.lower(passphrase), callStatus);
33
- }, /*liftString:*/FfiConverterString.lift));
22
+ return (__rb => {
23
+ try {
24
+ return FfiConverterArrayBuffer.lift(__rb);
25
+ } finally {
26
+ nativeModule().rustbuffer_free(__rb);
27
+ }
28
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
29
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_convert_mnemonic_to_seed(FfiConverterString.lower(mnemonic, nativeModule().rustbuffer_alloc), FfiConverterOptionalString.lower(passphrase, nativeModule().rustbuffer_alloc), callStatus);
30
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
34
31
  }
32
+
33
+ /**
34
+ * Create a single CET
35
+ */
35
36
  export function createCet(localOutput, localPayoutSerialId, remoteOutput, remotePayoutSerialId, fundTxId, fundVout, lockTime) /*throws*/{
36
- return FfiConverterTypeTransaction.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
37
- return (() => {
38
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_cet`);
39
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_cet;
40
- })()(FfiConverterTypeTxOutput.lower(localOutput), FfiConverterUInt64.lower(localPayoutSerialId), FfiConverterTypeTxOutput.lower(remoteOutput), FfiConverterUInt64.lower(remotePayoutSerialId), FfiConverterString.lower(fundTxId), FfiConverterUInt32.lower(fundVout), FfiConverterUInt32.lower(lockTime), callStatus);
41
- }, /*liftString:*/FfiConverterString.lift));
37
+ return (__rb => {
38
+ try {
39
+ return FfiConverterTypeTransaction.lift(__rb);
40
+ } finally {
41
+ nativeModule().rustbuffer_free(__rb);
42
+ }
43
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
44
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_cet(FfiConverterTypeTxOutput.lower(localOutput, nativeModule().rustbuffer_alloc), FfiConverterUInt64.lower(localPayoutSerialId, nativeModule().rustbuffer_alloc), FfiConverterTypeTxOutput.lower(remoteOutput, nativeModule().rustbuffer_alloc), FfiConverterUInt64.lower(remotePayoutSerialId, nativeModule().rustbuffer_alloc), FfiConverterString.lower(fundTxId, nativeModule().rustbuffer_alloc), FfiConverterUInt32.lower(fundVout, nativeModule().rustbuffer_alloc), FfiConverterUInt32.lower(lockTime, nativeModule().rustbuffer_alloc), callStatus);
45
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
42
46
  }
43
47
  export function createCetAdaptorPointsFromOracleInfo(oracleInfo, msgs) /*throws*/{
44
- return FfiConverterArrayArrayUInt8.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
45
- return (() => {
46
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_cet_adaptor_points_from_oracle_info`);
47
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_points_from_oracle_info;
48
- })()(FfiConverterArrayTypeOracleInfo.lower(oracleInfo), FfiConverterArrayArrayArrayArrayUInt8.lower(msgs), callStatus);
49
- }, /*liftString:*/FfiConverterString.lift));
50
- }
51
- export function createCetAdaptorSignatureFromOracleInfo(cet, oracleInfo, fundingSk, fundingScriptPubkey, totalCollateral, msgs) /*throws*/{
52
- return FfiConverterTypeAdaptorSignature.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
53
- return (() => {
54
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_cet_adaptor_signature_from_oracle_info`);
55
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_signature_from_oracle_info;
56
- })()(FfiConverterTypeTransaction.lower(cet), FfiConverterTypeOracleInfo.lower(oracleInfo), FfiConverterArrayUInt8.lower(fundingSk), FfiConverterArrayUInt8.lower(fundingScriptPubkey), FfiConverterUInt64.lower(totalCollateral), FfiConverterArrayArrayUInt8.lower(msgs), callStatus);
57
- }, /*liftString:*/FfiConverterString.lift));
48
+ return (__rb => {
49
+ try {
50
+ return FfiConverterSequenceBytes.lift(__rb);
51
+ } finally {
52
+ nativeModule().rustbuffer_free(__rb);
53
+ }
54
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
55
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_points_from_oracle_info(FfiConverterSequenceTypeOracleInfo.lower(oracleInfo, nativeModule().rustbuffer_alloc), FfiConverterSequenceSequenceSequenceBytes.lower(msgs, nativeModule().rustbuffer_alloc), callStatus);
56
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
58
57
  }
59
58
  export function createCetAdaptorSigsFromOracleInfo(cets, oracleInfo, fundingSecretKey, fundingScriptPubkey, fundOutputValue, msgs) /*throws*/{
60
- return FfiConverterArrayTypeAdaptorSignature.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
61
- return (() => {
62
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_cet_adaptor_sigs_from_oracle_info`);
63
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_sigs_from_oracle_info;
64
- })()(FfiConverterArrayTypeTransaction.lower(cets), FfiConverterArrayTypeOracleInfo.lower(oracleInfo), FfiConverterArrayUInt8.lower(fundingSecretKey), FfiConverterArrayUInt8.lower(fundingScriptPubkey), FfiConverterUInt64.lower(fundOutputValue), FfiConverterArrayArrayArrayArrayUInt8.lower(msgs), callStatus);
65
- }, /*liftString:*/FfiConverterString.lift));
59
+ return (__rb => {
60
+ try {
61
+ return FfiConverterSequenceTypeAdaptorSignature.lift(__rb);
62
+ } finally {
63
+ nativeModule().rustbuffer_free(__rb);
64
+ }
65
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
66
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_sigs_from_oracle_info(FfiConverterSequenceTypeTransaction.lower(cets, nativeModule().rustbuffer_alloc), FfiConverterSequenceTypeOracleInfo.lower(oracleInfo, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(fundingSecretKey, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(fundingScriptPubkey, nativeModule().rustbuffer_alloc), FfiConverterUInt64.lower(fundOutputValue, nativeModule().rustbuffer_alloc), FfiConverterSequenceSequenceSequenceBytes.lower(msgs, nativeModule().rustbuffer_alloc), callStatus);
67
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
66
68
  }
69
+
70
+ /**
71
+ * Create adaptor signatures from pre-computed adaptor points.
72
+ */
67
73
  export function createCetAdaptorSigsFromPoints(cets, adaptorPoints, fundingSecretKey, fundingScriptPubkey, fundOutputValue) /*throws*/{
68
- return FfiConverterArrayTypeAdaptorSignature.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
69
- return (() => {
70
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_cet_adaptor_sigs_from_points`);
71
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_sigs_from_points;
72
- })()(FfiConverterArrayTypeTransaction.lower(cets), FfiConverterArrayArrayUInt8.lower(adaptorPoints), FfiConverterArrayUInt8.lower(fundingSecretKey), FfiConverterArrayUInt8.lower(fundingScriptPubkey), FfiConverterUInt64.lower(fundOutputValue), callStatus);
73
- }, /*liftString:*/FfiConverterString.lift));
74
+ return (__rb => {
75
+ try {
76
+ return FfiConverterSequenceTypeAdaptorSignature.lift(__rb);
77
+ } finally {
78
+ nativeModule().rustbuffer_free(__rb);
79
+ }
80
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
81
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_sigs_from_points(FfiConverterSequenceTypeTransaction.lower(cets, nativeModule().rustbuffer_alloc), FfiConverterSequenceBytes.lower(adaptorPoints, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(fundingSecretKey, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(fundingScriptPubkey, nativeModule().rustbuffer_alloc), FfiConverterUInt64.lower(fundOutputValue, nativeModule().rustbuffer_alloc), callStatus);
82
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
74
83
  }
84
+
85
+ /**
86
+ * Create multiple CETs
87
+ */
75
88
  export function createCets(fundTxId, fundVout, localFinalScriptPubkey, remoteFinalScriptPubkey, outcomes, lockTime, localSerialId, remoteSerialId) /*throws*/{
76
- return FfiConverterArrayTypeTransaction.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
77
- return (() => {
78
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_cets`);
79
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_cets;
80
- })()(FfiConverterString.lower(fundTxId), FfiConverterUInt32.lower(fundVout), FfiConverterArrayUInt8.lower(localFinalScriptPubkey), FfiConverterArrayUInt8.lower(remoteFinalScriptPubkey), FfiConverterArrayTypePayout.lower(outcomes), FfiConverterUInt32.lower(lockTime), FfiConverterUInt64.lower(localSerialId), FfiConverterUInt64.lower(remoteSerialId), callStatus);
81
- }, /*liftString:*/FfiConverterString.lift));
89
+ return (__rb => {
90
+ try {
91
+ return FfiConverterSequenceTypeTransaction.lift(__rb);
92
+ } finally {
93
+ nativeModule().rustbuffer_free(__rb);
94
+ }
95
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
96
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_cets(FfiConverterString.lower(fundTxId, nativeModule().rustbuffer_alloc), FfiConverterUInt32.lower(fundVout, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(localFinalScriptPubkey, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(remoteFinalScriptPubkey, nativeModule().rustbuffer_alloc), FfiConverterSequenceTypePayout.lower(outcomes, nativeModule().rustbuffer_alloc), FfiConverterUInt32.lower(lockTime, nativeModule().rustbuffer_alloc), FfiConverterUInt64.lower(localSerialId, nativeModule().rustbuffer_alloc), FfiConverterUInt64.lower(remoteSerialId, nativeModule().rustbuffer_alloc), callStatus);
97
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
82
98
  }
99
+
100
+ /**
101
+ * Create complete DLC transactions
102
+ */
83
103
  export function createDlcTransactions(outcomes, localParams, remoteParams, refundLocktime, feeRate, fundLockTime, cetLockTime, fundOutputSerialId, contractFlags) /*throws*/{
84
- return FfiConverterTypeDlcTransactions.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
85
- return (() => {
86
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_dlc_transactions`);
87
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_dlc_transactions;
88
- })()(FfiConverterArrayTypePayout.lower(outcomes), FfiConverterTypePartyParams.lower(localParams), FfiConverterTypePartyParams.lower(remoteParams), FfiConverterUInt32.lower(refundLocktime), FfiConverterUInt64.lower(feeRate), FfiConverterUInt32.lower(fundLockTime), FfiConverterUInt32.lower(cetLockTime), FfiConverterUInt64.lower(fundOutputSerialId), FfiConverterUInt8.lower(contractFlags), callStatus);
89
- }, /*liftString:*/FfiConverterString.lift));
104
+ return (__rb => {
105
+ try {
106
+ return FfiConverterTypeDlcTransactions.lift(__rb);
107
+ } finally {
108
+ nativeModule().rustbuffer_free(__rb);
109
+ }
110
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
111
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_dlc_transactions(FfiConverterSequenceTypePayout.lower(outcomes, nativeModule().rustbuffer_alloc), FfiConverterTypePartyParams.lower(localParams, nativeModule().rustbuffer_alloc), FfiConverterTypePartyParams.lower(remoteParams, nativeModule().rustbuffer_alloc), FfiConverterUInt32.lower(refundLocktime, nativeModule().rustbuffer_alloc), FfiConverterUInt64.lower(feeRate, nativeModule().rustbuffer_alloc), FfiConverterUInt32.lower(fundLockTime, nativeModule().rustbuffer_alloc), FfiConverterUInt32.lower(cetLockTime, nativeModule().rustbuffer_alloc), FfiConverterUInt64.lower(fundOutputSerialId, nativeModule().rustbuffer_alloc), FfiConverterUInt8.lower(contractFlags, nativeModule().rustbuffer_alloc), callStatus);
112
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
90
113
  }
114
+
115
+ /**
116
+ * Derive child extended private key from parent extended key
117
+ * Input: 78-byte encoded xpriv, Output: 78-byte encoded xpriv
118
+ */
91
119
  export function createExtkeyFromParentPath(extkey, path) /*throws*/{
92
- return FfiConverterArrayUInt8.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
93
- return (() => {
94
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_extkey_from_parent_path`);
95
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_extkey_from_parent_path;
96
- })()(FfiConverterArrayUInt8.lower(extkey), FfiConverterString.lower(path), callStatus);
97
- }, /*liftString:*/FfiConverterString.lift));
120
+ return (__rb => {
121
+ try {
122
+ return FfiConverterArrayBuffer.lift(__rb);
123
+ } finally {
124
+ nativeModule().rustbuffer_free(__rb);
125
+ }
126
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
127
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_extkey_from_parent_path(FfiConverterArrayBuffer.lower(extkey, nativeModule().rustbuffer_alloc), FfiConverterString.lower(path, nativeModule().rustbuffer_alloc), callStatus);
128
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
98
129
  }
130
+
131
+ /**
132
+ * Create master extended private key from 64-byte seed
133
+ * Returns 78-byte encoded xpriv
134
+ */
99
135
  export function createExtkeyFromSeed(seed, network) /*throws*/{
100
- return FfiConverterArrayUInt8.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
101
- return (() => {
102
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_extkey_from_seed`);
103
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_extkey_from_seed;
104
- })()(FfiConverterArrayUInt8.lower(seed), FfiConverterString.lower(network), callStatus);
105
- }, /*liftString:*/FfiConverterString.lift));
136
+ return (__rb => {
137
+ try {
138
+ return FfiConverterArrayBuffer.lift(__rb);
139
+ } finally {
140
+ nativeModule().rustbuffer_free(__rb);
141
+ }
142
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
143
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_extkey_from_seed(FfiConverterArrayBuffer.lower(seed, nativeModule().rustbuffer_alloc), FfiConverterString.lower(network, nativeModule().rustbuffer_alloc), callStatus);
144
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
106
145
  }
146
+
147
+ /**
148
+ * Create a funding script pubkey for DLC transactions
149
+ */
107
150
  export function createFundTxLockingScript(localFundPubkey, remoteFundPubkey) /*throws*/{
108
- return FfiConverterArrayUInt8.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
109
- return (() => {
110
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_fund_tx_locking_script`);
111
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_fund_tx_locking_script;
112
- })()(FfiConverterArrayUInt8.lower(localFundPubkey), FfiConverterArrayUInt8.lower(remoteFundPubkey), callStatus);
113
- }, /*liftString:*/FfiConverterString.lift));
151
+ return (__rb => {
152
+ try {
153
+ return FfiConverterArrayBuffer.lift(__rb);
154
+ } finally {
155
+ nativeModule().rustbuffer_free(__rb);
156
+ }
157
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
158
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_fund_tx_locking_script(FfiConverterArrayBuffer.lower(localFundPubkey, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(remoteFundPubkey, nativeModule().rustbuffer_alloc), callStatus);
159
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
114
160
  }
161
+
162
+ /**
163
+ * Create a refund transaction
164
+ */
115
165
  export function createRefundTransaction(localFinalScriptPubkey, remoteFinalScriptPubkey, localAmount, remoteAmount, lockTime, fundTxId, fundVout) /*throws*/{
116
- return FfiConverterTypeTransaction.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
117
- return (() => {
118
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_refund_transaction`);
119
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_refund_transaction;
120
- })()(FfiConverterArrayUInt8.lower(localFinalScriptPubkey), FfiConverterArrayUInt8.lower(remoteFinalScriptPubkey), FfiConverterUInt64.lower(localAmount), FfiConverterUInt64.lower(remoteAmount), FfiConverterUInt32.lower(lockTime), FfiConverterString.lower(fundTxId), FfiConverterUInt32.lower(fundVout), callStatus);
121
- }, /*liftString:*/FfiConverterString.lift));
166
+ return (__rb => {
167
+ try {
168
+ return FfiConverterTypeTransaction.lift(__rb);
169
+ } finally {
170
+ nativeModule().rustbuffer_free(__rb);
171
+ }
172
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
173
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_refund_transaction(FfiConverterArrayBuffer.lower(localFinalScriptPubkey, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(remoteFinalScriptPubkey, nativeModule().rustbuffer_alloc), FfiConverterUInt64.lower(localAmount, nativeModule().rustbuffer_alloc), FfiConverterUInt64.lower(remoteAmount, nativeModule().rustbuffer_alloc), FfiConverterUInt32.lower(lockTime, nativeModule().rustbuffer_alloc), FfiConverterString.lower(fundTxId, nativeModule().rustbuffer_alloc), FfiConverterUInt32.lower(fundVout, nativeModule().rustbuffer_alloc), callStatus);
174
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
122
175
  }
176
+
177
+ /**
178
+ * Create spliced DLC transactions
179
+ */
123
180
  export function createSplicedDlcTransactions(outcomes, localParams, remoteParams, refundLocktime, feeRate, fundLockTime, cetLockTime, fundOutputSerialId, contractFlags) /*throws*/{
124
- return FfiConverterTypeDlcTransactions.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
125
- return (() => {
126
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_spliced_dlc_transactions`);
127
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_spliced_dlc_transactions;
128
- })()(FfiConverterArrayTypePayout.lower(outcomes), FfiConverterTypePartyParams.lower(localParams), FfiConverterTypePartyParams.lower(remoteParams), FfiConverterUInt32.lower(refundLocktime), FfiConverterUInt64.lower(feeRate), FfiConverterUInt32.lower(fundLockTime), FfiConverterUInt32.lower(cetLockTime), FfiConverterUInt64.lower(fundOutputSerialId), FfiConverterUInt8.lower(contractFlags), callStatus);
129
- }, /*liftString:*/FfiConverterString.lift));
181
+ return (__rb => {
182
+ try {
183
+ return FfiConverterTypeDlcTransactions.lift(__rb);
184
+ } finally {
185
+ nativeModule().rustbuffer_free(__rb);
186
+ }
187
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
188
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_spliced_dlc_transactions(FfiConverterSequenceTypePayout.lower(outcomes, nativeModule().rustbuffer_alloc), FfiConverterTypePartyParams.lower(localParams, nativeModule().rustbuffer_alloc), FfiConverterTypePartyParams.lower(remoteParams, nativeModule().rustbuffer_alloc), FfiConverterUInt32.lower(refundLocktime, nativeModule().rustbuffer_alloc), FfiConverterUInt64.lower(feeRate, nativeModule().rustbuffer_alloc), FfiConverterUInt32.lower(fundLockTime, nativeModule().rustbuffer_alloc), FfiConverterUInt32.lower(cetLockTime, nativeModule().rustbuffer_alloc), FfiConverterUInt64.lower(fundOutputSerialId, nativeModule().rustbuffer_alloc), FfiConverterUInt8.lower(contractFlags, nativeModule().rustbuffer_alloc), callStatus);
189
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
130
190
  }
191
+
192
+ /**
193
+ * DEPRECATED: Use create_extkey_from_seed + create_extkey_from_parent_path instead
194
+ * This function handles both seeds (64 bytes) and xprivs (78 bytes) which is confusing
195
+ */
131
196
  export function createXprivFromParentPath(seedOrXpriv, baseDerivationPath, network, path) /*throws*/{
132
- return FfiConverterArrayUInt8.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
133
- return (() => {
134
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_xpriv_from_parent_path`);
135
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_xpriv_from_parent_path;
136
- })()(FfiConverterArrayUInt8.lower(seedOrXpriv), FfiConverterString.lower(baseDerivationPath), FfiConverterString.lower(network), FfiConverterString.lower(path), callStatus);
137
- }, /*liftString:*/FfiConverterString.lift));
197
+ return (__rb => {
198
+ try {
199
+ return FfiConverterArrayBuffer.lift(__rb);
200
+ } finally {
201
+ nativeModule().rustbuffer_free(__rb);
202
+ }
203
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
204
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_create_xpriv_from_parent_path(FfiConverterArrayBuffer.lower(seedOrXpriv, nativeModule().rustbuffer_alloc), FfiConverterString.lower(baseDerivationPath, nativeModule().rustbuffer_alloc), FfiConverterString.lower(network, nativeModule().rustbuffer_alloc), FfiConverterString.lower(path, nativeModule().rustbuffer_alloc), callStatus);
205
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
138
206
  }
139
207
  export function extractEcdsaSignatureFromOracleSignatures(oracleSignatures, adaptorSignature) /*throws*/{
140
- return FfiConverterArrayUInt8.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
141
- return (() => {
142
- console.debug(`-- uniffi_ddk_ffi_fn_func_extract_ecdsa_signature_from_oracle_signatures`);
143
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_extract_ecdsa_signature_from_oracle_signatures;
144
- })()(FfiConverterArrayArrayUInt8.lower(oracleSignatures), FfiConverterArrayUInt8.lower(adaptorSignature), callStatus);
145
- }, /*liftString:*/FfiConverterString.lift));
146
- }
147
- export function getCetAdaptorSignatureInputs(cet, oracleInfo, fundingScriptPubkey, fundOutputValue, msgs) /*throws*/{
148
- return FfiConverterTypeCetAdaptorSignatureDebugInfo.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
149
- return (() => {
150
- console.debug(`-- uniffi_ddk_ffi_fn_func_get_cet_adaptor_signature_inputs`);
151
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_get_cet_adaptor_signature_inputs;
152
- })()(FfiConverterTypeTransaction.lower(cet), FfiConverterArrayTypeOracleInfo.lower(oracleInfo), FfiConverterArrayUInt8.lower(fundingScriptPubkey), FfiConverterUInt64.lower(fundOutputValue), FfiConverterArrayArrayArrayUInt8.lower(msgs), callStatus);
153
- }, /*liftString:*/FfiConverterString.lift));
154
- }
155
- export function getCetSighash(cet, fundingScriptPubkey, fundOutputValue) /*throws*/{
156
- return FfiConverterArrayUInt8.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
157
- return (() => {
158
- console.debug(`-- uniffi_ddk_ffi_fn_func_get_cet_sighash`);
159
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_get_cet_sighash;
160
- })()(FfiConverterTypeTransaction.lower(cet), FfiConverterArrayUInt8.lower(fundingScriptPubkey), FfiConverterUInt64.lower(fundOutputValue), callStatus);
161
- }, /*liftString:*/FfiConverterString.lift));
162
- }
163
- export function getChangeOutputAndFees(params, feeRate) /*throws*/{
164
- return FfiConverterTypeChangeOutputAndFees.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
165
- return (() => {
166
- console.debug(`-- uniffi_ddk_ffi_fn_func_get_change_output_and_fees`);
167
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_get_change_output_and_fees;
168
- })()(FfiConverterTypePartyParams.lower(params), FfiConverterUInt64.lower(feeRate), callStatus);
169
- }, /*liftString:*/FfiConverterString.lift));
208
+ return (__rb => {
209
+ try {
210
+ return FfiConverterArrayBuffer.lift(__rb);
211
+ } finally {
212
+ nativeModule().rustbuffer_free(__rb);
213
+ }
214
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
215
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_extract_ecdsa_signature_from_oracle_signatures(FfiConverterSequenceBytes.lower(oracleSignatures, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(adaptorSignature, nativeModule().rustbuffer_alloc), callStatus);
216
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
170
217
  }
218
+
219
+ /**
220
+ * Extract public key from extended key (private or public)
221
+ * Input: 78-byte encoded xpriv/xpub, Output: 33-byte compressed public key
222
+ */
171
223
  export function getPubkeyFromExtkey(extkey, network) /*throws*/{
172
- return FfiConverterArrayUInt8.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
173
- return (() => {
174
- console.debug(`-- uniffi_ddk_ffi_fn_func_get_pubkey_from_extkey`);
175
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_get_pubkey_from_extkey;
176
- })()(FfiConverterArrayUInt8.lower(extkey), FfiConverterString.lower(network), callStatus);
177
- }, /*liftString:*/FfiConverterString.lift));
178
- }
179
- export function getRawFundingTransactionInputSignature(fundingTransaction, privkey, prevTxId, prevTxVout, value) /*throws*/{
180
- return FfiConverterArrayUInt8.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
181
- return (() => {
182
- console.debug(`-- uniffi_ddk_ffi_fn_func_get_raw_funding_transaction_input_signature`);
183
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_get_raw_funding_transaction_input_signature;
184
- })()(FfiConverterTypeTransaction.lower(fundingTransaction), FfiConverterArrayUInt8.lower(privkey), FfiConverterString.lower(prevTxId), FfiConverterUInt32.lower(prevTxVout), FfiConverterUInt64.lower(value), callStatus);
185
- }, /*liftString:*/FfiConverterString.lift));
224
+ return (__rb => {
225
+ try {
226
+ return FfiConverterArrayBuffer.lift(__rb);
227
+ } finally {
228
+ nativeModule().rustbuffer_free(__rb);
229
+ }
230
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
231
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_get_pubkey_from_extkey(FfiConverterArrayBuffer.lower(extkey, nativeModule().rustbuffer_alloc), FfiConverterString.lower(network, nativeModule().rustbuffer_alloc), callStatus);
232
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
186
233
  }
234
+
235
+ /**
236
+ * Get total input virtual size for fee calculation
237
+ */
187
238
  export function getTotalInputVsize(inputs) {
188
239
  return FfiConverterUInt32.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
189
- return (() => {
190
- console.debug(`-- uniffi_ddk_ffi_fn_func_get_total_input_vsize`);
191
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_get_total_input_vsize;
192
- })()(FfiConverterArrayTypeTxInputInfo.lower(inputs), callStatus);
193
- }, /*liftString:*/FfiConverterString.lift));
240
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_get_total_input_vsize(FfiConverterSequenceTypeTxInputInfo.lower(inputs, nativeModule().rustbuffer_alloc), callStatus);
241
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
194
242
  }
243
+
244
+ /**
245
+ * Convert extended private key to extended public key
246
+ * Input: 78-byte encoded xpriv, Output: 78-byte encoded xpub
247
+ */
195
248
  export function getXpubFromXpriv(xpriv, network) /*throws*/{
196
- return FfiConverterArrayUInt8.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
197
- return (() => {
198
- console.debug(`-- uniffi_ddk_ffi_fn_func_get_xpub_from_xpriv`);
199
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_get_xpub_from_xpriv;
200
- })()(FfiConverterArrayUInt8.lower(xpriv), FfiConverterString.lower(network), callStatus);
201
- }, /*liftString:*/FfiConverterString.lift));
202
- }
203
- export function isDustOutput(output) {
204
- return FfiConverterBool.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
205
- return (() => {
206
- console.debug(`-- uniffi_ddk_ffi_fn_func_is_dust_output`);
207
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_is_dust_output;
208
- })()(FfiConverterTypeTxOutput.lower(output), callStatus);
209
- }, /*liftString:*/FfiConverterString.lift));
210
- }
211
- export function signCet(cet, adaptorSignature, oracleSignatures, fundingSecretKey, otherPubkey, fundingScriptPubkey, fundOutputValue) /*throws*/{
212
- return FfiConverterTypeTransaction.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
213
- return (() => {
214
- console.debug(`-- uniffi_ddk_ffi_fn_func_sign_cet`);
215
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_sign_cet;
216
- })()(FfiConverterTypeTransaction.lower(cet), FfiConverterArrayUInt8.lower(adaptorSignature), FfiConverterArrayArrayUInt8.lower(oracleSignatures), FfiConverterArrayUInt8.lower(fundingSecretKey), FfiConverterArrayUInt8.lower(otherPubkey), FfiConverterArrayUInt8.lower(fundingScriptPubkey), FfiConverterUInt64.lower(fundOutputValue), callStatus);
217
- }, /*liftString:*/FfiConverterString.lift));
218
- }
219
- export function signFundTransactionInput(fundTransaction, privkey, prevTxId, prevTxVout, value) /*throws*/{
220
- return FfiConverterTypeTransaction.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
221
- return (() => {
222
- console.debug(`-- uniffi_ddk_ffi_fn_func_sign_fund_transaction_input`);
223
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_sign_fund_transaction_input;
224
- })()(FfiConverterTypeTransaction.lower(fundTransaction), FfiConverterArrayUInt8.lower(privkey), FfiConverterString.lower(prevTxId), FfiConverterUInt32.lower(prevTxVout), FfiConverterUInt64.lower(value), callStatus);
225
- }, /*liftString:*/FfiConverterString.lift));
226
- }
227
- export function signMultiSigInput(tx, dlcInput, localPrivkey, remoteSignature) /*throws*/{
228
- return FfiConverterTypeTransaction.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
229
- return (() => {
230
- console.debug(`-- uniffi_ddk_ffi_fn_func_sign_multi_sig_input`);
231
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_sign_multi_sig_input;
232
- })()(FfiConverterTypeTransaction.lower(tx), FfiConverterTypeDlcInputInfo.lower(dlcInput), FfiConverterArrayUInt8.lower(localPrivkey), FfiConverterArrayUInt8.lower(remoteSignature), callStatus);
233
- }, /*liftString:*/FfiConverterString.lift));
234
- }
235
- export function verifyCetAdaptorSigFromOracleInfo(adaptorSig, cet, oracleInfo, pubkey, fundingScriptPubkey, totalCollateral, msgs) {
236
- return FfiConverterBool.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
237
- return (() => {
238
- console.debug(`-- uniffi_ddk_ffi_fn_func_verify_cet_adaptor_sig_from_oracle_info`);
239
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_verify_cet_adaptor_sig_from_oracle_info;
240
- })()(FfiConverterTypeAdaptorSignature.lower(adaptorSig), FfiConverterTypeTransaction.lower(cet), FfiConverterArrayTypeOracleInfo.lower(oracleInfo), FfiConverterArrayUInt8.lower(pubkey), FfiConverterArrayUInt8.lower(fundingScriptPubkey), FfiConverterUInt64.lower(totalCollateral), FfiConverterArrayArrayArrayUInt8.lower(msgs), callStatus);
241
- }, /*liftString:*/FfiConverterString.lift));
249
+ return (__rb => {
250
+ try {
251
+ return FfiConverterArrayBuffer.lift(__rb);
252
+ } finally {
253
+ nativeModule().rustbuffer_free(__rb);
254
+ }
255
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
256
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_get_xpub_from_xpriv(FfiConverterArrayBuffer.lower(xpriv, nativeModule().rustbuffer_alloc), FfiConverterString.lower(network, nativeModule().rustbuffer_alloc), callStatus);
257
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
242
258
  }
243
- export function verifyCetAdaptorSigsFromOracleInfo(adaptorSigs, cets, oracleInfo, pubkey, fundingScriptPubkey, totalCollateral, msgs) {
259
+ export function verifyCetAdaptorSigsFromOracleInfo(adaptorSigs, cets, oracleInfos, pubkey, fundingScriptPubkey, totalCollateral, msgs) {
244
260
  return FfiConverterBool.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
245
- return (() => {
246
- console.debug(`-- uniffi_ddk_ffi_fn_func_verify_cet_adaptor_sigs_from_oracle_info`);
247
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_verify_cet_adaptor_sigs_from_oracle_info;
248
- })()(FfiConverterArrayTypeAdaptorSignature.lower(adaptorSigs), FfiConverterArrayTypeTransaction.lower(cets), FfiConverterArrayTypeOracleInfo.lower(oracleInfo), FfiConverterArrayUInt8.lower(pubkey), FfiConverterArrayUInt8.lower(fundingScriptPubkey), FfiConverterUInt64.lower(totalCollateral), FfiConverterArrayArrayArrayArrayUInt8.lower(msgs), callStatus);
249
- }, /*liftString:*/FfiConverterString.lift));
250
- }
251
- export function verifyFundTxSignature(fundTx, signature, pubkey, txid, vout, inputAmount) /*throws*/{
252
- return FfiConverterBool.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
253
- return (() => {
254
- console.debug(`-- uniffi_ddk_ffi_fn_func_verify_fund_tx_signature`);
255
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_verify_fund_tx_signature;
256
- })()(FfiConverterTypeTransaction.lower(fundTx), FfiConverterArrayUInt8.lower(signature), FfiConverterArrayUInt8.lower(pubkey), FfiConverterString.lower(txid), FfiConverterUInt32.lower(vout), FfiConverterUInt64.lower(inputAmount), callStatus);
257
- }, /*liftString:*/FfiConverterString.lift));
261
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_verify_cet_adaptor_sigs_from_oracle_info(FfiConverterSequenceTypeAdaptorSignature.lower(adaptorSigs, nativeModule().rustbuffer_alloc), FfiConverterSequenceTypeTransaction.lower(cets, nativeModule().rustbuffer_alloc), FfiConverterSequenceTypeOracleInfo.lower(oracleInfos, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(pubkey, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(fundingScriptPubkey, nativeModule().rustbuffer_alloc), FfiConverterUInt64.lower(totalCollateral, nativeModule().rustbuffer_alloc), FfiConverterSequenceSequenceSequenceBytes.lower(msgs, nativeModule().rustbuffer_alloc), callStatus);
262
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
258
263
  }
259
264
  export function version() {
260
- return FfiConverterString.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
261
- return (() => {
262
- console.debug(`-- uniffi_ddk_ffi_fn_func_version`);
263
- return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_version;
264
- })()(callStatus);
265
- }, /*liftString:*/FfiConverterString.lift));
265
+ return (__rb => {
266
+ try {
267
+ return FfiConverterString.lift(__rb);
268
+ } finally {
269
+ nativeModule().rustbuffer_free(__rb);
270
+ }
271
+ })(uniffiCaller.rustCall(/*caller:*/callStatus => {
272
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_func_version(callStatus);
273
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
266
274
  }
267
275
  /**
268
276
  * Generated factory for {@link AdaptorSignature} record objects.
@@ -273,41 +281,83 @@ export const AdaptorSignature = (() => {
273
281
  return uniffiCreateRecord(defaults);
274
282
  })();
275
283
  return Object.freeze({
276
- /**
277
- * Create a frozen instance of {@link AdaptorSignature}, with defaults specified
278
- * in Rust, in the {@link ddk_ffi} crate.
279
- */
280
284
  create,
281
- /**
282
- * Create a frozen instance of {@link AdaptorSignature}, with defaults specified
283
- * in Rust, in the {@link ddk_ffi} crate.
284
- */
285
285
  new: create,
286
- /**
287
- * Defaults specified in the {@link ddk_ffi} crate.
288
- */
289
- defaults: () => Object.freeze(defaults())
286
+ defaults: () => Object.freeze(defaults()),
287
+ verifyFromOracleInfo(self_, cet, oracleInfos, pubkey, fundingScriptPubkey, totalCollateral, msgs) {
288
+ return FfiConverterBool.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
289
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_method_adaptorsignature_verify_from_oracle_info(FfiConverterTypeAdaptorSignature.lower(self_, nativeModule().rustbuffer_alloc), FfiConverterTypeTransaction.lower(cet, nativeModule().rustbuffer_alloc), FfiConverterSequenceTypeOracleInfo.lower(oracleInfos, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(pubkey, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(fundingScriptPubkey, nativeModule().rustbuffer_alloc), FfiConverterUInt64.lower(totalCollateral, nativeModule().rustbuffer_alloc), FfiConverterSequenceSequenceBytes.lower(msgs, nativeModule().rustbuffer_alloc), callStatus);
290
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
291
+ }
290
292
  });
291
293
  })();
292
294
  const FfiConverterTypeAdaptorSignature = (() => {
293
295
  class FFIConverter extends AbstractFfiConverterByteArray {
294
296
  read(from) {
295
297
  return {
296
- signature: FfiConverterArrayUInt8.read(from),
297
- proof: FfiConverterArrayUInt8.read(from)
298
+ signature: FfiConverterArrayBuffer.read(from),
299
+ proof: FfiConverterArrayBuffer.read(from)
298
300
  };
299
301
  }
300
302
  write(value, into) {
301
- FfiConverterArrayUInt8.write(value.signature, into);
302
- FfiConverterArrayUInt8.write(value.proof, into);
303
+ FfiConverterArrayBuffer.write(value.signature, into);
304
+ FfiConverterArrayBuffer.write(value.proof, into);
303
305
  }
304
306
  allocationSize(value) {
305
- return FfiConverterArrayUInt8.allocationSize(value.signature) + FfiConverterArrayUInt8.allocationSize(value.proof);
307
+ return FfiConverterArrayBuffer.allocationSize(value.signature) + FfiConverterArrayBuffer.allocationSize(value.proof);
306
308
  }
307
309
  }
308
- ;
309
310
  return new FFIConverter();
310
311
  })();
312
+
313
+ // Hermes (React Native ≥ 0.74) ships TextEncoder and encodeInto, but not
314
+ // TextDecoder. For single-string decode (bytesToString), we polyfill via the
315
+ // C++ string_from_buffer helper using a duck-typed object matching the
316
+ // standard TextDecoder.decode signature. Once Hermes ships a real
317
+ // TextDecoder, the `typeof` check will pick it up automatically.
318
+ //
319
+ // For array-of-strings decode (readStringFromBuffer), we keep a dedicated C++
320
+ // helper: the polyfill path (new Uint8Array view + decode) measured ~40%
321
+ // slower on getStringArray benchmarks than a direct (buf, offset, length)
322
+ // call, due to the per-read view allocation and extra property lookups in
323
+ // string_from_buffer.
324
+ const stringConverter = (() => {
325
+ const encoder = new TextEncoder();
326
+ const decoder = typeof TextDecoder !== 'undefined' ? new TextDecoder() : {
327
+ decode: bytes => nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_from_buffer(bytes, undefined)
328
+ };
329
+ return {
330
+ // Single-string lower() uses the C++ helper — TextEncoder.encode
331
+ // measured ~43% slower on takeString benchmarks.
332
+ stringToBytes: s => nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_buffer(s, undefined),
333
+ bytesToString: ab => decoder.decode(ab),
334
+ // Direct C++ call — bypasses uniffiCaller.rustCall() overhead.
335
+ // Matters for N-element arrays.
336
+ stringByteLength: s => nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length(s, undefined),
337
+ // Encode directly into the RustBuffer backing store via
338
+ // TextEncoder.encodeInto — zero intermediate allocation. Replaces
339
+ // the old C++ write_string_into_buffer helper.
340
+ writeStringIntoBuffer: (s, buf, offset) => {
341
+ const view = new Uint8Array(buf.arrayBuffer, offset, buf.arrayBuffer.byteLength - offset);
342
+ return encoder.encodeInto(s, view).written;
343
+ },
344
+ // Dedicated C++ helper — avoids per-read Uint8Array allocation and
345
+ // the double property-lookup in string_from_buffer.
346
+ readStringFromBuffer: (buf, offset, length) => nativeModule().ubrn_uniffi_internal_fn_func_ffi__read_string_from_buffer(buf, offset, length)
347
+ };
348
+ })();
349
+ const FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
350
+
351
+ /**
352
+ * Debug info for CET adaptor signature inputs.
353
+ *
354
+ * Contains all the values that go into creating an adaptor signature,
355
+ * useful for comparing with external signers during debugging.
356
+ *
357
+ * This struct is intentionally always available (not feature-gated)
358
+ * to support production debugging scenarios.
359
+ */
360
+
311
361
  /**
312
362
  * Generated factory for {@link CetAdaptorSignatureDebugInfo} record objects.
313
363
  */
@@ -317,19 +367,8 @@ export const CetAdaptorSignatureDebugInfo = (() => {
317
367
  return uniffiCreateRecord(defaults);
318
368
  })();
319
369
  return Object.freeze({
320
- /**
321
- * Create a frozen instance of {@link CetAdaptorSignatureDebugInfo}, with defaults specified
322
- * in Rust, in the {@link ddk_ffi} crate.
323
- */
324
370
  create,
325
- /**
326
- * Create a frozen instance of {@link CetAdaptorSignatureDebugInfo}, with defaults specified
327
- * in Rust, in the {@link ddk_ffi} crate.
328
- */
329
371
  new: create,
330
- /**
331
- * Defaults specified in the {@link ddk_ffi} crate.
332
- */
333
372
  defaults: () => Object.freeze(defaults())
334
373
  });
335
374
  })();
@@ -337,529 +376,553 @@ const FfiConverterTypeCetAdaptorSignatureDebugInfo = (() => {
337
376
  class FFIConverter extends AbstractFfiConverterByteArray {
338
377
  read(from) {
339
378
  return {
340
- sighash: FfiConverterArrayUInt8.read(from),
341
- adaptorPoint: FfiConverterArrayUInt8.read(from),
379
+ sighash: FfiConverterArrayBuffer.read(from),
380
+ adaptorPoint: FfiConverterArrayBuffer.read(from),
342
381
  inputIndex: FfiConverterUInt32.read(from),
343
- scriptPubkey: FfiConverterArrayUInt8.read(from),
382
+ scriptPubkey: FfiConverterArrayBuffer.read(from),
344
383
  value: FfiConverterUInt64.read(from),
345
384
  cetTxid: FfiConverterString.read(from),
346
- cetRaw: FfiConverterArrayUInt8.read(from)
385
+ cetRaw: FfiConverterArrayBuffer.read(from)
347
386
  };
348
387
  }
349
388
  write(value, into) {
350
- FfiConverterArrayUInt8.write(value.sighash, into);
351
- FfiConverterArrayUInt8.write(value.adaptorPoint, into);
389
+ FfiConverterArrayBuffer.write(value.sighash, into);
390
+ FfiConverterArrayBuffer.write(value.adaptorPoint, into);
352
391
  FfiConverterUInt32.write(value.inputIndex, into);
353
- FfiConverterArrayUInt8.write(value.scriptPubkey, into);
392
+ FfiConverterArrayBuffer.write(value.scriptPubkey, into);
354
393
  FfiConverterUInt64.write(value.value, into);
355
394
  FfiConverterString.write(value.cetTxid, into);
356
- FfiConverterArrayUInt8.write(value.cetRaw, into);
395
+ FfiConverterArrayBuffer.write(value.cetRaw, into);
357
396
  }
358
397
  allocationSize(value) {
359
- return FfiConverterArrayUInt8.allocationSize(value.sighash) + FfiConverterArrayUInt8.allocationSize(value.adaptorPoint) + FfiConverterUInt32.allocationSize(value.inputIndex) + FfiConverterArrayUInt8.allocationSize(value.scriptPubkey) + FfiConverterUInt64.allocationSize(value.value) + FfiConverterString.allocationSize(value.cetTxid) + FfiConverterArrayUInt8.allocationSize(value.cetRaw);
398
+ return FfiConverterArrayBuffer.allocationSize(value.sighash) + FfiConverterArrayBuffer.allocationSize(value.adaptorPoint) + FfiConverterUInt32.allocationSize(value.inputIndex) + FfiConverterArrayBuffer.allocationSize(value.scriptPubkey) + FfiConverterUInt64.allocationSize(value.value) + FfiConverterString.allocationSize(value.cetTxid) + FfiConverterArrayBuffer.allocationSize(value.cetRaw);
360
399
  }
361
400
  }
362
- ;
363
401
  return new FFIConverter();
364
402
  })();
365
403
  /**
366
- * Generated factory for {@link ChangeOutputAndFees} record objects.
404
+ * Generated factory for {@link TxOutput} record objects.
367
405
  */
368
- export const ChangeOutputAndFees = (() => {
406
+ export const TxOutput = (() => {
369
407
  const defaults = () => ({});
370
408
  const create = (() => {
371
409
  return uniffiCreateRecord(defaults);
372
410
  })();
373
411
  return Object.freeze({
374
- /**
375
- * Create a frozen instance of {@link ChangeOutputAndFees}, with defaults specified
376
- * in Rust, in the {@link ddk_ffi} crate.
377
- */
378
412
  create,
379
- /**
380
- * Create a frozen instance of {@link ChangeOutputAndFees}, with defaults specified
381
- * in Rust, in the {@link ddk_ffi} crate.
382
- */
383
413
  new: create,
384
- /**
385
- * Defaults specified in the {@link ddk_ffi} crate.
386
- */
387
- defaults: () => Object.freeze(defaults())
414
+ defaults: () => Object.freeze(defaults()),
415
+ isDust(self_) {
416
+ return FfiConverterBool.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
417
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_method_txoutput_is_dust(FfiConverterTypeTxOutput.lower(self_, nativeModule().rustbuffer_alloc), callStatus);
418
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
419
+ }
388
420
  });
389
421
  })();
390
- const FfiConverterTypeChangeOutputAndFees = (() => {
422
+ const FfiConverterTypeTxOutput = (() => {
391
423
  class FFIConverter extends AbstractFfiConverterByteArray {
392
424
  read(from) {
393
425
  return {
394
- changeOutput: FfiConverterTypeTxOutput.read(from),
395
- fundFee: FfiConverterUInt64.read(from),
396
- cetFee: FfiConverterUInt64.read(from)
426
+ value: FfiConverterUInt64.read(from),
427
+ scriptPubkey: FfiConverterArrayBuffer.read(from)
397
428
  };
398
429
  }
399
430
  write(value, into) {
400
- FfiConverterTypeTxOutput.write(value.changeOutput, into);
401
- FfiConverterUInt64.write(value.fundFee, into);
402
- FfiConverterUInt64.write(value.cetFee, into);
431
+ FfiConverterUInt64.write(value.value, into);
432
+ FfiConverterArrayBuffer.write(value.scriptPubkey, into);
403
433
  }
404
434
  allocationSize(value) {
405
- return FfiConverterTypeTxOutput.allocationSize(value.changeOutput) + FfiConverterUInt64.allocationSize(value.fundFee) + FfiConverterUInt64.allocationSize(value.cetFee);
435
+ return FfiConverterUInt64.allocationSize(value.value) + FfiConverterArrayBuffer.allocationSize(value.scriptPubkey);
406
436
  }
407
437
  }
408
- ;
409
438
  return new FFIConverter();
410
439
  })();
411
440
  /**
412
- * Generated factory for {@link DlcInputInfo} record objects.
441
+ * Generated factory for {@link ChangeOutputAndFees} record objects.
413
442
  */
414
- export const DlcInputInfo = (() => {
443
+ export const ChangeOutputAndFees = (() => {
415
444
  const defaults = () => ({});
416
445
  const create = (() => {
417
446
  return uniffiCreateRecord(defaults);
418
447
  })();
419
448
  return Object.freeze({
420
- /**
421
- * Create a frozen instance of {@link DlcInputInfo}, with defaults specified
422
- * in Rust, in the {@link ddk_ffi} crate.
423
- */
424
449
  create,
425
- /**
426
- * Create a frozen instance of {@link DlcInputInfo}, with defaults specified
427
- * in Rust, in the {@link ddk_ffi} crate.
428
- */
429
450
  new: create,
430
- /**
431
- * Defaults specified in the {@link ddk_ffi} crate.
432
- */
433
451
  defaults: () => Object.freeze(defaults())
434
452
  });
435
453
  })();
436
- const FfiConverterTypeDlcInputInfo = (() => {
454
+ const FfiConverterTypeChangeOutputAndFees = (() => {
437
455
  class FFIConverter extends AbstractFfiConverterByteArray {
438
456
  read(from) {
439
457
  return {
440
- fundTx: FfiConverterTypeTransaction.read(from),
441
- fundVout: FfiConverterUInt32.read(from),
442
- localFundPubkey: FfiConverterArrayUInt8.read(from),
443
- remoteFundPubkey: FfiConverterArrayUInt8.read(from),
444
- fundAmount: FfiConverterUInt64.read(from),
445
- maxWitnessLen: FfiConverterUInt32.read(from),
446
- inputSerialId: FfiConverterUInt64.read(from),
447
- contractId: FfiConverterArrayUInt8.read(from)
458
+ changeOutput: FfiConverterTypeTxOutput.read(from),
459
+ fundFee: FfiConverterUInt64.read(from),
460
+ cetFee: FfiConverterUInt64.read(from)
448
461
  };
449
462
  }
450
463
  write(value, into) {
451
- FfiConverterTypeTransaction.write(value.fundTx, into);
452
- FfiConverterUInt32.write(value.fundVout, into);
453
- FfiConverterArrayUInt8.write(value.localFundPubkey, into);
454
- FfiConverterArrayUInt8.write(value.remoteFundPubkey, into);
455
- FfiConverterUInt64.write(value.fundAmount, into);
456
- FfiConverterUInt32.write(value.maxWitnessLen, into);
457
- FfiConverterUInt64.write(value.inputSerialId, into);
458
- FfiConverterArrayUInt8.write(value.contractId, into);
464
+ FfiConverterTypeTxOutput.write(value.changeOutput, into);
465
+ FfiConverterUInt64.write(value.fundFee, into);
466
+ FfiConverterUInt64.write(value.cetFee, into);
459
467
  }
460
468
  allocationSize(value) {
461
- return FfiConverterTypeTransaction.allocationSize(value.fundTx) + FfiConverterUInt32.allocationSize(value.fundVout) + FfiConverterArrayUInt8.allocationSize(value.localFundPubkey) + FfiConverterArrayUInt8.allocationSize(value.remoteFundPubkey) + FfiConverterUInt64.allocationSize(value.fundAmount) + FfiConverterUInt32.allocationSize(value.maxWitnessLen) + FfiConverterUInt64.allocationSize(value.inputSerialId) + FfiConverterArrayUInt8.allocationSize(value.contractId);
469
+ return FfiConverterTypeTxOutput.allocationSize(value.changeOutput) + FfiConverterUInt64.allocationSize(value.fundFee) + FfiConverterUInt64.allocationSize(value.cetFee);
462
470
  }
463
471
  }
464
- ;
465
472
  return new FFIConverter();
466
473
  })();
467
474
  /**
468
- * Generated factory for {@link DlcTransactions} record objects.
475
+ * Generated factory for {@link TxInput} record objects.
469
476
  */
470
- export const DlcTransactions = (() => {
477
+ export const TxInput = (() => {
471
478
  const defaults = () => ({});
472
479
  const create = (() => {
473
480
  return uniffiCreateRecord(defaults);
474
481
  })();
475
482
  return Object.freeze({
476
- /**
477
- * Create a frozen instance of {@link DlcTransactions}, with defaults specified
478
- * in Rust, in the {@link ddk_ffi} crate.
479
- */
480
483
  create,
481
- /**
482
- * Create a frozen instance of {@link DlcTransactions}, with defaults specified
483
- * in Rust, in the {@link ddk_ffi} crate.
484
- */
485
484
  new: create,
486
- /**
487
- * Defaults specified in the {@link ddk_ffi} crate.
488
- */
489
485
  defaults: () => Object.freeze(defaults())
490
486
  });
491
487
  })();
492
- const FfiConverterTypeDlcTransactions = (() => {
488
+ const FfiConverterTypeTxInput = (() => {
493
489
  class FFIConverter extends AbstractFfiConverterByteArray {
494
490
  read(from) {
495
491
  return {
496
- fund: FfiConverterTypeTransaction.read(from),
497
- cets: FfiConverterArrayTypeTransaction.read(from),
498
- refund: FfiConverterTypeTransaction.read(from),
499
- fundingScriptPubkey: FfiConverterArrayUInt8.read(from)
492
+ txid: FfiConverterString.read(from),
493
+ vout: FfiConverterUInt32.read(from),
494
+ scriptSig: FfiConverterArrayBuffer.read(from),
495
+ sequence: FfiConverterUInt32.read(from),
496
+ witness: FfiConverterSequenceBytes.read(from)
500
497
  };
501
498
  }
502
499
  write(value, into) {
503
- FfiConverterTypeTransaction.write(value.fund, into);
504
- FfiConverterArrayTypeTransaction.write(value.cets, into);
505
- FfiConverterTypeTransaction.write(value.refund, into);
506
- FfiConverterArrayUInt8.write(value.fundingScriptPubkey, into);
500
+ FfiConverterString.write(value.txid, into);
501
+ FfiConverterUInt32.write(value.vout, into);
502
+ FfiConverterArrayBuffer.write(value.scriptSig, into);
503
+ FfiConverterUInt32.write(value.sequence, into);
504
+ FfiConverterSequenceBytes.write(value.witness, into);
507
505
  }
508
506
  allocationSize(value) {
509
- return FfiConverterTypeTransaction.allocationSize(value.fund) + FfiConverterArrayTypeTransaction.allocationSize(value.cets) + FfiConverterTypeTransaction.allocationSize(value.refund) + FfiConverterArrayUInt8.allocationSize(value.fundingScriptPubkey);
507
+ return FfiConverterString.allocationSize(value.txid) + FfiConverterUInt32.allocationSize(value.vout) + FfiConverterArrayBuffer.allocationSize(value.scriptSig) + FfiConverterUInt32.allocationSize(value.sequence) + FfiConverterSequenceBytes.allocationSize(value.witness);
510
508
  }
511
509
  }
512
- ;
513
510
  return new FFIConverter();
514
511
  })();
515
512
  /**
516
- * Generated factory for {@link OracleInfo} record objects.
513
+ * Generated factory for {@link Transaction} record objects.
517
514
  */
518
- export const OracleInfo = (() => {
515
+ export const Transaction = (() => {
519
516
  const defaults = () => ({});
520
517
  const create = (() => {
521
518
  return uniffiCreateRecord(defaults);
522
519
  })();
523
520
  return Object.freeze({
524
- /**
525
- * Create a frozen instance of {@link OracleInfo}, with defaults specified
526
- * in Rust, in the {@link ddk_ffi} crate.
527
- */
528
521
  create,
529
- /**
530
- * Create a frozen instance of {@link OracleInfo}, with defaults specified
531
- * in Rust, in the {@link ddk_ffi} crate.
532
- */
533
522
  new: create,
534
- /**
535
- * Defaults specified in the {@link ddk_ffi} crate.
536
- */
537
- defaults: () => Object.freeze(defaults())
523
+ defaults: () => Object.freeze(defaults()),
524
+ addSignature(self_, signature, pubkey, inputIndex) {
525
+ return (__rb => {
526
+ try {
527
+ return FfiConverterTypeTransaction.lift(__rb);
528
+ } finally {
529
+ nativeModule().rustbuffer_free(__rb);
530
+ }
531
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
532
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_method_transaction_add_signature(FfiConverterTypeTransaction.lower(self_, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(signature, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(pubkey, nativeModule().rustbuffer_alloc), FfiConverterUInt32.lower(inputIndex, nativeModule().rustbuffer_alloc), callStatus);
533
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
534
+ },
535
+ cetAdaptorSignatureFromOracleInfo(self_, oracleInfo, fundingSk, fundingScriptPubkey, totalCollateral, msgs) {
536
+ return (__rb => {
537
+ try {
538
+ return FfiConverterTypeAdaptorSignature.lift(__rb);
539
+ } finally {
540
+ nativeModule().rustbuffer_free(__rb);
541
+ }
542
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
543
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_method_transaction_cet_adaptor_signature_from_oracle_info(FfiConverterTypeTransaction.lower(self_, nativeModule().rustbuffer_alloc), FfiConverterTypeOracleInfo.lower(oracleInfo, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(fundingSk, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(fundingScriptPubkey, nativeModule().rustbuffer_alloc), FfiConverterUInt64.lower(totalCollateral, nativeModule().rustbuffer_alloc), FfiConverterSequenceBytes.lower(msgs, nativeModule().rustbuffer_alloc), callStatus);
544
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
545
+ },
546
+ cetAdaptorSignatureInputs(self_, oracleInfo, fundingScriptPubkey, fundOutputValue, msgs) {
547
+ return (__rb => {
548
+ try {
549
+ return FfiConverterTypeCetAdaptorSignatureDebugInfo.lift(__rb);
550
+ } finally {
551
+ nativeModule().rustbuffer_free(__rb);
552
+ }
553
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
554
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_method_transaction_cet_adaptor_signature_inputs(FfiConverterTypeTransaction.lower(self_, nativeModule().rustbuffer_alloc), FfiConverterSequenceTypeOracleInfo.lower(oracleInfo, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(fundingScriptPubkey, nativeModule().rustbuffer_alloc), FfiConverterUInt64.lower(fundOutputValue, nativeModule().rustbuffer_alloc), FfiConverterSequenceSequenceBytes.lower(msgs, nativeModule().rustbuffer_alloc), callStatus);
555
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
556
+ },
557
+ cetSighash(self_, fundingScriptPubkey, fundOutputValue) {
558
+ return (__rb => {
559
+ try {
560
+ return FfiConverterArrayBuffer.lift(__rb);
561
+ } finally {
562
+ nativeModule().rustbuffer_free(__rb);
563
+ }
564
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
565
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_method_transaction_cet_sighash(FfiConverterTypeTransaction.lower(self_, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(fundingScriptPubkey, nativeModule().rustbuffer_alloc), FfiConverterUInt64.lower(fundOutputValue, nativeModule().rustbuffer_alloc), callStatus);
566
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
567
+ },
568
+ rawFundingInputSignature(self_, privkey, prevTxId, prevTxVout, value) {
569
+ return (__rb => {
570
+ try {
571
+ return FfiConverterArrayBuffer.lift(__rb);
572
+ } finally {
573
+ nativeModule().rustbuffer_free(__rb);
574
+ }
575
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
576
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_method_transaction_raw_funding_input_signature(FfiConverterTypeTransaction.lower(self_, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(privkey, nativeModule().rustbuffer_alloc), FfiConverterString.lower(prevTxId, nativeModule().rustbuffer_alloc), FfiConverterUInt32.lower(prevTxVout, nativeModule().rustbuffer_alloc), FfiConverterUInt64.lower(value, nativeModule().rustbuffer_alloc), callStatus);
577
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
578
+ },
579
+ signCet(self_, adaptorSignature, oracleSignatures, fundingSecretKey, otherPubkey, fundingScriptPubkey, fundOutputValue) {
580
+ return (__rb => {
581
+ try {
582
+ return FfiConverterTypeTransaction.lift(__rb);
583
+ } finally {
584
+ nativeModule().rustbuffer_free(__rb);
585
+ }
586
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
587
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_method_transaction_sign_cet(FfiConverterTypeTransaction.lower(self_, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(adaptorSignature, nativeModule().rustbuffer_alloc), FfiConverterSequenceBytes.lower(oracleSignatures, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(fundingSecretKey, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(otherPubkey, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(fundingScriptPubkey, nativeModule().rustbuffer_alloc), FfiConverterUInt64.lower(fundOutputValue, nativeModule().rustbuffer_alloc), callStatus);
588
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
589
+ },
590
+ signFundInput(self_, privkey, prevTxId, prevTxVout, value) {
591
+ return (__rb => {
592
+ try {
593
+ return FfiConverterTypeTransaction.lift(__rb);
594
+ } finally {
595
+ nativeModule().rustbuffer_free(__rb);
596
+ }
597
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
598
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_method_transaction_sign_fund_input(FfiConverterTypeTransaction.lower(self_, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(privkey, nativeModule().rustbuffer_alloc), FfiConverterString.lower(prevTxId, nativeModule().rustbuffer_alloc), FfiConverterUInt32.lower(prevTxVout, nativeModule().rustbuffer_alloc), FfiConverterUInt64.lower(value, nativeModule().rustbuffer_alloc), callStatus);
599
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
600
+ },
601
+ signMultiSigInput(self_, dlcInput, localPrivkey, remoteSignature) {
602
+ return (__rb => {
603
+ try {
604
+ return FfiConverterTypeTransaction.lift(__rb);
605
+ } finally {
606
+ nativeModule().rustbuffer_free(__rb);
607
+ }
608
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
609
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_method_transaction_sign_multi_sig_input(FfiConverterTypeTransaction.lower(self_, nativeModule().rustbuffer_alloc), FfiConverterTypeDlcInputInfo.lower(dlcInput, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(localPrivkey, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(remoteSignature, nativeModule().rustbuffer_alloc), callStatus);
610
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
611
+ },
612
+ verifyFundSignature(self_, signature, pubkey, txid, vout, inputAmount) {
613
+ return FfiConverterBool.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
614
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_method_transaction_verify_fund_signature(FfiConverterTypeTransaction.lower(self_, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(signature, nativeModule().rustbuffer_alloc), FfiConverterArrayBuffer.lower(pubkey, nativeModule().rustbuffer_alloc), FfiConverterString.lower(txid, nativeModule().rustbuffer_alloc), FfiConverterUInt32.lower(vout, nativeModule().rustbuffer_alloc), FfiConverterUInt64.lower(inputAmount, nativeModule().rustbuffer_alloc), callStatus);
615
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
616
+ }
538
617
  });
539
618
  })();
540
- const FfiConverterTypeOracleInfo = (() => {
619
+ const FfiConverterTypeTransaction = (() => {
541
620
  class FFIConverter extends AbstractFfiConverterByteArray {
542
621
  read(from) {
543
622
  return {
544
- publicKey: FfiConverterArrayUInt8.read(from),
545
- nonces: FfiConverterArrayArrayUInt8.read(from)
623
+ version: FfiConverterInt32.read(from),
624
+ lockTime: FfiConverterUInt32.read(from),
625
+ inputs: FfiConverterSequenceTypeTxInput.read(from),
626
+ outputs: FfiConverterSequenceTypeTxOutput.read(from),
627
+ rawBytes: FfiConverterArrayBuffer.read(from)
546
628
  };
547
629
  }
548
630
  write(value, into) {
549
- FfiConverterArrayUInt8.write(value.publicKey, into);
550
- FfiConverterArrayArrayUInt8.write(value.nonces, into);
631
+ FfiConverterInt32.write(value.version, into);
632
+ FfiConverterUInt32.write(value.lockTime, into);
633
+ FfiConverterSequenceTypeTxInput.write(value.inputs, into);
634
+ FfiConverterSequenceTypeTxOutput.write(value.outputs, into);
635
+ FfiConverterArrayBuffer.write(value.rawBytes, into);
551
636
  }
552
637
  allocationSize(value) {
553
- return FfiConverterArrayUInt8.allocationSize(value.publicKey) + FfiConverterArrayArrayUInt8.allocationSize(value.nonces);
638
+ return FfiConverterInt32.allocationSize(value.version) + FfiConverterUInt32.allocationSize(value.lockTime) + FfiConverterSequenceTypeTxInput.allocationSize(value.inputs) + FfiConverterSequenceTypeTxOutput.allocationSize(value.outputs) + FfiConverterArrayBuffer.allocationSize(value.rawBytes);
554
639
  }
555
640
  }
556
- ;
557
641
  return new FFIConverter();
558
642
  })();
559
643
  /**
560
- * Generated factory for {@link PartyParams} record objects.
644
+ * Generated factory for {@link DlcInputInfo} record objects.
561
645
  */
562
- export const PartyParams = (() => {
646
+ export const DlcInputInfo = (() => {
563
647
  const defaults = () => ({});
564
648
  const create = (() => {
565
649
  return uniffiCreateRecord(defaults);
566
650
  })();
567
651
  return Object.freeze({
568
- /**
569
- * Create a frozen instance of {@link PartyParams}, with defaults specified
570
- * in Rust, in the {@link ddk_ffi} crate.
571
- */
572
652
  create,
573
- /**
574
- * Create a frozen instance of {@link PartyParams}, with defaults specified
575
- * in Rust, in the {@link ddk_ffi} crate.
576
- */
577
653
  new: create,
578
- /**
579
- * Defaults specified in the {@link ddk_ffi} crate.
580
- */
581
654
  defaults: () => Object.freeze(defaults())
582
655
  });
583
656
  })();
584
- const FfiConverterTypePartyParams = (() => {
657
+ const FfiConverterTypeDlcInputInfo = (() => {
585
658
  class FFIConverter extends AbstractFfiConverterByteArray {
586
659
  read(from) {
587
660
  return {
588
- fundPubkey: FfiConverterArrayUInt8.read(from),
589
- changeScriptPubkey: FfiConverterArrayUInt8.read(from),
590
- changeSerialId: FfiConverterUInt64.read(from),
591
- payoutScriptPubkey: FfiConverterArrayUInt8.read(from),
592
- payoutSerialId: FfiConverterUInt64.read(from),
593
- inputs: FfiConverterArrayTypeTxInputInfo.read(from),
594
- inputAmount: FfiConverterUInt64.read(from),
595
- collateral: FfiConverterUInt64.read(from),
596
- dlcInputs: FfiConverterArrayTypeDlcInputInfo.read(from)
661
+ fundTx: FfiConverterTypeTransaction.read(from),
662
+ fundVout: FfiConverterUInt32.read(from),
663
+ localFundPubkey: FfiConverterArrayBuffer.read(from),
664
+ remoteFundPubkey: FfiConverterArrayBuffer.read(from),
665
+ fundAmount: FfiConverterUInt64.read(from),
666
+ maxWitnessLen: FfiConverterUInt32.read(from),
667
+ inputSerialId: FfiConverterUInt64.read(from),
668
+ contractId: FfiConverterArrayBuffer.read(from)
597
669
  };
598
670
  }
599
671
  write(value, into) {
600
- FfiConverterArrayUInt8.write(value.fundPubkey, into);
601
- FfiConverterArrayUInt8.write(value.changeScriptPubkey, into);
602
- FfiConverterUInt64.write(value.changeSerialId, into);
603
- FfiConverterArrayUInt8.write(value.payoutScriptPubkey, into);
604
- FfiConverterUInt64.write(value.payoutSerialId, into);
605
- FfiConverterArrayTypeTxInputInfo.write(value.inputs, into);
606
- FfiConverterUInt64.write(value.inputAmount, into);
607
- FfiConverterUInt64.write(value.collateral, into);
608
- FfiConverterArrayTypeDlcInputInfo.write(value.dlcInputs, into);
672
+ FfiConverterTypeTransaction.write(value.fundTx, into);
673
+ FfiConverterUInt32.write(value.fundVout, into);
674
+ FfiConverterArrayBuffer.write(value.localFundPubkey, into);
675
+ FfiConverterArrayBuffer.write(value.remoteFundPubkey, into);
676
+ FfiConverterUInt64.write(value.fundAmount, into);
677
+ FfiConverterUInt32.write(value.maxWitnessLen, into);
678
+ FfiConverterUInt64.write(value.inputSerialId, into);
679
+ FfiConverterArrayBuffer.write(value.contractId, into);
609
680
  }
610
681
  allocationSize(value) {
611
- return FfiConverterArrayUInt8.allocationSize(value.fundPubkey) + FfiConverterArrayUInt8.allocationSize(value.changeScriptPubkey) + FfiConverterUInt64.allocationSize(value.changeSerialId) + FfiConverterArrayUInt8.allocationSize(value.payoutScriptPubkey) + FfiConverterUInt64.allocationSize(value.payoutSerialId) + FfiConverterArrayTypeTxInputInfo.allocationSize(value.inputs) + FfiConverterUInt64.allocationSize(value.inputAmount) + FfiConverterUInt64.allocationSize(value.collateral) + FfiConverterArrayTypeDlcInputInfo.allocationSize(value.dlcInputs);
682
+ return FfiConverterTypeTransaction.allocationSize(value.fundTx) + FfiConverterUInt32.allocationSize(value.fundVout) + FfiConverterArrayBuffer.allocationSize(value.localFundPubkey) + FfiConverterArrayBuffer.allocationSize(value.remoteFundPubkey) + FfiConverterUInt64.allocationSize(value.fundAmount) + FfiConverterUInt32.allocationSize(value.maxWitnessLen) + FfiConverterUInt64.allocationSize(value.inputSerialId) + FfiConverterArrayBuffer.allocationSize(value.contractId);
612
683
  }
613
684
  }
614
- ;
615
685
  return new FFIConverter();
616
686
  })();
617
687
  /**
618
- * Generated factory for {@link Payout} record objects.
688
+ * Generated factory for {@link DlcTransactions} record objects.
619
689
  */
620
- export const Payout = (() => {
690
+ export const DlcTransactions = (() => {
621
691
  const defaults = () => ({});
622
692
  const create = (() => {
623
693
  return uniffiCreateRecord(defaults);
624
694
  })();
625
695
  return Object.freeze({
626
- /**
627
- * Create a frozen instance of {@link Payout}, with defaults specified
628
- * in Rust, in the {@link ddk_ffi} crate.
629
- */
630
696
  create,
631
- /**
632
- * Create a frozen instance of {@link Payout}, with defaults specified
633
- * in Rust, in the {@link ddk_ffi} crate.
634
- */
635
697
  new: create,
636
- /**
637
- * Defaults specified in the {@link ddk_ffi} crate.
638
- */
639
698
  defaults: () => Object.freeze(defaults())
640
699
  });
641
700
  })();
642
- const FfiConverterTypePayout = (() => {
701
+ const FfiConverterTypeDlcTransactions = (() => {
643
702
  class FFIConverter extends AbstractFfiConverterByteArray {
644
703
  read(from) {
645
704
  return {
646
- offer: FfiConverterUInt64.read(from),
647
- accept: FfiConverterUInt64.read(from)
705
+ fund: FfiConverterTypeTransaction.read(from),
706
+ cets: FfiConverterSequenceTypeTransaction.read(from),
707
+ refund: FfiConverterTypeTransaction.read(from),
708
+ fundingScriptPubkey: FfiConverterArrayBuffer.read(from)
648
709
  };
649
710
  }
650
711
  write(value, into) {
651
- FfiConverterUInt64.write(value.offer, into);
652
- FfiConverterUInt64.write(value.accept, into);
712
+ FfiConverterTypeTransaction.write(value.fund, into);
713
+ FfiConverterSequenceTypeTransaction.write(value.cets, into);
714
+ FfiConverterTypeTransaction.write(value.refund, into);
715
+ FfiConverterArrayBuffer.write(value.fundingScriptPubkey, into);
653
716
  }
654
717
  allocationSize(value) {
655
- return FfiConverterUInt64.allocationSize(value.offer) + FfiConverterUInt64.allocationSize(value.accept);
718
+ return FfiConverterTypeTransaction.allocationSize(value.fund) + FfiConverterSequenceTypeTransaction.allocationSize(value.cets) + FfiConverterTypeTransaction.allocationSize(value.refund) + FfiConverterArrayBuffer.allocationSize(value.fundingScriptPubkey);
656
719
  }
657
720
  }
658
- ;
659
721
  return new FFIConverter();
660
722
  })();
661
723
  /**
662
- * Generated factory for {@link Transaction} record objects.
724
+ * Generated factory for {@link OracleInfo} record objects.
663
725
  */
664
- export const Transaction = (() => {
726
+ export const OracleInfo = (() => {
665
727
  const defaults = () => ({});
666
728
  const create = (() => {
667
729
  return uniffiCreateRecord(defaults);
668
730
  })();
669
731
  return Object.freeze({
670
- /**
671
- * Create a frozen instance of {@link Transaction}, with defaults specified
672
- * in Rust, in the {@link ddk_ffi} crate.
673
- */
674
732
  create,
675
- /**
676
- * Create a frozen instance of {@link Transaction}, with defaults specified
677
- * in Rust, in the {@link ddk_ffi} crate.
678
- */
679
733
  new: create,
680
- /**
681
- * Defaults specified in the {@link ddk_ffi} crate.
682
- */
683
734
  defaults: () => Object.freeze(defaults())
684
735
  });
685
736
  })();
686
- const FfiConverterTypeTransaction = (() => {
737
+ const FfiConverterTypeOracleInfo = (() => {
687
738
  class FFIConverter extends AbstractFfiConverterByteArray {
688
739
  read(from) {
689
740
  return {
690
- version: FfiConverterInt32.read(from),
691
- lockTime: FfiConverterUInt32.read(from),
692
- inputs: FfiConverterArrayTypeTxInput.read(from),
693
- outputs: FfiConverterArrayTypeTxOutput.read(from),
694
- rawBytes: FfiConverterArrayUInt8.read(from)
741
+ publicKey: FfiConverterArrayBuffer.read(from),
742
+ nonces: FfiConverterSequenceBytes.read(from)
695
743
  };
696
744
  }
697
745
  write(value, into) {
698
- FfiConverterInt32.write(value.version, into);
699
- FfiConverterUInt32.write(value.lockTime, into);
700
- FfiConverterArrayTypeTxInput.write(value.inputs, into);
701
- FfiConverterArrayTypeTxOutput.write(value.outputs, into);
702
- FfiConverterArrayUInt8.write(value.rawBytes, into);
746
+ FfiConverterArrayBuffer.write(value.publicKey, into);
747
+ FfiConverterSequenceBytes.write(value.nonces, into);
703
748
  }
704
749
  allocationSize(value) {
705
- return FfiConverterInt32.allocationSize(value.version) + FfiConverterUInt32.allocationSize(value.lockTime) + FfiConverterArrayTypeTxInput.allocationSize(value.inputs) + FfiConverterArrayTypeTxOutput.allocationSize(value.outputs) + FfiConverterArrayUInt8.allocationSize(value.rawBytes);
750
+ return FfiConverterArrayBuffer.allocationSize(value.publicKey) + FfiConverterSequenceBytes.allocationSize(value.nonces);
706
751
  }
707
752
  }
708
- ;
709
753
  return new FFIConverter();
710
754
  })();
711
755
  /**
712
- * Generated factory for {@link TxInput} record objects.
756
+ * Generated factory for {@link TxInputInfo} record objects.
713
757
  */
714
- export const TxInput = (() => {
758
+ export const TxInputInfo = (() => {
715
759
  const defaults = () => ({});
716
760
  const create = (() => {
717
761
  return uniffiCreateRecord(defaults);
718
762
  })();
719
763
  return Object.freeze({
720
- /**
721
- * Create a frozen instance of {@link TxInput}, with defaults specified
722
- * in Rust, in the {@link ddk_ffi} crate.
723
- */
724
764
  create,
725
- /**
726
- * Create a frozen instance of {@link TxInput}, with defaults specified
727
- * in Rust, in the {@link ddk_ffi} crate.
728
- */
729
765
  new: create,
730
- /**
731
- * Defaults specified in the {@link ddk_ffi} crate.
732
- */
733
766
  defaults: () => Object.freeze(defaults())
734
767
  });
735
768
  })();
736
- const FfiConverterTypeTxInput = (() => {
769
+ const FfiConverterTypeTxInputInfo = (() => {
737
770
  class FFIConverter extends AbstractFfiConverterByteArray {
738
771
  read(from) {
739
772
  return {
740
773
  txid: FfiConverterString.read(from),
741
774
  vout: FfiConverterUInt32.read(from),
742
- scriptSig: FfiConverterArrayUInt8.read(from),
743
- sequence: FfiConverterUInt32.read(from),
744
- witness: FfiConverterArrayArrayUInt8.read(from)
775
+ scriptSig: FfiConverterArrayBuffer.read(from),
776
+ maxWitnessLength: FfiConverterUInt32.read(from),
777
+ serialId: FfiConverterUInt64.read(from)
745
778
  };
746
779
  }
747
780
  write(value, into) {
748
781
  FfiConverterString.write(value.txid, into);
749
782
  FfiConverterUInt32.write(value.vout, into);
750
- FfiConverterArrayUInt8.write(value.scriptSig, into);
751
- FfiConverterUInt32.write(value.sequence, into);
752
- FfiConverterArrayArrayUInt8.write(value.witness, into);
783
+ FfiConverterArrayBuffer.write(value.scriptSig, into);
784
+ FfiConverterUInt32.write(value.maxWitnessLength, into);
785
+ FfiConverterUInt64.write(value.serialId, into);
753
786
  }
754
787
  allocationSize(value) {
755
- return FfiConverterString.allocationSize(value.txid) + FfiConverterUInt32.allocationSize(value.vout) + FfiConverterArrayUInt8.allocationSize(value.scriptSig) + FfiConverterUInt32.allocationSize(value.sequence) + FfiConverterArrayArrayUInt8.allocationSize(value.witness);
788
+ return FfiConverterString.allocationSize(value.txid) + FfiConverterUInt32.allocationSize(value.vout) + FfiConverterArrayBuffer.allocationSize(value.scriptSig) + FfiConverterUInt32.allocationSize(value.maxWitnessLength) + FfiConverterUInt64.allocationSize(value.serialId);
756
789
  }
757
790
  }
758
- ;
759
791
  return new FFIConverter();
760
792
  })();
761
793
  /**
762
- * Generated factory for {@link TxInputInfo} record objects.
794
+ * Generated factory for {@link PartyParams} record objects.
763
795
  */
764
- export const TxInputInfo = (() => {
796
+ export const PartyParams = (() => {
765
797
  const defaults = () => ({});
766
798
  const create = (() => {
767
799
  return uniffiCreateRecord(defaults);
768
800
  })();
769
801
  return Object.freeze({
770
- /**
771
- * Create a frozen instance of {@link TxInputInfo}, with defaults specified
772
- * in Rust, in the {@link ddk_ffi} crate.
773
- */
774
802
  create,
775
- /**
776
- * Create a frozen instance of {@link TxInputInfo}, with defaults specified
777
- * in Rust, in the {@link ddk_ffi} crate.
778
- */
779
803
  new: create,
780
- /**
781
- * Defaults specified in the {@link ddk_ffi} crate.
782
- */
783
- defaults: () => Object.freeze(defaults())
804
+ defaults: () => Object.freeze(defaults()),
805
+ changeOutputAndFees(self_, feeRate) {
806
+ return (__rb => {
807
+ try {
808
+ return FfiConverterTypeChangeOutputAndFees.lift(__rb);
809
+ } finally {
810
+ nativeModule().rustbuffer_free(__rb);
811
+ }
812
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
813
+ return nativeModule().ubrn_uniffi_ddk_ffi_fn_method_partyparams_change_output_and_fees(FfiConverterTypePartyParams.lower(self_, nativeModule().rustbuffer_alloc), FfiConverterUInt64.lower(feeRate, nativeModule().rustbuffer_alloc), callStatus);
814
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
815
+ }
784
816
  });
785
817
  })();
786
- const FfiConverterTypeTxInputInfo = (() => {
818
+ const FfiConverterTypePartyParams = (() => {
787
819
  class FFIConverter extends AbstractFfiConverterByteArray {
788
820
  read(from) {
789
821
  return {
790
- txid: FfiConverterString.read(from),
791
- vout: FfiConverterUInt32.read(from),
792
- scriptSig: FfiConverterArrayUInt8.read(from),
793
- maxWitnessLength: FfiConverterUInt32.read(from),
794
- serialId: FfiConverterUInt64.read(from)
822
+ fundPubkey: FfiConverterArrayBuffer.read(from),
823
+ changeScriptPubkey: FfiConverterArrayBuffer.read(from),
824
+ changeSerialId: FfiConverterUInt64.read(from),
825
+ payoutScriptPubkey: FfiConverterArrayBuffer.read(from),
826
+ payoutSerialId: FfiConverterUInt64.read(from),
827
+ inputs: FfiConverterSequenceTypeTxInputInfo.read(from),
828
+ inputAmount: FfiConverterUInt64.read(from),
829
+ collateral: FfiConverterUInt64.read(from),
830
+ dlcInputs: FfiConverterSequenceTypeDlcInputInfo.read(from)
795
831
  };
796
832
  }
797
833
  write(value, into) {
798
- FfiConverterString.write(value.txid, into);
799
- FfiConverterUInt32.write(value.vout, into);
800
- FfiConverterArrayUInt8.write(value.scriptSig, into);
801
- FfiConverterUInt32.write(value.maxWitnessLength, into);
802
- FfiConverterUInt64.write(value.serialId, into);
834
+ FfiConverterArrayBuffer.write(value.fundPubkey, into);
835
+ FfiConverterArrayBuffer.write(value.changeScriptPubkey, into);
836
+ FfiConverterUInt64.write(value.changeSerialId, into);
837
+ FfiConverterArrayBuffer.write(value.payoutScriptPubkey, into);
838
+ FfiConverterUInt64.write(value.payoutSerialId, into);
839
+ FfiConverterSequenceTypeTxInputInfo.write(value.inputs, into);
840
+ FfiConverterUInt64.write(value.inputAmount, into);
841
+ FfiConverterUInt64.write(value.collateral, into);
842
+ FfiConverterSequenceTypeDlcInputInfo.write(value.dlcInputs, into);
803
843
  }
804
844
  allocationSize(value) {
805
- return FfiConverterString.allocationSize(value.txid) + FfiConverterUInt32.allocationSize(value.vout) + FfiConverterArrayUInt8.allocationSize(value.scriptSig) + FfiConverterUInt32.allocationSize(value.maxWitnessLength) + FfiConverterUInt64.allocationSize(value.serialId);
845
+ return FfiConverterArrayBuffer.allocationSize(value.fundPubkey) + FfiConverterArrayBuffer.allocationSize(value.changeScriptPubkey) + FfiConverterUInt64.allocationSize(value.changeSerialId) + FfiConverterArrayBuffer.allocationSize(value.payoutScriptPubkey) + FfiConverterUInt64.allocationSize(value.payoutSerialId) + FfiConverterSequenceTypeTxInputInfo.allocationSize(value.inputs) + FfiConverterUInt64.allocationSize(value.inputAmount) + FfiConverterUInt64.allocationSize(value.collateral) + FfiConverterSequenceTypeDlcInputInfo.allocationSize(value.dlcInputs);
806
846
  }
807
847
  }
808
- ;
809
848
  return new FFIConverter();
810
849
  })();
811
850
  /**
812
- * Generated factory for {@link TxOutput} record objects.
851
+ * Generated factory for {@link Payout} record objects.
813
852
  */
814
- export const TxOutput = (() => {
853
+ export const Payout = (() => {
815
854
  const defaults = () => ({});
816
855
  const create = (() => {
817
856
  return uniffiCreateRecord(defaults);
818
857
  })();
819
858
  return Object.freeze({
820
- /**
821
- * Create a frozen instance of {@link TxOutput}, with defaults specified
822
- * in Rust, in the {@link ddk_ffi} crate.
823
- */
824
859
  create,
825
- /**
826
- * Create a frozen instance of {@link TxOutput}, with defaults specified
827
- * in Rust, in the {@link ddk_ffi} crate.
828
- */
829
860
  new: create,
830
- /**
831
- * Defaults specified in the {@link ddk_ffi} crate.
832
- */
833
861
  defaults: () => Object.freeze(defaults())
834
862
  });
835
863
  })();
836
- const FfiConverterTypeTxOutput = (() => {
864
+ const FfiConverterTypePayout = (() => {
837
865
  class FFIConverter extends AbstractFfiConverterByteArray {
838
866
  read(from) {
839
867
  return {
840
- value: FfiConverterUInt64.read(from),
841
- scriptPubkey: FfiConverterArrayUInt8.read(from)
868
+ offer: FfiConverterUInt64.read(from),
869
+ accept: FfiConverterUInt64.read(from)
842
870
  };
843
871
  }
844
872
  write(value, into) {
845
- FfiConverterUInt64.write(value.value, into);
846
- FfiConverterArrayUInt8.write(value.scriptPubkey, into);
873
+ FfiConverterUInt64.write(value.offer, into);
874
+ FfiConverterUInt64.write(value.accept, into);
847
875
  }
848
876
  allocationSize(value) {
849
- return FfiConverterUInt64.allocationSize(value.value) + FfiConverterArrayUInt8.allocationSize(value.scriptPubkey);
877
+ return FfiConverterUInt64.allocationSize(value.offer) + FfiConverterUInt64.allocationSize(value.accept);
878
+ }
879
+ }
880
+ return new FFIConverter();
881
+ })();
882
+ export let ExtendedKey = /*#__PURE__*/function (ExtendedKey) {
883
+ ExtendedKey[ExtendedKey["InvalidMnemonic"] = 0] = "InvalidMnemonic";
884
+ ExtendedKey[ExtendedKey["InvalidXpriv"] = 1] = "InvalidXpriv";
885
+ ExtendedKey[ExtendedKey["InvalidXpub"] = 2] = "InvalidXpub";
886
+ ExtendedKey[ExtendedKey["InvalidDerivationPath"] = 3] = "InvalidDerivationPath";
887
+ return ExtendedKey;
888
+ }({});
889
+ const FfiConverterTypeExtendedKey = (() => {
890
+ const ordinalConverter = FfiConverterInt32;
891
+ class FFIConverter extends AbstractFfiConverterByteArray {
892
+ read(from) {
893
+ switch (ordinalConverter.read(from)) {
894
+ case 1:
895
+ return ExtendedKey.InvalidMnemonic;
896
+ case 2:
897
+ return ExtendedKey.InvalidXpriv;
898
+ case 3:
899
+ return ExtendedKey.InvalidXpub;
900
+ case 4:
901
+ return ExtendedKey.InvalidDerivationPath;
902
+ default:
903
+ throw new UniffiInternalError.UnexpectedEnumCase();
904
+ }
905
+ }
906
+ write(value, into) {
907
+ switch (value) {
908
+ case ExtendedKey.InvalidMnemonic:
909
+ return ordinalConverter.write(1, into);
910
+ case ExtendedKey.InvalidXpriv:
911
+ return ordinalConverter.write(2, into);
912
+ case ExtendedKey.InvalidXpub:
913
+ return ordinalConverter.write(3, into);
914
+ case ExtendedKey.InvalidDerivationPath:
915
+ return ordinalConverter.write(4, into);
916
+ }
917
+ }
918
+ allocationSize(value) {
919
+ return ordinalConverter.allocationSize(0);
850
920
  }
851
921
  }
852
- ;
853
922
  return new FFIConverter();
854
923
  })();
855
- const stringConverter = {
856
- stringToBytes: s => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer(s, status)),
857
- bytesToString: ab => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string(ab, status)),
858
- stringByteLength: s => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length(s, status))
859
- };
860
- const FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
861
924
 
862
- // Flat error type: DlcError
925
+ // Error type: DlcError
863
926
  export let DlcError_Tags = /*#__PURE__*/function (DlcError_Tags) {
864
927
  DlcError_Tags["InvalidSignature"] = "InvalidSignature";
865
928
  DlcError_Tags["InvalidPublicKey"] = "InvalidPublicKey";
@@ -874,427 +937,428 @@ export let DlcError_Tags = /*#__PURE__*/function (DlcError_Tags) {
874
937
  return DlcError_Tags;
875
938
  }({});
876
939
  export const DlcError = (() => {
877
- class InvalidSignature extends UniffiError {
940
+ class InvalidSignature_ extends UniffiError {
878
941
  /**
879
942
  * @private
880
- * This field is private and should not be used.
943
+ * This field is private and should not be used, use `tag` instead.
881
944
  */
882
- [uniffiTypeNameSymbol] = "DlcError";
883
- /**
884
- * @private
885
- * This field is private and should not be used.
886
- */
887
- [variantOrdinalSymbol] = 1;
945
+ [uniffiTypeNameSymbol] = 'DlcError';
888
946
  tag = DlcError_Tags.InvalidSignature;
889
- constructor(message) {
890
- super("DlcError", "InvalidSignature", message);
947
+ constructor() {
948
+ super('DlcError', 'InvalidSignature');
949
+ }
950
+ static new() {
951
+ return new InvalidSignature_();
952
+ }
953
+ static instanceOf(obj) {
954
+ return obj.tag === DlcError_Tags.InvalidSignature;
891
955
  }
892
- static instanceOf(e) {
893
- return instanceOf(e) && e[variantOrdinalSymbol] === 1;
956
+ static hasInner(obj) {
957
+ return false;
894
958
  }
895
959
  }
896
- class InvalidPublicKey extends UniffiError {
960
+ class InvalidPublicKey_ extends UniffiError {
897
961
  /**
898
962
  * @private
899
- * This field is private and should not be used.
963
+ * This field is private and should not be used, use `tag` instead.
900
964
  */
901
- [uniffiTypeNameSymbol] = "DlcError";
902
- /**
903
- * @private
904
- * This field is private and should not be used.
905
- */
906
- [variantOrdinalSymbol] = 2;
965
+ [uniffiTypeNameSymbol] = 'DlcError';
907
966
  tag = DlcError_Tags.InvalidPublicKey;
908
- constructor(message) {
909
- super("DlcError", "InvalidPublicKey", message);
967
+ constructor() {
968
+ super('DlcError', 'InvalidPublicKey');
969
+ }
970
+ static new() {
971
+ return new InvalidPublicKey_();
910
972
  }
911
- static instanceOf(e) {
912
- return instanceOf(e) && e[variantOrdinalSymbol] === 2;
973
+ static instanceOf(obj) {
974
+ return obj.tag === DlcError_Tags.InvalidPublicKey;
975
+ }
976
+ static hasInner(obj) {
977
+ return false;
913
978
  }
914
979
  }
915
- class InvalidTransaction extends UniffiError {
916
- /**
917
- * @private
918
- * This field is private and should not be used.
919
- */
920
- [uniffiTypeNameSymbol] = "DlcError";
980
+ class InvalidTransaction_ extends UniffiError {
921
981
  /**
922
982
  * @private
923
- * This field is private and should not be used.
983
+ * This field is private and should not be used, use `tag` instead.
924
984
  */
925
- [variantOrdinalSymbol] = 3;
985
+ [uniffiTypeNameSymbol] = 'DlcError';
926
986
  tag = DlcError_Tags.InvalidTransaction;
927
- constructor(message) {
928
- super("DlcError", "InvalidTransaction", message);
987
+ constructor() {
988
+ super('DlcError', 'InvalidTransaction');
929
989
  }
930
- static instanceOf(e) {
931
- return instanceOf(e) && e[variantOrdinalSymbol] === 3;
990
+ static new() {
991
+ return new InvalidTransaction_();
992
+ }
993
+ static instanceOf(obj) {
994
+ return obj.tag === DlcError_Tags.InvalidTransaction;
995
+ }
996
+ static hasInner(obj) {
997
+ return false;
932
998
  }
933
999
  }
934
- class InsufficientFunds extends UniffiError {
1000
+ class InsufficientFunds_ extends UniffiError {
935
1001
  /**
936
1002
  * @private
937
- * This field is private and should not be used.
1003
+ * This field is private and should not be used, use `tag` instead.
938
1004
  */
939
- [uniffiTypeNameSymbol] = "DlcError";
940
- /**
941
- * @private
942
- * This field is private and should not be used.
943
- */
944
- [variantOrdinalSymbol] = 4;
1005
+ [uniffiTypeNameSymbol] = 'DlcError';
945
1006
  tag = DlcError_Tags.InsufficientFunds;
946
- constructor(message) {
947
- super("DlcError", "InsufficientFunds", message);
1007
+ constructor() {
1008
+ super('DlcError', 'InsufficientFunds');
1009
+ }
1010
+ static new() {
1011
+ return new InsufficientFunds_();
1012
+ }
1013
+ static instanceOf(obj) {
1014
+ return obj.tag === DlcError_Tags.InsufficientFunds;
948
1015
  }
949
- static instanceOf(e) {
950
- return instanceOf(e) && e[variantOrdinalSymbol] === 4;
1016
+ static hasInner(obj) {
1017
+ return false;
951
1018
  }
952
1019
  }
953
- class InvalidArgument extends UniffiError {
1020
+ class InvalidArgument_ extends UniffiError {
954
1021
  /**
955
1022
  * @private
956
- * This field is private and should not be used.
1023
+ * This field is private and should not be used, use `tag` instead.
957
1024
  */
958
- [uniffiTypeNameSymbol] = "DlcError";
959
- /**
960
- * @private
961
- * This field is private and should not be used.
962
- */
963
- [variantOrdinalSymbol] = 5;
1025
+ [uniffiTypeNameSymbol] = 'DlcError';
964
1026
  tag = DlcError_Tags.InvalidArgument;
965
- constructor(message) {
966
- super("DlcError", "InvalidArgument", message);
1027
+ constructor(inner) {
1028
+ super('DlcError', 'InvalidArgument');
1029
+ this.inner = Object.freeze(inner);
1030
+ }
1031
+ static new(inner) {
1032
+ return new InvalidArgument_(inner);
967
1033
  }
968
- static instanceOf(e) {
969
- return instanceOf(e) && e[variantOrdinalSymbol] === 5;
1034
+ static instanceOf(obj) {
1035
+ return obj.tag === DlcError_Tags.InvalidArgument;
1036
+ }
1037
+ static hasInner(obj) {
1038
+ return InvalidArgument_.instanceOf(obj);
1039
+ }
1040
+ static getInner(obj) {
1041
+ return obj.inner;
970
1042
  }
971
1043
  }
972
- class SerializationError extends UniffiError {
1044
+ class SerializationError_ extends UniffiError {
973
1045
  /**
974
1046
  * @private
975
- * This field is private and should not be used.
1047
+ * This field is private and should not be used, use `tag` instead.
976
1048
  */
977
- [uniffiTypeNameSymbol] = "DlcError";
978
- /**
979
- * @private
980
- * This field is private and should not be used.
981
- */
982
- [variantOrdinalSymbol] = 6;
1049
+ [uniffiTypeNameSymbol] = 'DlcError';
983
1050
  tag = DlcError_Tags.SerializationError;
984
- constructor(message) {
985
- super("DlcError", "SerializationError", message);
1051
+ constructor() {
1052
+ super('DlcError', 'SerializationError');
1053
+ }
1054
+ static new() {
1055
+ return new SerializationError_();
986
1056
  }
987
- static instanceOf(e) {
988
- return instanceOf(e) && e[variantOrdinalSymbol] === 6;
1057
+ static instanceOf(obj) {
1058
+ return obj.tag === DlcError_Tags.SerializationError;
1059
+ }
1060
+ static hasInner(obj) {
1061
+ return false;
989
1062
  }
990
1063
  }
991
- class Secp256k1Error extends UniffiError {
1064
+ class Secp256k1Error_ extends UniffiError {
992
1065
  /**
993
1066
  * @private
994
- * This field is private and should not be used.
1067
+ * This field is private and should not be used, use `tag` instead.
995
1068
  */
996
- [uniffiTypeNameSymbol] = "DlcError";
997
- /**
998
- * @private
999
- * This field is private and should not be used.
1000
- */
1001
- [variantOrdinalSymbol] = 7;
1069
+ [uniffiTypeNameSymbol] = 'DlcError';
1002
1070
  tag = DlcError_Tags.Secp256k1Error;
1003
- constructor(message) {
1004
- super("DlcError", "Secp256k1Error", message);
1071
+ constructor(inner) {
1072
+ super('DlcError', 'Secp256k1Error');
1073
+ this.inner = Object.freeze(inner);
1074
+ }
1075
+ static new(inner) {
1076
+ return new Secp256k1Error_(inner);
1005
1077
  }
1006
- static instanceOf(e) {
1007
- return instanceOf(e) && e[variantOrdinalSymbol] === 7;
1078
+ static instanceOf(obj) {
1079
+ return obj.tag === DlcError_Tags.Secp256k1Error;
1080
+ }
1081
+ static hasInner(obj) {
1082
+ return Secp256k1Error_.instanceOf(obj);
1083
+ }
1084
+ static getInner(obj) {
1085
+ return obj.inner;
1008
1086
  }
1009
1087
  }
1010
- class MiniscriptError extends UniffiError {
1011
- /**
1012
- * @private
1013
- * This field is private and should not be used.
1014
- */
1015
- [uniffiTypeNameSymbol] = "DlcError";
1088
+ class MiniscriptError_ extends UniffiError {
1016
1089
  /**
1017
1090
  * @private
1018
- * This field is private and should not be used.
1091
+ * This field is private and should not be used, use `tag` instead.
1019
1092
  */
1020
- [variantOrdinalSymbol] = 8;
1093
+ [uniffiTypeNameSymbol] = 'DlcError';
1021
1094
  tag = DlcError_Tags.MiniscriptError;
1022
- constructor(message) {
1023
- super("DlcError", "MiniscriptError", message);
1095
+ constructor() {
1096
+ super('DlcError', 'MiniscriptError');
1097
+ }
1098
+ static new() {
1099
+ return new MiniscriptError_();
1024
1100
  }
1025
- static instanceOf(e) {
1026
- return instanceOf(e) && e[variantOrdinalSymbol] === 8;
1101
+ static instanceOf(obj) {
1102
+ return obj.tag === DlcError_Tags.MiniscriptError;
1103
+ }
1104
+ static hasInner(obj) {
1105
+ return false;
1027
1106
  }
1028
1107
  }
1029
- class InvalidNetwork extends UniffiError {
1030
- /**
1031
- * @private
1032
- * This field is private and should not be used.
1033
- */
1034
- [uniffiTypeNameSymbol] = "DlcError";
1108
+ class InvalidNetwork_ extends UniffiError {
1035
1109
  /**
1036
1110
  * @private
1037
- * This field is private and should not be used.
1111
+ * This field is private and should not be used, use `tag` instead.
1038
1112
  */
1039
- [variantOrdinalSymbol] = 9;
1113
+ [uniffiTypeNameSymbol] = 'DlcError';
1040
1114
  tag = DlcError_Tags.InvalidNetwork;
1041
- constructor(message) {
1042
- super("DlcError", "InvalidNetwork", message);
1115
+ constructor() {
1116
+ super('DlcError', 'InvalidNetwork');
1117
+ }
1118
+ static new() {
1119
+ return new InvalidNetwork_();
1120
+ }
1121
+ static instanceOf(obj) {
1122
+ return obj.tag === DlcError_Tags.InvalidNetwork;
1043
1123
  }
1044
- static instanceOf(e) {
1045
- return instanceOf(e) && e[variantOrdinalSymbol] === 9;
1124
+ static hasInner(obj) {
1125
+ return false;
1046
1126
  }
1047
1127
  }
1048
- class KeyError extends UniffiError {
1128
+ class KeyError_ extends UniffiError {
1049
1129
  /**
1050
1130
  * @private
1051
- * This field is private and should not be used.
1131
+ * This field is private and should not be used, use `tag` instead.
1052
1132
  */
1053
- [uniffiTypeNameSymbol] = "DlcError";
1054
- /**
1055
- * @private
1056
- * This field is private and should not be used.
1057
- */
1058
- [variantOrdinalSymbol] = 10;
1133
+ [uniffiTypeNameSymbol] = 'DlcError';
1059
1134
  tag = DlcError_Tags.KeyError;
1060
- constructor(message) {
1061
- super("DlcError", "KeyError", message);
1135
+ constructor(inner) {
1136
+ super('DlcError', 'KeyError');
1137
+ this.inner = Object.freeze(inner);
1138
+ }
1139
+ static new(inner) {
1140
+ return new KeyError_(inner);
1062
1141
  }
1063
- static instanceOf(e) {
1064
- return instanceOf(e) && e[variantOrdinalSymbol] === 10;
1142
+ static instanceOf(obj) {
1143
+ return obj.tag === DlcError_Tags.KeyError;
1144
+ }
1145
+ static hasInner(obj) {
1146
+ return KeyError_.instanceOf(obj);
1147
+ }
1148
+ static getInner(obj) {
1149
+ return obj.inner;
1065
1150
  }
1066
1151
  }
1067
-
1068
- // Utility function which does not rely on instanceof.
1069
- function instanceOf(e) {
1070
- return e[uniffiTypeNameSymbol] === "DlcError";
1152
+ function instanceOf(obj) {
1153
+ return obj[uniffiTypeNameSymbol] === 'DlcError';
1071
1154
  }
1072
- return {
1073
- InvalidSignature,
1074
- InvalidPublicKey,
1075
- InvalidTransaction,
1076
- InsufficientFunds,
1077
- InvalidArgument,
1078
- SerializationError,
1079
- Secp256k1Error,
1080
- MiniscriptError,
1081
- InvalidNetwork,
1082
- KeyError,
1083
- instanceOf
1084
- };
1155
+ return Object.freeze({
1156
+ instanceOf,
1157
+ InvalidSignature: InvalidSignature_,
1158
+ InvalidPublicKey: InvalidPublicKey_,
1159
+ InvalidTransaction: InvalidTransaction_,
1160
+ InsufficientFunds: InsufficientFunds_,
1161
+ InvalidArgument: InvalidArgument_,
1162
+ SerializationError: SerializationError_,
1163
+ Secp256k1Error: Secp256k1Error_,
1164
+ MiniscriptError: MiniscriptError_,
1165
+ InvalidNetwork: InvalidNetwork_,
1166
+ KeyError: KeyError_
1167
+ });
1085
1168
  })();
1086
-
1087
- // Union type for DlcError error type.
1088
-
1169
+ // FfiConverter for enum DlcError
1089
1170
  const FfiConverterTypeDLCError = (() => {
1090
- const intConverter = FfiConverterInt32;
1091
- class FfiConverter extends AbstractFfiConverterByteArray {
1171
+ const ordinalConverter = FfiConverterInt32;
1172
+ class FFIConverter extends AbstractFfiConverterByteArray {
1092
1173
  read(from) {
1093
- switch (intConverter.read(from)) {
1174
+ switch (ordinalConverter.read(from)) {
1094
1175
  case 1:
1095
- return new DlcError.InvalidSignature(FfiConverterString.read(from));
1176
+ return new DlcError.InvalidSignature();
1096
1177
  case 2:
1097
- return new DlcError.InvalidPublicKey(FfiConverterString.read(from));
1178
+ return new DlcError.InvalidPublicKey();
1098
1179
  case 3:
1099
- return new DlcError.InvalidTransaction(FfiConverterString.read(from));
1180
+ return new DlcError.InvalidTransaction();
1100
1181
  case 4:
1101
- return new DlcError.InsufficientFunds(FfiConverterString.read(from));
1182
+ return new DlcError.InsufficientFunds();
1102
1183
  case 5:
1103
- return new DlcError.InvalidArgument(FfiConverterString.read(from));
1184
+ return new DlcError.InvalidArgument({
1185
+ message: FfiConverterString.read(from)
1186
+ });
1104
1187
  case 6:
1105
- return new DlcError.SerializationError(FfiConverterString.read(from));
1188
+ return new DlcError.SerializationError();
1106
1189
  case 7:
1107
- return new DlcError.Secp256k1Error(FfiConverterString.read(from));
1190
+ return new DlcError.Secp256k1Error({
1191
+ message: FfiConverterString.read(from)
1192
+ });
1108
1193
  case 8:
1109
- return new DlcError.MiniscriptError(FfiConverterString.read(from));
1194
+ return new DlcError.MiniscriptError();
1110
1195
  case 9:
1111
- return new DlcError.InvalidNetwork(FfiConverterString.read(from));
1196
+ return new DlcError.InvalidNetwork();
1112
1197
  case 10:
1113
- return new DlcError.KeyError(FfiConverterString.read(from));
1198
+ return new DlcError.KeyError({
1199
+ key: FfiConverterTypeExtendedKey.read(from)
1200
+ });
1114
1201
  default:
1115
1202
  throw new UniffiInternalError.UnexpectedEnumCase();
1116
1203
  }
1117
1204
  }
1118
1205
  write(value, into) {
1119
- const obj = value;
1120
- const index = obj[variantOrdinalSymbol];
1121
- intConverter.write(index, into);
1122
- }
1123
- allocationSize(value) {
1124
- return intConverter.allocationSize(0);
1125
- }
1126
- }
1127
- return new FfiConverter();
1128
- })();
1129
-
1130
- // Flat error type: ExtendedKey
1131
- export let ExtendedKey_Tags = /*#__PURE__*/function (ExtendedKey_Tags) {
1132
- ExtendedKey_Tags["InvalidMnemonic"] = "InvalidMnemonic";
1133
- ExtendedKey_Tags["InvalidXpriv"] = "InvalidXpriv";
1134
- ExtendedKey_Tags["InvalidXpub"] = "InvalidXpub";
1135
- ExtendedKey_Tags["InvalidDerivationPath"] = "InvalidDerivationPath";
1136
- return ExtendedKey_Tags;
1137
- }({});
1138
- export const ExtendedKey = (() => {
1139
- class InvalidMnemonic extends UniffiError {
1140
- /**
1141
- * @private
1142
- * This field is private and should not be used.
1143
- */
1144
- [uniffiTypeNameSymbol] = "ExtendedKey";
1145
- /**
1146
- * @private
1147
- * This field is private and should not be used.
1148
- */
1149
- [variantOrdinalSymbol] = 1;
1150
- tag = ExtendedKey_Tags.InvalidMnemonic;
1151
- constructor(message) {
1152
- super("ExtendedKey", "InvalidMnemonic", message);
1153
- }
1154
- static instanceOf(e) {
1155
- return instanceOf(e) && e[variantOrdinalSymbol] === 1;
1156
- }
1157
- }
1158
- class InvalidXpriv extends UniffiError {
1159
- /**
1160
- * @private
1161
- * This field is private and should not be used.
1162
- */
1163
- [uniffiTypeNameSymbol] = "ExtendedKey";
1164
- /**
1165
- * @private
1166
- * This field is private and should not be used.
1167
- */
1168
- [variantOrdinalSymbol] = 2;
1169
- tag = ExtendedKey_Tags.InvalidXpriv;
1170
- constructor(message) {
1171
- super("ExtendedKey", "InvalidXpriv", message);
1172
- }
1173
- static instanceOf(e) {
1174
- return instanceOf(e) && e[variantOrdinalSymbol] === 2;
1175
- }
1176
- }
1177
- class InvalidXpub extends UniffiError {
1178
- /**
1179
- * @private
1180
- * This field is private and should not be used.
1181
- */
1182
- [uniffiTypeNameSymbol] = "ExtendedKey";
1183
- /**
1184
- * @private
1185
- * This field is private and should not be used.
1186
- */
1187
- [variantOrdinalSymbol] = 3;
1188
- tag = ExtendedKey_Tags.InvalidXpub;
1189
- constructor(message) {
1190
- super("ExtendedKey", "InvalidXpub", message);
1191
- }
1192
- static instanceOf(e) {
1193
- return instanceOf(e) && e[variantOrdinalSymbol] === 3;
1194
- }
1195
- }
1196
- class InvalidDerivationPath extends UniffiError {
1197
- /**
1198
- * @private
1199
- * This field is private and should not be used.
1200
- */
1201
- [uniffiTypeNameSymbol] = "ExtendedKey";
1202
- /**
1203
- * @private
1204
- * This field is private and should not be used.
1205
- */
1206
- [variantOrdinalSymbol] = 4;
1207
- tag = ExtendedKey_Tags.InvalidDerivationPath;
1208
- constructor(message) {
1209
- super("ExtendedKey", "InvalidDerivationPath", message);
1210
- }
1211
- static instanceOf(e) {
1212
- return instanceOf(e) && e[variantOrdinalSymbol] === 4;
1213
- }
1214
- }
1215
-
1216
- // Utility function which does not rely on instanceof.
1217
- function instanceOf(e) {
1218
- return e[uniffiTypeNameSymbol] === "ExtendedKey";
1219
- }
1220
- return {
1221
- InvalidMnemonic,
1222
- InvalidXpriv,
1223
- InvalidXpub,
1224
- InvalidDerivationPath,
1225
- instanceOf
1226
- };
1227
- })();
1228
-
1229
- // Union type for ExtendedKey error type.
1230
-
1231
- const FfiConverterTypeExtendedKey = (() => {
1232
- const intConverter = FfiConverterInt32;
1233
- class FfiConverter extends AbstractFfiConverterByteArray {
1234
- read(from) {
1235
- switch (intConverter.read(from)) {
1236
- case 1:
1237
- return new ExtendedKey.InvalidMnemonic(FfiConverterString.read(from));
1238
- case 2:
1239
- return new ExtendedKey.InvalidXpriv(FfiConverterString.read(from));
1240
- case 3:
1241
- return new ExtendedKey.InvalidXpub(FfiConverterString.read(from));
1242
- case 4:
1243
- return new ExtendedKey.InvalidDerivationPath(FfiConverterString.read(from));
1206
+ switch (value.tag) {
1207
+ case DlcError_Tags.InvalidSignature:
1208
+ {
1209
+ ordinalConverter.write(1, into);
1210
+ return;
1211
+ }
1212
+ case DlcError_Tags.InvalidPublicKey:
1213
+ {
1214
+ ordinalConverter.write(2, into);
1215
+ return;
1216
+ }
1217
+ case DlcError_Tags.InvalidTransaction:
1218
+ {
1219
+ ordinalConverter.write(3, into);
1220
+ return;
1221
+ }
1222
+ case DlcError_Tags.InsufficientFunds:
1223
+ {
1224
+ ordinalConverter.write(4, into);
1225
+ return;
1226
+ }
1227
+ case DlcError_Tags.InvalidArgument:
1228
+ {
1229
+ ordinalConverter.write(5, into);
1230
+ const inner = value.inner;
1231
+ FfiConverterString.write(inner.message, into);
1232
+ return;
1233
+ }
1234
+ case DlcError_Tags.SerializationError:
1235
+ {
1236
+ ordinalConverter.write(6, into);
1237
+ return;
1238
+ }
1239
+ case DlcError_Tags.Secp256k1Error:
1240
+ {
1241
+ ordinalConverter.write(7, into);
1242
+ const inner = value.inner;
1243
+ FfiConverterString.write(inner.message, into);
1244
+ return;
1245
+ }
1246
+ case DlcError_Tags.MiniscriptError:
1247
+ {
1248
+ ordinalConverter.write(8, into);
1249
+ return;
1250
+ }
1251
+ case DlcError_Tags.InvalidNetwork:
1252
+ {
1253
+ ordinalConverter.write(9, into);
1254
+ return;
1255
+ }
1256
+ case DlcError_Tags.KeyError:
1257
+ {
1258
+ ordinalConverter.write(10, into);
1259
+ const inner = value.inner;
1260
+ FfiConverterTypeExtendedKey.write(inner.key, into);
1261
+ return;
1262
+ }
1244
1263
  default:
1264
+ // Throwing from here means that DlcError_Tags hasn't matched an ordinal.
1245
1265
  throw new UniffiInternalError.UnexpectedEnumCase();
1246
1266
  }
1247
1267
  }
1248
- write(value, into) {
1249
- const obj = value;
1250
- const index = obj[variantOrdinalSymbol];
1251
- intConverter.write(index, into);
1252
- }
1253
1268
  allocationSize(value) {
1254
- return intConverter.allocationSize(0);
1269
+ switch (value.tag) {
1270
+ case DlcError_Tags.InvalidSignature:
1271
+ {
1272
+ return ordinalConverter.allocationSize(1);
1273
+ }
1274
+ case DlcError_Tags.InvalidPublicKey:
1275
+ {
1276
+ return ordinalConverter.allocationSize(2);
1277
+ }
1278
+ case DlcError_Tags.InvalidTransaction:
1279
+ {
1280
+ return ordinalConverter.allocationSize(3);
1281
+ }
1282
+ case DlcError_Tags.InsufficientFunds:
1283
+ {
1284
+ return ordinalConverter.allocationSize(4);
1285
+ }
1286
+ case DlcError_Tags.InvalidArgument:
1287
+ {
1288
+ const inner = value.inner;
1289
+ let size = ordinalConverter.allocationSize(5);
1290
+ size += FfiConverterString.allocationSize(inner.message);
1291
+ return size;
1292
+ }
1293
+ case DlcError_Tags.SerializationError:
1294
+ {
1295
+ return ordinalConverter.allocationSize(6);
1296
+ }
1297
+ case DlcError_Tags.Secp256k1Error:
1298
+ {
1299
+ const inner = value.inner;
1300
+ let size = ordinalConverter.allocationSize(7);
1301
+ size += FfiConverterString.allocationSize(inner.message);
1302
+ return size;
1303
+ }
1304
+ case DlcError_Tags.MiniscriptError:
1305
+ {
1306
+ return ordinalConverter.allocationSize(8);
1307
+ }
1308
+ case DlcError_Tags.InvalidNetwork:
1309
+ {
1310
+ return ordinalConverter.allocationSize(9);
1311
+ }
1312
+ case DlcError_Tags.KeyError:
1313
+ {
1314
+ const inner = value.inner;
1315
+ let size = ordinalConverter.allocationSize(10);
1316
+ size += FfiConverterTypeExtendedKey.allocationSize(inner.key);
1317
+ return size;
1318
+ }
1319
+ default:
1320
+ throw new UniffiInternalError.UnexpectedEnumCase();
1321
+ }
1255
1322
  }
1256
1323
  }
1257
- return new FfiConverter();
1324
+ return new FFIConverter();
1258
1325
  })();
1259
1326
 
1260
- // FfiConverter for string | undefined
1261
- const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
1262
-
1263
- // FfiConverter for Array<AdaptorSignature>
1264
- const FfiConverterArrayTypeAdaptorSignature = new FfiConverterArray(FfiConverterTypeAdaptorSignature);
1265
-
1266
- // FfiConverter for Array<DlcInputInfo>
1267
- const FfiConverterArrayTypeDlcInputInfo = new FfiConverterArray(FfiConverterTypeDlcInputInfo);
1327
+ // FfiConverter for Array<ArrayBuffer>
1328
+ const FfiConverterSequenceBytes = new FfiConverterArray(FfiConverterArrayBuffer);
1268
1329
 
1269
- // FfiConverter for Array<OracleInfo>
1270
- const FfiConverterArrayTypeOracleInfo = new FfiConverterArray(FfiConverterTypeOracleInfo);
1330
+ // FfiConverter for Array<TxInput>
1331
+ const FfiConverterSequenceTypeTxInput = new FfiConverterArray(FfiConverterTypeTxInput);
1271
1332
 
1272
- // FfiConverter for Array<Payout>
1273
- const FfiConverterArrayTypePayout = new FfiConverterArray(FfiConverterTypePayout);
1333
+ // FfiConverter for Array<TxOutput>
1334
+ const FfiConverterSequenceTypeTxOutput = new FfiConverterArray(FfiConverterTypeTxOutput);
1274
1335
 
1275
1336
  // FfiConverter for Array<Transaction>
1276
- const FfiConverterArrayTypeTransaction = new FfiConverterArray(FfiConverterTypeTransaction);
1277
-
1278
- // FfiConverter for Array<TxInput>
1279
- const FfiConverterArrayTypeTxInput = new FfiConverterArray(FfiConverterTypeTxInput);
1337
+ const FfiConverterSequenceTypeTransaction = new FfiConverterArray(FfiConverterTypeTransaction);
1280
1338
 
1281
1339
  // FfiConverter for Array<TxInputInfo>
1282
- const FfiConverterArrayTypeTxInputInfo = new FfiConverterArray(FfiConverterTypeTxInputInfo);
1340
+ const FfiConverterSequenceTypeTxInputInfo = new FfiConverterArray(FfiConverterTypeTxInputInfo);
1283
1341
 
1284
- // FfiConverter for Array<TxOutput>
1285
- const FfiConverterArrayTypeTxOutput = new FfiConverterArray(FfiConverterTypeTxOutput);
1342
+ // FfiConverter for Array<DlcInputInfo>
1343
+ const FfiConverterSequenceTypeDlcInputInfo = new FfiConverterArray(FfiConverterTypeDlcInputInfo);
1344
+
1345
+ // FfiConverter for string | undefined
1346
+ const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
1347
+
1348
+ // FfiConverter for Array<OracleInfo>
1349
+ const FfiConverterSequenceTypeOracleInfo = new FfiConverterArray(FfiConverterTypeOracleInfo);
1286
1350
 
1287
- // FfiConverter for Array</*u8*/number>
1288
- const FfiConverterArrayUInt8 = new FfiConverterArray(FfiConverterUInt8);
1351
+ // FfiConverter for Array<Array<ArrayBuffer>>
1352
+ const FfiConverterSequenceSequenceBytes = new FfiConverterArray(FfiConverterSequenceBytes);
1289
1353
 
1290
- // FfiConverter for Array<Array</*u8*/number>>
1291
- const FfiConverterArrayArrayUInt8 = new FfiConverterArray(FfiConverterArrayUInt8);
1354
+ // FfiConverter for Array<Array<Array<ArrayBuffer>>>
1355
+ const FfiConverterSequenceSequenceSequenceBytes = new FfiConverterArray(FfiConverterSequenceSequenceBytes);
1292
1356
 
1293
- // FfiConverter for Array<Array<Array</*u8*/number>>>
1294
- const FfiConverterArrayArrayArrayUInt8 = new FfiConverterArray(FfiConverterArrayArrayUInt8);
1357
+ // FfiConverter for Array<AdaptorSignature>
1358
+ const FfiConverterSequenceTypeAdaptorSignature = new FfiConverterArray(FfiConverterTypeAdaptorSignature);
1295
1359
 
1296
- // FfiConverter for Array<Array<Array<Array</*u8*/number>>>>
1297
- const FfiConverterArrayArrayArrayArrayUInt8 = new FfiConverterArray(FfiConverterArrayArrayArrayUInt8);
1360
+ // FfiConverter for Array<Payout>
1361
+ const FfiConverterSequenceTypePayout = new FfiConverterArray(FfiConverterTypePayout);
1298
1362
 
1299
1363
  /**
1300
1364
  * This should be called before anything else.
@@ -1308,104 +1372,68 @@ const FfiConverterArrayArrayArrayArrayUInt8 = new FfiConverterArray(FfiConverter
1308
1372
  */
1309
1373
  function uniffiEnsureInitialized() {
1310
1374
  // Get the bindings contract version from our ComponentInterface
1311
- const bindingsContractVersion = 29;
1375
+ const bindingsContractVersion = 30;
1312
1376
  // Get the scaffolding contract version by calling the into the dylib
1313
1377
  const scaffoldingContractVersion = nativeModule().ubrn_ffi_ddk_ffi_uniffi_contract_version();
1314
1378
  if (bindingsContractVersion !== scaffoldingContractVersion) {
1315
1379
  throw new UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
1316
1380
  }
1317
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_add_signature_to_transaction() !== 1337) {
1318
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_add_signature_to_transaction");
1319
- }
1320
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed() !== 65049) {
1321
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed");
1322
- }
1323
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cet() !== 23081) {
1324
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_cet");
1325
- }
1326
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_points_from_oracle_info() !== 6552) {
1327
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_cet_adaptor_points_from_oracle_info");
1328
- }
1329
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_signature_from_oracle_info() !== 65174) {
1330
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_cet_adaptor_signature_from_oracle_info");
1331
- }
1332
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_oracle_info() !== 15699) {
1333
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_oracle_info");
1334
- }
1335
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_points() !== 33705) {
1336
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_points");
1337
- }
1338
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cets() !== 50529) {
1339
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_cets");
1340
- }
1341
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_dlc_transactions() !== 51134) {
1342
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_dlc_transactions");
1343
- }
1344
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_extkey_from_parent_path() !== 26671) {
1345
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_extkey_from_parent_path");
1346
- }
1347
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_extkey_from_seed() !== 12526) {
1348
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_extkey_from_seed");
1349
- }
1350
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_fund_tx_locking_script() !== 2761) {
1351
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_fund_tx_locking_script");
1352
- }
1353
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_refund_transaction() !== 57261) {
1354
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_refund_transaction");
1381
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed() !== 29793) {
1382
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed');
1355
1383
  }
1356
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions() !== 31130) {
1357
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions");
1384
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cet() !== 62951) {
1385
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_cet');
1358
1386
  }
1359
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path() !== 34808) {
1360
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path");
1387
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_points_from_oracle_info() !== 14977) {
1388
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_cet_adaptor_points_from_oracle_info');
1361
1389
  }
1362
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_extract_ecdsa_signature_from_oracle_signatures() !== 8006) {
1363
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_extract_ecdsa_signature_from_oracle_signatures");
1390
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_oracle_info() !== 5605) {
1391
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_oracle_info');
1364
1392
  }
1365
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_cet_adaptor_signature_inputs() !== 14595) {
1366
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_get_cet_adaptor_signature_inputs");
1393
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_points() !== 39452) {
1394
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_points');
1367
1395
  }
1368
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_cet_sighash() !== 10643) {
1369
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_get_cet_sighash");
1396
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cets() !== 22051) {
1397
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_cets');
1370
1398
  }
1371
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_change_output_and_fees() !== 44150) {
1372
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_get_change_output_and_fees");
1399
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_dlc_transactions() !== 60266) {
1400
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_dlc_transactions');
1373
1401
  }
1374
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_pubkey_from_extkey() !== 64637) {
1375
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_get_pubkey_from_extkey");
1402
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_extkey_from_parent_path() !== 23090) {
1403
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_extkey_from_parent_path');
1376
1404
  }
1377
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_raw_funding_transaction_input_signature() !== 35708) {
1378
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_get_raw_funding_transaction_input_signature");
1405
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_extkey_from_seed() !== 45469) {
1406
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_extkey_from_seed');
1379
1407
  }
1380
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_total_input_vsize() !== 38213) {
1381
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_get_total_input_vsize");
1408
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_fund_tx_locking_script() !== 37235) {
1409
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_fund_tx_locking_script');
1382
1410
  }
1383
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv() !== 44344) {
1384
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv");
1411
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_refund_transaction() !== 40230) {
1412
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_refund_transaction');
1385
1413
  }
1386
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_is_dust_output() !== 64174) {
1387
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_is_dust_output");
1414
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions() !== 55101) {
1415
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions');
1388
1416
  }
1389
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_sign_cet() !== 43957) {
1390
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_sign_cet");
1417
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path() !== 7895) {
1418
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path');
1391
1419
  }
1392
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_sign_fund_transaction_input() !== 50531) {
1393
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_sign_fund_transaction_input");
1420
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_extract_ecdsa_signature_from_oracle_signatures() !== 4868) {
1421
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_extract_ecdsa_signature_from_oracle_signatures');
1394
1422
  }
1395
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_sign_multi_sig_input() !== 14569) {
1396
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_sign_multi_sig_input");
1423
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_pubkey_from_extkey() !== 18050) {
1424
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_get_pubkey_from_extkey');
1397
1425
  }
1398
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_verify_cet_adaptor_sig_from_oracle_info() !== 52232) {
1399
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_verify_cet_adaptor_sig_from_oracle_info");
1426
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_total_input_vsize() !== 2998) {
1427
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_get_total_input_vsize');
1400
1428
  }
1401
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_verify_cet_adaptor_sigs_from_oracle_info() !== 14181) {
1402
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_verify_cet_adaptor_sigs_from_oracle_info");
1429
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv() !== 8843) {
1430
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv');
1403
1431
  }
1404
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_verify_fund_tx_signature() !== 27316) {
1405
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_verify_fund_tx_signature");
1432
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_verify_cet_adaptor_sigs_from_oracle_info() !== 32235) {
1433
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_verify_cet_adaptor_sigs_from_oracle_info');
1406
1434
  }
1407
- if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_version() !== 22317) {
1408
- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_version");
1435
+ if (nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_version() !== 2994) {
1436
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_version');
1409
1437
  }
1410
1438
  }
1411
1439
  export default Object.freeze({