@bennyblader/ddk-rn 0.4.0 → 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/README.md +184 -49
- 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/ddk_ffi.cpp +1120 -33
- package/cpp/ddk_ffi.hpp +53 -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.map +1 -1
- package/lib/commonjs/ddk_ffi.js +2097 -228
- package/lib/commonjs/ddk_ffi.js.map +1 -1
- package/lib/module/ddk_ffi-ffi.js.map +1 -1
- package/lib/module/ddk_ffi.js +2076 -228
- package/lib/module/ddk_ffi.js.map +1 -1
- package/lib/typescript/commonjs/src/ddk_ffi-ffi.d.ts +54 -1
- package/lib/typescript/commonjs/src/ddk_ffi-ffi.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ddk_ffi.d.ts +2251 -201
- package/lib/typescript/commonjs/src/ddk_ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/ddk_ffi-ffi.d.ts +54 -1
- package/lib/typescript/module/src/ddk_ffi-ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/ddk_ffi.d.ts +2251 -201
- package/lib/typescript/module/src/ddk_ffi.d.ts.map +1 -1
- package/package.json +17 -8
- package/src/ddk_ffi-ffi.ts +190 -0
- package/src/ddk_ffi.ts +3530 -506
package/lib/commonjs/ddk_ffi.js
CHANGED
|
@@ -3,25 +3,45 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.TxOutput = exports.TxInputInfo = exports.TxInput = exports.Transaction = exports.Payout = exports.PartyParams = exports.OracleInfo = exports.ExtendedKey = exports.DlcTransactions = exports.DlcInputInfo = exports.DlcError_Tags = exports.DlcError = exports.ChangeOutputAndFees = exports.CetAdaptorSignatureDebugInfo = exports.AdaptorSignature = void 0;
|
|
6
|
+
exports.TxOutput = exports.TxInputInfo = exports.TxInput = exports.Transaction = exports.SpliceKeyRef = exports.SignResult = exports.PayoutRow = exports.Payout = exports.PartyParams = exports.Party = exports.OracleInfo = exports.OracleAttestationRef = exports.ExtendedKey = exports.DlcTransactions = exports.DlcInputInfo = exports.DlcError_Tags = exports.DlcError = exports.DescriptorInput = exports.CreateOfferParams = exports.ContractPayouts = exports.ContractPartyParams = exports.ContractKeyProvider = exports.ContractError_Tags = exports.ContractError = exports.ChangeOutputAndFees = exports.CetAdaptorSignatureDebugInfo = exports.AdaptorSignature = exports.AcceptResult = exports.AcceptOfferParams = void 0;
|
|
7
|
+
exports.acceptOffer = acceptOffer;
|
|
8
|
+
exports.chainHashFromNetwork = chainHashFromNetwork;
|
|
9
|
+
exports.computeContractId = computeContractId;
|
|
10
|
+
exports.contractInfoPayouts = contractInfoPayouts;
|
|
7
11
|
exports.convertMnemonicToSeed = convertMnemonicToSeed;
|
|
8
12
|
exports.createCet = createCet;
|
|
9
13
|
exports.createCetAdaptorPointsFromOracleInfo = createCetAdaptorPointsFromOracleInfo;
|
|
10
14
|
exports.createCetAdaptorSigsFromOracleInfo = createCetAdaptorSigsFromOracleInfo;
|
|
11
15
|
exports.createCetAdaptorSigsFromPoints = createCetAdaptorSigsFromPoints;
|
|
12
16
|
exports.createCets = createCets;
|
|
17
|
+
exports.createDlcSpliceInput = createDlcSpliceInput;
|
|
13
18
|
exports.createDlcTransactions = createDlcTransactions;
|
|
14
19
|
exports.createExtkeyFromParentPath = createExtkeyFromParentPath;
|
|
15
20
|
exports.createExtkeyFromSeed = createExtkeyFromSeed;
|
|
16
21
|
exports.createFundTxLockingScript = createFundTxLockingScript;
|
|
22
|
+
exports.createFundingPsbt = createFundingPsbt;
|
|
23
|
+
exports.createOffer = createOffer;
|
|
17
24
|
exports.createRefundTransaction = createRefundTransaction;
|
|
18
25
|
exports.createSplicedDlcTransactions = createSplicedDlcTransactions;
|
|
19
26
|
exports.createXprivFromParentPath = createXprivFromParentPath;
|
|
20
27
|
exports.default = void 0;
|
|
28
|
+
exports.dlcInputMaxWitnessLen = dlcInputMaxWitnessLen;
|
|
29
|
+
exports.dlcTransactionsFromMessages = dlcTransactionsFromMessages;
|
|
21
30
|
exports.extractEcdsaSignatureFromOracleSignatures = extractEcdsaSignatureFromOracleSignatures;
|
|
31
|
+
exports.finalizeSign = finalizeSign;
|
|
32
|
+
exports.finalizeSignSpliced = finalizeSignSpliced;
|
|
33
|
+
exports.fundingInput = fundingInput;
|
|
22
34
|
exports.getPubkeyFromExtkey = getPubkeyFromExtkey;
|
|
23
35
|
exports.getTotalInputVsize = getTotalInputVsize;
|
|
24
36
|
exports.getXpubFromXpriv = getXpubFromXpriv;
|
|
37
|
+
exports.signAccept = signAccept;
|
|
38
|
+
exports.signAcceptSpliced = signAcceptSpliced;
|
|
39
|
+
exports.signContractCet = signContractCet;
|
|
40
|
+
exports.signContractRefund = signContractRefund;
|
|
41
|
+
exports.signFundingPsbtWithDescriptor = signFundingPsbtWithDescriptor;
|
|
42
|
+
exports.validateAccept = validateAccept;
|
|
43
|
+
exports.validateOffer = validateOffer;
|
|
44
|
+
exports.validateSign = validateSign;
|
|
25
45
|
exports.verifyCetAdaptorSigsFromOracleInfo = verifyCetAdaptorSigsFromOracleInfo;
|
|
26
46
|
exports.version = version;
|
|
27
47
|
var _ddk_ffiFfi = _interopRequireDefault(require("./ddk_ffi-ffi.js"));
|
|
@@ -44,6 +64,75 @@ process?.env?.NODE_ENV !== 'production' || false;
|
|
|
44
64
|
|
|
45
65
|
// Public interface members begin here.
|
|
46
66
|
|
|
67
|
+
/**
|
|
68
|
+
* Accepts an offer. The accepting party's funding secret key is derived inside
|
|
69
|
+
* Rust from `keys` + `new_temporary_contract_id` and never crosses the boundary;
|
|
70
|
+
* it must match `params.party.funding_pubkey` (derive both from the same provider).
|
|
71
|
+
*/
|
|
72
|
+
function acceptOffer(offer, params, keys, newTemporaryContractId) /*throws*/{
|
|
73
|
+
return (__rb => {
|
|
74
|
+
try {
|
|
75
|
+
return FfiConverterTypeAcceptResult.lift(__rb);
|
|
76
|
+
} finally {
|
|
77
|
+
(0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
|
|
78
|
+
}
|
|
79
|
+
})(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
|
|
80
|
+
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_accept_offer(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterTypeAcceptOfferParams.lower(params, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterTypeContractKeyProvider.lower(keys, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(newTemporaryContractId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
81
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The 32-byte chain hash for a network (`bitcoin` / `testnet` / `signet` /
|
|
86
|
+
* `regtest`). Use it for [`CreateOfferParams::chain_hash`].
|
|
87
|
+
*/
|
|
88
|
+
function chainHashFromNetwork(network) /*throws*/{
|
|
89
|
+
return (__rb => {
|
|
90
|
+
try {
|
|
91
|
+
return _core.FfiConverterArrayBuffer.lift(__rb);
|
|
92
|
+
} finally {
|
|
93
|
+
(0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
|
|
94
|
+
}
|
|
95
|
+
})(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
|
|
96
|
+
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_chain_hash_from_network(FfiConverterString.lower(network, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
97
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The 32-byte contract id derived from the offer and accept messages — the
|
|
102
|
+
* stable id of the funded contract. Use it to key stored contracts.
|
|
103
|
+
*/
|
|
104
|
+
function computeContractId(offer, accept) /*throws*/{
|
|
105
|
+
return (__rb => {
|
|
106
|
+
try {
|
|
107
|
+
return _core.FfiConverterArrayBuffer.lift(__rb);
|
|
108
|
+
} finally {
|
|
109
|
+
(0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
|
|
110
|
+
}
|
|
111
|
+
})(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
|
|
112
|
+
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_compute_contract_id(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(accept, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
113
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Derives the offer/accept payouts for every outcome of a contract from its
|
|
118
|
+
* wire-encoded `ContractInfo`, for building a payout table to show users.
|
|
119
|
+
*
|
|
120
|
+
* Handles both enum contracts (each row a labeled outcome) and numeric-outcome
|
|
121
|
+
* contracts (each row an inclusive outcome range that shares a single payout,
|
|
122
|
+
* as determined by the payout function and rounding intervals). Disjoint
|
|
123
|
+
* contracts contribute the rows of each of their sub-contracts.
|
|
124
|
+
*/
|
|
125
|
+
function contractInfoPayouts(contractInfo) /*throws*/{
|
|
126
|
+
return (__rb => {
|
|
127
|
+
try {
|
|
128
|
+
return FfiConverterTypeContractPayouts.lift(__rb);
|
|
129
|
+
} finally {
|
|
130
|
+
(0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
|
|
131
|
+
}
|
|
132
|
+
})(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
|
|
133
|
+
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_contract_info_payouts(_core.FfiConverterArrayBuffer.lower(contractInfo, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
134
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
135
|
+
}
|
|
47
136
|
function convertMnemonicToSeed(mnemonic, passphrase) /*throws*/{
|
|
48
137
|
return (__rb => {
|
|
49
138
|
try {
|
|
@@ -123,6 +212,25 @@ function createCets(fundTxId, fundVout, localFinalScriptPubkey, remoteFinalScrip
|
|
|
123
212
|
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
124
213
|
}
|
|
125
214
|
|
|
215
|
+
/**
|
|
216
|
+
* Rebuilds the splice `FundingInput` (wire-encoded) that spends a previous
|
|
217
|
+
* contract's 2-of-2 funding output, from that contract's offer and accept
|
|
218
|
+
* messages. Only the offering party contributes a splice input; place the
|
|
219
|
+
* result in the offering party's `funding_inputs`. `max_witness_len` must be
|
|
220
|
+
* greater than 108 — use [`dlc_input_max_witness_len`].
|
|
221
|
+
*/
|
|
222
|
+
function createDlcSpliceInput(prevOffer, prevAccept, localParty, inputSerialId, maxWitnessLen) /*throws*/{
|
|
223
|
+
return (__rb => {
|
|
224
|
+
try {
|
|
225
|
+
return _core.FfiConverterArrayBuffer.lift(__rb);
|
|
226
|
+
} finally {
|
|
227
|
+
(0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
|
|
228
|
+
}
|
|
229
|
+
})(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
|
|
230
|
+
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_dlc_splice_input(_core.FfiConverterArrayBuffer.lower(prevOffer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(prevAccept, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterTypeParty.lower(localParty, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterOptionalUInt64.lower(inputSerialId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt16.lower(maxWitnessLen, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
231
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
232
|
+
}
|
|
233
|
+
|
|
126
234
|
/**
|
|
127
235
|
* Create complete DLC transactions
|
|
128
236
|
*/
|
|
@@ -185,6 +293,36 @@ function createFundTxLockingScript(localFundPubkey, remoteFundPubkey) /*throws*/
|
|
|
185
293
|
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
186
294
|
}
|
|
187
295
|
|
|
296
|
+
/**
|
|
297
|
+
* Rebuilds the BIP-174 funding PSBT from the offer and accept messages.
|
|
298
|
+
*/
|
|
299
|
+
function createFundingPsbt(offer, accept) /*throws*/{
|
|
300
|
+
return (__rb => {
|
|
301
|
+
try {
|
|
302
|
+
return _core.FfiConverterArrayBuffer.lift(__rb);
|
|
303
|
+
} finally {
|
|
304
|
+
(0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
|
|
305
|
+
}
|
|
306
|
+
})(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
|
|
307
|
+
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_funding_psbt(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(accept, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
308
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Creates an offer. Returns the wire-encoded `OfferDlc` to send to the accepting party.
|
|
313
|
+
*/
|
|
314
|
+
function createOffer(params) /*throws*/{
|
|
315
|
+
return (__rb => {
|
|
316
|
+
try {
|
|
317
|
+
return _core.FfiConverterArrayBuffer.lift(__rb);
|
|
318
|
+
} finally {
|
|
319
|
+
(0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
|
|
320
|
+
}
|
|
321
|
+
})(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
|
|
322
|
+
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_offer(FfiConverterTypeCreateOfferParams.lower(params, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
323
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
324
|
+
}
|
|
325
|
+
|
|
188
326
|
/**
|
|
189
327
|
* Create a refund transaction
|
|
190
328
|
*/
|
|
@@ -230,6 +368,30 @@ function createXprivFromParentPath(seedOrXpriv, baseDerivationPath, network, pat
|
|
|
230
368
|
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_create_xpriv_from_parent_path(_core.FfiConverterArrayBuffer.lower(seedOrXpriv, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterString.lower(baseDerivationPath, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterString.lower(network, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterString.lower(path, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
231
369
|
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
232
370
|
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* The required `max_witness_len` for a DLC (splice) funding input (220).
|
|
374
|
+
*/
|
|
375
|
+
function dlcInputMaxWitnessLen() {
|
|
376
|
+
return _core.FfiConverterUInt16.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
|
|
377
|
+
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_dlc_input_max_witness_len(callStatus);
|
|
378
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Rebuilds the unsigned funding, CET, and refund transactions from the messages.
|
|
383
|
+
*/
|
|
384
|
+
function dlcTransactionsFromMessages(offer, accept) /*throws*/{
|
|
385
|
+
return (__rb => {
|
|
386
|
+
try {
|
|
387
|
+
return FfiConverterTypeDlcTransactions.lift(__rb);
|
|
388
|
+
} finally {
|
|
389
|
+
(0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
|
|
390
|
+
}
|
|
391
|
+
})(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
|
|
392
|
+
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_dlc_transactions_from_messages(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(accept, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
393
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
394
|
+
}
|
|
233
395
|
function extractEcdsaSignatureFromOracleSignatures(oracleSignatures, adaptorSignature) /*throws*/{
|
|
234
396
|
return (__rb => {
|
|
235
397
|
try {
|
|
@@ -242,6 +404,65 @@ function extractEcdsaSignatureFromOracleSignatures(oracleSignatures, adaptorSign
|
|
|
242
404
|
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
243
405
|
}
|
|
244
406
|
|
|
407
|
+
/**
|
|
408
|
+
* The accepting party verifies the sign message and completes the funding
|
|
409
|
+
* transaction. Returns the Bitcoin consensus-serialized signed transaction.
|
|
410
|
+
*/
|
|
411
|
+
function finalizeSign(offer, accept, sign, signedFundingPsbt) /*throws*/{
|
|
412
|
+
return (__rb => {
|
|
413
|
+
try {
|
|
414
|
+
return _core.FfiConverterArrayBuffer.lift(__rb);
|
|
415
|
+
} finally {
|
|
416
|
+
(0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
|
|
417
|
+
}
|
|
418
|
+
})(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
|
|
419
|
+
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_finalize_sign(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(accept, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(sign, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(signedFundingPsbt, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
420
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Like [`finalize_sign`], but additionally completes the 2-of-2 witness for any
|
|
425
|
+
* splice (DLC) funding input using this (accepting) party's prior funding keys,
|
|
426
|
+
* re-derived inside Rust from `keys`.
|
|
427
|
+
*/
|
|
428
|
+
function finalizeSignSpliced(offer, accept, sign, signedFundingPsbt, keys, spliceKeys) /*throws*/{
|
|
429
|
+
return (__rb => {
|
|
430
|
+
try {
|
|
431
|
+
return _core.FfiConverterArrayBuffer.lift(__rb);
|
|
432
|
+
} finally {
|
|
433
|
+
(0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
|
|
434
|
+
}
|
|
435
|
+
})(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
|
|
436
|
+
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_finalize_sign_spliced(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(accept, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(sign, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(signedFundingPsbt, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterTypeContractKeyProvider.lower(keys, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceTypeSpliceKeyRef.lower(spliceKeys, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
437
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* Builds a wire-encoded `FundingInput` from a wallet UTXO, ready to place in a
|
|
442
|
+
* party's `funding_inputs`.
|
|
443
|
+
*
|
|
444
|
+
* - `previous_transaction`: the full consensus-serialized transaction that
|
|
445
|
+
* created the UTXO being spent.
|
|
446
|
+
* - `vout`: the output index of the UTXO within that transaction.
|
|
447
|
+
* - `input_serial_id`: orders the input in the funding transaction; randomly
|
|
448
|
+
* generated when `None`.
|
|
449
|
+
* - `sequence`: the input sequence (usually `0xffffffff`).
|
|
450
|
+
* - `max_witness_len`: the input's maximum witness length (e.g. 108 for
|
|
451
|
+
* P2WPKH).
|
|
452
|
+
* - `redeem_script`: the redeem script for a P2SH input, or empty for others.
|
|
453
|
+
*/
|
|
454
|
+
function fundingInput(previousTransaction, vout, inputSerialId, sequence, maxWitnessLen, redeemScript) /*throws*/{
|
|
455
|
+
return (__rb => {
|
|
456
|
+
try {
|
|
457
|
+
return _core.FfiConverterArrayBuffer.lift(__rb);
|
|
458
|
+
} finally {
|
|
459
|
+
(0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
|
|
460
|
+
}
|
|
461
|
+
})(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
|
|
462
|
+
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_funding_input(_core.FfiConverterArrayBuffer.lower(previousTransaction, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt32.lower(vout, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterOptionalUInt64.lower(inputSerialId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt32.lower(sequence, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt16.lower(maxWitnessLen, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(redeemScript, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
463
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
464
|
+
}
|
|
465
|
+
|
|
245
466
|
/**
|
|
246
467
|
* Extract public key from extended key (private or public)
|
|
247
468
|
* Input: 78-byte encoded xpriv/xpub, Output: 33-byte compressed public key
|
|
@@ -282,6 +503,155 @@ function getXpubFromXpriv(xpriv, network) /*throws*/{
|
|
|
282
503
|
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_get_xpub_from_xpriv(_core.FfiConverterArrayBuffer.lower(xpriv, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterString.lower(network, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
283
504
|
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
284
505
|
}
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* The offering party verifies the accept message and produces its `SignDlc`.
|
|
509
|
+
* The offer party's funding secret key is derived from `keys` +
|
|
510
|
+
* `temporary_contract_id` (the new contract's id).
|
|
511
|
+
*/
|
|
512
|
+
function signAccept(offer, accept, keys, temporaryContractId, signedFundingPsbt) /*throws*/{
|
|
513
|
+
return (__rb => {
|
|
514
|
+
try {
|
|
515
|
+
return FfiConverterTypeSignResult.lift(__rb);
|
|
516
|
+
} finally {
|
|
517
|
+
(0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
|
|
518
|
+
}
|
|
519
|
+
})(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
|
|
520
|
+
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_sign_accept(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(accept, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterTypeContractKeyProvider.lower(keys, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(temporaryContractId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(signedFundingPsbt, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
521
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* Like [`sign_accept`], but additionally co-signs any splice (DLC) funding
|
|
526
|
+
* inputs. For each splice input, `splice_keys` names the previous contract; the
|
|
527
|
+
* prior funding secret key is re-derived inside Rust from `keys`.
|
|
528
|
+
*/
|
|
529
|
+
function signAcceptSpliced(offer, accept, keys, temporaryContractId, signedFundingPsbt, spliceKeys) /*throws*/{
|
|
530
|
+
return (__rb => {
|
|
531
|
+
try {
|
|
532
|
+
return FfiConverterTypeSignResult.lift(__rb);
|
|
533
|
+
} finally {
|
|
534
|
+
(0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
|
|
535
|
+
}
|
|
536
|
+
})(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
|
|
537
|
+
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_sign_accept_spliced(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(accept, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterTypeContractKeyProvider.lower(keys, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(temporaryContractId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(signedFundingPsbt, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceTypeSpliceKeyRef.lower(spliceKeys, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
538
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* Signs the CET matching a set of oracle attestations, returning the Bitcoin
|
|
543
|
+
* consensus-serialized transaction. It pays each party the attested outcome's
|
|
544
|
+
* payout and is ready to broadcast — no network access happens here.
|
|
545
|
+
*
|
|
546
|
+
* The settling party's funding secret key is derived inside Rust from `keys` +
|
|
547
|
+
* `temporary_contract_id` — the settling party's OWN temporary id (the offer's
|
|
548
|
+
* for the offering party, the `new_temporary_contract_id` passed to
|
|
549
|
+
* `accept_offer` for the accepting party). The key also identifies which side
|
|
550
|
+
* is settling, so there is no party argument to get wrong. Either party can
|
|
551
|
+
* settle alone: the counterparty's half of the 2-of-2 comes from decrypting its
|
|
552
|
+
* CET adaptor signature with the oracle signatures.
|
|
553
|
+
*
|
|
554
|
+
* Each entry in `attestations` pairs a wire-encoded `OracleAttestation` with
|
|
555
|
+
* the index of its oracle in the announcements of the contract info it settles.
|
|
556
|
+
* Attestations are verified against the announcements they claim to come from,
|
|
557
|
+
* so a forged or misindexed one cannot produce a CET
|
|
558
|
+
* ([`ContractError::InvalidAttestation`]). When no contract outcome matches the
|
|
559
|
+
* attested outcomes, [`ContractError::NoMatchingOutcome`] is returned — which
|
|
560
|
+
* is also what an attestation for an unrelated event looks like.
|
|
561
|
+
*/
|
|
562
|
+
function signContractCet(offer, accept, sign, keys, temporaryContractId, attestations) /*throws*/{
|
|
563
|
+
return (__rb => {
|
|
564
|
+
try {
|
|
565
|
+
return _core.FfiConverterArrayBuffer.lift(__rb);
|
|
566
|
+
} finally {
|
|
567
|
+
(0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
|
|
568
|
+
}
|
|
569
|
+
})(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
|
|
570
|
+
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_sign_contract_cet(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(accept, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(sign, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterTypeContractKeyProvider.lower(keys, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(temporaryContractId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceTypeOracleAttestationRef.lower(attestations, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
571
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Signs the refund transaction, returning the Bitcoin consensus-serialized
|
|
576
|
+
* transaction. It returns each party its own collateral and can only be
|
|
577
|
+
* broadcast once the offer's `refund_locktime` has passed — enforcing that is
|
|
578
|
+
* the chain's job, not this function's.
|
|
579
|
+
*
|
|
580
|
+
* As with [`sign_contract_cet`], `temporary_contract_id` is the settling
|
|
581
|
+
* party's own temporary id and identifies which side is settling. Both parties
|
|
582
|
+
* signed the refund during the offer/accept exchange, so this only adds this
|
|
583
|
+
* party's half; the counterparty's stored signature is verified first.
|
|
584
|
+
*/
|
|
585
|
+
function signContractRefund(offer, accept, sign, keys, temporaryContractId) /*throws*/{
|
|
586
|
+
return (__rb => {
|
|
587
|
+
try {
|
|
588
|
+
return _core.FfiConverterArrayBuffer.lift(__rb);
|
|
589
|
+
} finally {
|
|
590
|
+
(0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
|
|
591
|
+
}
|
|
592
|
+
})(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
|
|
593
|
+
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_sign_contract_refund(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(accept, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(sign, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterTypeContractKeyProvider.lower(keys, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(temporaryContractId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
594
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* Signs a party's own funding inputs on the funding PSBT using a private output
|
|
599
|
+
* descriptor (e.g. bdk's `wpkh(...)` with an xprv), returning the updated PSBT.
|
|
600
|
+
* Each entry in `inputs` names one of this party's funding inputs (by serial
|
|
601
|
+
* id) and the descriptor wildcard index that derives its key. Supports `wpkh()`
|
|
602
|
+
* and `sh(wpkh())`, with or without a wildcard.
|
|
603
|
+
*/
|
|
604
|
+
function signFundingPsbtWithDescriptor(offer, accept, fundingPsbt, descriptor, inputs) /*throws*/{
|
|
605
|
+
return (__rb => {
|
|
606
|
+
try {
|
|
607
|
+
return _core.FfiConverterArrayBuffer.lift(__rb);
|
|
608
|
+
} finally {
|
|
609
|
+
(0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
|
|
610
|
+
}
|
|
611
|
+
})(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
|
|
612
|
+
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_sign_funding_psbt_with_descriptor(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(accept, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(fundingPsbt, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterString.lower(descriptor, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceTypeDescriptorInput.lower(inputs, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
613
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* Validates an accept message against its offer: the acceptor's CET adaptor
|
|
618
|
+
* signatures and refund signature must be valid for the contract the two
|
|
619
|
+
* messages describe. This is the same check `sign_accept` runs internally,
|
|
620
|
+
* exposed so a stored/received `AcceptDlc` can be verified on its own.
|
|
621
|
+
*/
|
|
622
|
+
function validateAccept(offer, accept) /*throws*/{
|
|
623
|
+
uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
|
|
624
|
+
(0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_validate_accept(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(accept, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
625
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString));
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* Validates an offer's protocol version, funding inputs, fee rate, collateral,
|
|
630
|
+
* and oracle timeouts.
|
|
631
|
+
*
|
|
632
|
+
* The lifecycle functions already validate internally (`accept_offer` validates
|
|
633
|
+
* the offer, `sign_accept` validates the accept, `finalize_sign` validates the
|
|
634
|
+
* sign); these `validate_*` functions expose the same checks standalone, so a
|
|
635
|
+
* consumer can independently verify a stored or received message at any time —
|
|
636
|
+
* e.g. before persisting it, or when loading it back later.
|
|
637
|
+
*/
|
|
638
|
+
function validateOffer(offer, minTimeoutInterval, maxTimeoutInterval) /*throws*/{
|
|
639
|
+
uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
|
|
640
|
+
(0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_validate_offer(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt32.lower(minTimeoutInterval, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt32.lower(maxTimeoutInterval, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
641
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString));
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
/**
|
|
645
|
+
* Validates a sign message against its offer and accept: the offerer's CET
|
|
646
|
+
* adaptor signatures and refund signature must be valid. This is the same
|
|
647
|
+
* check `finalize_sign` runs internally, exposed so a stored/received `SignDlc`
|
|
648
|
+
* can be verified on its own.
|
|
649
|
+
*/
|
|
650
|
+
function validateSign(offer, accept, sign) /*throws*/{
|
|
651
|
+
uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
|
|
652
|
+
(0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_validate_sign(_core.FfiConverterArrayBuffer.lower(offer, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(accept, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(sign, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
653
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString));
|
|
654
|
+
}
|
|
285
655
|
function verifyCetAdaptorSigsFromOracleInfo(adaptorSigs, cets, oracleInfos, pubkey, fundingScriptPubkey, totalCollateral, msgs) {
|
|
286
656
|
return _core.FfiConverterBool.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
|
|
287
657
|
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_verify_cet_adaptor_sigs_from_oracle_info(FfiConverterSequenceTypeAdaptorSignature.lower(adaptorSigs, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceTypeTransaction.lower(cets, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceTypeOracleInfo.lower(oracleInfos, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(pubkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(fundingScriptPubkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt64.lower(totalCollateral, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceSequenceSequenceBytes.lower(msgs, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
@@ -298,10 +668,15 @@ function version() {
|
|
|
298
668
|
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_func_version(callStatus);
|
|
299
669
|
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
300
670
|
}
|
|
671
|
+
|
|
301
672
|
/**
|
|
302
|
-
*
|
|
673
|
+
* One party's Bitcoin-level contract data (mirrors [`ddk::contract::PartyParams`]).
|
|
303
674
|
*/
|
|
304
|
-
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* Generated factory for {@link ContractPartyParams} record objects.
|
|
678
|
+
*/
|
|
679
|
+
const ContractPartyParams = exports.ContractPartyParams = (() => {
|
|
305
680
|
const defaults = () => ({});
|
|
306
681
|
const create = (() => {
|
|
307
682
|
return (0, _core.uniffiCreateRecord)(defaults);
|
|
@@ -309,28 +684,70 @@ const AdaptorSignature = exports.AdaptorSignature = (() => {
|
|
|
309
684
|
return Object.freeze({
|
|
310
685
|
create,
|
|
311
686
|
new: create,
|
|
312
|
-
defaults: () => Object.freeze(defaults())
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
687
|
+
defaults: () => Object.freeze(defaults())
|
|
688
|
+
});
|
|
689
|
+
})();
|
|
690
|
+
const FfiConverterTypeContractPartyParams = (() => {
|
|
691
|
+
class FFIConverter extends _core.AbstractFfiConverterByteArray {
|
|
692
|
+
read(from) {
|
|
693
|
+
return {
|
|
694
|
+
fundingPubkey: _core.FfiConverterArrayBuffer.read(from),
|
|
695
|
+
fundingInputs: FfiConverterSequenceBytes.read(from),
|
|
696
|
+
payoutSpk: _core.FfiConverterArrayBuffer.read(from),
|
|
697
|
+
payoutSerialId: FfiConverterOptionalUInt64.read(from),
|
|
698
|
+
changeSpk: _core.FfiConverterArrayBuffer.read(from),
|
|
699
|
+
changeSerialId: FfiConverterOptionalUInt64.read(from)
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
write(value, into) {
|
|
703
|
+
_core.FfiConverterArrayBuffer.write(value.fundingPubkey, into);
|
|
704
|
+
FfiConverterSequenceBytes.write(value.fundingInputs, into);
|
|
705
|
+
_core.FfiConverterArrayBuffer.write(value.payoutSpk, into);
|
|
706
|
+
FfiConverterOptionalUInt64.write(value.payoutSerialId, into);
|
|
707
|
+
_core.FfiConverterArrayBuffer.write(value.changeSpk, into);
|
|
708
|
+
FfiConverterOptionalUInt64.write(value.changeSerialId, into);
|
|
709
|
+
}
|
|
710
|
+
allocationSize(value) {
|
|
711
|
+
return _core.FfiConverterArrayBuffer.allocationSize(value.fundingPubkey) + FfiConverterSequenceBytes.allocationSize(value.fundingInputs) + _core.FfiConverterArrayBuffer.allocationSize(value.payoutSpk) + FfiConverterOptionalUInt64.allocationSize(value.payoutSerialId) + _core.FfiConverterArrayBuffer.allocationSize(value.changeSpk) + FfiConverterOptionalUInt64.allocationSize(value.changeSerialId);
|
|
317
712
|
}
|
|
713
|
+
}
|
|
714
|
+
return new FFIConverter();
|
|
715
|
+
})();
|
|
716
|
+
|
|
717
|
+
/**
|
|
718
|
+
* Parameters for [`accept_offer`] (mirrors [`ddk::contract::AcceptOfferParams`]).
|
|
719
|
+
*/
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* Generated factory for {@link AcceptOfferParams} record objects.
|
|
723
|
+
*/
|
|
724
|
+
const AcceptOfferParams = exports.AcceptOfferParams = (() => {
|
|
725
|
+
const defaults = () => ({});
|
|
726
|
+
const create = (() => {
|
|
727
|
+
return (0, _core.uniffiCreateRecord)(defaults);
|
|
728
|
+
})();
|
|
729
|
+
return Object.freeze({
|
|
730
|
+
create,
|
|
731
|
+
new: create,
|
|
732
|
+
defaults: () => Object.freeze(defaults())
|
|
318
733
|
});
|
|
319
734
|
})();
|
|
320
|
-
const
|
|
735
|
+
const FfiConverterTypeAcceptOfferParams = (() => {
|
|
321
736
|
class FFIConverter extends _core.AbstractFfiConverterByteArray {
|
|
322
737
|
read(from) {
|
|
323
738
|
return {
|
|
324
|
-
|
|
325
|
-
|
|
739
|
+
party: FfiConverterTypeContractPartyParams.read(from),
|
|
740
|
+
minTimeoutInterval: _core.FfiConverterUInt32.read(from),
|
|
741
|
+
maxTimeoutInterval: _core.FfiConverterUInt32.read(from)
|
|
326
742
|
};
|
|
327
743
|
}
|
|
328
744
|
write(value, into) {
|
|
329
|
-
|
|
330
|
-
_core.
|
|
745
|
+
FfiConverterTypeContractPartyParams.write(value.party, into);
|
|
746
|
+
_core.FfiConverterUInt32.write(value.minTimeoutInterval, into);
|
|
747
|
+
_core.FfiConverterUInt32.write(value.maxTimeoutInterval, into);
|
|
331
748
|
}
|
|
332
749
|
allocationSize(value) {
|
|
333
|
-
return _core.
|
|
750
|
+
return FfiConverterTypeContractPartyParams.allocationSize(value.party) + _core.FfiConverterUInt32.allocationSize(value.minTimeoutInterval) + _core.FfiConverterUInt32.allocationSize(value.maxTimeoutInterval);
|
|
334
751
|
}
|
|
335
752
|
}
|
|
336
753
|
return new FFIConverter();
|
|
@@ -373,21 +790,10 @@ const stringConverter = (() => {
|
|
|
373
790
|
};
|
|
374
791
|
})();
|
|
375
792
|
const FfiConverterString = (0, _core.uniffiCreateFfiConverterString)(stringConverter);
|
|
376
|
-
|
|
377
793
|
/**
|
|
378
|
-
*
|
|
379
|
-
*
|
|
380
|
-
* Contains all the values that go into creating an adaptor signature,
|
|
381
|
-
* useful for comparing with external signers during debugging.
|
|
382
|
-
*
|
|
383
|
-
* This struct is intentionally always available (not feature-gated)
|
|
384
|
-
* to support production debugging scenarios.
|
|
385
|
-
*/
|
|
386
|
-
|
|
387
|
-
/**
|
|
388
|
-
* Generated factory for {@link CetAdaptorSignatureDebugInfo} record objects.
|
|
794
|
+
* Generated factory for {@link TxInput} record objects.
|
|
389
795
|
*/
|
|
390
|
-
const
|
|
796
|
+
const TxInput = exports.TxInput = (() => {
|
|
391
797
|
const defaults = () => ({});
|
|
392
798
|
const create = (() => {
|
|
393
799
|
return (0, _core.uniffiCreateRecord)(defaults);
|
|
@@ -398,30 +804,26 @@ const CetAdaptorSignatureDebugInfo = exports.CetAdaptorSignatureDebugInfo = (()
|
|
|
398
804
|
defaults: () => Object.freeze(defaults())
|
|
399
805
|
});
|
|
400
806
|
})();
|
|
401
|
-
const
|
|
807
|
+
const FfiConverterTypeTxInput = (() => {
|
|
402
808
|
class FFIConverter extends _core.AbstractFfiConverterByteArray {
|
|
403
809
|
read(from) {
|
|
404
810
|
return {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
cetTxid: FfiConverterString.read(from),
|
|
411
|
-
cetRaw: _core.FfiConverterArrayBuffer.read(from)
|
|
811
|
+
txid: FfiConverterString.read(from),
|
|
812
|
+
vout: _core.FfiConverterUInt32.read(from),
|
|
813
|
+
scriptSig: _core.FfiConverterArrayBuffer.read(from),
|
|
814
|
+
sequence: _core.FfiConverterUInt32.read(from),
|
|
815
|
+
witness: FfiConverterSequenceBytes.read(from)
|
|
412
816
|
};
|
|
413
817
|
}
|
|
414
818
|
write(value, into) {
|
|
415
|
-
|
|
416
|
-
_core.
|
|
417
|
-
_core.
|
|
418
|
-
_core.
|
|
419
|
-
|
|
420
|
-
FfiConverterString.write(value.cetTxid, into);
|
|
421
|
-
_core.FfiConverterArrayBuffer.write(value.cetRaw, into);
|
|
819
|
+
FfiConverterString.write(value.txid, into);
|
|
820
|
+
_core.FfiConverterUInt32.write(value.vout, into);
|
|
821
|
+
_core.FfiConverterArrayBuffer.write(value.scriptSig, into);
|
|
822
|
+
_core.FfiConverterUInt32.write(value.sequence, into);
|
|
823
|
+
FfiConverterSequenceBytes.write(value.witness, into);
|
|
422
824
|
}
|
|
423
825
|
allocationSize(value) {
|
|
424
|
-
return
|
|
826
|
+
return FfiConverterString.allocationSize(value.txid) + _core.FfiConverterUInt32.allocationSize(value.vout) + _core.FfiConverterArrayBuffer.allocationSize(value.scriptSig) + _core.FfiConverterUInt32.allocationSize(value.sequence) + FfiConverterSequenceBytes.allocationSize(value.witness);
|
|
425
827
|
}
|
|
426
828
|
}
|
|
427
829
|
return new FFIConverter();
|
|
@@ -463,78 +865,6 @@ const FfiConverterTypeTxOutput = (() => {
|
|
|
463
865
|
}
|
|
464
866
|
return new FFIConverter();
|
|
465
867
|
})();
|
|
466
|
-
/**
|
|
467
|
-
* Generated factory for {@link ChangeOutputAndFees} record objects.
|
|
468
|
-
*/
|
|
469
|
-
const ChangeOutputAndFees = exports.ChangeOutputAndFees = (() => {
|
|
470
|
-
const defaults = () => ({});
|
|
471
|
-
const create = (() => {
|
|
472
|
-
return (0, _core.uniffiCreateRecord)(defaults);
|
|
473
|
-
})();
|
|
474
|
-
return Object.freeze({
|
|
475
|
-
create,
|
|
476
|
-
new: create,
|
|
477
|
-
defaults: () => Object.freeze(defaults())
|
|
478
|
-
});
|
|
479
|
-
})();
|
|
480
|
-
const FfiConverterTypeChangeOutputAndFees = (() => {
|
|
481
|
-
class FFIConverter extends _core.AbstractFfiConverterByteArray {
|
|
482
|
-
read(from) {
|
|
483
|
-
return {
|
|
484
|
-
changeOutput: FfiConverterTypeTxOutput.read(from),
|
|
485
|
-
fundFee: _core.FfiConverterUInt64.read(from),
|
|
486
|
-
cetFee: _core.FfiConverterUInt64.read(from)
|
|
487
|
-
};
|
|
488
|
-
}
|
|
489
|
-
write(value, into) {
|
|
490
|
-
FfiConverterTypeTxOutput.write(value.changeOutput, into);
|
|
491
|
-
_core.FfiConverterUInt64.write(value.fundFee, into);
|
|
492
|
-
_core.FfiConverterUInt64.write(value.cetFee, into);
|
|
493
|
-
}
|
|
494
|
-
allocationSize(value) {
|
|
495
|
-
return FfiConverterTypeTxOutput.allocationSize(value.changeOutput) + _core.FfiConverterUInt64.allocationSize(value.fundFee) + _core.FfiConverterUInt64.allocationSize(value.cetFee);
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
return new FFIConverter();
|
|
499
|
-
})();
|
|
500
|
-
/**
|
|
501
|
-
* Generated factory for {@link TxInput} record objects.
|
|
502
|
-
*/
|
|
503
|
-
const TxInput = exports.TxInput = (() => {
|
|
504
|
-
const defaults = () => ({});
|
|
505
|
-
const create = (() => {
|
|
506
|
-
return (0, _core.uniffiCreateRecord)(defaults);
|
|
507
|
-
})();
|
|
508
|
-
return Object.freeze({
|
|
509
|
-
create,
|
|
510
|
-
new: create,
|
|
511
|
-
defaults: () => Object.freeze(defaults())
|
|
512
|
-
});
|
|
513
|
-
})();
|
|
514
|
-
const FfiConverterTypeTxInput = (() => {
|
|
515
|
-
class FFIConverter extends _core.AbstractFfiConverterByteArray {
|
|
516
|
-
read(from) {
|
|
517
|
-
return {
|
|
518
|
-
txid: FfiConverterString.read(from),
|
|
519
|
-
vout: _core.FfiConverterUInt32.read(from),
|
|
520
|
-
scriptSig: _core.FfiConverterArrayBuffer.read(from),
|
|
521
|
-
sequence: _core.FfiConverterUInt32.read(from),
|
|
522
|
-
witness: FfiConverterSequenceBytes.read(from)
|
|
523
|
-
};
|
|
524
|
-
}
|
|
525
|
-
write(value, into) {
|
|
526
|
-
FfiConverterString.write(value.txid, into);
|
|
527
|
-
_core.FfiConverterUInt32.write(value.vout, into);
|
|
528
|
-
_core.FfiConverterArrayBuffer.write(value.scriptSig, into);
|
|
529
|
-
_core.FfiConverterUInt32.write(value.sequence, into);
|
|
530
|
-
FfiConverterSequenceBytes.write(value.witness, into);
|
|
531
|
-
}
|
|
532
|
-
allocationSize(value) {
|
|
533
|
-
return FfiConverterString.allocationSize(value.txid) + _core.FfiConverterUInt32.allocationSize(value.vout) + _core.FfiConverterArrayBuffer.allocationSize(value.scriptSig) + _core.FfiConverterUInt32.allocationSize(value.sequence) + FfiConverterSequenceBytes.allocationSize(value.witness);
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
return new FFIConverter();
|
|
537
|
-
})();
|
|
538
868
|
/**
|
|
539
869
|
* Generated factory for {@link Transaction} record objects.
|
|
540
870
|
*/
|
|
@@ -666,50 +996,6 @@ const FfiConverterTypeTransaction = (() => {
|
|
|
666
996
|
}
|
|
667
997
|
return new FFIConverter();
|
|
668
998
|
})();
|
|
669
|
-
/**
|
|
670
|
-
* Generated factory for {@link DlcInputInfo} record objects.
|
|
671
|
-
*/
|
|
672
|
-
const DlcInputInfo = exports.DlcInputInfo = (() => {
|
|
673
|
-
const defaults = () => ({});
|
|
674
|
-
const create = (() => {
|
|
675
|
-
return (0, _core.uniffiCreateRecord)(defaults);
|
|
676
|
-
})();
|
|
677
|
-
return Object.freeze({
|
|
678
|
-
create,
|
|
679
|
-
new: create,
|
|
680
|
-
defaults: () => Object.freeze(defaults())
|
|
681
|
-
});
|
|
682
|
-
})();
|
|
683
|
-
const FfiConverterTypeDlcInputInfo = (() => {
|
|
684
|
-
class FFIConverter extends _core.AbstractFfiConverterByteArray {
|
|
685
|
-
read(from) {
|
|
686
|
-
return {
|
|
687
|
-
fundTx: FfiConverterTypeTransaction.read(from),
|
|
688
|
-
fundVout: _core.FfiConverterUInt32.read(from),
|
|
689
|
-
localFundPubkey: _core.FfiConverterArrayBuffer.read(from),
|
|
690
|
-
remoteFundPubkey: _core.FfiConverterArrayBuffer.read(from),
|
|
691
|
-
fundAmount: _core.FfiConverterUInt64.read(from),
|
|
692
|
-
maxWitnessLen: _core.FfiConverterUInt32.read(from),
|
|
693
|
-
inputSerialId: _core.FfiConverterUInt64.read(from),
|
|
694
|
-
contractId: _core.FfiConverterArrayBuffer.read(from)
|
|
695
|
-
};
|
|
696
|
-
}
|
|
697
|
-
write(value, into) {
|
|
698
|
-
FfiConverterTypeTransaction.write(value.fundTx, into);
|
|
699
|
-
_core.FfiConverterUInt32.write(value.fundVout, into);
|
|
700
|
-
_core.FfiConverterArrayBuffer.write(value.localFundPubkey, into);
|
|
701
|
-
_core.FfiConverterArrayBuffer.write(value.remoteFundPubkey, into);
|
|
702
|
-
_core.FfiConverterUInt64.write(value.fundAmount, into);
|
|
703
|
-
_core.FfiConverterUInt32.write(value.maxWitnessLen, into);
|
|
704
|
-
_core.FfiConverterUInt64.write(value.inputSerialId, into);
|
|
705
|
-
_core.FfiConverterArrayBuffer.write(value.contractId, into);
|
|
706
|
-
}
|
|
707
|
-
allocationSize(value) {
|
|
708
|
-
return FfiConverterTypeTransaction.allocationSize(value.fundTx) + _core.FfiConverterUInt32.allocationSize(value.fundVout) + _core.FfiConverterArrayBuffer.allocationSize(value.localFundPubkey) + _core.FfiConverterArrayBuffer.allocationSize(value.remoteFundPubkey) + _core.FfiConverterUInt64.allocationSize(value.fundAmount) + _core.FfiConverterUInt32.allocationSize(value.maxWitnessLen) + _core.FfiConverterUInt64.allocationSize(value.inputSerialId) + _core.FfiConverterArrayBuffer.allocationSize(value.contractId);
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
return new FFIConverter();
|
|
712
|
-
})();
|
|
713
999
|
/**
|
|
714
1000
|
* Generated factory for {@link DlcTransactions} record objects.
|
|
715
1001
|
*/
|
|
@@ -746,10 +1032,15 @@ const FfiConverterTypeDlcTransactions = (() => {
|
|
|
746
1032
|
}
|
|
747
1033
|
return new FFIConverter();
|
|
748
1034
|
})();
|
|
1035
|
+
|
|
749
1036
|
/**
|
|
750
|
-
*
|
|
1037
|
+
* The result of [`accept_offer`].
|
|
751
1038
|
*/
|
|
752
|
-
|
|
1039
|
+
|
|
1040
|
+
/**
|
|
1041
|
+
* Generated factory for {@link AcceptResult} record objects.
|
|
1042
|
+
*/
|
|
1043
|
+
const AcceptResult = exports.AcceptResult = (() => {
|
|
753
1044
|
const defaults = () => ({});
|
|
754
1045
|
const create = (() => {
|
|
755
1046
|
return (0, _core.uniffiCreateRecord)(defaults);
|
|
@@ -760,28 +1051,30 @@ const OracleInfo = exports.OracleInfo = (() => {
|
|
|
760
1051
|
defaults: () => Object.freeze(defaults())
|
|
761
1052
|
});
|
|
762
1053
|
})();
|
|
763
|
-
const
|
|
1054
|
+
const FfiConverterTypeAcceptResult = (() => {
|
|
764
1055
|
class FFIConverter extends _core.AbstractFfiConverterByteArray {
|
|
765
1056
|
read(from) {
|
|
766
1057
|
return {
|
|
767
|
-
|
|
768
|
-
|
|
1058
|
+
accept: _core.FfiConverterArrayBuffer.read(from),
|
|
1059
|
+
transactions: FfiConverterTypeDlcTransactions.read(from),
|
|
1060
|
+
fundingPsbt: _core.FfiConverterArrayBuffer.read(from)
|
|
769
1061
|
};
|
|
770
1062
|
}
|
|
771
1063
|
write(value, into) {
|
|
772
|
-
_core.FfiConverterArrayBuffer.write(value.
|
|
773
|
-
|
|
1064
|
+
_core.FfiConverterArrayBuffer.write(value.accept, into);
|
|
1065
|
+
FfiConverterTypeDlcTransactions.write(value.transactions, into);
|
|
1066
|
+
_core.FfiConverterArrayBuffer.write(value.fundingPsbt, into);
|
|
774
1067
|
}
|
|
775
1068
|
allocationSize(value) {
|
|
776
|
-
return _core.FfiConverterArrayBuffer.allocationSize(value.
|
|
1069
|
+
return _core.FfiConverterArrayBuffer.allocationSize(value.accept) + FfiConverterTypeDlcTransactions.allocationSize(value.transactions) + _core.FfiConverterArrayBuffer.allocationSize(value.fundingPsbt);
|
|
777
1070
|
}
|
|
778
1071
|
}
|
|
779
1072
|
return new FFIConverter();
|
|
780
1073
|
})();
|
|
781
1074
|
/**
|
|
782
|
-
* Generated factory for {@link
|
|
1075
|
+
* Generated factory for {@link AdaptorSignature} record objects.
|
|
783
1076
|
*/
|
|
784
|
-
const
|
|
1077
|
+
const AdaptorSignature = exports.AdaptorSignature = (() => {
|
|
785
1078
|
const defaults = () => ({});
|
|
786
1079
|
const create = (() => {
|
|
787
1080
|
return (0, _core.uniffiCreateRecord)(defaults);
|
|
@@ -789,37 +1082,47 @@ const TxInputInfo = exports.TxInputInfo = (() => {
|
|
|
789
1082
|
return Object.freeze({
|
|
790
1083
|
create,
|
|
791
1084
|
new: create,
|
|
792
|
-
defaults: () => Object.freeze(defaults())
|
|
1085
|
+
defaults: () => Object.freeze(defaults()),
|
|
1086
|
+
verifyFromOracleInfo(self_, cet, oracleInfos, pubkey, fundingScriptPubkey, totalCollateral, msgs) {
|
|
1087
|
+
return _core.FfiConverterBool.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
|
|
1088
|
+
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_method_adaptorsignature_verify_from_oracle_info(FfiConverterTypeAdaptorSignature.lower(self_, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterTypeTransaction.lower(cet, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceTypeOracleInfo.lower(oracleInfos, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(pubkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterArrayBuffer.lower(fundingScriptPubkey, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt64.lower(totalCollateral, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterSequenceSequenceBytes.lower(msgs, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
1089
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
1090
|
+
}
|
|
793
1091
|
});
|
|
794
1092
|
})();
|
|
795
|
-
const
|
|
1093
|
+
const FfiConverterTypeAdaptorSignature = (() => {
|
|
796
1094
|
class FFIConverter extends _core.AbstractFfiConverterByteArray {
|
|
797
1095
|
read(from) {
|
|
798
1096
|
return {
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
scriptSig: _core.FfiConverterArrayBuffer.read(from),
|
|
802
|
-
maxWitnessLength: _core.FfiConverterUInt32.read(from),
|
|
803
|
-
serialId: _core.FfiConverterUInt64.read(from)
|
|
1097
|
+
signature: _core.FfiConverterArrayBuffer.read(from),
|
|
1098
|
+
proof: _core.FfiConverterArrayBuffer.read(from)
|
|
804
1099
|
};
|
|
805
1100
|
}
|
|
806
1101
|
write(value, into) {
|
|
807
|
-
|
|
808
|
-
_core.
|
|
809
|
-
_core.FfiConverterArrayBuffer.write(value.scriptSig, into);
|
|
810
|
-
_core.FfiConverterUInt32.write(value.maxWitnessLength, into);
|
|
811
|
-
_core.FfiConverterUInt64.write(value.serialId, into);
|
|
1102
|
+
_core.FfiConverterArrayBuffer.write(value.signature, into);
|
|
1103
|
+
_core.FfiConverterArrayBuffer.write(value.proof, into);
|
|
812
1104
|
}
|
|
813
1105
|
allocationSize(value) {
|
|
814
|
-
return
|
|
1106
|
+
return _core.FfiConverterArrayBuffer.allocationSize(value.signature) + _core.FfiConverterArrayBuffer.allocationSize(value.proof);
|
|
815
1107
|
}
|
|
816
1108
|
}
|
|
817
1109
|
return new FFIConverter();
|
|
818
1110
|
})();
|
|
1111
|
+
|
|
819
1112
|
/**
|
|
820
|
-
*
|
|
1113
|
+
* Debug info for CET adaptor signature inputs.
|
|
1114
|
+
*
|
|
1115
|
+
* Contains all the values that go into creating an adaptor signature,
|
|
1116
|
+
* useful for comparing with external signers during debugging.
|
|
1117
|
+
*
|
|
1118
|
+
* This struct is intentionally always available (not feature-gated)
|
|
1119
|
+
* to support production debugging scenarios.
|
|
821
1120
|
*/
|
|
822
|
-
|
|
1121
|
+
|
|
1122
|
+
/**
|
|
1123
|
+
* Generated factory for {@link CetAdaptorSignatureDebugInfo} record objects.
|
|
1124
|
+
*/
|
|
1125
|
+
const CetAdaptorSignatureDebugInfo = exports.CetAdaptorSignatureDebugInfo = (() => {
|
|
823
1126
|
const defaults = () => ({});
|
|
824
1127
|
const create = (() => {
|
|
825
1128
|
return (0, _core.uniffiCreateRecord)(defaults);
|
|
@@ -827,56 +1130,41 @@ const PartyParams = exports.PartyParams = (() => {
|
|
|
827
1130
|
return Object.freeze({
|
|
828
1131
|
create,
|
|
829
1132
|
new: create,
|
|
830
|
-
defaults: () => Object.freeze(defaults())
|
|
831
|
-
changeOutputAndFees(self_, feeRate) {
|
|
832
|
-
return (__rb => {
|
|
833
|
-
try {
|
|
834
|
-
return FfiConverterTypeChangeOutputAndFees.lift(__rb);
|
|
835
|
-
} finally {
|
|
836
|
-
(0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
|
|
837
|
-
}
|
|
838
|
-
})(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
|
|
839
|
-
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_method_partyparams_change_output_and_fees(FfiConverterTypePartyParams.lower(self_, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt64.lower(feeRate, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
840
|
-
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
841
|
-
}
|
|
1133
|
+
defaults: () => Object.freeze(defaults())
|
|
842
1134
|
});
|
|
843
1135
|
})();
|
|
844
|
-
const
|
|
1136
|
+
const FfiConverterTypeCetAdaptorSignatureDebugInfo = (() => {
|
|
845
1137
|
class FFIConverter extends _core.AbstractFfiConverterByteArray {
|
|
846
1138
|
read(from) {
|
|
847
1139
|
return {
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
collateral: _core.FfiConverterUInt64.read(from),
|
|
856
|
-
dlcInputs: FfiConverterSequenceTypeDlcInputInfo.read(from)
|
|
1140
|
+
sighash: _core.FfiConverterArrayBuffer.read(from),
|
|
1141
|
+
adaptorPoint: _core.FfiConverterArrayBuffer.read(from),
|
|
1142
|
+
inputIndex: _core.FfiConverterUInt32.read(from),
|
|
1143
|
+
scriptPubkey: _core.FfiConverterArrayBuffer.read(from),
|
|
1144
|
+
value: _core.FfiConverterUInt64.read(from),
|
|
1145
|
+
cetTxid: FfiConverterString.read(from),
|
|
1146
|
+
cetRaw: _core.FfiConverterArrayBuffer.read(from)
|
|
857
1147
|
};
|
|
858
1148
|
}
|
|
859
1149
|
write(value, into) {
|
|
860
|
-
_core.FfiConverterArrayBuffer.write(value.
|
|
861
|
-
_core.FfiConverterArrayBuffer.write(value.
|
|
862
|
-
_core.
|
|
863
|
-
_core.FfiConverterArrayBuffer.write(value.
|
|
864
|
-
_core.FfiConverterUInt64.write(value.
|
|
865
|
-
|
|
866
|
-
_core.
|
|
867
|
-
_core.FfiConverterUInt64.write(value.collateral, into);
|
|
868
|
-
FfiConverterSequenceTypeDlcInputInfo.write(value.dlcInputs, into);
|
|
1150
|
+
_core.FfiConverterArrayBuffer.write(value.sighash, into);
|
|
1151
|
+
_core.FfiConverterArrayBuffer.write(value.adaptorPoint, into);
|
|
1152
|
+
_core.FfiConverterUInt32.write(value.inputIndex, into);
|
|
1153
|
+
_core.FfiConverterArrayBuffer.write(value.scriptPubkey, into);
|
|
1154
|
+
_core.FfiConverterUInt64.write(value.value, into);
|
|
1155
|
+
FfiConverterString.write(value.cetTxid, into);
|
|
1156
|
+
_core.FfiConverterArrayBuffer.write(value.cetRaw, into);
|
|
869
1157
|
}
|
|
870
1158
|
allocationSize(value) {
|
|
871
|
-
return _core.FfiConverterArrayBuffer.allocationSize(value.
|
|
1159
|
+
return _core.FfiConverterArrayBuffer.allocationSize(value.sighash) + _core.FfiConverterArrayBuffer.allocationSize(value.adaptorPoint) + _core.FfiConverterUInt32.allocationSize(value.inputIndex) + _core.FfiConverterArrayBuffer.allocationSize(value.scriptPubkey) + _core.FfiConverterUInt64.allocationSize(value.value) + FfiConverterString.allocationSize(value.cetTxid) + _core.FfiConverterArrayBuffer.allocationSize(value.cetRaw);
|
|
872
1160
|
}
|
|
873
1161
|
}
|
|
874
1162
|
return new FFIConverter();
|
|
875
1163
|
})();
|
|
876
1164
|
/**
|
|
877
|
-
* Generated factory for {@link
|
|
1165
|
+
* Generated factory for {@link ChangeOutputAndFees} record objects.
|
|
878
1166
|
*/
|
|
879
|
-
const
|
|
1167
|
+
const ChangeOutputAndFees = exports.ChangeOutputAndFees = (() => {
|
|
880
1168
|
const defaults = () => ({});
|
|
881
1169
|
const create = (() => {
|
|
882
1170
|
return (0, _core.uniffiCreateRecord)(defaults);
|
|
@@ -887,20 +1175,1318 @@ const Payout = exports.Payout = (() => {
|
|
|
887
1175
|
defaults: () => Object.freeze(defaults())
|
|
888
1176
|
});
|
|
889
1177
|
})();
|
|
890
|
-
const
|
|
1178
|
+
const FfiConverterTypeChangeOutputAndFees = (() => {
|
|
891
1179
|
class FFIConverter extends _core.AbstractFfiConverterByteArray {
|
|
892
1180
|
read(from) {
|
|
893
1181
|
return {
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
1182
|
+
changeOutput: FfiConverterTypeTxOutput.read(from),
|
|
1183
|
+
fundFee: _core.FfiConverterUInt64.read(from),
|
|
1184
|
+
cetFee: _core.FfiConverterUInt64.read(from)
|
|
1185
|
+
};
|
|
1186
|
+
}
|
|
1187
|
+
write(value, into) {
|
|
1188
|
+
FfiConverterTypeTxOutput.write(value.changeOutput, into);
|
|
1189
|
+
_core.FfiConverterUInt64.write(value.fundFee, into);
|
|
1190
|
+
_core.FfiConverterUInt64.write(value.cetFee, into);
|
|
1191
|
+
}
|
|
1192
|
+
allocationSize(value) {
|
|
1193
|
+
return FfiConverterTypeTxOutput.allocationSize(value.changeOutput) + _core.FfiConverterUInt64.allocationSize(value.fundFee) + _core.FfiConverterUInt64.allocationSize(value.cetFee);
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
return new FFIConverter();
|
|
1197
|
+
})();
|
|
1198
|
+
|
|
1199
|
+
/**
|
|
1200
|
+
* One row of a contract's payout table.
|
|
1201
|
+
*
|
|
1202
|
+
* Enum-contract rows carry an `outcome` label; numeric-contract rows carry an
|
|
1203
|
+
* inclusive `[range_start, range_end]` of outcome values that share the payout.
|
|
1204
|
+
*/
|
|
1205
|
+
|
|
1206
|
+
/**
|
|
1207
|
+
* Generated factory for {@link PayoutRow} record objects.
|
|
1208
|
+
*/
|
|
1209
|
+
const PayoutRow = exports.PayoutRow = (() => {
|
|
1210
|
+
const defaults = () => ({});
|
|
1211
|
+
const create = (() => {
|
|
1212
|
+
return (0, _core.uniffiCreateRecord)(defaults);
|
|
1213
|
+
})();
|
|
1214
|
+
return Object.freeze({
|
|
1215
|
+
create,
|
|
1216
|
+
new: create,
|
|
1217
|
+
defaults: () => Object.freeze(defaults())
|
|
1218
|
+
});
|
|
1219
|
+
})();
|
|
1220
|
+
const FfiConverterTypePayoutRow = (() => {
|
|
1221
|
+
class FFIConverter extends _core.AbstractFfiConverterByteArray {
|
|
1222
|
+
read(from) {
|
|
1223
|
+
return {
|
|
1224
|
+
outcome: FfiConverterOptionalString.read(from),
|
|
1225
|
+
rangeStart: FfiConverterOptionalUInt64.read(from),
|
|
1226
|
+
rangeEnd: FfiConverterOptionalUInt64.read(from),
|
|
1227
|
+
offerPayoutSats: _core.FfiConverterUInt64.read(from),
|
|
1228
|
+
acceptPayoutSats: _core.FfiConverterUInt64.read(from)
|
|
1229
|
+
};
|
|
1230
|
+
}
|
|
1231
|
+
write(value, into) {
|
|
1232
|
+
FfiConverterOptionalString.write(value.outcome, into);
|
|
1233
|
+
FfiConverterOptionalUInt64.write(value.rangeStart, into);
|
|
1234
|
+
FfiConverterOptionalUInt64.write(value.rangeEnd, into);
|
|
1235
|
+
_core.FfiConverterUInt64.write(value.offerPayoutSats, into);
|
|
1236
|
+
_core.FfiConverterUInt64.write(value.acceptPayoutSats, into);
|
|
1237
|
+
}
|
|
1238
|
+
allocationSize(value) {
|
|
1239
|
+
return FfiConverterOptionalString.allocationSize(value.outcome) + FfiConverterOptionalUInt64.allocationSize(value.rangeStart) + FfiConverterOptionalUInt64.allocationSize(value.rangeEnd) + _core.FfiConverterUInt64.allocationSize(value.offerPayoutSats) + _core.FfiConverterUInt64.allocationSize(value.acceptPayoutSats);
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
return new FFIConverter();
|
|
1243
|
+
})();
|
|
1244
|
+
|
|
1245
|
+
/**
|
|
1246
|
+
* A contract's payouts, derived from its `ContractInfo`, for display as a table.
|
|
1247
|
+
*/
|
|
1248
|
+
|
|
1249
|
+
/**
|
|
1250
|
+
* Generated factory for {@link ContractPayouts} record objects.
|
|
1251
|
+
*/
|
|
1252
|
+
const ContractPayouts = exports.ContractPayouts = (() => {
|
|
1253
|
+
const defaults = () => ({});
|
|
1254
|
+
const create = (() => {
|
|
1255
|
+
return (0, _core.uniffiCreateRecord)(defaults);
|
|
1256
|
+
})();
|
|
1257
|
+
return Object.freeze({
|
|
1258
|
+
create,
|
|
1259
|
+
new: create,
|
|
1260
|
+
defaults: () => Object.freeze(defaults())
|
|
1261
|
+
});
|
|
1262
|
+
})();
|
|
1263
|
+
const FfiConverterTypeContractPayouts = (() => {
|
|
1264
|
+
class FFIConverter extends _core.AbstractFfiConverterByteArray {
|
|
1265
|
+
read(from) {
|
|
1266
|
+
return {
|
|
1267
|
+
totalCollateralSats: _core.FfiConverterUInt64.read(from),
|
|
1268
|
+
isEnum: _core.FfiConverterBool.read(from),
|
|
1269
|
+
rows: FfiConverterSequenceTypePayoutRow.read(from)
|
|
1270
|
+
};
|
|
1271
|
+
}
|
|
1272
|
+
write(value, into) {
|
|
1273
|
+
_core.FfiConverterUInt64.write(value.totalCollateralSats, into);
|
|
1274
|
+
_core.FfiConverterBool.write(value.isEnum, into);
|
|
1275
|
+
FfiConverterSequenceTypePayoutRow.write(value.rows, into);
|
|
1276
|
+
}
|
|
1277
|
+
allocationSize(value) {
|
|
1278
|
+
return _core.FfiConverterUInt64.allocationSize(value.totalCollateralSats) + _core.FfiConverterBool.allocationSize(value.isEnum) + FfiConverterSequenceTypePayoutRow.allocationSize(value.rows);
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
return new FFIConverter();
|
|
1282
|
+
})();
|
|
1283
|
+
|
|
1284
|
+
/**
|
|
1285
|
+
* Parameters for [`create_offer`] (mirrors [`ddk::contract::CreateOfferParams`]).
|
|
1286
|
+
*/
|
|
1287
|
+
|
|
1288
|
+
/**
|
|
1289
|
+
* Generated factory for {@link CreateOfferParams} record objects.
|
|
1290
|
+
*/
|
|
1291
|
+
const CreateOfferParams = exports.CreateOfferParams = (() => {
|
|
1292
|
+
const defaults = () => ({});
|
|
1293
|
+
const create = (() => {
|
|
1294
|
+
return (0, _core.uniffiCreateRecord)(defaults);
|
|
1295
|
+
})();
|
|
1296
|
+
return Object.freeze({
|
|
1297
|
+
create,
|
|
1298
|
+
new: create,
|
|
1299
|
+
defaults: () => Object.freeze(defaults())
|
|
1300
|
+
});
|
|
1301
|
+
})();
|
|
1302
|
+
const FfiConverterTypeCreateOfferParams = (() => {
|
|
1303
|
+
class FFIConverter extends _core.AbstractFfiConverterByteArray {
|
|
1304
|
+
read(from) {
|
|
1305
|
+
return {
|
|
1306
|
+
chainHash: _core.FfiConverterArrayBuffer.read(from),
|
|
1307
|
+
temporaryContractId: FfiConverterOptionalBytes.read(from),
|
|
1308
|
+
contractInfo: _core.FfiConverterArrayBuffer.read(from),
|
|
1309
|
+
offerCollateralSats: _core.FfiConverterUInt64.read(from),
|
|
1310
|
+
party: FfiConverterTypeContractPartyParams.read(from),
|
|
1311
|
+
fundOutputSerialId: FfiConverterOptionalUInt64.read(from),
|
|
1312
|
+
feeRatePerVb: _core.FfiConverterUInt64.read(from),
|
|
1313
|
+
cetLocktime: _core.FfiConverterUInt32.read(from),
|
|
1314
|
+
refundLocktime: _core.FfiConverterUInt32.read(from),
|
|
1315
|
+
contractFlags: _core.FfiConverterUInt8.read(from)
|
|
1316
|
+
};
|
|
1317
|
+
}
|
|
1318
|
+
write(value, into) {
|
|
1319
|
+
_core.FfiConverterArrayBuffer.write(value.chainHash, into);
|
|
1320
|
+
FfiConverterOptionalBytes.write(value.temporaryContractId, into);
|
|
1321
|
+
_core.FfiConverterArrayBuffer.write(value.contractInfo, into);
|
|
1322
|
+
_core.FfiConverterUInt64.write(value.offerCollateralSats, into);
|
|
1323
|
+
FfiConverterTypeContractPartyParams.write(value.party, into);
|
|
1324
|
+
FfiConverterOptionalUInt64.write(value.fundOutputSerialId, into);
|
|
1325
|
+
_core.FfiConverterUInt64.write(value.feeRatePerVb, into);
|
|
1326
|
+
_core.FfiConverterUInt32.write(value.cetLocktime, into);
|
|
1327
|
+
_core.FfiConverterUInt32.write(value.refundLocktime, into);
|
|
1328
|
+
_core.FfiConverterUInt8.write(value.contractFlags, into);
|
|
1329
|
+
}
|
|
1330
|
+
allocationSize(value) {
|
|
1331
|
+
return _core.FfiConverterArrayBuffer.allocationSize(value.chainHash) + FfiConverterOptionalBytes.allocationSize(value.temporaryContractId) + _core.FfiConverterArrayBuffer.allocationSize(value.contractInfo) + _core.FfiConverterUInt64.allocationSize(value.offerCollateralSats) + FfiConverterTypeContractPartyParams.allocationSize(value.party) + FfiConverterOptionalUInt64.allocationSize(value.fundOutputSerialId) + _core.FfiConverterUInt64.allocationSize(value.feeRatePerVb) + _core.FfiConverterUInt32.allocationSize(value.cetLocktime) + _core.FfiConverterUInt32.allocationSize(value.refundLocktime) + _core.FfiConverterUInt8.allocationSize(value.contractFlags);
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
return new FFIConverter();
|
|
1335
|
+
})();
|
|
1336
|
+
|
|
1337
|
+
/**
|
|
1338
|
+
* Identifies a funding input and the descriptor wildcard index that derives its
|
|
1339
|
+
* key, for [`sign_funding_psbt_with_descriptor`].
|
|
1340
|
+
*/
|
|
1341
|
+
|
|
1342
|
+
/**
|
|
1343
|
+
* Generated factory for {@link DescriptorInput} record objects.
|
|
1344
|
+
*/
|
|
1345
|
+
const DescriptorInput = exports.DescriptorInput = (() => {
|
|
1346
|
+
const defaults = () => ({});
|
|
1347
|
+
const create = (() => {
|
|
1348
|
+
return (0, _core.uniffiCreateRecord)(defaults);
|
|
1349
|
+
})();
|
|
1350
|
+
return Object.freeze({
|
|
1351
|
+
create,
|
|
1352
|
+
new: create,
|
|
1353
|
+
defaults: () => Object.freeze(defaults())
|
|
1354
|
+
});
|
|
1355
|
+
})();
|
|
1356
|
+
const FfiConverterTypeDescriptorInput = (() => {
|
|
1357
|
+
class FFIConverter extends _core.AbstractFfiConverterByteArray {
|
|
1358
|
+
read(from) {
|
|
1359
|
+
return {
|
|
1360
|
+
inputSerialId: _core.FfiConverterUInt64.read(from),
|
|
1361
|
+
derivationIndex: _core.FfiConverterUInt32.read(from)
|
|
1362
|
+
};
|
|
1363
|
+
}
|
|
1364
|
+
write(value, into) {
|
|
1365
|
+
_core.FfiConverterUInt64.write(value.inputSerialId, into);
|
|
1366
|
+
_core.FfiConverterUInt32.write(value.derivationIndex, into);
|
|
1367
|
+
}
|
|
1368
|
+
allocationSize(value) {
|
|
1369
|
+
return _core.FfiConverterUInt64.allocationSize(value.inputSerialId) + _core.FfiConverterUInt32.allocationSize(value.derivationIndex);
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
return new FFIConverter();
|
|
1373
|
+
})();
|
|
1374
|
+
/**
|
|
1375
|
+
* Generated factory for {@link DlcInputInfo} record objects.
|
|
1376
|
+
*/
|
|
1377
|
+
const DlcInputInfo = exports.DlcInputInfo = (() => {
|
|
1378
|
+
const defaults = () => ({});
|
|
1379
|
+
const create = (() => {
|
|
1380
|
+
return (0, _core.uniffiCreateRecord)(defaults);
|
|
1381
|
+
})();
|
|
1382
|
+
return Object.freeze({
|
|
1383
|
+
create,
|
|
1384
|
+
new: create,
|
|
1385
|
+
defaults: () => Object.freeze(defaults())
|
|
1386
|
+
});
|
|
1387
|
+
})();
|
|
1388
|
+
const FfiConverterTypeDlcInputInfo = (() => {
|
|
1389
|
+
class FFIConverter extends _core.AbstractFfiConverterByteArray {
|
|
1390
|
+
read(from) {
|
|
1391
|
+
return {
|
|
1392
|
+
fundTx: FfiConverterTypeTransaction.read(from),
|
|
1393
|
+
fundVout: _core.FfiConverterUInt32.read(from),
|
|
1394
|
+
localFundPubkey: _core.FfiConverterArrayBuffer.read(from),
|
|
1395
|
+
remoteFundPubkey: _core.FfiConverterArrayBuffer.read(from),
|
|
1396
|
+
fundAmount: _core.FfiConverterUInt64.read(from),
|
|
1397
|
+
maxWitnessLen: _core.FfiConverterUInt32.read(from),
|
|
1398
|
+
inputSerialId: _core.FfiConverterUInt64.read(from),
|
|
1399
|
+
contractId: _core.FfiConverterArrayBuffer.read(from)
|
|
1400
|
+
};
|
|
1401
|
+
}
|
|
1402
|
+
write(value, into) {
|
|
1403
|
+
FfiConverterTypeTransaction.write(value.fundTx, into);
|
|
1404
|
+
_core.FfiConverterUInt32.write(value.fundVout, into);
|
|
1405
|
+
_core.FfiConverterArrayBuffer.write(value.localFundPubkey, into);
|
|
1406
|
+
_core.FfiConverterArrayBuffer.write(value.remoteFundPubkey, into);
|
|
1407
|
+
_core.FfiConverterUInt64.write(value.fundAmount, into);
|
|
1408
|
+
_core.FfiConverterUInt32.write(value.maxWitnessLen, into);
|
|
1409
|
+
_core.FfiConverterUInt64.write(value.inputSerialId, into);
|
|
1410
|
+
_core.FfiConverterArrayBuffer.write(value.contractId, into);
|
|
1411
|
+
}
|
|
1412
|
+
allocationSize(value) {
|
|
1413
|
+
return FfiConverterTypeTransaction.allocationSize(value.fundTx) + _core.FfiConverterUInt32.allocationSize(value.fundVout) + _core.FfiConverterArrayBuffer.allocationSize(value.localFundPubkey) + _core.FfiConverterArrayBuffer.allocationSize(value.remoteFundPubkey) + _core.FfiConverterUInt64.allocationSize(value.fundAmount) + _core.FfiConverterUInt32.allocationSize(value.maxWitnessLen) + _core.FfiConverterUInt64.allocationSize(value.inputSerialId) + _core.FfiConverterArrayBuffer.allocationSize(value.contractId);
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
return new FFIConverter();
|
|
1417
|
+
})();
|
|
1418
|
+
|
|
1419
|
+
/**
|
|
1420
|
+
* An oracle attestation paired with the position of the oracle that produced it
|
|
1421
|
+
* in the contract's announcements, for [`sign_contract_cet`].
|
|
1422
|
+
*/
|
|
1423
|
+
|
|
1424
|
+
/**
|
|
1425
|
+
* Generated factory for {@link OracleAttestationRef} record objects.
|
|
1426
|
+
*/
|
|
1427
|
+
const OracleAttestationRef = exports.OracleAttestationRef = (() => {
|
|
1428
|
+
const defaults = () => ({});
|
|
1429
|
+
const create = (() => {
|
|
1430
|
+
return (0, _core.uniffiCreateRecord)(defaults);
|
|
1431
|
+
})();
|
|
1432
|
+
return Object.freeze({
|
|
1433
|
+
create,
|
|
1434
|
+
new: create,
|
|
1435
|
+
defaults: () => Object.freeze(defaults())
|
|
1436
|
+
});
|
|
1437
|
+
})();
|
|
1438
|
+
const FfiConverterTypeOracleAttestationRef = (() => {
|
|
1439
|
+
class FFIConverter extends _core.AbstractFfiConverterByteArray {
|
|
1440
|
+
read(from) {
|
|
1441
|
+
return {
|
|
1442
|
+
oracleIndex: _core.FfiConverterUInt32.read(from),
|
|
1443
|
+
attestation: _core.FfiConverterArrayBuffer.read(from)
|
|
1444
|
+
};
|
|
1445
|
+
}
|
|
1446
|
+
write(value, into) {
|
|
1447
|
+
_core.FfiConverterUInt32.write(value.oracleIndex, into);
|
|
1448
|
+
_core.FfiConverterArrayBuffer.write(value.attestation, into);
|
|
1449
|
+
}
|
|
1450
|
+
allocationSize(value) {
|
|
1451
|
+
return _core.FfiConverterUInt32.allocationSize(value.oracleIndex) + _core.FfiConverterArrayBuffer.allocationSize(value.attestation);
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
return new FFIConverter();
|
|
1455
|
+
})();
|
|
1456
|
+
/**
|
|
1457
|
+
* Generated factory for {@link OracleInfo} record objects.
|
|
1458
|
+
*/
|
|
1459
|
+
const OracleInfo = exports.OracleInfo = (() => {
|
|
1460
|
+
const defaults = () => ({});
|
|
1461
|
+
const create = (() => {
|
|
1462
|
+
return (0, _core.uniffiCreateRecord)(defaults);
|
|
1463
|
+
})();
|
|
1464
|
+
return Object.freeze({
|
|
1465
|
+
create,
|
|
1466
|
+
new: create,
|
|
1467
|
+
defaults: () => Object.freeze(defaults())
|
|
1468
|
+
});
|
|
1469
|
+
})();
|
|
1470
|
+
const FfiConverterTypeOracleInfo = (() => {
|
|
1471
|
+
class FFIConverter extends _core.AbstractFfiConverterByteArray {
|
|
1472
|
+
read(from) {
|
|
1473
|
+
return {
|
|
1474
|
+
publicKey: _core.FfiConverterArrayBuffer.read(from),
|
|
1475
|
+
nonces: FfiConverterSequenceBytes.read(from)
|
|
1476
|
+
};
|
|
1477
|
+
}
|
|
1478
|
+
write(value, into) {
|
|
1479
|
+
_core.FfiConverterArrayBuffer.write(value.publicKey, into);
|
|
1480
|
+
FfiConverterSequenceBytes.write(value.nonces, into);
|
|
1481
|
+
}
|
|
1482
|
+
allocationSize(value) {
|
|
1483
|
+
return _core.FfiConverterArrayBuffer.allocationSize(value.publicKey) + FfiConverterSequenceBytes.allocationSize(value.nonces);
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
return new FFIConverter();
|
|
1487
|
+
})();
|
|
1488
|
+
/**
|
|
1489
|
+
* Generated factory for {@link TxInputInfo} record objects.
|
|
1490
|
+
*/
|
|
1491
|
+
const TxInputInfo = exports.TxInputInfo = (() => {
|
|
1492
|
+
const defaults = () => ({});
|
|
1493
|
+
const create = (() => {
|
|
1494
|
+
return (0, _core.uniffiCreateRecord)(defaults);
|
|
1495
|
+
})();
|
|
1496
|
+
return Object.freeze({
|
|
1497
|
+
create,
|
|
1498
|
+
new: create,
|
|
1499
|
+
defaults: () => Object.freeze(defaults())
|
|
1500
|
+
});
|
|
1501
|
+
})();
|
|
1502
|
+
const FfiConverterTypeTxInputInfo = (() => {
|
|
1503
|
+
class FFIConverter extends _core.AbstractFfiConverterByteArray {
|
|
1504
|
+
read(from) {
|
|
1505
|
+
return {
|
|
1506
|
+
txid: FfiConverterString.read(from),
|
|
1507
|
+
vout: _core.FfiConverterUInt32.read(from),
|
|
1508
|
+
scriptSig: _core.FfiConverterArrayBuffer.read(from),
|
|
1509
|
+
maxWitnessLength: _core.FfiConverterUInt32.read(from),
|
|
1510
|
+
serialId: _core.FfiConverterUInt64.read(from)
|
|
1511
|
+
};
|
|
1512
|
+
}
|
|
1513
|
+
write(value, into) {
|
|
1514
|
+
FfiConverterString.write(value.txid, into);
|
|
1515
|
+
_core.FfiConverterUInt32.write(value.vout, into);
|
|
1516
|
+
_core.FfiConverterArrayBuffer.write(value.scriptSig, into);
|
|
1517
|
+
_core.FfiConverterUInt32.write(value.maxWitnessLength, into);
|
|
1518
|
+
_core.FfiConverterUInt64.write(value.serialId, into);
|
|
1519
|
+
}
|
|
1520
|
+
allocationSize(value) {
|
|
1521
|
+
return FfiConverterString.allocationSize(value.txid) + _core.FfiConverterUInt32.allocationSize(value.vout) + _core.FfiConverterArrayBuffer.allocationSize(value.scriptSig) + _core.FfiConverterUInt32.allocationSize(value.maxWitnessLength) + _core.FfiConverterUInt64.allocationSize(value.serialId);
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
return new FFIConverter();
|
|
1525
|
+
})();
|
|
1526
|
+
/**
|
|
1527
|
+
* Generated factory for {@link PartyParams} record objects.
|
|
1528
|
+
*/
|
|
1529
|
+
const PartyParams = exports.PartyParams = (() => {
|
|
1530
|
+
const defaults = () => ({});
|
|
1531
|
+
const create = (() => {
|
|
1532
|
+
return (0, _core.uniffiCreateRecord)(defaults);
|
|
1533
|
+
})();
|
|
1534
|
+
return Object.freeze({
|
|
1535
|
+
create,
|
|
1536
|
+
new: create,
|
|
1537
|
+
defaults: () => Object.freeze(defaults()),
|
|
1538
|
+
changeOutputAndFees(self_, feeRate) {
|
|
1539
|
+
return (__rb => {
|
|
1540
|
+
try {
|
|
1541
|
+
return FfiConverterTypeChangeOutputAndFees.lift(__rb);
|
|
1542
|
+
} finally {
|
|
1543
|
+
(0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
|
|
1544
|
+
}
|
|
1545
|
+
})(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeDLCError.lift.bind(FfiConverterTypeDLCError), /*caller:*/callStatus => {
|
|
1546
|
+
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_method_partyparams_change_output_and_fees(FfiConverterTypePartyParams.lower(self_, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), _core.FfiConverterUInt64.lower(feeRate, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
1547
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
1548
|
+
}
|
|
1549
|
+
});
|
|
1550
|
+
})();
|
|
1551
|
+
const FfiConverterTypePartyParams = (() => {
|
|
1552
|
+
class FFIConverter extends _core.AbstractFfiConverterByteArray {
|
|
1553
|
+
read(from) {
|
|
1554
|
+
return {
|
|
1555
|
+
fundPubkey: _core.FfiConverterArrayBuffer.read(from),
|
|
1556
|
+
changeScriptPubkey: _core.FfiConverterArrayBuffer.read(from),
|
|
1557
|
+
changeSerialId: _core.FfiConverterUInt64.read(from),
|
|
1558
|
+
payoutScriptPubkey: _core.FfiConverterArrayBuffer.read(from),
|
|
1559
|
+
payoutSerialId: _core.FfiConverterUInt64.read(from),
|
|
1560
|
+
inputs: FfiConverterSequenceTypeTxInputInfo.read(from),
|
|
1561
|
+
inputAmount: _core.FfiConverterUInt64.read(from),
|
|
1562
|
+
collateral: _core.FfiConverterUInt64.read(from),
|
|
1563
|
+
dlcInputs: FfiConverterSequenceTypeDlcInputInfo.read(from)
|
|
1564
|
+
};
|
|
1565
|
+
}
|
|
1566
|
+
write(value, into) {
|
|
1567
|
+
_core.FfiConverterArrayBuffer.write(value.fundPubkey, into);
|
|
1568
|
+
_core.FfiConverterArrayBuffer.write(value.changeScriptPubkey, into);
|
|
1569
|
+
_core.FfiConverterUInt64.write(value.changeSerialId, into);
|
|
1570
|
+
_core.FfiConverterArrayBuffer.write(value.payoutScriptPubkey, into);
|
|
1571
|
+
_core.FfiConverterUInt64.write(value.payoutSerialId, into);
|
|
1572
|
+
FfiConverterSequenceTypeTxInputInfo.write(value.inputs, into);
|
|
1573
|
+
_core.FfiConverterUInt64.write(value.inputAmount, into);
|
|
1574
|
+
_core.FfiConverterUInt64.write(value.collateral, into);
|
|
1575
|
+
FfiConverterSequenceTypeDlcInputInfo.write(value.dlcInputs, into);
|
|
1576
|
+
}
|
|
1577
|
+
allocationSize(value) {
|
|
1578
|
+
return _core.FfiConverterArrayBuffer.allocationSize(value.fundPubkey) + _core.FfiConverterArrayBuffer.allocationSize(value.changeScriptPubkey) + _core.FfiConverterUInt64.allocationSize(value.changeSerialId) + _core.FfiConverterArrayBuffer.allocationSize(value.payoutScriptPubkey) + _core.FfiConverterUInt64.allocationSize(value.payoutSerialId) + FfiConverterSequenceTypeTxInputInfo.allocationSize(value.inputs) + _core.FfiConverterUInt64.allocationSize(value.inputAmount) + _core.FfiConverterUInt64.allocationSize(value.collateral) + FfiConverterSequenceTypeDlcInputInfo.allocationSize(value.dlcInputs);
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
return new FFIConverter();
|
|
1582
|
+
})();
|
|
1583
|
+
/**
|
|
1584
|
+
* Generated factory for {@link Payout} record objects.
|
|
1585
|
+
*/
|
|
1586
|
+
const Payout = exports.Payout = (() => {
|
|
1587
|
+
const defaults = () => ({});
|
|
1588
|
+
const create = (() => {
|
|
1589
|
+
return (0, _core.uniffiCreateRecord)(defaults);
|
|
1590
|
+
})();
|
|
1591
|
+
return Object.freeze({
|
|
1592
|
+
create,
|
|
1593
|
+
new: create,
|
|
1594
|
+
defaults: () => Object.freeze(defaults())
|
|
1595
|
+
});
|
|
1596
|
+
})();
|
|
1597
|
+
const FfiConverterTypePayout = (() => {
|
|
1598
|
+
class FFIConverter extends _core.AbstractFfiConverterByteArray {
|
|
1599
|
+
read(from) {
|
|
1600
|
+
return {
|
|
1601
|
+
offer: _core.FfiConverterUInt64.read(from),
|
|
1602
|
+
accept: _core.FfiConverterUInt64.read(from)
|
|
1603
|
+
};
|
|
1604
|
+
}
|
|
1605
|
+
write(value, into) {
|
|
1606
|
+
_core.FfiConverterUInt64.write(value.offer, into);
|
|
1607
|
+
_core.FfiConverterUInt64.write(value.accept, into);
|
|
1608
|
+
}
|
|
1609
|
+
allocationSize(value) {
|
|
1610
|
+
return _core.FfiConverterUInt64.allocationSize(value.offer) + _core.FfiConverterUInt64.allocationSize(value.accept);
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
return new FFIConverter();
|
|
1614
|
+
})();
|
|
1615
|
+
|
|
1616
|
+
/**
|
|
1617
|
+
* The result of [`sign_accept`] / [`sign_accept_spliced`].
|
|
1618
|
+
*/
|
|
1619
|
+
|
|
1620
|
+
/**
|
|
1621
|
+
* Generated factory for {@link SignResult} record objects.
|
|
1622
|
+
*/
|
|
1623
|
+
const SignResult = exports.SignResult = (() => {
|
|
1624
|
+
const defaults = () => ({});
|
|
1625
|
+
const create = (() => {
|
|
1626
|
+
return (0, _core.uniffiCreateRecord)(defaults);
|
|
1627
|
+
})();
|
|
1628
|
+
return Object.freeze({
|
|
1629
|
+
create,
|
|
1630
|
+
new: create,
|
|
1631
|
+
defaults: () => Object.freeze(defaults())
|
|
1632
|
+
});
|
|
1633
|
+
})();
|
|
1634
|
+
const FfiConverterTypeSignResult = (() => {
|
|
1635
|
+
class FFIConverter extends _core.AbstractFfiConverterByteArray {
|
|
1636
|
+
read(from) {
|
|
1637
|
+
return {
|
|
1638
|
+
sign: _core.FfiConverterArrayBuffer.read(from),
|
|
1639
|
+
transactions: FfiConverterTypeDlcTransactions.read(from)
|
|
1640
|
+
};
|
|
1641
|
+
}
|
|
1642
|
+
write(value, into) {
|
|
1643
|
+
_core.FfiConverterArrayBuffer.write(value.sign, into);
|
|
1644
|
+
FfiConverterTypeDlcTransactions.write(value.transactions, into);
|
|
1645
|
+
}
|
|
1646
|
+
allocationSize(value) {
|
|
1647
|
+
return _core.FfiConverterArrayBuffer.allocationSize(value.sign) + FfiConverterTypeDlcTransactions.allocationSize(value.transactions);
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
return new FFIConverter();
|
|
1651
|
+
})();
|
|
1652
|
+
|
|
1653
|
+
/**
|
|
1654
|
+
* References a splice (DLC) funding input and the previous contract whose
|
|
1655
|
+
* 2-of-2 output it spends, so the provider can re-derive the signing key.
|
|
1656
|
+
*/
|
|
1657
|
+
|
|
1658
|
+
/**
|
|
1659
|
+
* Generated factory for {@link SpliceKeyRef} record objects.
|
|
1660
|
+
*/
|
|
1661
|
+
const SpliceKeyRef = exports.SpliceKeyRef = (() => {
|
|
1662
|
+
const defaults = () => ({});
|
|
1663
|
+
const create = (() => {
|
|
1664
|
+
return (0, _core.uniffiCreateRecord)(defaults);
|
|
1665
|
+
})();
|
|
1666
|
+
return Object.freeze({
|
|
1667
|
+
create,
|
|
1668
|
+
new: create,
|
|
1669
|
+
defaults: () => Object.freeze(defaults())
|
|
1670
|
+
});
|
|
1671
|
+
})();
|
|
1672
|
+
const FfiConverterTypeSpliceKeyRef = (() => {
|
|
1673
|
+
class FFIConverter extends _core.AbstractFfiConverterByteArray {
|
|
1674
|
+
read(from) {
|
|
1675
|
+
return {
|
|
1676
|
+
inputSerialId: _core.FfiConverterUInt64.read(from),
|
|
1677
|
+
priorTemporaryContractId: _core.FfiConverterArrayBuffer.read(from)
|
|
1678
|
+
};
|
|
1679
|
+
}
|
|
1680
|
+
write(value, into) {
|
|
1681
|
+
_core.FfiConverterUInt64.write(value.inputSerialId, into);
|
|
1682
|
+
_core.FfiConverterArrayBuffer.write(value.priorTemporaryContractId, into);
|
|
1683
|
+
}
|
|
1684
|
+
allocationSize(value) {
|
|
1685
|
+
return _core.FfiConverterUInt64.allocationSize(value.inputSerialId) + _core.FfiConverterArrayBuffer.allocationSize(value.priorTemporaryContractId);
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
return new FFIConverter();
|
|
1689
|
+
})();
|
|
1690
|
+
|
|
1691
|
+
// Error type: ContractError
|
|
1692
|
+
let ContractError_Tags = exports.ContractError_Tags = /*#__PURE__*/function (ContractError_Tags) {
|
|
1693
|
+
ContractError_Tags["InvalidOffer"] = "InvalidOffer";
|
|
1694
|
+
ContractError_Tags["InvalidAccept"] = "InvalidAccept";
|
|
1695
|
+
ContractError_Tags["InvalidSign"] = "InvalidSign";
|
|
1696
|
+
ContractError_Tags["InvalidFundingInput"] = "InvalidFundingInput";
|
|
1697
|
+
ContractError_Tags["PsbtMismatch"] = "PsbtMismatch";
|
|
1698
|
+
ContractError_Tags["MissingFinalizedInput"] = "MissingFinalizedInput";
|
|
1699
|
+
ContractError_Tags["UnsupportedScriptType"] = "UnsupportedScriptType";
|
|
1700
|
+
ContractError_Tags["InvalidAttestation"] = "InvalidAttestation";
|
|
1701
|
+
ContractError_Tags["NoMatchingOutcome"] = "NoMatchingOutcome";
|
|
1702
|
+
ContractError_Tags["Descriptor"] = "Descriptor";
|
|
1703
|
+
ContractError_Tags["Wallet"] = "Wallet";
|
|
1704
|
+
ContractError_Tags["Bip32"] = "Bip32";
|
|
1705
|
+
ContractError_Tags["Dlc"] = "Dlc";
|
|
1706
|
+
ContractError_Tags["Key"] = "Key";
|
|
1707
|
+
ContractError_Tags["Serialization"] = "Serialization";
|
|
1708
|
+
ContractError_Tags["InvalidNetwork"] = "InvalidNetwork";
|
|
1709
|
+
ContractError_Tags["InvalidLength"] = "InvalidLength";
|
|
1710
|
+
return ContractError_Tags;
|
|
1711
|
+
}({});
|
|
1712
|
+
/**
|
|
1713
|
+
* Errors returned by the stateless contract API.
|
|
1714
|
+
*
|
|
1715
|
+
* Mirrors [`ddk::contract::ContractError`] as a uniffi error so the typed
|
|
1716
|
+
* variants survive across the binding boundary. Variants carry plain strings.
|
|
1717
|
+
*/
|
|
1718
|
+
const ContractError = exports.ContractError = (() => {
|
|
1719
|
+
class InvalidOffer_ extends _core.UniffiError {
|
|
1720
|
+
/**
|
|
1721
|
+
* @private
|
|
1722
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1723
|
+
*/
|
|
1724
|
+
[_core.uniffiTypeNameSymbol] = 'ContractError';
|
|
1725
|
+
tag = ContractError_Tags.InvalidOffer;
|
|
1726
|
+
constructor(inner) {
|
|
1727
|
+
super('ContractError', 'InvalidOffer');
|
|
1728
|
+
this.inner = Object.freeze(inner);
|
|
1729
|
+
}
|
|
1730
|
+
static new(inner) {
|
|
1731
|
+
return new InvalidOffer_(inner);
|
|
1732
|
+
}
|
|
1733
|
+
static instanceOf(obj) {
|
|
1734
|
+
return obj.tag === ContractError_Tags.InvalidOffer;
|
|
1735
|
+
}
|
|
1736
|
+
static hasInner(obj) {
|
|
1737
|
+
return InvalidOffer_.instanceOf(obj);
|
|
1738
|
+
}
|
|
1739
|
+
static getInner(obj) {
|
|
1740
|
+
return obj.inner;
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
class InvalidAccept_ extends _core.UniffiError {
|
|
1744
|
+
/**
|
|
1745
|
+
* @private
|
|
1746
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1747
|
+
*/
|
|
1748
|
+
[_core.uniffiTypeNameSymbol] = 'ContractError';
|
|
1749
|
+
tag = ContractError_Tags.InvalidAccept;
|
|
1750
|
+
constructor(inner) {
|
|
1751
|
+
super('ContractError', 'InvalidAccept');
|
|
1752
|
+
this.inner = Object.freeze(inner);
|
|
1753
|
+
}
|
|
1754
|
+
static new(inner) {
|
|
1755
|
+
return new InvalidAccept_(inner);
|
|
1756
|
+
}
|
|
1757
|
+
static instanceOf(obj) {
|
|
1758
|
+
return obj.tag === ContractError_Tags.InvalidAccept;
|
|
1759
|
+
}
|
|
1760
|
+
static hasInner(obj) {
|
|
1761
|
+
return InvalidAccept_.instanceOf(obj);
|
|
1762
|
+
}
|
|
1763
|
+
static getInner(obj) {
|
|
1764
|
+
return obj.inner;
|
|
1765
|
+
}
|
|
1766
|
+
}
|
|
1767
|
+
class InvalidSign_ extends _core.UniffiError {
|
|
1768
|
+
/**
|
|
1769
|
+
* @private
|
|
1770
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1771
|
+
*/
|
|
1772
|
+
[_core.uniffiTypeNameSymbol] = 'ContractError';
|
|
1773
|
+
tag = ContractError_Tags.InvalidSign;
|
|
1774
|
+
constructor(inner) {
|
|
1775
|
+
super('ContractError', 'InvalidSign');
|
|
1776
|
+
this.inner = Object.freeze(inner);
|
|
1777
|
+
}
|
|
1778
|
+
static new(inner) {
|
|
1779
|
+
return new InvalidSign_(inner);
|
|
1780
|
+
}
|
|
1781
|
+
static instanceOf(obj) {
|
|
1782
|
+
return obj.tag === ContractError_Tags.InvalidSign;
|
|
1783
|
+
}
|
|
1784
|
+
static hasInner(obj) {
|
|
1785
|
+
return InvalidSign_.instanceOf(obj);
|
|
1786
|
+
}
|
|
1787
|
+
static getInner(obj) {
|
|
1788
|
+
return obj.inner;
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1791
|
+
class InvalidFundingInput_ extends _core.UniffiError {
|
|
1792
|
+
/**
|
|
1793
|
+
* @private
|
|
1794
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1795
|
+
*/
|
|
1796
|
+
[_core.uniffiTypeNameSymbol] = 'ContractError';
|
|
1797
|
+
tag = ContractError_Tags.InvalidFundingInput;
|
|
1798
|
+
constructor(inner) {
|
|
1799
|
+
super('ContractError', 'InvalidFundingInput');
|
|
1800
|
+
this.inner = Object.freeze(inner);
|
|
1801
|
+
}
|
|
1802
|
+
static new(inner) {
|
|
1803
|
+
return new InvalidFundingInput_(inner);
|
|
1804
|
+
}
|
|
1805
|
+
static instanceOf(obj) {
|
|
1806
|
+
return obj.tag === ContractError_Tags.InvalidFundingInput;
|
|
1807
|
+
}
|
|
1808
|
+
static hasInner(obj) {
|
|
1809
|
+
return InvalidFundingInput_.instanceOf(obj);
|
|
1810
|
+
}
|
|
1811
|
+
static getInner(obj) {
|
|
1812
|
+
return obj.inner;
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
class PsbtMismatch_ extends _core.UniffiError {
|
|
1816
|
+
/**
|
|
1817
|
+
* @private
|
|
1818
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1819
|
+
*/
|
|
1820
|
+
[_core.uniffiTypeNameSymbol] = 'ContractError';
|
|
1821
|
+
tag = ContractError_Tags.PsbtMismatch;
|
|
1822
|
+
constructor(inner) {
|
|
1823
|
+
super('ContractError', 'PsbtMismatch');
|
|
1824
|
+
this.inner = Object.freeze(inner);
|
|
1825
|
+
}
|
|
1826
|
+
static new(inner) {
|
|
1827
|
+
return new PsbtMismatch_(inner);
|
|
1828
|
+
}
|
|
1829
|
+
static instanceOf(obj) {
|
|
1830
|
+
return obj.tag === ContractError_Tags.PsbtMismatch;
|
|
1831
|
+
}
|
|
1832
|
+
static hasInner(obj) {
|
|
1833
|
+
return PsbtMismatch_.instanceOf(obj);
|
|
1834
|
+
}
|
|
1835
|
+
static getInner(obj) {
|
|
1836
|
+
return obj.inner;
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
class MissingFinalizedInput_ extends _core.UniffiError {
|
|
1840
|
+
/**
|
|
1841
|
+
* @private
|
|
1842
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1843
|
+
*/
|
|
1844
|
+
[_core.uniffiTypeNameSymbol] = 'ContractError';
|
|
1845
|
+
tag = ContractError_Tags.MissingFinalizedInput;
|
|
1846
|
+
constructor(inner) {
|
|
1847
|
+
super('ContractError', 'MissingFinalizedInput');
|
|
1848
|
+
this.inner = Object.freeze(inner);
|
|
1849
|
+
}
|
|
1850
|
+
static new(inner) {
|
|
1851
|
+
return new MissingFinalizedInput_(inner);
|
|
1852
|
+
}
|
|
1853
|
+
static instanceOf(obj) {
|
|
1854
|
+
return obj.tag === ContractError_Tags.MissingFinalizedInput;
|
|
1855
|
+
}
|
|
1856
|
+
static hasInner(obj) {
|
|
1857
|
+
return MissingFinalizedInput_.instanceOf(obj);
|
|
1858
|
+
}
|
|
1859
|
+
static getInner(obj) {
|
|
1860
|
+
return obj.inner;
|
|
1861
|
+
}
|
|
1862
|
+
}
|
|
1863
|
+
class UnsupportedScriptType_ extends _core.UniffiError {
|
|
1864
|
+
/**
|
|
1865
|
+
* @private
|
|
1866
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1867
|
+
*/
|
|
1868
|
+
[_core.uniffiTypeNameSymbol] = 'ContractError';
|
|
1869
|
+
tag = ContractError_Tags.UnsupportedScriptType;
|
|
1870
|
+
constructor(inner) {
|
|
1871
|
+
super('ContractError', 'UnsupportedScriptType');
|
|
1872
|
+
this.inner = Object.freeze(inner);
|
|
1873
|
+
}
|
|
1874
|
+
static new(inner) {
|
|
1875
|
+
return new UnsupportedScriptType_(inner);
|
|
1876
|
+
}
|
|
1877
|
+
static instanceOf(obj) {
|
|
1878
|
+
return obj.tag === ContractError_Tags.UnsupportedScriptType;
|
|
1879
|
+
}
|
|
1880
|
+
static hasInner(obj) {
|
|
1881
|
+
return UnsupportedScriptType_.instanceOf(obj);
|
|
1882
|
+
}
|
|
1883
|
+
static getInner(obj) {
|
|
1884
|
+
return obj.inner;
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
class InvalidAttestation_ extends _core.UniffiError {
|
|
1888
|
+
/**
|
|
1889
|
+
* @private
|
|
1890
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1891
|
+
*/
|
|
1892
|
+
[_core.uniffiTypeNameSymbol] = 'ContractError';
|
|
1893
|
+
tag = ContractError_Tags.InvalidAttestation;
|
|
1894
|
+
constructor(inner) {
|
|
1895
|
+
super('ContractError', 'InvalidAttestation');
|
|
1896
|
+
this.inner = Object.freeze(inner);
|
|
1897
|
+
}
|
|
1898
|
+
static new(inner) {
|
|
1899
|
+
return new InvalidAttestation_(inner);
|
|
1900
|
+
}
|
|
1901
|
+
static instanceOf(obj) {
|
|
1902
|
+
return obj.tag === ContractError_Tags.InvalidAttestation;
|
|
1903
|
+
}
|
|
1904
|
+
static hasInner(obj) {
|
|
1905
|
+
return InvalidAttestation_.instanceOf(obj);
|
|
1906
|
+
}
|
|
1907
|
+
static getInner(obj) {
|
|
1908
|
+
return obj.inner;
|
|
1909
|
+
}
|
|
1910
|
+
}
|
|
1911
|
+
class NoMatchingOutcome_ extends _core.UniffiError {
|
|
1912
|
+
/**
|
|
1913
|
+
* @private
|
|
1914
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1915
|
+
*/
|
|
1916
|
+
[_core.uniffiTypeNameSymbol] = 'ContractError';
|
|
1917
|
+
tag = ContractError_Tags.NoMatchingOutcome;
|
|
1918
|
+
constructor() {
|
|
1919
|
+
super('ContractError', 'NoMatchingOutcome');
|
|
1920
|
+
}
|
|
1921
|
+
static new() {
|
|
1922
|
+
return new NoMatchingOutcome_();
|
|
1923
|
+
}
|
|
1924
|
+
static instanceOf(obj) {
|
|
1925
|
+
return obj.tag === ContractError_Tags.NoMatchingOutcome;
|
|
1926
|
+
}
|
|
1927
|
+
static hasInner(obj) {
|
|
1928
|
+
return false;
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
class Descriptor_ extends _core.UniffiError {
|
|
1932
|
+
/**
|
|
1933
|
+
* @private
|
|
1934
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1935
|
+
*/
|
|
1936
|
+
[_core.uniffiTypeNameSymbol] = 'ContractError';
|
|
1937
|
+
tag = ContractError_Tags.Descriptor;
|
|
1938
|
+
constructor(inner) {
|
|
1939
|
+
super('ContractError', 'Descriptor');
|
|
1940
|
+
this.inner = Object.freeze(inner);
|
|
1941
|
+
}
|
|
1942
|
+
static new(inner) {
|
|
1943
|
+
return new Descriptor_(inner);
|
|
1944
|
+
}
|
|
1945
|
+
static instanceOf(obj) {
|
|
1946
|
+
return obj.tag === ContractError_Tags.Descriptor;
|
|
1947
|
+
}
|
|
1948
|
+
static hasInner(obj) {
|
|
1949
|
+
return Descriptor_.instanceOf(obj);
|
|
1950
|
+
}
|
|
1951
|
+
static getInner(obj) {
|
|
1952
|
+
return obj.inner;
|
|
1953
|
+
}
|
|
1954
|
+
}
|
|
1955
|
+
class Wallet_ extends _core.UniffiError {
|
|
1956
|
+
/**
|
|
1957
|
+
* @private
|
|
1958
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1959
|
+
*/
|
|
1960
|
+
[_core.uniffiTypeNameSymbol] = 'ContractError';
|
|
1961
|
+
tag = ContractError_Tags.Wallet;
|
|
1962
|
+
constructor(inner) {
|
|
1963
|
+
super('ContractError', 'Wallet');
|
|
1964
|
+
this.inner = Object.freeze(inner);
|
|
1965
|
+
}
|
|
1966
|
+
static new(inner) {
|
|
1967
|
+
return new Wallet_(inner);
|
|
1968
|
+
}
|
|
1969
|
+
static instanceOf(obj) {
|
|
1970
|
+
return obj.tag === ContractError_Tags.Wallet;
|
|
1971
|
+
}
|
|
1972
|
+
static hasInner(obj) {
|
|
1973
|
+
return Wallet_.instanceOf(obj);
|
|
1974
|
+
}
|
|
1975
|
+
static getInner(obj) {
|
|
1976
|
+
return obj.inner;
|
|
1977
|
+
}
|
|
1978
|
+
}
|
|
1979
|
+
class Bip32_ extends _core.UniffiError {
|
|
1980
|
+
/**
|
|
1981
|
+
* @private
|
|
1982
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1983
|
+
*/
|
|
1984
|
+
[_core.uniffiTypeNameSymbol] = 'ContractError';
|
|
1985
|
+
tag = ContractError_Tags.Bip32;
|
|
1986
|
+
constructor(inner) {
|
|
1987
|
+
super('ContractError', 'Bip32');
|
|
1988
|
+
this.inner = Object.freeze(inner);
|
|
1989
|
+
}
|
|
1990
|
+
static new(inner) {
|
|
1991
|
+
return new Bip32_(inner);
|
|
1992
|
+
}
|
|
1993
|
+
static instanceOf(obj) {
|
|
1994
|
+
return obj.tag === ContractError_Tags.Bip32;
|
|
1995
|
+
}
|
|
1996
|
+
static hasInner(obj) {
|
|
1997
|
+
return Bip32_.instanceOf(obj);
|
|
1998
|
+
}
|
|
1999
|
+
static getInner(obj) {
|
|
2000
|
+
return obj.inner;
|
|
2001
|
+
}
|
|
2002
|
+
}
|
|
2003
|
+
class Dlc_ extends _core.UniffiError {
|
|
2004
|
+
/**
|
|
2005
|
+
* @private
|
|
2006
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2007
|
+
*/
|
|
2008
|
+
[_core.uniffiTypeNameSymbol] = 'ContractError';
|
|
2009
|
+
tag = ContractError_Tags.Dlc;
|
|
2010
|
+
constructor(inner) {
|
|
2011
|
+
super('ContractError', 'Dlc');
|
|
2012
|
+
this.inner = Object.freeze(inner);
|
|
2013
|
+
}
|
|
2014
|
+
static new(inner) {
|
|
2015
|
+
return new Dlc_(inner);
|
|
2016
|
+
}
|
|
2017
|
+
static instanceOf(obj) {
|
|
2018
|
+
return obj.tag === ContractError_Tags.Dlc;
|
|
2019
|
+
}
|
|
2020
|
+
static hasInner(obj) {
|
|
2021
|
+
return Dlc_.instanceOf(obj);
|
|
2022
|
+
}
|
|
2023
|
+
static getInner(obj) {
|
|
2024
|
+
return obj.inner;
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
class Key_ extends _core.UniffiError {
|
|
2028
|
+
/**
|
|
2029
|
+
* @private
|
|
2030
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2031
|
+
*/
|
|
2032
|
+
[_core.uniffiTypeNameSymbol] = 'ContractError';
|
|
2033
|
+
tag = ContractError_Tags.Key;
|
|
2034
|
+
constructor(inner) {
|
|
2035
|
+
super('ContractError', 'Key');
|
|
2036
|
+
this.inner = Object.freeze(inner);
|
|
2037
|
+
}
|
|
2038
|
+
static new(inner) {
|
|
2039
|
+
return new Key_(inner);
|
|
2040
|
+
}
|
|
2041
|
+
static instanceOf(obj) {
|
|
2042
|
+
return obj.tag === ContractError_Tags.Key;
|
|
2043
|
+
}
|
|
2044
|
+
static hasInner(obj) {
|
|
2045
|
+
return Key_.instanceOf(obj);
|
|
2046
|
+
}
|
|
2047
|
+
static getInner(obj) {
|
|
2048
|
+
return obj.inner;
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2051
|
+
/**
|
|
2052
|
+
* A message or PSBT could not be (de)serialized at the FFI boundary.
|
|
2053
|
+
*/
|
|
2054
|
+
class Serialization_ extends _core.UniffiError {
|
|
2055
|
+
/**
|
|
2056
|
+
* @private
|
|
2057
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2058
|
+
*/
|
|
2059
|
+
[_core.uniffiTypeNameSymbol] = 'ContractError';
|
|
2060
|
+
tag = ContractError_Tags.Serialization;
|
|
2061
|
+
constructor(inner) {
|
|
2062
|
+
super('ContractError', 'Serialization');
|
|
2063
|
+
this.inner = Object.freeze(inner);
|
|
2064
|
+
}
|
|
2065
|
+
static new(inner) {
|
|
2066
|
+
return new Serialization_(inner);
|
|
2067
|
+
}
|
|
2068
|
+
static instanceOf(obj) {
|
|
2069
|
+
return obj.tag === ContractError_Tags.Serialization;
|
|
2070
|
+
}
|
|
2071
|
+
static hasInner(obj) {
|
|
2072
|
+
return Serialization_.instanceOf(obj);
|
|
2073
|
+
}
|
|
2074
|
+
static getInner(obj) {
|
|
2075
|
+
return obj.inner;
|
|
2076
|
+
}
|
|
2077
|
+
}
|
|
2078
|
+
/**
|
|
2079
|
+
* The network string was not one of bitcoin/testnet/signet/regtest.
|
|
2080
|
+
*/
|
|
2081
|
+
class InvalidNetwork_ extends _core.UniffiError {
|
|
2082
|
+
/**
|
|
2083
|
+
* @private
|
|
2084
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2085
|
+
*/
|
|
2086
|
+
[_core.uniffiTypeNameSymbol] = 'ContractError';
|
|
2087
|
+
tag = ContractError_Tags.InvalidNetwork;
|
|
2088
|
+
constructor(inner) {
|
|
2089
|
+
super('ContractError', 'InvalidNetwork');
|
|
2090
|
+
this.inner = Object.freeze(inner);
|
|
2091
|
+
}
|
|
2092
|
+
static new(inner) {
|
|
2093
|
+
return new InvalidNetwork_(inner);
|
|
2094
|
+
}
|
|
2095
|
+
static instanceOf(obj) {
|
|
2096
|
+
return obj.tag === ContractError_Tags.InvalidNetwork;
|
|
2097
|
+
}
|
|
2098
|
+
static hasInner(obj) {
|
|
2099
|
+
return InvalidNetwork_.instanceOf(obj);
|
|
2100
|
+
}
|
|
2101
|
+
static getInner(obj) {
|
|
2102
|
+
return obj.inner;
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
/**
|
|
2106
|
+
* A byte argument had the wrong length (e.g. a 32-byte id).
|
|
2107
|
+
*/
|
|
2108
|
+
class InvalidLength_ extends _core.UniffiError {
|
|
2109
|
+
/**
|
|
2110
|
+
* @private
|
|
2111
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2112
|
+
*/
|
|
2113
|
+
[_core.uniffiTypeNameSymbol] = 'ContractError';
|
|
2114
|
+
tag = ContractError_Tags.InvalidLength;
|
|
2115
|
+
constructor(inner) {
|
|
2116
|
+
super('ContractError', 'InvalidLength');
|
|
2117
|
+
this.inner = Object.freeze(inner);
|
|
2118
|
+
}
|
|
2119
|
+
static new(inner) {
|
|
2120
|
+
return new InvalidLength_(inner);
|
|
2121
|
+
}
|
|
2122
|
+
static instanceOf(obj) {
|
|
2123
|
+
return obj.tag === ContractError_Tags.InvalidLength;
|
|
2124
|
+
}
|
|
2125
|
+
static hasInner(obj) {
|
|
2126
|
+
return InvalidLength_.instanceOf(obj);
|
|
2127
|
+
}
|
|
2128
|
+
static getInner(obj) {
|
|
2129
|
+
return obj.inner;
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2132
|
+
function instanceOf(obj) {
|
|
2133
|
+
return obj[_core.uniffiTypeNameSymbol] === 'ContractError';
|
|
2134
|
+
}
|
|
2135
|
+
return Object.freeze({
|
|
2136
|
+
instanceOf,
|
|
2137
|
+
InvalidOffer: InvalidOffer_,
|
|
2138
|
+
InvalidAccept: InvalidAccept_,
|
|
2139
|
+
InvalidSign: InvalidSign_,
|
|
2140
|
+
InvalidFundingInput: InvalidFundingInput_,
|
|
2141
|
+
PsbtMismatch: PsbtMismatch_,
|
|
2142
|
+
MissingFinalizedInput: MissingFinalizedInput_,
|
|
2143
|
+
UnsupportedScriptType: UnsupportedScriptType_,
|
|
2144
|
+
InvalidAttestation: InvalidAttestation_,
|
|
2145
|
+
NoMatchingOutcome: NoMatchingOutcome_,
|
|
2146
|
+
Descriptor: Descriptor_,
|
|
2147
|
+
Wallet: Wallet_,
|
|
2148
|
+
Bip32: Bip32_,
|
|
2149
|
+
Dlc: Dlc_,
|
|
2150
|
+
Key: Key_,
|
|
2151
|
+
Serialization: Serialization_,
|
|
2152
|
+
InvalidNetwork: InvalidNetwork_,
|
|
2153
|
+
InvalidLength: InvalidLength_
|
|
2154
|
+
});
|
|
2155
|
+
})();
|
|
2156
|
+
/**
|
|
2157
|
+
* Errors returned by the stateless contract API.
|
|
2158
|
+
*
|
|
2159
|
+
* Mirrors [`ddk::contract::ContractError`] as a uniffi error so the typed
|
|
2160
|
+
* variants survive across the binding boundary. Variants carry plain strings.
|
|
2161
|
+
*/
|
|
2162
|
+
|
|
2163
|
+
// FfiConverter for enum ContractError
|
|
2164
|
+
const FfiConverterTypeContractError = (() => {
|
|
2165
|
+
const ordinalConverter = _core.FfiConverterInt32;
|
|
2166
|
+
class FFIConverter extends _core.AbstractFfiConverterByteArray {
|
|
2167
|
+
read(from) {
|
|
2168
|
+
switch (ordinalConverter.read(from)) {
|
|
2169
|
+
case 1:
|
|
2170
|
+
return new ContractError.InvalidOffer({
|
|
2171
|
+
message: FfiConverterString.read(from)
|
|
2172
|
+
});
|
|
2173
|
+
case 2:
|
|
2174
|
+
return new ContractError.InvalidAccept({
|
|
2175
|
+
message: FfiConverterString.read(from)
|
|
2176
|
+
});
|
|
2177
|
+
case 3:
|
|
2178
|
+
return new ContractError.InvalidSign({
|
|
2179
|
+
message: FfiConverterString.read(from)
|
|
2180
|
+
});
|
|
2181
|
+
case 4:
|
|
2182
|
+
return new ContractError.InvalidFundingInput({
|
|
2183
|
+
message: FfiConverterString.read(from)
|
|
2184
|
+
});
|
|
2185
|
+
case 5:
|
|
2186
|
+
return new ContractError.PsbtMismatch({
|
|
2187
|
+
message: FfiConverterString.read(from)
|
|
2188
|
+
});
|
|
2189
|
+
case 6:
|
|
2190
|
+
return new ContractError.MissingFinalizedInput({
|
|
2191
|
+
inputIndex: _core.FfiConverterUInt32.read(from)
|
|
2192
|
+
});
|
|
2193
|
+
case 7:
|
|
2194
|
+
return new ContractError.UnsupportedScriptType({
|
|
2195
|
+
inputIndex: _core.FfiConverterUInt32.read(from)
|
|
2196
|
+
});
|
|
2197
|
+
case 8:
|
|
2198
|
+
return new ContractError.InvalidAttestation({
|
|
2199
|
+
message: FfiConverterString.read(from)
|
|
2200
|
+
});
|
|
2201
|
+
case 9:
|
|
2202
|
+
return new ContractError.NoMatchingOutcome();
|
|
2203
|
+
case 10:
|
|
2204
|
+
return new ContractError.Descriptor({
|
|
2205
|
+
message: FfiConverterString.read(from)
|
|
2206
|
+
});
|
|
2207
|
+
case 11:
|
|
2208
|
+
return new ContractError.Wallet({
|
|
2209
|
+
message: FfiConverterString.read(from)
|
|
2210
|
+
});
|
|
2211
|
+
case 12:
|
|
2212
|
+
return new ContractError.Bip32({
|
|
2213
|
+
message: FfiConverterString.read(from)
|
|
2214
|
+
});
|
|
2215
|
+
case 13:
|
|
2216
|
+
return new ContractError.Dlc({
|
|
2217
|
+
message: FfiConverterString.read(from)
|
|
2218
|
+
});
|
|
2219
|
+
case 14:
|
|
2220
|
+
return new ContractError.Key({
|
|
2221
|
+
message: FfiConverterString.read(from)
|
|
2222
|
+
});
|
|
2223
|
+
case 15:
|
|
2224
|
+
return new ContractError.Serialization({
|
|
2225
|
+
message: FfiConverterString.read(from)
|
|
2226
|
+
});
|
|
2227
|
+
case 16:
|
|
2228
|
+
return new ContractError.InvalidNetwork({
|
|
2229
|
+
message: FfiConverterString.read(from)
|
|
2230
|
+
});
|
|
2231
|
+
case 17:
|
|
2232
|
+
return new ContractError.InvalidLength({
|
|
2233
|
+
field: FfiConverterString.read(from),
|
|
2234
|
+
expected: _core.FfiConverterUInt32.read(from),
|
|
2235
|
+
actual: _core.FfiConverterUInt32.read(from)
|
|
2236
|
+
});
|
|
2237
|
+
default:
|
|
2238
|
+
throw new _core.UniffiInternalError.UnexpectedEnumCase();
|
|
2239
|
+
}
|
|
897
2240
|
}
|
|
898
2241
|
write(value, into) {
|
|
899
|
-
|
|
900
|
-
|
|
2242
|
+
switch (value.tag) {
|
|
2243
|
+
case ContractError_Tags.InvalidOffer:
|
|
2244
|
+
{
|
|
2245
|
+
ordinalConverter.write(1, into);
|
|
2246
|
+
const inner = value.inner;
|
|
2247
|
+
FfiConverterString.write(inner.message, into);
|
|
2248
|
+
return;
|
|
2249
|
+
}
|
|
2250
|
+
case ContractError_Tags.InvalidAccept:
|
|
2251
|
+
{
|
|
2252
|
+
ordinalConverter.write(2, into);
|
|
2253
|
+
const inner = value.inner;
|
|
2254
|
+
FfiConverterString.write(inner.message, into);
|
|
2255
|
+
return;
|
|
2256
|
+
}
|
|
2257
|
+
case ContractError_Tags.InvalidSign:
|
|
2258
|
+
{
|
|
2259
|
+
ordinalConverter.write(3, into);
|
|
2260
|
+
const inner = value.inner;
|
|
2261
|
+
FfiConverterString.write(inner.message, into);
|
|
2262
|
+
return;
|
|
2263
|
+
}
|
|
2264
|
+
case ContractError_Tags.InvalidFundingInput:
|
|
2265
|
+
{
|
|
2266
|
+
ordinalConverter.write(4, into);
|
|
2267
|
+
const inner = value.inner;
|
|
2268
|
+
FfiConverterString.write(inner.message, into);
|
|
2269
|
+
return;
|
|
2270
|
+
}
|
|
2271
|
+
case ContractError_Tags.PsbtMismatch:
|
|
2272
|
+
{
|
|
2273
|
+
ordinalConverter.write(5, into);
|
|
2274
|
+
const inner = value.inner;
|
|
2275
|
+
FfiConverterString.write(inner.message, into);
|
|
2276
|
+
return;
|
|
2277
|
+
}
|
|
2278
|
+
case ContractError_Tags.MissingFinalizedInput:
|
|
2279
|
+
{
|
|
2280
|
+
ordinalConverter.write(6, into);
|
|
2281
|
+
const inner = value.inner;
|
|
2282
|
+
_core.FfiConverterUInt32.write(inner.inputIndex, into);
|
|
2283
|
+
return;
|
|
2284
|
+
}
|
|
2285
|
+
case ContractError_Tags.UnsupportedScriptType:
|
|
2286
|
+
{
|
|
2287
|
+
ordinalConverter.write(7, into);
|
|
2288
|
+
const inner = value.inner;
|
|
2289
|
+
_core.FfiConverterUInt32.write(inner.inputIndex, into);
|
|
2290
|
+
return;
|
|
2291
|
+
}
|
|
2292
|
+
case ContractError_Tags.InvalidAttestation:
|
|
2293
|
+
{
|
|
2294
|
+
ordinalConverter.write(8, into);
|
|
2295
|
+
const inner = value.inner;
|
|
2296
|
+
FfiConverterString.write(inner.message, into);
|
|
2297
|
+
return;
|
|
2298
|
+
}
|
|
2299
|
+
case ContractError_Tags.NoMatchingOutcome:
|
|
2300
|
+
{
|
|
2301
|
+
ordinalConverter.write(9, into);
|
|
2302
|
+
return;
|
|
2303
|
+
}
|
|
2304
|
+
case ContractError_Tags.Descriptor:
|
|
2305
|
+
{
|
|
2306
|
+
ordinalConverter.write(10, into);
|
|
2307
|
+
const inner = value.inner;
|
|
2308
|
+
FfiConverterString.write(inner.message, into);
|
|
2309
|
+
return;
|
|
2310
|
+
}
|
|
2311
|
+
case ContractError_Tags.Wallet:
|
|
2312
|
+
{
|
|
2313
|
+
ordinalConverter.write(11, into);
|
|
2314
|
+
const inner = value.inner;
|
|
2315
|
+
FfiConverterString.write(inner.message, into);
|
|
2316
|
+
return;
|
|
2317
|
+
}
|
|
2318
|
+
case ContractError_Tags.Bip32:
|
|
2319
|
+
{
|
|
2320
|
+
ordinalConverter.write(12, into);
|
|
2321
|
+
const inner = value.inner;
|
|
2322
|
+
FfiConverterString.write(inner.message, into);
|
|
2323
|
+
return;
|
|
2324
|
+
}
|
|
2325
|
+
case ContractError_Tags.Dlc:
|
|
2326
|
+
{
|
|
2327
|
+
ordinalConverter.write(13, into);
|
|
2328
|
+
const inner = value.inner;
|
|
2329
|
+
FfiConverterString.write(inner.message, into);
|
|
2330
|
+
return;
|
|
2331
|
+
}
|
|
2332
|
+
case ContractError_Tags.Key:
|
|
2333
|
+
{
|
|
2334
|
+
ordinalConverter.write(14, into);
|
|
2335
|
+
const inner = value.inner;
|
|
2336
|
+
FfiConverterString.write(inner.message, into);
|
|
2337
|
+
return;
|
|
2338
|
+
}
|
|
2339
|
+
case ContractError_Tags.Serialization:
|
|
2340
|
+
{
|
|
2341
|
+
ordinalConverter.write(15, into);
|
|
2342
|
+
const inner = value.inner;
|
|
2343
|
+
FfiConverterString.write(inner.message, into);
|
|
2344
|
+
return;
|
|
2345
|
+
}
|
|
2346
|
+
case ContractError_Tags.InvalidNetwork:
|
|
2347
|
+
{
|
|
2348
|
+
ordinalConverter.write(16, into);
|
|
2349
|
+
const inner = value.inner;
|
|
2350
|
+
FfiConverterString.write(inner.message, into);
|
|
2351
|
+
return;
|
|
2352
|
+
}
|
|
2353
|
+
case ContractError_Tags.InvalidLength:
|
|
2354
|
+
{
|
|
2355
|
+
ordinalConverter.write(17, into);
|
|
2356
|
+
const inner = value.inner;
|
|
2357
|
+
FfiConverterString.write(inner.field, into);
|
|
2358
|
+
_core.FfiConverterUInt32.write(inner.expected, into);
|
|
2359
|
+
_core.FfiConverterUInt32.write(inner.actual, into);
|
|
2360
|
+
return;
|
|
2361
|
+
}
|
|
2362
|
+
default:
|
|
2363
|
+
// Throwing from here means that ContractError_Tags hasn't matched an ordinal.
|
|
2364
|
+
throw new _core.UniffiInternalError.UnexpectedEnumCase();
|
|
2365
|
+
}
|
|
901
2366
|
}
|
|
902
2367
|
allocationSize(value) {
|
|
903
|
-
|
|
2368
|
+
switch (value.tag) {
|
|
2369
|
+
case ContractError_Tags.InvalidOffer:
|
|
2370
|
+
{
|
|
2371
|
+
const inner = value.inner;
|
|
2372
|
+
let size = ordinalConverter.allocationSize(1);
|
|
2373
|
+
size += FfiConverterString.allocationSize(inner.message);
|
|
2374
|
+
return size;
|
|
2375
|
+
}
|
|
2376
|
+
case ContractError_Tags.InvalidAccept:
|
|
2377
|
+
{
|
|
2378
|
+
const inner = value.inner;
|
|
2379
|
+
let size = ordinalConverter.allocationSize(2);
|
|
2380
|
+
size += FfiConverterString.allocationSize(inner.message);
|
|
2381
|
+
return size;
|
|
2382
|
+
}
|
|
2383
|
+
case ContractError_Tags.InvalidSign:
|
|
2384
|
+
{
|
|
2385
|
+
const inner = value.inner;
|
|
2386
|
+
let size = ordinalConverter.allocationSize(3);
|
|
2387
|
+
size += FfiConverterString.allocationSize(inner.message);
|
|
2388
|
+
return size;
|
|
2389
|
+
}
|
|
2390
|
+
case ContractError_Tags.InvalidFundingInput:
|
|
2391
|
+
{
|
|
2392
|
+
const inner = value.inner;
|
|
2393
|
+
let size = ordinalConverter.allocationSize(4);
|
|
2394
|
+
size += FfiConverterString.allocationSize(inner.message);
|
|
2395
|
+
return size;
|
|
2396
|
+
}
|
|
2397
|
+
case ContractError_Tags.PsbtMismatch:
|
|
2398
|
+
{
|
|
2399
|
+
const inner = value.inner;
|
|
2400
|
+
let size = ordinalConverter.allocationSize(5);
|
|
2401
|
+
size += FfiConverterString.allocationSize(inner.message);
|
|
2402
|
+
return size;
|
|
2403
|
+
}
|
|
2404
|
+
case ContractError_Tags.MissingFinalizedInput:
|
|
2405
|
+
{
|
|
2406
|
+
const inner = value.inner;
|
|
2407
|
+
let size = ordinalConverter.allocationSize(6);
|
|
2408
|
+
size += _core.FfiConverterUInt32.allocationSize(inner.inputIndex);
|
|
2409
|
+
return size;
|
|
2410
|
+
}
|
|
2411
|
+
case ContractError_Tags.UnsupportedScriptType:
|
|
2412
|
+
{
|
|
2413
|
+
const inner = value.inner;
|
|
2414
|
+
let size = ordinalConverter.allocationSize(7);
|
|
2415
|
+
size += _core.FfiConverterUInt32.allocationSize(inner.inputIndex);
|
|
2416
|
+
return size;
|
|
2417
|
+
}
|
|
2418
|
+
case ContractError_Tags.InvalidAttestation:
|
|
2419
|
+
{
|
|
2420
|
+
const inner = value.inner;
|
|
2421
|
+
let size = ordinalConverter.allocationSize(8);
|
|
2422
|
+
size += FfiConverterString.allocationSize(inner.message);
|
|
2423
|
+
return size;
|
|
2424
|
+
}
|
|
2425
|
+
case ContractError_Tags.NoMatchingOutcome:
|
|
2426
|
+
{
|
|
2427
|
+
return ordinalConverter.allocationSize(9);
|
|
2428
|
+
}
|
|
2429
|
+
case ContractError_Tags.Descriptor:
|
|
2430
|
+
{
|
|
2431
|
+
const inner = value.inner;
|
|
2432
|
+
let size = ordinalConverter.allocationSize(10);
|
|
2433
|
+
size += FfiConverterString.allocationSize(inner.message);
|
|
2434
|
+
return size;
|
|
2435
|
+
}
|
|
2436
|
+
case ContractError_Tags.Wallet:
|
|
2437
|
+
{
|
|
2438
|
+
const inner = value.inner;
|
|
2439
|
+
let size = ordinalConverter.allocationSize(11);
|
|
2440
|
+
size += FfiConverterString.allocationSize(inner.message);
|
|
2441
|
+
return size;
|
|
2442
|
+
}
|
|
2443
|
+
case ContractError_Tags.Bip32:
|
|
2444
|
+
{
|
|
2445
|
+
const inner = value.inner;
|
|
2446
|
+
let size = ordinalConverter.allocationSize(12);
|
|
2447
|
+
size += FfiConverterString.allocationSize(inner.message);
|
|
2448
|
+
return size;
|
|
2449
|
+
}
|
|
2450
|
+
case ContractError_Tags.Dlc:
|
|
2451
|
+
{
|
|
2452
|
+
const inner = value.inner;
|
|
2453
|
+
let size = ordinalConverter.allocationSize(13);
|
|
2454
|
+
size += FfiConverterString.allocationSize(inner.message);
|
|
2455
|
+
return size;
|
|
2456
|
+
}
|
|
2457
|
+
case ContractError_Tags.Key:
|
|
2458
|
+
{
|
|
2459
|
+
const inner = value.inner;
|
|
2460
|
+
let size = ordinalConverter.allocationSize(14);
|
|
2461
|
+
size += FfiConverterString.allocationSize(inner.message);
|
|
2462
|
+
return size;
|
|
2463
|
+
}
|
|
2464
|
+
case ContractError_Tags.Serialization:
|
|
2465
|
+
{
|
|
2466
|
+
const inner = value.inner;
|
|
2467
|
+
let size = ordinalConverter.allocationSize(15);
|
|
2468
|
+
size += FfiConverterString.allocationSize(inner.message);
|
|
2469
|
+
return size;
|
|
2470
|
+
}
|
|
2471
|
+
case ContractError_Tags.InvalidNetwork:
|
|
2472
|
+
{
|
|
2473
|
+
const inner = value.inner;
|
|
2474
|
+
let size = ordinalConverter.allocationSize(16);
|
|
2475
|
+
size += FfiConverterString.allocationSize(inner.message);
|
|
2476
|
+
return size;
|
|
2477
|
+
}
|
|
2478
|
+
case ContractError_Tags.InvalidLength:
|
|
2479
|
+
{
|
|
2480
|
+
const inner = value.inner;
|
|
2481
|
+
let size = ordinalConverter.allocationSize(17);
|
|
2482
|
+
size += FfiConverterString.allocationSize(inner.field);
|
|
2483
|
+
size += _core.FfiConverterUInt32.allocationSize(inner.expected);
|
|
2484
|
+
size += _core.FfiConverterUInt32.allocationSize(inner.actual);
|
|
2485
|
+
return size;
|
|
2486
|
+
}
|
|
2487
|
+
default:
|
|
2488
|
+
throw new _core.UniffiInternalError.UnexpectedEnumCase();
|
|
2489
|
+
}
|
|
904
2490
|
}
|
|
905
2491
|
}
|
|
906
2492
|
return new FFIConverter();
|
|
@@ -1350,9 +2936,189 @@ const FfiConverterTypeDLCError = (() => {
|
|
|
1350
2936
|
return new FFIConverter();
|
|
1351
2937
|
})();
|
|
1352
2938
|
|
|
2939
|
+
/**
|
|
2940
|
+
* Identifies which party's funding inputs an operation applies to.
|
|
2941
|
+
*/
|
|
2942
|
+
let Party = exports.Party = /*#__PURE__*/function (Party) {
|
|
2943
|
+
/**
|
|
2944
|
+
* The party that created the offer.
|
|
2945
|
+
*/
|
|
2946
|
+
Party[Party["Offer"] = 0] = "Offer";
|
|
2947
|
+
/**
|
|
2948
|
+
* The party that accepted the offer.
|
|
2949
|
+
*/
|
|
2950
|
+
Party[Party["Accept"] = 1] = "Accept";
|
|
2951
|
+
return Party;
|
|
2952
|
+
}({});
|
|
2953
|
+
const FfiConverterTypeParty = (() => {
|
|
2954
|
+
const ordinalConverter = _core.FfiConverterInt32;
|
|
2955
|
+
class FFIConverter extends _core.AbstractFfiConverterByteArray {
|
|
2956
|
+
read(from) {
|
|
2957
|
+
switch (ordinalConverter.read(from)) {
|
|
2958
|
+
case 1:
|
|
2959
|
+
return Party.Offer;
|
|
2960
|
+
case 2:
|
|
2961
|
+
return Party.Accept;
|
|
2962
|
+
default:
|
|
2963
|
+
throw new _core.UniffiInternalError.UnexpectedEnumCase();
|
|
2964
|
+
}
|
|
2965
|
+
}
|
|
2966
|
+
write(value, into) {
|
|
2967
|
+
switch (value) {
|
|
2968
|
+
case Party.Offer:
|
|
2969
|
+
return ordinalConverter.write(1, into);
|
|
2970
|
+
case Party.Accept:
|
|
2971
|
+
return ordinalConverter.write(2, into);
|
|
2972
|
+
}
|
|
2973
|
+
}
|
|
2974
|
+
allocationSize(value) {
|
|
2975
|
+
return ordinalConverter.allocationSize(0);
|
|
2976
|
+
}
|
|
2977
|
+
}
|
|
2978
|
+
return new FFIConverter();
|
|
2979
|
+
})();
|
|
2980
|
+
|
|
2981
|
+
/**
|
|
2982
|
+
* Deterministically derives DLC contract funding keys from a master extended
|
|
2983
|
+
* private key. Secret keys never leave this object.
|
|
2984
|
+
*
|
|
2985
|
+
* Construct one from whatever key material the consumer holds, then call
|
|
2986
|
+
* [`ContractKeyProvider::funding_pubkey`] to obtain the public key to publish
|
|
2987
|
+
* in an offer/accept message.
|
|
2988
|
+
*/
|
|
2989
|
+
|
|
2990
|
+
/**
|
|
2991
|
+
* @deprecated Use `ContractKeyProviderLike` instead.
|
|
2992
|
+
*/
|
|
2993
|
+
|
|
2994
|
+
/**
|
|
2995
|
+
* Deterministically derives DLC contract funding keys from a master extended
|
|
2996
|
+
* private key. Secret keys never leave this object.
|
|
2997
|
+
*
|
|
2998
|
+
* Construct one from whatever key material the consumer holds, then call
|
|
2999
|
+
* [`ContractKeyProvider::funding_pubkey`] to obtain the public key to publish
|
|
3000
|
+
* in an offer/accept message.
|
|
3001
|
+
*/
|
|
3002
|
+
class ContractKeyProvider extends _core.UniffiAbstractObject {
|
|
3003
|
+
[_core.uniffiTypeNameSymbol] = 'ContractKeyProvider';
|
|
3004
|
+
// No primary constructor declared for this class.
|
|
3005
|
+
constructor(pointer) {
|
|
3006
|
+
super();
|
|
3007
|
+
this[_core.pointerLiteralSymbol] = pointer;
|
|
3008
|
+
this[_core.destructorGuardSymbol] = uniffiTypeContractKeyProviderObjectFactory.bless(pointer);
|
|
3009
|
+
}
|
|
3010
|
+
|
|
3011
|
+
/**
|
|
3012
|
+
* Builds a provider from an output descriptor that carries an extended
|
|
3013
|
+
* private key (e.g. `wpkh(xprv.../84h/1h/0h/0/*)`). Watch-only descriptors
|
|
3014
|
+
* are rejected; the descriptor's own path/wildcard is not applied to
|
|
3015
|
+
* contract-key derivation.
|
|
3016
|
+
*/
|
|
3017
|
+
static fromDescriptor(descriptor) /*throws*/{
|
|
3018
|
+
return FfiConverterTypeContractKeyProvider.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
|
|
3019
|
+
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_constructor_contractkeyprovider_from_descriptor(FfiConverterString.lower(descriptor, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
3020
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
3021
|
+
}
|
|
3022
|
+
|
|
3023
|
+
/**
|
|
3024
|
+
* Builds a provider from a BIP39 mnemonic (with optional passphrase).
|
|
3025
|
+
*/
|
|
3026
|
+
static fromMnemonic(mnemonic, passphrase, network) /*throws*/{
|
|
3027
|
+
return FfiConverterTypeContractKeyProvider.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
|
|
3028
|
+
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_constructor_contractkeyprovider_from_mnemonic(FfiConverterString.lower(mnemonic, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterOptionalString.lower(passphrase, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterString.lower(network, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
3029
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
3030
|
+
}
|
|
3031
|
+
|
|
3032
|
+
/**
|
|
3033
|
+
* Builds a provider from a raw seed (for example the 64 bytes produced by
|
|
3034
|
+
* `convert_mnemonic_to_seed`).
|
|
3035
|
+
*/
|
|
3036
|
+
static fromSeed(seed, network) /*throws*/{
|
|
3037
|
+
return FfiConverterTypeContractKeyProvider.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
|
|
3038
|
+
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_constructor_contractkeyprovider_from_seed(_core.FfiConverterArrayBuffer.lower(seed, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), FfiConverterString.lower(network, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
3039
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
3040
|
+
}
|
|
3041
|
+
|
|
3042
|
+
/**
|
|
3043
|
+
* Builds a provider from a 78-byte encoded master extended private key
|
|
3044
|
+
* (the encoding produced by `create_extkey_from_seed`).
|
|
3045
|
+
*/
|
|
3046
|
+
static fromXprv(xprv) /*throws*/{
|
|
3047
|
+
return FfiConverterTypeContractKeyProvider.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
|
|
3048
|
+
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_constructor_contractkeyprovider_from_xprv(_core.FfiConverterArrayBuffer.lower(xprv, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
3049
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
3050
|
+
}
|
|
3051
|
+
|
|
3052
|
+
/**
|
|
3053
|
+
* The 33-byte compressed funding public key for a contract, from its
|
|
3054
|
+
* 32-byte temporary id. Publish this in the offer or accept message.
|
|
3055
|
+
*/
|
|
3056
|
+
fundingPubkey(temporaryContractId) /*throws*/{
|
|
3057
|
+
return (__rb => {
|
|
3058
|
+
try {
|
|
3059
|
+
return _core.FfiConverterArrayBuffer.lift(__rb);
|
|
3060
|
+
} finally {
|
|
3061
|
+
(0, _ddk_ffiFfi.default)().rustbuffer_free(__rb);
|
|
3062
|
+
}
|
|
3063
|
+
})(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeContractError.lift.bind(FfiConverterTypeContractError), /*caller:*/callStatus => {
|
|
3064
|
+
return (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_method_contractkeyprovider_funding_pubkey(uniffiTypeContractKeyProviderObjectFactory.clonePointer(this), _core.FfiConverterArrayBuffer.lower(temporaryContractId, (0, _ddk_ffiFfi.default)().rustbuffer_alloc), callStatus);
|
|
3065
|
+
}, /*liftString:*/FfiConverterString.lift.bind(FfiConverterString)));
|
|
3066
|
+
}
|
|
3067
|
+
uniffiDestroy() {
|
|
3068
|
+
const ptr = this[_core.destructorGuardSymbol];
|
|
3069
|
+
if (ptr !== undefined) {
|
|
3070
|
+
const pointer = uniffiTypeContractKeyProviderObjectFactory.pointer(this);
|
|
3071
|
+
uniffiTypeContractKeyProviderObjectFactory.freePointer(pointer);
|
|
3072
|
+
uniffiTypeContractKeyProviderObjectFactory.unbless(ptr);
|
|
3073
|
+
delete this[_core.destructorGuardSymbol];
|
|
3074
|
+
}
|
|
3075
|
+
}
|
|
3076
|
+
static instanceOf(obj_) {
|
|
3077
|
+
return uniffiTypeContractKeyProviderObjectFactory.isConcreteType(obj_);
|
|
3078
|
+
}
|
|
3079
|
+
}
|
|
3080
|
+
exports.ContractKeyProvider = ContractKeyProvider;
|
|
3081
|
+
const uniffiTypeContractKeyProviderObjectFactory = (() => {
|
|
3082
|
+
return {
|
|
3083
|
+
create(pointer) {
|
|
3084
|
+
const instance = Object.create(ContractKeyProvider.prototype);
|
|
3085
|
+
instance[_core.pointerLiteralSymbol] = pointer;
|
|
3086
|
+
instance[_core.destructorGuardSymbol] = this.bless(pointer);
|
|
3087
|
+
instance[_core.uniffiTypeNameSymbol] = 'ContractKeyProvider';
|
|
3088
|
+
return instance;
|
|
3089
|
+
},
|
|
3090
|
+
bless(p) {
|
|
3091
|
+
return uniffiCaller.rustCall(/*caller:*/status => (0, _ddk_ffiFfi.default)().ubrn_uniffi_internal_fn_method_contractkeyprovider_ffi__bless_pointer(p, status), /*liftString:*/FfiConverterString.lift);
|
|
3092
|
+
},
|
|
3093
|
+
unbless(ptr_) {
|
|
3094
|
+
ptr_.markDestroyed();
|
|
3095
|
+
},
|
|
3096
|
+
pointer(obj_) {
|
|
3097
|
+
if (obj_[_core.destructorGuardSymbol] === undefined) {
|
|
3098
|
+
throw new _core.UniffiInternalError.UnexpectedNullPointer();
|
|
3099
|
+
}
|
|
3100
|
+
return obj_[_core.pointerLiteralSymbol];
|
|
3101
|
+
},
|
|
3102
|
+
clonePointer(obj_) {
|
|
3103
|
+
const pointer = this.pointer(obj_);
|
|
3104
|
+
return uniffiCaller.rustCall(/*caller:*/callStatus => (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_clone_contractkeyprovider(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
|
|
3105
|
+
},
|
|
3106
|
+
freePointer(pointer) {
|
|
3107
|
+
uniffiCaller.rustCall(/*caller:*/callStatus => (0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_fn_free_contractkeyprovider(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
|
|
3108
|
+
},
|
|
3109
|
+
isConcreteType(obj_) {
|
|
3110
|
+
return obj_[_core.destructorGuardSymbol] && obj_[_core.uniffiTypeNameSymbol] === 'ContractKeyProvider';
|
|
3111
|
+
}
|
|
3112
|
+
};
|
|
3113
|
+
})();
|
|
3114
|
+
const FfiConverterTypeContractKeyProvider = new _core.FfiConverterObject(uniffiTypeContractKeyProviderObjectFactory);
|
|
3115
|
+
|
|
1353
3116
|
// FfiConverter for Array<ArrayBuffer>
|
|
1354
3117
|
const FfiConverterSequenceBytes = new _core.FfiConverterArray(_core.FfiConverterArrayBuffer);
|
|
1355
3118
|
|
|
3119
|
+
// FfiConverter for bigint | undefined
|
|
3120
|
+
const FfiConverterOptionalUInt64 = new _core.FfiConverterOptional(_core.FfiConverterUInt64);
|
|
3121
|
+
|
|
1356
3122
|
// FfiConverter for Array<TxInput>
|
|
1357
3123
|
const FfiConverterSequenceTypeTxInput = new _core.FfiConverterArray(FfiConverterTypeTxInput);
|
|
1358
3124
|
|
|
@@ -1362,15 +3128,21 @@ const FfiConverterSequenceTypeTxOutput = new _core.FfiConverterArray(FfiConverte
|
|
|
1362
3128
|
// FfiConverter for Array<Transaction>
|
|
1363
3129
|
const FfiConverterSequenceTypeTransaction = new _core.FfiConverterArray(FfiConverterTypeTransaction);
|
|
1364
3130
|
|
|
3131
|
+
// FfiConverter for string | undefined
|
|
3132
|
+
const FfiConverterOptionalString = new _core.FfiConverterOptional(FfiConverterString);
|
|
3133
|
+
|
|
3134
|
+
// FfiConverter for Array<PayoutRow>
|
|
3135
|
+
const FfiConverterSequenceTypePayoutRow = new _core.FfiConverterArray(FfiConverterTypePayoutRow);
|
|
3136
|
+
|
|
3137
|
+
// FfiConverter for ArrayBuffer | undefined
|
|
3138
|
+
const FfiConverterOptionalBytes = new _core.FfiConverterOptional(_core.FfiConverterArrayBuffer);
|
|
3139
|
+
|
|
1365
3140
|
// FfiConverter for Array<TxInputInfo>
|
|
1366
3141
|
const FfiConverterSequenceTypeTxInputInfo = new _core.FfiConverterArray(FfiConverterTypeTxInputInfo);
|
|
1367
3142
|
|
|
1368
3143
|
// FfiConverter for Array<DlcInputInfo>
|
|
1369
3144
|
const FfiConverterSequenceTypeDlcInputInfo = new _core.FfiConverterArray(FfiConverterTypeDlcInputInfo);
|
|
1370
3145
|
|
|
1371
|
-
// FfiConverter for string | undefined
|
|
1372
|
-
const FfiConverterOptionalString = new _core.FfiConverterOptional(FfiConverterString);
|
|
1373
|
-
|
|
1374
3146
|
// FfiConverter for Array<OracleInfo>
|
|
1375
3147
|
const FfiConverterSequenceTypeOracleInfo = new _core.FfiConverterArray(FfiConverterTypeOracleInfo);
|
|
1376
3148
|
|
|
@@ -1386,6 +3158,15 @@ const FfiConverterSequenceTypeAdaptorSignature = new _core.FfiConverterArray(Ffi
|
|
|
1386
3158
|
// FfiConverter for Array<Payout>
|
|
1387
3159
|
const FfiConverterSequenceTypePayout = new _core.FfiConverterArray(FfiConverterTypePayout);
|
|
1388
3160
|
|
|
3161
|
+
// FfiConverter for Array<SpliceKeyRef>
|
|
3162
|
+
const FfiConverterSequenceTypeSpliceKeyRef = new _core.FfiConverterArray(FfiConverterTypeSpliceKeyRef);
|
|
3163
|
+
|
|
3164
|
+
// FfiConverter for Array<OracleAttestationRef>
|
|
3165
|
+
const FfiConverterSequenceTypeOracleAttestationRef = new _core.FfiConverterArray(FfiConverterTypeOracleAttestationRef);
|
|
3166
|
+
|
|
3167
|
+
// FfiConverter for Array<DescriptorInput>
|
|
3168
|
+
const FfiConverterSequenceTypeDescriptorInput = new _core.FfiConverterArray(FfiConverterTypeDescriptorInput);
|
|
3169
|
+
|
|
1389
3170
|
/**
|
|
1390
3171
|
* This should be called before anything else.
|
|
1391
3172
|
*
|
|
@@ -1404,6 +3185,18 @@ function uniffiEnsureInitialized() {
|
|
|
1404
3185
|
if (bindingsContractVersion !== scaffoldingContractVersion) {
|
|
1405
3186
|
throw new _core.UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
|
|
1406
3187
|
}
|
|
3188
|
+
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_accept_offer() !== 49334) {
|
|
3189
|
+
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_accept_offer');
|
|
3190
|
+
}
|
|
3191
|
+
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_chain_hash_from_network() !== 782) {
|
|
3192
|
+
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_chain_hash_from_network');
|
|
3193
|
+
}
|
|
3194
|
+
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_compute_contract_id() !== 7849) {
|
|
3195
|
+
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_compute_contract_id');
|
|
3196
|
+
}
|
|
3197
|
+
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_contract_info_payouts() !== 5148) {
|
|
3198
|
+
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_contract_info_payouts');
|
|
3199
|
+
}
|
|
1407
3200
|
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed() !== 29793) {
|
|
1408
3201
|
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_convert_mnemonic_to_seed');
|
|
1409
3202
|
}
|
|
@@ -1422,6 +3215,9 @@ function uniffiEnsureInitialized() {
|
|
|
1422
3215
|
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_cets() !== 22051) {
|
|
1423
3216
|
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_cets');
|
|
1424
3217
|
}
|
|
3218
|
+
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_dlc_splice_input() !== 50727) {
|
|
3219
|
+
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_dlc_splice_input');
|
|
3220
|
+
}
|
|
1425
3221
|
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_dlc_transactions() !== 60266) {
|
|
1426
3222
|
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_dlc_transactions');
|
|
1427
3223
|
}
|
|
@@ -1434,6 +3230,12 @@ function uniffiEnsureInitialized() {
|
|
|
1434
3230
|
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_fund_tx_locking_script() !== 37235) {
|
|
1435
3231
|
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_fund_tx_locking_script');
|
|
1436
3232
|
}
|
|
3233
|
+
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_funding_psbt() !== 39942) {
|
|
3234
|
+
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_funding_psbt');
|
|
3235
|
+
}
|
|
3236
|
+
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_offer() !== 39327) {
|
|
3237
|
+
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_offer');
|
|
3238
|
+
}
|
|
1437
3239
|
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_refund_transaction() !== 40230) {
|
|
1438
3240
|
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_refund_transaction');
|
|
1439
3241
|
}
|
|
@@ -1443,9 +3245,24 @@ function uniffiEnsureInitialized() {
|
|
|
1443
3245
|
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path() !== 7895) {
|
|
1444
3246
|
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path');
|
|
1445
3247
|
}
|
|
3248
|
+
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_dlc_input_max_witness_len() !== 49586) {
|
|
3249
|
+
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_dlc_input_max_witness_len');
|
|
3250
|
+
}
|
|
3251
|
+
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_dlc_transactions_from_messages() !== 56492) {
|
|
3252
|
+
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_dlc_transactions_from_messages');
|
|
3253
|
+
}
|
|
1446
3254
|
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_extract_ecdsa_signature_from_oracle_signatures() !== 4868) {
|
|
1447
3255
|
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_extract_ecdsa_signature_from_oracle_signatures');
|
|
1448
3256
|
}
|
|
3257
|
+
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_finalize_sign() !== 20463) {
|
|
3258
|
+
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_finalize_sign');
|
|
3259
|
+
}
|
|
3260
|
+
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_finalize_sign_spliced() !== 32005) {
|
|
3261
|
+
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_finalize_sign_spliced');
|
|
3262
|
+
}
|
|
3263
|
+
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_funding_input() !== 64911) {
|
|
3264
|
+
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_funding_input');
|
|
3265
|
+
}
|
|
1449
3266
|
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_get_pubkey_from_extkey() !== 18050) {
|
|
1450
3267
|
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_get_pubkey_from_extkey');
|
|
1451
3268
|
}
|
|
@@ -1455,26 +3272,78 @@ function uniffiEnsureInitialized() {
|
|
|
1455
3272
|
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv() !== 8843) {
|
|
1456
3273
|
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv');
|
|
1457
3274
|
}
|
|
3275
|
+
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_sign_accept() !== 37062) {
|
|
3276
|
+
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_sign_accept');
|
|
3277
|
+
}
|
|
3278
|
+
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_sign_accept_spliced() !== 32504) {
|
|
3279
|
+
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_sign_accept_spliced');
|
|
3280
|
+
}
|
|
3281
|
+
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_sign_contract_cet() !== 36727) {
|
|
3282
|
+
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_sign_contract_cet');
|
|
3283
|
+
}
|
|
3284
|
+
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_sign_contract_refund() !== 23156) {
|
|
3285
|
+
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_sign_contract_refund');
|
|
3286
|
+
}
|
|
3287
|
+
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_sign_funding_psbt_with_descriptor() !== 25961) {
|
|
3288
|
+
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_sign_funding_psbt_with_descriptor');
|
|
3289
|
+
}
|
|
3290
|
+
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_validate_accept() !== 9081) {
|
|
3291
|
+
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_validate_accept');
|
|
3292
|
+
}
|
|
3293
|
+
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_validate_offer() !== 24632) {
|
|
3294
|
+
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_validate_offer');
|
|
3295
|
+
}
|
|
3296
|
+
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_validate_sign() !== 7419) {
|
|
3297
|
+
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_validate_sign');
|
|
3298
|
+
}
|
|
1458
3299
|
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_verify_cet_adaptor_sigs_from_oracle_info() !== 32235) {
|
|
1459
3300
|
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_verify_cet_adaptor_sigs_from_oracle_info');
|
|
1460
3301
|
}
|
|
1461
3302
|
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_func_version() !== 2994) {
|
|
1462
3303
|
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_func_version');
|
|
1463
3304
|
}
|
|
3305
|
+
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_constructor_contractkeyprovider_from_descriptor() !== 47034) {
|
|
3306
|
+
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_constructor_contractkeyprovider_from_descriptor');
|
|
3307
|
+
}
|
|
3308
|
+
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_constructor_contractkeyprovider_from_mnemonic() !== 47667) {
|
|
3309
|
+
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_constructor_contractkeyprovider_from_mnemonic');
|
|
3310
|
+
}
|
|
3311
|
+
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_constructor_contractkeyprovider_from_seed() !== 47192) {
|
|
3312
|
+
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_constructor_contractkeyprovider_from_seed');
|
|
3313
|
+
}
|
|
3314
|
+
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_constructor_contractkeyprovider_from_xprv() !== 7002) {
|
|
3315
|
+
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_constructor_contractkeyprovider_from_xprv');
|
|
3316
|
+
}
|
|
3317
|
+
if ((0, _ddk_ffiFfi.default)().ubrn_uniffi_ddk_ffi_checksum_method_contractkeyprovider_funding_pubkey() !== 58577) {
|
|
3318
|
+
throw new _core.UniffiInternalError.ApiChecksumMismatch('uniffi_ddk_ffi_checksum_method_contractkeyprovider_funding_pubkey');
|
|
3319
|
+
}
|
|
1464
3320
|
}
|
|
1465
3321
|
var _default = exports.default = Object.freeze({
|
|
1466
3322
|
initialize: uniffiEnsureInitialized,
|
|
1467
3323
|
converters: {
|
|
3324
|
+
FfiConverterTypeAcceptOfferParams,
|
|
3325
|
+
FfiConverterTypeAcceptResult,
|
|
1468
3326
|
FfiConverterTypeAdaptorSignature,
|
|
1469
3327
|
FfiConverterTypeCetAdaptorSignatureDebugInfo,
|
|
1470
3328
|
FfiConverterTypeChangeOutputAndFees,
|
|
3329
|
+
FfiConverterTypeContractError,
|
|
3330
|
+
FfiConverterTypeContractKeyProvider,
|
|
3331
|
+
FfiConverterTypeContractPartyParams,
|
|
3332
|
+
FfiConverterTypeContractPayouts,
|
|
3333
|
+
FfiConverterTypeCreateOfferParams,
|
|
1471
3334
|
FfiConverterTypeDLCError,
|
|
3335
|
+
FfiConverterTypeDescriptorInput,
|
|
1472
3336
|
FfiConverterTypeDlcInputInfo,
|
|
1473
3337
|
FfiConverterTypeDlcTransactions,
|
|
1474
3338
|
FfiConverterTypeExtendedKey,
|
|
3339
|
+
FfiConverterTypeOracleAttestationRef,
|
|
1475
3340
|
FfiConverterTypeOracleInfo,
|
|
3341
|
+
FfiConverterTypeParty,
|
|
1476
3342
|
FfiConverterTypePartyParams,
|
|
1477
3343
|
FfiConverterTypePayout,
|
|
3344
|
+
FfiConverterTypePayoutRow,
|
|
3345
|
+
FfiConverterTypeSignResult,
|
|
3346
|
+
FfiConverterTypeSpliceKeyRef,
|
|
1478
3347
|
FfiConverterTypeTransaction,
|
|
1479
3348
|
FfiConverterTypeTxInput,
|
|
1480
3349
|
FfiConverterTypeTxInputInfo,
|