@bennyblader/ddk-rn 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/DdkRn.podspec +44 -0
  2. package/LICENSE +20 -0
  3. package/README.md +33 -0
  4. package/android/CMakeLists.txt +76 -0
  5. package/android/build.gradle +144 -0
  6. package/android/cpp-adapter.cpp +63 -0
  7. package/android/gradle.properties +5 -0
  8. package/android/proguard-rules.pro +4 -0
  9. package/android/src/main/AndroidManifest.xml +5 -0
  10. package/android/src/main/AndroidManifestNew.xml +2 -0
  11. package/android/src/main/java/com/ddkrn/DdkRnModule.kt +43 -0
  12. package/android/src/main/java/com/ddkrn/DdkRnPackage.kt +34 -0
  13. package/cpp/bennyblader-ddk-rn.cpp +16 -0
  14. package/cpp/bennyblader-ddk-rn.h +15 -0
  15. package/cpp/ddk_ffi.cpp +2557 -0
  16. package/cpp/ddk_ffi.hpp +78 -0
  17. package/ios/DdkRn.h +16 -0
  18. package/ios/DdkRn.mm +66 -0
  19. package/lib/commonjs/NativeDdkRn.js +10 -0
  20. package/lib/commonjs/NativeDdkRn.js.map +1 -0
  21. package/lib/commonjs/ddk_ffi-ffi.js +44 -0
  22. package/lib/commonjs/ddk_ffi-ffi.js.map +1 -0
  23. package/lib/commonjs/ddk_ffi.js +1072 -0
  24. package/lib/commonjs/ddk_ffi.js.map +1 -0
  25. package/lib/commonjs/index.js +63 -0
  26. package/lib/commonjs/index.js.map +1 -0
  27. package/lib/commonjs/package.json +1 -0
  28. package/lib/module/NativeDdkRn.js +7 -0
  29. package/lib/module/NativeDdkRn.js.map +1 -0
  30. package/lib/module/ddk_ffi-ffi.js +43 -0
  31. package/lib/module/ddk_ffi-ffi.js.map +1 -0
  32. package/lib/module/ddk_ffi.js +1052 -0
  33. package/lib/module/ddk_ffi.js.map +1 -0
  34. package/lib/module/index.js +43 -0
  35. package/lib/module/index.js.map +1 -0
  36. package/lib/module/package.json +1 -0
  37. package/lib/typescript/commonjs/package.json +1 -0
  38. package/lib/typescript/commonjs/src/NativeDdkRn.d.ts +8 -0
  39. package/lib/typescript/commonjs/src/NativeDdkRn.d.ts.map +1 -0
  40. package/lib/typescript/commonjs/src/ddk_ffi-ffi.d.ts +108 -0
  41. package/lib/typescript/commonjs/src/ddk_ffi-ffi.d.ts.map +1 -0
  42. package/lib/typescript/commonjs/src/ddk_ffi.d.ts +773 -0
  43. package/lib/typescript/commonjs/src/ddk_ffi.d.ts.map +1 -0
  44. package/lib/typescript/commonjs/src/index.d.ts +8 -0
  45. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  46. package/lib/typescript/module/package.json +1 -0
  47. package/lib/typescript/module/src/NativeDdkRn.d.ts +8 -0
  48. package/lib/typescript/module/src/NativeDdkRn.d.ts.map +1 -0
  49. package/lib/typescript/module/src/ddk_ffi-ffi.d.ts +108 -0
  50. package/lib/typescript/module/src/ddk_ffi-ffi.d.ts.map +1 -0
  51. package/lib/typescript/module/src/ddk_ffi.d.ts +773 -0
  52. package/lib/typescript/module/src/ddk_ffi.d.ts.map +1 -0
  53. package/lib/typescript/module/src/index.d.ts +8 -0
  54. package/lib/typescript/module/src/index.d.ts.map +1 -0
  55. package/package.json +206 -0
  56. package/scripts/postinstall.js +130 -0
  57. package/src/NativeDdkRn.ts +10 -0
  58. package/src/ddk_ffi-ffi.ts +307 -0
  59. package/src/ddk_ffi.ts +1743 -0
  60. package/src/index.tsx +41 -0
@@ -0,0 +1,773 @@
1
+ import { type UniffiByteArray, RustBuffer, uniffiTypeNameSymbol, variantOrdinalSymbol } from 'uniffi-bindgen-react-native';
2
+ export declare function createCet(localOutput: TxOutput, localPayoutSerialId: bigint, remoteOutput: TxOutput, remotePayoutSerialId: bigint, fundTxId: string, fundVout: number, lockTime: number): Transaction;
3
+ export declare function createCetAdaptorSignatureFromOracleInfo(cet: Transaction, oracleInfo: OracleInfo, fundingSk: Array</*u8*/ number>, fundingScriptPubkey: Array</*u8*/ number>, totalCollateral: bigint, msgs: Array<Array</*u8*/ number>>): AdaptorSignature;
4
+ export declare function createCets(fundTxId: string, fundVout: number, localFinalScriptPubkey: Array</*u8*/ number>, remoteFinalScriptPubkey: Array</*u8*/ number>, outcomes: Array<DlcOutcome>, lockTime: number, localSerialId: bigint, remoteSerialId: bigint): Array<Transaction>;
5
+ export declare function createDlcTransactions(outcomes: Array<DlcOutcome>, localParams: PartyParams, remoteParams: PartyParams, refundLocktime: number, feeRate: bigint, fundLockTime: number, cetLockTime: number, fundOutputSerialId: bigint): DlcTransactions;
6
+ export declare function createFundTxLockingScript(localFundPubkey: Array</*u8*/ number>, remoteFundPubkey: Array</*u8*/ number>): Array</*u8*/ number>;
7
+ export declare function createRefundTransaction(localFinalScriptPubkey: Array</*u8*/ number>, remoteFinalScriptPubkey: Array</*u8*/ number>, localAmount: bigint, remoteAmount: bigint, lockTime: number, fundTxId: string, fundVout: number): Transaction;
8
+ export declare function createSplicedDlcTransactions(outcomes: Array<DlcOutcome>, localParams: PartyParams, remoteParams: PartyParams, refundLocktime: number, feeRate: bigint, fundLockTime: number, cetLockTime: number, fundOutputSerialId: bigint): DlcTransactions;
9
+ export declare function getChangeOutputAndFees(params: PartyParams, feeRate: bigint): ChangeOutputAndFees;
10
+ export declare function getRawFundingTransactionInputSignature(fundingTransaction: Transaction, privkey: Array</*u8*/ number>, prevTxId: string, prevTxVout: number, value: bigint): Array</*u8*/ number>;
11
+ export declare function getTotalInputVsize(inputs: Array<TxInputInfo>): number;
12
+ export declare function isDustOutput(output: TxOutput): boolean;
13
+ export declare function signFundTransactionInput(fundTransaction: Transaction, privkey: Array</*u8*/ number>, prevTxId: string, prevTxVout: number, value: bigint): Transaction;
14
+ export declare function verifyFundTxSignature(fundTx: Transaction, signature: Array</*u8*/ number>, pubkey: Array</*u8*/ number>, txid: string, vout: number, inputAmount: bigint): boolean;
15
+ export declare function version(): string;
16
+ export type AdaptorSignature = {
17
+ signature: Array</*u8*/ number>;
18
+ proof: Array</*u8*/ number>;
19
+ };
20
+ /**
21
+ * Generated factory for {@link AdaptorSignature} record objects.
22
+ */
23
+ export declare const AdaptorSignature: Readonly<{
24
+ /**
25
+ * Create a frozen instance of {@link AdaptorSignature}, with defaults specified
26
+ * in Rust, in the {@link ddk_ffi} crate.
27
+ */
28
+ create: (partial: Partial<AdaptorSignature> & Required<Omit<AdaptorSignature, never>>) => AdaptorSignature;
29
+ /**
30
+ * Create a frozen instance of {@link AdaptorSignature}, with defaults specified
31
+ * in Rust, in the {@link ddk_ffi} crate.
32
+ */
33
+ new: (partial: Partial<AdaptorSignature> & Required<Omit<AdaptorSignature, never>>) => AdaptorSignature;
34
+ /**
35
+ * Defaults specified in the {@link ddk_ffi} crate.
36
+ */
37
+ defaults: () => Partial<AdaptorSignature>;
38
+ }>;
39
+ export type ChangeOutputAndFees = {
40
+ changeOutput: TxOutput;
41
+ fundFee: bigint;
42
+ cetFee: bigint;
43
+ };
44
+ /**
45
+ * Generated factory for {@link ChangeOutputAndFees} record objects.
46
+ */
47
+ export declare const ChangeOutputAndFees: Readonly<{
48
+ /**
49
+ * Create a frozen instance of {@link ChangeOutputAndFees}, with defaults specified
50
+ * in Rust, in the {@link ddk_ffi} crate.
51
+ */
52
+ create: (partial: Partial<ChangeOutputAndFees> & Required<Omit<ChangeOutputAndFees, never>>) => ChangeOutputAndFees;
53
+ /**
54
+ * Create a frozen instance of {@link ChangeOutputAndFees}, with defaults specified
55
+ * in Rust, in the {@link ddk_ffi} crate.
56
+ */
57
+ new: (partial: Partial<ChangeOutputAndFees> & Required<Omit<ChangeOutputAndFees, never>>) => ChangeOutputAndFees;
58
+ /**
59
+ * Defaults specified in the {@link ddk_ffi} crate.
60
+ */
61
+ defaults: () => Partial<ChangeOutputAndFees>;
62
+ }>;
63
+ export type DlcInputInfo = {
64
+ fundTx: Transaction;
65
+ fundVout: number;
66
+ localFundPubkey: Array</*u8*/ number>;
67
+ remoteFundPubkey: Array</*u8*/ number>;
68
+ fundAmount: bigint;
69
+ maxWitnessLen: number;
70
+ inputSerialId: bigint;
71
+ contractId: Array</*u8*/ number>;
72
+ };
73
+ /**
74
+ * Generated factory for {@link DlcInputInfo} record objects.
75
+ */
76
+ export declare const DlcInputInfo: Readonly<{
77
+ /**
78
+ * Create a frozen instance of {@link DlcInputInfo}, with defaults specified
79
+ * in Rust, in the {@link ddk_ffi} crate.
80
+ */
81
+ create: (partial: Partial<DlcInputInfo> & Required<Omit<DlcInputInfo, never>>) => DlcInputInfo;
82
+ /**
83
+ * Create a frozen instance of {@link DlcInputInfo}, with defaults specified
84
+ * in Rust, in the {@link ddk_ffi} crate.
85
+ */
86
+ new: (partial: Partial<DlcInputInfo> & Required<Omit<DlcInputInfo, never>>) => DlcInputInfo;
87
+ /**
88
+ * Defaults specified in the {@link ddk_ffi} crate.
89
+ */
90
+ defaults: () => Partial<DlcInputInfo>;
91
+ }>;
92
+ export type DlcOutcome = {
93
+ localPayout: bigint;
94
+ remotePayout: bigint;
95
+ };
96
+ /**
97
+ * Generated factory for {@link DlcOutcome} record objects.
98
+ */
99
+ export declare const DlcOutcome: Readonly<{
100
+ /**
101
+ * Create a frozen instance of {@link DlcOutcome}, with defaults specified
102
+ * in Rust, in the {@link ddk_ffi} crate.
103
+ */
104
+ create: (partial: Partial<DlcOutcome> & Required<Omit<DlcOutcome, never>>) => DlcOutcome;
105
+ /**
106
+ * Create a frozen instance of {@link DlcOutcome}, with defaults specified
107
+ * in Rust, in the {@link ddk_ffi} crate.
108
+ */
109
+ new: (partial: Partial<DlcOutcome> & Required<Omit<DlcOutcome, never>>) => DlcOutcome;
110
+ /**
111
+ * Defaults specified in the {@link ddk_ffi} crate.
112
+ */
113
+ defaults: () => Partial<DlcOutcome>;
114
+ }>;
115
+ export type DlcTransactions = {
116
+ fund: Transaction;
117
+ cets: Array<Transaction>;
118
+ refund: Transaction;
119
+ fundingScriptPubkey: Array</*u8*/ number>;
120
+ };
121
+ /**
122
+ * Generated factory for {@link DlcTransactions} record objects.
123
+ */
124
+ export declare const DlcTransactions: Readonly<{
125
+ /**
126
+ * Create a frozen instance of {@link DlcTransactions}, with defaults specified
127
+ * in Rust, in the {@link ddk_ffi} crate.
128
+ */
129
+ create: (partial: Partial<DlcTransactions> & Required<Omit<DlcTransactions, never>>) => DlcTransactions;
130
+ /**
131
+ * Create a frozen instance of {@link DlcTransactions}, with defaults specified
132
+ * in Rust, in the {@link ddk_ffi} crate.
133
+ */
134
+ new: (partial: Partial<DlcTransactions> & Required<Omit<DlcTransactions, never>>) => DlcTransactions;
135
+ /**
136
+ * Defaults specified in the {@link ddk_ffi} crate.
137
+ */
138
+ defaults: () => Partial<DlcTransactions>;
139
+ }>;
140
+ export type OracleInfo = {
141
+ publicKey: Array</*u8*/ number>;
142
+ nonces: Array<Array</*u8*/ number>>;
143
+ };
144
+ /**
145
+ * Generated factory for {@link OracleInfo} record objects.
146
+ */
147
+ export declare const OracleInfo: Readonly<{
148
+ /**
149
+ * Create a frozen instance of {@link OracleInfo}, with defaults specified
150
+ * in Rust, in the {@link ddk_ffi} crate.
151
+ */
152
+ create: (partial: Partial<OracleInfo> & Required<Omit<OracleInfo, never>>) => OracleInfo;
153
+ /**
154
+ * Create a frozen instance of {@link OracleInfo}, with defaults specified
155
+ * in Rust, in the {@link ddk_ffi} crate.
156
+ */
157
+ new: (partial: Partial<OracleInfo> & Required<Omit<OracleInfo, never>>) => OracleInfo;
158
+ /**
159
+ * Defaults specified in the {@link ddk_ffi} crate.
160
+ */
161
+ defaults: () => Partial<OracleInfo>;
162
+ }>;
163
+ export type PartyParams = {
164
+ fundPubkey: Array</*u8*/ number>;
165
+ changeScriptPubkey: Array</*u8*/ number>;
166
+ changeSerialId: bigint;
167
+ payoutScriptPubkey: Array</*u8*/ number>;
168
+ payoutSerialId: bigint;
169
+ inputs: Array<TxInputInfo>;
170
+ inputAmount: bigint;
171
+ collateral: bigint;
172
+ dlcInputs: Array<DlcInputInfo>;
173
+ };
174
+ /**
175
+ * Generated factory for {@link PartyParams} record objects.
176
+ */
177
+ export declare const PartyParams: Readonly<{
178
+ /**
179
+ * Create a frozen instance of {@link PartyParams}, with defaults specified
180
+ * in Rust, in the {@link ddk_ffi} crate.
181
+ */
182
+ create: (partial: Partial<PartyParams> & Required<Omit<PartyParams, never>>) => PartyParams;
183
+ /**
184
+ * Create a frozen instance of {@link PartyParams}, with defaults specified
185
+ * in Rust, in the {@link ddk_ffi} crate.
186
+ */
187
+ new: (partial: Partial<PartyParams> & Required<Omit<PartyParams, never>>) => PartyParams;
188
+ /**
189
+ * Defaults specified in the {@link ddk_ffi} crate.
190
+ */
191
+ defaults: () => Partial<PartyParams>;
192
+ }>;
193
+ export type Payout = {
194
+ offer: bigint;
195
+ accept: bigint;
196
+ };
197
+ /**
198
+ * Generated factory for {@link Payout} record objects.
199
+ */
200
+ export declare const Payout: Readonly<{
201
+ /**
202
+ * Create a frozen instance of {@link Payout}, with defaults specified
203
+ * in Rust, in the {@link ddk_ffi} crate.
204
+ */
205
+ create: (partial: Partial<Payout> & Required<Omit<Payout, never>>) => Payout;
206
+ /**
207
+ * Create a frozen instance of {@link Payout}, with defaults specified
208
+ * in Rust, in the {@link ddk_ffi} crate.
209
+ */
210
+ new: (partial: Partial<Payout> & Required<Omit<Payout, never>>) => Payout;
211
+ /**
212
+ * Defaults specified in the {@link ddk_ffi} crate.
213
+ */
214
+ defaults: () => Partial<Payout>;
215
+ }>;
216
+ export type Transaction = {
217
+ version: number;
218
+ lockTime: number;
219
+ inputs: Array<TxInput>;
220
+ outputs: Array<TxOutput>;
221
+ rawBytes: Array</*u8*/ number>;
222
+ };
223
+ /**
224
+ * Generated factory for {@link Transaction} record objects.
225
+ */
226
+ export declare const Transaction: Readonly<{
227
+ /**
228
+ * Create a frozen instance of {@link Transaction}, with defaults specified
229
+ * in Rust, in the {@link ddk_ffi} crate.
230
+ */
231
+ create: (partial: Partial<Transaction> & Required<Omit<Transaction, never>>) => Transaction;
232
+ /**
233
+ * Create a frozen instance of {@link Transaction}, with defaults specified
234
+ * in Rust, in the {@link ddk_ffi} crate.
235
+ */
236
+ new: (partial: Partial<Transaction> & Required<Omit<Transaction, never>>) => Transaction;
237
+ /**
238
+ * Defaults specified in the {@link ddk_ffi} crate.
239
+ */
240
+ defaults: () => Partial<Transaction>;
241
+ }>;
242
+ export type TxInput = {
243
+ txid: string;
244
+ vout: number;
245
+ scriptSig: Array</*u8*/ number>;
246
+ sequence: number;
247
+ witness: Array<Array</*u8*/ number>>;
248
+ };
249
+ /**
250
+ * Generated factory for {@link TxInput} record objects.
251
+ */
252
+ export declare const TxInput: Readonly<{
253
+ /**
254
+ * Create a frozen instance of {@link TxInput}, with defaults specified
255
+ * in Rust, in the {@link ddk_ffi} crate.
256
+ */
257
+ create: (partial: Partial<TxInput> & Required<Omit<TxInput, never>>) => TxInput;
258
+ /**
259
+ * Create a frozen instance of {@link TxInput}, with defaults specified
260
+ * in Rust, in the {@link ddk_ffi} crate.
261
+ */
262
+ new: (partial: Partial<TxInput> & Required<Omit<TxInput, never>>) => TxInput;
263
+ /**
264
+ * Defaults specified in the {@link ddk_ffi} crate.
265
+ */
266
+ defaults: () => Partial<TxInput>;
267
+ }>;
268
+ export type TxInputInfo = {
269
+ txid: string;
270
+ vout: number;
271
+ scriptSig: Array</*u8*/ number>;
272
+ maxWitnessLength: number;
273
+ serialId: bigint;
274
+ };
275
+ /**
276
+ * Generated factory for {@link TxInputInfo} record objects.
277
+ */
278
+ export declare const TxInputInfo: Readonly<{
279
+ /**
280
+ * Create a frozen instance of {@link TxInputInfo}, with defaults specified
281
+ * in Rust, in the {@link ddk_ffi} crate.
282
+ */
283
+ create: (partial: Partial<TxInputInfo> & Required<Omit<TxInputInfo, never>>) => TxInputInfo;
284
+ /**
285
+ * Create a frozen instance of {@link TxInputInfo}, with defaults specified
286
+ * in Rust, in the {@link ddk_ffi} crate.
287
+ */
288
+ new: (partial: Partial<TxInputInfo> & Required<Omit<TxInputInfo, never>>) => TxInputInfo;
289
+ /**
290
+ * Defaults specified in the {@link ddk_ffi} crate.
291
+ */
292
+ defaults: () => Partial<TxInputInfo>;
293
+ }>;
294
+ export type TxOutput = {
295
+ value: bigint;
296
+ scriptPubkey: Array</*u8*/ number>;
297
+ };
298
+ /**
299
+ * Generated factory for {@link TxOutput} record objects.
300
+ */
301
+ export declare const TxOutput: Readonly<{
302
+ /**
303
+ * Create a frozen instance of {@link TxOutput}, with defaults specified
304
+ * in Rust, in the {@link ddk_ffi} crate.
305
+ */
306
+ create: (partial: Partial<TxOutput> & Required<Omit<TxOutput, never>>) => TxOutput;
307
+ /**
308
+ * Create a frozen instance of {@link TxOutput}, with defaults specified
309
+ * in Rust, in the {@link ddk_ffi} crate.
310
+ */
311
+ new: (partial: Partial<TxOutput> & Required<Omit<TxOutput, never>>) => TxOutput;
312
+ /**
313
+ * Defaults specified in the {@link ddk_ffi} crate.
314
+ */
315
+ defaults: () => Partial<TxOutput>;
316
+ }>;
317
+ export declare enum DlcError_Tags {
318
+ InvalidSignature = "InvalidSignature",
319
+ InvalidPublicKey = "InvalidPublicKey",
320
+ InvalidTransaction = "InvalidTransaction",
321
+ InsufficientFunds = "InsufficientFunds",
322
+ InvalidArgument = "InvalidArgument",
323
+ SerializationError = "SerializationError",
324
+ Secp256k1Error = "Secp256k1Error",
325
+ MiniscriptError = "MiniscriptError",
326
+ NetworkError = "NetworkError"
327
+ }
328
+ export declare const DlcError: {
329
+ InvalidSignature: {
330
+ new (message: string): {
331
+ readonly tag: DlcError_Tags.InvalidSignature;
332
+ /**
333
+ * @private
334
+ * This field is private and should not be used.
335
+ */
336
+ readonly [uniffiTypeNameSymbol]: string;
337
+ /**
338
+ * @private
339
+ * This field is private and should not be used.
340
+ */
341
+ readonly [variantOrdinalSymbol]: 1;
342
+ name: string;
343
+ message: string;
344
+ stack?: string;
345
+ cause?: unknown;
346
+ };
347
+ instanceOf(e: any): e is {
348
+ readonly tag: DlcError_Tags.InvalidSignature;
349
+ /**
350
+ * @private
351
+ * This field is private and should not be used.
352
+ */
353
+ readonly [uniffiTypeNameSymbol]: string;
354
+ /**
355
+ * @private
356
+ * This field is private and should not be used.
357
+ */
358
+ readonly [variantOrdinalSymbol]: 1;
359
+ name: string;
360
+ message: string;
361
+ stack?: string;
362
+ cause?: unknown;
363
+ };
364
+ isError(error: unknown): error is Error;
365
+ };
366
+ InvalidPublicKey: {
367
+ new (message: string): {
368
+ readonly tag: DlcError_Tags.InvalidPublicKey;
369
+ /**
370
+ * @private
371
+ * This field is private and should not be used.
372
+ */
373
+ readonly [uniffiTypeNameSymbol]: string;
374
+ /**
375
+ * @private
376
+ * This field is private and should not be used.
377
+ */
378
+ readonly [variantOrdinalSymbol]: 2;
379
+ name: string;
380
+ message: string;
381
+ stack?: string;
382
+ cause?: unknown;
383
+ };
384
+ instanceOf(e: any): e is {
385
+ readonly tag: DlcError_Tags.InvalidPublicKey;
386
+ /**
387
+ * @private
388
+ * This field is private and should not be used.
389
+ */
390
+ readonly [uniffiTypeNameSymbol]: string;
391
+ /**
392
+ * @private
393
+ * This field is private and should not be used.
394
+ */
395
+ readonly [variantOrdinalSymbol]: 2;
396
+ name: string;
397
+ message: string;
398
+ stack?: string;
399
+ cause?: unknown;
400
+ };
401
+ isError(error: unknown): error is Error;
402
+ };
403
+ InvalidTransaction: {
404
+ new (message: string): {
405
+ readonly tag: DlcError_Tags.InvalidTransaction;
406
+ /**
407
+ * @private
408
+ * This field is private and should not be used.
409
+ */
410
+ readonly [uniffiTypeNameSymbol]: string;
411
+ /**
412
+ * @private
413
+ * This field is private and should not be used.
414
+ */
415
+ readonly [variantOrdinalSymbol]: 3;
416
+ name: string;
417
+ message: string;
418
+ stack?: string;
419
+ cause?: unknown;
420
+ };
421
+ instanceOf(e: any): e is {
422
+ readonly tag: DlcError_Tags.InvalidTransaction;
423
+ /**
424
+ * @private
425
+ * This field is private and should not be used.
426
+ */
427
+ readonly [uniffiTypeNameSymbol]: string;
428
+ /**
429
+ * @private
430
+ * This field is private and should not be used.
431
+ */
432
+ readonly [variantOrdinalSymbol]: 3;
433
+ name: string;
434
+ message: string;
435
+ stack?: string;
436
+ cause?: unknown;
437
+ };
438
+ isError(error: unknown): error is Error;
439
+ };
440
+ InsufficientFunds: {
441
+ new (message: string): {
442
+ readonly tag: DlcError_Tags.InsufficientFunds;
443
+ /**
444
+ * @private
445
+ * This field is private and should not be used.
446
+ */
447
+ readonly [uniffiTypeNameSymbol]: string;
448
+ /**
449
+ * @private
450
+ * This field is private and should not be used.
451
+ */
452
+ readonly [variantOrdinalSymbol]: 4;
453
+ name: string;
454
+ message: string;
455
+ stack?: string;
456
+ cause?: unknown;
457
+ };
458
+ instanceOf(e: any): e is {
459
+ readonly tag: DlcError_Tags.InsufficientFunds;
460
+ /**
461
+ * @private
462
+ * This field is private and should not be used.
463
+ */
464
+ readonly [uniffiTypeNameSymbol]: string;
465
+ /**
466
+ * @private
467
+ * This field is private and should not be used.
468
+ */
469
+ readonly [variantOrdinalSymbol]: 4;
470
+ name: string;
471
+ message: string;
472
+ stack?: string;
473
+ cause?: unknown;
474
+ };
475
+ isError(error: unknown): error is Error;
476
+ };
477
+ InvalidArgument: {
478
+ new (message: string): {
479
+ readonly tag: DlcError_Tags.InvalidArgument;
480
+ /**
481
+ * @private
482
+ * This field is private and should not be used.
483
+ */
484
+ readonly [uniffiTypeNameSymbol]: string;
485
+ /**
486
+ * @private
487
+ * This field is private and should not be used.
488
+ */
489
+ readonly [variantOrdinalSymbol]: 5;
490
+ name: string;
491
+ message: string;
492
+ stack?: string;
493
+ cause?: unknown;
494
+ };
495
+ instanceOf(e: any): e is {
496
+ readonly tag: DlcError_Tags.InvalidArgument;
497
+ /**
498
+ * @private
499
+ * This field is private and should not be used.
500
+ */
501
+ readonly [uniffiTypeNameSymbol]: string;
502
+ /**
503
+ * @private
504
+ * This field is private and should not be used.
505
+ */
506
+ readonly [variantOrdinalSymbol]: 5;
507
+ name: string;
508
+ message: string;
509
+ stack?: string;
510
+ cause?: unknown;
511
+ };
512
+ isError(error: unknown): error is Error;
513
+ };
514
+ SerializationError: {
515
+ new (message: string): {
516
+ readonly tag: DlcError_Tags.SerializationError;
517
+ /**
518
+ * @private
519
+ * This field is private and should not be used.
520
+ */
521
+ readonly [uniffiTypeNameSymbol]: string;
522
+ /**
523
+ * @private
524
+ * This field is private and should not be used.
525
+ */
526
+ readonly [variantOrdinalSymbol]: 6;
527
+ name: string;
528
+ message: string;
529
+ stack?: string;
530
+ cause?: unknown;
531
+ };
532
+ instanceOf(e: any): e is {
533
+ readonly tag: DlcError_Tags.SerializationError;
534
+ /**
535
+ * @private
536
+ * This field is private and should not be used.
537
+ */
538
+ readonly [uniffiTypeNameSymbol]: string;
539
+ /**
540
+ * @private
541
+ * This field is private and should not be used.
542
+ */
543
+ readonly [variantOrdinalSymbol]: 6;
544
+ name: string;
545
+ message: string;
546
+ stack?: string;
547
+ cause?: unknown;
548
+ };
549
+ isError(error: unknown): error is Error;
550
+ };
551
+ Secp256k1Error: {
552
+ new (message: string): {
553
+ readonly tag: DlcError_Tags.Secp256k1Error;
554
+ /**
555
+ * @private
556
+ * This field is private and should not be used.
557
+ */
558
+ readonly [uniffiTypeNameSymbol]: string;
559
+ /**
560
+ * @private
561
+ * This field is private and should not be used.
562
+ */
563
+ readonly [variantOrdinalSymbol]: 7;
564
+ name: string;
565
+ message: string;
566
+ stack?: string;
567
+ cause?: unknown;
568
+ };
569
+ instanceOf(e: any): e is {
570
+ readonly tag: DlcError_Tags.Secp256k1Error;
571
+ /**
572
+ * @private
573
+ * This field is private and should not be used.
574
+ */
575
+ readonly [uniffiTypeNameSymbol]: string;
576
+ /**
577
+ * @private
578
+ * This field is private and should not be used.
579
+ */
580
+ readonly [variantOrdinalSymbol]: 7;
581
+ name: string;
582
+ message: string;
583
+ stack?: string;
584
+ cause?: unknown;
585
+ };
586
+ isError(error: unknown): error is Error;
587
+ };
588
+ MiniscriptError: {
589
+ new (message: string): {
590
+ readonly tag: DlcError_Tags.MiniscriptError;
591
+ /**
592
+ * @private
593
+ * This field is private and should not be used.
594
+ */
595
+ readonly [uniffiTypeNameSymbol]: string;
596
+ /**
597
+ * @private
598
+ * This field is private and should not be used.
599
+ */
600
+ readonly [variantOrdinalSymbol]: 8;
601
+ name: string;
602
+ message: string;
603
+ stack?: string;
604
+ cause?: unknown;
605
+ };
606
+ instanceOf(e: any): e is {
607
+ readonly tag: DlcError_Tags.MiniscriptError;
608
+ /**
609
+ * @private
610
+ * This field is private and should not be used.
611
+ */
612
+ readonly [uniffiTypeNameSymbol]: string;
613
+ /**
614
+ * @private
615
+ * This field is private and should not be used.
616
+ */
617
+ readonly [variantOrdinalSymbol]: 8;
618
+ name: string;
619
+ message: string;
620
+ stack?: string;
621
+ cause?: unknown;
622
+ };
623
+ isError(error: unknown): error is Error;
624
+ };
625
+ NetworkError: {
626
+ new (message: string): {
627
+ readonly tag: DlcError_Tags.NetworkError;
628
+ /**
629
+ * @private
630
+ * This field is private and should not be used.
631
+ */
632
+ readonly [uniffiTypeNameSymbol]: string;
633
+ /**
634
+ * @private
635
+ * This field is private and should not be used.
636
+ */
637
+ readonly [variantOrdinalSymbol]: 9;
638
+ name: string;
639
+ message: string;
640
+ stack?: string;
641
+ cause?: unknown;
642
+ };
643
+ instanceOf(e: any): e is {
644
+ readonly tag: DlcError_Tags.NetworkError;
645
+ /**
646
+ * @private
647
+ * This field is private and should not be used.
648
+ */
649
+ readonly [uniffiTypeNameSymbol]: string;
650
+ /**
651
+ * @private
652
+ * This field is private and should not be used.
653
+ */
654
+ readonly [variantOrdinalSymbol]: 9;
655
+ name: string;
656
+ message: string;
657
+ stack?: string;
658
+ cause?: unknown;
659
+ };
660
+ isError(error: unknown): error is Error;
661
+ };
662
+ instanceOf: (e: any) => e is DlcError;
663
+ };
664
+ export type DlcError = InstanceType<(typeof DlcError)[keyof Omit<typeof DlcError, 'instanceOf'>]>;
665
+ /**
666
+ * This should be called before anything else.
667
+ *
668
+ * It is likely that this is being done for you by the library's `index.ts`.
669
+ *
670
+ * It checks versions of uniffi between when the Rust scaffolding was generated
671
+ * and when the bindings were generated.
672
+ *
673
+ * It also initializes the machinery to enable Rust to talk back to Javascript.
674
+ */
675
+ declare function uniffiEnsureInitialized(): void;
676
+ declare const _default: Readonly<{
677
+ initialize: typeof uniffiEnsureInitialized;
678
+ converters: {
679
+ FfiConverterTypeAdaptorSignature: {
680
+ read(from: RustBuffer): AdaptorSignature;
681
+ write(value: AdaptorSignature, into: RustBuffer): void;
682
+ allocationSize(value: AdaptorSignature): number;
683
+ lift(value: UniffiByteArray): AdaptorSignature;
684
+ lower(value: AdaptorSignature): UniffiByteArray;
685
+ };
686
+ FfiConverterTypeChangeOutputAndFees: {
687
+ read(from: RustBuffer): ChangeOutputAndFees;
688
+ write(value: ChangeOutputAndFees, into: RustBuffer): void;
689
+ allocationSize(value: ChangeOutputAndFees): number;
690
+ lift(value: UniffiByteArray): ChangeOutputAndFees;
691
+ lower(value: ChangeOutputAndFees): UniffiByteArray;
692
+ };
693
+ FfiConverterTypeDLCError: {
694
+ read(from: RustBuffer): DlcError;
695
+ write(value: DlcError, into: RustBuffer): void;
696
+ allocationSize(value: DlcError): number;
697
+ lift(value: UniffiByteArray): DlcError;
698
+ lower(value: DlcError): UniffiByteArray;
699
+ };
700
+ FfiConverterTypeDlcInputInfo: {
701
+ read(from: RustBuffer): DlcInputInfo;
702
+ write(value: DlcInputInfo, into: RustBuffer): void;
703
+ allocationSize(value: DlcInputInfo): number;
704
+ lift(value: UniffiByteArray): DlcInputInfo;
705
+ lower(value: DlcInputInfo): UniffiByteArray;
706
+ };
707
+ FfiConverterTypeDlcOutcome: {
708
+ read(from: RustBuffer): DlcOutcome;
709
+ write(value: DlcOutcome, into: RustBuffer): void;
710
+ allocationSize(value: DlcOutcome): number;
711
+ lift(value: UniffiByteArray): DlcOutcome;
712
+ lower(value: DlcOutcome): UniffiByteArray;
713
+ };
714
+ FfiConverterTypeDlcTransactions: {
715
+ read(from: RustBuffer): DlcTransactions;
716
+ write(value: DlcTransactions, into: RustBuffer): void;
717
+ allocationSize(value: DlcTransactions): number;
718
+ lift(value: UniffiByteArray): DlcTransactions;
719
+ lower(value: DlcTransactions): UniffiByteArray;
720
+ };
721
+ FfiConverterTypeOracleInfo: {
722
+ read(from: RustBuffer): OracleInfo;
723
+ write(value: OracleInfo, into: RustBuffer): void;
724
+ allocationSize(value: OracleInfo): number;
725
+ lift(value: UniffiByteArray): OracleInfo;
726
+ lower(value: OracleInfo): UniffiByteArray;
727
+ };
728
+ FfiConverterTypePartyParams: {
729
+ read(from: RustBuffer): PartyParams;
730
+ write(value: PartyParams, into: RustBuffer): void;
731
+ allocationSize(value: PartyParams): number;
732
+ lift(value: UniffiByteArray): PartyParams;
733
+ lower(value: PartyParams): UniffiByteArray;
734
+ };
735
+ FfiConverterTypePayout: {
736
+ read(from: RustBuffer): Payout;
737
+ write(value: Payout, into: RustBuffer): void;
738
+ allocationSize(value: Payout): number;
739
+ lift(value: UniffiByteArray): Payout;
740
+ lower(value: Payout): UniffiByteArray;
741
+ };
742
+ FfiConverterTypeTransaction: {
743
+ read(from: RustBuffer): Transaction;
744
+ write(value: Transaction, into: RustBuffer): void;
745
+ allocationSize(value: Transaction): number;
746
+ lift(value: UniffiByteArray): Transaction;
747
+ lower(value: Transaction): UniffiByteArray;
748
+ };
749
+ FfiConverterTypeTxInput: {
750
+ read(from: RustBuffer): TxInput;
751
+ write(value: TxInput, into: RustBuffer): void;
752
+ allocationSize(value: TxInput): number;
753
+ lift(value: UniffiByteArray): TxInput;
754
+ lower(value: TxInput): UniffiByteArray;
755
+ };
756
+ FfiConverterTypeTxInputInfo: {
757
+ read(from: RustBuffer): TxInputInfo;
758
+ write(value: TxInputInfo, into: RustBuffer): void;
759
+ allocationSize(value: TxInputInfo): number;
760
+ lift(value: UniffiByteArray): TxInputInfo;
761
+ lower(value: TxInputInfo): UniffiByteArray;
762
+ };
763
+ FfiConverterTypeTxOutput: {
764
+ read(from: RustBuffer): TxOutput;
765
+ write(value: TxOutput, into: RustBuffer): void;
766
+ allocationSize(value: TxOutput): number;
767
+ lift(value: UniffiByteArray): TxOutput;
768
+ lower(value: TxOutput): UniffiByteArray;
769
+ };
770
+ };
771
+ }>;
772
+ export default _default;
773
+ //# sourceMappingURL=ddk_ffi.d.ts.map