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