@bennyblader/ddk-rn 0.4.0 → 1.0.0-rc2

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.
@@ -1,19 +1,53 @@
1
- import { type UniffiByteArray, RustBuffer, uniffiTypeNameSymbol } from '@ubjs/core';
2
- export declare function convertMnemonicToSeed(mnemonic: string, passphrase: string | undefined): ArrayBuffer;
1
+ import { type UniffiByteArray, type UniffiGcObject, type UniffiHandle, FfiConverterObject, RustBuffer, UniffiAbstractObject, destructorGuardSymbol, pointerLiteralSymbol, uniffiTypeNameSymbol } from '@ubjs/core';
2
+ /**
3
+ * Accepts an offer. The accepting party's funding secret key is derived inside
4
+ * Rust from `keys` + `new_temporary_contract_id` and never crosses the boundary;
5
+ * it must match `params.party.funding_pubkey` (derive both from the same provider).
6
+ */
7
+ export declare function acceptOffer(offer: Uint8Array, params: AcceptOfferParams, keys: ContractKeyProviderLike, newTemporaryContractId: Uint8Array): AcceptResult;
8
+ /**
9
+ * The 32-byte chain hash for a network (`bitcoin` / `testnet` / `signet` /
10
+ * `regtest`). Use it for [`CreateOfferParams::chain_hash`].
11
+ */
12
+ export declare function chainHashFromNetwork(network: string): Uint8Array;
13
+ /**
14
+ * The 32-byte contract id derived from the offer and accept messages — the
15
+ * stable id of the funded contract. Use it to key stored contracts.
16
+ */
17
+ export declare function computeContractId(offer: Uint8Array, accept: Uint8Array): Uint8Array;
18
+ /**
19
+ * Derives the offer/accept payouts for every outcome of a contract from its
20
+ * wire-encoded `ContractInfo`, for building a payout table to show users.
21
+ *
22
+ * Handles both enum contracts (each row a labeled outcome) and numeric-outcome
23
+ * contracts (each row an inclusive outcome range that shares a single payout,
24
+ * as determined by the payout function and rounding intervals). Disjoint
25
+ * contracts contribute the rows of each of their sub-contracts.
26
+ */
27
+ export declare function contractInfoPayouts(contractInfo: Uint8Array): ContractPayouts;
28
+ export declare function convertMnemonicToSeed(mnemonic: string, passphrase: string | undefined): Uint8Array;
3
29
  /**
4
30
  * Create a single CET
5
31
  */
6
32
  export declare function createCet(localOutput: TxOutput, localPayoutSerialId: bigint, remoteOutput: TxOutput, remotePayoutSerialId: bigint, fundTxId: string, fundVout: number, lockTime: number): Transaction;
7
- export declare function createCetAdaptorPointsFromOracleInfo(oracleInfo: Array<OracleInfo>, msgs: Array<Array<Array<ArrayBuffer>>>): Array<ArrayBuffer>;
8
- export declare function createCetAdaptorSigsFromOracleInfo(cets: Array<Transaction>, oracleInfo: Array<OracleInfo>, fundingSecretKey: ArrayBuffer, fundingScriptPubkey: ArrayBuffer, fundOutputValue: bigint, msgs: Array<Array<Array<ArrayBuffer>>>): Array<AdaptorSignature>;
33
+ export declare function createCetAdaptorPointsFromOracleInfo(oracleInfo: Array<OracleInfo>, msgs: Array<Array<Array<Uint8Array>>>): Array<Uint8Array>;
34
+ export declare function createCetAdaptorSigsFromOracleInfo(cets: Array<Transaction>, oracleInfo: Array<OracleInfo>, fundingSecretKey: Uint8Array, fundingScriptPubkey: Uint8Array, fundOutputValue: bigint, msgs: Array<Array<Array<Uint8Array>>>): Array<AdaptorSignature>;
9
35
  /**
10
36
  * Create adaptor signatures from pre-computed adaptor points.
11
37
  */
12
- export declare function createCetAdaptorSigsFromPoints(cets: Array<Transaction>, adaptorPoints: Array<ArrayBuffer>, fundingSecretKey: ArrayBuffer, fundingScriptPubkey: ArrayBuffer, fundOutputValue: bigint): Array<AdaptorSignature>;
38
+ export declare function createCetAdaptorSigsFromPoints(cets: Array<Transaction>, adaptorPoints: Array<Uint8Array>, fundingSecretKey: Uint8Array, fundingScriptPubkey: Uint8Array, fundOutputValue: bigint): Array<AdaptorSignature>;
13
39
  /**
14
40
  * Create multiple CETs
15
41
  */
16
- export declare function createCets(fundTxId: string, fundVout: number, localFinalScriptPubkey: ArrayBuffer, remoteFinalScriptPubkey: ArrayBuffer, outcomes: Array<Payout>, lockTime: number, localSerialId: bigint, remoteSerialId: bigint): Array<Transaction>;
42
+ export declare function createCets(fundTxId: string, fundVout: number, localFinalScriptPubkey: Uint8Array, remoteFinalScriptPubkey: Uint8Array, outcomes: Array<Payout>, lockTime: number, localSerialId: bigint, remoteSerialId: bigint): Array<Transaction>;
43
+ /**
44
+ * Rebuilds the splice `FundingInput` (wire-encoded) that spends a previous
45
+ * contract's 2-of-2 funding output, from that contract's offer and accept
46
+ * messages. Only the offering party contributes a splice input; place the
47
+ * result in the offering party's `funding_inputs`. `max_witness_len` must be
48
+ * greater than 108 — use [`dlc_input_max_witness_len`].
49
+ */
50
+ export declare function createDlcSpliceInput(prevOffer: Uint8Array, prevAccept: Uint8Array, localParty: Party, inputSerialId: bigint | undefined, maxWitnessLen: number): Uint8Array;
17
51
  /**
18
52
  * Create complete DLC transactions
19
53
  */
@@ -22,20 +56,28 @@ export declare function createDlcTransactions(outcomes: Array<Payout>, localPara
22
56
  * Derive child extended private key from parent extended key
23
57
  * Input: 78-byte encoded xpriv, Output: 78-byte encoded xpriv
24
58
  */
25
- export declare function createExtkeyFromParentPath(extkey: ArrayBuffer, path: string): ArrayBuffer;
59
+ export declare function createExtkeyFromParentPath(extkey: Uint8Array, path: string): Uint8Array;
26
60
  /**
27
61
  * Create master extended private key from 64-byte seed
28
62
  * Returns 78-byte encoded xpriv
29
63
  */
30
- export declare function createExtkeyFromSeed(seed: ArrayBuffer, network: string): ArrayBuffer;
64
+ export declare function createExtkeyFromSeed(seed: Uint8Array, network: string): Uint8Array;
31
65
  /**
32
66
  * Create a funding script pubkey for DLC transactions
33
67
  */
34
- export declare function createFundTxLockingScript(localFundPubkey: ArrayBuffer, remoteFundPubkey: ArrayBuffer): ArrayBuffer;
68
+ export declare function createFundTxLockingScript(localFundPubkey: Uint8Array, remoteFundPubkey: Uint8Array): Uint8Array;
69
+ /**
70
+ * Rebuilds the BIP-174 funding PSBT from the offer and accept messages.
71
+ */
72
+ export declare function createFundingPsbt(offer: Uint8Array, accept: Uint8Array): Uint8Array;
73
+ /**
74
+ * Creates an offer. Returns the wire-encoded `OfferDlc` to send to the accepting party.
75
+ */
76
+ export declare function createOffer(params: CreateOfferParams): Uint8Array;
35
77
  /**
36
78
  * Create a refund transaction
37
79
  */
38
- export declare function createRefundTransaction(localFinalScriptPubkey: ArrayBuffer, remoteFinalScriptPubkey: ArrayBuffer, localAmount: bigint, remoteAmount: bigint, lockTime: number, fundTxId: string, fundVout: number): Transaction;
80
+ export declare function createRefundTransaction(localFinalScriptPubkey: Uint8Array, remoteFinalScriptPubkey: Uint8Array, localAmount: bigint, remoteAmount: bigint, lockTime: number, fundTxId: string, fundVout: number): Transaction;
39
81
  /**
40
82
  * Create spliced DLC transactions
41
83
  */
@@ -44,13 +86,47 @@ export declare function createSplicedDlcTransactions(outcomes: Array<Payout>, lo
44
86
  * DEPRECATED: Use create_extkey_from_seed + create_extkey_from_parent_path instead
45
87
  * This function handles both seeds (64 bytes) and xprivs (78 bytes) which is confusing
46
88
  */
47
- export declare function createXprivFromParentPath(seedOrXpriv: ArrayBuffer, baseDerivationPath: string, network: string, path: string): ArrayBuffer;
48
- export declare function extractEcdsaSignatureFromOracleSignatures(oracleSignatures: Array<ArrayBuffer>, adaptorSignature: ArrayBuffer): ArrayBuffer;
89
+ export declare function createXprivFromParentPath(seedOrXpriv: Uint8Array, baseDerivationPath: string, network: string, path: string): Uint8Array;
90
+ /**
91
+ * The required `max_witness_len` for a DLC (splice) funding input (220).
92
+ */
93
+ export declare function dlcInputMaxWitnessLen(): number;
94
+ /**
95
+ * Rebuilds the unsigned funding, CET, and refund transactions from the messages.
96
+ */
97
+ export declare function dlcTransactionsFromMessages(offer: Uint8Array, accept: Uint8Array): DlcTransactions;
98
+ export declare function extractEcdsaSignatureFromOracleSignatures(oracleSignatures: Array<Uint8Array>, adaptorSignature: Uint8Array): Uint8Array;
99
+ /**
100
+ * The accepting party verifies the sign message and completes the funding
101
+ * transaction. Returns the Bitcoin consensus-serialized signed transaction.
102
+ */
103
+ export declare function finalizeSign(offer: Uint8Array, accept: Uint8Array, sign: Uint8Array, signedFundingPsbt: Uint8Array): Uint8Array;
104
+ /**
105
+ * Like [`finalize_sign`], but additionally completes the 2-of-2 witness for any
106
+ * splice (DLC) funding input using this (accepting) party's prior funding keys,
107
+ * re-derived inside Rust from `keys`.
108
+ */
109
+ export declare function finalizeSignSpliced(offer: Uint8Array, accept: Uint8Array, sign: Uint8Array, signedFundingPsbt: Uint8Array, keys: ContractKeyProviderLike, spliceKeys: Array<SpliceKeyRef>): Uint8Array;
110
+ /**
111
+ * Builds a wire-encoded `FundingInput` from a wallet UTXO, ready to place in a
112
+ * party's `funding_inputs`.
113
+ *
114
+ * - `previous_transaction`: the full consensus-serialized transaction that
115
+ * created the UTXO being spent.
116
+ * - `vout`: the output index of the UTXO within that transaction.
117
+ * - `input_serial_id`: orders the input in the funding transaction; randomly
118
+ * generated when `None`.
119
+ * - `sequence`: the input sequence (usually `0xffffffff`).
120
+ * - `max_witness_len`: the input's maximum witness length (e.g. 108 for
121
+ * P2WPKH).
122
+ * - `redeem_script`: the redeem script for a P2SH input, or empty for others.
123
+ */
124
+ export declare function fundingInput(previousTransaction: Uint8Array, vout: number, inputSerialId: bigint | undefined, sequence: number, maxWitnessLen: number, redeemScript: Uint8Array): Uint8Array;
49
125
  /**
50
126
  * Extract public key from extended key (private or public)
51
127
  * Input: 78-byte encoded xpriv/xpub, Output: 33-byte compressed public key
52
128
  */
53
- export declare function getPubkeyFromExtkey(extkey: ArrayBuffer, network: string): ArrayBuffer;
129
+ export declare function getPubkeyFromExtkey(extkey: Uint8Array, network: string): Uint8Array;
54
130
  /**
55
131
  * Get total input virtual size for fee calculation
56
132
  */
@@ -59,12 +135,244 @@ export declare function getTotalInputVsize(inputs: Array<TxInputInfo>): number;
59
135
  * Convert extended private key to extended public key
60
136
  * Input: 78-byte encoded xpriv, Output: 78-byte encoded xpub
61
137
  */
62
- export declare function getXpubFromXpriv(xpriv: ArrayBuffer, network: string): ArrayBuffer;
63
- export declare function verifyCetAdaptorSigsFromOracleInfo(adaptorSigs: Array<AdaptorSignature>, cets: Array<Transaction>, oracleInfos: Array<OracleInfo>, pubkey: ArrayBuffer, fundingScriptPubkey: ArrayBuffer, totalCollateral: bigint, msgs: Array<Array<Array<ArrayBuffer>>>): boolean;
138
+ export declare function getXpubFromXpriv(xpriv: Uint8Array, network: string): Uint8Array;
139
+ /**
140
+ * The offering party verifies the accept message and produces its `SignDlc`.
141
+ * The offer party's funding secret key is derived from `keys` +
142
+ * `temporary_contract_id` (the new contract's id).
143
+ */
144
+ export declare function signAccept(offer: Uint8Array, accept: Uint8Array, keys: ContractKeyProviderLike, temporaryContractId: Uint8Array, signedFundingPsbt: Uint8Array): SignResult;
145
+ /**
146
+ * Like [`sign_accept`], but additionally co-signs any splice (DLC) funding
147
+ * inputs. For each splice input, `splice_keys` names the previous contract; the
148
+ * prior funding secret key is re-derived inside Rust from `keys`.
149
+ */
150
+ export declare function signAcceptSpliced(offer: Uint8Array, accept: Uint8Array, keys: ContractKeyProviderLike, temporaryContractId: Uint8Array, signedFundingPsbt: Uint8Array, spliceKeys: Array<SpliceKeyRef>): SignResult;
151
+ /**
152
+ * Signs the CET matching a set of oracle attestations, returning the Bitcoin
153
+ * consensus-serialized transaction. It pays each party the attested outcome's
154
+ * payout and is ready to broadcast — no network access happens here.
155
+ *
156
+ * The settling party's funding secret key is derived inside Rust from `keys` +
157
+ * `temporary_contract_id` — the settling party's OWN temporary id (the offer's
158
+ * for the offering party, the `new_temporary_contract_id` passed to
159
+ * `accept_offer` for the accepting party). The key also identifies which side
160
+ * is settling, so there is no party argument to get wrong. Either party can
161
+ * settle alone: the counterparty's half of the 2-of-2 comes from decrypting its
162
+ * CET adaptor signature with the oracle signatures.
163
+ *
164
+ * Each entry in `attestations` pairs a wire-encoded `OracleAttestation` with
165
+ * the index of its oracle in the announcements of the contract info it settles.
166
+ * Attestations are verified against the announcements they claim to come from,
167
+ * so a forged or misindexed one cannot produce a CET
168
+ * ([`ContractError::InvalidAttestation`]). When no contract outcome matches the
169
+ * attested outcomes, [`ContractError::NoMatchingOutcome`] is returned — which
170
+ * is also what an attestation for an unrelated event looks like.
171
+ */
172
+ export declare function signContractCet(offer: Uint8Array, accept: Uint8Array, sign: Uint8Array, keys: ContractKeyProviderLike, temporaryContractId: Uint8Array, attestations: Array<OracleAttestationRef>): Uint8Array;
173
+ /**
174
+ * Signs the refund transaction, returning the Bitcoin consensus-serialized
175
+ * transaction. It returns each party its own collateral and can only be
176
+ * broadcast once the offer's `refund_locktime` has passed — enforcing that is
177
+ * the chain's job, not this function's.
178
+ *
179
+ * As with [`sign_contract_cet`], `temporary_contract_id` is the settling
180
+ * party's own temporary id and identifies which side is settling. Both parties
181
+ * signed the refund during the offer/accept exchange, so this only adds this
182
+ * party's half; the counterparty's stored signature is verified first.
183
+ */
184
+ export declare function signContractRefund(offer: Uint8Array, accept: Uint8Array, sign: Uint8Array, keys: ContractKeyProviderLike, temporaryContractId: Uint8Array): Uint8Array;
185
+ /**
186
+ * Signs a party's own funding inputs on the funding PSBT using a private output
187
+ * descriptor (e.g. bdk's `wpkh(...)` with an xprv), returning the updated PSBT.
188
+ * Each entry in `inputs` names one of this party's funding inputs (by serial
189
+ * id) and the descriptor wildcard index that derives its key. Supports `wpkh()`
190
+ * and `sh(wpkh())`, with or without a wildcard.
191
+ */
192
+ export declare function signFundingPsbtWithDescriptor(offer: Uint8Array, accept: Uint8Array, fundingPsbt: Uint8Array, descriptor: string, inputs: Array<DescriptorInput>): Uint8Array;
193
+ /**
194
+ * Validates an accept message against its offer: the acceptor's CET adaptor
195
+ * signatures and refund signature must be valid for the contract the two
196
+ * messages describe. This is the same check `sign_accept` runs internally,
197
+ * exposed so a stored/received `AcceptDlc` can be verified on its own.
198
+ */
199
+ export declare function validateAccept(offer: Uint8Array, accept: Uint8Array): void;
200
+ /**
201
+ * Validates an offer's protocol version, funding inputs, fee rate, collateral,
202
+ * and oracle timeouts.
203
+ *
204
+ * The lifecycle functions already validate internally (`accept_offer` validates
205
+ * the offer, `sign_accept` validates the accept, `finalize_sign` validates the
206
+ * sign); these `validate_*` functions expose the same checks standalone, so a
207
+ * consumer can independently verify a stored or received message at any time —
208
+ * e.g. before persisting it, or when loading it back later.
209
+ */
210
+ export declare function validateOffer(offer: Uint8Array, minTimeoutInterval: number, maxTimeoutInterval: number): void;
211
+ /**
212
+ * Validates a sign message against its offer and accept: the offerer's CET
213
+ * adaptor signatures and refund signature must be valid. This is the same
214
+ * check `finalize_sign` runs internally, exposed so a stored/received `SignDlc`
215
+ * can be verified on its own.
216
+ */
217
+ export declare function validateSign(offer: Uint8Array, accept: Uint8Array, sign: Uint8Array): void;
218
+ export declare function verifyCetAdaptorSigsFromOracleInfo(adaptorSigs: Array<AdaptorSignature>, cets: Array<Transaction>, oracleInfos: Array<OracleInfo>, pubkey: Uint8Array, fundingScriptPubkey: Uint8Array, totalCollateral: bigint, msgs: Array<Array<Array<Uint8Array>>>): boolean;
64
219
  export declare function version(): string;
220
+ /**
221
+ * One party's Bitcoin-level contract data (mirrors [`ddk::contract::PartyParams`]).
222
+ */
223
+ export type ContractPartyParams = {
224
+ /**
225
+ * The 33-byte compressed DLC funding public key.
226
+ */
227
+ fundingPubkey: Uint8Array;
228
+ /**
229
+ * The wallet UTXOs this party contributes, each a wire-encoded `FundingInput`.
230
+ */
231
+ fundingInputs: Array<Uint8Array>;
232
+ /**
233
+ * The script pubkey (raw bytes) CET and refund payouts are sent to.
234
+ */
235
+ payoutSpk: Uint8Array;
236
+ /**
237
+ * Serial id ordering the payout output; randomly generated when `None`.
238
+ */
239
+ payoutSerialId?: bigint;
240
+ /**
241
+ * The script pubkey (raw bytes) funding change is sent to.
242
+ */
243
+ changeSpk: Uint8Array;
244
+ /**
245
+ * Serial id ordering the change output; randomly generated when `None`.
246
+ */
247
+ changeSerialId?: bigint;
248
+ };
249
+ /**
250
+ * Generated factory for {@link ContractPartyParams} record objects.
251
+ */
252
+ export declare const ContractPartyParams: Readonly<{
253
+ create: (partial: Partial<ContractPartyParams> & Required<Omit<ContractPartyParams, "payoutSerialId" | "changeSerialId">>) => ContractPartyParams;
254
+ new: (partial: Partial<ContractPartyParams> & Required<Omit<ContractPartyParams, "payoutSerialId" | "changeSerialId">>) => ContractPartyParams;
255
+ defaults: () => Partial<ContractPartyParams>;
256
+ }>;
257
+ /**
258
+ * Parameters for [`accept_offer`] (mirrors [`ddk::contract::AcceptOfferParams`]).
259
+ */
260
+ export type AcceptOfferParams = {
261
+ /**
262
+ * The accepting party's Bitcoin-level contract data.
263
+ */
264
+ party: ContractPartyParams;
265
+ /**
266
+ * The minimum accepted interval between oracle maturity and the refund locktime.
267
+ */
268
+ minTimeoutInterval: number;
269
+ /**
270
+ * The maximum accepted interval between oracle maturity and the refund locktime.
271
+ */
272
+ maxTimeoutInterval: number;
273
+ };
274
+ /**
275
+ * Generated factory for {@link AcceptOfferParams} record objects.
276
+ */
277
+ export declare const AcceptOfferParams: Readonly<{
278
+ create: (partial: Partial<AcceptOfferParams> & Required<Omit<AcceptOfferParams, never>>) => AcceptOfferParams;
279
+ new: (partial: Partial<AcceptOfferParams> & Required<Omit<AcceptOfferParams, never>>) => AcceptOfferParams;
280
+ defaults: () => Partial<AcceptOfferParams>;
281
+ }>;
282
+ export type TxInput = {
283
+ txid: string;
284
+ vout: number;
285
+ scriptSig: Uint8Array;
286
+ sequence: number;
287
+ witness: Array<Uint8Array>;
288
+ };
289
+ /**
290
+ * Generated factory for {@link TxInput} record objects.
291
+ */
292
+ export declare const TxInput: Readonly<{
293
+ create: (partial: Partial<TxInput> & Required<Omit<TxInput, never>>) => TxInput;
294
+ new: (partial: Partial<TxInput> & Required<Omit<TxInput, never>>) => TxInput;
295
+ defaults: () => Partial<TxInput>;
296
+ }>;
297
+ export type TxOutput = {
298
+ value: bigint;
299
+ scriptPubkey: Uint8Array;
300
+ };
301
+ /**
302
+ * Generated factory for {@link TxOutput} record objects.
303
+ */
304
+ export declare const TxOutput: Readonly<{
305
+ create: (partial: Partial<TxOutput> & Required<Omit<TxOutput, never>>) => TxOutput;
306
+ new: (partial: Partial<TxOutput> & Required<Omit<TxOutput, never>>) => TxOutput;
307
+ defaults: () => Partial<TxOutput>;
308
+ isDust(self_: TxOutput): boolean;
309
+ }>;
310
+ export type Transaction = {
311
+ version: number;
312
+ lockTime: number;
313
+ inputs: Array<TxInput>;
314
+ outputs: Array<TxOutput>;
315
+ rawBytes: Uint8Array;
316
+ };
317
+ /**
318
+ * Generated factory for {@link Transaction} record objects.
319
+ */
320
+ export declare const Transaction: Readonly<{
321
+ create: (partial: Partial<Transaction> & Required<Omit<Transaction, never>>) => Transaction;
322
+ new: (partial: Partial<Transaction> & Required<Omit<Transaction, never>>) => Transaction;
323
+ defaults: () => Partial<Transaction>;
324
+ addSignature(self_: Transaction, signature: Uint8Array, pubkey: Uint8Array, inputIndex: number): Transaction;
325
+ cetAdaptorSignatureFromOracleInfo(self_: Transaction, oracleInfo: OracleInfo, fundingSk: Uint8Array, fundingScriptPubkey: Uint8Array, totalCollateral: bigint, msgs: Array<Uint8Array>): AdaptorSignature;
326
+ cetAdaptorSignatureInputs(self_: Transaction, oracleInfo: Array<OracleInfo>, fundingScriptPubkey: Uint8Array, fundOutputValue: bigint, msgs: Array<Array<Uint8Array>>): CetAdaptorSignatureDebugInfo;
327
+ cetSighash(self_: Transaction, fundingScriptPubkey: Uint8Array, fundOutputValue: bigint): Uint8Array;
328
+ rawFundingInputSignature(self_: Transaction, privkey: Uint8Array, prevTxId: string, prevTxVout: number, value: bigint): Uint8Array;
329
+ signCet(self_: Transaction, adaptorSignature: Uint8Array, oracleSignatures: Array<Uint8Array>, fundingSecretKey: Uint8Array, otherPubkey: Uint8Array, fundingScriptPubkey: Uint8Array, fundOutputValue: bigint): Transaction;
330
+ signFundInput(self_: Transaction, privkey: Uint8Array, prevTxId: string, prevTxVout: number, value: bigint): Transaction;
331
+ signMultiSigInput(self_: Transaction, dlcInput: DlcInputInfo, localPrivkey: Uint8Array, remoteSignature: Uint8Array): Transaction;
332
+ verifyFundSignature(self_: Transaction, signature: Uint8Array, pubkey: Uint8Array, txid: string, vout: number, inputAmount: bigint): boolean;
333
+ }>;
334
+ export type DlcTransactions = {
335
+ fund: Transaction;
336
+ cets: Array<Transaction>;
337
+ refund: Transaction;
338
+ fundingScriptPubkey: Uint8Array;
339
+ };
340
+ /**
341
+ * Generated factory for {@link DlcTransactions} record objects.
342
+ */
343
+ export declare const DlcTransactions: Readonly<{
344
+ create: (partial: Partial<DlcTransactions> & Required<Omit<DlcTransactions, never>>) => DlcTransactions;
345
+ new: (partial: Partial<DlcTransactions> & Required<Omit<DlcTransactions, never>>) => DlcTransactions;
346
+ defaults: () => Partial<DlcTransactions>;
347
+ }>;
348
+ /**
349
+ * The result of [`accept_offer`].
350
+ */
351
+ export type AcceptResult = {
352
+ /**
353
+ * The wire-encoded `AcceptDlc` message to send to the offering party.
354
+ */
355
+ accept: Uint8Array;
356
+ /**
357
+ * The unsigned funding, CET, and refund transactions.
358
+ */
359
+ transactions: DlcTransactions;
360
+ /**
361
+ * The BIP-174 funding PSBT ready to be signed by either party's funding source.
362
+ */
363
+ fundingPsbt: Uint8Array;
364
+ };
365
+ /**
366
+ * Generated factory for {@link AcceptResult} record objects.
367
+ */
368
+ export declare const AcceptResult: Readonly<{
369
+ create: (partial: Partial<AcceptResult> & Required<Omit<AcceptResult, never>>) => AcceptResult;
370
+ new: (partial: Partial<AcceptResult> & Required<Omit<AcceptResult, never>>) => AcceptResult;
371
+ defaults: () => Partial<AcceptResult>;
372
+ }>;
65
373
  export type AdaptorSignature = {
66
- signature: ArrayBuffer;
67
- proof: ArrayBuffer;
374
+ signature: Uint8Array;
375
+ proof: Uint8Array;
68
376
  };
69
377
  /**
70
378
  * Generated factory for {@link AdaptorSignature} record objects.
@@ -73,211 +381,1794 @@ export declare const AdaptorSignature: Readonly<{
73
381
  create: (partial: Partial<AdaptorSignature> & Required<Omit<AdaptorSignature, never>>) => AdaptorSignature;
74
382
  new: (partial: Partial<AdaptorSignature> & Required<Omit<AdaptorSignature, never>>) => AdaptorSignature;
75
383
  defaults: () => Partial<AdaptorSignature>;
76
- verifyFromOracleInfo(self_: AdaptorSignature, cet: Transaction, oracleInfos: Array<OracleInfo>, pubkey: ArrayBuffer, fundingScriptPubkey: ArrayBuffer, totalCollateral: bigint, msgs: Array<Array<ArrayBuffer>>): boolean;
384
+ verifyFromOracleInfo(self_: AdaptorSignature, cet: Transaction, oracleInfos: Array<OracleInfo>, pubkey: Uint8Array, fundingScriptPubkey: Uint8Array, totalCollateral: bigint, msgs: Array<Array<Uint8Array>>): boolean;
385
+ }>;
386
+ /**
387
+ * Debug info for CET adaptor signature inputs.
388
+ *
389
+ * Contains all the values that go into creating an adaptor signature,
390
+ * useful for comparing with external signers during debugging.
391
+ *
392
+ * This struct is intentionally always available (not feature-gated)
393
+ * to support production debugging scenarios.
394
+ */
395
+ export type CetAdaptorSignatureDebugInfo = {
396
+ /**
397
+ * The sighash (32 bytes) - this is the message that gets signed
398
+ */
399
+ sighash: Uint8Array;
400
+ /**
401
+ * The adaptor point (33 bytes compressed public key)
402
+ */
403
+ adaptorPoint: Uint8Array;
404
+ /**
405
+ * Input index (always 0 for CETs)
406
+ */
407
+ inputIndex: number;
408
+ /**
409
+ * The funding script pubkey used for sighash
410
+ */
411
+ scriptPubkey: Uint8Array;
412
+ /**
413
+ * The fund output value used for sighash
414
+ */
415
+ value: bigint;
416
+ /**
417
+ * The CET txid
418
+ */
419
+ cetTxid: string;
420
+ /**
421
+ * Raw CET bytes for verification
422
+ */
423
+ cetRaw: Uint8Array;
424
+ };
425
+ /**
426
+ * Generated factory for {@link CetAdaptorSignatureDebugInfo} record objects.
427
+ */
428
+ export declare const CetAdaptorSignatureDebugInfo: Readonly<{
429
+ create: (partial: Partial<CetAdaptorSignatureDebugInfo> & Required<Omit<CetAdaptorSignatureDebugInfo, never>>) => CetAdaptorSignatureDebugInfo;
430
+ new: (partial: Partial<CetAdaptorSignatureDebugInfo> & Required<Omit<CetAdaptorSignatureDebugInfo, never>>) => CetAdaptorSignatureDebugInfo;
431
+ defaults: () => Partial<CetAdaptorSignatureDebugInfo>;
432
+ }>;
433
+ export type ChangeOutputAndFees = {
434
+ changeOutput: TxOutput;
435
+ fundFee: bigint;
436
+ cetFee: bigint;
437
+ };
438
+ /**
439
+ * Generated factory for {@link ChangeOutputAndFees} record objects.
440
+ */
441
+ export declare const ChangeOutputAndFees: Readonly<{
442
+ create: (partial: Partial<ChangeOutputAndFees> & Required<Omit<ChangeOutputAndFees, never>>) => ChangeOutputAndFees;
443
+ new: (partial: Partial<ChangeOutputAndFees> & Required<Omit<ChangeOutputAndFees, never>>) => ChangeOutputAndFees;
444
+ defaults: () => Partial<ChangeOutputAndFees>;
445
+ }>;
446
+ /**
447
+ * One row of a contract's payout table.
448
+ *
449
+ * Enum-contract rows carry an `outcome` label; numeric-contract rows carry an
450
+ * inclusive `[range_start, range_end]` of outcome values that share the payout.
451
+ */
452
+ export type PayoutRow = {
453
+ /**
454
+ * The outcome label (enum contracts only; `None` for numeric).
455
+ */
456
+ outcome?: string;
457
+ /**
458
+ * Inclusive start of the outcome range (numeric contracts only; `None` for enum).
459
+ */
460
+ rangeStart?: bigint;
461
+ /**
462
+ * Inclusive end of the outcome range (numeric contracts only; `None` for enum).
463
+ */
464
+ rangeEnd?: bigint;
465
+ /**
466
+ * The payout to the offering party, in satoshis.
467
+ */
468
+ offerPayoutSats: bigint;
469
+ /**
470
+ * The payout to the accepting party, in satoshis.
471
+ */
472
+ acceptPayoutSats: bigint;
473
+ };
474
+ /**
475
+ * Generated factory for {@link PayoutRow} record objects.
476
+ */
477
+ export declare const PayoutRow: Readonly<{
478
+ create: (partial: Partial<PayoutRow> & Required<Omit<PayoutRow, "outcome" | "rangeStart" | "rangeEnd">>) => PayoutRow;
479
+ new: (partial: Partial<PayoutRow> & Required<Omit<PayoutRow, "outcome" | "rangeStart" | "rangeEnd">>) => PayoutRow;
480
+ defaults: () => Partial<PayoutRow>;
481
+ }>;
482
+ /**
483
+ * A contract's payouts, derived from its `ContractInfo`, for display as a table.
484
+ */
485
+ export type ContractPayouts = {
486
+ /**
487
+ * Total collateral (offer + accept), in satoshis.
488
+ */
489
+ totalCollateralSats: bigint;
490
+ /**
491
+ * `true` for enum contracts (rows are labeled outcomes); `false` for numeric
492
+ * contracts (rows are outcome ranges).
493
+ */
494
+ isEnum: boolean;
495
+ /**
496
+ * The payout rows, in outcome order.
497
+ */
498
+ rows: Array<PayoutRow>;
499
+ };
500
+ /**
501
+ * Generated factory for {@link ContractPayouts} record objects.
502
+ */
503
+ export declare const ContractPayouts: Readonly<{
504
+ create: (partial: Partial<ContractPayouts> & Required<Omit<ContractPayouts, never>>) => ContractPayouts;
505
+ new: (partial: Partial<ContractPayouts> & Required<Omit<ContractPayouts, never>>) => ContractPayouts;
506
+ defaults: () => Partial<ContractPayouts>;
507
+ }>;
508
+ /**
509
+ * Parameters for [`create_offer`] (mirrors [`ddk::contract::CreateOfferParams`]).
510
+ */
511
+ export type CreateOfferParams = {
512
+ /**
513
+ * The 32-byte chain hash the contract settles on.
514
+ */
515
+ chainHash: Uint8Array;
516
+ /**
517
+ * The 32-byte temporary contract id; randomly generated when `None`.
518
+ */
519
+ temporaryContractId?: Uint8Array;
520
+ /**
521
+ * The contract payout and oracle information, wire-encoded `ContractInfo`.
522
+ */
523
+ contractInfo: Uint8Array;
524
+ /**
525
+ * The collateral, in satoshis, contributed by the offering party.
526
+ */
527
+ offerCollateralSats: bigint;
528
+ /**
529
+ * The offering party's Bitcoin-level contract data.
530
+ */
531
+ party: ContractPartyParams;
532
+ /**
533
+ * Serial id ordering the funding output; randomly generated when `None`.
534
+ */
535
+ fundOutputSerialId?: bigint;
536
+ /**
537
+ * The fee rate, in satoshis per virtual byte.
538
+ */
539
+ feeRatePerVb: bigint;
540
+ /**
541
+ * The earliest time CETs can be broadcast.
542
+ */
543
+ cetLocktime: number;
544
+ /**
545
+ * The time after which the refund transaction can be broadcast.
546
+ */
547
+ refundLocktime: number;
548
+ /**
549
+ * Contract feature flags. Use `0` unless a protocol extension requires otherwise.
550
+ */
551
+ contractFlags: number;
552
+ };
553
+ /**
554
+ * Generated factory for {@link CreateOfferParams} record objects.
555
+ */
556
+ export declare const CreateOfferParams: Readonly<{
557
+ create: (partial: Partial<CreateOfferParams> & Required<Omit<CreateOfferParams, "temporaryContractId" | "fundOutputSerialId">>) => CreateOfferParams;
558
+ new: (partial: Partial<CreateOfferParams> & Required<Omit<CreateOfferParams, "temporaryContractId" | "fundOutputSerialId">>) => CreateOfferParams;
559
+ defaults: () => Partial<CreateOfferParams>;
560
+ }>;
561
+ /**
562
+ * Identifies a funding input and the descriptor wildcard index that derives its
563
+ * key, for [`sign_funding_psbt_with_descriptor`].
564
+ */
565
+ export type DescriptorInput = {
566
+ /**
567
+ * The serial id of the funding input to sign.
568
+ */
569
+ inputSerialId: bigint;
570
+ /**
571
+ * The descriptor wildcard derivation index of the input's script (ignored
572
+ * for descriptors without a wildcard).
573
+ */
574
+ derivationIndex: number;
575
+ };
576
+ /**
577
+ * Generated factory for {@link DescriptorInput} record objects.
578
+ */
579
+ export declare const DescriptorInput: Readonly<{
580
+ create: (partial: Partial<DescriptorInput> & Required<Omit<DescriptorInput, never>>) => DescriptorInput;
581
+ new: (partial: Partial<DescriptorInput> & Required<Omit<DescriptorInput, never>>) => DescriptorInput;
582
+ defaults: () => Partial<DescriptorInput>;
583
+ }>;
584
+ export type DlcInputInfo = {
585
+ fundTx: Transaction;
586
+ fundVout: number;
587
+ localFundPubkey: Uint8Array;
588
+ remoteFundPubkey: Uint8Array;
589
+ fundAmount: bigint;
590
+ maxWitnessLen: number;
591
+ inputSerialId: bigint;
592
+ contractId: Uint8Array;
593
+ };
594
+ /**
595
+ * Generated factory for {@link DlcInputInfo} record objects.
596
+ */
597
+ export declare const DlcInputInfo: Readonly<{
598
+ create: (partial: Partial<DlcInputInfo> & Required<Omit<DlcInputInfo, never>>) => DlcInputInfo;
599
+ new: (partial: Partial<DlcInputInfo> & Required<Omit<DlcInputInfo, never>>) => DlcInputInfo;
600
+ defaults: () => Partial<DlcInputInfo>;
601
+ }>;
602
+ /**
603
+ * An oracle attestation paired with the position of the oracle that produced it
604
+ * in the contract's announcements, for [`sign_contract_cet`].
605
+ */
606
+ export type OracleAttestationRef = {
607
+ /**
608
+ * The index of the attesting oracle in the contract info's announcements.
609
+ */
610
+ oracleIndex: number;
611
+ /**
612
+ * The wire-encoded `OracleAttestation`.
613
+ */
614
+ attestation: Uint8Array;
615
+ };
616
+ /**
617
+ * Generated factory for {@link OracleAttestationRef} record objects.
618
+ */
619
+ export declare const OracleAttestationRef: Readonly<{
620
+ create: (partial: Partial<OracleAttestationRef> & Required<Omit<OracleAttestationRef, never>>) => OracleAttestationRef;
621
+ new: (partial: Partial<OracleAttestationRef> & Required<Omit<OracleAttestationRef, never>>) => OracleAttestationRef;
622
+ defaults: () => Partial<OracleAttestationRef>;
623
+ }>;
624
+ export type OracleInfo = {
625
+ publicKey: Uint8Array;
626
+ nonces: Array<Uint8Array>;
627
+ };
628
+ /**
629
+ * Generated factory for {@link OracleInfo} record objects.
630
+ */
631
+ export declare const OracleInfo: Readonly<{
632
+ create: (partial: Partial<OracleInfo> & Required<Omit<OracleInfo, never>>) => OracleInfo;
633
+ new: (partial: Partial<OracleInfo> & Required<Omit<OracleInfo, never>>) => OracleInfo;
634
+ defaults: () => Partial<OracleInfo>;
635
+ }>;
636
+ export type TxInputInfo = {
637
+ txid: string;
638
+ vout: number;
639
+ scriptSig: Uint8Array;
640
+ maxWitnessLength: number;
641
+ serialId: bigint;
642
+ };
643
+ /**
644
+ * Generated factory for {@link TxInputInfo} record objects.
645
+ */
646
+ export declare const TxInputInfo: Readonly<{
647
+ create: (partial: Partial<TxInputInfo> & Required<Omit<TxInputInfo, never>>) => TxInputInfo;
648
+ new: (partial: Partial<TxInputInfo> & Required<Omit<TxInputInfo, never>>) => TxInputInfo;
649
+ defaults: () => Partial<TxInputInfo>;
650
+ }>;
651
+ export type PartyParams = {
652
+ fundPubkey: Uint8Array;
653
+ changeScriptPubkey: Uint8Array;
654
+ changeSerialId: bigint;
655
+ payoutScriptPubkey: Uint8Array;
656
+ payoutSerialId: bigint;
657
+ inputs: Array<TxInputInfo>;
658
+ inputAmount: bigint;
659
+ collateral: bigint;
660
+ dlcInputs: Array<DlcInputInfo>;
661
+ };
662
+ /**
663
+ * Generated factory for {@link PartyParams} record objects.
664
+ */
665
+ export declare const PartyParams: Readonly<{
666
+ create: (partial: Partial<PartyParams> & Required<Omit<PartyParams, never>>) => PartyParams;
667
+ new: (partial: Partial<PartyParams> & Required<Omit<PartyParams, never>>) => PartyParams;
668
+ defaults: () => Partial<PartyParams>;
669
+ changeOutputAndFees(self_: PartyParams, feeRate: bigint): ChangeOutputAndFees;
670
+ }>;
671
+ export type Payout = {
672
+ offer: bigint;
673
+ accept: bigint;
674
+ };
675
+ /**
676
+ * Generated factory for {@link Payout} record objects.
677
+ */
678
+ export declare const Payout: Readonly<{
679
+ create: (partial: Partial<Payout> & Required<Omit<Payout, never>>) => Payout;
680
+ new: (partial: Partial<Payout> & Required<Omit<Payout, never>>) => Payout;
681
+ defaults: () => Partial<Payout>;
682
+ }>;
683
+ /**
684
+ * The result of [`sign_accept`] / [`sign_accept_spliced`].
685
+ */
686
+ export type SignResult = {
687
+ /**
688
+ * The wire-encoded `SignDlc` message to send to the accepting party.
689
+ */
690
+ sign: Uint8Array;
691
+ /**
692
+ * The unsigned funding, CET, and refund transactions.
693
+ */
694
+ transactions: DlcTransactions;
695
+ };
696
+ /**
697
+ * Generated factory for {@link SignResult} record objects.
698
+ */
699
+ export declare const SignResult: Readonly<{
700
+ create: (partial: Partial<SignResult> & Required<Omit<SignResult, never>>) => SignResult;
701
+ new: (partial: Partial<SignResult> & Required<Omit<SignResult, never>>) => SignResult;
702
+ defaults: () => Partial<SignResult>;
703
+ }>;
704
+ /**
705
+ * References a splice (DLC) funding input and the previous contract whose
706
+ * 2-of-2 output it spends, so the provider can re-derive the signing key.
707
+ */
708
+ export type SpliceKeyRef = {
709
+ /**
710
+ * The serial id of the DLC (splice) funding input this key signs.
711
+ */
712
+ inputSerialId: bigint;
713
+ /**
714
+ * The 32-byte temporary id of the previous contract being spliced from.
715
+ */
716
+ priorTemporaryContractId: Uint8Array;
717
+ };
718
+ /**
719
+ * Generated factory for {@link SpliceKeyRef} record objects.
720
+ */
721
+ export declare const SpliceKeyRef: Readonly<{
722
+ create: (partial: Partial<SpliceKeyRef> & Required<Omit<SpliceKeyRef, never>>) => SpliceKeyRef;
723
+ new: (partial: Partial<SpliceKeyRef> & Required<Omit<SpliceKeyRef, never>>) => SpliceKeyRef;
724
+ defaults: () => Partial<SpliceKeyRef>;
725
+ }>;
726
+ export declare enum ContractError_Tags {
727
+ InvalidOffer = "InvalidOffer",
728
+ InvalidAccept = "InvalidAccept",
729
+ InvalidSign = "InvalidSign",
730
+ InvalidFundingInput = "InvalidFundingInput",
731
+ PsbtMismatch = "PsbtMismatch",
732
+ MissingFinalizedInput = "MissingFinalizedInput",
733
+ UnsupportedScriptType = "UnsupportedScriptType",
734
+ InvalidAttestation = "InvalidAttestation",
735
+ NoMatchingOutcome = "NoMatchingOutcome",
736
+ Descriptor = "Descriptor",
737
+ Wallet = "Wallet",
738
+ Bip32 = "Bip32",
739
+ Dlc = "Dlc",
740
+ Key = "Key",
741
+ Serialization = "Serialization",
742
+ InvalidNetwork = "InvalidNetwork",
743
+ InvalidLength = "InvalidLength"
744
+ }
745
+ /**
746
+ * Errors returned by the stateless contract API.
747
+ *
748
+ * Mirrors [`ddk::contract::ContractError`] as a uniffi error so the typed
749
+ * variants survive across the binding boundary. Variants carry plain strings.
750
+ */
751
+ export declare const ContractError: Readonly<{
752
+ instanceOf: (obj: any) => obj is ContractError;
753
+ InvalidOffer: {
754
+ new (inner: {
755
+ message: string;
756
+ }): {
757
+ readonly tag: ContractError_Tags.InvalidOffer;
758
+ readonly inner: Readonly<{
759
+ message: string;
760
+ }>;
761
+ /**
762
+ * @private
763
+ * This field is private and should not be used, use `tag` instead.
764
+ */
765
+ readonly [uniffiTypeNameSymbol]: "ContractError";
766
+ name: string;
767
+ message: string;
768
+ stack?: string;
769
+ cause?: unknown;
770
+ };
771
+ "new"(inner: {
772
+ message: string;
773
+ }): {
774
+ readonly tag: ContractError_Tags.InvalidOffer;
775
+ readonly inner: Readonly<{
776
+ message: string;
777
+ }>;
778
+ /**
779
+ * @private
780
+ * This field is private and should not be used, use `tag` instead.
781
+ */
782
+ readonly [uniffiTypeNameSymbol]: "ContractError";
783
+ name: string;
784
+ message: string;
785
+ stack?: string;
786
+ cause?: unknown;
787
+ };
788
+ instanceOf(obj: any): obj is {
789
+ readonly tag: ContractError_Tags.InvalidOffer;
790
+ readonly inner: Readonly<{
791
+ message: string;
792
+ }>;
793
+ /**
794
+ * @private
795
+ * This field is private and should not be used, use `tag` instead.
796
+ */
797
+ readonly [uniffiTypeNameSymbol]: "ContractError";
798
+ name: string;
799
+ message: string;
800
+ stack?: string;
801
+ cause?: unknown;
802
+ };
803
+ hasInner(obj: any): obj is {
804
+ readonly tag: ContractError_Tags.InvalidOffer;
805
+ readonly inner: Readonly<{
806
+ message: string;
807
+ }>;
808
+ /**
809
+ * @private
810
+ * This field is private and should not be used, use `tag` instead.
811
+ */
812
+ readonly [uniffiTypeNameSymbol]: "ContractError";
813
+ name: string;
814
+ message: string;
815
+ stack?: string;
816
+ cause?: unknown;
817
+ };
818
+ getInner(obj: {
819
+ readonly tag: ContractError_Tags.InvalidOffer;
820
+ readonly inner: Readonly<{
821
+ message: string;
822
+ }>;
823
+ /**
824
+ * @private
825
+ * This field is private and should not be used, use `tag` instead.
826
+ */
827
+ readonly [uniffiTypeNameSymbol]: "ContractError";
828
+ name: string;
829
+ message: string;
830
+ stack?: string;
831
+ cause?: unknown;
832
+ }): Readonly<{
833
+ message: string;
834
+ }>;
835
+ isError(error: unknown): error is Error;
836
+ };
837
+ InvalidAccept: {
838
+ new (inner: {
839
+ message: string;
840
+ }): {
841
+ readonly tag: ContractError_Tags.InvalidAccept;
842
+ readonly inner: Readonly<{
843
+ message: string;
844
+ }>;
845
+ /**
846
+ * @private
847
+ * This field is private and should not be used, use `tag` instead.
848
+ */
849
+ readonly [uniffiTypeNameSymbol]: "ContractError";
850
+ name: string;
851
+ message: string;
852
+ stack?: string;
853
+ cause?: unknown;
854
+ };
855
+ "new"(inner: {
856
+ message: string;
857
+ }): {
858
+ readonly tag: ContractError_Tags.InvalidAccept;
859
+ readonly inner: Readonly<{
860
+ message: string;
861
+ }>;
862
+ /**
863
+ * @private
864
+ * This field is private and should not be used, use `tag` instead.
865
+ */
866
+ readonly [uniffiTypeNameSymbol]: "ContractError";
867
+ name: string;
868
+ message: string;
869
+ stack?: string;
870
+ cause?: unknown;
871
+ };
872
+ instanceOf(obj: any): obj is {
873
+ readonly tag: ContractError_Tags.InvalidAccept;
874
+ readonly inner: Readonly<{
875
+ message: string;
876
+ }>;
877
+ /**
878
+ * @private
879
+ * This field is private and should not be used, use `tag` instead.
880
+ */
881
+ readonly [uniffiTypeNameSymbol]: "ContractError";
882
+ name: string;
883
+ message: string;
884
+ stack?: string;
885
+ cause?: unknown;
886
+ };
887
+ hasInner(obj: any): obj is {
888
+ readonly tag: ContractError_Tags.InvalidAccept;
889
+ readonly inner: Readonly<{
890
+ message: string;
891
+ }>;
892
+ /**
893
+ * @private
894
+ * This field is private and should not be used, use `tag` instead.
895
+ */
896
+ readonly [uniffiTypeNameSymbol]: "ContractError";
897
+ name: string;
898
+ message: string;
899
+ stack?: string;
900
+ cause?: unknown;
901
+ };
902
+ getInner(obj: {
903
+ readonly tag: ContractError_Tags.InvalidAccept;
904
+ readonly inner: Readonly<{
905
+ message: string;
906
+ }>;
907
+ /**
908
+ * @private
909
+ * This field is private and should not be used, use `tag` instead.
910
+ */
911
+ readonly [uniffiTypeNameSymbol]: "ContractError";
912
+ name: string;
913
+ message: string;
914
+ stack?: string;
915
+ cause?: unknown;
916
+ }): Readonly<{
917
+ message: string;
918
+ }>;
919
+ isError(error: unknown): error is Error;
920
+ };
921
+ InvalidSign: {
922
+ new (inner: {
923
+ message: string;
924
+ }): {
925
+ readonly tag: ContractError_Tags.InvalidSign;
926
+ readonly inner: Readonly<{
927
+ message: string;
928
+ }>;
929
+ /**
930
+ * @private
931
+ * This field is private and should not be used, use `tag` instead.
932
+ */
933
+ readonly [uniffiTypeNameSymbol]: "ContractError";
934
+ name: string;
935
+ message: string;
936
+ stack?: string;
937
+ cause?: unknown;
938
+ };
939
+ "new"(inner: {
940
+ message: string;
941
+ }): {
942
+ readonly tag: ContractError_Tags.InvalidSign;
943
+ readonly inner: Readonly<{
944
+ message: string;
945
+ }>;
946
+ /**
947
+ * @private
948
+ * This field is private and should not be used, use `tag` instead.
949
+ */
950
+ readonly [uniffiTypeNameSymbol]: "ContractError";
951
+ name: string;
952
+ message: string;
953
+ stack?: string;
954
+ cause?: unknown;
955
+ };
956
+ instanceOf(obj: any): obj is {
957
+ readonly tag: ContractError_Tags.InvalidSign;
958
+ readonly inner: Readonly<{
959
+ message: string;
960
+ }>;
961
+ /**
962
+ * @private
963
+ * This field is private and should not be used, use `tag` instead.
964
+ */
965
+ readonly [uniffiTypeNameSymbol]: "ContractError";
966
+ name: string;
967
+ message: string;
968
+ stack?: string;
969
+ cause?: unknown;
970
+ };
971
+ hasInner(obj: any): obj is {
972
+ readonly tag: ContractError_Tags.InvalidSign;
973
+ readonly inner: Readonly<{
974
+ message: string;
975
+ }>;
976
+ /**
977
+ * @private
978
+ * This field is private and should not be used, use `tag` instead.
979
+ */
980
+ readonly [uniffiTypeNameSymbol]: "ContractError";
981
+ name: string;
982
+ message: string;
983
+ stack?: string;
984
+ cause?: unknown;
985
+ };
986
+ getInner(obj: {
987
+ readonly tag: ContractError_Tags.InvalidSign;
988
+ readonly inner: Readonly<{
989
+ message: string;
990
+ }>;
991
+ /**
992
+ * @private
993
+ * This field is private and should not be used, use `tag` instead.
994
+ */
995
+ readonly [uniffiTypeNameSymbol]: "ContractError";
996
+ name: string;
997
+ message: string;
998
+ stack?: string;
999
+ cause?: unknown;
1000
+ }): Readonly<{
1001
+ message: string;
1002
+ }>;
1003
+ isError(error: unknown): error is Error;
1004
+ };
1005
+ InvalidFundingInput: {
1006
+ new (inner: {
1007
+ message: string;
1008
+ }): {
1009
+ readonly tag: ContractError_Tags.InvalidFundingInput;
1010
+ readonly inner: Readonly<{
1011
+ message: string;
1012
+ }>;
1013
+ /**
1014
+ * @private
1015
+ * This field is private and should not be used, use `tag` instead.
1016
+ */
1017
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1018
+ name: string;
1019
+ message: string;
1020
+ stack?: string;
1021
+ cause?: unknown;
1022
+ };
1023
+ "new"(inner: {
1024
+ message: string;
1025
+ }): {
1026
+ readonly tag: ContractError_Tags.InvalidFundingInput;
1027
+ readonly inner: Readonly<{
1028
+ message: string;
1029
+ }>;
1030
+ /**
1031
+ * @private
1032
+ * This field is private and should not be used, use `tag` instead.
1033
+ */
1034
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1035
+ name: string;
1036
+ message: string;
1037
+ stack?: string;
1038
+ cause?: unknown;
1039
+ };
1040
+ instanceOf(obj: any): obj is {
1041
+ readonly tag: ContractError_Tags.InvalidFundingInput;
1042
+ readonly inner: Readonly<{
1043
+ message: string;
1044
+ }>;
1045
+ /**
1046
+ * @private
1047
+ * This field is private and should not be used, use `tag` instead.
1048
+ */
1049
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1050
+ name: string;
1051
+ message: string;
1052
+ stack?: string;
1053
+ cause?: unknown;
1054
+ };
1055
+ hasInner(obj: any): obj is {
1056
+ readonly tag: ContractError_Tags.InvalidFundingInput;
1057
+ readonly inner: Readonly<{
1058
+ message: string;
1059
+ }>;
1060
+ /**
1061
+ * @private
1062
+ * This field is private and should not be used, use `tag` instead.
1063
+ */
1064
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1065
+ name: string;
1066
+ message: string;
1067
+ stack?: string;
1068
+ cause?: unknown;
1069
+ };
1070
+ getInner(obj: {
1071
+ readonly tag: ContractError_Tags.InvalidFundingInput;
1072
+ readonly inner: Readonly<{
1073
+ message: string;
1074
+ }>;
1075
+ /**
1076
+ * @private
1077
+ * This field is private and should not be used, use `tag` instead.
1078
+ */
1079
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1080
+ name: string;
1081
+ message: string;
1082
+ stack?: string;
1083
+ cause?: unknown;
1084
+ }): Readonly<{
1085
+ message: string;
1086
+ }>;
1087
+ isError(error: unknown): error is Error;
1088
+ };
1089
+ PsbtMismatch: {
1090
+ new (inner: {
1091
+ message: string;
1092
+ }): {
1093
+ readonly tag: ContractError_Tags.PsbtMismatch;
1094
+ readonly inner: Readonly<{
1095
+ message: string;
1096
+ }>;
1097
+ /**
1098
+ * @private
1099
+ * This field is private and should not be used, use `tag` instead.
1100
+ */
1101
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1102
+ name: string;
1103
+ message: string;
1104
+ stack?: string;
1105
+ cause?: unknown;
1106
+ };
1107
+ "new"(inner: {
1108
+ message: string;
1109
+ }): {
1110
+ readonly tag: ContractError_Tags.PsbtMismatch;
1111
+ readonly inner: Readonly<{
1112
+ message: string;
1113
+ }>;
1114
+ /**
1115
+ * @private
1116
+ * This field is private and should not be used, use `tag` instead.
1117
+ */
1118
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1119
+ name: string;
1120
+ message: string;
1121
+ stack?: string;
1122
+ cause?: unknown;
1123
+ };
1124
+ instanceOf(obj: any): obj is {
1125
+ readonly tag: ContractError_Tags.PsbtMismatch;
1126
+ readonly inner: Readonly<{
1127
+ message: string;
1128
+ }>;
1129
+ /**
1130
+ * @private
1131
+ * This field is private and should not be used, use `tag` instead.
1132
+ */
1133
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1134
+ name: string;
1135
+ message: string;
1136
+ stack?: string;
1137
+ cause?: unknown;
1138
+ };
1139
+ hasInner(obj: any): obj is {
1140
+ readonly tag: ContractError_Tags.PsbtMismatch;
1141
+ readonly inner: Readonly<{
1142
+ message: string;
1143
+ }>;
1144
+ /**
1145
+ * @private
1146
+ * This field is private and should not be used, use `tag` instead.
1147
+ */
1148
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1149
+ name: string;
1150
+ message: string;
1151
+ stack?: string;
1152
+ cause?: unknown;
1153
+ };
1154
+ getInner(obj: {
1155
+ readonly tag: ContractError_Tags.PsbtMismatch;
1156
+ readonly inner: Readonly<{
1157
+ message: string;
1158
+ }>;
1159
+ /**
1160
+ * @private
1161
+ * This field is private and should not be used, use `tag` instead.
1162
+ */
1163
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1164
+ name: string;
1165
+ message: string;
1166
+ stack?: string;
1167
+ cause?: unknown;
1168
+ }): Readonly<{
1169
+ message: string;
1170
+ }>;
1171
+ isError(error: unknown): error is Error;
1172
+ };
1173
+ MissingFinalizedInput: {
1174
+ new (inner: {
1175
+ inputIndex: number;
1176
+ }): {
1177
+ readonly tag: ContractError_Tags.MissingFinalizedInput;
1178
+ readonly inner: Readonly<{
1179
+ inputIndex: number;
1180
+ }>;
1181
+ /**
1182
+ * @private
1183
+ * This field is private and should not be used, use `tag` instead.
1184
+ */
1185
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1186
+ name: string;
1187
+ message: string;
1188
+ stack?: string;
1189
+ cause?: unknown;
1190
+ };
1191
+ "new"(inner: {
1192
+ inputIndex: number;
1193
+ }): {
1194
+ readonly tag: ContractError_Tags.MissingFinalizedInput;
1195
+ readonly inner: Readonly<{
1196
+ inputIndex: number;
1197
+ }>;
1198
+ /**
1199
+ * @private
1200
+ * This field is private and should not be used, use `tag` instead.
1201
+ */
1202
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1203
+ name: string;
1204
+ message: string;
1205
+ stack?: string;
1206
+ cause?: unknown;
1207
+ };
1208
+ instanceOf(obj: any): obj is {
1209
+ readonly tag: ContractError_Tags.MissingFinalizedInput;
1210
+ readonly inner: Readonly<{
1211
+ inputIndex: number;
1212
+ }>;
1213
+ /**
1214
+ * @private
1215
+ * This field is private and should not be used, use `tag` instead.
1216
+ */
1217
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1218
+ name: string;
1219
+ message: string;
1220
+ stack?: string;
1221
+ cause?: unknown;
1222
+ };
1223
+ hasInner(obj: any): obj is {
1224
+ readonly tag: ContractError_Tags.MissingFinalizedInput;
1225
+ readonly inner: Readonly<{
1226
+ inputIndex: number;
1227
+ }>;
1228
+ /**
1229
+ * @private
1230
+ * This field is private and should not be used, use `tag` instead.
1231
+ */
1232
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1233
+ name: string;
1234
+ message: string;
1235
+ stack?: string;
1236
+ cause?: unknown;
1237
+ };
1238
+ getInner(obj: {
1239
+ readonly tag: ContractError_Tags.MissingFinalizedInput;
1240
+ readonly inner: Readonly<{
1241
+ inputIndex: number;
1242
+ }>;
1243
+ /**
1244
+ * @private
1245
+ * This field is private and should not be used, use `tag` instead.
1246
+ */
1247
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1248
+ name: string;
1249
+ message: string;
1250
+ stack?: string;
1251
+ cause?: unknown;
1252
+ }): Readonly<{
1253
+ inputIndex: number;
1254
+ }>;
1255
+ isError(error: unknown): error is Error;
1256
+ };
1257
+ UnsupportedScriptType: {
1258
+ new (inner: {
1259
+ inputIndex: number;
1260
+ }): {
1261
+ readonly tag: ContractError_Tags.UnsupportedScriptType;
1262
+ readonly inner: Readonly<{
1263
+ inputIndex: number;
1264
+ }>;
1265
+ /**
1266
+ * @private
1267
+ * This field is private and should not be used, use `tag` instead.
1268
+ */
1269
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1270
+ name: string;
1271
+ message: string;
1272
+ stack?: string;
1273
+ cause?: unknown;
1274
+ };
1275
+ "new"(inner: {
1276
+ inputIndex: number;
1277
+ }): {
1278
+ readonly tag: ContractError_Tags.UnsupportedScriptType;
1279
+ readonly inner: Readonly<{
1280
+ inputIndex: number;
1281
+ }>;
1282
+ /**
1283
+ * @private
1284
+ * This field is private and should not be used, use `tag` instead.
1285
+ */
1286
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1287
+ name: string;
1288
+ message: string;
1289
+ stack?: string;
1290
+ cause?: unknown;
1291
+ };
1292
+ instanceOf(obj: any): obj is {
1293
+ readonly tag: ContractError_Tags.UnsupportedScriptType;
1294
+ readonly inner: Readonly<{
1295
+ inputIndex: number;
1296
+ }>;
1297
+ /**
1298
+ * @private
1299
+ * This field is private and should not be used, use `tag` instead.
1300
+ */
1301
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1302
+ name: string;
1303
+ message: string;
1304
+ stack?: string;
1305
+ cause?: unknown;
1306
+ };
1307
+ hasInner(obj: any): obj is {
1308
+ readonly tag: ContractError_Tags.UnsupportedScriptType;
1309
+ readonly inner: Readonly<{
1310
+ inputIndex: number;
1311
+ }>;
1312
+ /**
1313
+ * @private
1314
+ * This field is private and should not be used, use `tag` instead.
1315
+ */
1316
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1317
+ name: string;
1318
+ message: string;
1319
+ stack?: string;
1320
+ cause?: unknown;
1321
+ };
1322
+ getInner(obj: {
1323
+ readonly tag: ContractError_Tags.UnsupportedScriptType;
1324
+ readonly inner: Readonly<{
1325
+ inputIndex: number;
1326
+ }>;
1327
+ /**
1328
+ * @private
1329
+ * This field is private and should not be used, use `tag` instead.
1330
+ */
1331
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1332
+ name: string;
1333
+ message: string;
1334
+ stack?: string;
1335
+ cause?: unknown;
1336
+ }): Readonly<{
1337
+ inputIndex: number;
1338
+ }>;
1339
+ isError(error: unknown): error is Error;
1340
+ };
1341
+ InvalidAttestation: {
1342
+ new (inner: {
1343
+ message: string;
1344
+ }): {
1345
+ readonly tag: ContractError_Tags.InvalidAttestation;
1346
+ readonly inner: Readonly<{
1347
+ message: string;
1348
+ }>;
1349
+ /**
1350
+ * @private
1351
+ * This field is private and should not be used, use `tag` instead.
1352
+ */
1353
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1354
+ name: string;
1355
+ message: string;
1356
+ stack?: string;
1357
+ cause?: unknown;
1358
+ };
1359
+ "new"(inner: {
1360
+ message: string;
1361
+ }): {
1362
+ readonly tag: ContractError_Tags.InvalidAttestation;
1363
+ readonly inner: Readonly<{
1364
+ message: string;
1365
+ }>;
1366
+ /**
1367
+ * @private
1368
+ * This field is private and should not be used, use `tag` instead.
1369
+ */
1370
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1371
+ name: string;
1372
+ message: string;
1373
+ stack?: string;
1374
+ cause?: unknown;
1375
+ };
1376
+ instanceOf(obj: any): obj is {
1377
+ readonly tag: ContractError_Tags.InvalidAttestation;
1378
+ readonly inner: Readonly<{
1379
+ message: string;
1380
+ }>;
1381
+ /**
1382
+ * @private
1383
+ * This field is private and should not be used, use `tag` instead.
1384
+ */
1385
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1386
+ name: string;
1387
+ message: string;
1388
+ stack?: string;
1389
+ cause?: unknown;
1390
+ };
1391
+ hasInner(obj: any): obj is {
1392
+ readonly tag: ContractError_Tags.InvalidAttestation;
1393
+ readonly inner: Readonly<{
1394
+ message: string;
1395
+ }>;
1396
+ /**
1397
+ * @private
1398
+ * This field is private and should not be used, use `tag` instead.
1399
+ */
1400
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1401
+ name: string;
1402
+ message: string;
1403
+ stack?: string;
1404
+ cause?: unknown;
1405
+ };
1406
+ getInner(obj: {
1407
+ readonly tag: ContractError_Tags.InvalidAttestation;
1408
+ readonly inner: Readonly<{
1409
+ message: string;
1410
+ }>;
1411
+ /**
1412
+ * @private
1413
+ * This field is private and should not be used, use `tag` instead.
1414
+ */
1415
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1416
+ name: string;
1417
+ message: string;
1418
+ stack?: string;
1419
+ cause?: unknown;
1420
+ }): Readonly<{
1421
+ message: string;
1422
+ }>;
1423
+ isError(error: unknown): error is Error;
1424
+ };
1425
+ NoMatchingOutcome: {
1426
+ new (): {
1427
+ readonly tag: ContractError_Tags.NoMatchingOutcome;
1428
+ /**
1429
+ * @private
1430
+ * This field is private and should not be used, use `tag` instead.
1431
+ */
1432
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1433
+ name: string;
1434
+ message: string;
1435
+ stack?: string;
1436
+ cause?: unknown;
1437
+ };
1438
+ "new"(): {
1439
+ readonly tag: ContractError_Tags.NoMatchingOutcome;
1440
+ /**
1441
+ * @private
1442
+ * This field is private and should not be used, use `tag` instead.
1443
+ */
1444
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1445
+ name: string;
1446
+ message: string;
1447
+ stack?: string;
1448
+ cause?: unknown;
1449
+ };
1450
+ instanceOf(obj: any): obj is {
1451
+ readonly tag: ContractError_Tags.NoMatchingOutcome;
1452
+ /**
1453
+ * @private
1454
+ * This field is private and should not be used, use `tag` instead.
1455
+ */
1456
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1457
+ name: string;
1458
+ message: string;
1459
+ stack?: string;
1460
+ cause?: unknown;
1461
+ };
1462
+ hasInner(obj: any): obj is {
1463
+ readonly tag: ContractError_Tags.NoMatchingOutcome;
1464
+ /**
1465
+ * @private
1466
+ * This field is private and should not be used, use `tag` instead.
1467
+ */
1468
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1469
+ name: string;
1470
+ message: string;
1471
+ stack?: string;
1472
+ cause?: unknown;
1473
+ };
1474
+ isError(error: unknown): error is Error;
1475
+ };
1476
+ Descriptor: {
1477
+ new (inner: {
1478
+ message: string;
1479
+ }): {
1480
+ readonly tag: ContractError_Tags.Descriptor;
1481
+ readonly inner: Readonly<{
1482
+ message: string;
1483
+ }>;
1484
+ /**
1485
+ * @private
1486
+ * This field is private and should not be used, use `tag` instead.
1487
+ */
1488
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1489
+ name: string;
1490
+ message: string;
1491
+ stack?: string;
1492
+ cause?: unknown;
1493
+ };
1494
+ "new"(inner: {
1495
+ message: string;
1496
+ }): {
1497
+ readonly tag: ContractError_Tags.Descriptor;
1498
+ readonly inner: Readonly<{
1499
+ message: string;
1500
+ }>;
1501
+ /**
1502
+ * @private
1503
+ * This field is private and should not be used, use `tag` instead.
1504
+ */
1505
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1506
+ name: string;
1507
+ message: string;
1508
+ stack?: string;
1509
+ cause?: unknown;
1510
+ };
1511
+ instanceOf(obj: any): obj is {
1512
+ readonly tag: ContractError_Tags.Descriptor;
1513
+ readonly inner: Readonly<{
1514
+ message: string;
1515
+ }>;
1516
+ /**
1517
+ * @private
1518
+ * This field is private and should not be used, use `tag` instead.
1519
+ */
1520
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1521
+ name: string;
1522
+ message: string;
1523
+ stack?: string;
1524
+ cause?: unknown;
1525
+ };
1526
+ hasInner(obj: any): obj is {
1527
+ readonly tag: ContractError_Tags.Descriptor;
1528
+ readonly inner: Readonly<{
1529
+ message: string;
1530
+ }>;
1531
+ /**
1532
+ * @private
1533
+ * This field is private and should not be used, use `tag` instead.
1534
+ */
1535
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1536
+ name: string;
1537
+ message: string;
1538
+ stack?: string;
1539
+ cause?: unknown;
1540
+ };
1541
+ getInner(obj: {
1542
+ readonly tag: ContractError_Tags.Descriptor;
1543
+ readonly inner: Readonly<{
1544
+ message: string;
1545
+ }>;
1546
+ /**
1547
+ * @private
1548
+ * This field is private and should not be used, use `tag` instead.
1549
+ */
1550
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1551
+ name: string;
1552
+ message: string;
1553
+ stack?: string;
1554
+ cause?: unknown;
1555
+ }): Readonly<{
1556
+ message: string;
1557
+ }>;
1558
+ isError(error: unknown): error is Error;
1559
+ };
1560
+ Wallet: {
1561
+ new (inner: {
1562
+ message: string;
1563
+ }): {
1564
+ readonly tag: ContractError_Tags.Wallet;
1565
+ readonly inner: Readonly<{
1566
+ message: string;
1567
+ }>;
1568
+ /**
1569
+ * @private
1570
+ * This field is private and should not be used, use `tag` instead.
1571
+ */
1572
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1573
+ name: string;
1574
+ message: string;
1575
+ stack?: string;
1576
+ cause?: unknown;
1577
+ };
1578
+ "new"(inner: {
1579
+ message: string;
1580
+ }): {
1581
+ readonly tag: ContractError_Tags.Wallet;
1582
+ readonly inner: Readonly<{
1583
+ message: string;
1584
+ }>;
1585
+ /**
1586
+ * @private
1587
+ * This field is private and should not be used, use `tag` instead.
1588
+ */
1589
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1590
+ name: string;
1591
+ message: string;
1592
+ stack?: string;
1593
+ cause?: unknown;
1594
+ };
1595
+ instanceOf(obj: any): obj is {
1596
+ readonly tag: ContractError_Tags.Wallet;
1597
+ readonly inner: Readonly<{
1598
+ message: string;
1599
+ }>;
1600
+ /**
1601
+ * @private
1602
+ * This field is private and should not be used, use `tag` instead.
1603
+ */
1604
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1605
+ name: string;
1606
+ message: string;
1607
+ stack?: string;
1608
+ cause?: unknown;
1609
+ };
1610
+ hasInner(obj: any): obj is {
1611
+ readonly tag: ContractError_Tags.Wallet;
1612
+ readonly inner: Readonly<{
1613
+ message: string;
1614
+ }>;
1615
+ /**
1616
+ * @private
1617
+ * This field is private and should not be used, use `tag` instead.
1618
+ */
1619
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1620
+ name: string;
1621
+ message: string;
1622
+ stack?: string;
1623
+ cause?: unknown;
1624
+ };
1625
+ getInner(obj: {
1626
+ readonly tag: ContractError_Tags.Wallet;
1627
+ readonly inner: Readonly<{
1628
+ message: string;
1629
+ }>;
1630
+ /**
1631
+ * @private
1632
+ * This field is private and should not be used, use `tag` instead.
1633
+ */
1634
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1635
+ name: string;
1636
+ message: string;
1637
+ stack?: string;
1638
+ cause?: unknown;
1639
+ }): Readonly<{
1640
+ message: string;
1641
+ }>;
1642
+ isError(error: unknown): error is Error;
1643
+ };
1644
+ Bip32: {
1645
+ new (inner: {
1646
+ message: string;
1647
+ }): {
1648
+ readonly tag: ContractError_Tags.Bip32;
1649
+ readonly inner: Readonly<{
1650
+ message: string;
1651
+ }>;
1652
+ /**
1653
+ * @private
1654
+ * This field is private and should not be used, use `tag` instead.
1655
+ */
1656
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1657
+ name: string;
1658
+ message: string;
1659
+ stack?: string;
1660
+ cause?: unknown;
1661
+ };
1662
+ "new"(inner: {
1663
+ message: string;
1664
+ }): {
1665
+ readonly tag: ContractError_Tags.Bip32;
1666
+ readonly inner: Readonly<{
1667
+ message: string;
1668
+ }>;
1669
+ /**
1670
+ * @private
1671
+ * This field is private and should not be used, use `tag` instead.
1672
+ */
1673
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1674
+ name: string;
1675
+ message: string;
1676
+ stack?: string;
1677
+ cause?: unknown;
1678
+ };
1679
+ instanceOf(obj: any): obj is {
1680
+ readonly tag: ContractError_Tags.Bip32;
1681
+ readonly inner: Readonly<{
1682
+ message: string;
1683
+ }>;
1684
+ /**
1685
+ * @private
1686
+ * This field is private and should not be used, use `tag` instead.
1687
+ */
1688
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1689
+ name: string;
1690
+ message: string;
1691
+ stack?: string;
1692
+ cause?: unknown;
1693
+ };
1694
+ hasInner(obj: any): obj is {
1695
+ readonly tag: ContractError_Tags.Bip32;
1696
+ readonly inner: Readonly<{
1697
+ message: string;
1698
+ }>;
1699
+ /**
1700
+ * @private
1701
+ * This field is private and should not be used, use `tag` instead.
1702
+ */
1703
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1704
+ name: string;
1705
+ message: string;
1706
+ stack?: string;
1707
+ cause?: unknown;
1708
+ };
1709
+ getInner(obj: {
1710
+ readonly tag: ContractError_Tags.Bip32;
1711
+ readonly inner: Readonly<{
1712
+ message: string;
1713
+ }>;
1714
+ /**
1715
+ * @private
1716
+ * This field is private and should not be used, use `tag` instead.
1717
+ */
1718
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1719
+ name: string;
1720
+ message: string;
1721
+ stack?: string;
1722
+ cause?: unknown;
1723
+ }): Readonly<{
1724
+ message: string;
1725
+ }>;
1726
+ isError(error: unknown): error is Error;
1727
+ };
1728
+ Dlc: {
1729
+ new (inner: {
1730
+ message: string;
1731
+ }): {
1732
+ readonly tag: ContractError_Tags.Dlc;
1733
+ readonly inner: Readonly<{
1734
+ message: string;
1735
+ }>;
1736
+ /**
1737
+ * @private
1738
+ * This field is private and should not be used, use `tag` instead.
1739
+ */
1740
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1741
+ name: string;
1742
+ message: string;
1743
+ stack?: string;
1744
+ cause?: unknown;
1745
+ };
1746
+ "new"(inner: {
1747
+ message: string;
1748
+ }): {
1749
+ readonly tag: ContractError_Tags.Dlc;
1750
+ readonly inner: Readonly<{
1751
+ message: string;
1752
+ }>;
1753
+ /**
1754
+ * @private
1755
+ * This field is private and should not be used, use `tag` instead.
1756
+ */
1757
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1758
+ name: string;
1759
+ message: string;
1760
+ stack?: string;
1761
+ cause?: unknown;
1762
+ };
1763
+ instanceOf(obj: any): obj is {
1764
+ readonly tag: ContractError_Tags.Dlc;
1765
+ readonly inner: Readonly<{
1766
+ message: string;
1767
+ }>;
1768
+ /**
1769
+ * @private
1770
+ * This field is private and should not be used, use `tag` instead.
1771
+ */
1772
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1773
+ name: string;
1774
+ message: string;
1775
+ stack?: string;
1776
+ cause?: unknown;
1777
+ };
1778
+ hasInner(obj: any): obj is {
1779
+ readonly tag: ContractError_Tags.Dlc;
1780
+ readonly inner: Readonly<{
1781
+ message: string;
1782
+ }>;
1783
+ /**
1784
+ * @private
1785
+ * This field is private and should not be used, use `tag` instead.
1786
+ */
1787
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1788
+ name: string;
1789
+ message: string;
1790
+ stack?: string;
1791
+ cause?: unknown;
1792
+ };
1793
+ getInner(obj: {
1794
+ readonly tag: ContractError_Tags.Dlc;
1795
+ readonly inner: Readonly<{
1796
+ message: string;
1797
+ }>;
1798
+ /**
1799
+ * @private
1800
+ * This field is private and should not be used, use `tag` instead.
1801
+ */
1802
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1803
+ name: string;
1804
+ message: string;
1805
+ stack?: string;
1806
+ cause?: unknown;
1807
+ }): Readonly<{
1808
+ message: string;
1809
+ }>;
1810
+ isError(error: unknown): error is Error;
1811
+ };
1812
+ Key: {
1813
+ new (inner: {
1814
+ message: string;
1815
+ }): {
1816
+ readonly tag: ContractError_Tags.Key;
1817
+ readonly inner: Readonly<{
1818
+ message: string;
1819
+ }>;
1820
+ /**
1821
+ * @private
1822
+ * This field is private and should not be used, use `tag` instead.
1823
+ */
1824
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1825
+ name: string;
1826
+ message: string;
1827
+ stack?: string;
1828
+ cause?: unknown;
1829
+ };
1830
+ "new"(inner: {
1831
+ message: string;
1832
+ }): {
1833
+ readonly tag: ContractError_Tags.Key;
1834
+ readonly inner: Readonly<{
1835
+ message: string;
1836
+ }>;
1837
+ /**
1838
+ * @private
1839
+ * This field is private and should not be used, use `tag` instead.
1840
+ */
1841
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1842
+ name: string;
1843
+ message: string;
1844
+ stack?: string;
1845
+ cause?: unknown;
1846
+ };
1847
+ instanceOf(obj: any): obj is {
1848
+ readonly tag: ContractError_Tags.Key;
1849
+ readonly inner: Readonly<{
1850
+ message: string;
1851
+ }>;
1852
+ /**
1853
+ * @private
1854
+ * This field is private and should not be used, use `tag` instead.
1855
+ */
1856
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1857
+ name: string;
1858
+ message: string;
1859
+ stack?: string;
1860
+ cause?: unknown;
1861
+ };
1862
+ hasInner(obj: any): obj is {
1863
+ readonly tag: ContractError_Tags.Key;
1864
+ readonly inner: Readonly<{
1865
+ message: string;
1866
+ }>;
1867
+ /**
1868
+ * @private
1869
+ * This field is private and should not be used, use `tag` instead.
1870
+ */
1871
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1872
+ name: string;
1873
+ message: string;
1874
+ stack?: string;
1875
+ cause?: unknown;
1876
+ };
1877
+ getInner(obj: {
1878
+ readonly tag: ContractError_Tags.Key;
1879
+ readonly inner: Readonly<{
1880
+ message: string;
1881
+ }>;
1882
+ /**
1883
+ * @private
1884
+ * This field is private and should not be used, use `tag` instead.
1885
+ */
1886
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1887
+ name: string;
1888
+ message: string;
1889
+ stack?: string;
1890
+ cause?: unknown;
1891
+ }): Readonly<{
1892
+ message: string;
1893
+ }>;
1894
+ isError(error: unknown): error is Error;
1895
+ };
1896
+ Serialization: {
1897
+ new (inner: {
1898
+ message: string;
1899
+ }): {
1900
+ readonly tag: ContractError_Tags.Serialization;
1901
+ readonly inner: Readonly<{
1902
+ message: string;
1903
+ }>;
1904
+ /**
1905
+ * @private
1906
+ * This field is private and should not be used, use `tag` instead.
1907
+ */
1908
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1909
+ name: string;
1910
+ message: string;
1911
+ stack?: string;
1912
+ cause?: unknown;
1913
+ };
1914
+ "new"(inner: {
1915
+ message: string;
1916
+ }): {
1917
+ readonly tag: ContractError_Tags.Serialization;
1918
+ readonly inner: Readonly<{
1919
+ message: string;
1920
+ }>;
1921
+ /**
1922
+ * @private
1923
+ * This field is private and should not be used, use `tag` instead.
1924
+ */
1925
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1926
+ name: string;
1927
+ message: string;
1928
+ stack?: string;
1929
+ cause?: unknown;
1930
+ };
1931
+ instanceOf(obj: any): obj is {
1932
+ readonly tag: ContractError_Tags.Serialization;
1933
+ readonly inner: Readonly<{
1934
+ message: string;
1935
+ }>;
1936
+ /**
1937
+ * @private
1938
+ * This field is private and should not be used, use `tag` instead.
1939
+ */
1940
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1941
+ name: string;
1942
+ message: string;
1943
+ stack?: string;
1944
+ cause?: unknown;
1945
+ };
1946
+ hasInner(obj: any): obj is {
1947
+ readonly tag: ContractError_Tags.Serialization;
1948
+ readonly inner: Readonly<{
1949
+ message: string;
1950
+ }>;
1951
+ /**
1952
+ * @private
1953
+ * This field is private and should not be used, use `tag` instead.
1954
+ */
1955
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1956
+ name: string;
1957
+ message: string;
1958
+ stack?: string;
1959
+ cause?: unknown;
1960
+ };
1961
+ getInner(obj: {
1962
+ readonly tag: ContractError_Tags.Serialization;
1963
+ readonly inner: Readonly<{
1964
+ message: string;
1965
+ }>;
1966
+ /**
1967
+ * @private
1968
+ * This field is private and should not be used, use `tag` instead.
1969
+ */
1970
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1971
+ name: string;
1972
+ message: string;
1973
+ stack?: string;
1974
+ cause?: unknown;
1975
+ }): Readonly<{
1976
+ message: string;
1977
+ }>;
1978
+ isError(error: unknown): error is Error;
1979
+ };
1980
+ InvalidNetwork: {
1981
+ new (inner: {
1982
+ message: string;
1983
+ }): {
1984
+ readonly tag: ContractError_Tags.InvalidNetwork;
1985
+ readonly inner: Readonly<{
1986
+ message: string;
1987
+ }>;
1988
+ /**
1989
+ * @private
1990
+ * This field is private and should not be used, use `tag` instead.
1991
+ */
1992
+ readonly [uniffiTypeNameSymbol]: "ContractError";
1993
+ name: string;
1994
+ message: string;
1995
+ stack?: string;
1996
+ cause?: unknown;
1997
+ };
1998
+ "new"(inner: {
1999
+ message: string;
2000
+ }): {
2001
+ readonly tag: ContractError_Tags.InvalidNetwork;
2002
+ readonly inner: Readonly<{
2003
+ message: string;
2004
+ }>;
2005
+ /**
2006
+ * @private
2007
+ * This field is private and should not be used, use `tag` instead.
2008
+ */
2009
+ readonly [uniffiTypeNameSymbol]: "ContractError";
2010
+ name: string;
2011
+ message: string;
2012
+ stack?: string;
2013
+ cause?: unknown;
2014
+ };
2015
+ instanceOf(obj: any): obj is {
2016
+ readonly tag: ContractError_Tags.InvalidNetwork;
2017
+ readonly inner: Readonly<{
2018
+ message: string;
2019
+ }>;
2020
+ /**
2021
+ * @private
2022
+ * This field is private and should not be used, use `tag` instead.
2023
+ */
2024
+ readonly [uniffiTypeNameSymbol]: "ContractError";
2025
+ name: string;
2026
+ message: string;
2027
+ stack?: string;
2028
+ cause?: unknown;
2029
+ };
2030
+ hasInner(obj: any): obj is {
2031
+ readonly tag: ContractError_Tags.InvalidNetwork;
2032
+ readonly inner: Readonly<{
2033
+ message: string;
2034
+ }>;
2035
+ /**
2036
+ * @private
2037
+ * This field is private and should not be used, use `tag` instead.
2038
+ */
2039
+ readonly [uniffiTypeNameSymbol]: "ContractError";
2040
+ name: string;
2041
+ message: string;
2042
+ stack?: string;
2043
+ cause?: unknown;
2044
+ };
2045
+ getInner(obj: {
2046
+ readonly tag: ContractError_Tags.InvalidNetwork;
2047
+ readonly inner: Readonly<{
2048
+ message: string;
2049
+ }>;
2050
+ /**
2051
+ * @private
2052
+ * This field is private and should not be used, use `tag` instead.
2053
+ */
2054
+ readonly [uniffiTypeNameSymbol]: "ContractError";
2055
+ name: string;
2056
+ message: string;
2057
+ stack?: string;
2058
+ cause?: unknown;
2059
+ }): Readonly<{
2060
+ message: string;
2061
+ }>;
2062
+ isError(error: unknown): error is Error;
2063
+ };
2064
+ InvalidLength: {
2065
+ new (inner: {
2066
+ field: string;
2067
+ expected: number;
2068
+ actual: number;
2069
+ }): {
2070
+ readonly tag: ContractError_Tags.InvalidLength;
2071
+ readonly inner: Readonly<{
2072
+ field: string;
2073
+ expected: number;
2074
+ actual: number;
2075
+ }>;
2076
+ /**
2077
+ * @private
2078
+ * This field is private and should not be used, use `tag` instead.
2079
+ */
2080
+ readonly [uniffiTypeNameSymbol]: "ContractError";
2081
+ name: string;
2082
+ message: string;
2083
+ stack?: string;
2084
+ cause?: unknown;
2085
+ };
2086
+ "new"(inner: {
2087
+ field: string;
2088
+ expected: number;
2089
+ actual: number;
2090
+ }): {
2091
+ readonly tag: ContractError_Tags.InvalidLength;
2092
+ readonly inner: Readonly<{
2093
+ field: string;
2094
+ expected: number;
2095
+ actual: number;
2096
+ }>;
2097
+ /**
2098
+ * @private
2099
+ * This field is private and should not be used, use `tag` instead.
2100
+ */
2101
+ readonly [uniffiTypeNameSymbol]: "ContractError";
2102
+ name: string;
2103
+ message: string;
2104
+ stack?: string;
2105
+ cause?: unknown;
2106
+ };
2107
+ instanceOf(obj: any): obj is {
2108
+ readonly tag: ContractError_Tags.InvalidLength;
2109
+ readonly inner: Readonly<{
2110
+ field: string;
2111
+ expected: number;
2112
+ actual: number;
2113
+ }>;
2114
+ /**
2115
+ * @private
2116
+ * This field is private and should not be used, use `tag` instead.
2117
+ */
2118
+ readonly [uniffiTypeNameSymbol]: "ContractError";
2119
+ name: string;
2120
+ message: string;
2121
+ stack?: string;
2122
+ cause?: unknown;
2123
+ };
2124
+ hasInner(obj: any): obj is {
2125
+ readonly tag: ContractError_Tags.InvalidLength;
2126
+ readonly inner: Readonly<{
2127
+ field: string;
2128
+ expected: number;
2129
+ actual: number;
2130
+ }>;
2131
+ /**
2132
+ * @private
2133
+ * This field is private and should not be used, use `tag` instead.
2134
+ */
2135
+ readonly [uniffiTypeNameSymbol]: "ContractError";
2136
+ name: string;
2137
+ message: string;
2138
+ stack?: string;
2139
+ cause?: unknown;
2140
+ };
2141
+ getInner(obj: {
2142
+ readonly tag: ContractError_Tags.InvalidLength;
2143
+ readonly inner: Readonly<{
2144
+ field: string;
2145
+ expected: number;
2146
+ actual: number;
2147
+ }>;
2148
+ /**
2149
+ * @private
2150
+ * This field is private and should not be used, use `tag` instead.
2151
+ */
2152
+ readonly [uniffiTypeNameSymbol]: "ContractError";
2153
+ name: string;
2154
+ message: string;
2155
+ stack?: string;
2156
+ cause?: unknown;
2157
+ }): Readonly<{
2158
+ field: string;
2159
+ expected: number;
2160
+ actual: number;
2161
+ }>;
2162
+ isError(error: unknown): error is Error;
2163
+ };
77
2164
  }>;
78
2165
  /**
79
- * Debug info for CET adaptor signature inputs.
80
- *
81
- * Contains all the values that go into creating an adaptor signature,
82
- * useful for comparing with external signers during debugging.
2166
+ * Errors returned by the stateless contract API.
83
2167
  *
84
- * This struct is intentionally always available (not feature-gated)
85
- * to support production debugging scenarios.
86
- */
87
- export type CetAdaptorSignatureDebugInfo = {
88
- /**
89
- * The sighash (32 bytes) - this is the message that gets signed
90
- */
91
- sighash: ArrayBuffer;
92
- /**
93
- * The adaptor point (33 bytes compressed public key)
94
- */
95
- adaptorPoint: ArrayBuffer;
96
- /**
97
- * Input index (always 0 for CETs)
98
- */
99
- inputIndex: number;
100
- /**
101
- * The funding script pubkey used for sighash
102
- */
103
- scriptPubkey: ArrayBuffer;
104
- /**
105
- * The fund output value used for sighash
106
- */
107
- value: bigint;
108
- /**
109
- * The CET txid
110
- */
111
- cetTxid: string;
112
- /**
113
- * Raw CET bytes for verification
114
- */
115
- cetRaw: ArrayBuffer;
116
- };
117
- /**
118
- * Generated factory for {@link CetAdaptorSignatureDebugInfo} record objects.
119
- */
120
- export declare const CetAdaptorSignatureDebugInfo: Readonly<{
121
- create: (partial: Partial<CetAdaptorSignatureDebugInfo> & Required<Omit<CetAdaptorSignatureDebugInfo, never>>) => CetAdaptorSignatureDebugInfo;
122
- new: (partial: Partial<CetAdaptorSignatureDebugInfo> & Required<Omit<CetAdaptorSignatureDebugInfo, never>>) => CetAdaptorSignatureDebugInfo;
123
- defaults: () => Partial<CetAdaptorSignatureDebugInfo>;
124
- }>;
125
- export type TxOutput = {
126
- value: bigint;
127
- scriptPubkey: ArrayBuffer;
128
- };
129
- /**
130
- * Generated factory for {@link TxOutput} record objects.
131
- */
132
- export declare const TxOutput: Readonly<{
133
- create: (partial: Partial<TxOutput> & Required<Omit<TxOutput, never>>) => TxOutput;
134
- new: (partial: Partial<TxOutput> & Required<Omit<TxOutput, never>>) => TxOutput;
135
- defaults: () => Partial<TxOutput>;
136
- isDust(self_: TxOutput): boolean;
137
- }>;
138
- export type ChangeOutputAndFees = {
139
- changeOutput: TxOutput;
140
- fundFee: bigint;
141
- cetFee: bigint;
142
- };
143
- /**
144
- * Generated factory for {@link ChangeOutputAndFees} record objects.
145
- */
146
- export declare const ChangeOutputAndFees: Readonly<{
147
- create: (partial: Partial<ChangeOutputAndFees> & Required<Omit<ChangeOutputAndFees, never>>) => ChangeOutputAndFees;
148
- new: (partial: Partial<ChangeOutputAndFees> & Required<Omit<ChangeOutputAndFees, never>>) => ChangeOutputAndFees;
149
- defaults: () => Partial<ChangeOutputAndFees>;
150
- }>;
151
- export type TxInput = {
152
- txid: string;
153
- vout: number;
154
- scriptSig: ArrayBuffer;
155
- sequence: number;
156
- witness: Array<ArrayBuffer>;
157
- };
158
- /**
159
- * Generated factory for {@link TxInput} record objects.
160
- */
161
- export declare const TxInput: Readonly<{
162
- create: (partial: Partial<TxInput> & Required<Omit<TxInput, never>>) => TxInput;
163
- new: (partial: Partial<TxInput> & Required<Omit<TxInput, never>>) => TxInput;
164
- defaults: () => Partial<TxInput>;
165
- }>;
166
- export type Transaction = {
167
- version: number;
168
- lockTime: number;
169
- inputs: Array<TxInput>;
170
- outputs: Array<TxOutput>;
171
- rawBytes: ArrayBuffer;
172
- };
173
- /**
174
- * Generated factory for {@link Transaction} record objects.
175
- */
176
- export declare const Transaction: Readonly<{
177
- create: (partial: Partial<Transaction> & Required<Omit<Transaction, never>>) => Transaction;
178
- new: (partial: Partial<Transaction> & Required<Omit<Transaction, never>>) => Transaction;
179
- defaults: () => Partial<Transaction>;
180
- addSignature(self_: Transaction, signature: ArrayBuffer, pubkey: ArrayBuffer, inputIndex: number): Transaction;
181
- cetAdaptorSignatureFromOracleInfo(self_: Transaction, oracleInfo: OracleInfo, fundingSk: ArrayBuffer, fundingScriptPubkey: ArrayBuffer, totalCollateral: bigint, msgs: Array<ArrayBuffer>): AdaptorSignature;
182
- cetAdaptorSignatureInputs(self_: Transaction, oracleInfo: Array<OracleInfo>, fundingScriptPubkey: ArrayBuffer, fundOutputValue: bigint, msgs: Array<Array<ArrayBuffer>>): CetAdaptorSignatureDebugInfo;
183
- cetSighash(self_: Transaction, fundingScriptPubkey: ArrayBuffer, fundOutputValue: bigint): ArrayBuffer;
184
- rawFundingInputSignature(self_: Transaction, privkey: ArrayBuffer, prevTxId: string, prevTxVout: number, value: bigint): ArrayBuffer;
185
- signCet(self_: Transaction, adaptorSignature: ArrayBuffer, oracleSignatures: Array<ArrayBuffer>, fundingSecretKey: ArrayBuffer, otherPubkey: ArrayBuffer, fundingScriptPubkey: ArrayBuffer, fundOutputValue: bigint): Transaction;
186
- signFundInput(self_: Transaction, privkey: ArrayBuffer, prevTxId: string, prevTxVout: number, value: bigint): Transaction;
187
- signMultiSigInput(self_: Transaction, dlcInput: DlcInputInfo, localPrivkey: ArrayBuffer, remoteSignature: ArrayBuffer): Transaction;
188
- verifyFundSignature(self_: Transaction, signature: ArrayBuffer, pubkey: ArrayBuffer, txid: string, vout: number, inputAmount: bigint): boolean;
189
- }>;
190
- export type DlcInputInfo = {
191
- fundTx: Transaction;
192
- fundVout: number;
193
- localFundPubkey: ArrayBuffer;
194
- remoteFundPubkey: ArrayBuffer;
195
- fundAmount: bigint;
196
- maxWitnessLen: number;
197
- inputSerialId: bigint;
198
- contractId: ArrayBuffer;
199
- };
200
- /**
201
- * Generated factory for {@link DlcInputInfo} record objects.
202
- */
203
- export declare const DlcInputInfo: Readonly<{
204
- create: (partial: Partial<DlcInputInfo> & Required<Omit<DlcInputInfo, never>>) => DlcInputInfo;
205
- new: (partial: Partial<DlcInputInfo> & Required<Omit<DlcInputInfo, never>>) => DlcInputInfo;
206
- defaults: () => Partial<DlcInputInfo>;
207
- }>;
208
- export type DlcTransactions = {
209
- fund: Transaction;
210
- cets: Array<Transaction>;
211
- refund: Transaction;
212
- fundingScriptPubkey: ArrayBuffer;
213
- };
214
- /**
215
- * Generated factory for {@link DlcTransactions} record objects.
216
- */
217
- export declare const DlcTransactions: Readonly<{
218
- create: (partial: Partial<DlcTransactions> & Required<Omit<DlcTransactions, never>>) => DlcTransactions;
219
- new: (partial: Partial<DlcTransactions> & Required<Omit<DlcTransactions, never>>) => DlcTransactions;
220
- defaults: () => Partial<DlcTransactions>;
221
- }>;
222
- export type OracleInfo = {
223
- publicKey: ArrayBuffer;
224
- nonces: Array<ArrayBuffer>;
225
- };
226
- /**
227
- * Generated factory for {@link OracleInfo} record objects.
228
- */
229
- export declare const OracleInfo: Readonly<{
230
- create: (partial: Partial<OracleInfo> & Required<Omit<OracleInfo, never>>) => OracleInfo;
231
- new: (partial: Partial<OracleInfo> & Required<Omit<OracleInfo, never>>) => OracleInfo;
232
- defaults: () => Partial<OracleInfo>;
233
- }>;
234
- export type TxInputInfo = {
235
- txid: string;
236
- vout: number;
237
- scriptSig: ArrayBuffer;
238
- maxWitnessLength: number;
239
- serialId: bigint;
240
- };
241
- /**
242
- * Generated factory for {@link TxInputInfo} record objects.
243
- */
244
- export declare const TxInputInfo: Readonly<{
245
- create: (partial: Partial<TxInputInfo> & Required<Omit<TxInputInfo, never>>) => TxInputInfo;
246
- new: (partial: Partial<TxInputInfo> & Required<Omit<TxInputInfo, never>>) => TxInputInfo;
247
- defaults: () => Partial<TxInputInfo>;
248
- }>;
249
- export type PartyParams = {
250
- fundPubkey: ArrayBuffer;
251
- changeScriptPubkey: ArrayBuffer;
252
- changeSerialId: bigint;
253
- payoutScriptPubkey: ArrayBuffer;
254
- payoutSerialId: bigint;
255
- inputs: Array<TxInputInfo>;
256
- inputAmount: bigint;
257
- collateral: bigint;
258
- dlcInputs: Array<DlcInputInfo>;
259
- };
260
- /**
261
- * Generated factory for {@link PartyParams} record objects.
262
- */
263
- export declare const PartyParams: Readonly<{
264
- create: (partial: Partial<PartyParams> & Required<Omit<PartyParams, never>>) => PartyParams;
265
- new: (partial: Partial<PartyParams> & Required<Omit<PartyParams, never>>) => PartyParams;
266
- defaults: () => Partial<PartyParams>;
267
- changeOutputAndFees(self_: PartyParams, feeRate: bigint): ChangeOutputAndFees;
268
- }>;
269
- export type Payout = {
270
- offer: bigint;
271
- accept: bigint;
272
- };
273
- /**
274
- * Generated factory for {@link Payout} record objects.
2168
+ * Mirrors [`ddk::contract::ContractError`] as a uniffi error so the typed
2169
+ * variants survive across the binding boundary. Variants carry plain strings.
275
2170
  */
276
- export declare const Payout: Readonly<{
277
- create: (partial: Partial<Payout> & Required<Omit<Payout, never>>) => Payout;
278
- new: (partial: Partial<Payout> & Required<Omit<Payout, never>>) => Payout;
279
- defaults: () => Partial<Payout>;
280
- }>;
2171
+ export type ContractError = InstanceType<(typeof ContractError)['InvalidOffer' | 'InvalidAccept' | 'InvalidSign' | 'InvalidFundingInput' | 'PsbtMismatch' | 'MissingFinalizedInput' | 'UnsupportedScriptType' | 'InvalidAttestation' | 'NoMatchingOutcome' | 'Descriptor' | 'Wallet' | 'Bip32' | 'Dlc' | 'Key' | 'Serialization' | 'InvalidNetwork' | 'InvalidLength']>;
281
2172
  export declare enum ExtendedKey {
282
2173
  InvalidMnemonic = 0,
283
2174
  InvalidXpriv = 1,
@@ -909,6 +2800,80 @@ export declare const DlcError: Readonly<{
909
2800
  };
910
2801
  }>;
911
2802
  export type DlcError = InstanceType<(typeof DlcError)['InvalidSignature' | 'InvalidPublicKey' | 'InvalidTransaction' | 'InsufficientFunds' | 'InvalidArgument' | 'SerializationError' | 'Secp256k1Error' | 'MiniscriptError' | 'InvalidNetwork' | 'KeyError']>;
2803
+ /**
2804
+ * Identifies which party's funding inputs an operation applies to.
2805
+ */
2806
+ export declare enum Party {
2807
+ /**
2808
+ * The party that created the offer.
2809
+ */
2810
+ Offer = 0,
2811
+ /**
2812
+ * The party that accepted the offer.
2813
+ */
2814
+ Accept = 1
2815
+ }
2816
+ /**
2817
+ * Deterministically derives DLC contract funding keys from a master extended
2818
+ * private key. Secret keys never leave this object.
2819
+ *
2820
+ * Construct one from whatever key material the consumer holds, then call
2821
+ * [`ContractKeyProvider::funding_pubkey`] to obtain the public key to publish
2822
+ * in an offer/accept message.
2823
+ */
2824
+ export interface ContractKeyProviderLike {
2825
+ /**
2826
+ * The 33-byte compressed funding public key for a contract, from its
2827
+ * 32-byte temporary id. Publish this in the offer or accept message.
2828
+ */
2829
+ fundingPubkey(temporaryContractId: Uint8Array): Uint8Array;
2830
+ }
2831
+ /**
2832
+ * @deprecated Use `ContractKeyProviderLike` instead.
2833
+ */
2834
+ export type ContractKeyProviderInterface = ContractKeyProviderLike;
2835
+ /**
2836
+ * Deterministically derives DLC contract funding keys from a master extended
2837
+ * private key. Secret keys never leave this object.
2838
+ *
2839
+ * Construct one from whatever key material the consumer holds, then call
2840
+ * [`ContractKeyProvider::funding_pubkey`] to obtain the public key to publish
2841
+ * in an offer/accept message.
2842
+ */
2843
+ export declare class ContractKeyProvider extends UniffiAbstractObject implements ContractKeyProviderLike {
2844
+ readonly [uniffiTypeNameSymbol] = "ContractKeyProvider";
2845
+ readonly [destructorGuardSymbol]: UniffiGcObject;
2846
+ readonly [pointerLiteralSymbol]: UniffiHandle;
2847
+ private constructor();
2848
+ /**
2849
+ * Builds a provider from an output descriptor that carries an extended
2850
+ * private key (e.g. `wpkh(xprv.../84h/1h/0h/0/*)`). Watch-only descriptors
2851
+ * are rejected; the descriptor's own path/wildcard is not applied to
2852
+ * contract-key derivation.
2853
+ */
2854
+ static fromDescriptor(descriptor: string): ContractKeyProviderLike;
2855
+ /**
2856
+ * Builds a provider from a BIP39 mnemonic (with optional passphrase).
2857
+ */
2858
+ static fromMnemonic(mnemonic: string, passphrase: string | undefined, network: string): ContractKeyProviderLike;
2859
+ /**
2860
+ * Builds a provider from a raw seed (for example the 64 bytes produced by
2861
+ * `convert_mnemonic_to_seed`).
2862
+ */
2863
+ static fromSeed(seed: Uint8Array, network: string): ContractKeyProviderLike;
2864
+ /**
2865
+ * Builds a provider from a 78-byte encoded master extended private key
2866
+ * (the encoding produced by `create_extkey_from_seed`).
2867
+ */
2868
+ static fromXprv(xprv: Uint8Array): ContractKeyProviderLike;
2869
+ /**
2870
+ * The 33-byte compressed funding public key for a contract, from its
2871
+ * 32-byte temporary id. Publish this in the offer or accept message.
2872
+ */
2873
+ fundingPubkey(temporaryContractId: Uint8Array): Uint8Array;
2874
+ uniffiDestroy(): void;
2875
+ static instanceOf(obj_: any): obj_ is ContractKeyProvider;
2876
+ }
912
2877
  /**
913
2878
  * This should be called before anything else.
914
2879
  *
@@ -923,6 +2888,20 @@ declare function uniffiEnsureInitialized(): void;
923
2888
  declare const _default: Readonly<{
924
2889
  initialize: typeof uniffiEnsureInitialized;
925
2890
  converters: {
2891
+ FfiConverterTypeAcceptOfferParams: {
2892
+ read(from: RustBuffer): AcceptOfferParams;
2893
+ write(value: AcceptOfferParams, into: RustBuffer): void;
2894
+ allocationSize(value: AcceptOfferParams): number;
2895
+ lift(value: UniffiByteArray): AcceptOfferParams;
2896
+ lower(value: AcceptOfferParams, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
2897
+ };
2898
+ FfiConverterTypeAcceptResult: {
2899
+ read(from: RustBuffer): AcceptResult;
2900
+ write(value: AcceptResult, into: RustBuffer): void;
2901
+ allocationSize(value: AcceptResult): number;
2902
+ lift(value: UniffiByteArray): AcceptResult;
2903
+ lower(value: AcceptResult, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
2904
+ };
926
2905
  FfiConverterTypeAdaptorSignature: {
927
2906
  read(from: RustBuffer): AdaptorSignature;
928
2907
  write(value: AdaptorSignature, into: RustBuffer): void;
@@ -944,6 +2923,35 @@ declare const _default: Readonly<{
944
2923
  lift(value: UniffiByteArray): ChangeOutputAndFees;
945
2924
  lower(value: ChangeOutputAndFees, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
946
2925
  };
2926
+ FfiConverterTypeContractError: {
2927
+ read(from: RustBuffer): ContractError;
2928
+ write(value: ContractError, into: RustBuffer): void;
2929
+ allocationSize(value: ContractError): number;
2930
+ lift(value: UniffiByteArray): ContractError;
2931
+ lower(value: ContractError, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
2932
+ };
2933
+ FfiConverterTypeContractKeyProvider: FfiConverterObject<ContractKeyProviderLike>;
2934
+ FfiConverterTypeContractPartyParams: {
2935
+ read(from: RustBuffer): ContractPartyParams;
2936
+ write(value: ContractPartyParams, into: RustBuffer): void;
2937
+ allocationSize(value: ContractPartyParams): number;
2938
+ lift(value: UniffiByteArray): ContractPartyParams;
2939
+ lower(value: ContractPartyParams, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
2940
+ };
2941
+ FfiConverterTypeContractPayouts: {
2942
+ read(from: RustBuffer): ContractPayouts;
2943
+ write(value: ContractPayouts, into: RustBuffer): void;
2944
+ allocationSize(value: ContractPayouts): number;
2945
+ lift(value: UniffiByteArray): ContractPayouts;
2946
+ lower(value: ContractPayouts, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
2947
+ };
2948
+ FfiConverterTypeCreateOfferParams: {
2949
+ read(from: RustBuffer): CreateOfferParams;
2950
+ write(value: CreateOfferParams, into: RustBuffer): void;
2951
+ allocationSize(value: CreateOfferParams): number;
2952
+ lift(value: UniffiByteArray): CreateOfferParams;
2953
+ lower(value: CreateOfferParams, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
2954
+ };
947
2955
  FfiConverterTypeDLCError: {
948
2956
  read(from: RustBuffer): DlcError;
949
2957
  write(value: DlcError, into: RustBuffer): void;
@@ -951,6 +2959,13 @@ declare const _default: Readonly<{
951
2959
  lift(value: UniffiByteArray): DlcError;
952
2960
  lower(value: DlcError, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
953
2961
  };
2962
+ FfiConverterTypeDescriptorInput: {
2963
+ read(from: RustBuffer): DescriptorInput;
2964
+ write(value: DescriptorInput, into: RustBuffer): void;
2965
+ allocationSize(value: DescriptorInput): number;
2966
+ lift(value: UniffiByteArray): DescriptorInput;
2967
+ lower(value: DescriptorInput, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
2968
+ };
954
2969
  FfiConverterTypeDlcInputInfo: {
955
2970
  read(from: RustBuffer): DlcInputInfo;
956
2971
  write(value: DlcInputInfo, into: RustBuffer): void;
@@ -972,6 +2987,13 @@ declare const _default: Readonly<{
972
2987
  lift(value: UniffiByteArray): ExtendedKey;
973
2988
  lower(value: ExtendedKey, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
974
2989
  };
2990
+ FfiConverterTypeOracleAttestationRef: {
2991
+ read(from: RustBuffer): OracleAttestationRef;
2992
+ write(value: OracleAttestationRef, into: RustBuffer): void;
2993
+ allocationSize(value: OracleAttestationRef): number;
2994
+ lift(value: UniffiByteArray): OracleAttestationRef;
2995
+ lower(value: OracleAttestationRef, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
2996
+ };
975
2997
  FfiConverterTypeOracleInfo: {
976
2998
  read(from: RustBuffer): OracleInfo;
977
2999
  write(value: OracleInfo, into: RustBuffer): void;
@@ -979,6 +3001,13 @@ declare const _default: Readonly<{
979
3001
  lift(value: UniffiByteArray): OracleInfo;
980
3002
  lower(value: OracleInfo, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
981
3003
  };
3004
+ FfiConverterTypeParty: {
3005
+ read(from: RustBuffer): Party;
3006
+ write(value: Party, into: RustBuffer): void;
3007
+ allocationSize(value: Party): number;
3008
+ lift(value: UniffiByteArray): Party;
3009
+ lower(value: Party, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
3010
+ };
982
3011
  FfiConverterTypePartyParams: {
983
3012
  read(from: RustBuffer): PartyParams;
984
3013
  write(value: PartyParams, into: RustBuffer): void;
@@ -993,6 +3022,27 @@ declare const _default: Readonly<{
993
3022
  lift(value: UniffiByteArray): Payout;
994
3023
  lower(value: Payout, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
995
3024
  };
3025
+ FfiConverterTypePayoutRow: {
3026
+ read(from: RustBuffer): PayoutRow;
3027
+ write(value: PayoutRow, into: RustBuffer): void;
3028
+ allocationSize(value: PayoutRow): number;
3029
+ lift(value: UniffiByteArray): PayoutRow;
3030
+ lower(value: PayoutRow, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
3031
+ };
3032
+ FfiConverterTypeSignResult: {
3033
+ read(from: RustBuffer): SignResult;
3034
+ write(value: SignResult, into: RustBuffer): void;
3035
+ allocationSize(value: SignResult): number;
3036
+ lift(value: UniffiByteArray): SignResult;
3037
+ lower(value: SignResult, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
3038
+ };
3039
+ FfiConverterTypeSpliceKeyRef: {
3040
+ read(from: RustBuffer): SpliceKeyRef;
3041
+ write(value: SpliceKeyRef, into: RustBuffer): void;
3042
+ allocationSize(value: SpliceKeyRef): number;
3043
+ lift(value: UniffiByteArray): SpliceKeyRef;
3044
+ lower(value: SpliceKeyRef, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
3045
+ };
996
3046
  FfiConverterTypeTransaction: {
997
3047
  read(from: RustBuffer): Transaction;
998
3048
  write(value: Transaction, into: RustBuffer): void;