@bennyblader/ddk-rn 0.3.43 → 1.0.0-rc1

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 +198 -49
  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 +3446 -2669
  12. package/cpp/ddk_ffi.hpp +139 -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 +2828 -942
  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 +2750 -874
  23. package/lib/module/ddk_ffi.js.map +1 -1
  24. package/lib/typescript/commonjs/src/ddk_ffi-ffi.d.ts +124 -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 +2545 -466
  27. package/lib/typescript/commonjs/src/ddk_ffi.d.ts.map +1 -1
  28. package/lib/typescript/module/src/ddk_ffi-ffi.d.ts +124 -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 +2545 -466
  31. package/lib/typescript/module/src/ddk_ffi.d.ts.map +1 -1
  32. package/package.json +24 -45
  33. package/src/ddk_ffi-ffi.ts +609 -170
  34. package/src/ddk_ffi.ts +5643 -1910
  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
@@ -3,900 +3,2538 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.TxOutput = exports.TxInputInfo = exports.TxInput = exports.Transaction = exports.Payout = exports.PartyParams = exports.OracleInfo = exports.ExtendedKey_Tags = exports.ExtendedKey = exports.DlcTransactions = exports.DlcInputInfo = exports.DlcError_Tags = exports.DlcError = exports.ChangeOutputAndFees = exports.CetAdaptorSignatureDebugInfo = exports.AdaptorSignature = void 0;
7
- exports.addSignatureToTransaction = addSignatureToTransaction;
6
+ exports.TxOutput = exports.TxInputInfo = exports.TxInput = exports.Transaction = exports.SpliceKeyRef = exports.SignResult = exports.PayoutRow = exports.Payout = exports.PartyParams = exports.Party = exports.OracleInfo = exports.OracleAttestationRef = exports.ExtendedKey = exports.DlcTransactions = exports.DlcInputInfo = exports.DlcError_Tags = exports.DlcError = exports.DescriptorInput = exports.CreateOfferParams = exports.ContractPayouts = exports.ContractPartyParams = exports.ContractKeyProvider = exports.ContractError_Tags = exports.ContractError = exports.ChangeOutputAndFees = exports.CetAdaptorSignatureDebugInfo = exports.AdaptorSignature = exports.AcceptResult = exports.AcceptOfferParams = void 0;
7
+ exports.acceptOffer = acceptOffer;
8
+ exports.chainHashFromNetwork = chainHashFromNetwork;
9
+ exports.computeContractId = computeContractId;
10
+ exports.contractInfoPayouts = contractInfoPayouts;
8
11
  exports.convertMnemonicToSeed = convertMnemonicToSeed;
9
12
  exports.createCet = createCet;
10
13
  exports.createCetAdaptorPointsFromOracleInfo = createCetAdaptorPointsFromOracleInfo;
11
- exports.createCetAdaptorSignatureFromOracleInfo = createCetAdaptorSignatureFromOracleInfo;
12
14
  exports.createCetAdaptorSigsFromOracleInfo = createCetAdaptorSigsFromOracleInfo;
13
15
  exports.createCetAdaptorSigsFromPoints = createCetAdaptorSigsFromPoints;
14
16
  exports.createCets = createCets;
17
+ exports.createDlcSpliceInput = createDlcSpliceInput;
15
18
  exports.createDlcTransactions = createDlcTransactions;
16
19
  exports.createExtkeyFromParentPath = createExtkeyFromParentPath;
17
20
  exports.createExtkeyFromSeed = createExtkeyFromSeed;
18
21
  exports.createFundTxLockingScript = createFundTxLockingScript;
22
+ exports.createFundingPsbt = createFundingPsbt;
23
+ exports.createOffer = createOffer;
19
24
  exports.createRefundTransaction = createRefundTransaction;
20
25
  exports.createSplicedDlcTransactions = createSplicedDlcTransactions;
21
26
  exports.createXprivFromParentPath = createXprivFromParentPath;
22
27
  exports.default = void 0;
28
+ exports.dlcInputMaxWitnessLen = dlcInputMaxWitnessLen;
29
+ exports.dlcTransactionsFromMessages = dlcTransactionsFromMessages;
23
30
  exports.extractEcdsaSignatureFromOracleSignatures = extractEcdsaSignatureFromOracleSignatures;
24
- exports.getCetAdaptorSignatureInputs = getCetAdaptorSignatureInputs;
25
- exports.getCetSighash = getCetSighash;
26
- exports.getChangeOutputAndFees = getChangeOutputAndFees;
31
+ exports.finalizeSign = finalizeSign;
32
+ exports.finalizeSignSpliced = finalizeSignSpliced;
33
+ exports.fundingInput = fundingInput;
27
34
  exports.getPubkeyFromExtkey = getPubkeyFromExtkey;
28
- exports.getRawFundingTransactionInputSignature = getRawFundingTransactionInputSignature;
29
35
  exports.getTotalInputVsize = getTotalInputVsize;
30
36
  exports.getXpubFromXpriv = getXpubFromXpriv;
31
- exports.isDustOutput = isDustOutput;
32
- exports.signCet = signCet;
33
- exports.signFundTransactionInput = signFundTransactionInput;
34
- exports.signMultiSigInput = signMultiSigInput;
35
- exports.verifyCetAdaptorSigFromOracleInfo = verifyCetAdaptorSigFromOracleInfo;
37
+ exports.signAccept = signAccept;
38
+ exports.signAcceptSpliced = signAcceptSpliced;
39
+ exports.signContractCet = signContractCet;
40
+ exports.signContractRefund = signContractRefund;
41
+ exports.signFundingPsbtWithDescriptor = signFundingPsbtWithDescriptor;
42
+ exports.validateAccept = validateAccept;
43
+ exports.validateOffer = validateOffer;
44
+ exports.validateSign = validateSign;
36
45
  exports.verifyCetAdaptorSigsFromOracleInfo = verifyCetAdaptorSigsFromOracleInfo;
37
- exports.verifyFundTxSignature = verifyFundTxSignature;
38
46
  exports.version = version;
39
47
  var _ddk_ffiFfi = _interopRequireDefault(require("./ddk_ffi-ffi.js"));
40
- var _uniffiBindgenReactNative = require("uniffi-bindgen-react-native");
48
+ var _core = require("@ubjs/core");
41
49
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
42
50
  // This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate.
43
51
  // Trust me, you don't want to mess with it!
52
+ /* tslint:disable */
53
+ /* eslint-disable */
54
+ // @ts-nocheck
44
55
 
45
- // Get converters from the other files, if any.
46
- const uniffiCaller = new _uniffiBindgenReactNative.UniffiRustCaller(() => ({
56
+ const uniffiCaller = new _core.UniffiRustCaller(() => ({
47
57
  code: 0
48
58
  }));
49
59
  const uniffiIsDebug =
50
60
  // @ts-ignore -- The process global might not be defined
51
- typeof process !== "object" ||
61
+ typeof process !== 'object' ||
52
62
  // @ts-ignore -- The process global might not be defined
53
- process?.env?.NODE_ENV !== "production" || true;
63
+ process?.env?.NODE_ENV !== 'production' || false;
64
+
54
65
  // Public interface members begin here.
55
66
 
56
- function addSignatureToTransaction(tx, signature, pubkey, inputIndex) /*throws*/{
57
- return FfiConverterTypeTransaction.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
58
- return (() => {
59
- console.debug(`-- uniffi_ddk_ffi_fn_func_add_signature_to_transaction`);
60
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_add_signature_to_transaction;
61
- })()(FfiConverterTypeTransaction.lower(tx), FfiConverterArrayUInt8.lower(signature), FfiConverterArrayUInt8.lower(pubkey), _uniffiBindgenReactNative.FfiConverterUInt32.lower(inputIndex), callStatus);
62
- }, /*liftString:*/FfiConverterString.lift));
67
+ /**
68
+ * Accepts an offer. The accepting party's funding secret key is derived inside
69
+ * Rust from `keys` + `new_temporary_contract_id` and never crosses the boundary;
70
+ * it must match `params.party.funding_pubkey` (derive both from the same provider).
71
+ */
72
+ function acceptOffer(offer, params, keys, newTemporaryContractId) /*throws*/{
73
+ return (__rb => {
74
+ try {
75
+ return FfiConverterTypeAcceptResult.lift(__rb);
76
+ } finally {
77
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
78
+ }
79
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
80
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_accept_offer(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterTypeAcceptOfferParams.lower(params, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterTypeContractKeyProvider.lower(keys, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(newTemporaryContractId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
81
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
82
+ }
83
+
84
+ /**
85
+ * The 32-byte chain hash for a network (`bitcoin` / `testnet` / `signet` /
86
+ * `regtest`). Use it for [`CreateOfferParams::chain_hash`].
87
+ */
88
+ function chainHashFromNetwork(network) /*throws*/{
89
+ return (__rb => {
90
+ try {
91
+ return _core.FfiConverterArrayBuffer.lift(__rb);
92
+ } finally {
93
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
94
+ }
95
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
96
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_chain_hash_from_network(FfiConverterString.lower(network, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
97
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
98
+ }
99
+
100
+ /**
101
+ * The 32-byte contract id derived from the offer and accept messages — the
102
+ * stable id of the funded contract. Use it to key stored contracts.
103
+ */
104
+ function computeContractId(offer, accept) /*throws*/{
105
+ return (__rb => {
106
+ try {
107
+ return _core.FfiConverterArrayBuffer.lift(__rb);
108
+ } finally {
109
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
110
+ }
111
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
112
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_compute_contract_id(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(accept, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
113
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
114
+ }
115
+
116
+ /**
117
+ * Derives the offer/accept payouts for every outcome of a contract from its
118
+ * wire-encoded `ContractInfo`, for building a payout table to show users.
119
+ *
120
+ * Handles both enum contracts (each row a labeled outcome) and numeric-outcome
121
+ * contracts (each row an inclusive outcome range that shares a single payout,
122
+ * as determined by the payout function and rounding intervals). Disjoint
123
+ * contracts contribute the rows of each of their sub-contracts.
124
+ */
125
+ function contractInfoPayouts(contractInfo) /*throws*/{
126
+ return (__rb => {
127
+ try {
128
+ return FfiConverterTypeContractPayouts.lift(__rb);
129
+ } finally {
130
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
131
+ }
132
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
133
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_contract_info_payouts(_core.FfiConverterArrayBuffer.lower(contractInfo, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
134
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
63
135
  }
64
136
  function convertMnemonicToSeed(mnemonic, passphrase) /*throws*/{
65
- return FfiConverterArrayUInt8.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
66
- return (() => {
67
- console.debug(`-- uniffi_ddk_ffi_fn_func_convert_mnemonic_to_seed`);
68
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_convert_mnemonic_to_seed;
69
- })()(FfiConverterString.lower(mnemonic), FfiConverterOptionalString.lower(passphrase), callStatus);
70
- }, /*liftString:*/FfiConverterString.lift));
137
+ return (__rb => {
138
+ try {
139
+ return _core.FfiConverterArrayBuffer.lift(__rb);
140
+ } finally {
141
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
142
+ }
143
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
144
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_convert_mnemonic_to_seed(FfiConverterString.lower(mnemonic, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterOptionalString.lower(passphrase, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
145
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
71
146
  }
147
+
148
+ /**
149
+ * Create a single CET
150
+ */
72
151
  function createCet(localOutput, localPayoutSerialId, remoteOutput, remotePayoutSerialId, fundTxId, fundVout, lockTime) /*throws*/{
73
- return FfiConverterTypeTransaction.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
74
- return (() => {
75
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_cet`);
76
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_cet;
77
- })()(FfiConverterTypeTxOutput.lower(localOutput), _uniffiBindgenReactNative.FfiConverterUInt64.lower(localPayoutSerialId), FfiConverterTypeTxOutput.lower(remoteOutput), _uniffiBindgenReactNative.FfiConverterUInt64.lower(remotePayoutSerialId), FfiConverterString.lower(fundTxId), _uniffiBindgenReactNative.FfiConverterUInt32.lower(fundVout), _uniffiBindgenReactNative.FfiConverterUInt32.lower(lockTime), callStatus);
78
- }, /*liftString:*/FfiConverterString.lift));
152
+ return (__rb => {
153
+ try {
154
+ return FfiConverterTypeTransaction.lift(__rb);
155
+ } finally {
156
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
157
+ }
158
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
159
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_cet(FfiConverterTypeTxOutput.lower(localOutput, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt64.lower(localPayoutSerialId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterTypeTxOutput.lower(remoteOutput, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt64.lower(remotePayoutSerialId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterString.lower(fundTxId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt32.lower(fundVout, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt32.lower(lockTime, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
160
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
79
161
  }
80
162
  function createCetAdaptorPointsFromOracleInfo(oracleInfo, msgs) /*throws*/{
81
- return FfiConverterArrayArrayUInt8.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
82
- return (() => {
83
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_cet_adaptor_points_from_oracle_info`);
84
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_points_from_oracle_info;
85
- })()(FfiConverterArrayTypeOracleInfo.lower(oracleInfo), FfiConverterArrayArrayArrayArrayUInt8.lower(msgs), callStatus);
86
- }, /*liftString:*/FfiConverterString.lift));
87
- }
88
- function createCetAdaptorSignatureFromOracleInfo(cet, oracleInfo, fundingSk, fundingScriptPubkey, totalCollateral, msgs) /*throws*/{
89
- return FfiConverterTypeAdaptorSignature.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
90
- return (() => {
91
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_cet_adaptor_signature_from_oracle_info`);
92
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_signature_from_oracle_info;
93
- })()(FfiConverterTypeTransaction.lower(cet), FfiConverterTypeOracleInfo.lower(oracleInfo), FfiConverterArrayUInt8.lower(fundingSk), FfiConverterArrayUInt8.lower(fundingScriptPubkey), _uniffiBindgenReactNative.FfiConverterUInt64.lower(totalCollateral), FfiConverterArrayArrayUInt8.lower(msgs), callStatus);
94
- }, /*liftString:*/FfiConverterString.lift));
163
+ return (__rb => {
164
+ try {
165
+ return FfiConverterSequenceBytes.lift(__rb);
166
+ } finally {
167
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
168
+ }
169
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
170
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_points_from_oracle_info(FfiConverterSequenceTypeOracleInfo.lower(oracleInfo, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceSequenceSequenceBytes.lower(msgs, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
171
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
95
172
  }
96
173
  function createCetAdaptorSigsFromOracleInfo(cets, oracleInfo, fundingSecretKey, fundingScriptPubkey, fundOutputValue, msgs) /*throws*/{
97
- return FfiConverterArrayTypeAdaptorSignature.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
98
- return (() => {
99
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_cet_adaptor_sigs_from_oracle_info`);
100
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_sigs_from_oracle_info;
101
- })()(FfiConverterArrayTypeTransaction.lower(cets), FfiConverterArrayTypeOracleInfo.lower(oracleInfo), FfiConverterArrayUInt8.lower(fundingSecretKey), FfiConverterArrayUInt8.lower(fundingScriptPubkey), _uniffiBindgenReactNative.FfiConverterUInt64.lower(fundOutputValue), FfiConverterArrayArrayArrayArrayUInt8.lower(msgs), callStatus);
102
- }, /*liftString:*/FfiConverterString.lift));
174
+ return (__rb => {
175
+ try {
176
+ return FfiConverterSequenceTypeAdaptorSignature.lift(__rb);
177
+ } finally {
178
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
179
+ }
180
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
181
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_sigs_from_oracle_info(FfiConverterSequenceTypeTransaction.lower(cets, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceTypeOracleInfo.lower(oracleInfo, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(fundingSecretKey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(fundingScriptPubkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt64.lower(fundOutputValue, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceSequenceSequenceBytes.lower(msgs, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
182
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
103
183
  }
184
+
185
+ /**
186
+ * Create adaptor signatures from pre-computed adaptor points.
187
+ */
104
188
  function createCetAdaptorSigsFromPoints(cets, adaptorPoints, fundingSecretKey, fundingScriptPubkey, fundOutputValue) /*throws*/{
105
- return FfiConverterArrayTypeAdaptorSignature.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
106
- return (() => {
107
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_cet_adaptor_sigs_from_points`);
108
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_sigs_from_points;
109
- })()(FfiConverterArrayTypeTransaction.lower(cets), FfiConverterArrayArrayUInt8.lower(adaptorPoints), FfiConverterArrayUInt8.lower(fundingSecretKey), FfiConverterArrayUInt8.lower(fundingScriptPubkey), _uniffiBindgenReactNative.FfiConverterUInt64.lower(fundOutputValue), callStatus);
110
- }, /*liftString:*/FfiConverterString.lift));
189
+ return (__rb => {
190
+ try {
191
+ return FfiConverterSequenceTypeAdaptorSignature.lift(__rb);
192
+ } finally {
193
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
194
+ }
195
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
196
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_cet_adaptor_sigs_from_points(FfiConverterSequenceTypeTransaction.lower(cets, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceBytes.lower(adaptorPoints, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(fundingSecretKey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(fundingScriptPubkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt64.lower(fundOutputValue, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
197
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
111
198
  }
199
+
200
+ /**
201
+ * Create multiple CETs
202
+ */
112
203
  function createCets(fundTxId, fundVout, localFinalScriptPubkey, remoteFinalScriptPubkey, outcomes, lockTime, localSerialId, remoteSerialId) /*throws*/{
113
- return FfiConverterArrayTypeTransaction.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
114
- return (() => {
115
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_cets`);
116
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_cets;
117
- })()(FfiConverterString.lower(fundTxId), _uniffiBindgenReactNative.FfiConverterUInt32.lower(fundVout), FfiConverterArrayUInt8.lower(localFinalScriptPubkey), FfiConverterArrayUInt8.lower(remoteFinalScriptPubkey), FfiConverterArrayTypePayout.lower(outcomes), _uniffiBindgenReactNative.FfiConverterUInt32.lower(lockTime), _uniffiBindgenReactNative.FfiConverterUInt64.lower(localSerialId), _uniffiBindgenReactNative.FfiConverterUInt64.lower(remoteSerialId), callStatus);
118
- }, /*liftString:*/FfiConverterString.lift));
204
+ return (__rb => {
205
+ try {
206
+ return FfiConverterSequenceTypeTransaction.lift(__rb);
207
+ } finally {
208
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
209
+ }
210
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
211
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_cets(FfiConverterString.lower(fundTxId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt32.lower(fundVout, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(localFinalScriptPubkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(remoteFinalScriptPubkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceTypePayout.lower(outcomes, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt32.lower(lockTime, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt64.lower(localSerialId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt64.lower(remoteSerialId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
212
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
213
+ }
214
+
215
+ /**
216
+ * Rebuilds the splice `FundingInput` (wire-encoded) that spends a previous
217
+ * contract's 2-of-2 funding output, from that contract's offer and accept
218
+ * messages. Only the offering party contributes a splice input; place the
219
+ * result in the offering party's `funding_inputs`. `max_witness_len` must be
220
+ * greater than 108 — use [`dlc_input_max_witness_len`].
221
+ */
222
+ function createDlcSpliceInput(prevOffer, prevAccept, localParty, inputSerialId, maxWitnessLen) /*throws*/{
223
+ return (__rb => {
224
+ try {
225
+ return _core.FfiConverterArrayBuffer.lift(__rb);
226
+ } finally {
227
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
228
+ }
229
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
230
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_dlc_splice_input(_core.FfiConverterArrayBuffer.lower(prevOffer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(prevAccept, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterTypeParty.lower(localParty, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterOptionalUInt64.lower(inputSerialId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt16.lower(maxWitnessLen, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
231
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
119
232
  }
233
+
234
+ /**
235
+ * Create complete DLC transactions
236
+ */
120
237
  function createDlcTransactions(outcomes, localParams, remoteParams, refundLocktime, feeRate, fundLockTime, cetLockTime, fundOutputSerialId, contractFlags) /*throws*/{
121
- return FfiConverterTypeDlcTransactions.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
122
- return (() => {
123
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_dlc_transactions`);
124
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_dlc_transactions;
125
- })()(FfiConverterArrayTypePayout.lower(outcomes), FfiConverterTypePartyParams.lower(localParams), FfiConverterTypePartyParams.lower(remoteParams), _uniffiBindgenReactNative.FfiConverterUInt32.lower(refundLocktime), _uniffiBindgenReactNative.FfiConverterUInt64.lower(feeRate), _uniffiBindgenReactNative.FfiConverterUInt32.lower(fundLockTime), _uniffiBindgenReactNative.FfiConverterUInt32.lower(cetLockTime), _uniffiBindgenReactNative.FfiConverterUInt64.lower(fundOutputSerialId), _uniffiBindgenReactNative.FfiConverterUInt8.lower(contractFlags), callStatus);
126
- }, /*liftString:*/FfiConverterString.lift));
238
+ return (__rb => {
239
+ try {
240
+ return FfiConverterTypeDlcTransactions.lift(__rb);
241
+ } finally {
242
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
243
+ }
244
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
245
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_dlc_transactions(FfiConverterSequenceTypePayout.lower(outcomes, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterTypePartyParams.lower(localParams, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterTypePartyParams.lower(remoteParams, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt32.lower(refundLocktime, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt64.lower(feeRate, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt32.lower(fundLockTime, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt32.lower(cetLockTime, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt64.lower(fundOutputSerialId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt8.lower(contractFlags, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
246
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
127
247
  }
248
+
249
+ /**
250
+ * Derive child extended private key from parent extended key
251
+ * Input: 78-byte encoded xpriv, Output: 78-byte encoded xpriv
252
+ */
128
253
  function createExtkeyFromParentPath(extkey, path) /*throws*/{
129
- return FfiConverterArrayUInt8.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
130
- return (() => {
131
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_extkey_from_parent_path`);
132
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_extkey_from_parent_path;
133
- })()(FfiConverterArrayUInt8.lower(extkey), FfiConverterString.lower(path), callStatus);
134
- }, /*liftString:*/FfiConverterString.lift));
254
+ return (__rb => {
255
+ try {
256
+ return _core.FfiConverterArrayBuffer.lift(__rb);
257
+ } finally {
258
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
259
+ }
260
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
261
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_extkey_from_parent_path(_core.FfiConverterArrayBuffer.lower(extkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterString.lower(path, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
262
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
135
263
  }
264
+
265
+ /**
266
+ * Create master extended private key from 64-byte seed
267
+ * Returns 78-byte encoded xpriv
268
+ */
136
269
  function createExtkeyFromSeed(seed, network) /*throws*/{
137
- return FfiConverterArrayUInt8.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
138
- return (() => {
139
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_extkey_from_seed`);
140
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_extkey_from_seed;
141
- })()(FfiConverterArrayUInt8.lower(seed), FfiConverterString.lower(network), callStatus);
142
- }, /*liftString:*/FfiConverterString.lift));
270
+ return (__rb => {
271
+ try {
272
+ return _core.FfiConverterArrayBuffer.lift(__rb);
273
+ } finally {
274
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
275
+ }
276
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
277
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_extkey_from_seed(_core.FfiConverterArrayBuffer.lower(seed, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterString.lower(network, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
278
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
143
279
  }
280
+
281
+ /**
282
+ * Create a funding script pubkey for DLC transactions
283
+ */
144
284
  function createFundTxLockingScript(localFundPubkey, remoteFundPubkey) /*throws*/{
145
- return FfiConverterArrayUInt8.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
146
- return (() => {
147
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_fund_tx_locking_script`);
148
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_fund_tx_locking_script;
149
- })()(FfiConverterArrayUInt8.lower(localFundPubkey), FfiConverterArrayUInt8.lower(remoteFundPubkey), callStatus);
150
- }, /*liftString:*/FfiConverterString.lift));
285
+ return (__rb => {
286
+ try {
287
+ return _core.FfiConverterArrayBuffer.lift(__rb);
288
+ } finally {
289
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
290
+ }
291
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
292
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_fund_tx_locking_script(_core.FfiConverterArrayBuffer.lower(localFundPubkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(remoteFundPubkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
293
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
294
+ }
295
+
296
+ /**
297
+ * Rebuilds the BIP-174 funding PSBT from the offer and accept messages.
298
+ */
299
+ function createFundingPsbt(offer, accept) /*throws*/{
300
+ return (__rb => {
301
+ try {
302
+ return _core.FfiConverterArrayBuffer.lift(__rb);
303
+ } finally {
304
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
305
+ }
306
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
307
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_funding_psbt(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(accept, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
308
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
309
+ }
310
+
311
+ /**
312
+ * Creates an offer. Returns the wire-encoded `OfferDlc` to send to the accepting party.
313
+ */
314
+ function createOffer(params) /*throws*/{
315
+ return (__rb => {
316
+ try {
317
+ return _core.FfiConverterArrayBuffer.lift(__rb);
318
+ } finally {
319
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
320
+ }
321
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
322
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_offer(FfiConverterTypeCreateOfferParams.lower(params, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
323
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
151
324
  }
325
+
326
+ /**
327
+ * Create a refund transaction
328
+ */
152
329
  function createRefundTransaction(localFinalScriptPubkey, remoteFinalScriptPubkey, localAmount, remoteAmount, lockTime, fundTxId, fundVout) /*throws*/{
153
- return FfiConverterTypeTransaction.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
154
- return (() => {
155
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_refund_transaction`);
156
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_refund_transaction;
157
- })()(FfiConverterArrayUInt8.lower(localFinalScriptPubkey), FfiConverterArrayUInt8.lower(remoteFinalScriptPubkey), _uniffiBindgenReactNative.FfiConverterUInt64.lower(localAmount), _uniffiBindgenReactNative.FfiConverterUInt64.lower(remoteAmount), _uniffiBindgenReactNative.FfiConverterUInt32.lower(lockTime), FfiConverterString.lower(fundTxId), _uniffiBindgenReactNative.FfiConverterUInt32.lower(fundVout), callStatus);
158
- }, /*liftString:*/FfiConverterString.lift));
330
+ return (__rb => {
331
+ try {
332
+ return FfiConverterTypeTransaction.lift(__rb);
333
+ } finally {
334
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
335
+ }
336
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
337
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_refund_transaction(_core.FfiConverterArrayBuffer.lower(localFinalScriptPubkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(remoteFinalScriptPubkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt64.lower(localAmount, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt64.lower(remoteAmount, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt32.lower(lockTime, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterString.lower(fundTxId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt32.lower(fundVout, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
338
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
159
339
  }
340
+
341
+ /**
342
+ * Create spliced DLC transactions
343
+ */
160
344
  function createSplicedDlcTransactions(outcomes, localParams, remoteParams, refundLocktime, feeRate, fundLockTime, cetLockTime, fundOutputSerialId, contractFlags) /*throws*/{
161
- return FfiConverterTypeDlcTransactions.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
162
- return (() => {
163
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_spliced_dlc_transactions`);
164
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_spliced_dlc_transactions;
165
- })()(FfiConverterArrayTypePayout.lower(outcomes), FfiConverterTypePartyParams.lower(localParams), FfiConverterTypePartyParams.lower(remoteParams), _uniffiBindgenReactNative.FfiConverterUInt32.lower(refundLocktime), _uniffiBindgenReactNative.FfiConverterUInt64.lower(feeRate), _uniffiBindgenReactNative.FfiConverterUInt32.lower(fundLockTime), _uniffiBindgenReactNative.FfiConverterUInt32.lower(cetLockTime), _uniffiBindgenReactNative.FfiConverterUInt64.lower(fundOutputSerialId), _uniffiBindgenReactNative.FfiConverterUInt8.lower(contractFlags), callStatus);
166
- }, /*liftString:*/FfiConverterString.lift));
345
+ return (__rb => {
346
+ try {
347
+ return FfiConverterTypeDlcTransactions.lift(__rb);
348
+ } finally {
349
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
350
+ }
351
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
352
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_spliced_dlc_transactions(FfiConverterSequenceTypePayout.lower(outcomes, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterTypePartyParams.lower(localParams, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterTypePartyParams.lower(remoteParams, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt32.lower(refundLocktime, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt64.lower(feeRate, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt32.lower(fundLockTime, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt32.lower(cetLockTime, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt64.lower(fundOutputSerialId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt8.lower(contractFlags, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
353
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
167
354
  }
355
+
356
+ /**
357
+ * DEPRECATED: Use create_extkey_from_seed + create_extkey_from_parent_path instead
358
+ * This function handles both seeds (64 bytes) and xprivs (78 bytes) which is confusing
359
+ */
168
360
  function createXprivFromParentPath(seedOrXpriv, baseDerivationPath, network, path) /*throws*/{
169
- return FfiConverterArrayUInt8.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
170
- return (() => {
171
- console.debug(`-- uniffi_ddk_ffi_fn_func_create_xpriv_from_parent_path`);
172
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_xpriv_from_parent_path;
173
- })()(FfiConverterArrayUInt8.lower(seedOrXpriv), FfiConverterString.lower(baseDerivationPath), FfiConverterString.lower(network), FfiConverterString.lower(path), callStatus);
174
- }, /*liftString:*/FfiConverterString.lift));
361
+ return (__rb => {
362
+ try {
363
+ return _core.FfiConverterArrayBuffer.lift(__rb);
364
+ } finally {
365
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
366
+ }
367
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
368
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_xpriv_from_parent_path(_core.FfiConverterArrayBuffer.lower(seedOrXpriv, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterString.lower(baseDerivationPath, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterString.lower(network, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterString.lower(path, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
369
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
370
+ }
371
+
372
+ /**
373
+ * The required `max_witness_len` for a DLC (splice) funding input (220).
374
+ */
375
+ function dlcInputMaxWitnessLen() {
376
+ return _core.FfiConverterUInt16.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
377
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_dlc_input_max_witness_len(callStatus);
378
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
379
+ }
380
+
381
+ /**
382
+ * Rebuilds the unsigned funding, CET, and refund transactions from the messages.
383
+ */
384
+ function dlcTransactionsFromMessages(offer, accept) /*throws*/{
385
+ return (__rb => {
386
+ try {
387
+ return FfiConverterTypeDlcTransactions.lift(__rb);
388
+ } finally {
389
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
390
+ }
391
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
392
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_dlc_transactions_from_messages(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(accept, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
393
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
175
394
  }
176
395
  function extractEcdsaSignatureFromOracleSignatures(oracleSignatures, adaptorSignature) /*throws*/{
177
- return FfiConverterArrayUInt8.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
178
- return (() => {
179
- console.debug(`-- uniffi_ddk_ffi_fn_func_extract_ecdsa_signature_from_oracle_signatures`);
180
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_extract_ecdsa_signature_from_oracle_signatures;
181
- })()(FfiConverterArrayArrayUInt8.lower(oracleSignatures), FfiConverterArrayUInt8.lower(adaptorSignature), callStatus);
182
- }, /*liftString:*/FfiConverterString.lift));
396
+ return (__rb => {
397
+ try {
398
+ return _core.FfiConverterArrayBuffer.lift(__rb);
399
+ } finally {
400
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
401
+ }
402
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
403
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_extract_ecdsa_signature_from_oracle_signatures(FfiConverterSequenceBytes.lower(oracleSignatures, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(adaptorSignature, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
404
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
183
405
  }
184
- function getCetAdaptorSignatureInputs(cet, oracleInfo, fundingScriptPubkey, fundOutputValue, msgs) /*throws*/{
185
- return FfiConverterTypeCetAdaptorSignatureDebugInfo.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
186
- return (() => {
187
- console.debug(`-- uniffi_ddk_ffi_fn_func_get_cet_adaptor_signature_inputs`);
188
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_get_cet_adaptor_signature_inputs;
189
- })()(FfiConverterTypeTransaction.lower(cet), FfiConverterArrayTypeOracleInfo.lower(oracleInfo), FfiConverterArrayUInt8.lower(fundingScriptPubkey), _uniffiBindgenReactNative.FfiConverterUInt64.lower(fundOutputValue), FfiConverterArrayArrayArrayUInt8.lower(msgs), callStatus);
190
- }, /*liftString:*/FfiConverterString.lift));
406
+
407
+ /**
408
+ * The accepting party verifies the sign message and completes the funding
409
+ * transaction. Returns the Bitcoin consensus-serialized signed transaction.
410
+ */
411
+ function finalizeSign(offer, accept, sign, signedFundingPsbt) /*throws*/{
412
+ return (__rb => {
413
+ try {
414
+ return _core.FfiConverterArrayBuffer.lift(__rb);
415
+ } finally {
416
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
417
+ }
418
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
419
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_finalize_sign(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(accept, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(sign, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(signedFundingPsbt, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
420
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
191
421
  }
192
- function getCetSighash(cet, fundingScriptPubkey, fundOutputValue) /*throws*/{
193
- return FfiConverterArrayUInt8.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
194
- return (() => {
195
- console.debug(`-- uniffi_ddk_ffi_fn_func_get_cet_sighash`);
196
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_get_cet_sighash;
197
- })()(FfiConverterTypeTransaction.lower(cet), FfiConverterArrayUInt8.lower(fundingScriptPubkey), _uniffiBindgenReactNative.FfiConverterUInt64.lower(fundOutputValue), callStatus);
198
- }, /*liftString:*/FfiConverterString.lift));
422
+
423
+ /**
424
+ * Like [`finalize_sign`], but additionally completes the 2-of-2 witness for any
425
+ * splice (DLC) funding input using this (accepting) party's prior funding keys,
426
+ * re-derived inside Rust from `keys`.
427
+ */
428
+ function finalizeSignSpliced(offer, accept, sign, signedFundingPsbt, keys, spliceKeys) /*throws*/{
429
+ return (__rb => {
430
+ try {
431
+ return _core.FfiConverterArrayBuffer.lift(__rb);
432
+ } finally {
433
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
434
+ }
435
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
436
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_finalize_sign_spliced(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(accept, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(sign, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(signedFundingPsbt, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterTypeContractKeyProvider.lower(keys, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceTypeSpliceKeyRef.lower(spliceKeys, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
437
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
199
438
  }
200
- function getChangeOutputAndFees(params, feeRate) /*throws*/{
201
- return FfiConverterTypeChangeOutputAndFees.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
202
- return (() => {
203
- console.debug(`-- uniffi_ddk_ffi_fn_func_get_change_output_and_fees`);
204
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_get_change_output_and_fees;
205
- })()(FfiConverterTypePartyParams.lower(params), _uniffiBindgenReactNative.FfiConverterUInt64.lower(feeRate), callStatus);
206
- }, /*liftString:*/FfiConverterString.lift));
439
+
440
+ /**
441
+ * Builds a wire-encoded `FundingInput` from a wallet UTXO, ready to place in a
442
+ * party's `funding_inputs`.
443
+ *
444
+ * - `previous_transaction`: the full consensus-serialized transaction that
445
+ * created the UTXO being spent.
446
+ * - `vout`: the output index of the UTXO within that transaction.
447
+ * - `input_serial_id`: orders the input in the funding transaction; randomly
448
+ * generated when `None`.
449
+ * - `sequence`: the input sequence (usually `0xffffffff`).
450
+ * - `max_witness_len`: the input's maximum witness length (e.g. 108 for
451
+ * P2WPKH).
452
+ * - `redeem_script`: the redeem script for a P2SH input, or empty for others.
453
+ */
454
+ function fundingInput(previousTransaction, vout, inputSerialId, sequence, maxWitnessLen, redeemScript) /*throws*/{
455
+ return (__rb => {
456
+ try {
457
+ return _core.FfiConverterArrayBuffer.lift(__rb);
458
+ } finally {
459
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
460
+ }
461
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
462
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_funding_input(_core.FfiConverterArrayBuffer.lower(previousTransaction, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt32.lower(vout, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterOptionalUInt64.lower(inputSerialId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt32.lower(sequence, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt16.lower(maxWitnessLen, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(redeemScript, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
463
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
207
464
  }
465
+
466
+ /**
467
+ * Extract public key from extended key (private or public)
468
+ * Input: 78-byte encoded xpriv/xpub, Output: 33-byte compressed public key
469
+ */
208
470
  function getPubkeyFromExtkey(extkey, network) /*throws*/{
209
- return FfiConverterArrayUInt8.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
210
- return (() => {
211
- console.debug(`-- uniffi_ddk_ffi_fn_func_get_pubkey_from_extkey`);
212
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_get_pubkey_from_extkey;
213
- })()(FfiConverterArrayUInt8.lower(extkey), FfiConverterString.lower(network), callStatus);
214
- }, /*liftString:*/FfiConverterString.lift));
215
- }
216
- function getRawFundingTransactionInputSignature(fundingTransaction, privkey, prevTxId, prevTxVout, value) /*throws*/{
217
- return FfiConverterArrayUInt8.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
218
- return (() => {
219
- console.debug(`-- uniffi_ddk_ffi_fn_func_get_raw_funding_transaction_input_signature`);
220
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_get_raw_funding_transaction_input_signature;
221
- })()(FfiConverterTypeTransaction.lower(fundingTransaction), FfiConverterArrayUInt8.lower(privkey), FfiConverterString.lower(prevTxId), _uniffiBindgenReactNative.FfiConverterUInt32.lower(prevTxVout), _uniffiBindgenReactNative.FfiConverterUInt64.lower(value), callStatus);
222
- }, /*liftString:*/FfiConverterString.lift));
471
+ return (__rb => {
472
+ try {
473
+ return _core.FfiConverterArrayBuffer.lift(__rb);
474
+ } finally {
475
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
476
+ }
477
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
478
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_get_pubkey_from_extkey(_core.FfiConverterArrayBuffer.lower(extkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterString.lower(network, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
479
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
223
480
  }
481
+
482
+ /**
483
+ * Get total input virtual size for fee calculation
484
+ */
224
485
  function getTotalInputVsize(inputs) {
225
- return _uniffiBindgenReactNative.FfiConverterUInt32.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
226
- return (() => {
227
- console.debug(`-- uniffi_ddk_ffi_fn_func_get_total_input_vsize`);
228
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_get_total_input_vsize;
229
- })()(FfiConverterArrayTypeTxInputInfo.lower(inputs), callStatus);
230
- }, /*liftString:*/FfiConverterString.lift));
486
+ return _core.FfiConverterUInt32.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
487
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_get_total_input_vsize(FfiConverterSequenceTypeTxInputInfo.lower(inputs, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
488
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
231
489
  }
490
+
491
+ /**
492
+ * Convert extended private key to extended public key
493
+ * Input: 78-byte encoded xpriv, Output: 78-byte encoded xpub
494
+ */
232
495
  function getXpubFromXpriv(xpriv, network) /*throws*/{
233
- return FfiConverterArrayUInt8.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
234
- return (() => {
235
- console.debug(`-- uniffi_ddk_ffi_fn_func_get_xpub_from_xpriv`);
236
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_get_xpub_from_xpriv;
237
- })()(FfiConverterArrayUInt8.lower(xpriv), FfiConverterString.lower(network), callStatus);
238
- }, /*liftString:*/FfiConverterString.lift));
496
+ return (__rb => {
497
+ try {
498
+ return _core.FfiConverterArrayBuffer.lift(__rb);
499
+ } finally {
500
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
501
+ }
502
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
503
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_get_xpub_from_xpriv(_core.FfiConverterArrayBuffer.lower(xpriv, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterString.lower(network, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
504
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
505
+ }
506
+
507
+ /**
508
+ * The offering party verifies the accept message and produces its `SignDlc`.
509
+ * The offer party's funding secret key is derived from `keys` +
510
+ * `temporary_contract_id` (the new contract's id).
511
+ */
512
+ function signAccept(offer, accept, keys, temporaryContractId, signedFundingPsbt) /*throws*/{
513
+ return (__rb => {
514
+ try {
515
+ return FfiConverterTypeSignResult.lift(__rb);
516
+ } finally {
517
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
518
+ }
519
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
520
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_sign_accept(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(accept, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterTypeContractKeyProvider.lower(keys, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(temporaryContractId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(signedFundingPsbt, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
521
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
522
+ }
523
+
524
+ /**
525
+ * Like [`sign_accept`], but additionally co-signs any splice (DLC) funding
526
+ * inputs. For each splice input, `splice_keys` names the previous contract; the
527
+ * prior funding secret key is re-derived inside Rust from `keys`.
528
+ */
529
+ function signAcceptSpliced(offer, accept, keys, temporaryContractId, signedFundingPsbt, spliceKeys) /*throws*/{
530
+ return (__rb => {
531
+ try {
532
+ return FfiConverterTypeSignResult.lift(__rb);
533
+ } finally {
534
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
535
+ }
536
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
537
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_sign_accept_spliced(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(accept, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterTypeContractKeyProvider.lower(keys, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(temporaryContractId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(signedFundingPsbt, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceTypeSpliceKeyRef.lower(spliceKeys, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
538
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
239
539
  }
240
- function isDustOutput(output) {
241
- return _uniffiBindgenReactNative.FfiConverterBool.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
242
- return (() => {
243
- console.debug(`-- uniffi_ddk_ffi_fn_func_is_dust_output`);
244
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_is_dust_output;
245
- })()(FfiConverterTypeTxOutput.lower(output), callStatus);
246
- }, /*liftString:*/FfiConverterString.lift));
540
+
541
+ /**
542
+ * Signs the CET matching a set of oracle attestations, returning the Bitcoin
543
+ * consensus-serialized transaction. It pays each party the attested outcome's
544
+ * payout and is ready to broadcast — no network access happens here.
545
+ *
546
+ * The settling party's funding secret key is derived inside Rust from `keys` +
547
+ * `temporary_contract_id` — the settling party's OWN temporary id (the offer's
548
+ * for the offering party, the `new_temporary_contract_id` passed to
549
+ * `accept_offer` for the accepting party). The key also identifies which side
550
+ * is settling, so there is no party argument to get wrong. Either party can
551
+ * settle alone: the counterparty's half of the 2-of-2 comes from decrypting its
552
+ * CET adaptor signature with the oracle signatures.
553
+ *
554
+ * Each entry in `attestations` pairs a wire-encoded `OracleAttestation` with
555
+ * the index of its oracle in the announcements of the contract info it settles.
556
+ * Attestations are verified against the announcements they claim to come from,
557
+ * so a forged or misindexed one cannot produce a CET
558
+ * ([`ContractError::InvalidAttestation`]). When no contract outcome matches the
559
+ * attested outcomes, [`ContractError::NoMatchingOutcome`] is returned — which
560
+ * is also what an attestation for an unrelated event looks like.
561
+ */
562
+ function signContractCet(offer, accept, sign, keys, temporaryContractId, attestations) /*throws*/{
563
+ return (__rb => {
564
+ try {
565
+ return _core.FfiConverterArrayBuffer.lift(__rb);
566
+ } finally {
567
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
568
+ }
569
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
570
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_sign_contract_cet(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(accept, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(sign, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterTypeContractKeyProvider.lower(keys, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(temporaryContractId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceTypeOracleAttestationRef.lower(attestations, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
571
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
247
572
  }
248
- function signCet(cet, adaptorSignature, oracleSignatures, fundingSecretKey, otherPubkey, fundingScriptPubkey, fundOutputValue) /*throws*/{
249
- return FfiConverterTypeTransaction.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
250
- return (() => {
251
- console.debug(`-- uniffi_ddk_ffi_fn_func_sign_cet`);
252
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_sign_cet;
253
- })()(FfiConverterTypeTransaction.lower(cet), FfiConverterArrayUInt8.lower(adaptorSignature), FfiConverterArrayArrayUInt8.lower(oracleSignatures), FfiConverterArrayUInt8.lower(fundingSecretKey), FfiConverterArrayUInt8.lower(otherPubkey), FfiConverterArrayUInt8.lower(fundingScriptPubkey), _uniffiBindgenReactNative.FfiConverterUInt64.lower(fundOutputValue), callStatus);
254
- }, /*liftString:*/FfiConverterString.lift));
573
+
574
+ /**
575
+ * Signs the refund transaction, returning the Bitcoin consensus-serialized
576
+ * transaction. It returns each party its own collateral and can only be
577
+ * broadcast once the offer's `refund_locktime` has passed — enforcing that is
578
+ * the chain's job, not this function's.
579
+ *
580
+ * As with [`sign_contract_cet`], `temporary_contract_id` is the settling
581
+ * party's own temporary id and identifies which side is settling. Both parties
582
+ * signed the refund during the offer/accept exchange, so this only adds this
583
+ * party's half; the counterparty's stored signature is verified first.
584
+ */
585
+ function signContractRefund(offer, accept, sign, keys, temporaryContractId) /*throws*/{
586
+ return (__rb => {
587
+ try {
588
+ return _core.FfiConverterArrayBuffer.lift(__rb);
589
+ } finally {
590
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
591
+ }
592
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
593
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_sign_contract_refund(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(accept, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(sign, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterTypeContractKeyProvider.lower(keys, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(temporaryContractId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
594
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
255
595
  }
256
- function signFundTransactionInput(fundTransaction, privkey, prevTxId, prevTxVout, value) /*throws*/{
257
- return FfiConverterTypeTransaction.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
258
- return (() => {
259
- console.debug(`-- uniffi_ddk_ffi_fn_func_sign_fund_transaction_input`);
260
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_sign_fund_transaction_input;
261
- })()(FfiConverterTypeTransaction.lower(fundTransaction), FfiConverterArrayUInt8.lower(privkey), FfiConverterString.lower(prevTxId), _uniffiBindgenReactNative.FfiConverterUInt32.lower(prevTxVout), _uniffiBindgenReactNative.FfiConverterUInt64.lower(value), callStatus);
262
- }, /*liftString:*/FfiConverterString.lift));
596
+
597
+ /**
598
+ * Signs a party's own funding inputs on the funding PSBT using a private output
599
+ * descriptor (e.g. bdk's `wpkh(...)` with an xprv), returning the updated PSBT.
600
+ * Each entry in `inputs` names one of this party's funding inputs (by serial
601
+ * id) and the descriptor wildcard index that derives its key. Supports `wpkh()`
602
+ * and `sh(wpkh())`, with or without a wildcard.
603
+ */
604
+ function signFundingPsbtWithDescriptor(offer, accept, fundingPsbt, descriptor, inputs) /*throws*/{
605
+ return (__rb => {
606
+ try {
607
+ return _core.FfiConverterArrayBuffer.lift(__rb);
608
+ } finally {
609
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
610
+ }
611
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
612
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_sign_funding_psbt_with_descriptor(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(accept, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(fundingPsbt, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterString.lower(descriptor, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceTypeDescriptorInput.lower(inputs, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
613
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
263
614
  }
264
- function signMultiSigInput(tx, dlcInput, localPrivkey, remoteSignature) /*throws*/{
265
- return FfiConverterTypeTransaction.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
266
- return (() => {
267
- console.debug(`-- uniffi_ddk_ffi_fn_func_sign_multi_sig_input`);
268
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_sign_multi_sig_input;
269
- })()(FfiConverterTypeTransaction.lower(tx), FfiConverterTypeDlcInputInfo.lower(dlcInput), FfiConverterArrayUInt8.lower(localPrivkey), FfiConverterArrayUInt8.lower(remoteSignature), callStatus);
270
- }, /*liftString:*/FfiConverterString.lift));
615
+
616
+ /**
617
+ * Validates an accept message against its offer: the acceptor's CET adaptor
618
+ * signatures and refund signature must be valid for the contract the two
619
+ * messages describe. This is the same check `sign_accept` runs internally,
620
+ * exposed so a stored/received `AcceptDlc` can be verified on its own.
621
+ */
622
+ function validateAccept(offer, accept) /*throws*/{
623
+ uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
624
+ (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_validate_accept(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(accept, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
625
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString));
271
626
  }
272
- function verifyCetAdaptorSigFromOracleInfo(adaptorSig, cet, oracleInfo, pubkey, fundingScriptPubkey, totalCollateral, msgs) {
273
- return _uniffiBindgenReactNative.FfiConverterBool.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
274
- return (() => {
275
- console.debug(`-- uniffi_ddk_ffi_fn_func_verify_cet_adaptor_sig_from_oracle_info`);
276
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_verify_cet_adaptor_sig_from_oracle_info;
277
- })()(FfiConverterTypeAdaptorSignature.lower(adaptorSig), FfiConverterTypeTransaction.lower(cet), FfiConverterArrayTypeOracleInfo.lower(oracleInfo), FfiConverterArrayUInt8.lower(pubkey), FfiConverterArrayUInt8.lower(fundingScriptPubkey), _uniffiBindgenReactNative.FfiConverterUInt64.lower(totalCollateral), FfiConverterArrayArrayArrayUInt8.lower(msgs), callStatus);
278
- }, /*liftString:*/FfiConverterString.lift));
627
+
628
+ /**
629
+ * Validates an offer's protocol version, funding inputs, fee rate, collateral,
630
+ * and oracle timeouts.
631
+ *
632
+ * The lifecycle functions already validate internally (`accept_offer` validates
633
+ * the offer, `sign_accept` validates the accept, `finalize_sign` validates the
634
+ * sign); these `validate_*` functions expose the same checks standalone, so a
635
+ * consumer can independently verify a stored or received message at any time —
636
+ * e.g. before persisting it, or when loading it back later.
637
+ */
638
+ function validateOffer(offer, minTimeoutInterval, maxTimeoutInterval) /*throws*/{
639
+ uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
640
+ (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_validate_offer(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt32.lower(minTimeoutInterval, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt32.lower(maxTimeoutInterval, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
641
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString));
279
642
  }
280
- function verifyCetAdaptorSigsFromOracleInfo(adaptorSigs, cets, oracleInfo, pubkey, fundingScriptPubkey, totalCollateral, msgs) {
281
- return _uniffiBindgenReactNative.FfiConverterBool.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
282
- return (() => {
283
- console.debug(`-- uniffi_ddk_ffi_fn_func_verify_cet_adaptor_sigs_from_oracle_info`);
284
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_verify_cet_adaptor_sigs_from_oracle_info;
285
- })()(FfiConverterArrayTypeAdaptorSignature.lower(adaptorSigs), FfiConverterArrayTypeTransaction.lower(cets), FfiConverterArrayTypeOracleInfo.lower(oracleInfo), FfiConverterArrayUInt8.lower(pubkey), FfiConverterArrayUInt8.lower(fundingScriptPubkey), _uniffiBindgenReactNative.FfiConverterUInt64.lower(totalCollateral), FfiConverterArrayArrayArrayArrayUInt8.lower(msgs), callStatus);
286
- }, /*liftString:*/FfiConverterString.lift));
643
+
644
+ /**
645
+ * Validates a sign message against its offer and accept: the offerer's CET
646
+ * adaptor signatures and refund signature must be valid. This is the same
647
+ * check `finalize_sign` runs internally, exposed so a stored/received `SignDlc`
648
+ * can be verified on its own.
649
+ */
650
+ function validateSign(offer, accept, sign) /*throws*/{
651
+ uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
652
+ (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_validate_sign(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(accept, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(sign, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
653
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString));
287
654
  }
288
- function verifyFundTxSignature(fundTx, signature, pubkey, txid, vout, inputAmount) /*throws*/{
289
- return _uniffiBindgenReactNative.FfiConverterBool.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
290
- return (() => {
291
- console.debug(`-- uniffi_ddk_ffi_fn_func_verify_fund_tx_signature`);
292
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_verify_fund_tx_signature;
293
- })()(FfiConverterTypeTransaction.lower(fundTx), FfiConverterArrayUInt8.lower(signature), FfiConverterArrayUInt8.lower(pubkey), FfiConverterString.lower(txid), _uniffiBindgenReactNative.FfiConverterUInt32.lower(vout), _uniffiBindgenReactNative.FfiConverterUInt64.lower(inputAmount), callStatus);
294
- }, /*liftString:*/FfiConverterString.lift));
655
+ function verifyCetAdaptorSigsFromOracleInfo(adaptorSigs, cets, oracleInfos, pubkey, fundingScriptPubkey, totalCollateral, msgs) {
656
+ return _core.FfiConverterBool.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
657
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_verify_cet_adaptor_sigs_from_oracle_info(FfiConverterSequenceTypeAdaptorSignature.lower(adaptorSigs, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceTypeTransaction.lower(cets, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceTypeOracleInfo.lower(oracleInfos, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(pubkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(fundingScriptPubkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt64.lower(totalCollateral, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceSequenceSequenceBytes.lower(msgs, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
658
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
295
659
  }
296
660
  function version() {
297
- return FfiConverterString.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
298
- return (() => {
299
- console.debug(`-- uniffi_ddk_ffi_fn_func_version`);
300
- return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_version;
301
- })()(callStatus);
302
- }, /*liftString:*/FfiConverterString.lift));
661
+ return (__rb => {
662
+ try {
663
+ return FfiConverterString.lift(__rb);
664
+ } finally {
665
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
666
+ }
667
+ })(uniffiCaller.rustCall(/*caller:*/callStatus => {
668
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_version(callStatus);
669
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
303
670
  }
671
+
304
672
  /**
305
- * Generated factory for {@link AdaptorSignature} record objects.
673
+ * One party's Bitcoin-level contract data (mirrors [`ddk::contract::PartyParams`]).
306
674
  */
307
- const AdaptorSignature = exports.AdaptorSignature = (() => {
675
+
676
+ /**
677
+ * Generated factory for {@link ContractPartyParams} record objects.
678
+ */
679
+ const ContractPartyParams = exports.ContractPartyParams = (() => {
308
680
  const defaults = () => ({});
309
681
  const create = (() => {
310
- return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(defaults);
682
+ return (0, _core.uniffiCreateRecord)(defaults);
311
683
  })();
312
684
  return Object.freeze({
313
- /**
314
- * Create a frozen instance of {@link AdaptorSignature}, with defaults specified
315
- * in Rust, in the {@link ddk_ffi} crate.
316
- */
317
685
  create,
318
- /**
319
- * Create a frozen instance of {@link AdaptorSignature}, with defaults specified
320
- * in Rust, in the {@link ddk_ffi} crate.
321
- */
322
686
  new: create,
323
- /**
324
- * Defaults specified in the {@link ddk_ffi} crate.
325
- */
326
687
  defaults: () => Object.freeze(defaults())
327
688
  });
328
689
  })();
329
- const FfiConverterTypeAdaptorSignature = (() => {
330
- class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
690
+ const FfiConverterTypeContractPartyParams = (() => {
691
+ class FFIConverter extends _core.AbstractFfiConverterByteArray {
331
692
  read(from) {
332
693
  return {
333
- signature: FfiConverterArrayUInt8.read(from),
334
- proof: FfiConverterArrayUInt8.read(from)
694
+ fundingPubkey: _core.FfiConverterArrayBuffer.read(from),
695
+ fundingInputs: FfiConverterSequenceBytes.read(from),
696
+ payoutSpk: _core.FfiConverterArrayBuffer.read(from),
697
+ payoutSerialId: FfiConverterOptionalUInt64.read(from),
698
+ changeSpk: _core.FfiConverterArrayBuffer.read(from),
699
+ changeSerialId: FfiConverterOptionalUInt64.read(from)
335
700
  };
336
701
  }
337
702
  write(value, into) {
338
- FfiConverterArrayUInt8.write(value.signature, into);
339
- FfiConverterArrayUInt8.write(value.proof, into);
703
+ _core.FfiConverterArrayBuffer.write(value.fundingPubkey, into);
704
+ FfiConverterSequenceBytes.write(value.fundingInputs, into);
705
+ _core.FfiConverterArrayBuffer.write(value.payoutSpk, into);
706
+ FfiConverterOptionalUInt64.write(value.payoutSerialId, into);
707
+ _core.FfiConverterArrayBuffer.write(value.changeSpk, into);
708
+ FfiConverterOptionalUInt64.write(value.changeSerialId, into);
340
709
  }
341
710
  allocationSize(value) {
342
- return FfiConverterArrayUInt8.allocationSize(value.signature) + FfiConverterArrayUInt8.allocationSize(value.proof);
711
+ return _core.FfiConverterArrayBuffer.allocationSize(value.fundingPubkey) + FfiConverterSequenceBytes.allocationSize(value.fundingInputs) + _core.FfiConverterArrayBuffer.allocationSize(value.payoutSpk) + FfiConverterOptionalUInt64.allocationSize(value.payoutSerialId) + _core.FfiConverterArrayBuffer.allocationSize(value.changeSpk) + FfiConverterOptionalUInt64.allocationSize(value.changeSerialId);
343
712
  }
344
713
  }
345
- ;
346
714
  return new FFIConverter();
347
715
  })();
716
+
348
717
  /**
349
- * Generated factory for {@link CetAdaptorSignatureDebugInfo} record objects.
718
+ * Parameters for [`accept_offer`] (mirrors [`ddk::contract::AcceptOfferParams`]).
350
719
  */
351
- const CetAdaptorSignatureDebugInfo = exports.CetAdaptorSignatureDebugInfo = (() => {
720
+
721
+ /**
722
+ * Generated factory for {@link AcceptOfferParams} record objects.
723
+ */
724
+ const AcceptOfferParams = exports.AcceptOfferParams = (() => {
352
725
  const defaults = () => ({});
353
726
  const create = (() => {
354
- return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(defaults);
727
+ return (0, _core.uniffiCreateRecord)(defaults);
355
728
  })();
356
729
  return Object.freeze({
357
- /**
358
- * Create a frozen instance of {@link CetAdaptorSignatureDebugInfo}, with defaults specified
359
- * in Rust, in the {@link ddk_ffi} crate.
360
- */
361
730
  create,
362
- /**
363
- * Create a frozen instance of {@link CetAdaptorSignatureDebugInfo}, with defaults specified
364
- * in Rust, in the {@link ddk_ffi} crate.
365
- */
366
731
  new: create,
367
- /**
368
- * Defaults specified in the {@link ddk_ffi} crate.
369
- */
370
732
  defaults: () => Object.freeze(defaults())
371
733
  });
372
734
  })();
373
- const FfiConverterTypeCetAdaptorSignatureDebugInfo = (() => {
374
- class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
735
+ const FfiConverterTypeAcceptOfferParams = (() => {
736
+ class FFIConverter extends _core.AbstractFfiConverterByteArray {
375
737
  read(from) {
376
738
  return {
377
- sighash: FfiConverterArrayUInt8.read(from),
378
- adaptorPoint: FfiConverterArrayUInt8.read(from),
379
- inputIndex: _uniffiBindgenReactNative.FfiConverterUInt32.read(from),
380
- scriptPubkey: FfiConverterArrayUInt8.read(from),
381
- value: _uniffiBindgenReactNative.FfiConverterUInt64.read(from),
382
- cetTxid: FfiConverterString.read(from),
383
- cetRaw: FfiConverterArrayUInt8.read(from)
739
+ party: FfiConverterTypeContractPartyParams.read(from),
740
+ minTimeoutInterval: _core.FfiConverterUInt32.read(from),
741
+ maxTimeoutInterval: _core.FfiConverterUInt32.read(from)
384
742
  };
385
743
  }
386
744
  write(value, into) {
387
- FfiConverterArrayUInt8.write(value.sighash, into);
388
- FfiConverterArrayUInt8.write(value.adaptorPoint, into);
389
- _uniffiBindgenReactNative.FfiConverterUInt32.write(value.inputIndex, into);
390
- FfiConverterArrayUInt8.write(value.scriptPubkey, into);
391
- _uniffiBindgenReactNative.FfiConverterUInt64.write(value.value, into);
392
- FfiConverterString.write(value.cetTxid, into);
393
- FfiConverterArrayUInt8.write(value.cetRaw, into);
745
+ FfiConverterTypeContractPartyParams.write(value.party, into);
746
+ _core.FfiConverterUInt32.write(value.minTimeoutInterval, into);
747
+ _core.FfiConverterUInt32.write(value.maxTimeoutInterval, into);
394
748
  }
395
749
  allocationSize(value) {
396
- return FfiConverterArrayUInt8.allocationSize(value.sighash) + FfiConverterArrayUInt8.allocationSize(value.adaptorPoint) + _uniffiBindgenReactNative.FfiConverterUInt32.allocationSize(value.inputIndex) + FfiConverterArrayUInt8.allocationSize(value.scriptPubkey) + _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.value) + FfiConverterString.allocationSize(value.cetTxid) + FfiConverterArrayUInt8.allocationSize(value.cetRaw);
750
+ return FfiConverterTypeContractPartyParams.allocationSize(value.party) + _core.FfiConverterUInt32.allocationSize(value.minTimeoutInterval) + _core.FfiConverterUInt32.allocationSize(value.maxTimeoutInterval);
397
751
  }
398
752
  }
399
- ;
400
753
  return new FFIConverter();
401
754
  })();
755
+
756
+ // Hermes (React Native ≥ 0.74) ships TextEncoder and encodeInto, but not
757
+ // TextDecoder. For single-string decode (bytesToString), we polyfill via the
758
+ // C++ string_from_buffer helper using a duck-typed object matching the
759
+ // standard TextDecoder.decode signature. Once Hermes ships a real
760
+ // TextDecoder, the `typeof` check will pick it up automatically.
761
+ //
762
+ // For array-of-strings decode (readStringFromBuffer), we keep a dedicated C++
763
+ // helper: the polyfill path (new Uint8Array view + decode) measured ~40%
764
+ // slower on getStringArray benchmarks than a direct (buf, offset, length)
765
+ // call, due to the per-read view allocation and extra property lookups in
766
+ // string_from_buffer.
767
+ const stringConverter = (() => {
768
+ const encoder = new TextEncoder();
769
+ const decoder = typeof TextDecoder !== 'undefined' ? new TextDecoder() : {
770
+ decode: bytes => (0, _ddk_ffiFfi.default)().ubrn_uniffi_internal_fn_func_ffi__string_from_buffer(bytes, undefined)
771
+ };
772
+ return {
773
+ // Single-string lower() uses the C++ helper — TextEncoder.encode
774
+ // measured ~43% slower on takeString benchmarks.
775
+ stringToBytes: s => (0, _ddk_ffiFfi.default)().ubrn_uniffi_internal_fn_func_ffi__string_to_buffer(s, undefined),
776
+ bytesToString: ab => decoder.decode(ab),
777
+ // Direct C++ call — bypasses uniffiCaller.rustCall() overhead.
778
+ // Matters for N-element arrays.
779
+ stringByteLength: s => (0, _ddk_ffiFfi.default)().ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length(s, undefined),
780
+ // Encode directly into the RustBuffer backing store via
781
+ // TextEncoder.encodeInto — zero intermediate allocation. Replaces
782
+ // the old C++ write_string_into_buffer helper.
783
+ writeStringIntoBuffer: (s, buf, offset) => {
784
+ const view = new Uint8Array(buf.arrayBuffer, offset, buf.arrayBuffer.byteLength - offset);
785
+ return encoder.encodeInto(s, view).written;
786
+ },
787
+ // Dedicated C++ helper — avoids per-read Uint8Array allocation and
788
+ // the double property-lookup in string_from_buffer.
789
+ readStringFromBuffer: (buf, offset, length) => (0, _ddk_ffiFfi.default)().ubrn_uniffi_internal_fn_func_ffi__read_string_from_buffer(buf, offset, length)
790
+ };
791
+ })();
792
+ const FfiConverterString = (0, _core.uniffiCreateFfiConverterString)(stringConverter);
402
793
  /**
403
- * Generated factory for {@link ChangeOutputAndFees} record objects.
794
+ * Generated factory for {@link TxInput} record objects.
404
795
  */
405
- const ChangeOutputAndFees = exports.ChangeOutputAndFees = (() => {
796
+ const TxInput = exports.TxInput = (() => {
406
797
  const defaults = () => ({});
407
798
  const create = (() => {
408
- return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(defaults);
799
+ return (0, _core.uniffiCreateRecord)(defaults);
409
800
  })();
410
801
  return Object.freeze({
411
- /**
412
- * Create a frozen instance of {@link ChangeOutputAndFees}, with defaults specified
413
- * in Rust, in the {@link ddk_ffi} crate.
414
- */
415
802
  create,
416
- /**
417
- * Create a frozen instance of {@link ChangeOutputAndFees}, with defaults specified
418
- * in Rust, in the {@link ddk_ffi} crate.
419
- */
420
803
  new: create,
421
- /**
422
- * Defaults specified in the {@link ddk_ffi} crate.
423
- */
424
804
  defaults: () => Object.freeze(defaults())
425
805
  });
426
806
  })();
427
- const FfiConverterTypeChangeOutputAndFees = (() => {
428
- class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
807
+ const FfiConverterTypeTxInput = (() => {
808
+ class FFIConverter extends _core.AbstractFfiConverterByteArray {
429
809
  read(from) {
430
810
  return {
431
- changeOutput: FfiConverterTypeTxOutput.read(from),
432
- fundFee: _uniffiBindgenReactNative.FfiConverterUInt64.read(from),
433
- cetFee: _uniffiBindgenReactNative.FfiConverterUInt64.read(from)
811
+ txid: FfiConverterString.read(from),
812
+ vout: _core.FfiConverterUInt32.read(from),
813
+ scriptSig: _core.FfiConverterArrayBuffer.read(from),
814
+ sequence: _core.FfiConverterUInt32.read(from),
815
+ witness: FfiConverterSequenceBytes.read(from)
434
816
  };
435
817
  }
436
818
  write(value, into) {
437
- FfiConverterTypeTxOutput.write(value.changeOutput, into);
438
- _uniffiBindgenReactNative.FfiConverterUInt64.write(value.fundFee, into);
439
- _uniffiBindgenReactNative.FfiConverterUInt64.write(value.cetFee, into);
819
+ FfiConverterString.write(value.txid, into);
820
+ _core.FfiConverterUInt32.write(value.vout, into);
821
+ _core.FfiConverterArrayBuffer.write(value.scriptSig, into);
822
+ _core.FfiConverterUInt32.write(value.sequence, into);
823
+ FfiConverterSequenceBytes.write(value.witness, into);
440
824
  }
441
825
  allocationSize(value) {
442
- return FfiConverterTypeTxOutput.allocationSize(value.changeOutput) + _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.fundFee) + _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.cetFee);
826
+ return FfiConverterString.allocationSize(value.txid) + _core.FfiConverterUInt32.allocationSize(value.vout) + _core.FfiConverterArrayBuffer.allocationSize(value.scriptSig) + _core.FfiConverterUInt32.allocationSize(value.sequence) + FfiConverterSequenceBytes.allocationSize(value.witness);
443
827
  }
444
828
  }
445
- ;
446
829
  return new FFIConverter();
447
830
  })();
448
831
  /**
449
- * Generated factory for {@link DlcInputInfo} record objects.
832
+ * Generated factory for {@link TxOutput} record objects.
450
833
  */
451
- const DlcInputInfo = exports.DlcInputInfo = (() => {
834
+ const TxOutput = exports.TxOutput = (() => {
452
835
  const defaults = () => ({});
453
836
  const create = (() => {
454
- return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(defaults);
837
+ return (0, _core.uniffiCreateRecord)(defaults);
455
838
  })();
456
839
  return Object.freeze({
457
- /**
458
- * Create a frozen instance of {@link DlcInputInfo}, with defaults specified
459
- * in Rust, in the {@link ddk_ffi} crate.
460
- */
461
840
  create,
462
- /**
463
- * Create a frozen instance of {@link DlcInputInfo}, with defaults specified
464
- * in Rust, in the {@link ddk_ffi} crate.
465
- */
466
841
  new: create,
467
- /**
468
- * Defaults specified in the {@link ddk_ffi} crate.
469
- */
470
- defaults: () => Object.freeze(defaults())
842
+ defaults: () => Object.freeze(defaults()),
843
+ isDust(self_) {
844
+ return _core.FfiConverterBool.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
845
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_method_txoutput_is_dust(FfiConverterTypeTxOutput.lower(self_, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
846
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
847
+ }
471
848
  });
472
849
  })();
473
- const FfiConverterTypeDlcInputInfo = (() => {
474
- class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
850
+ const FfiConverterTypeTxOutput = (() => {
851
+ class FFIConverter extends _core.AbstractFfiConverterByteArray {
475
852
  read(from) {
476
853
  return {
477
- fundTx: FfiConverterTypeTransaction.read(from),
478
- fundVout: _uniffiBindgenReactNative.FfiConverterUInt32.read(from),
479
- localFundPubkey: FfiConverterArrayUInt8.read(from),
480
- remoteFundPubkey: FfiConverterArrayUInt8.read(from),
481
- fundAmount: _uniffiBindgenReactNative.FfiConverterUInt64.read(from),
482
- maxWitnessLen: _uniffiBindgenReactNative.FfiConverterUInt32.read(from),
483
- inputSerialId: _uniffiBindgenReactNative.FfiConverterUInt64.read(from),
484
- contractId: FfiConverterArrayUInt8.read(from)
854
+ value: _core.FfiConverterUInt64.read(from),
855
+ scriptPubkey: _core.FfiConverterArrayBuffer.read(from)
485
856
  };
486
857
  }
487
858
  write(value, into) {
488
- FfiConverterTypeTransaction.write(value.fundTx, into);
489
- _uniffiBindgenReactNative.FfiConverterUInt32.write(value.fundVout, into);
490
- FfiConverterArrayUInt8.write(value.localFundPubkey, into);
491
- FfiConverterArrayUInt8.write(value.remoteFundPubkey, into);
492
- _uniffiBindgenReactNative.FfiConverterUInt64.write(value.fundAmount, into);
493
- _uniffiBindgenReactNative.FfiConverterUInt32.write(value.maxWitnessLen, into);
494
- _uniffiBindgenReactNative.FfiConverterUInt64.write(value.inputSerialId, into);
495
- FfiConverterArrayUInt8.write(value.contractId, into);
859
+ _core.FfiConverterUInt64.write(value.value, into);
860
+ _core.FfiConverterArrayBuffer.write(value.scriptPubkey, into);
496
861
  }
497
862
  allocationSize(value) {
498
- return FfiConverterTypeTransaction.allocationSize(value.fundTx) + _uniffiBindgenReactNative.FfiConverterUInt32.allocationSize(value.fundVout) + FfiConverterArrayUInt8.allocationSize(value.localFundPubkey) + FfiConverterArrayUInt8.allocationSize(value.remoteFundPubkey) + _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.fundAmount) + _uniffiBindgenReactNative.FfiConverterUInt32.allocationSize(value.maxWitnessLen) + _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.inputSerialId) + FfiConverterArrayUInt8.allocationSize(value.contractId);
863
+ return _core.FfiConverterUInt64.allocationSize(value.value) + _core.FfiConverterArrayBuffer.allocationSize(value.scriptPubkey);
499
864
  }
500
865
  }
501
- ;
502
866
  return new FFIConverter();
503
867
  })();
504
868
  /**
505
- * Generated factory for {@link DlcTransactions} record objects.
869
+ * Generated factory for {@link Transaction} record objects.
506
870
  */
507
- const DlcTransactions = exports.DlcTransactions = (() => {
871
+ const Transaction = exports.Transaction = (() => {
508
872
  const defaults = () => ({});
509
873
  const create = (() => {
510
- return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(defaults);
874
+ return (0, _core.uniffiCreateRecord)(defaults);
511
875
  })();
512
876
  return Object.freeze({
513
- /**
514
- * Create a frozen instance of {@link DlcTransactions}, with defaults specified
515
- * in Rust, in the {@link ddk_ffi} crate.
516
- */
517
877
  create,
518
- /**
519
- * Create a frozen instance of {@link DlcTransactions}, with defaults specified
520
- * in Rust, in the {@link ddk_ffi} crate.
521
- */
522
878
  new: create,
523
- /**
524
- * Defaults specified in the {@link ddk_ffi} crate.
525
- */
526
- defaults: () => Object.freeze(defaults())
879
+ defaults: () => Object.freeze(defaults()),
880
+ addSignature(self_, signature, pubkey, inputIndex) {
881
+ return (__rb => {
882
+ try {
883
+ return FfiConverterTypeTransaction.lift(__rb);
884
+ } finally {
885
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
886
+ }
887
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
888
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_method_transaction_add_signature(FfiConverterTypeTransaction.lower(self_, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(signature, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(pubkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt32.lower(inputIndex, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
889
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
890
+ },
891
+ cetAdaptorSignatureFromOracleInfo(self_, oracleInfo, fundingSk, fundingScriptPubkey, totalCollateral, msgs) {
892
+ return (__rb => {
893
+ try {
894
+ return FfiConverterTypeAdaptorSignature.lift(__rb);
895
+ } finally {
896
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
897
+ }
898
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
899
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_method_transaction_cet_adaptor_signature_from_oracle_info(FfiConverterTypeTransaction.lower(self_, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterTypeOracleInfo.lower(oracleInfo, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(fundingSk, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(fundingScriptPubkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt64.lower(totalCollateral, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceBytes.lower(msgs, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
900
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
901
+ },
902
+ cetAdaptorSignatureInputs(self_, oracleInfo, fundingScriptPubkey, fundOutputValue, msgs) {
903
+ return (__rb => {
904
+ try {
905
+ return FfiConverterTypeCetAdaptorSignatureDebugInfo.lift(__rb);
906
+ } finally {
907
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
908
+ }
909
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
910
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_method_transaction_cet_adaptor_signature_inputs(FfiConverterTypeTransaction.lower(self_, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceTypeOracleInfo.lower(oracleInfo, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(fundingScriptPubkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt64.lower(fundOutputValue, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceSequenceBytes.lower(msgs, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
911
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
912
+ },
913
+ cetSighash(self_, fundingScriptPubkey, fundOutputValue) {
914
+ return (__rb => {
915
+ try {
916
+ return _core.FfiConverterArrayBuffer.lift(__rb);
917
+ } finally {
918
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
919
+ }
920
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
921
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_method_transaction_cet_sighash(FfiConverterTypeTransaction.lower(self_, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(fundingScriptPubkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt64.lower(fundOutputValue, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
922
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
923
+ },
924
+ rawFundingInputSignature(self_, privkey, prevTxId, prevTxVout, value) {
925
+ return (__rb => {
926
+ try {
927
+ return _core.FfiConverterArrayBuffer.lift(__rb);
928
+ } finally {
929
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
930
+ }
931
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
932
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_method_transaction_raw_funding_input_signature(FfiConverterTypeTransaction.lower(self_, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(privkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterString.lower(prevTxId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt32.lower(prevTxVout, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt64.lower(value, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
933
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
934
+ },
935
+ signCet(self_, adaptorSignature, oracleSignatures, fundingSecretKey, otherPubkey, fundingScriptPubkey, fundOutputValue) {
936
+ return (__rb => {
937
+ try {
938
+ return FfiConverterTypeTransaction.lift(__rb);
939
+ } finally {
940
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
941
+ }
942
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
943
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_method_transaction_sign_cet(FfiConverterTypeTransaction.lower(self_, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(adaptorSignature, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceBytes.lower(oracleSignatures, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(fundingSecretKey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(otherPubkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(fundingScriptPubkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt64.lower(fundOutputValue, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
944
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
945
+ },
946
+ signFundInput(self_, privkey, prevTxId, prevTxVout, value) {
947
+ return (__rb => {
948
+ try {
949
+ return FfiConverterTypeTransaction.lift(__rb);
950
+ } finally {
951
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
952
+ }
953
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
954
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_method_transaction_sign_fund_input(FfiConverterTypeTransaction.lower(self_, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(privkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterString.lower(prevTxId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt32.lower(prevTxVout, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt64.lower(value, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
955
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
956
+ },
957
+ signMultiSigInput(self_, dlcInput, localPrivkey, remoteSignature) {
958
+ return (__rb => {
959
+ try {
960
+ return FfiConverterTypeTransaction.lift(__rb);
961
+ } finally {
962
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
963
+ }
964
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
965
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_method_transaction_sign_multi_sig_input(FfiConverterTypeTransaction.lower(self_, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterTypeDlcInputInfo.lower(dlcInput, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(localPrivkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(remoteSignature, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
966
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
967
+ },
968
+ verifyFundSignature(self_, signature, pubkey, txid, vout, inputAmount) {
969
+ return _core.FfiConverterBool.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
970
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_method_transaction_verify_fund_signature(FfiConverterTypeTransaction.lower(self_, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(signature, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(pubkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterString.lower(txid, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt32.lower(vout, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt64.lower(inputAmount, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
971
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
972
+ }
527
973
  });
528
974
  })();
529
- const FfiConverterTypeDlcTransactions = (() => {
530
- class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
975
+ const FfiConverterTypeTransaction = (() => {
976
+ class FFIConverter extends _core.AbstractFfiConverterByteArray {
531
977
  read(from) {
532
978
  return {
533
- fund: FfiConverterTypeTransaction.read(from),
534
- cets: FfiConverterArrayTypeTransaction.read(from),
535
- refund: FfiConverterTypeTransaction.read(from),
536
- fundingScriptPubkey: FfiConverterArrayUInt8.read(from)
979
+ version: _core.FfiConverterInt32.read(from),
980
+ lockTime: _core.FfiConverterUInt32.read(from),
981
+ inputs: FfiConverterSequenceTypeTxInput.read(from),
982
+ outputs: FfiConverterSequenceTypeTxOutput.read(from),
983
+ rawBytes: _core.FfiConverterArrayBuffer.read(from)
537
984
  };
538
985
  }
539
986
  write(value, into) {
540
- FfiConverterTypeTransaction.write(value.fund, into);
541
- FfiConverterArrayTypeTransaction.write(value.cets, into);
542
- FfiConverterTypeTransaction.write(value.refund, into);
543
- FfiConverterArrayUInt8.write(value.fundingScriptPubkey, into);
987
+ _core.FfiConverterInt32.write(value.version, into);
988
+ _core.FfiConverterUInt32.write(value.lockTime, into);
989
+ FfiConverterSequenceTypeTxInput.write(value.inputs, into);
990
+ FfiConverterSequenceTypeTxOutput.write(value.outputs, into);
991
+ _core.FfiConverterArrayBuffer.write(value.rawBytes, into);
544
992
  }
545
993
  allocationSize(value) {
546
- return FfiConverterTypeTransaction.allocationSize(value.fund) + FfiConverterArrayTypeTransaction.allocationSize(value.cets) + FfiConverterTypeTransaction.allocationSize(value.refund) + FfiConverterArrayUInt8.allocationSize(value.fundingScriptPubkey);
994
+ return _core.FfiConverterInt32.allocationSize(value.version) + _core.FfiConverterUInt32.allocationSize(value.lockTime) + FfiConverterSequenceTypeTxInput.allocationSize(value.inputs) + FfiConverterSequenceTypeTxOutput.allocationSize(value.outputs) + _core.FfiConverterArrayBuffer.allocationSize(value.rawBytes);
547
995
  }
548
996
  }
549
- ;
550
997
  return new FFIConverter();
551
998
  })();
552
999
  /**
553
- * Generated factory for {@link OracleInfo} record objects.
1000
+ * Generated factory for {@link DlcTransactions} record objects.
554
1001
  */
555
- const OracleInfo = exports.OracleInfo = (() => {
1002
+ const DlcTransactions = exports.DlcTransactions = (() => {
556
1003
  const defaults = () => ({});
557
1004
  const create = (() => {
558
- return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(defaults);
1005
+ return (0, _core.uniffiCreateRecord)(defaults);
559
1006
  })();
560
1007
  return Object.freeze({
561
- /**
562
- * Create a frozen instance of {@link OracleInfo}, with defaults specified
563
- * in Rust, in the {@link ddk_ffi} crate.
564
- */
565
1008
  create,
566
- /**
567
- * Create a frozen instance of {@link OracleInfo}, with defaults specified
568
- * in Rust, in the {@link ddk_ffi} crate.
569
- */
570
1009
  new: create,
571
- /**
572
- * Defaults specified in the {@link ddk_ffi} crate.
573
- */
574
1010
  defaults: () => Object.freeze(defaults())
575
1011
  });
576
1012
  })();
577
- const FfiConverterTypeOracleInfo = (() => {
578
- class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
1013
+ const FfiConverterTypeDlcTransactions = (() => {
1014
+ class FFIConverter extends _core.AbstractFfiConverterByteArray {
579
1015
  read(from) {
580
1016
  return {
581
- publicKey: FfiConverterArrayUInt8.read(from),
582
- nonces: FfiConverterArrayArrayUInt8.read(from)
1017
+ fund: FfiConverterTypeTransaction.read(from),
1018
+ cets: FfiConverterSequenceTypeTransaction.read(from),
1019
+ refund: FfiConverterTypeTransaction.read(from),
1020
+ fundingScriptPubkey: _core.FfiConverterArrayBuffer.read(from)
583
1021
  };
584
1022
  }
585
1023
  write(value, into) {
586
- FfiConverterArrayUInt8.write(value.publicKey, into);
587
- FfiConverterArrayArrayUInt8.write(value.nonces, into);
1024
+ FfiConverterTypeTransaction.write(value.fund, into);
1025
+ FfiConverterSequenceTypeTransaction.write(value.cets, into);
1026
+ FfiConverterTypeTransaction.write(value.refund, into);
1027
+ _core.FfiConverterArrayBuffer.write(value.fundingScriptPubkey, into);
588
1028
  }
589
1029
  allocationSize(value) {
590
- return FfiConverterArrayUInt8.allocationSize(value.publicKey) + FfiConverterArrayArrayUInt8.allocationSize(value.nonces);
1030
+ return FfiConverterTypeTransaction.allocationSize(value.fund) + FfiConverterSequenceTypeTransaction.allocationSize(value.cets) + FfiConverterTypeTransaction.allocationSize(value.refund) + _core.FfiConverterArrayBuffer.allocationSize(value.fundingScriptPubkey);
591
1031
  }
592
1032
  }
593
- ;
594
1033
  return new FFIConverter();
595
1034
  })();
1035
+
596
1036
  /**
597
- * Generated factory for {@link PartyParams} record objects.
1037
+ * The result of [`accept_offer`].
598
1038
  */
599
- const PartyParams = exports.PartyParams = (() => {
1039
+
1040
+ /**
1041
+ * Generated factory for {@link AcceptResult} record objects.
1042
+ */
1043
+ const AcceptResult = exports.AcceptResult = (() => {
600
1044
  const defaults = () => ({});
601
1045
  const create = (() => {
602
- return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(defaults);
1046
+ return (0, _core.uniffiCreateRecord)(defaults);
603
1047
  })();
604
1048
  return Object.freeze({
605
- /**
606
- * Create a frozen instance of {@link PartyParams}, with defaults specified
607
- * in Rust, in the {@link ddk_ffi} crate.
608
- */
609
1049
  create,
610
- /**
611
- * Create a frozen instance of {@link PartyParams}, with defaults specified
612
- * in Rust, in the {@link ddk_ffi} crate.
613
- */
614
1050
  new: create,
615
- /**
616
- * Defaults specified in the {@link ddk_ffi} crate.
617
- */
618
1051
  defaults: () => Object.freeze(defaults())
619
1052
  });
620
1053
  })();
621
- const FfiConverterTypePartyParams = (() => {
622
- class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
1054
+ const FfiConverterTypeAcceptResult = (() => {
1055
+ class FFIConverter extends _core.AbstractFfiConverterByteArray {
623
1056
  read(from) {
624
1057
  return {
625
- fundPubkey: FfiConverterArrayUInt8.read(from),
626
- changeScriptPubkey: FfiConverterArrayUInt8.read(from),
627
- changeSerialId: _uniffiBindgenReactNative.FfiConverterUInt64.read(from),
628
- payoutScriptPubkey: FfiConverterArrayUInt8.read(from),
629
- payoutSerialId: _uniffiBindgenReactNative.FfiConverterUInt64.read(from),
630
- inputs: FfiConverterArrayTypeTxInputInfo.read(from),
631
- inputAmount: _uniffiBindgenReactNative.FfiConverterUInt64.read(from),
632
- collateral: _uniffiBindgenReactNative.FfiConverterUInt64.read(from),
633
- dlcInputs: FfiConverterArrayTypeDlcInputInfo.read(from)
1058
+ accept: _core.FfiConverterArrayBuffer.read(from),
1059
+ transactions: FfiConverterTypeDlcTransactions.read(from),
1060
+ fundingPsbt: _core.FfiConverterArrayBuffer.read(from)
634
1061
  };
635
1062
  }
636
1063
  write(value, into) {
637
- FfiConverterArrayUInt8.write(value.fundPubkey, into);
638
- FfiConverterArrayUInt8.write(value.changeScriptPubkey, into);
639
- _uniffiBindgenReactNative.FfiConverterUInt64.write(value.changeSerialId, into);
640
- FfiConverterArrayUInt8.write(value.payoutScriptPubkey, into);
641
- _uniffiBindgenReactNative.FfiConverterUInt64.write(value.payoutSerialId, into);
642
- FfiConverterArrayTypeTxInputInfo.write(value.inputs, into);
643
- _uniffiBindgenReactNative.FfiConverterUInt64.write(value.inputAmount, into);
644
- _uniffiBindgenReactNative.FfiConverterUInt64.write(value.collateral, into);
645
- FfiConverterArrayTypeDlcInputInfo.write(value.dlcInputs, into);
1064
+ _core.FfiConverterArrayBuffer.write(value.accept, into);
1065
+ FfiConverterTypeDlcTransactions.write(value.transactions, into);
1066
+ _core.FfiConverterArrayBuffer.write(value.fundingPsbt, into);
646
1067
  }
647
1068
  allocationSize(value) {
648
- return FfiConverterArrayUInt8.allocationSize(value.fundPubkey) + FfiConverterArrayUInt8.allocationSize(value.changeScriptPubkey) + _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.changeSerialId) + FfiConverterArrayUInt8.allocationSize(value.payoutScriptPubkey) + _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.payoutSerialId) + FfiConverterArrayTypeTxInputInfo.allocationSize(value.inputs) + _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.inputAmount) + _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.collateral) + FfiConverterArrayTypeDlcInputInfo.allocationSize(value.dlcInputs);
1069
+ return _core.FfiConverterArrayBuffer.allocationSize(value.accept) + FfiConverterTypeDlcTransactions.allocationSize(value.transactions) + _core.FfiConverterArrayBuffer.allocationSize(value.fundingPsbt);
649
1070
  }
650
1071
  }
651
- ;
652
1072
  return new FFIConverter();
653
1073
  })();
654
1074
  /**
655
- * Generated factory for {@link Payout} record objects.
1075
+ * Generated factory for {@link AdaptorSignature} record objects.
656
1076
  */
657
- const Payout = exports.Payout = (() => {
1077
+ const AdaptorSignature = exports.AdaptorSignature = (() => {
658
1078
  const defaults = () => ({});
659
1079
  const create = (() => {
660
- return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(defaults);
1080
+ return (0, _core.uniffiCreateRecord)(defaults);
661
1081
  })();
662
1082
  return Object.freeze({
663
- /**
664
- * Create a frozen instance of {@link Payout}, with defaults specified
665
- * in Rust, in the {@link ddk_ffi} crate.
666
- */
667
1083
  create,
668
- /**
669
- * Create a frozen instance of {@link Payout}, with defaults specified
670
- * in Rust, in the {@link ddk_ffi} crate.
671
- */
672
1084
  new: create,
673
- /**
674
- * Defaults specified in the {@link ddk_ffi} crate.
675
- */
676
- defaults: () => Object.freeze(defaults())
1085
+ defaults: () => Object.freeze(defaults()),
1086
+ verifyFromOracleInfo(self_, cet, oracleInfos, pubkey, fundingScriptPubkey, totalCollateral, msgs) {
1087
+ return _core.FfiConverterBool.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
1088
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_method_adaptorsignature_verify_from_oracle_info(FfiConverterTypeAdaptorSignature.lower(self_, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterTypeTransaction.lower(cet, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceTypeOracleInfo.lower(oracleInfos, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(pubkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(fundingScriptPubkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt64.lower(totalCollateral, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceSequenceBytes.lower(msgs, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
1089
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
1090
+ }
677
1091
  });
678
1092
  })();
679
- const FfiConverterTypePayout = (() => {
680
- class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
1093
+ const FfiConverterTypeAdaptorSignature = (() => {
1094
+ class FFIConverter extends _core.AbstractFfiConverterByteArray {
681
1095
  read(from) {
682
1096
  return {
683
- offer: _uniffiBindgenReactNative.FfiConverterUInt64.read(from),
684
- accept: _uniffiBindgenReactNative.FfiConverterUInt64.read(from)
1097
+ signature: _core.FfiConverterArrayBuffer.read(from),
1098
+ proof: _core.FfiConverterArrayBuffer.read(from)
685
1099
  };
686
1100
  }
687
1101
  write(value, into) {
688
- _uniffiBindgenReactNative.FfiConverterUInt64.write(value.offer, into);
689
- _uniffiBindgenReactNative.FfiConverterUInt64.write(value.accept, into);
1102
+ _core.FfiConverterArrayBuffer.write(value.signature, into);
1103
+ _core.FfiConverterArrayBuffer.write(value.proof, into);
690
1104
  }
691
1105
  allocationSize(value) {
692
- return _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.offer) + _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.accept);
1106
+ return _core.FfiConverterArrayBuffer.allocationSize(value.signature) + _core.FfiConverterArrayBuffer.allocationSize(value.proof);
693
1107
  }
694
1108
  }
695
- ;
696
1109
  return new FFIConverter();
697
1110
  })();
1111
+
698
1112
  /**
699
- * Generated factory for {@link Transaction} record objects.
1113
+ * Debug info for CET adaptor signature inputs.
1114
+ *
1115
+ * Contains all the values that go into creating an adaptor signature,
1116
+ * useful for comparing with external signers during debugging.
1117
+ *
1118
+ * This struct is intentionally always available (not feature-gated)
1119
+ * to support production debugging scenarios.
700
1120
  */
701
- const Transaction = exports.Transaction = (() => {
1121
+
1122
+ /**
1123
+ * Generated factory for {@link CetAdaptorSignatureDebugInfo} record objects.
1124
+ */
1125
+ const CetAdaptorSignatureDebugInfo = exports.CetAdaptorSignatureDebugInfo = (() => {
702
1126
  const defaults = () => ({});
703
1127
  const create = (() => {
704
- return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(defaults);
1128
+ return (0, _core.uniffiCreateRecord)(defaults);
705
1129
  })();
706
1130
  return Object.freeze({
707
- /**
708
- * Create a frozen instance of {@link Transaction}, with defaults specified
709
- * in Rust, in the {@link ddk_ffi} crate.
710
- */
711
1131
  create,
712
- /**
713
- * Create a frozen instance of {@link Transaction}, with defaults specified
714
- * in Rust, in the {@link ddk_ffi} crate.
715
- */
716
1132
  new: create,
717
- /**
718
- * Defaults specified in the {@link ddk_ffi} crate.
719
- */
720
1133
  defaults: () => Object.freeze(defaults())
721
1134
  });
722
1135
  })();
723
- const FfiConverterTypeTransaction = (() => {
724
- class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
1136
+ const FfiConverterTypeCetAdaptorSignatureDebugInfo = (() => {
1137
+ class FFIConverter extends _core.AbstractFfiConverterByteArray {
725
1138
  read(from) {
726
1139
  return {
727
- version: _uniffiBindgenReactNative.FfiConverterInt32.read(from),
728
- lockTime: _uniffiBindgenReactNative.FfiConverterUInt32.read(from),
729
- inputs: FfiConverterArrayTypeTxInput.read(from),
730
- outputs: FfiConverterArrayTypeTxOutput.read(from),
731
- rawBytes: FfiConverterArrayUInt8.read(from)
1140
+ sighash: _core.FfiConverterArrayBuffer.read(from),
1141
+ adaptorPoint: _core.FfiConverterArrayBuffer.read(from),
1142
+ inputIndex: _core.FfiConverterUInt32.read(from),
1143
+ scriptPubkey: _core.FfiConverterArrayBuffer.read(from),
1144
+ value: _core.FfiConverterUInt64.read(from),
1145
+ cetTxid: FfiConverterString.read(from),
1146
+ cetRaw: _core.FfiConverterArrayBuffer.read(from)
732
1147
  };
733
1148
  }
734
1149
  write(value, into) {
735
- _uniffiBindgenReactNative.FfiConverterInt32.write(value.version, into);
736
- _uniffiBindgenReactNative.FfiConverterUInt32.write(value.lockTime, into);
737
- FfiConverterArrayTypeTxInput.write(value.inputs, into);
738
- FfiConverterArrayTypeTxOutput.write(value.outputs, into);
739
- FfiConverterArrayUInt8.write(value.rawBytes, into);
1150
+ _core.FfiConverterArrayBuffer.write(value.sighash, into);
1151
+ _core.FfiConverterArrayBuffer.write(value.adaptorPoint, into);
1152
+ _core.FfiConverterUInt32.write(value.inputIndex, into);
1153
+ _core.FfiConverterArrayBuffer.write(value.scriptPubkey, into);
1154
+ _core.FfiConverterUInt64.write(value.value, into);
1155
+ FfiConverterString.write(value.cetTxid, into);
1156
+ _core.FfiConverterArrayBuffer.write(value.cetRaw, into);
740
1157
  }
741
1158
  allocationSize(value) {
742
- return _uniffiBindgenReactNative.FfiConverterInt32.allocationSize(value.version) + _uniffiBindgenReactNative.FfiConverterUInt32.allocationSize(value.lockTime) + FfiConverterArrayTypeTxInput.allocationSize(value.inputs) + FfiConverterArrayTypeTxOutput.allocationSize(value.outputs) + FfiConverterArrayUInt8.allocationSize(value.rawBytes);
1159
+ return _core.FfiConverterArrayBuffer.allocationSize(value.sighash) + _core.FfiConverterArrayBuffer.allocationSize(value.adaptorPoint) + _core.FfiConverterUInt32.allocationSize(value.inputIndex) + _core.FfiConverterArrayBuffer.allocationSize(value.scriptPubkey) + _core.FfiConverterUInt64.allocationSize(value.value) + FfiConverterString.allocationSize(value.cetTxid) + _core.FfiConverterArrayBuffer.allocationSize(value.cetRaw);
743
1160
  }
744
1161
  }
745
- ;
746
1162
  return new FFIConverter();
747
1163
  })();
748
1164
  /**
749
- * Generated factory for {@link TxInput} record objects.
1165
+ * Generated factory for {@link ChangeOutputAndFees} record objects.
750
1166
  */
751
- const TxInput = exports.TxInput = (() => {
1167
+ const ChangeOutputAndFees = exports.ChangeOutputAndFees = (() => {
752
1168
  const defaults = () => ({});
753
1169
  const create = (() => {
754
- return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(defaults);
1170
+ return (0, _core.uniffiCreateRecord)(defaults);
755
1171
  })();
756
1172
  return Object.freeze({
757
- /**
758
- * Create a frozen instance of {@link TxInput}, with defaults specified
759
- * in Rust, in the {@link ddk_ffi} crate.
760
- */
761
1173
  create,
762
- /**
763
- * Create a frozen instance of {@link TxInput}, with defaults specified
764
- * in Rust, in the {@link ddk_ffi} crate.
765
- */
766
1174
  new: create,
767
- /**
768
- * Defaults specified in the {@link ddk_ffi} crate.
769
- */
770
1175
  defaults: () => Object.freeze(defaults())
771
1176
  });
772
1177
  })();
773
- const FfiConverterTypeTxInput = (() => {
774
- class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
1178
+ const FfiConverterTypeChangeOutputAndFees = (() => {
1179
+ class FFIConverter extends _core.AbstractFfiConverterByteArray {
1180
+ read(from) {
1181
+ return {
1182
+ changeOutput: FfiConverterTypeTxOutput.read(from),
1183
+ fundFee: _core.FfiConverterUInt64.read(from),
1184
+ cetFee: _core.FfiConverterUInt64.read(from)
1185
+ };
1186
+ }
1187
+ write(value, into) {
1188
+ FfiConverterTypeTxOutput.write(value.changeOutput, into);
1189
+ _core.FfiConverterUInt64.write(value.fundFee, into);
1190
+ _core.FfiConverterUInt64.write(value.cetFee, into);
1191
+ }
1192
+ allocationSize(value) {
1193
+ return FfiConverterTypeTxOutput.allocationSize(value.changeOutput) + _core.FfiConverterUInt64.allocationSize(value.fundFee) + _core.FfiConverterUInt64.allocationSize(value.cetFee);
1194
+ }
1195
+ }
1196
+ return new FFIConverter();
1197
+ })();
1198
+
1199
+ /**
1200
+ * One row of a contract's payout table.
1201
+ *
1202
+ * Enum-contract rows carry an `outcome` label; numeric-contract rows carry an
1203
+ * inclusive `[range_start, range_end]` of outcome values that share the payout.
1204
+ */
1205
+
1206
+ /**
1207
+ * Generated factory for {@link PayoutRow} record objects.
1208
+ */
1209
+ const PayoutRow = exports.PayoutRow = (() => {
1210
+ const defaults = () => ({});
1211
+ const create = (() => {
1212
+ return (0, _core.uniffiCreateRecord)(defaults);
1213
+ })();
1214
+ return Object.freeze({
1215
+ create,
1216
+ new: create,
1217
+ defaults: () => Object.freeze(defaults())
1218
+ });
1219
+ })();
1220
+ const FfiConverterTypePayoutRow = (() => {
1221
+ class FFIConverter extends _core.AbstractFfiConverterByteArray {
1222
+ read(from) {
1223
+ return {
1224
+ outcome: FfiConverterOptionalString.read(from),
1225
+ rangeStart: FfiConverterOptionalUInt64.read(from),
1226
+ rangeEnd: FfiConverterOptionalUInt64.read(from),
1227
+ offerPayoutSats: _core.FfiConverterUInt64.read(from),
1228
+ acceptPayoutSats: _core.FfiConverterUInt64.read(from)
1229
+ };
1230
+ }
1231
+ write(value, into) {
1232
+ FfiConverterOptionalString.write(value.outcome, into);
1233
+ FfiConverterOptionalUInt64.write(value.rangeStart, into);
1234
+ FfiConverterOptionalUInt64.write(value.rangeEnd, into);
1235
+ _core.FfiConverterUInt64.write(value.offerPayoutSats, into);
1236
+ _core.FfiConverterUInt64.write(value.acceptPayoutSats, into);
1237
+ }
1238
+ allocationSize(value) {
1239
+ return FfiConverterOptionalString.allocationSize(value.outcome) + FfiConverterOptionalUInt64.allocationSize(value.rangeStart) + FfiConverterOptionalUInt64.allocationSize(value.rangeEnd) + _core.FfiConverterUInt64.allocationSize(value.offerPayoutSats) + _core.FfiConverterUInt64.allocationSize(value.acceptPayoutSats);
1240
+ }
1241
+ }
1242
+ return new FFIConverter();
1243
+ })();
1244
+
1245
+ /**
1246
+ * A contract's payouts, derived from its `ContractInfo`, for display as a table.
1247
+ */
1248
+
1249
+ /**
1250
+ * Generated factory for {@link ContractPayouts} record objects.
1251
+ */
1252
+ const ContractPayouts = exports.ContractPayouts = (() => {
1253
+ const defaults = () => ({});
1254
+ const create = (() => {
1255
+ return (0, _core.uniffiCreateRecord)(defaults);
1256
+ })();
1257
+ return Object.freeze({
1258
+ create,
1259
+ new: create,
1260
+ defaults: () => Object.freeze(defaults())
1261
+ });
1262
+ })();
1263
+ const FfiConverterTypeContractPayouts = (() => {
1264
+ class FFIConverter extends _core.AbstractFfiConverterByteArray {
1265
+ read(from) {
1266
+ return {
1267
+ totalCollateralSats: _core.FfiConverterUInt64.read(from),
1268
+ isEnum: _core.FfiConverterBool.read(from),
1269
+ rows: FfiConverterSequenceTypePayoutRow.read(from)
1270
+ };
1271
+ }
1272
+ write(value, into) {
1273
+ _core.FfiConverterUInt64.write(value.totalCollateralSats, into);
1274
+ _core.FfiConverterBool.write(value.isEnum, into);
1275
+ FfiConverterSequenceTypePayoutRow.write(value.rows, into);
1276
+ }
1277
+ allocationSize(value) {
1278
+ return _core.FfiConverterUInt64.allocationSize(value.totalCollateralSats) + _core.FfiConverterBool.allocationSize(value.isEnum) + FfiConverterSequenceTypePayoutRow.allocationSize(value.rows);
1279
+ }
1280
+ }
1281
+ return new FFIConverter();
1282
+ })();
1283
+
1284
+ /**
1285
+ * Parameters for [`create_offer`] (mirrors [`ddk::contract::CreateOfferParams`]).
1286
+ */
1287
+
1288
+ /**
1289
+ * Generated factory for {@link CreateOfferParams} record objects.
1290
+ */
1291
+ const CreateOfferParams = exports.CreateOfferParams = (() => {
1292
+ const defaults = () => ({});
1293
+ const create = (() => {
1294
+ return (0, _core.uniffiCreateRecord)(defaults);
1295
+ })();
1296
+ return Object.freeze({
1297
+ create,
1298
+ new: create,
1299
+ defaults: () => Object.freeze(defaults())
1300
+ });
1301
+ })();
1302
+ const FfiConverterTypeCreateOfferParams = (() => {
1303
+ class FFIConverter extends _core.AbstractFfiConverterByteArray {
1304
+ read(from) {
1305
+ return {
1306
+ chainHash: _core.FfiConverterArrayBuffer.read(from),
1307
+ temporaryContractId: FfiConverterOptionalBytes.read(from),
1308
+ contractInfo: _core.FfiConverterArrayBuffer.read(from),
1309
+ offerCollateralSats: _core.FfiConverterUInt64.read(from),
1310
+ party: FfiConverterTypeContractPartyParams.read(from),
1311
+ fundOutputSerialId: FfiConverterOptionalUInt64.read(from),
1312
+ feeRatePerVb: _core.FfiConverterUInt64.read(from),
1313
+ cetLocktime: _core.FfiConverterUInt32.read(from),
1314
+ refundLocktime: _core.FfiConverterUInt32.read(from),
1315
+ contractFlags: _core.FfiConverterUInt8.read(from)
1316
+ };
1317
+ }
1318
+ write(value, into) {
1319
+ _core.FfiConverterArrayBuffer.write(value.chainHash, into);
1320
+ FfiConverterOptionalBytes.write(value.temporaryContractId, into);
1321
+ _core.FfiConverterArrayBuffer.write(value.contractInfo, into);
1322
+ _core.FfiConverterUInt64.write(value.offerCollateralSats, into);
1323
+ FfiConverterTypeContractPartyParams.write(value.party, into);
1324
+ FfiConverterOptionalUInt64.write(value.fundOutputSerialId, into);
1325
+ _core.FfiConverterUInt64.write(value.feeRatePerVb, into);
1326
+ _core.FfiConverterUInt32.write(value.cetLocktime, into);
1327
+ _core.FfiConverterUInt32.write(value.refundLocktime, into);
1328
+ _core.FfiConverterUInt8.write(value.contractFlags, into);
1329
+ }
1330
+ allocationSize(value) {
1331
+ return _core.FfiConverterArrayBuffer.allocationSize(value.chainHash) + FfiConverterOptionalBytes.allocationSize(value.temporaryContractId) + _core.FfiConverterArrayBuffer.allocationSize(value.contractInfo) + _core.FfiConverterUInt64.allocationSize(value.offerCollateralSats) + FfiConverterTypeContractPartyParams.allocationSize(value.party) + FfiConverterOptionalUInt64.allocationSize(value.fundOutputSerialId) + _core.FfiConverterUInt64.allocationSize(value.feeRatePerVb) + _core.FfiConverterUInt32.allocationSize(value.cetLocktime) + _core.FfiConverterUInt32.allocationSize(value.refundLocktime) + _core.FfiConverterUInt8.allocationSize(value.contractFlags);
1332
+ }
1333
+ }
1334
+ return new FFIConverter();
1335
+ })();
1336
+
1337
+ /**
1338
+ * Identifies a funding input and the descriptor wildcard index that derives its
1339
+ * key, for [`sign_funding_psbt_with_descriptor`].
1340
+ */
1341
+
1342
+ /**
1343
+ * Generated factory for {@link DescriptorInput} record objects.
1344
+ */
1345
+ const DescriptorInput = exports.DescriptorInput = (() => {
1346
+ const defaults = () => ({});
1347
+ const create = (() => {
1348
+ return (0, _core.uniffiCreateRecord)(defaults);
1349
+ })();
1350
+ return Object.freeze({
1351
+ create,
1352
+ new: create,
1353
+ defaults: () => Object.freeze(defaults())
1354
+ });
1355
+ })();
1356
+ const FfiConverterTypeDescriptorInput = (() => {
1357
+ class FFIConverter extends _core.AbstractFfiConverterByteArray {
1358
+ read(from) {
1359
+ return {
1360
+ inputSerialId: _core.FfiConverterUInt64.read(from),
1361
+ derivationIndex: _core.FfiConverterUInt32.read(from)
1362
+ };
1363
+ }
1364
+ write(value, into) {
1365
+ _core.FfiConverterUInt64.write(value.inputSerialId, into);
1366
+ _core.FfiConverterUInt32.write(value.derivationIndex, into);
1367
+ }
1368
+ allocationSize(value) {
1369
+ return _core.FfiConverterUInt64.allocationSize(value.inputSerialId) + _core.FfiConverterUInt32.allocationSize(value.derivationIndex);
1370
+ }
1371
+ }
1372
+ return new FFIConverter();
1373
+ })();
1374
+ /**
1375
+ * Generated factory for {@link DlcInputInfo} record objects.
1376
+ */
1377
+ const DlcInputInfo = exports.DlcInputInfo = (() => {
1378
+ const defaults = () => ({});
1379
+ const create = (() => {
1380
+ return (0, _core.uniffiCreateRecord)(defaults);
1381
+ })();
1382
+ return Object.freeze({
1383
+ create,
1384
+ new: create,
1385
+ defaults: () => Object.freeze(defaults())
1386
+ });
1387
+ })();
1388
+ const FfiConverterTypeDlcInputInfo = (() => {
1389
+ class FFIConverter extends _core.AbstractFfiConverterByteArray {
1390
+ read(from) {
1391
+ return {
1392
+ fundTx: FfiConverterTypeTransaction.read(from),
1393
+ fundVout: _core.FfiConverterUInt32.read(from),
1394
+ localFundPubkey: _core.FfiConverterArrayBuffer.read(from),
1395
+ remoteFundPubkey: _core.FfiConverterArrayBuffer.read(from),
1396
+ fundAmount: _core.FfiConverterUInt64.read(from),
1397
+ maxWitnessLen: _core.FfiConverterUInt32.read(from),
1398
+ inputSerialId: _core.FfiConverterUInt64.read(from),
1399
+ contractId: _core.FfiConverterArrayBuffer.read(from)
1400
+ };
1401
+ }
1402
+ write(value, into) {
1403
+ FfiConverterTypeTransaction.write(value.fundTx, into);
1404
+ _core.FfiConverterUInt32.write(value.fundVout, into);
1405
+ _core.FfiConverterArrayBuffer.write(value.localFundPubkey, into);
1406
+ _core.FfiConverterArrayBuffer.write(value.remoteFundPubkey, into);
1407
+ _core.FfiConverterUInt64.write(value.fundAmount, into);
1408
+ _core.FfiConverterUInt32.write(value.maxWitnessLen, into);
1409
+ _core.FfiConverterUInt64.write(value.inputSerialId, into);
1410
+ _core.FfiConverterArrayBuffer.write(value.contractId, into);
1411
+ }
1412
+ allocationSize(value) {
1413
+ return FfiConverterTypeTransaction.allocationSize(value.fundTx) + _core.FfiConverterUInt32.allocationSize(value.fundVout) + _core.FfiConverterArrayBuffer.allocationSize(value.localFundPubkey) + _core.FfiConverterArrayBuffer.allocationSize(value.remoteFundPubkey) + _core.FfiConverterUInt64.allocationSize(value.fundAmount) + _core.FfiConverterUInt32.allocationSize(value.maxWitnessLen) + _core.FfiConverterUInt64.allocationSize(value.inputSerialId) + _core.FfiConverterArrayBuffer.allocationSize(value.contractId);
1414
+ }
1415
+ }
1416
+ return new FFIConverter();
1417
+ })();
1418
+
1419
+ /**
1420
+ * An oracle attestation paired with the position of the oracle that produced it
1421
+ * in the contract's announcements, for [`sign_contract_cet`].
1422
+ */
1423
+
1424
+ /**
1425
+ * Generated factory for {@link OracleAttestationRef} record objects.
1426
+ */
1427
+ const OracleAttestationRef = exports.OracleAttestationRef = (() => {
1428
+ const defaults = () => ({});
1429
+ const create = (() => {
1430
+ return (0, _core.uniffiCreateRecord)(defaults);
1431
+ })();
1432
+ return Object.freeze({
1433
+ create,
1434
+ new: create,
1435
+ defaults: () => Object.freeze(defaults())
1436
+ });
1437
+ })();
1438
+ const FfiConverterTypeOracleAttestationRef = (() => {
1439
+ class FFIConverter extends _core.AbstractFfiConverterByteArray {
1440
+ read(from) {
1441
+ return {
1442
+ oracleIndex: _core.FfiConverterUInt32.read(from),
1443
+ attestation: _core.FfiConverterArrayBuffer.read(from)
1444
+ };
1445
+ }
1446
+ write(value, into) {
1447
+ _core.FfiConverterUInt32.write(value.oracleIndex, into);
1448
+ _core.FfiConverterArrayBuffer.write(value.attestation, into);
1449
+ }
1450
+ allocationSize(value) {
1451
+ return _core.FfiConverterUInt32.allocationSize(value.oracleIndex) + _core.FfiConverterArrayBuffer.allocationSize(value.attestation);
1452
+ }
1453
+ }
1454
+ return new FFIConverter();
1455
+ })();
1456
+ /**
1457
+ * Generated factory for {@link OracleInfo} record objects.
1458
+ */
1459
+ const OracleInfo = exports.OracleInfo = (() => {
1460
+ const defaults = () => ({});
1461
+ const create = (() => {
1462
+ return (0, _core.uniffiCreateRecord)(defaults);
1463
+ })();
1464
+ return Object.freeze({
1465
+ create,
1466
+ new: create,
1467
+ defaults: () => Object.freeze(defaults())
1468
+ });
1469
+ })();
1470
+ const FfiConverterTypeOracleInfo = (() => {
1471
+ class FFIConverter extends _core.AbstractFfiConverterByteArray {
1472
+ read(from) {
1473
+ return {
1474
+ publicKey: _core.FfiConverterArrayBuffer.read(from),
1475
+ nonces: FfiConverterSequenceBytes.read(from)
1476
+ };
1477
+ }
1478
+ write(value, into) {
1479
+ _core.FfiConverterArrayBuffer.write(value.publicKey, into);
1480
+ FfiConverterSequenceBytes.write(value.nonces, into);
1481
+ }
1482
+ allocationSize(value) {
1483
+ return _core.FfiConverterArrayBuffer.allocationSize(value.publicKey) + FfiConverterSequenceBytes.allocationSize(value.nonces);
1484
+ }
1485
+ }
1486
+ return new FFIConverter();
1487
+ })();
1488
+ /**
1489
+ * Generated factory for {@link TxInputInfo} record objects.
1490
+ */
1491
+ const TxInputInfo = exports.TxInputInfo = (() => {
1492
+ const defaults = () => ({});
1493
+ const create = (() => {
1494
+ return (0, _core.uniffiCreateRecord)(defaults);
1495
+ })();
1496
+ return Object.freeze({
1497
+ create,
1498
+ new: create,
1499
+ defaults: () => Object.freeze(defaults())
1500
+ });
1501
+ })();
1502
+ const FfiConverterTypeTxInputInfo = (() => {
1503
+ class FFIConverter extends _core.AbstractFfiConverterByteArray {
775
1504
  read(from) {
776
1505
  return {
777
1506
  txid: FfiConverterString.read(from),
778
- vout: _uniffiBindgenReactNative.FfiConverterUInt32.read(from),
779
- scriptSig: FfiConverterArrayUInt8.read(from),
780
- sequence: _uniffiBindgenReactNative.FfiConverterUInt32.read(from),
781
- witness: FfiConverterArrayArrayUInt8.read(from)
1507
+ vout: _core.FfiConverterUInt32.read(from),
1508
+ scriptSig: _core.FfiConverterArrayBuffer.read(from),
1509
+ maxWitnessLength: _core.FfiConverterUInt32.read(from),
1510
+ serialId: _core.FfiConverterUInt64.read(from)
782
1511
  };
783
1512
  }
784
- write(value, into) {
785
- FfiConverterString.write(value.txid, into);
786
- _uniffiBindgenReactNative.FfiConverterUInt32.write(value.vout, into);
787
- FfiConverterArrayUInt8.write(value.scriptSig, into);
788
- _uniffiBindgenReactNative.FfiConverterUInt32.write(value.sequence, into);
789
- FfiConverterArrayArrayUInt8.write(value.witness, into);
1513
+ write(value, into) {
1514
+ FfiConverterString.write(value.txid, into);
1515
+ _core.FfiConverterUInt32.write(value.vout, into);
1516
+ _core.FfiConverterArrayBuffer.write(value.scriptSig, into);
1517
+ _core.FfiConverterUInt32.write(value.maxWitnessLength, into);
1518
+ _core.FfiConverterUInt64.write(value.serialId, into);
1519
+ }
1520
+ allocationSize(value) {
1521
+ return FfiConverterString.allocationSize(value.txid) + _core.FfiConverterUInt32.allocationSize(value.vout) + _core.FfiConverterArrayBuffer.allocationSize(value.scriptSig) + _core.FfiConverterUInt32.allocationSize(value.maxWitnessLength) + _core.FfiConverterUInt64.allocationSize(value.serialId);
1522
+ }
1523
+ }
1524
+ return new FFIConverter();
1525
+ })();
1526
+ /**
1527
+ * Generated factory for {@link PartyParams} record objects.
1528
+ */
1529
+ const PartyParams = exports.PartyParams = (() => {
1530
+ const defaults = () => ({});
1531
+ const create = (() => {
1532
+ return (0, _core.uniffiCreateRecord)(defaults);
1533
+ })();
1534
+ return Object.freeze({
1535
+ create,
1536
+ new: create,
1537
+ defaults: () => Object.freeze(defaults()),
1538
+ changeOutputAndFees(self_, feeRate) {
1539
+ return (__rb => {
1540
+ try {
1541
+ return FfiConverterTypeChangeOutputAndFees.lift(__rb);
1542
+ } finally {
1543
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
1544
+ }
1545
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
1546
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_method_partyparams_change_output_and_fees(FfiConverterTypePartyParams.lower(self_, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt64.lower(feeRate, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
1547
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
1548
+ }
1549
+ });
1550
+ })();
1551
+ const FfiConverterTypePartyParams = (() => {
1552
+ class FFIConverter extends _core.AbstractFfiConverterByteArray {
1553
+ read(from) {
1554
+ return {
1555
+ fundPubkey: _core.FfiConverterArrayBuffer.read(from),
1556
+ changeScriptPubkey: _core.FfiConverterArrayBuffer.read(from),
1557
+ changeSerialId: _core.FfiConverterUInt64.read(from),
1558
+ payoutScriptPubkey: _core.FfiConverterArrayBuffer.read(from),
1559
+ payoutSerialId: _core.FfiConverterUInt64.read(from),
1560
+ inputs: FfiConverterSequenceTypeTxInputInfo.read(from),
1561
+ inputAmount: _core.FfiConverterUInt64.read(from),
1562
+ collateral: _core.FfiConverterUInt64.read(from),
1563
+ dlcInputs: FfiConverterSequenceTypeDlcInputInfo.read(from)
1564
+ };
1565
+ }
1566
+ write(value, into) {
1567
+ _core.FfiConverterArrayBuffer.write(value.fundPubkey, into);
1568
+ _core.FfiConverterArrayBuffer.write(value.changeScriptPubkey, into);
1569
+ _core.FfiConverterUInt64.write(value.changeSerialId, into);
1570
+ _core.FfiConverterArrayBuffer.write(value.payoutScriptPubkey, into);
1571
+ _core.FfiConverterUInt64.write(value.payoutSerialId, into);
1572
+ FfiConverterSequenceTypeTxInputInfo.write(value.inputs, into);
1573
+ _core.FfiConverterUInt64.write(value.inputAmount, into);
1574
+ _core.FfiConverterUInt64.write(value.collateral, into);
1575
+ FfiConverterSequenceTypeDlcInputInfo.write(value.dlcInputs, into);
1576
+ }
1577
+ allocationSize(value) {
1578
+ return _core.FfiConverterArrayBuffer.allocationSize(value.fundPubkey) + _core.FfiConverterArrayBuffer.allocationSize(value.changeScriptPubkey) + _core.FfiConverterUInt64.allocationSize(value.changeSerialId) + _core.FfiConverterArrayBuffer.allocationSize(value.payoutScriptPubkey) + _core.FfiConverterUInt64.allocationSize(value.payoutSerialId) + FfiConverterSequenceTypeTxInputInfo.allocationSize(value.inputs) + _core.FfiConverterUInt64.allocationSize(value.inputAmount) + _core.FfiConverterUInt64.allocationSize(value.collateral) + FfiConverterSequenceTypeDlcInputInfo.allocationSize(value.dlcInputs);
1579
+ }
1580
+ }
1581
+ return new FFIConverter();
1582
+ })();
1583
+ /**
1584
+ * Generated factory for {@link Payout} record objects.
1585
+ */
1586
+ const Payout = exports.Payout = (() => {
1587
+ const defaults = () => ({});
1588
+ const create = (() => {
1589
+ return (0, _core.uniffiCreateRecord)(defaults);
1590
+ })();
1591
+ return Object.freeze({
1592
+ create,
1593
+ new: create,
1594
+ defaults: () => Object.freeze(defaults())
1595
+ });
1596
+ })();
1597
+ const FfiConverterTypePayout = (() => {
1598
+ class FFIConverter extends _core.AbstractFfiConverterByteArray {
1599
+ read(from) {
1600
+ return {
1601
+ offer: _core.FfiConverterUInt64.read(from),
1602
+ accept: _core.FfiConverterUInt64.read(from)
1603
+ };
1604
+ }
1605
+ write(value, into) {
1606
+ _core.FfiConverterUInt64.write(value.offer, into);
1607
+ _core.FfiConverterUInt64.write(value.accept, into);
1608
+ }
1609
+ allocationSize(value) {
1610
+ return _core.FfiConverterUInt64.allocationSize(value.offer) + _core.FfiConverterUInt64.allocationSize(value.accept);
1611
+ }
1612
+ }
1613
+ return new FFIConverter();
1614
+ })();
1615
+
1616
+ /**
1617
+ * The result of [`sign_accept`] / [`sign_accept_spliced`].
1618
+ */
1619
+
1620
+ /**
1621
+ * Generated factory for {@link SignResult} record objects.
1622
+ */
1623
+ const SignResult = exports.SignResult = (() => {
1624
+ const defaults = () => ({});
1625
+ const create = (() => {
1626
+ return (0, _core.uniffiCreateRecord)(defaults);
1627
+ })();
1628
+ return Object.freeze({
1629
+ create,
1630
+ new: create,
1631
+ defaults: () => Object.freeze(defaults())
1632
+ });
1633
+ })();
1634
+ const FfiConverterTypeSignResult = (() => {
1635
+ class FFIConverter extends _core.AbstractFfiConverterByteArray {
1636
+ read(from) {
1637
+ return {
1638
+ sign: _core.FfiConverterArrayBuffer.read(from),
1639
+ transactions: FfiConverterTypeDlcTransactions.read(from)
1640
+ };
1641
+ }
1642
+ write(value, into) {
1643
+ _core.FfiConverterArrayBuffer.write(value.sign, into);
1644
+ FfiConverterTypeDlcTransactions.write(value.transactions, into);
1645
+ }
1646
+ allocationSize(value) {
1647
+ return _core.FfiConverterArrayBuffer.allocationSize(value.sign) + FfiConverterTypeDlcTransactions.allocationSize(value.transactions);
1648
+ }
1649
+ }
1650
+ return new FFIConverter();
1651
+ })();
1652
+
1653
+ /**
1654
+ * References a splice (DLC) funding input and the previous contract whose
1655
+ * 2-of-2 output it spends, so the provider can re-derive the signing key.
1656
+ */
1657
+
1658
+ /**
1659
+ * Generated factory for {@link SpliceKeyRef} record objects.
1660
+ */
1661
+ const SpliceKeyRef = exports.SpliceKeyRef = (() => {
1662
+ const defaults = () => ({});
1663
+ const create = (() => {
1664
+ return (0, _core.uniffiCreateRecord)(defaults);
1665
+ })();
1666
+ return Object.freeze({
1667
+ create,
1668
+ new: create,
1669
+ defaults: () => Object.freeze(defaults())
1670
+ });
1671
+ })();
1672
+ const FfiConverterTypeSpliceKeyRef = (() => {
1673
+ class FFIConverter extends _core.AbstractFfiConverterByteArray {
1674
+ read(from) {
1675
+ return {
1676
+ inputSerialId: _core.FfiConverterUInt64.read(from),
1677
+ priorTemporaryContractId: _core.FfiConverterArrayBuffer.read(from)
1678
+ };
1679
+ }
1680
+ write(value, into) {
1681
+ _core.FfiConverterUInt64.write(value.inputSerialId, into);
1682
+ _core.FfiConverterArrayBuffer.write(value.priorTemporaryContractId, into);
1683
+ }
1684
+ allocationSize(value) {
1685
+ return _core.FfiConverterUInt64.allocationSize(value.inputSerialId) + _core.FfiConverterArrayBuffer.allocationSize(value.priorTemporaryContractId);
1686
+ }
1687
+ }
1688
+ return new FFIConverter();
1689
+ })();
1690
+
1691
+ // Error type: ContractError
1692
+ let ContractError_Tags = exports.ContractError_Tags = /*#__PURE__*/function (ContractError_Tags) {
1693
+ ContractError_Tags["InvalidOffer"] = "InvalidOffer";
1694
+ ContractError_Tags["InvalidAccept"] = "InvalidAccept";
1695
+ ContractError_Tags["InvalidSign"] = "InvalidSign";
1696
+ ContractError_Tags["InvalidFundingInput"] = "InvalidFundingInput";
1697
+ ContractError_Tags["PsbtMismatch"] = "PsbtMismatch";
1698
+ ContractError_Tags["MissingFinalizedInput"] = "MissingFinalizedInput";
1699
+ ContractError_Tags["UnsupportedScriptType"] = "UnsupportedScriptType";
1700
+ ContractError_Tags["InvalidAttestation"] = "InvalidAttestation";
1701
+ ContractError_Tags["NoMatchingOutcome"] = "NoMatchingOutcome";
1702
+ ContractError_Tags["Descriptor"] = "Descriptor";
1703
+ ContractError_Tags["Wallet"] = "Wallet";
1704
+ ContractError_Tags["Bip32"] = "Bip32";
1705
+ ContractError_Tags["Dlc"] = "Dlc";
1706
+ ContractError_Tags["Key"] = "Key";
1707
+ ContractError_Tags["Serialization"] = "Serialization";
1708
+ ContractError_Tags["InvalidNetwork"] = "InvalidNetwork";
1709
+ ContractError_Tags["InvalidLength"] = "InvalidLength";
1710
+ return ContractError_Tags;
1711
+ }({});
1712
+ /**
1713
+ * Errors returned by the stateless contract API.
1714
+ *
1715
+ * Mirrors [`ddk::contract::ContractError`] as a uniffi error so the typed
1716
+ * variants survive across the binding boundary. Variants carry plain strings.
1717
+ */
1718
+ const ContractError = exports.ContractError = (() => {
1719
+ class InvalidOffer_ extends _core.UniffiError {
1720
+ /**
1721
+ * @private
1722
+ * This field is private and should not be used, use `tag` instead.
1723
+ */
1724
+ [_core.uniffiTypeNameSymbol] = 'ContractError';
1725
+ tag = ContractError_Tags.InvalidOffer;
1726
+ constructor(inner) {
1727
+ super('ContractError', 'InvalidOffer');
1728
+ this.inner = Object.freeze(inner);
1729
+ }
1730
+ static new(inner) {
1731
+ return new InvalidOffer_(inner);
1732
+ }
1733
+ static instanceOf(obj) {
1734
+ return obj.tag === ContractError_Tags.InvalidOffer;
1735
+ }
1736
+ static hasInner(obj) {
1737
+ return InvalidOffer_.instanceOf(obj);
1738
+ }
1739
+ static getInner(obj) {
1740
+ return obj.inner;
1741
+ }
1742
+ }
1743
+ class InvalidAccept_ extends _core.UniffiError {
1744
+ /**
1745
+ * @private
1746
+ * This field is private and should not be used, use `tag` instead.
1747
+ */
1748
+ [_core.uniffiTypeNameSymbol] = 'ContractError';
1749
+ tag = ContractError_Tags.InvalidAccept;
1750
+ constructor(inner) {
1751
+ super('ContractError', 'InvalidAccept');
1752
+ this.inner = Object.freeze(inner);
1753
+ }
1754
+ static new(inner) {
1755
+ return new InvalidAccept_(inner);
1756
+ }
1757
+ static instanceOf(obj) {
1758
+ return obj.tag === ContractError_Tags.InvalidAccept;
1759
+ }
1760
+ static hasInner(obj) {
1761
+ return InvalidAccept_.instanceOf(obj);
1762
+ }
1763
+ static getInner(obj) {
1764
+ return obj.inner;
1765
+ }
1766
+ }
1767
+ class InvalidSign_ extends _core.UniffiError {
1768
+ /**
1769
+ * @private
1770
+ * This field is private and should not be used, use `tag` instead.
1771
+ */
1772
+ [_core.uniffiTypeNameSymbol] = 'ContractError';
1773
+ tag = ContractError_Tags.InvalidSign;
1774
+ constructor(inner) {
1775
+ super('ContractError', 'InvalidSign');
1776
+ this.inner = Object.freeze(inner);
1777
+ }
1778
+ static new(inner) {
1779
+ return new InvalidSign_(inner);
1780
+ }
1781
+ static instanceOf(obj) {
1782
+ return obj.tag === ContractError_Tags.InvalidSign;
1783
+ }
1784
+ static hasInner(obj) {
1785
+ return InvalidSign_.instanceOf(obj);
1786
+ }
1787
+ static getInner(obj) {
1788
+ return obj.inner;
1789
+ }
1790
+ }
1791
+ class InvalidFundingInput_ extends _core.UniffiError {
1792
+ /**
1793
+ * @private
1794
+ * This field is private and should not be used, use `tag` instead.
1795
+ */
1796
+ [_core.uniffiTypeNameSymbol] = 'ContractError';
1797
+ tag = ContractError_Tags.InvalidFundingInput;
1798
+ constructor(inner) {
1799
+ super('ContractError', 'InvalidFundingInput');
1800
+ this.inner = Object.freeze(inner);
1801
+ }
1802
+ static new(inner) {
1803
+ return new InvalidFundingInput_(inner);
1804
+ }
1805
+ static instanceOf(obj) {
1806
+ return obj.tag === ContractError_Tags.InvalidFundingInput;
1807
+ }
1808
+ static hasInner(obj) {
1809
+ return InvalidFundingInput_.instanceOf(obj);
1810
+ }
1811
+ static getInner(obj) {
1812
+ return obj.inner;
1813
+ }
1814
+ }
1815
+ class PsbtMismatch_ extends _core.UniffiError {
1816
+ /**
1817
+ * @private
1818
+ * This field is private and should not be used, use `tag` instead.
1819
+ */
1820
+ [_core.uniffiTypeNameSymbol] = 'ContractError';
1821
+ tag = ContractError_Tags.PsbtMismatch;
1822
+ constructor(inner) {
1823
+ super('ContractError', 'PsbtMismatch');
1824
+ this.inner = Object.freeze(inner);
1825
+ }
1826
+ static new(inner) {
1827
+ return new PsbtMismatch_(inner);
1828
+ }
1829
+ static instanceOf(obj) {
1830
+ return obj.tag === ContractError_Tags.PsbtMismatch;
1831
+ }
1832
+ static hasInner(obj) {
1833
+ return PsbtMismatch_.instanceOf(obj);
1834
+ }
1835
+ static getInner(obj) {
1836
+ return obj.inner;
1837
+ }
1838
+ }
1839
+ class MissingFinalizedInput_ extends _core.UniffiError {
1840
+ /**
1841
+ * @private
1842
+ * This field is private and should not be used, use `tag` instead.
1843
+ */
1844
+ [_core.uniffiTypeNameSymbol] = 'ContractError';
1845
+ tag = ContractError_Tags.MissingFinalizedInput;
1846
+ constructor(inner) {
1847
+ super('ContractError', 'MissingFinalizedInput');
1848
+ this.inner = Object.freeze(inner);
1849
+ }
1850
+ static new(inner) {
1851
+ return new MissingFinalizedInput_(inner);
1852
+ }
1853
+ static instanceOf(obj) {
1854
+ return obj.tag === ContractError_Tags.MissingFinalizedInput;
1855
+ }
1856
+ static hasInner(obj) {
1857
+ return MissingFinalizedInput_.instanceOf(obj);
1858
+ }
1859
+ static getInner(obj) {
1860
+ return obj.inner;
1861
+ }
1862
+ }
1863
+ class UnsupportedScriptType_ extends _core.UniffiError {
1864
+ /**
1865
+ * @private
1866
+ * This field is private and should not be used, use `tag` instead.
1867
+ */
1868
+ [_core.uniffiTypeNameSymbol] = 'ContractError';
1869
+ tag = ContractError_Tags.UnsupportedScriptType;
1870
+ constructor(inner) {
1871
+ super('ContractError', 'UnsupportedScriptType');
1872
+ this.inner = Object.freeze(inner);
1873
+ }
1874
+ static new(inner) {
1875
+ return new UnsupportedScriptType_(inner);
1876
+ }
1877
+ static instanceOf(obj) {
1878
+ return obj.tag === ContractError_Tags.UnsupportedScriptType;
1879
+ }
1880
+ static hasInner(obj) {
1881
+ return UnsupportedScriptType_.instanceOf(obj);
1882
+ }
1883
+ static getInner(obj) {
1884
+ return obj.inner;
1885
+ }
1886
+ }
1887
+ class InvalidAttestation_ extends _core.UniffiError {
1888
+ /**
1889
+ * @private
1890
+ * This field is private and should not be used, use `tag` instead.
1891
+ */
1892
+ [_core.uniffiTypeNameSymbol] = 'ContractError';
1893
+ tag = ContractError_Tags.InvalidAttestation;
1894
+ constructor(inner) {
1895
+ super('ContractError', 'InvalidAttestation');
1896
+ this.inner = Object.freeze(inner);
1897
+ }
1898
+ static new(inner) {
1899
+ return new InvalidAttestation_(inner);
1900
+ }
1901
+ static instanceOf(obj) {
1902
+ return obj.tag === ContractError_Tags.InvalidAttestation;
1903
+ }
1904
+ static hasInner(obj) {
1905
+ return InvalidAttestation_.instanceOf(obj);
1906
+ }
1907
+ static getInner(obj) {
1908
+ return obj.inner;
1909
+ }
1910
+ }
1911
+ class NoMatchingOutcome_ extends _core.UniffiError {
1912
+ /**
1913
+ * @private
1914
+ * This field is private and should not be used, use `tag` instead.
1915
+ */
1916
+ [_core.uniffiTypeNameSymbol] = 'ContractError';
1917
+ tag = ContractError_Tags.NoMatchingOutcome;
1918
+ constructor() {
1919
+ super('ContractError', 'NoMatchingOutcome');
1920
+ }
1921
+ static new() {
1922
+ return new NoMatchingOutcome_();
1923
+ }
1924
+ static instanceOf(obj) {
1925
+ return obj.tag === ContractError_Tags.NoMatchingOutcome;
1926
+ }
1927
+ static hasInner(obj) {
1928
+ return false;
1929
+ }
1930
+ }
1931
+ class Descriptor_ extends _core.UniffiError {
1932
+ /**
1933
+ * @private
1934
+ * This field is private and should not be used, use `tag` instead.
1935
+ */
1936
+ [_core.uniffiTypeNameSymbol] = 'ContractError';
1937
+ tag = ContractError_Tags.Descriptor;
1938
+ constructor(inner) {
1939
+ super('ContractError', 'Descriptor');
1940
+ this.inner = Object.freeze(inner);
1941
+ }
1942
+ static new(inner) {
1943
+ return new Descriptor_(inner);
1944
+ }
1945
+ static instanceOf(obj) {
1946
+ return obj.tag === ContractError_Tags.Descriptor;
1947
+ }
1948
+ static hasInner(obj) {
1949
+ return Descriptor_.instanceOf(obj);
1950
+ }
1951
+ static getInner(obj) {
1952
+ return obj.inner;
1953
+ }
1954
+ }
1955
+ class Wallet_ extends _core.UniffiError {
1956
+ /**
1957
+ * @private
1958
+ * This field is private and should not be used, use `tag` instead.
1959
+ */
1960
+ [_core.uniffiTypeNameSymbol] = 'ContractError';
1961
+ tag = ContractError_Tags.Wallet;
1962
+ constructor(inner) {
1963
+ super('ContractError', 'Wallet');
1964
+ this.inner = Object.freeze(inner);
1965
+ }
1966
+ static new(inner) {
1967
+ return new Wallet_(inner);
1968
+ }
1969
+ static instanceOf(obj) {
1970
+ return obj.tag === ContractError_Tags.Wallet;
1971
+ }
1972
+ static hasInner(obj) {
1973
+ return Wallet_.instanceOf(obj);
1974
+ }
1975
+ static getInner(obj) {
1976
+ return obj.inner;
1977
+ }
1978
+ }
1979
+ class Bip32_ extends _core.UniffiError {
1980
+ /**
1981
+ * @private
1982
+ * This field is private and should not be used, use `tag` instead.
1983
+ */
1984
+ [_core.uniffiTypeNameSymbol] = 'ContractError';
1985
+ tag = ContractError_Tags.Bip32;
1986
+ constructor(inner) {
1987
+ super('ContractError', 'Bip32');
1988
+ this.inner = Object.freeze(inner);
1989
+ }
1990
+ static new(inner) {
1991
+ return new Bip32_(inner);
1992
+ }
1993
+ static instanceOf(obj) {
1994
+ return obj.tag === ContractError_Tags.Bip32;
1995
+ }
1996
+ static hasInner(obj) {
1997
+ return Bip32_.instanceOf(obj);
1998
+ }
1999
+ static getInner(obj) {
2000
+ return obj.inner;
2001
+ }
2002
+ }
2003
+ class Dlc_ extends _core.UniffiError {
2004
+ /**
2005
+ * @private
2006
+ * This field is private and should not be used, use `tag` instead.
2007
+ */
2008
+ [_core.uniffiTypeNameSymbol] = 'ContractError';
2009
+ tag = ContractError_Tags.Dlc;
2010
+ constructor(inner) {
2011
+ super('ContractError', 'Dlc');
2012
+ this.inner = Object.freeze(inner);
2013
+ }
2014
+ static new(inner) {
2015
+ return new Dlc_(inner);
2016
+ }
2017
+ static instanceOf(obj) {
2018
+ return obj.tag === ContractError_Tags.Dlc;
2019
+ }
2020
+ static hasInner(obj) {
2021
+ return Dlc_.instanceOf(obj);
2022
+ }
2023
+ static getInner(obj) {
2024
+ return obj.inner;
2025
+ }
2026
+ }
2027
+ class Key_ extends _core.UniffiError {
2028
+ /**
2029
+ * @private
2030
+ * This field is private and should not be used, use `tag` instead.
2031
+ */
2032
+ [_core.uniffiTypeNameSymbol] = 'ContractError';
2033
+ tag = ContractError_Tags.Key;
2034
+ constructor(inner) {
2035
+ super('ContractError', 'Key');
2036
+ this.inner = Object.freeze(inner);
2037
+ }
2038
+ static new(inner) {
2039
+ return new Key_(inner);
2040
+ }
2041
+ static instanceOf(obj) {
2042
+ return obj.tag === ContractError_Tags.Key;
2043
+ }
2044
+ static hasInner(obj) {
2045
+ return Key_.instanceOf(obj);
2046
+ }
2047
+ static getInner(obj) {
2048
+ return obj.inner;
2049
+ }
2050
+ }
2051
+ /**
2052
+ * A message or PSBT could not be (de)serialized at the FFI boundary.
2053
+ */
2054
+ class Serialization_ extends _core.UniffiError {
2055
+ /**
2056
+ * @private
2057
+ * This field is private and should not be used, use `tag` instead.
2058
+ */
2059
+ [_core.uniffiTypeNameSymbol] = 'ContractError';
2060
+ tag = ContractError_Tags.Serialization;
2061
+ constructor(inner) {
2062
+ super('ContractError', 'Serialization');
2063
+ this.inner = Object.freeze(inner);
2064
+ }
2065
+ static new(inner) {
2066
+ return new Serialization_(inner);
2067
+ }
2068
+ static instanceOf(obj) {
2069
+ return obj.tag === ContractError_Tags.Serialization;
2070
+ }
2071
+ static hasInner(obj) {
2072
+ return Serialization_.instanceOf(obj);
2073
+ }
2074
+ static getInner(obj) {
2075
+ return obj.inner;
2076
+ }
2077
+ }
2078
+ /**
2079
+ * The network string was not one of bitcoin/testnet/signet/regtest.
2080
+ */
2081
+ class InvalidNetwork_ extends _core.UniffiError {
2082
+ /**
2083
+ * @private
2084
+ * This field is private and should not be used, use `tag` instead.
2085
+ */
2086
+ [_core.uniffiTypeNameSymbol] = 'ContractError';
2087
+ tag = ContractError_Tags.InvalidNetwork;
2088
+ constructor(inner) {
2089
+ super('ContractError', 'InvalidNetwork');
2090
+ this.inner = Object.freeze(inner);
2091
+ }
2092
+ static new(inner) {
2093
+ return new InvalidNetwork_(inner);
2094
+ }
2095
+ static instanceOf(obj) {
2096
+ return obj.tag === ContractError_Tags.InvalidNetwork;
2097
+ }
2098
+ static hasInner(obj) {
2099
+ return InvalidNetwork_.instanceOf(obj);
2100
+ }
2101
+ static getInner(obj) {
2102
+ return obj.inner;
2103
+ }
2104
+ }
2105
+ /**
2106
+ * A byte argument had the wrong length (e.g. a 32-byte id).
2107
+ */
2108
+ class InvalidLength_ extends _core.UniffiError {
2109
+ /**
2110
+ * @private
2111
+ * This field is private and should not be used, use `tag` instead.
2112
+ */
2113
+ [_core.uniffiTypeNameSymbol] = 'ContractError';
2114
+ tag = ContractError_Tags.InvalidLength;
2115
+ constructor(inner) {
2116
+ super('ContractError', 'InvalidLength');
2117
+ this.inner = Object.freeze(inner);
2118
+ }
2119
+ static new(inner) {
2120
+ return new InvalidLength_(inner);
2121
+ }
2122
+ static instanceOf(obj) {
2123
+ return obj.tag === ContractError_Tags.InvalidLength;
2124
+ }
2125
+ static hasInner(obj) {
2126
+ return InvalidLength_.instanceOf(obj);
790
2127
  }
791
- allocationSize(value) {
792
- return FfiConverterString.allocationSize(value.txid) + _uniffiBindgenReactNative.FfiConverterUInt32.allocationSize(value.vout) + FfiConverterArrayUInt8.allocationSize(value.scriptSig) + _uniffiBindgenReactNative.FfiConverterUInt32.allocationSize(value.sequence) + FfiConverterArrayArrayUInt8.allocationSize(value.witness);
2128
+ static getInner(obj) {
2129
+ return obj.inner;
793
2130
  }
794
2131
  }
795
- ;
796
- return new FFIConverter();
797
- })();
798
- /**
799
- * Generated factory for {@link TxInputInfo} record objects.
800
- */
801
- const TxInputInfo = exports.TxInputInfo = (() => {
802
- const defaults = () => ({});
803
- const create = (() => {
804
- return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(defaults);
805
- })();
2132
+ function instanceOf(obj) {
2133
+ return obj[_core.uniffiTypeNameSymbol] === 'ContractError';
2134
+ }
806
2135
  return Object.freeze({
807
- /**
808
- * Create a frozen instance of {@link TxInputInfo}, with defaults specified
809
- * in Rust, in the {@link ddk_ffi} crate.
810
- */
811
- create,
812
- /**
813
- * Create a frozen instance of {@link TxInputInfo}, with defaults specified
814
- * in Rust, in the {@link ddk_ffi} crate.
815
- */
816
- new: create,
817
- /**
818
- * Defaults specified in the {@link ddk_ffi} crate.
819
- */
820
- defaults: () => Object.freeze(defaults())
2136
+ instanceOf,
2137
+ InvalidOffer: InvalidOffer_,
2138
+ InvalidAccept: InvalidAccept_,
2139
+ InvalidSign: InvalidSign_,
2140
+ InvalidFundingInput: InvalidFundingInput_,
2141
+ PsbtMismatch: PsbtMismatch_,
2142
+ MissingFinalizedInput: MissingFinalizedInput_,
2143
+ UnsupportedScriptType: UnsupportedScriptType_,
2144
+ InvalidAttestation: InvalidAttestation_,
2145
+ NoMatchingOutcome: NoMatchingOutcome_,
2146
+ Descriptor: Descriptor_,
2147
+ Wallet: Wallet_,
2148
+ Bip32: Bip32_,
2149
+ Dlc: Dlc_,
2150
+ Key: Key_,
2151
+ Serialization: Serialization_,
2152
+ InvalidNetwork: InvalidNetwork_,
2153
+ InvalidLength: InvalidLength_
821
2154
  });
822
2155
  })();
823
- const FfiConverterTypeTxInputInfo = (() => {
824
- class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
2156
+ /**
2157
+ * Errors returned by the stateless contract API.
2158
+ *
2159
+ * Mirrors [`ddk::contract::ContractError`] as a uniffi error so the typed
2160
+ * variants survive across the binding boundary. Variants carry plain strings.
2161
+ */
2162
+
2163
+ // FfiConverter for enum ContractError
2164
+ const FfiConverterTypeContractError = (() => {
2165
+ const ordinalConverter = _core.FfiConverterInt32;
2166
+ class FFIConverter extends _core.AbstractFfiConverterByteArray {
825
2167
  read(from) {
826
- return {
827
- txid: FfiConverterString.read(from),
828
- vout: _uniffiBindgenReactNative.FfiConverterUInt32.read(from),
829
- scriptSig: FfiConverterArrayUInt8.read(from),
830
- maxWitnessLength: _uniffiBindgenReactNative.FfiConverterUInt32.read(from),
831
- serialId: _uniffiBindgenReactNative.FfiConverterUInt64.read(from)
832
- };
2168
+ switch (ordinalConverter.read(from)) {
2169
+ case 1:
2170
+ return new ContractError.InvalidOffer({
2171
+ message: FfiConverterString.read(from)
2172
+ });
2173
+ case 2:
2174
+ return new ContractError.InvalidAccept({
2175
+ message: FfiConverterString.read(from)
2176
+ });
2177
+ case 3:
2178
+ return new ContractError.InvalidSign({
2179
+ message: FfiConverterString.read(from)
2180
+ });
2181
+ case 4:
2182
+ return new ContractError.InvalidFundingInput({
2183
+ message: FfiConverterString.read(from)
2184
+ });
2185
+ case 5:
2186
+ return new ContractError.PsbtMismatch({
2187
+ message: FfiConverterString.read(from)
2188
+ });
2189
+ case 6:
2190
+ return new ContractError.MissingFinalizedInput({
2191
+ inputIndex: _core.FfiConverterUInt32.read(from)
2192
+ });
2193
+ case 7:
2194
+ return new ContractError.UnsupportedScriptType({
2195
+ inputIndex: _core.FfiConverterUInt32.read(from)
2196
+ });
2197
+ case 8:
2198
+ return new ContractError.InvalidAttestation({
2199
+ message: FfiConverterString.read(from)
2200
+ });
2201
+ case 9:
2202
+ return new ContractError.NoMatchingOutcome();
2203
+ case 10:
2204
+ return new ContractError.Descriptor({
2205
+ message: FfiConverterString.read(from)
2206
+ });
2207
+ case 11:
2208
+ return new ContractError.Wallet({
2209
+ message: FfiConverterString.read(from)
2210
+ });
2211
+ case 12:
2212
+ return new ContractError.Bip32({
2213
+ message: FfiConverterString.read(from)
2214
+ });
2215
+ case 13:
2216
+ return new ContractError.Dlc({
2217
+ message: FfiConverterString.read(from)
2218
+ });
2219
+ case 14:
2220
+ return new ContractError.Key({
2221
+ message: FfiConverterString.read(from)
2222
+ });
2223
+ case 15:
2224
+ return new ContractError.Serialization({
2225
+ message: FfiConverterString.read(from)
2226
+ });
2227
+ case 16:
2228
+ return new ContractError.InvalidNetwork({
2229
+ message: FfiConverterString.read(from)
2230
+ });
2231
+ case 17:
2232
+ return new ContractError.InvalidLength({
2233
+ field: FfiConverterString.read(from),
2234
+ expected: _core.FfiConverterUInt32.read(from),
2235
+ actual: _core.FfiConverterUInt32.read(from)
2236
+ });
2237
+ default:
2238
+ throw new _core.UniffiInternalError.UnexpectedEnumCase();
2239
+ }
833
2240
  }
834
2241
  write(value, into) {
835
- FfiConverterString.write(value.txid, into);
836
- _uniffiBindgenReactNative.FfiConverterUInt32.write(value.vout, into);
837
- FfiConverterArrayUInt8.write(value.scriptSig, into);
838
- _uniffiBindgenReactNative.FfiConverterUInt32.write(value.maxWitnessLength, into);
839
- _uniffiBindgenReactNative.FfiConverterUInt64.write(value.serialId, into);
2242
+ switch (value.tag) {
2243
+ case ContractError_Tags.InvalidOffer:
2244
+ {
2245
+ ordinalConverter.write(1, into);
2246
+ const inner = value.inner;
2247
+ FfiConverterString.write(inner.message, into);
2248
+ return;
2249
+ }
2250
+ case ContractError_Tags.InvalidAccept:
2251
+ {
2252
+ ordinalConverter.write(2, into);
2253
+ const inner = value.inner;
2254
+ FfiConverterString.write(inner.message, into);
2255
+ return;
2256
+ }
2257
+ case ContractError_Tags.InvalidSign:
2258
+ {
2259
+ ordinalConverter.write(3, into);
2260
+ const inner = value.inner;
2261
+ FfiConverterString.write(inner.message, into);
2262
+ return;
2263
+ }
2264
+ case ContractError_Tags.InvalidFundingInput:
2265
+ {
2266
+ ordinalConverter.write(4, into);
2267
+ const inner = value.inner;
2268
+ FfiConverterString.write(inner.message, into);
2269
+ return;
2270
+ }
2271
+ case ContractError_Tags.PsbtMismatch:
2272
+ {
2273
+ ordinalConverter.write(5, into);
2274
+ const inner = value.inner;
2275
+ FfiConverterString.write(inner.message, into);
2276
+ return;
2277
+ }
2278
+ case ContractError_Tags.MissingFinalizedInput:
2279
+ {
2280
+ ordinalConverter.write(6, into);
2281
+ const inner = value.inner;
2282
+ _core.FfiConverterUInt32.write(inner.inputIndex, into);
2283
+ return;
2284
+ }
2285
+ case ContractError_Tags.UnsupportedScriptType:
2286
+ {
2287
+ ordinalConverter.write(7, into);
2288
+ const inner = value.inner;
2289
+ _core.FfiConverterUInt32.write(inner.inputIndex, into);
2290
+ return;
2291
+ }
2292
+ case ContractError_Tags.InvalidAttestation:
2293
+ {
2294
+ ordinalConverter.write(8, into);
2295
+ const inner = value.inner;
2296
+ FfiConverterString.write(inner.message, into);
2297
+ return;
2298
+ }
2299
+ case ContractError_Tags.NoMatchingOutcome:
2300
+ {
2301
+ ordinalConverter.write(9, into);
2302
+ return;
2303
+ }
2304
+ case ContractError_Tags.Descriptor:
2305
+ {
2306
+ ordinalConverter.write(10, into);
2307
+ const inner = value.inner;
2308
+ FfiConverterString.write(inner.message, into);
2309
+ return;
2310
+ }
2311
+ case ContractError_Tags.Wallet:
2312
+ {
2313
+ ordinalConverter.write(11, into);
2314
+ const inner = value.inner;
2315
+ FfiConverterString.write(inner.message, into);
2316
+ return;
2317
+ }
2318
+ case ContractError_Tags.Bip32:
2319
+ {
2320
+ ordinalConverter.write(12, into);
2321
+ const inner = value.inner;
2322
+ FfiConverterString.write(inner.message, into);
2323
+ return;
2324
+ }
2325
+ case ContractError_Tags.Dlc:
2326
+ {
2327
+ ordinalConverter.write(13, into);
2328
+ const inner = value.inner;
2329
+ FfiConverterString.write(inner.message, into);
2330
+ return;
2331
+ }
2332
+ case ContractError_Tags.Key:
2333
+ {
2334
+ ordinalConverter.write(14, into);
2335
+ const inner = value.inner;
2336
+ FfiConverterString.write(inner.message, into);
2337
+ return;
2338
+ }
2339
+ case ContractError_Tags.Serialization:
2340
+ {
2341
+ ordinalConverter.write(15, into);
2342
+ const inner = value.inner;
2343
+ FfiConverterString.write(inner.message, into);
2344
+ return;
2345
+ }
2346
+ case ContractError_Tags.InvalidNetwork:
2347
+ {
2348
+ ordinalConverter.write(16, into);
2349
+ const inner = value.inner;
2350
+ FfiConverterString.write(inner.message, into);
2351
+ return;
2352
+ }
2353
+ case ContractError_Tags.InvalidLength:
2354
+ {
2355
+ ordinalConverter.write(17, into);
2356
+ const inner = value.inner;
2357
+ FfiConverterString.write(inner.field, into);
2358
+ _core.FfiConverterUInt32.write(inner.expected, into);
2359
+ _core.FfiConverterUInt32.write(inner.actual, into);
2360
+ return;
2361
+ }
2362
+ default:
2363
+ // Throwing from here means that ContractError_Tags hasn't matched an ordinal.
2364
+ throw new _core.UniffiInternalError.UnexpectedEnumCase();
2365
+ }
840
2366
  }
841
2367
  allocationSize(value) {
842
- return FfiConverterString.allocationSize(value.txid) + _uniffiBindgenReactNative.FfiConverterUInt32.allocationSize(value.vout) + FfiConverterArrayUInt8.allocationSize(value.scriptSig) + _uniffiBindgenReactNative.FfiConverterUInt32.allocationSize(value.maxWitnessLength) + _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.serialId);
2368
+ switch (value.tag) {
2369
+ case ContractError_Tags.InvalidOffer:
2370
+ {
2371
+ const inner = value.inner;
2372
+ let size = ordinalConverter.allocationSize(1);
2373
+ size += FfiConverterString.allocationSize(inner.message);
2374
+ return size;
2375
+ }
2376
+ case ContractError_Tags.InvalidAccept:
2377
+ {
2378
+ const inner = value.inner;
2379
+ let size = ordinalConverter.allocationSize(2);
2380
+ size += FfiConverterString.allocationSize(inner.message);
2381
+ return size;
2382
+ }
2383
+ case ContractError_Tags.InvalidSign:
2384
+ {
2385
+ const inner = value.inner;
2386
+ let size = ordinalConverter.allocationSize(3);
2387
+ size += FfiConverterString.allocationSize(inner.message);
2388
+ return size;
2389
+ }
2390
+ case ContractError_Tags.InvalidFundingInput:
2391
+ {
2392
+ const inner = value.inner;
2393
+ let size = ordinalConverter.allocationSize(4);
2394
+ size += FfiConverterString.allocationSize(inner.message);
2395
+ return size;
2396
+ }
2397
+ case ContractError_Tags.PsbtMismatch:
2398
+ {
2399
+ const inner = value.inner;
2400
+ let size = ordinalConverter.allocationSize(5);
2401
+ size += FfiConverterString.allocationSize(inner.message);
2402
+ return size;
2403
+ }
2404
+ case ContractError_Tags.MissingFinalizedInput:
2405
+ {
2406
+ const inner = value.inner;
2407
+ let size = ordinalConverter.allocationSize(6);
2408
+ size += _core.FfiConverterUInt32.allocationSize(inner.inputIndex);
2409
+ return size;
2410
+ }
2411
+ case ContractError_Tags.UnsupportedScriptType:
2412
+ {
2413
+ const inner = value.inner;
2414
+ let size = ordinalConverter.allocationSize(7);
2415
+ size += _core.FfiConverterUInt32.allocationSize(inner.inputIndex);
2416
+ return size;
2417
+ }
2418
+ case ContractError_Tags.InvalidAttestation:
2419
+ {
2420
+ const inner = value.inner;
2421
+ let size = ordinalConverter.allocationSize(8);
2422
+ size += FfiConverterString.allocationSize(inner.message);
2423
+ return size;
2424
+ }
2425
+ case ContractError_Tags.NoMatchingOutcome:
2426
+ {
2427
+ return ordinalConverter.allocationSize(9);
2428
+ }
2429
+ case ContractError_Tags.Descriptor:
2430
+ {
2431
+ const inner = value.inner;
2432
+ let size = ordinalConverter.allocationSize(10);
2433
+ size += FfiConverterString.allocationSize(inner.message);
2434
+ return size;
2435
+ }
2436
+ case ContractError_Tags.Wallet:
2437
+ {
2438
+ const inner = value.inner;
2439
+ let size = ordinalConverter.allocationSize(11);
2440
+ size += FfiConverterString.allocationSize(inner.message);
2441
+ return size;
2442
+ }
2443
+ case ContractError_Tags.Bip32:
2444
+ {
2445
+ const inner = value.inner;
2446
+ let size = ordinalConverter.allocationSize(12);
2447
+ size += FfiConverterString.allocationSize(inner.message);
2448
+ return size;
2449
+ }
2450
+ case ContractError_Tags.Dlc:
2451
+ {
2452
+ const inner = value.inner;
2453
+ let size = ordinalConverter.allocationSize(13);
2454
+ size += FfiConverterString.allocationSize(inner.message);
2455
+ return size;
2456
+ }
2457
+ case ContractError_Tags.Key:
2458
+ {
2459
+ const inner = value.inner;
2460
+ let size = ordinalConverter.allocationSize(14);
2461
+ size += FfiConverterString.allocationSize(inner.message);
2462
+ return size;
2463
+ }
2464
+ case ContractError_Tags.Serialization:
2465
+ {
2466
+ const inner = value.inner;
2467
+ let size = ordinalConverter.allocationSize(15);
2468
+ size += FfiConverterString.allocationSize(inner.message);
2469
+ return size;
2470
+ }
2471
+ case ContractError_Tags.InvalidNetwork:
2472
+ {
2473
+ const inner = value.inner;
2474
+ let size = ordinalConverter.allocationSize(16);
2475
+ size += FfiConverterString.allocationSize(inner.message);
2476
+ return size;
2477
+ }
2478
+ case ContractError_Tags.InvalidLength:
2479
+ {
2480
+ const inner = value.inner;
2481
+ let size = ordinalConverter.allocationSize(17);
2482
+ size += FfiConverterString.allocationSize(inner.field);
2483
+ size += _core.FfiConverterUInt32.allocationSize(inner.expected);
2484
+ size += _core.FfiConverterUInt32.allocationSize(inner.actual);
2485
+ return size;
2486
+ }
2487
+ default:
2488
+ throw new _core.UniffiInternalError.UnexpectedEnumCase();
2489
+ }
843
2490
  }
844
2491
  }
845
- ;
846
2492
  return new FFIConverter();
847
2493
  })();
848
- /**
849
- * Generated factory for {@link TxOutput} record objects.
850
- */
851
- const TxOutput = exports.TxOutput = (() => {
852
- const defaults = () => ({});
853
- const create = (() => {
854
- return (0, _uniffiBindgenReactNative.uniffiCreateRecord)(defaults);
855
- })();
856
- return Object.freeze({
857
- /**
858
- * Create a frozen instance of {@link TxOutput}, with defaults specified
859
- * in Rust, in the {@link ddk_ffi} crate.
860
- */
861
- create,
862
- /**
863
- * Create a frozen instance of {@link TxOutput}, with defaults specified
864
- * in Rust, in the {@link ddk_ffi} crate.
865
- */
866
- new: create,
867
- /**
868
- * Defaults specified in the {@link ddk_ffi} crate.
869
- */
870
- defaults: () => Object.freeze(defaults())
871
- });
872
- })();
873
- const FfiConverterTypeTxOutput = (() => {
874
- class FFIConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
2494
+ let ExtendedKey = exports.ExtendedKey = /*#__PURE__*/function (ExtendedKey) {
2495
+ ExtendedKey[ExtendedKey["InvalidMnemonic"] = 0] = "InvalidMnemonic";
2496
+ ExtendedKey[ExtendedKey["InvalidXpriv"] = 1] = "InvalidXpriv";
2497
+ ExtendedKey[ExtendedKey["InvalidXpub"] = 2] = "InvalidXpub";
2498
+ ExtendedKey[ExtendedKey["InvalidDerivationPath"] = 3] = "InvalidDerivationPath";
2499
+ return ExtendedKey;
2500
+ }({});
2501
+ const FfiConverterTypeExtendedKey = (() => {
2502
+ const ordinalConverter = _core.FfiConverterInt32;
2503
+ class FFIConverter extends _core.AbstractFfiConverterByteArray {
875
2504
  read(from) {
876
- return {
877
- value: _uniffiBindgenReactNative.FfiConverterUInt64.read(from),
878
- scriptPubkey: FfiConverterArrayUInt8.read(from)
879
- };
2505
+ switch (ordinalConverter.read(from)) {
2506
+ case 1:
2507
+ return ExtendedKey.InvalidMnemonic;
2508
+ case 2:
2509
+ return ExtendedKey.InvalidXpriv;
2510
+ case 3:
2511
+ return ExtendedKey.InvalidXpub;
2512
+ case 4:
2513
+ return ExtendedKey.InvalidDerivationPath;
2514
+ default:
2515
+ throw new _core.UniffiInternalError.UnexpectedEnumCase();
2516
+ }
880
2517
  }
881
2518
  write(value, into) {
882
- _uniffiBindgenReactNative.FfiConverterUInt64.write(value.value, into);
883
- FfiConverterArrayUInt8.write(value.scriptPubkey, into);
2519
+ switch (value) {
2520
+ case ExtendedKey.InvalidMnemonic:
2521
+ return ordinalConverter.write(1, into);
2522
+ case ExtendedKey.InvalidXpriv:
2523
+ return ordinalConverter.write(2, into);
2524
+ case ExtendedKey.InvalidXpub:
2525
+ return ordinalConverter.write(3, into);
2526
+ case ExtendedKey.InvalidDerivationPath:
2527
+ return ordinalConverter.write(4, into);
2528
+ }
884
2529
  }
885
2530
  allocationSize(value) {
886
- return _uniffiBindgenReactNative.FfiConverterUInt64.allocationSize(value.value) + FfiConverterArrayUInt8.allocationSize(value.scriptPubkey);
2531
+ return ordinalConverter.allocationSize(0);
887
2532
  }
888
2533
  }
889
- ;
890
2534
  return new FFIConverter();
891
2535
  })();
892
- const stringConverter = {
893
- stringToBytes: s => uniffiCaller.rustCall(status => (0, _ddk_ffiFfi.default)().ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer(s, status)),
894
- bytesToString: ab => uniffiCaller.rustCall(status => (0, _ddk_ffiFfi.default)().ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string(ab, status)),
895
- stringByteLength: s => uniffiCaller.rustCall(status => (0, _ddk_ffiFfi.default)().ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length(s, status))
896
- };
897
- const FfiConverterString = (0, _uniffiBindgenReactNative.uniffiCreateFfiConverterString)(stringConverter);
898
-
899
- // Flat error type: DlcError
2536
+
2537
+ // Error type: DlcError
900
2538
  let DlcError_Tags = exports.DlcError_Tags = /*#__PURE__*/function (DlcError_Tags) {
901
2539
  DlcError_Tags["InvalidSignature"] = "InvalidSignature";
902
2540
  DlcError_Tags["InvalidPublicKey"] = "InvalidPublicKey";
@@ -911,427 +2549,623 @@ let DlcError_Tags = exports.DlcError_Tags = /*#__PURE__*/function (DlcError_Tags
911
2549
  return DlcError_Tags;
912
2550
  }({});
913
2551
  const DlcError = exports.DlcError = (() => {
914
- class InvalidSignature extends _uniffiBindgenReactNative.UniffiError {
915
- /**
916
- * @private
917
- * This field is private and should not be used.
918
- */
919
- [_uniffiBindgenReactNative.uniffiTypeNameSymbol] = "DlcError";
2552
+ class InvalidSignature_ extends _core.UniffiError {
920
2553
  /**
921
2554
  * @private
922
- * This field is private and should not be used.
2555
+ * This field is private and should not be used, use `tag` instead.
923
2556
  */
924
- [_uniffiBindgenReactNative.variantOrdinalSymbol] = 1;
2557
+ [_core.uniffiTypeNameSymbol] = 'DlcError';
925
2558
  tag = DlcError_Tags.InvalidSignature;
926
- constructor(message) {
927
- super("DlcError", "InvalidSignature", message);
2559
+ constructor() {
2560
+ super('DlcError', 'InvalidSignature');
2561
+ }
2562
+ static new() {
2563
+ return new InvalidSignature_();
2564
+ }
2565
+ static instanceOf(obj) {
2566
+ return obj.tag === DlcError_Tags.InvalidSignature;
928
2567
  }
929
- static instanceOf(e) {
930
- return instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 1;
2568
+ static hasInner(obj) {
2569
+ return false;
931
2570
  }
932
2571
  }
933
- class InvalidPublicKey extends _uniffiBindgenReactNative.UniffiError {
2572
+ class InvalidPublicKey_ extends _core.UniffiError {
934
2573
  /**
935
2574
  * @private
936
- * This field is private and should not be used.
2575
+ * This field is private and should not be used, use `tag` instead.
937
2576
  */
938
- [_uniffiBindgenReactNative.uniffiTypeNameSymbol] = "DlcError";
939
- /**
940
- * @private
941
- * This field is private and should not be used.
942
- */
943
- [_uniffiBindgenReactNative.variantOrdinalSymbol] = 2;
2577
+ [_core.uniffiTypeNameSymbol] = 'DlcError';
944
2578
  tag = DlcError_Tags.InvalidPublicKey;
945
- constructor(message) {
946
- super("DlcError", "InvalidPublicKey", message);
2579
+ constructor() {
2580
+ super('DlcError', 'InvalidPublicKey');
2581
+ }
2582
+ static new() {
2583
+ return new InvalidPublicKey_();
947
2584
  }
948
- static instanceOf(e) {
949
- return instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 2;
2585
+ static instanceOf(obj) {
2586
+ return obj.tag === DlcError_Tags.InvalidPublicKey;
2587
+ }
2588
+ static hasInner(obj) {
2589
+ return false;
950
2590
  }
951
2591
  }
952
- class InvalidTransaction extends _uniffiBindgenReactNative.UniffiError {
953
- /**
954
- * @private
955
- * This field is private and should not be used.
956
- */
957
- [_uniffiBindgenReactNative.uniffiTypeNameSymbol] = "DlcError";
2592
+ class InvalidTransaction_ extends _core.UniffiError {
958
2593
  /**
959
2594
  * @private
960
- * This field is private and should not be used.
2595
+ * This field is private and should not be used, use `tag` instead.
961
2596
  */
962
- [_uniffiBindgenReactNative.variantOrdinalSymbol] = 3;
2597
+ [_core.uniffiTypeNameSymbol] = 'DlcError';
963
2598
  tag = DlcError_Tags.InvalidTransaction;
964
- constructor(message) {
965
- super("DlcError", "InvalidTransaction", message);
2599
+ constructor() {
2600
+ super('DlcError', 'InvalidTransaction');
966
2601
  }
967
- static instanceOf(e) {
968
- return instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 3;
2602
+ static new() {
2603
+ return new InvalidTransaction_();
2604
+ }
2605
+ static instanceOf(obj) {
2606
+ return obj.tag === DlcError_Tags.InvalidTransaction;
2607
+ }
2608
+ static hasInner(obj) {
2609
+ return false;
969
2610
  }
970
2611
  }
971
- class InsufficientFunds extends _uniffiBindgenReactNative.UniffiError {
972
- /**
973
- * @private
974
- * This field is private and should not be used.
975
- */
976
- [_uniffiBindgenReactNative.uniffiTypeNameSymbol] = "DlcError";
2612
+ class InsufficientFunds_ extends _core.UniffiError {
977
2613
  /**
978
2614
  * @private
979
- * This field is private and should not be used.
2615
+ * This field is private and should not be used, use `tag` instead.
980
2616
  */
981
- [_uniffiBindgenReactNative.variantOrdinalSymbol] = 4;
2617
+ [_core.uniffiTypeNameSymbol] = 'DlcError';
982
2618
  tag = DlcError_Tags.InsufficientFunds;
983
- constructor(message) {
984
- super("DlcError", "InsufficientFunds", message);
2619
+ constructor() {
2620
+ super('DlcError', 'InsufficientFunds');
2621
+ }
2622
+ static new() {
2623
+ return new InsufficientFunds_();
985
2624
  }
986
- static instanceOf(e) {
987
- return instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 4;
2625
+ static instanceOf(obj) {
2626
+ return obj.tag === DlcError_Tags.InsufficientFunds;
2627
+ }
2628
+ static hasInner(obj) {
2629
+ return false;
988
2630
  }
989
2631
  }
990
- class InvalidArgument extends _uniffiBindgenReactNative.UniffiError {
991
- /**
992
- * @private
993
- * This field is private and should not be used.
994
- */
995
- [_uniffiBindgenReactNative.uniffiTypeNameSymbol] = "DlcError";
2632
+ class InvalidArgument_ extends _core.UniffiError {
996
2633
  /**
997
2634
  * @private
998
- * This field is private and should not be used.
2635
+ * This field is private and should not be used, use `tag` instead.
999
2636
  */
1000
- [_uniffiBindgenReactNative.variantOrdinalSymbol] = 5;
2637
+ [_core.uniffiTypeNameSymbol] = 'DlcError';
1001
2638
  tag = DlcError_Tags.InvalidArgument;
1002
- constructor(message) {
1003
- super("DlcError", "InvalidArgument", message);
2639
+ constructor(inner) {
2640
+ super('DlcError', 'InvalidArgument');
2641
+ this.inner = Object.freeze(inner);
2642
+ }
2643
+ static new(inner) {
2644
+ return new InvalidArgument_(inner);
2645
+ }
2646
+ static instanceOf(obj) {
2647
+ return obj.tag === DlcError_Tags.InvalidArgument;
1004
2648
  }
1005
- static instanceOf(e) {
1006
- return instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 5;
2649
+ static hasInner(obj) {
2650
+ return InvalidArgument_.instanceOf(obj);
2651
+ }
2652
+ static getInner(obj) {
2653
+ return obj.inner;
1007
2654
  }
1008
2655
  }
1009
- class SerializationError extends _uniffiBindgenReactNative.UniffiError {
1010
- /**
1011
- * @private
1012
- * This field is private and should not be used.
1013
- */
1014
- [_uniffiBindgenReactNative.uniffiTypeNameSymbol] = "DlcError";
2656
+ class SerializationError_ extends _core.UniffiError {
1015
2657
  /**
1016
2658
  * @private
1017
- * This field is private and should not be used.
2659
+ * This field is private and should not be used, use `tag` instead.
1018
2660
  */
1019
- [_uniffiBindgenReactNative.variantOrdinalSymbol] = 6;
2661
+ [_core.uniffiTypeNameSymbol] = 'DlcError';
1020
2662
  tag = DlcError_Tags.SerializationError;
1021
- constructor(message) {
1022
- super("DlcError", "SerializationError", message);
2663
+ constructor() {
2664
+ super('DlcError', 'SerializationError');
1023
2665
  }
1024
- static instanceOf(e) {
1025
- return instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 6;
2666
+ static new() {
2667
+ return new SerializationError_();
2668
+ }
2669
+ static instanceOf(obj) {
2670
+ return obj.tag === DlcError_Tags.SerializationError;
2671
+ }
2672
+ static hasInner(obj) {
2673
+ return false;
1026
2674
  }
1027
2675
  }
1028
- class Secp256k1Error extends _uniffiBindgenReactNative.UniffiError {
1029
- /**
1030
- * @private
1031
- * This field is private and should not be used.
1032
- */
1033
- [_uniffiBindgenReactNative.uniffiTypeNameSymbol] = "DlcError";
2676
+ class Secp256k1Error_ extends _core.UniffiError {
1034
2677
  /**
1035
2678
  * @private
1036
- * This field is private and should not be used.
2679
+ * This field is private and should not be used, use `tag` instead.
1037
2680
  */
1038
- [_uniffiBindgenReactNative.variantOrdinalSymbol] = 7;
2681
+ [_core.uniffiTypeNameSymbol] = 'DlcError';
1039
2682
  tag = DlcError_Tags.Secp256k1Error;
1040
- constructor(message) {
1041
- super("DlcError", "Secp256k1Error", message);
2683
+ constructor(inner) {
2684
+ super('DlcError', 'Secp256k1Error');
2685
+ this.inner = Object.freeze(inner);
2686
+ }
2687
+ static new(inner) {
2688
+ return new Secp256k1Error_(inner);
2689
+ }
2690
+ static instanceOf(obj) {
2691
+ return obj.tag === DlcError_Tags.Secp256k1Error;
2692
+ }
2693
+ static hasInner(obj) {
2694
+ return Secp256k1Error_.instanceOf(obj);
1042
2695
  }
1043
- static instanceOf(e) {
1044
- return instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 7;
2696
+ static getInner(obj) {
2697
+ return obj.inner;
1045
2698
  }
1046
2699
  }
1047
- class MiniscriptError extends _uniffiBindgenReactNative.UniffiError {
2700
+ class MiniscriptError_ extends _core.UniffiError {
1048
2701
  /**
1049
2702
  * @private
1050
- * This field is private and should not be used.
2703
+ * This field is private and should not be used, use `tag` instead.
1051
2704
  */
1052
- [_uniffiBindgenReactNative.uniffiTypeNameSymbol] = "DlcError";
1053
- /**
1054
- * @private
1055
- * This field is private and should not be used.
1056
- */
1057
- [_uniffiBindgenReactNative.variantOrdinalSymbol] = 8;
2705
+ [_core.uniffiTypeNameSymbol] = 'DlcError';
1058
2706
  tag = DlcError_Tags.MiniscriptError;
1059
- constructor(message) {
1060
- super("DlcError", "MiniscriptError", message);
2707
+ constructor() {
2708
+ super('DlcError', 'MiniscriptError');
2709
+ }
2710
+ static new() {
2711
+ return new MiniscriptError_();
1061
2712
  }
1062
- static instanceOf(e) {
1063
- return instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 8;
2713
+ static instanceOf(obj) {
2714
+ return obj.tag === DlcError_Tags.MiniscriptError;
2715
+ }
2716
+ static hasInner(obj) {
2717
+ return false;
1064
2718
  }
1065
2719
  }
1066
- class InvalidNetwork extends _uniffiBindgenReactNative.UniffiError {
1067
- /**
1068
- * @private
1069
- * This field is private and should not be used.
1070
- */
1071
- [_uniffiBindgenReactNative.uniffiTypeNameSymbol] = "DlcError";
2720
+ class InvalidNetwork_ extends _core.UniffiError {
1072
2721
  /**
1073
2722
  * @private
1074
- * This field is private and should not be used.
2723
+ * This field is private and should not be used, use `tag` instead.
1075
2724
  */
1076
- [_uniffiBindgenReactNative.variantOrdinalSymbol] = 9;
2725
+ [_core.uniffiTypeNameSymbol] = 'DlcError';
1077
2726
  tag = DlcError_Tags.InvalidNetwork;
1078
- constructor(message) {
1079
- super("DlcError", "InvalidNetwork", message);
2727
+ constructor() {
2728
+ super('DlcError', 'InvalidNetwork');
1080
2729
  }
1081
- static instanceOf(e) {
1082
- return instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 9;
2730
+ static new() {
2731
+ return new InvalidNetwork_();
2732
+ }
2733
+ static instanceOf(obj) {
2734
+ return obj.tag === DlcError_Tags.InvalidNetwork;
2735
+ }
2736
+ static hasInner(obj) {
2737
+ return false;
1083
2738
  }
1084
2739
  }
1085
- class KeyError extends _uniffiBindgenReactNative.UniffiError {
1086
- /**
1087
- * @private
1088
- * This field is private and should not be used.
1089
- */
1090
- [_uniffiBindgenReactNative.uniffiTypeNameSymbol] = "DlcError";
2740
+ class KeyError_ extends _core.UniffiError {
1091
2741
  /**
1092
2742
  * @private
1093
- * This field is private and should not be used.
2743
+ * This field is private and should not be used, use `tag` instead.
1094
2744
  */
1095
- [_uniffiBindgenReactNative.variantOrdinalSymbol] = 10;
2745
+ [_core.uniffiTypeNameSymbol] = 'DlcError';
1096
2746
  tag = DlcError_Tags.KeyError;
1097
- constructor(message) {
1098
- super("DlcError", "KeyError", message);
2747
+ constructor(inner) {
2748
+ super('DlcError', 'KeyError');
2749
+ this.inner = Object.freeze(inner);
2750
+ }
2751
+ static new(inner) {
2752
+ return new KeyError_(inner);
2753
+ }
2754
+ static instanceOf(obj) {
2755
+ return obj.tag === DlcError_Tags.KeyError;
2756
+ }
2757
+ static hasInner(obj) {
2758
+ return KeyError_.instanceOf(obj);
1099
2759
  }
1100
- static instanceOf(e) {
1101
- return instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 10;
2760
+ static getInner(obj) {
2761
+ return obj.inner;
1102
2762
  }
1103
2763
  }
1104
-
1105
- // Utility function which does not rely on instanceof.
1106
- function instanceOf(e) {
1107
- return e[_uniffiBindgenReactNative.uniffiTypeNameSymbol] === "DlcError";
2764
+ function instanceOf(obj) {
2765
+ return obj[_core.uniffiTypeNameSymbol] === 'DlcError';
1108
2766
  }
1109
- return {
1110
- InvalidSignature,
1111
- InvalidPublicKey,
1112
- InvalidTransaction,
1113
- InsufficientFunds,
1114
- InvalidArgument,
1115
- SerializationError,
1116
- Secp256k1Error,
1117
- MiniscriptError,
1118
- InvalidNetwork,
1119
- KeyError,
1120
- instanceOf
1121
- };
2767
+ return Object.freeze({
2768
+ instanceOf,
2769
+ InvalidSignature: InvalidSignature_,
2770
+ InvalidPublicKey: InvalidPublicKey_,
2771
+ InvalidTransaction: InvalidTransaction_,
2772
+ InsufficientFunds: InsufficientFunds_,
2773
+ InvalidArgument: InvalidArgument_,
2774
+ SerializationError: SerializationError_,
2775
+ Secp256k1Error: Secp256k1Error_,
2776
+ MiniscriptError: MiniscriptError_,
2777
+ InvalidNetwork: InvalidNetwork_,
2778
+ KeyError: KeyError_
2779
+ });
1122
2780
  })();
1123
-
1124
- // Union type for DlcError error type.
1125
-
2781
+ // FfiConverter for enum DlcError
1126
2782
  const FfiConverterTypeDLCError = (() => {
1127
- const intConverter = _uniffiBindgenReactNative.FfiConverterInt32;
1128
- class FfiConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
2783
+ const ordinalConverter = _core.FfiConverterInt32;
2784
+ class FFIConverter extends _core.AbstractFfiConverterByteArray {
1129
2785
  read(from) {
1130
- switch (intConverter.read(from)) {
2786
+ switch (ordinalConverter.read(from)) {
1131
2787
  case 1:
1132
- return new DlcError.InvalidSignature(FfiConverterString.read(from));
2788
+ return new DlcError.InvalidSignature();
1133
2789
  case 2:
1134
- return new DlcError.InvalidPublicKey(FfiConverterString.read(from));
2790
+ return new DlcError.InvalidPublicKey();
1135
2791
  case 3:
1136
- return new DlcError.InvalidTransaction(FfiConverterString.read(from));
2792
+ return new DlcError.InvalidTransaction();
1137
2793
  case 4:
1138
- return new DlcError.InsufficientFunds(FfiConverterString.read(from));
2794
+ return new DlcError.InsufficientFunds();
1139
2795
  case 5:
1140
- return new DlcError.InvalidArgument(FfiConverterString.read(from));
2796
+ return new DlcError.InvalidArgument({
2797
+ message: FfiConverterString.read(from)
2798
+ });
1141
2799
  case 6:
1142
- return new DlcError.SerializationError(FfiConverterString.read(from));
2800
+ return new DlcError.SerializationError();
1143
2801
  case 7:
1144
- return new DlcError.Secp256k1Error(FfiConverterString.read(from));
2802
+ return new DlcError.Secp256k1Error({
2803
+ message: FfiConverterString.read(from)
2804
+ });
1145
2805
  case 8:
1146
- return new DlcError.MiniscriptError(FfiConverterString.read(from));
2806
+ return new DlcError.MiniscriptError();
1147
2807
  case 9:
1148
- return new DlcError.InvalidNetwork(FfiConverterString.read(from));
2808
+ return new DlcError.InvalidNetwork();
1149
2809
  case 10:
1150
- return new DlcError.KeyError(FfiConverterString.read(from));
2810
+ return new DlcError.KeyError({
2811
+ key: FfiConverterTypeExtendedKey.read(from)
2812
+ });
1151
2813
  default:
1152
- throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
2814
+ throw new _core.UniffiInternalError.UnexpectedEnumCase();
1153
2815
  }
1154
2816
  }
1155
2817
  write(value, into) {
1156
- const obj = value;
1157
- const index = obj[_uniffiBindgenReactNative.variantOrdinalSymbol];
1158
- intConverter.write(index, into);
2818
+ switch (value.tag) {
2819
+ case DlcError_Tags.InvalidSignature:
2820
+ {
2821
+ ordinalConverter.write(1, into);
2822
+ return;
2823
+ }
2824
+ case DlcError_Tags.InvalidPublicKey:
2825
+ {
2826
+ ordinalConverter.write(2, into);
2827
+ return;
2828
+ }
2829
+ case DlcError_Tags.InvalidTransaction:
2830
+ {
2831
+ ordinalConverter.write(3, into);
2832
+ return;
2833
+ }
2834
+ case DlcError_Tags.InsufficientFunds:
2835
+ {
2836
+ ordinalConverter.write(4, into);
2837
+ return;
2838
+ }
2839
+ case DlcError_Tags.InvalidArgument:
2840
+ {
2841
+ ordinalConverter.write(5, into);
2842
+ const inner = value.inner;
2843
+ FfiConverterString.write(inner.message, into);
2844
+ return;
2845
+ }
2846
+ case DlcError_Tags.SerializationError:
2847
+ {
2848
+ ordinalConverter.write(6, into);
2849
+ return;
2850
+ }
2851
+ case DlcError_Tags.Secp256k1Error:
2852
+ {
2853
+ ordinalConverter.write(7, into);
2854
+ const inner = value.inner;
2855
+ FfiConverterString.write(inner.message, into);
2856
+ return;
2857
+ }
2858
+ case DlcError_Tags.MiniscriptError:
2859
+ {
2860
+ ordinalConverter.write(8, into);
2861
+ return;
2862
+ }
2863
+ case DlcError_Tags.InvalidNetwork:
2864
+ {
2865
+ ordinalConverter.write(9, into);
2866
+ return;
2867
+ }
2868
+ case DlcError_Tags.KeyError:
2869
+ {
2870
+ ordinalConverter.write(10, into);
2871
+ const inner = value.inner;
2872
+ FfiConverterTypeExtendedKey.write(inner.key, into);
2873
+ return;
2874
+ }
2875
+ default:
2876
+ // Throwing from here means that DlcError_Tags hasn't matched an ordinal.
2877
+ throw new _core.UniffiInternalError.UnexpectedEnumCase();
2878
+ }
1159
2879
  }
1160
2880
  allocationSize(value) {
1161
- return intConverter.allocationSize(0);
2881
+ switch (value.tag) {
2882
+ case DlcError_Tags.InvalidSignature:
2883
+ {
2884
+ return ordinalConverter.allocationSize(1);
2885
+ }
2886
+ case DlcError_Tags.InvalidPublicKey:
2887
+ {
2888
+ return ordinalConverter.allocationSize(2);
2889
+ }
2890
+ case DlcError_Tags.InvalidTransaction:
2891
+ {
2892
+ return ordinalConverter.allocationSize(3);
2893
+ }
2894
+ case DlcError_Tags.InsufficientFunds:
2895
+ {
2896
+ return ordinalConverter.allocationSize(4);
2897
+ }
2898
+ case DlcError_Tags.InvalidArgument:
2899
+ {
2900
+ const inner = value.inner;
2901
+ let size = ordinalConverter.allocationSize(5);
2902
+ size += FfiConverterString.allocationSize(inner.message);
2903
+ return size;
2904
+ }
2905
+ case DlcError_Tags.SerializationError:
2906
+ {
2907
+ return ordinalConverter.allocationSize(6);
2908
+ }
2909
+ case DlcError_Tags.Secp256k1Error:
2910
+ {
2911
+ const inner = value.inner;
2912
+ let size = ordinalConverter.allocationSize(7);
2913
+ size += FfiConverterString.allocationSize(inner.message);
2914
+ return size;
2915
+ }
2916
+ case DlcError_Tags.MiniscriptError:
2917
+ {
2918
+ return ordinalConverter.allocationSize(8);
2919
+ }
2920
+ case DlcError_Tags.InvalidNetwork:
2921
+ {
2922
+ return ordinalConverter.allocationSize(9);
2923
+ }
2924
+ case DlcError_Tags.KeyError:
2925
+ {
2926
+ const inner = value.inner;
2927
+ let size = ordinalConverter.allocationSize(10);
2928
+ size += FfiConverterTypeExtendedKey.allocationSize(inner.key);
2929
+ return size;
2930
+ }
2931
+ default:
2932
+ throw new _core.UniffiInternalError.UnexpectedEnumCase();
2933
+ }
1162
2934
  }
1163
2935
  }
1164
- return new FfiConverter();
2936
+ return new FFIConverter();
1165
2937
  })();
1166
2938
 
1167
- // Flat error type: ExtendedKey
1168
- let ExtendedKey_Tags = exports.ExtendedKey_Tags = /*#__PURE__*/function (ExtendedKey_Tags) {
1169
- ExtendedKey_Tags["InvalidMnemonic"] = "InvalidMnemonic";
1170
- ExtendedKey_Tags["InvalidXpriv"] = "InvalidXpriv";
1171
- ExtendedKey_Tags["InvalidXpub"] = "InvalidXpub";
1172
- ExtendedKey_Tags["InvalidDerivationPath"] = "InvalidDerivationPath";
1173
- return ExtendedKey_Tags;
2939
+ /**
2940
+ * Identifies which party's funding inputs an operation applies to.
2941
+ */
2942
+ let Party = exports.Party = /*#__PURE__*/function (Party) {
2943
+ /**
2944
+ * The party that created the offer.
2945
+ */
2946
+ Party[Party["Offer"] = 0] = "Offer";
2947
+ /**
2948
+ * The party that accepted the offer.
2949
+ */
2950
+ Party[Party["Accept"] = 1] = "Accept";
2951
+ return Party;
1174
2952
  }({});
1175
- const ExtendedKey = exports.ExtendedKey = (() => {
1176
- class InvalidMnemonic extends _uniffiBindgenReactNative.UniffiError {
1177
- /**
1178
- * @private
1179
- * This field is private and should not be used.
1180
- */
1181
- [_uniffiBindgenReactNative.uniffiTypeNameSymbol] = "ExtendedKey";
1182
- /**
1183
- * @private
1184
- * This field is private and should not be used.
1185
- */
1186
- [_uniffiBindgenReactNative.variantOrdinalSymbol] = 1;
1187
- tag = ExtendedKey_Tags.InvalidMnemonic;
1188
- constructor(message) {
1189
- super("ExtendedKey", "InvalidMnemonic", message);
1190
- }
1191
- static instanceOf(e) {
1192
- return instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 1;
2953
+ const FfiConverterTypeParty = (() => {
2954
+ const ordinalConverter = _core.FfiConverterInt32;
2955
+ class FFIConverter extends _core.AbstractFfiConverterByteArray {
2956
+ read(from) {
2957
+ switch (ordinalConverter.read(from)) {
2958
+ case 1:
2959
+ return Party.Offer;
2960
+ case 2:
2961
+ return Party.Accept;
2962
+ default:
2963
+ throw new _core.UniffiInternalError.UnexpectedEnumCase();
2964
+ }
1193
2965
  }
1194
- }
1195
- class InvalidXpriv extends _uniffiBindgenReactNative.UniffiError {
1196
- /**
1197
- * @private
1198
- * This field is private and should not be used.
1199
- */
1200
- [_uniffiBindgenReactNative.uniffiTypeNameSymbol] = "ExtendedKey";
1201
- /**
1202
- * @private
1203
- * This field is private and should not be used.
1204
- */
1205
- [_uniffiBindgenReactNative.variantOrdinalSymbol] = 2;
1206
- tag = ExtendedKey_Tags.InvalidXpriv;
1207
- constructor(message) {
1208
- super("ExtendedKey", "InvalidXpriv", message);
2966
+ write(value, into) {
2967
+ switch (value) {
2968
+ case Party.Offer:
2969
+ return ordinalConverter.write(1, into);
2970
+ case Party.Accept:
2971
+ return ordinalConverter.write(2, into);
2972
+ }
1209
2973
  }
1210
- static instanceOf(e) {
1211
- return instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 2;
2974
+ allocationSize(value) {
2975
+ return ordinalConverter.allocationSize(0);
1212
2976
  }
1213
2977
  }
1214
- class InvalidXpub extends _uniffiBindgenReactNative.UniffiError {
1215
- /**
1216
- * @private
1217
- * This field is private and should not be used.
1218
- */
1219
- [_uniffiBindgenReactNative.uniffiTypeNameSymbol] = "ExtendedKey";
1220
- /**
1221
- * @private
1222
- * This field is private and should not be used.
1223
- */
1224
- [_uniffiBindgenReactNative.variantOrdinalSymbol] = 3;
1225
- tag = ExtendedKey_Tags.InvalidXpub;
1226
- constructor(message) {
1227
- super("ExtendedKey", "InvalidXpub", message);
1228
- }
1229
- static instanceOf(e) {
1230
- return instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 3;
1231
- }
2978
+ return new FFIConverter();
2979
+ })();
2980
+
2981
+ /**
2982
+ * Deterministically derives DLC contract funding keys from a master extended
2983
+ * private key. Secret keys never leave this object.
2984
+ *
2985
+ * Construct one from whatever key material the consumer holds, then call
2986
+ * [`ContractKeyProvider::funding_pubkey`] to obtain the public key to publish
2987
+ * in an offer/accept message.
2988
+ */
2989
+
2990
+ /**
2991
+ * @deprecated Use `ContractKeyProviderLike` instead.
2992
+ */
2993
+
2994
+ /**
2995
+ * Deterministically derives DLC contract funding keys from a master extended
2996
+ * private key. Secret keys never leave this object.
2997
+ *
2998
+ * Construct one from whatever key material the consumer holds, then call
2999
+ * [`ContractKeyProvider::funding_pubkey`] to obtain the public key to publish
3000
+ * in an offer/accept message.
3001
+ */
3002
+ class ContractKeyProvider extends _core.UniffiAbstractObject {
3003
+ [_core.uniffiTypeNameSymbol] = 'ContractKeyProvider';
3004
+ // No primary constructor declared for this class.
3005
+ constructor(pointer) {
3006
+ super();
3007
+ this[_core.pointerLiteralSymbol] = pointer;
3008
+ this[_core.destructorGuardSymbol] = uniffiTypeContractKeyProviderObjectFactory.bless(pointer);
1232
3009
  }
1233
- class InvalidDerivationPath extends _uniffiBindgenReactNative.UniffiError {
1234
- /**
1235
- * @private
1236
- * This field is private and should not be used.
1237
- */
1238
- [_uniffiBindgenReactNative.uniffiTypeNameSymbol] = "ExtendedKey";
1239
- /**
1240
- * @private
1241
- * This field is private and should not be used.
1242
- */
1243
- [_uniffiBindgenReactNative.variantOrdinalSymbol] = 4;
1244
- tag = ExtendedKey_Tags.InvalidDerivationPath;
1245
- constructor(message) {
1246
- super("ExtendedKey", "InvalidDerivationPath", message);
1247
- }
1248
- static instanceOf(e) {
1249
- return instanceOf(e) && e[_uniffiBindgenReactNative.variantOrdinalSymbol] === 4;
1250
- }
3010
+
3011
+ /**
3012
+ * Builds a provider from an output descriptor that carries an extended
3013
+ * private key (e.g. `wpkh(xprv.../84h/1h/0h/0/*)`). Watch-only descriptors
3014
+ * are rejected; the descriptor's own path/wildcard is not applied to
3015
+ * contract-key derivation.
3016
+ */
3017
+ static fromDescriptor(descriptor) /*throws*/{
3018
+ return FfiConverterTypeContractKeyProvider.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
3019
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_constructor_contractkeyprovider_from_descriptor(FfiConverterString.lower(descriptor, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
3020
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
1251
3021
  }
1252
3022
 
1253
- // Utility function which does not rely on instanceof.
1254
- function instanceOf(e) {
1255
- return e[_uniffiBindgenReactNative.uniffiTypeNameSymbol] === "ExtendedKey";
3023
+ /**
3024
+ * Builds a provider from a BIP39 mnemonic (with optional passphrase).
3025
+ */
3026
+ static fromMnemonic(mnemonic, passphrase, network) /*throws*/{
3027
+ return FfiConverterTypeContractKeyProvider.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
3028
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_constructor_contractkeyprovider_from_mnemonic(FfiConverterString.lower(mnemonic, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterOptionalString.lower(passphrase, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterString.lower(network, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
3029
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
1256
3030
  }
1257
- return {
1258
- InvalidMnemonic,
1259
- InvalidXpriv,
1260
- InvalidXpub,
1261
- InvalidDerivationPath,
1262
- instanceOf
1263
- };
1264
- })();
1265
3031
 
1266
- // Union type for ExtendedKey error type.
3032
+ /**
3033
+ * Builds a provider from a raw seed (for example the 64 bytes produced by
3034
+ * `convert_mnemonic_to_seed`).
3035
+ */
3036
+ static fromSeed(seed, network) /*throws*/{
3037
+ return FfiConverterTypeContractKeyProvider.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
3038
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_constructor_contractkeyprovider_from_seed(_core.FfiConverterArrayBuffer.lower(seed, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterString.lower(network, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
3039
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
3040
+ }
1267
3041
 
1268
- const FfiConverterTypeExtendedKey = (() => {
1269
- const intConverter = _uniffiBindgenReactNative.FfiConverterInt32;
1270
- class FfiConverter extends _uniffiBindgenReactNative.AbstractFfiConverterByteArray {
1271
- read(from) {
1272
- switch (intConverter.read(from)) {
1273
- case 1:
1274
- return new ExtendedKey.InvalidMnemonic(FfiConverterString.read(from));
1275
- case 2:
1276
- return new ExtendedKey.InvalidXpriv(FfiConverterString.read(from));
1277
- case 3:
1278
- return new ExtendedKey.InvalidXpub(FfiConverterString.read(from));
1279
- case 4:
1280
- return new ExtendedKey.InvalidDerivationPath(FfiConverterString.read(from));
1281
- default:
1282
- throw new _uniffiBindgenReactNative.UniffiInternalError.UnexpectedEnumCase();
3042
+ /**
3043
+ * Builds a provider from a 78-byte encoded master extended private key
3044
+ * (the encoding produced by `create_extkey_from_seed`).
3045
+ */
3046
+ static fromXprv(xprv) /*throws*/{
3047
+ return FfiConverterTypeContractKeyProvider.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
3048
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_constructor_contractkeyprovider_from_xprv(_core.FfiConverterArrayBuffer.lower(xprv, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
3049
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
3050
+ }
3051
+
3052
+ /**
3053
+ * The 33-byte compressed funding public key for a contract, from its
3054
+ * 32-byte temporary id. Publish this in the offer or accept message.
3055
+ */
3056
+ fundingPubkey(temporaryContractId) /*throws*/{
3057
+ return (__rb => {
3058
+ try {
3059
+ return _core.FfiConverterArrayBuffer.lift(__rb);
3060
+ } finally {
3061
+ (0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
1283
3062
  }
1284
- }
1285
- write(value, into) {
1286
- const obj = value;
1287
- const index = obj[_uniffiBindgenReactNative.variantOrdinalSymbol];
1288
- intConverter.write(index, into);
1289
- }
1290
- allocationSize(value) {
1291
- return intConverter.allocationSize(0);
3063
+ })(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
3064
+ return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_method_contractkeyprovider_funding_pubkey(uniffiTypeContractKeyProviderObjectFactory.clonePointer(this), _core.FfiConverterArrayBuffer.lower(temporaryContractId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
3065
+ }, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
3066
+ }
3067
+ uniffiDestroy() {
3068
+ const ptr = this[_core.destructorGuardSymbol];
3069
+ if (ptr !== undefined) {
3070
+ const pointer = uniffiTypeContractKeyProviderObjectFactory.pointer(this);
3071
+ uniffiTypeContractKeyProviderObjectFactory.freePointer(pointer);
3072
+ uniffiTypeContractKeyProviderObjectFactory.unbless(ptr);
3073
+ delete this[_core.destructorGuardSymbol];
1292
3074
  }
1293
3075
  }
1294
- return new FfiConverter();
3076
+ static instanceOf(obj_) {
3077
+ return uniffiTypeContractKeyProviderObjectFactory.isConcreteType(obj_);
3078
+ }
3079
+ }
3080
+ exports.ContractKeyProvider = ContractKeyProvider;
3081
+ const uniffiTypeContractKeyProviderObjectFactory = (() => {
3082
+ return {
3083
+ create(pointer) {
3084
+ const instance = Object.create(ContractKeyProvider.prototype);
3085
+ instance[_core.pointerLiteralSymbol] = pointer;
3086
+ instance[_core.destructorGuardSymbol] = this.bless(pointer);
3087
+ instance[_core.uniffiTypeNameSymbol] = 'ContractKeyProvider';
3088
+ return instance;
3089
+ },
3090
+ bless(p) {
3091
+ return uniffiCaller.rustCall(/*caller:*/status => (0, _ddk_ffiFfi.default)().ubrn_uniffi_internal_fn_method_contractkeyprovider_ffi__bless_pointer(p, status), /*liftString:*/FfiConverterString.lift);
3092
+ },
3093
+ unbless(ptr_) {
3094
+ ptr_.markDestroyed();
3095
+ },
3096
+ pointer(obj_) {
3097
+ if (obj_[_core.destructorGuardSymbol] === undefined) {
3098
+ throw new _core.UniffiInternalError.UnexpectedNullPointer();
3099
+ }
3100
+ return obj_[_core.pointerLiteralSymbol];
3101
+ },
3102
+ clonePointer(obj_) {
3103
+ const pointer = this.pointer(obj_);
3104
+ return uniffiCaller.rustCall(/*caller:*/callStatus => (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_clone_contractkeyprovider(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
3105
+ },
3106
+ freePointer(pointer) {
3107
+ uniffiCaller.rustCall(/*caller:*/callStatus => (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_free_contractkeyprovider(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
3108
+ },
3109
+ isConcreteType(obj_) {
3110
+ return obj_[_core.destructorGuardSymbol] && obj_[_core.uniffiTypeNameSymbol] === 'ContractKeyProvider';
3111
+ }
3112
+ };
1295
3113
  })();
3114
+ const FfiConverterTypeContractKeyProvider = new _core.FfiConverterObject(uniffiTypeContractKeyProviderObjectFactory);
1296
3115
 
1297
- // FfiConverter for string | undefined
1298
- const FfiConverterOptionalString = new _uniffiBindgenReactNative.FfiConverterOptional(FfiConverterString);
1299
-
1300
- // FfiConverter for Array<AdaptorSignature>
1301
- const FfiConverterArrayTypeAdaptorSignature = new _uniffiBindgenReactNative.FfiConverterArray(FfiConverterTypeAdaptorSignature);
3116
+ // FfiConverter for Array<ArrayBuffer>
3117
+ const FfiConverterSequenceBytes = new _core.FfiConverterArray(_core.FfiConverterArrayBuffer);
1302
3118
 
1303
- // FfiConverter for Array<DlcInputInfo>
1304
- const FfiConverterArrayTypeDlcInputInfo = new _uniffiBindgenReactNative.FfiConverterArray(FfiConverterTypeDlcInputInfo);
3119
+ // FfiConverter for bigint | undefined
3120
+ const FfiConverterOptionalUInt64 = new _core.FfiConverterOptional(_core.FfiConverterUInt64);
1305
3121
 
1306
- // FfiConverter for Array<OracleInfo>
1307
- const FfiConverterArrayTypeOracleInfo = new _uniffiBindgenReactNative.FfiConverterArray(FfiConverterTypeOracleInfo);
3122
+ // FfiConverter for Array<TxInput>
3123
+ const FfiConverterSequenceTypeTxInput = new _core.FfiConverterArray(FfiConverterTypeTxInput);
1308
3124
 
1309
- // FfiConverter for Array<Payout>
1310
- const FfiConverterArrayTypePayout = new _uniffiBindgenReactNative.FfiConverterArray(FfiConverterTypePayout);
3125
+ // FfiConverter for Array<TxOutput>
3126
+ const FfiConverterSequenceTypeTxOutput = new _core.FfiConverterArray(FfiConverterTypeTxOutput);
1311
3127
 
1312
3128
  // FfiConverter for Array<Transaction>
1313
- const FfiConverterArrayTypeTransaction = new _uniffiBindgenReactNative.FfiConverterArray(FfiConverterTypeTransaction);
3129
+ const FfiConverterSequenceTypeTransaction = new _core.FfiConverterArray(FfiConverterTypeTransaction);
1314
3130
 
1315
- // FfiConverter for Array<TxInput>
1316
- const FfiConverterArrayTypeTxInput = new _uniffiBindgenReactNative.FfiConverterArray(FfiConverterTypeTxInput);
3131
+ // FfiConverter for string | undefined
3132
+ const FfiConverterOptionalString = new _core.FfiConverterOptional(FfiConverterString);
3133
+
3134
+ // FfiConverter for Array<PayoutRow>
3135
+ const FfiConverterSequenceTypePayoutRow = new _core.FfiConverterArray(FfiConverterTypePayoutRow);
3136
+
3137
+ // FfiConverter for ArrayBuffer | undefined
3138
+ const FfiConverterOptionalBytes = new _core.FfiConverterOptional(_core.FfiConverterArrayBuffer);
1317
3139
 
1318
3140
  // FfiConverter for Array<TxInputInfo>
1319
- const FfiConverterArrayTypeTxInputInfo = new _uniffiBindgenReactNative.FfiConverterArray(FfiConverterTypeTxInputInfo);
3141
+ const FfiConverterSequenceTypeTxInputInfo = new _core.FfiConverterArray(FfiConverterTypeTxInputInfo);
1320
3142
 
1321
- // FfiConverter for Array<TxOutput>
1322
- const FfiConverterArrayTypeTxOutput = new _uniffiBindgenReactNative.FfiConverterArray(FfiConverterTypeTxOutput);
3143
+ // FfiConverter for Array<DlcInputInfo>
3144
+ const FfiConverterSequenceTypeDlcInputInfo = new _core.FfiConverterArray(FfiConverterTypeDlcInputInfo);
3145
+
3146
+ // FfiConverter for Array<OracleInfo>
3147
+ const FfiConverterSequenceTypeOracleInfo = new _core.FfiConverterArray(FfiConverterTypeOracleInfo);
3148
+
3149
+ // FfiConverter for Array<Array<ArrayBuffer>>
3150
+ const FfiConverterSequenceSequenceBytes = new _core.FfiConverterArray(FfiConverterSequenceBytes);
3151
+
3152
+ // FfiConverter for Array<Array<Array<ArrayBuffer>>>
3153
+ const FfiConverterSequenceSequenceSequenceBytes = new _core.FfiConverterArray(FfiConverterSequenceSequenceBytes);
1323
3154
 
1324
- // FfiConverter for Array</*u8*/number>
1325
- const FfiConverterArrayUInt8 = new _uniffiBindgenReactNative.FfiConverterArray(_uniffiBindgenReactNative.FfiConverterUInt8);
3155
+ // FfiConverter for Array<AdaptorSignature>
3156
+ const FfiConverterSequenceTypeAdaptorSignature = new _core.FfiConverterArray(FfiConverterTypeAdaptorSignature);
3157
+
3158
+ // FfiConverter for Array<Payout>
3159
+ const FfiConverterSequenceTypePayout = new _core.FfiConverterArray(FfiConverterTypePayout);
1326
3160
 
1327
- // FfiConverter for Array<Array</*u8*/number>>
1328
- const FfiConverterArrayArrayUInt8 = new _uniffiBindgenReactNative.FfiConverterArray(FfiConverterArrayUInt8);
3161
+ // FfiConverter for Array<SpliceKeyRef>
3162
+ const FfiConverterSequenceTypeSpliceKeyRef = new _core.FfiConverterArray(FfiConverterTypeSpliceKeyRef);
1329
3163
 
1330
- // FfiConverter for Array<Array<Array</*u8*/number>>>
1331
- const FfiConverterArrayArrayArrayUInt8 = new _uniffiBindgenReactNative.FfiConverterArray(FfiConverterArrayArrayUInt8);
3164
+ // FfiConverter for Array<OracleAttestationRef>
3165
+ const FfiConverterSequenceTypeOracleAttestationRef = new _core.FfiConverterArray(FfiConverterTypeOracleAttestationRef);
1332
3166
 
1333
- // FfiConverter for Array<Array<Array<Array</*u8*/number>>>>
1334
- const FfiConverterArrayArrayArrayArrayUInt8 = new _uniffiBindgenReactNative.FfiConverterArray(FfiConverterArrayArrayArrayUInt8);
3167
+ // FfiConverter for Array<DescriptorInput>
3168
+ const FfiConverterSequenceTypeDescriptorInput = new _core.FfiConverterArray(FfiConverterTypeDescriptorInput);
1335
3169
 
1336
3170
  /**
1337
3171
  * This should be called before anything else.
@@ -1345,119 +3179,171 @@ const FfiConverterArrayArrayArrayArrayUInt8 = new _uniffiBindgenReactNative.FfiC
1345
3179
  */
1346
3180
  function uniffiEnsureInitialized() {
1347
3181
  // Get the bindings contract version from our ComponentInterface
1348
- const bindingsContractVersion = 29;
3182
+ const bindingsContractVersion = 30;
1349
3183
  // Get the scaffolding contract version by calling the into the dylib
1350
3184
  const scaffoldingContractVersion = (0, _ddk_ffiFfi.default)().ubrn_ffi_ddk_ffi_uniffi_contract_version();
1351
3185
  if (bindingsContractVersion !== scaffoldingContractVersion) {
1352
- throw new _uniffiBindgenReactNative.UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
3186
+ throw new _core.UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
3187
+ }
3188
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_accept_offer() !== 49334) {
3189
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_accept_offer');
3190
+ }
3191
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_chain_hash_from_network() !== 782) {
3192
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_chain_hash_from_network');
3193
+ }
3194
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_compute_contract_id() !== 7849) {
3195
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_compute_contract_id');
3196
+ }
3197
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_contract_info_payouts() !== 5148) {
3198
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_contract_info_payouts');
3199
+ }
3200
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed() !== 29793) {
3201
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed');
3202
+ }
3203
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_cet() !== 62951) {
3204
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_cet');
3205
+ }
3206
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_points_from_oracle_info() !== 14977) {
3207
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_cet_adaptor_points_from_oracle_info');
3208
+ }
3209
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_oracle_info() !== 5605) {
3210
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_oracle_info');
3211
+ }
3212
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_points() !== 39452) {
3213
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_points');
3214
+ }
3215
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_cets() !== 22051) {
3216
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_cets');
3217
+ }
3218
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_dlc_splice_input() !== 50727) {
3219
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_dlc_splice_input');
3220
+ }
3221
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_dlc_transactions() !== 60266) {
3222
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_dlc_transactions');
3223
+ }
3224
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_extkey_from_parent_path() !== 23090) {
3225
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_extkey_from_parent_path');
1353
3226
  }
1354
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_add_signature_to_transaction() !== 1337) {
1355
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_add_signature_to_transaction");
3227
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_extkey_from_seed() !== 45469) {
3228
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_extkey_from_seed');
1356
3229
  }
1357
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed() !== 65049) {
1358
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed");
3230
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_fund_tx_locking_script() !== 37235) {
3231
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_fund_tx_locking_script');
1359
3232
  }
1360
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_cet() !== 23081) {
1361
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_cet");
3233
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_funding_psbt() !== 39942) {
3234
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_funding_psbt');
1362
3235
  }
1363
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_points_from_oracle_info() !== 6552) {
1364
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_cet_adaptor_points_from_oracle_info");
3236
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_offer() !== 39327) {
3237
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_offer');
1365
3238
  }
1366
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_signature_from_oracle_info() !== 65174) {
1367
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_cet_adaptor_signature_from_oracle_info");
3239
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_refund_transaction() !== 40230) {
3240
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_refund_transaction');
1368
3241
  }
1369
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_oracle_info() !== 15699) {
1370
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_oracle_info");
3242
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions() !== 55101) {
3243
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions');
1371
3244
  }
1372
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_points() !== 33705) {
1373
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_points");
3245
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path() !== 7895) {
3246
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path');
1374
3247
  }
1375
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_cets() !== 50529) {
1376
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_cets");
3248
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_dlc_input_max_witness_len() !== 49586) {
3249
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_dlc_input_max_witness_len');
1377
3250
  }
1378
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_dlc_transactions() !== 51134) {
1379
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_dlc_transactions");
3251
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_dlc_transactions_from_messages() !== 56492) {
3252
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_dlc_transactions_from_messages');
1380
3253
  }
1381
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_extkey_from_parent_path() !== 26671) {
1382
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_extkey_from_parent_path");
3254
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_extract_ecdsa_signature_from_oracle_signatures() !== 4868) {
3255
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_extract_ecdsa_signature_from_oracle_signatures');
1383
3256
  }
1384
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_extkey_from_seed() !== 12526) {
1385
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_extkey_from_seed");
3257
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_finalize_sign() !== 20463) {
3258
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_finalize_sign');
1386
3259
  }
1387
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_fund_tx_locking_script() !== 2761) {
1388
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_fund_tx_locking_script");
3260
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_finalize_sign_spliced() !== 32005) {
3261
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_finalize_sign_spliced');
1389
3262
  }
1390
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_refund_transaction() !== 57261) {
1391
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_refund_transaction");
3263
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_funding_input() !== 64911) {
3264
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_funding_input');
1392
3265
  }
1393
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions() !== 31130) {
1394
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions");
3266
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_get_pubkey_from_extkey() !== 18050) {
3267
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_get_pubkey_from_extkey');
1395
3268
  }
1396
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path() !== 34808) {
1397
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path");
3269
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_get_total_input_vsize() !== 2998) {
3270
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_get_total_input_vsize');
1398
3271
  }
1399
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_extract_ecdsa_signature_from_oracle_signatures() !== 8006) {
1400
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_extract_ecdsa_signature_from_oracle_signatures");
3272
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv() !== 8843) {
3273
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv');
1401
3274
  }
1402
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_get_cet_adaptor_signature_inputs() !== 14595) {
1403
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_get_cet_adaptor_signature_inputs");
3275
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_sign_accept() !== 37062) {
3276
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_sign_accept');
1404
3277
  }
1405
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_get_cet_sighash() !== 10643) {
1406
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_get_cet_sighash");
3278
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_sign_accept_spliced() !== 32504) {
3279
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_sign_accept_spliced');
1407
3280
  }
1408
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_get_change_output_and_fees() !== 44150) {
1409
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_get_change_output_and_fees");
3281
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_sign_contract_cet() !== 36727) {
3282
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_sign_contract_cet');
1410
3283
  }
1411
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_get_pubkey_from_extkey() !== 64637) {
1412
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_get_pubkey_from_extkey");
3284
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_sign_contract_refund() !== 23156) {
3285
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_sign_contract_refund');
1413
3286
  }
1414
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_get_raw_funding_transaction_input_signature() !== 35708) {
1415
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_get_raw_funding_transaction_input_signature");
3287
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_sign_funding_psbt_with_descriptor() !== 25961) {
3288
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_sign_funding_psbt_with_descriptor');
1416
3289
  }
1417
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_get_total_input_vsize() !== 38213) {
1418
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_get_total_input_vsize");
3290
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_validate_accept() !== 9081) {
3291
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_validate_accept');
1419
3292
  }
1420
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv() !== 44344) {
1421
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv");
3293
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_validate_offer() !== 24632) {
3294
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_validate_offer');
1422
3295
  }
1423
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_is_dust_output() !== 64174) {
1424
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_is_dust_output");
3296
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_validate_sign() !== 7419) {
3297
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_validate_sign');
1425
3298
  }
1426
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_sign_cet() !== 43957) {
1427
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_sign_cet");
3299
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_verify_cet_adaptor_sigs_from_oracle_info() !== 32235) {
3300
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_verify_cet_adaptor_sigs_from_oracle_info');
1428
3301
  }
1429
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_sign_fund_transaction_input() !== 50531) {
1430
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_sign_fund_transaction_input");
3302
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_version() !== 2994) {
3303
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_version');
1431
3304
  }
1432
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_sign_multi_sig_input() !== 14569) {
1433
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_sign_multi_sig_input");
3305
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_constructor_contractkeyprovider_from_descriptor() !== 47034) {
3306
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_constructor_contractkeyprovider_from_descriptor');
1434
3307
  }
1435
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_verify_cet_adaptor_sig_from_oracle_info() !== 52232) {
1436
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_verify_cet_adaptor_sig_from_oracle_info");
3308
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_constructor_contractkeyprovider_from_mnemonic() !== 47667) {
3309
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_constructor_contractkeyprovider_from_mnemonic');
1437
3310
  }
1438
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_verify_cet_adaptor_sigs_from_oracle_info() !== 14181) {
1439
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_verify_cet_adaptor_sigs_from_oracle_info");
3311
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_constructor_contractkeyprovider_from_seed() !== 47192) {
3312
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_constructor_contractkeyprovider_from_seed');
1440
3313
  }
1441
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_verify_fund_tx_signature() !== 27316) {
1442
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_verify_fund_tx_signature");
3314
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_constructor_contractkeyprovider_from_xprv() !== 7002) {
3315
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_constructor_contractkeyprovider_from_xprv');
1443
3316
  }
1444
- if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_version() !== 22317) {
1445
- throw new _uniffiBindgenReactNative.UniffiInternalError.ApiChecksumMismatch("uniffi_ddk_ffi_checksum_func_version");
3317
+ if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_method_contractkeyprovider_funding_pubkey() !== 58577) {
3318
+ throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_method_contractkeyprovider_funding_pubkey');
1446
3319
  }
1447
3320
  }
1448
3321
  var _default = exports.default = Object.freeze({
1449
3322
  initialize: uniffiEnsureInitialized,
1450
3323
  converters: {
3324
+ FfiConverterTypeAcceptOfferParams,
3325
+ FfiConverterTypeAcceptResult,
1451
3326
  FfiConverterTypeAdaptorSignature,
1452
3327
  FfiConverterTypeCetAdaptorSignatureDebugInfo,
1453
3328
  FfiConverterTypeChangeOutputAndFees,
3329
+ FfiConverterTypeContractError,
3330
+ FfiConverterTypeContractKeyProvider,
3331
+ FfiConverterTypeContractPartyParams,
3332
+ FfiConverterTypeContractPayouts,
3333
+ FfiConverterTypeCreateOfferParams,
1454
3334
  FfiConverterTypeDLCError,
3335
+ FfiConverterTypeDescriptorInput,
1455
3336
  FfiConverterTypeDlcInputInfo,
1456
3337
  FfiConverterTypeDlcTransactions,
1457
3338
  FfiConverterTypeExtendedKey,
3339
+ FfiConverterTypeOracleAttestationRef,
1458
3340
  FfiConverterTypeOracleInfo,
3341
+ FfiConverterTypeParty,
1459
3342
  FfiConverterTypePartyParams,
1460
3343
  FfiConverterTypePayout,
3344
+ FfiConverterTypePayoutRow,
3345
+ FfiConverterTypeSignResult,
3346
+ FfiConverterTypeSpliceKeyRef,
1461
3347
  FfiConverterTypeTransaction,
1462
3348
  FfiConverterTypeTxInput,
1463
3349
  FfiConverterTypeTxInputInfo,