@bennyblader/ddk-rn 0.3.42 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/DdkRn.podspec +1 -1
  2. package/README.md +14 -0
  3. package/android/CMakeLists.txt +6 -3
  4. package/android/build.gradle +0 -1
  5. package/android/cpp-adapter.cpp +6 -26
  6. package/android/src/main/jniLibs/arm64-v8a/libddk_ffi.so +0 -0
  7. package/android/src/main/jniLibs/armeabi-v7a/libddk_ffi.so +0 -0
  8. package/android/src/main/jniLibs/x86/libddk_ffi.so +0 -0
  9. package/android/src/main/jniLibs/x86_64/libddk_ffi.so +0 -0
  10. package/cpp/bennyblader-ddk-rn.cpp +1 -1
  11. package/cpp/ddk_ffi.cpp +2361 -2671
  12. package/cpp/ddk_ffi.hpp +86 -255
  13. package/ios/DdkRn.xcframework/Info.plist +43 -0
  14. package/ios/DdkRn.xcframework/ios-arm64/libddk_ffi.a +0 -0
  15. package/ios/DdkRn.xcframework/ios-arm64-simulator/libddk_ffi.a +0 -0
  16. package/lib/commonjs/ddk_ffi-ffi.js +6 -29
  17. package/lib/commonjs/ddk_ffi-ffi.js.map +1 -1
  18. package/lib/commonjs/ddk_ffi.js +961 -944
  19. package/lib/commonjs/ddk_ffi.js.map +1 -1
  20. package/lib/module/ddk_ffi-ffi.js +6 -29
  21. package/lib/module/ddk_ffi-ffi.js.map +1 -1
  22. package/lib/module/ddk_ffi.js +924 -896
  23. package/lib/module/ddk_ffi.js.map +1 -1
  24. package/lib/typescript/commonjs/src/ddk_ffi-ffi.d.ts +71 -96
  25. package/lib/typescript/commonjs/src/ddk_ffi-ffi.d.ts.map +1 -1
  26. package/lib/typescript/commonjs/src/ddk_ffi.d.ts +500 -471
  27. package/lib/typescript/commonjs/src/ddk_ffi.d.ts.map +1 -1
  28. package/lib/typescript/module/src/ddk_ffi-ffi.d.ts +71 -96
  29. package/lib/typescript/module/src/ddk_ffi-ffi.d.ts.map +1 -1
  30. package/lib/typescript/module/src/ddk_ffi.d.ts +500 -471
  31. package/lib/typescript/module/src/ddk_ffi.d.ts.map +1 -1
  32. package/package.json +8 -38
  33. package/src/ddk_ffi-ffi.ts +419 -170
  34. package/src/ddk_ffi.ts +2648 -1939
  35. package/ubrn.config.yaml +18 -1
  36. package/ddk-ffi/Cargo.lock +0 -1013
  37. package/ddk-ffi/Cargo.toml +0 -36
  38. package/ddk-ffi/build.rs +0 -3
  39. package/ddk-ffi/rust-toolchain.toml +0 -10
  40. package/ddk-ffi/src/ddk_ffi.udl +0 -376
  41. package/ddk-ffi/src/lib.rs +0 -2509
  42. package/ddk-ffi/src/uniffi-bindgen.rs +0 -3
  43. package/ddk-ffi/uniffi.toml +0 -18
  44. package/scripts/apply-hotfix.js +0 -96
  45. package/scripts/postinstall.js +0 -298
  46. package/scripts/prepare-rust-src.js +0 -51
@@ -1,86 +1,140 @@
1
- import { type UniffiByteArray, RustBuffer, uniffiTypeNameSymbol, variantOrdinalSymbol } from "uniffi-bindgen-react-native";
2
- export declare function addSignatureToTransaction(tx: Transaction, signature: Array</*u8*/ number>, pubkey: Array</*u8*/ number>, inputIndex: number): Transaction;
3
- export declare function convertMnemonicToSeed(mnemonic: string, passphrase: string | undefined): Array</*u8*/ number>;
1
+ import { type UniffiByteArray, RustBuffer, uniffiTypeNameSymbol } from '@ubjs/core';
2
+ export declare function convertMnemonicToSeed(mnemonic: string, passphrase: string | undefined): ArrayBuffer;
3
+ /**
4
+ * Create a single CET
5
+ */
4
6
  export declare function createCet(localOutput: TxOutput, localPayoutSerialId: bigint, remoteOutput: TxOutput, remotePayoutSerialId: bigint, fundTxId: string, fundVout: number, lockTime: number): Transaction;
5
- export declare function createCetAdaptorPointsFromOracleInfo(oracleInfo: Array<OracleInfo>, msgs: Array<Array<Array<Array</*u8*/ number>>>>): Array<Array</*u8*/ number>>;
6
- export declare function createCetAdaptorSignatureFromOracleInfo(cet: Transaction, oracleInfo: OracleInfo, fundingSk: Array</*u8*/ number>, fundingScriptPubkey: Array</*u8*/ number>, totalCollateral: bigint, msgs: Array<Array</*u8*/ number>>): AdaptorSignature;
7
- export declare function createCetAdaptorSigsFromOracleInfo(cets: Array<Transaction>, oracleInfo: Array<OracleInfo>, fundingSecretKey: Array</*u8*/ number>, fundingScriptPubkey: Array</*u8*/ number>, fundOutputValue: bigint, msgs: Array<Array<Array<Array</*u8*/ number>>>>): Array<AdaptorSignature>;
8
- export declare function createCetAdaptorSigsFromPoints(cets: Array<Transaction>, adaptorPoints: Array<Array</*u8*/ number>>, fundingSecretKey: Array</*u8*/ number>, fundingScriptPubkey: Array</*u8*/ number>, fundOutputValue: bigint): Array<AdaptorSignature>;
9
- export declare function createCets(fundTxId: string, fundVout: number, localFinalScriptPubkey: Array</*u8*/ number>, remoteFinalScriptPubkey: Array</*u8*/ number>, outcomes: Array<Payout>, lockTime: number, localSerialId: bigint, remoteSerialId: bigint): Array<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>;
9
+ /**
10
+ * Create adaptor signatures from pre-computed adaptor points.
11
+ */
12
+ export declare function createCetAdaptorSigsFromPoints(cets: Array<Transaction>, adaptorPoints: Array<ArrayBuffer>, fundingSecretKey: ArrayBuffer, fundingScriptPubkey: ArrayBuffer, fundOutputValue: bigint): Array<AdaptorSignature>;
13
+ /**
14
+ * Create multiple CETs
15
+ */
16
+ export declare function createCets(fundTxId: string, fundVout: number, localFinalScriptPubkey: ArrayBuffer, remoteFinalScriptPubkey: ArrayBuffer, outcomes: Array<Payout>, lockTime: number, localSerialId: bigint, remoteSerialId: bigint): Array<Transaction>;
17
+ /**
18
+ * Create complete DLC transactions
19
+ */
10
20
  export declare function createDlcTransactions(outcomes: Array<Payout>, localParams: PartyParams, remoteParams: PartyParams, refundLocktime: number, feeRate: bigint, fundLockTime: number, cetLockTime: number, fundOutputSerialId: bigint, contractFlags: number): DlcTransactions;
11
- export declare function createExtkeyFromParentPath(extkey: Array</*u8*/ number>, path: string): Array</*u8*/ number>;
12
- export declare function createExtkeyFromSeed(seed: Array</*u8*/ number>, network: string): Array</*u8*/ number>;
13
- export declare function createFundTxLockingScript(localFundPubkey: Array</*u8*/ number>, remoteFundPubkey: Array</*u8*/ number>): Array</*u8*/ number>;
14
- export declare function createRefundTransaction(localFinalScriptPubkey: Array</*u8*/ number>, remoteFinalScriptPubkey: Array</*u8*/ number>, localAmount: bigint, remoteAmount: bigint, lockTime: number, fundTxId: string, fundVout: number): Transaction;
21
+ /**
22
+ * Derive child extended private key from parent extended key
23
+ * Input: 78-byte encoded xpriv, Output: 78-byte encoded xpriv
24
+ */
25
+ export declare function createExtkeyFromParentPath(extkey: ArrayBuffer, path: string): ArrayBuffer;
26
+ /**
27
+ * Create master extended private key from 64-byte seed
28
+ * Returns 78-byte encoded xpriv
29
+ */
30
+ export declare function createExtkeyFromSeed(seed: ArrayBuffer, network: string): ArrayBuffer;
31
+ /**
32
+ * Create a funding script pubkey for DLC transactions
33
+ */
34
+ export declare function createFundTxLockingScript(localFundPubkey: ArrayBuffer, remoteFundPubkey: ArrayBuffer): ArrayBuffer;
35
+ /**
36
+ * Create a refund transaction
37
+ */
38
+ export declare function createRefundTransaction(localFinalScriptPubkey: ArrayBuffer, remoteFinalScriptPubkey: ArrayBuffer, localAmount: bigint, remoteAmount: bigint, lockTime: number, fundTxId: string, fundVout: number): Transaction;
39
+ /**
40
+ * Create spliced DLC transactions
41
+ */
15
42
  export declare function createSplicedDlcTransactions(outcomes: Array<Payout>, localParams: PartyParams, remoteParams: PartyParams, refundLocktime: number, feeRate: bigint, fundLockTime: number, cetLockTime: number, fundOutputSerialId: bigint, contractFlags: number): DlcTransactions;
16
- export declare function createXprivFromParentPath(seedOrXpriv: Array</*u8*/ number>, baseDerivationPath: string, network: string, path: string): Array</*u8*/ number>;
17
- export declare function extractEcdsaSignatureFromOracleSignatures(oracleSignatures: Array<Array</*u8*/ number>>, adaptorSignature: Array</*u8*/ number>): Array</*u8*/ number>;
18
- export declare function getCetAdaptorSignatureInputs(cet: Transaction, oracleInfo: Array<OracleInfo>, fundingScriptPubkey: Array</*u8*/ number>, fundOutputValue: bigint, msgs: Array<Array<Array</*u8*/ number>>>): CetAdaptorSignatureDebugInfo;
19
- export declare function getCetSighash(cet: Transaction, fundingScriptPubkey: Array</*u8*/ number>, fundOutputValue: bigint): Array</*u8*/ number>;
20
- export declare function getChangeOutputAndFees(params: PartyParams, feeRate: bigint): ChangeOutputAndFees;
21
- export declare function getPubkeyFromExtkey(extkey: Array</*u8*/ number>, network: string): Array</*u8*/ number>;
22
- export declare function getRawFundingTransactionInputSignature(fundingTransaction: Transaction, privkey: Array</*u8*/ number>, prevTxId: string, prevTxVout: number, value: bigint): Array</*u8*/ number>;
43
+ /**
44
+ * DEPRECATED: Use create_extkey_from_seed + create_extkey_from_parent_path instead
45
+ * This function handles both seeds (64 bytes) and xprivs (78 bytes) which is confusing
46
+ */
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;
49
+ /**
50
+ * Extract public key from extended key (private or public)
51
+ * Input: 78-byte encoded xpriv/xpub, Output: 33-byte compressed public key
52
+ */
53
+ export declare function getPubkeyFromExtkey(extkey: ArrayBuffer, network: string): ArrayBuffer;
54
+ /**
55
+ * Get total input virtual size for fee calculation
56
+ */
23
57
  export declare function getTotalInputVsize(inputs: Array<TxInputInfo>): number;
24
- export declare function getXpubFromXpriv(xpriv: Array</*u8*/ number>, network: string): Array</*u8*/ number>;
25
- export declare function isDustOutput(output: TxOutput): boolean;
26
- export declare function signCet(cet: Transaction, adaptorSignature: Array</*u8*/ number>, oracleSignatures: Array<Array</*u8*/ number>>, fundingSecretKey: Array</*u8*/ number>, otherPubkey: Array</*u8*/ number>, fundingScriptPubkey: Array</*u8*/ number>, fundOutputValue: bigint): Transaction;
27
- export declare function signFundTransactionInput(fundTransaction: Transaction, privkey: Array</*u8*/ number>, prevTxId: string, prevTxVout: number, value: bigint): Transaction;
28
- export declare function signMultiSigInput(tx: Transaction, dlcInput: DlcInputInfo, localPrivkey: Array</*u8*/ number>, remoteSignature: Array</*u8*/ number>): Transaction;
29
- export declare function verifyCetAdaptorSigFromOracleInfo(adaptorSig: AdaptorSignature, cet: Transaction, oracleInfo: Array<OracleInfo>, pubkey: Array</*u8*/ number>, fundingScriptPubkey: Array</*u8*/ number>, totalCollateral: bigint, msgs: Array<Array<Array</*u8*/ number>>>): boolean;
30
- export declare function verifyCetAdaptorSigsFromOracleInfo(adaptorSigs: Array<AdaptorSignature>, cets: Array<Transaction>, oracleInfo: Array<OracleInfo>, pubkey: Array</*u8*/ number>, fundingScriptPubkey: Array</*u8*/ number>, totalCollateral: bigint, msgs: Array<Array<Array<Array</*u8*/ number>>>>): boolean;
31
- export declare function verifyFundTxSignature(fundTx: Transaction, signature: Array</*u8*/ number>, pubkey: Array</*u8*/ number>, txid: string, vout: number, inputAmount: bigint): boolean;
58
+ /**
59
+ * Convert extended private key to extended public key
60
+ * Input: 78-byte encoded xpriv, Output: 78-byte encoded xpub
61
+ */
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;
32
64
  export declare function version(): string;
33
65
  export type AdaptorSignature = {
34
- signature: Array</*u8*/ number>;
35
- proof: Array</*u8*/ number>;
66
+ signature: ArrayBuffer;
67
+ proof: ArrayBuffer;
36
68
  };
37
69
  /**
38
70
  * Generated factory for {@link AdaptorSignature} record objects.
39
71
  */
40
72
  export declare const AdaptorSignature: Readonly<{
73
+ create: (partial: Partial<AdaptorSignature> & Required<Omit<AdaptorSignature, never>>) => AdaptorSignature;
74
+ new: (partial: Partial<AdaptorSignature> & Required<Omit<AdaptorSignature, never>>) => AdaptorSignature;
75
+ defaults: () => Partial<AdaptorSignature>;
76
+ verifyFromOracleInfo(self_: AdaptorSignature, cet: Transaction, oracleInfos: Array<OracleInfo>, pubkey: ArrayBuffer, fundingScriptPubkey: ArrayBuffer, totalCollateral: bigint, msgs: Array<Array<ArrayBuffer>>): boolean;
77
+ }>;
78
+ /**
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.
83
+ *
84
+ * This struct is intentionally always available (not feature-gated)
85
+ * to support production debugging scenarios.
86
+ */
87
+ export type CetAdaptorSignatureDebugInfo = {
41
88
  /**
42
- * Create a frozen instance of {@link AdaptorSignature}, with defaults specified
43
- * in Rust, in the {@link ddk_ffi} crate.
89
+ * The sighash (32 bytes) - this is the message that gets signed
44
90
  */
45
- create: (partial: Partial<AdaptorSignature> & Required<Omit<AdaptorSignature, never>>) => AdaptorSignature;
91
+ sighash: ArrayBuffer;
46
92
  /**
47
- * Create a frozen instance of {@link AdaptorSignature}, with defaults specified
48
- * in Rust, in the {@link ddk_ffi} crate.
93
+ * The adaptor point (33 bytes compressed public key)
49
94
  */
50
- new: (partial: Partial<AdaptorSignature> & Required<Omit<AdaptorSignature, never>>) => AdaptorSignature;
95
+ adaptorPoint: ArrayBuffer;
51
96
  /**
52
- * Defaults specified in the {@link ddk_ffi} crate.
97
+ * Input index (always 0 for CETs)
53
98
  */
54
- defaults: () => Partial<AdaptorSignature>;
55
- }>;
56
- export type CetAdaptorSignatureDebugInfo = {
57
- sighash: Array</*u8*/ number>;
58
- adaptorPoint: Array</*u8*/ number>;
59
99
  inputIndex: number;
60
- scriptPubkey: Array</*u8*/ number>;
100
+ /**
101
+ * The funding script pubkey used for sighash
102
+ */
103
+ scriptPubkey: ArrayBuffer;
104
+ /**
105
+ * The fund output value used for sighash
106
+ */
61
107
  value: bigint;
108
+ /**
109
+ * The CET txid
110
+ */
62
111
  cetTxid: string;
63
- cetRaw: Array</*u8*/ number>;
112
+ /**
113
+ * Raw CET bytes for verification
114
+ */
115
+ cetRaw: ArrayBuffer;
64
116
  };
65
117
  /**
66
118
  * Generated factory for {@link CetAdaptorSignatureDebugInfo} record objects.
67
119
  */
68
120
  export declare const CetAdaptorSignatureDebugInfo: Readonly<{
69
- /**
70
- * Create a frozen instance of {@link CetAdaptorSignatureDebugInfo}, with defaults specified
71
- * in Rust, in the {@link ddk_ffi} crate.
72
- */
73
121
  create: (partial: Partial<CetAdaptorSignatureDebugInfo> & Required<Omit<CetAdaptorSignatureDebugInfo, never>>) => CetAdaptorSignatureDebugInfo;
74
- /**
75
- * Create a frozen instance of {@link CetAdaptorSignatureDebugInfo}, with defaults specified
76
- * in Rust, in the {@link ddk_ffi} crate.
77
- */
78
122
  new: (partial: Partial<CetAdaptorSignatureDebugInfo> & Required<Omit<CetAdaptorSignatureDebugInfo, never>>) => CetAdaptorSignatureDebugInfo;
79
- /**
80
- * Defaults specified in the {@link ddk_ffi} crate.
81
- */
82
123
  defaults: () => Partial<CetAdaptorSignatureDebugInfo>;
83
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
+ }>;
84
138
  export type ChangeOutputAndFees = {
85
139
  changeOutput: TxOutput;
86
140
  fundFee: bigint;
@@ -90,103 +144,113 @@ export type ChangeOutputAndFees = {
90
144
  * Generated factory for {@link ChangeOutputAndFees} record objects.
91
145
  */
92
146
  export declare const ChangeOutputAndFees: Readonly<{
93
- /**
94
- * Create a frozen instance of {@link ChangeOutputAndFees}, with defaults specified
95
- * in Rust, in the {@link ddk_ffi} crate.
96
- */
97
147
  create: (partial: Partial<ChangeOutputAndFees> & Required<Omit<ChangeOutputAndFees, never>>) => ChangeOutputAndFees;
98
- /**
99
- * Create a frozen instance of {@link ChangeOutputAndFees}, with defaults specified
100
- * in Rust, in the {@link ddk_ffi} crate.
101
- */
102
148
  new: (partial: Partial<ChangeOutputAndFees> & Required<Omit<ChangeOutputAndFees, never>>) => ChangeOutputAndFees;
103
- /**
104
- * Defaults specified in the {@link ddk_ffi} crate.
105
- */
106
149
  defaults: () => Partial<ChangeOutputAndFees>;
107
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
+ }>;
108
190
  export type DlcInputInfo = {
109
191
  fundTx: Transaction;
110
192
  fundVout: number;
111
- localFundPubkey: Array</*u8*/ number>;
112
- remoteFundPubkey: Array</*u8*/ number>;
193
+ localFundPubkey: ArrayBuffer;
194
+ remoteFundPubkey: ArrayBuffer;
113
195
  fundAmount: bigint;
114
196
  maxWitnessLen: number;
115
197
  inputSerialId: bigint;
116
- contractId: Array</*u8*/ number>;
198
+ contractId: ArrayBuffer;
117
199
  };
118
200
  /**
119
201
  * Generated factory for {@link DlcInputInfo} record objects.
120
202
  */
121
203
  export declare const DlcInputInfo: Readonly<{
122
- /**
123
- * Create a frozen instance of {@link DlcInputInfo}, with defaults specified
124
- * in Rust, in the {@link ddk_ffi} crate.
125
- */
126
204
  create: (partial: Partial<DlcInputInfo> & Required<Omit<DlcInputInfo, never>>) => DlcInputInfo;
127
- /**
128
- * Create a frozen instance of {@link DlcInputInfo}, with defaults specified
129
- * in Rust, in the {@link ddk_ffi} crate.
130
- */
131
205
  new: (partial: Partial<DlcInputInfo> & Required<Omit<DlcInputInfo, never>>) => DlcInputInfo;
132
- /**
133
- * Defaults specified in the {@link ddk_ffi} crate.
134
- */
135
206
  defaults: () => Partial<DlcInputInfo>;
136
207
  }>;
137
208
  export type DlcTransactions = {
138
209
  fund: Transaction;
139
210
  cets: Array<Transaction>;
140
211
  refund: Transaction;
141
- fundingScriptPubkey: Array</*u8*/ number>;
212
+ fundingScriptPubkey: ArrayBuffer;
142
213
  };
143
214
  /**
144
215
  * Generated factory for {@link DlcTransactions} record objects.
145
216
  */
146
217
  export declare const DlcTransactions: Readonly<{
147
- /**
148
- * Create a frozen instance of {@link DlcTransactions}, with defaults specified
149
- * in Rust, in the {@link ddk_ffi} crate.
150
- */
151
218
  create: (partial: Partial<DlcTransactions> & Required<Omit<DlcTransactions, never>>) => DlcTransactions;
152
- /**
153
- * Create a frozen instance of {@link DlcTransactions}, with defaults specified
154
- * in Rust, in the {@link ddk_ffi} crate.
155
- */
156
219
  new: (partial: Partial<DlcTransactions> & Required<Omit<DlcTransactions, never>>) => DlcTransactions;
157
- /**
158
- * Defaults specified in the {@link ddk_ffi} crate.
159
- */
160
220
  defaults: () => Partial<DlcTransactions>;
161
221
  }>;
162
222
  export type OracleInfo = {
163
- publicKey: Array</*u8*/ number>;
164
- nonces: Array<Array</*u8*/ number>>;
223
+ publicKey: ArrayBuffer;
224
+ nonces: Array<ArrayBuffer>;
165
225
  };
166
226
  /**
167
227
  * Generated factory for {@link OracleInfo} record objects.
168
228
  */
169
229
  export declare const OracleInfo: Readonly<{
170
- /**
171
- * Create a frozen instance of {@link OracleInfo}, with defaults specified
172
- * in Rust, in the {@link ddk_ffi} crate.
173
- */
174
230
  create: (partial: Partial<OracleInfo> & Required<Omit<OracleInfo, never>>) => OracleInfo;
175
- /**
176
- * Create a frozen instance of {@link OracleInfo}, with defaults specified
177
- * in Rust, in the {@link ddk_ffi} crate.
178
- */
179
231
  new: (partial: Partial<OracleInfo> & Required<Omit<OracleInfo, never>>) => OracleInfo;
180
- /**
181
- * Defaults specified in the {@link ddk_ffi} crate.
182
- */
183
232
  defaults: () => Partial<OracleInfo>;
184
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
+ }>;
185
249
  export type PartyParams = {
186
- fundPubkey: Array</*u8*/ number>;
187
- changeScriptPubkey: Array</*u8*/ number>;
250
+ fundPubkey: ArrayBuffer;
251
+ changeScriptPubkey: ArrayBuffer;
188
252
  changeSerialId: bigint;
189
- payoutScriptPubkey: Array</*u8*/ number>;
253
+ payoutScriptPubkey: ArrayBuffer;
190
254
  payoutSerialId: bigint;
191
255
  inputs: Array<TxInputInfo>;
192
256
  inputAmount: bigint;
@@ -197,20 +261,10 @@ export type PartyParams = {
197
261
  * Generated factory for {@link PartyParams} record objects.
198
262
  */
199
263
  export declare const PartyParams: Readonly<{
200
- /**
201
- * Create a frozen instance of {@link PartyParams}, with defaults specified
202
- * in Rust, in the {@link ddk_ffi} crate.
203
- */
204
264
  create: (partial: Partial<PartyParams> & Required<Omit<PartyParams, never>>) => PartyParams;
205
- /**
206
- * Create a frozen instance of {@link PartyParams}, with defaults specified
207
- * in Rust, in the {@link ddk_ffi} crate.
208
- */
209
265
  new: (partial: Partial<PartyParams> & Required<Omit<PartyParams, never>>) => PartyParams;
210
- /**
211
- * Defaults specified in the {@link ddk_ffi} crate.
212
- */
213
266
  defaults: () => Partial<PartyParams>;
267
+ changeOutputAndFees(self_: PartyParams, feeRate: bigint): ChangeOutputAndFees;
214
268
  }>;
215
269
  export type Payout = {
216
270
  offer: bigint;
@@ -220,122 +274,16 @@ export type Payout = {
220
274
  * Generated factory for {@link Payout} record objects.
221
275
  */
222
276
  export declare const Payout: Readonly<{
223
- /**
224
- * Create a frozen instance of {@link Payout}, with defaults specified
225
- * in Rust, in the {@link ddk_ffi} crate.
226
- */
227
277
  create: (partial: Partial<Payout> & Required<Omit<Payout, never>>) => Payout;
228
- /**
229
- * Create a frozen instance of {@link Payout}, with defaults specified
230
- * in Rust, in the {@link ddk_ffi} crate.
231
- */
232
278
  new: (partial: Partial<Payout> & Required<Omit<Payout, never>>) => Payout;
233
- /**
234
- * Defaults specified in the {@link ddk_ffi} crate.
235
- */
236
279
  defaults: () => Partial<Payout>;
237
280
  }>;
238
- export type Transaction = {
239
- version: number;
240
- lockTime: number;
241
- inputs: Array<TxInput>;
242
- outputs: Array<TxOutput>;
243
- rawBytes: Array</*u8*/ number>;
244
- };
245
- /**
246
- * Generated factory for {@link Transaction} record objects.
247
- */
248
- export declare const Transaction: Readonly<{
249
- /**
250
- * Create a frozen instance of {@link Transaction}, with defaults specified
251
- * in Rust, in the {@link ddk_ffi} crate.
252
- */
253
- create: (partial: Partial<Transaction> & Required<Omit<Transaction, never>>) => Transaction;
254
- /**
255
- * Create a frozen instance of {@link Transaction}, with defaults specified
256
- * in Rust, in the {@link ddk_ffi} crate.
257
- */
258
- new: (partial: Partial<Transaction> & Required<Omit<Transaction, never>>) => Transaction;
259
- /**
260
- * Defaults specified in the {@link ddk_ffi} crate.
261
- */
262
- defaults: () => Partial<Transaction>;
263
- }>;
264
- export type TxInput = {
265
- txid: string;
266
- vout: number;
267
- scriptSig: Array</*u8*/ number>;
268
- sequence: number;
269
- witness: Array<Array</*u8*/ number>>;
270
- };
271
- /**
272
- * Generated factory for {@link TxInput} record objects.
273
- */
274
- export declare const TxInput: Readonly<{
275
- /**
276
- * Create a frozen instance of {@link TxInput}, with defaults specified
277
- * in Rust, in the {@link ddk_ffi} crate.
278
- */
279
- create: (partial: Partial<TxInput> & Required<Omit<TxInput, never>>) => TxInput;
280
- /**
281
- * Create a frozen instance of {@link TxInput}, with defaults specified
282
- * in Rust, in the {@link ddk_ffi} crate.
283
- */
284
- new: (partial: Partial<TxInput> & Required<Omit<TxInput, never>>) => TxInput;
285
- /**
286
- * Defaults specified in the {@link ddk_ffi} crate.
287
- */
288
- defaults: () => Partial<TxInput>;
289
- }>;
290
- export type TxInputInfo = {
291
- txid: string;
292
- vout: number;
293
- scriptSig: Array</*u8*/ number>;
294
- maxWitnessLength: number;
295
- serialId: bigint;
296
- };
297
- /**
298
- * Generated factory for {@link TxInputInfo} record objects.
299
- */
300
- export declare const TxInputInfo: Readonly<{
301
- /**
302
- * Create a frozen instance of {@link TxInputInfo}, with defaults specified
303
- * in Rust, in the {@link ddk_ffi} crate.
304
- */
305
- create: (partial: Partial<TxInputInfo> & Required<Omit<TxInputInfo, never>>) => TxInputInfo;
306
- /**
307
- * Create a frozen instance of {@link TxInputInfo}, with defaults specified
308
- * in Rust, in the {@link ddk_ffi} crate.
309
- */
310
- new: (partial: Partial<TxInputInfo> & Required<Omit<TxInputInfo, never>>) => TxInputInfo;
311
- /**
312
- * Defaults specified in the {@link ddk_ffi} crate.
313
- */
314
- defaults: () => Partial<TxInputInfo>;
315
- }>;
316
- export type TxOutput = {
317
- value: bigint;
318
- scriptPubkey: Array</*u8*/ number>;
319
- };
320
- /**
321
- * Generated factory for {@link TxOutput} record objects.
322
- */
323
- export declare const TxOutput: Readonly<{
324
- /**
325
- * Create a frozen instance of {@link TxOutput}, with defaults specified
326
- * in Rust, in the {@link ddk_ffi} crate.
327
- */
328
- create: (partial: Partial<TxOutput> & Required<Omit<TxOutput, never>>) => TxOutput;
329
- /**
330
- * Create a frozen instance of {@link TxOutput}, with defaults specified
331
- * in Rust, in the {@link ddk_ffi} crate.
332
- */
333
- new: (partial: Partial<TxOutput> & Required<Omit<TxOutput, never>>) => TxOutput;
334
- /**
335
- * Defaults specified in the {@link ddk_ffi} crate.
336
- */
337
- defaults: () => Partial<TxOutput>;
338
- }>;
281
+ export declare enum ExtendedKey {
282
+ InvalidMnemonic = 0,
283
+ InvalidXpriv = 1,
284
+ InvalidXpub = 2,
285
+ InvalidDerivationPath = 3
286
+ }
339
287
  export declare enum DlcError_Tags {
340
288
  InvalidSignature = "InvalidSignature",
341
289
  InvalidPublicKey = "InvalidPublicKey",
@@ -348,37 +296,52 @@ export declare enum DlcError_Tags {
348
296
  InvalidNetwork = "InvalidNetwork",
349
297
  KeyError = "KeyError"
350
298
  }
351
- export declare const DlcError: {
299
+ export declare const DlcError: Readonly<{
300
+ instanceOf: (obj: any) => obj is DlcError;
352
301
  InvalidSignature: {
353
- new (message: string): {
302
+ new (): {
354
303
  readonly tag: DlcError_Tags.InvalidSignature;
355
304
  /**
356
305
  * @private
357
- * This field is private and should not be used.
306
+ * This field is private and should not be used, use `tag` instead.
358
307
  */
359
- readonly [uniffiTypeNameSymbol]: string;
308
+ readonly [uniffiTypeNameSymbol]: "DlcError";
309
+ name: string;
310
+ message: string;
311
+ stack?: string;
312
+ cause?: unknown;
313
+ };
314
+ "new"(): {
315
+ readonly tag: DlcError_Tags.InvalidSignature;
360
316
  /**
361
317
  * @private
362
- * This field is private and should not be used.
318
+ * This field is private and should not be used, use `tag` instead.
363
319
  */
364
- readonly [variantOrdinalSymbol]: 1;
320
+ readonly [uniffiTypeNameSymbol]: "DlcError";
365
321
  name: string;
366
322
  message: string;
367
323
  stack?: string;
368
324
  cause?: unknown;
369
325
  };
370
- instanceOf(e: any): e is {
326
+ instanceOf(obj: any): obj is {
371
327
  readonly tag: DlcError_Tags.InvalidSignature;
372
328
  /**
373
329
  * @private
374
- * This field is private and should not be used.
330
+ * This field is private and should not be used, use `tag` instead.
375
331
  */
376
- readonly [uniffiTypeNameSymbol]: string;
332
+ readonly [uniffiTypeNameSymbol]: "DlcError";
333
+ name: string;
334
+ message: string;
335
+ stack?: string;
336
+ cause?: unknown;
337
+ };
338
+ hasInner(obj: any): obj is {
339
+ readonly tag: DlcError_Tags.InvalidSignature;
377
340
  /**
378
341
  * @private
379
- * This field is private and should not be used.
342
+ * This field is private and should not be used, use `tag` instead.
380
343
  */
381
- readonly [variantOrdinalSymbol]: 1;
344
+ readonly [uniffiTypeNameSymbol]: "DlcError";
382
345
  name: string;
383
346
  message: string;
384
347
  stack?: string;
@@ -387,35 +350,49 @@ export declare const DlcError: {
387
350
  isError(error: unknown): error is Error;
388
351
  };
389
352
  InvalidPublicKey: {
390
- new (message: string): {
353
+ new (): {
391
354
  readonly tag: DlcError_Tags.InvalidPublicKey;
392
355
  /**
393
356
  * @private
394
- * This field is private and should not be used.
357
+ * This field is private and should not be used, use `tag` instead.
395
358
  */
396
- readonly [uniffiTypeNameSymbol]: string;
359
+ readonly [uniffiTypeNameSymbol]: "DlcError";
360
+ name: string;
361
+ message: string;
362
+ stack?: string;
363
+ cause?: unknown;
364
+ };
365
+ "new"(): {
366
+ readonly tag: DlcError_Tags.InvalidPublicKey;
397
367
  /**
398
368
  * @private
399
- * This field is private and should not be used.
369
+ * This field is private and should not be used, use `tag` instead.
400
370
  */
401
- readonly [variantOrdinalSymbol]: 2;
371
+ readonly [uniffiTypeNameSymbol]: "DlcError";
402
372
  name: string;
403
373
  message: string;
404
374
  stack?: string;
405
375
  cause?: unknown;
406
376
  };
407
- instanceOf(e: any): e is {
377
+ instanceOf(obj: any): obj is {
408
378
  readonly tag: DlcError_Tags.InvalidPublicKey;
409
379
  /**
410
380
  * @private
411
- * This field is private and should not be used.
381
+ * This field is private and should not be used, use `tag` instead.
412
382
  */
413
- readonly [uniffiTypeNameSymbol]: string;
383
+ readonly [uniffiTypeNameSymbol]: "DlcError";
384
+ name: string;
385
+ message: string;
386
+ stack?: string;
387
+ cause?: unknown;
388
+ };
389
+ hasInner(obj: any): obj is {
390
+ readonly tag: DlcError_Tags.InvalidPublicKey;
414
391
  /**
415
392
  * @private
416
- * This field is private and should not be used.
393
+ * This field is private and should not be used, use `tag` instead.
417
394
  */
418
- readonly [variantOrdinalSymbol]: 2;
395
+ readonly [uniffiTypeNameSymbol]: "DlcError";
419
396
  name: string;
420
397
  message: string;
421
398
  stack?: string;
@@ -424,35 +401,49 @@ export declare const DlcError: {
424
401
  isError(error: unknown): error is Error;
425
402
  };
426
403
  InvalidTransaction: {
427
- new (message: string): {
404
+ new (): {
428
405
  readonly tag: DlcError_Tags.InvalidTransaction;
429
406
  /**
430
407
  * @private
431
- * This field is private and should not be used.
408
+ * This field is private and should not be used, use `tag` instead.
432
409
  */
433
- readonly [uniffiTypeNameSymbol]: string;
410
+ readonly [uniffiTypeNameSymbol]: "DlcError";
411
+ name: string;
412
+ message: string;
413
+ stack?: string;
414
+ cause?: unknown;
415
+ };
416
+ "new"(): {
417
+ readonly tag: DlcError_Tags.InvalidTransaction;
434
418
  /**
435
419
  * @private
436
- * This field is private and should not be used.
420
+ * This field is private and should not be used, use `tag` instead.
437
421
  */
438
- readonly [variantOrdinalSymbol]: 3;
422
+ readonly [uniffiTypeNameSymbol]: "DlcError";
439
423
  name: string;
440
424
  message: string;
441
425
  stack?: string;
442
426
  cause?: unknown;
443
427
  };
444
- instanceOf(e: any): e is {
428
+ instanceOf(obj: any): obj is {
445
429
  readonly tag: DlcError_Tags.InvalidTransaction;
446
430
  /**
447
431
  * @private
448
- * This field is private and should not be used.
432
+ * This field is private and should not be used, use `tag` instead.
449
433
  */
450
- readonly [uniffiTypeNameSymbol]: string;
434
+ readonly [uniffiTypeNameSymbol]: "DlcError";
435
+ name: string;
436
+ message: string;
437
+ stack?: string;
438
+ cause?: unknown;
439
+ };
440
+ hasInner(obj: any): obj is {
441
+ readonly tag: DlcError_Tags.InvalidTransaction;
451
442
  /**
452
443
  * @private
453
- * This field is private and should not be used.
444
+ * This field is private and should not be used, use `tag` instead.
454
445
  */
455
- readonly [variantOrdinalSymbol]: 3;
446
+ readonly [uniffiTypeNameSymbol]: "DlcError";
456
447
  name: string;
457
448
  message: string;
458
449
  stack?: string;
@@ -461,35 +452,49 @@ export declare const DlcError: {
461
452
  isError(error: unknown): error is Error;
462
453
  };
463
454
  InsufficientFunds: {
464
- new (message: string): {
455
+ new (): {
465
456
  readonly tag: DlcError_Tags.InsufficientFunds;
466
457
  /**
467
458
  * @private
468
- * This field is private and should not be used.
459
+ * This field is private and should not be used, use `tag` instead.
469
460
  */
470
- readonly [uniffiTypeNameSymbol]: string;
461
+ readonly [uniffiTypeNameSymbol]: "DlcError";
462
+ name: string;
463
+ message: string;
464
+ stack?: string;
465
+ cause?: unknown;
466
+ };
467
+ "new"(): {
468
+ readonly tag: DlcError_Tags.InsufficientFunds;
471
469
  /**
472
470
  * @private
473
- * This field is private and should not be used.
471
+ * This field is private and should not be used, use `tag` instead.
474
472
  */
475
- readonly [variantOrdinalSymbol]: 4;
473
+ readonly [uniffiTypeNameSymbol]: "DlcError";
476
474
  name: string;
477
475
  message: string;
478
476
  stack?: string;
479
477
  cause?: unknown;
480
478
  };
481
- instanceOf(e: any): e is {
479
+ instanceOf(obj: any): obj is {
482
480
  readonly tag: DlcError_Tags.InsufficientFunds;
483
481
  /**
484
482
  * @private
485
- * This field is private and should not be used.
483
+ * This field is private and should not be used, use `tag` instead.
486
484
  */
487
- readonly [uniffiTypeNameSymbol]: string;
485
+ readonly [uniffiTypeNameSymbol]: "DlcError";
486
+ name: string;
487
+ message: string;
488
+ stack?: string;
489
+ cause?: unknown;
490
+ };
491
+ hasInner(obj: any): obj is {
492
+ readonly tag: DlcError_Tags.InsufficientFunds;
488
493
  /**
489
494
  * @private
490
- * This field is private and should not be used.
495
+ * This field is private and should not be used, use `tag` instead.
491
496
  */
492
- readonly [variantOrdinalSymbol]: 4;
497
+ readonly [uniffiTypeNameSymbol]: "DlcError";
493
498
  name: string;
494
499
  message: string;
495
500
  stack?: string;
@@ -498,72 +503,133 @@ export declare const DlcError: {
498
503
  isError(error: unknown): error is Error;
499
504
  };
500
505
  InvalidArgument: {
501
- new (message: string): {
506
+ new (inner: {
507
+ message: string;
508
+ }): {
502
509
  readonly tag: DlcError_Tags.InvalidArgument;
510
+ readonly inner: Readonly<{
511
+ message: string;
512
+ }>;
503
513
  /**
504
514
  * @private
505
- * This field is private and should not be used.
515
+ * This field is private and should not be used, use `tag` instead.
506
516
  */
507
- readonly [uniffiTypeNameSymbol]: string;
517
+ readonly [uniffiTypeNameSymbol]: "DlcError";
518
+ name: string;
519
+ message: string;
520
+ stack?: string;
521
+ cause?: unknown;
522
+ };
523
+ "new"(inner: {
524
+ message: string;
525
+ }): {
526
+ readonly tag: DlcError_Tags.InvalidArgument;
527
+ readonly inner: Readonly<{
528
+ message: string;
529
+ }>;
508
530
  /**
509
531
  * @private
510
- * This field is private and should not be used.
532
+ * This field is private and should not be used, use `tag` instead.
511
533
  */
512
- readonly [variantOrdinalSymbol]: 5;
534
+ readonly [uniffiTypeNameSymbol]: "DlcError";
513
535
  name: string;
514
536
  message: string;
515
537
  stack?: string;
516
538
  cause?: unknown;
517
539
  };
518
- instanceOf(e: any): e is {
540
+ instanceOf(obj: any): obj is {
519
541
  readonly tag: DlcError_Tags.InvalidArgument;
542
+ readonly inner: Readonly<{
543
+ message: string;
544
+ }>;
520
545
  /**
521
546
  * @private
522
- * This field is private and should not be used.
547
+ * This field is private and should not be used, use `tag` instead.
523
548
  */
524
- readonly [uniffiTypeNameSymbol]: string;
549
+ readonly [uniffiTypeNameSymbol]: "DlcError";
550
+ name: string;
551
+ message: string;
552
+ stack?: string;
553
+ cause?: unknown;
554
+ };
555
+ hasInner(obj: any): obj is {
556
+ readonly tag: DlcError_Tags.InvalidArgument;
557
+ readonly inner: Readonly<{
558
+ message: string;
559
+ }>;
525
560
  /**
526
561
  * @private
527
- * This field is private and should not be used.
562
+ * This field is private and should not be used, use `tag` instead.
528
563
  */
529
- readonly [variantOrdinalSymbol]: 5;
564
+ readonly [uniffiTypeNameSymbol]: "DlcError";
530
565
  name: string;
531
566
  message: string;
532
567
  stack?: string;
533
568
  cause?: unknown;
534
569
  };
570
+ getInner(obj: {
571
+ readonly tag: DlcError_Tags.InvalidArgument;
572
+ readonly inner: Readonly<{
573
+ message: string;
574
+ }>;
575
+ /**
576
+ * @private
577
+ * This field is private and should not be used, use `tag` instead.
578
+ */
579
+ readonly [uniffiTypeNameSymbol]: "DlcError";
580
+ name: string;
581
+ message: string;
582
+ stack?: string;
583
+ cause?: unknown;
584
+ }): Readonly<{
585
+ message: string;
586
+ }>;
535
587
  isError(error: unknown): error is Error;
536
588
  };
537
589
  SerializationError: {
538
- new (message: string): {
590
+ new (): {
539
591
  readonly tag: DlcError_Tags.SerializationError;
540
592
  /**
541
593
  * @private
542
- * This field is private and should not be used.
594
+ * This field is private and should not be used, use `tag` instead.
543
595
  */
544
- readonly [uniffiTypeNameSymbol]: string;
596
+ readonly [uniffiTypeNameSymbol]: "DlcError";
597
+ name: string;
598
+ message: string;
599
+ stack?: string;
600
+ cause?: unknown;
601
+ };
602
+ "new"(): {
603
+ readonly tag: DlcError_Tags.SerializationError;
545
604
  /**
546
605
  * @private
547
- * This field is private and should not be used.
606
+ * This field is private and should not be used, use `tag` instead.
548
607
  */
549
- readonly [variantOrdinalSymbol]: 6;
608
+ readonly [uniffiTypeNameSymbol]: "DlcError";
550
609
  name: string;
551
610
  message: string;
552
611
  stack?: string;
553
612
  cause?: unknown;
554
613
  };
555
- instanceOf(e: any): e is {
614
+ instanceOf(obj: any): obj is {
556
615
  readonly tag: DlcError_Tags.SerializationError;
557
616
  /**
558
617
  * @private
559
- * This field is private and should not be used.
618
+ * This field is private and should not be used, use `tag` instead.
560
619
  */
561
- readonly [uniffiTypeNameSymbol]: string;
620
+ readonly [uniffiTypeNameSymbol]: "DlcError";
621
+ name: string;
622
+ message: string;
623
+ stack?: string;
624
+ cause?: unknown;
625
+ };
626
+ hasInner(obj: any): obj is {
627
+ readonly tag: DlcError_Tags.SerializationError;
562
628
  /**
563
629
  * @private
564
- * This field is private and should not be used.
630
+ * This field is private and should not be used, use `tag` instead.
565
631
  */
566
- readonly [variantOrdinalSymbol]: 6;
632
+ readonly [uniffiTypeNameSymbol]: "DlcError";
567
633
  name: string;
568
634
  message: string;
569
635
  stack?: string;
@@ -572,146 +638,133 @@ export declare const DlcError: {
572
638
  isError(error: unknown): error is Error;
573
639
  };
574
640
  Secp256k1Error: {
575
- new (message: string): {
641
+ new (inner: {
642
+ message: string;
643
+ }): {
576
644
  readonly tag: DlcError_Tags.Secp256k1Error;
645
+ readonly inner: Readonly<{
646
+ message: string;
647
+ }>;
577
648
  /**
578
649
  * @private
579
- * This field is private and should not be used.
650
+ * This field is private and should not be used, use `tag` instead.
580
651
  */
581
- readonly [uniffiTypeNameSymbol]: string;
582
- /**
583
- * @private
584
- * This field is private and should not be used.
585
- */
586
- readonly [variantOrdinalSymbol]: 7;
652
+ readonly [uniffiTypeNameSymbol]: "DlcError";
587
653
  name: string;
588
654
  message: string;
589
655
  stack?: string;
590
656
  cause?: unknown;
591
657
  };
592
- instanceOf(e: any): e is {
658
+ "new"(inner: {
659
+ message: string;
660
+ }): {
593
661
  readonly tag: DlcError_Tags.Secp256k1Error;
662
+ readonly inner: Readonly<{
663
+ message: string;
664
+ }>;
594
665
  /**
595
666
  * @private
596
- * This field is private and should not be used.
667
+ * This field is private and should not be used, use `tag` instead.
597
668
  */
598
- readonly [uniffiTypeNameSymbol]: string;
599
- /**
600
- * @private
601
- * This field is private and should not be used.
602
- */
603
- readonly [variantOrdinalSymbol]: 7;
669
+ readonly [uniffiTypeNameSymbol]: "DlcError";
604
670
  name: string;
605
671
  message: string;
606
672
  stack?: string;
607
673
  cause?: unknown;
608
674
  };
609
- isError(error: unknown): error is Error;
610
- };
611
- MiniscriptError: {
612
- new (message: string): {
613
- readonly tag: DlcError_Tags.MiniscriptError;
614
- /**
615
- * @private
616
- * This field is private and should not be used.
617
- */
618
- readonly [uniffiTypeNameSymbol]: string;
675
+ instanceOf(obj: any): obj is {
676
+ readonly tag: DlcError_Tags.Secp256k1Error;
677
+ readonly inner: Readonly<{
678
+ message: string;
679
+ }>;
619
680
  /**
620
681
  * @private
621
- * This field is private and should not be used.
682
+ * This field is private and should not be used, use `tag` instead.
622
683
  */
623
- readonly [variantOrdinalSymbol]: 8;
684
+ readonly [uniffiTypeNameSymbol]: "DlcError";
624
685
  name: string;
625
686
  message: string;
626
687
  stack?: string;
627
688
  cause?: unknown;
628
689
  };
629
- instanceOf(e: any): e is {
630
- readonly tag: DlcError_Tags.MiniscriptError;
690
+ hasInner(obj: any): obj is {
691
+ readonly tag: DlcError_Tags.Secp256k1Error;
692
+ readonly inner: Readonly<{
693
+ message: string;
694
+ }>;
631
695
  /**
632
696
  * @private
633
- * This field is private and should not be used.
697
+ * This field is private and should not be used, use `tag` instead.
634
698
  */
635
- readonly [uniffiTypeNameSymbol]: string;
699
+ readonly [uniffiTypeNameSymbol]: "DlcError";
700
+ name: string;
701
+ message: string;
702
+ stack?: string;
703
+ cause?: unknown;
704
+ };
705
+ getInner(obj: {
706
+ readonly tag: DlcError_Tags.Secp256k1Error;
707
+ readonly inner: Readonly<{
708
+ message: string;
709
+ }>;
636
710
  /**
637
711
  * @private
638
- * This field is private and should not be used.
712
+ * This field is private and should not be used, use `tag` instead.
639
713
  */
640
- readonly [variantOrdinalSymbol]: 8;
714
+ readonly [uniffiTypeNameSymbol]: "DlcError";
641
715
  name: string;
642
716
  message: string;
643
717
  stack?: string;
644
718
  cause?: unknown;
645
- };
719
+ }): Readonly<{
720
+ message: string;
721
+ }>;
646
722
  isError(error: unknown): error is Error;
647
723
  };
648
- InvalidNetwork: {
649
- new (message: string): {
650
- readonly tag: DlcError_Tags.InvalidNetwork;
651
- /**
652
- * @private
653
- * This field is private and should not be used.
654
- */
655
- readonly [uniffiTypeNameSymbol]: string;
724
+ MiniscriptError: {
725
+ new (): {
726
+ readonly tag: DlcError_Tags.MiniscriptError;
656
727
  /**
657
728
  * @private
658
- * This field is private and should not be used.
729
+ * This field is private and should not be used, use `tag` instead.
659
730
  */
660
- readonly [variantOrdinalSymbol]: 9;
731
+ readonly [uniffiTypeNameSymbol]: "DlcError";
661
732
  name: string;
662
733
  message: string;
663
734
  stack?: string;
664
735
  cause?: unknown;
665
736
  };
666
- instanceOf(e: any): e is {
667
- readonly tag: DlcError_Tags.InvalidNetwork;
668
- /**
669
- * @private
670
- * This field is private and should not be used.
671
- */
672
- readonly [uniffiTypeNameSymbol]: string;
737
+ "new"(): {
738
+ readonly tag: DlcError_Tags.MiniscriptError;
673
739
  /**
674
740
  * @private
675
- * This field is private and should not be used.
741
+ * This field is private and should not be used, use `tag` instead.
676
742
  */
677
- readonly [variantOrdinalSymbol]: 9;
743
+ readonly [uniffiTypeNameSymbol]: "DlcError";
678
744
  name: string;
679
745
  message: string;
680
746
  stack?: string;
681
747
  cause?: unknown;
682
748
  };
683
- isError(error: unknown): error is Error;
684
- };
685
- KeyError: {
686
- new (message: string): {
687
- readonly tag: DlcError_Tags.KeyError;
688
- /**
689
- * @private
690
- * This field is private and should not be used.
691
- */
692
- readonly [uniffiTypeNameSymbol]: string;
749
+ instanceOf(obj: any): obj is {
750
+ readonly tag: DlcError_Tags.MiniscriptError;
693
751
  /**
694
752
  * @private
695
- * This field is private and should not be used.
753
+ * This field is private and should not be used, use `tag` instead.
696
754
  */
697
- readonly [variantOrdinalSymbol]: 10;
755
+ readonly [uniffiTypeNameSymbol]: "DlcError";
698
756
  name: string;
699
757
  message: string;
700
758
  stack?: string;
701
759
  cause?: unknown;
702
760
  };
703
- instanceOf(e: any): e is {
704
- readonly tag: DlcError_Tags.KeyError;
705
- /**
706
- * @private
707
- * This field is private and should not be used.
708
- */
709
- readonly [uniffiTypeNameSymbol]: string;
761
+ hasInner(obj: any): obj is {
762
+ readonly tag: DlcError_Tags.MiniscriptError;
710
763
  /**
711
764
  * @private
712
- * This field is private and should not be used.
765
+ * This field is private and should not be used, use `tag` instead.
713
766
  */
714
- readonly [variantOrdinalSymbol]: 10;
767
+ readonly [uniffiTypeNameSymbol]: "DlcError";
715
768
  name: string;
716
769
  message: string;
717
770
  stack?: string;
@@ -719,83 +772,50 @@ export declare const DlcError: {
719
772
  };
720
773
  isError(error: unknown): error is Error;
721
774
  };
722
- instanceOf: (e: any) => e is DlcError;
723
- };
724
- export type DlcError = InstanceType<typeof DlcError[keyof Omit<typeof DlcError, 'instanceOf'>]>;
725
- export declare enum ExtendedKey_Tags {
726
- InvalidMnemonic = "InvalidMnemonic",
727
- InvalidXpriv = "InvalidXpriv",
728
- InvalidXpub = "InvalidXpub",
729
- InvalidDerivationPath = "InvalidDerivationPath"
730
- }
731
- export declare const ExtendedKey: {
732
- InvalidMnemonic: {
733
- new (message: string): {
734
- readonly tag: ExtendedKey_Tags.InvalidMnemonic;
735
- /**
736
- * @private
737
- * This field is private and should not be used.
738
- */
739
- readonly [uniffiTypeNameSymbol]: string;
775
+ InvalidNetwork: {
776
+ new (): {
777
+ readonly tag: DlcError_Tags.InvalidNetwork;
740
778
  /**
741
779
  * @private
742
- * This field is private and should not be used.
780
+ * This field is private and should not be used, use `tag` instead.
743
781
  */
744
- readonly [variantOrdinalSymbol]: 1;
782
+ readonly [uniffiTypeNameSymbol]: "DlcError";
745
783
  name: string;
746
784
  message: string;
747
785
  stack?: string;
748
786
  cause?: unknown;
749
787
  };
750
- instanceOf(e: any): e is {
751
- readonly tag: ExtendedKey_Tags.InvalidMnemonic;
752
- /**
753
- * @private
754
- * This field is private and should not be used.
755
- */
756
- readonly [uniffiTypeNameSymbol]: string;
788
+ "new"(): {
789
+ readonly tag: DlcError_Tags.InvalidNetwork;
757
790
  /**
758
791
  * @private
759
- * This field is private and should not be used.
792
+ * This field is private and should not be used, use `tag` instead.
760
793
  */
761
- readonly [variantOrdinalSymbol]: 1;
794
+ readonly [uniffiTypeNameSymbol]: "DlcError";
762
795
  name: string;
763
796
  message: string;
764
797
  stack?: string;
765
798
  cause?: unknown;
766
799
  };
767
- isError(error: unknown): error is Error;
768
- };
769
- InvalidXpriv: {
770
- new (message: string): {
771
- readonly tag: ExtendedKey_Tags.InvalidXpriv;
772
- /**
773
- * @private
774
- * This field is private and should not be used.
775
- */
776
- readonly [uniffiTypeNameSymbol]: string;
800
+ instanceOf(obj: any): obj is {
801
+ readonly tag: DlcError_Tags.InvalidNetwork;
777
802
  /**
778
803
  * @private
779
- * This field is private and should not be used.
804
+ * This field is private and should not be used, use `tag` instead.
780
805
  */
781
- readonly [variantOrdinalSymbol]: 2;
806
+ readonly [uniffiTypeNameSymbol]: "DlcError";
782
807
  name: string;
783
808
  message: string;
784
809
  stack?: string;
785
810
  cause?: unknown;
786
811
  };
787
- instanceOf(e: any): e is {
788
- readonly tag: ExtendedKey_Tags.InvalidXpriv;
789
- /**
790
- * @private
791
- * This field is private and should not be used.
792
- */
793
- readonly [uniffiTypeNameSymbol]: string;
812
+ hasInner(obj: any): obj is {
813
+ readonly tag: DlcError_Tags.InvalidNetwork;
794
814
  /**
795
815
  * @private
796
- * This field is private and should not be used.
816
+ * This field is private and should not be used, use `tag` instead.
797
817
  */
798
- readonly [variantOrdinalSymbol]: 2;
818
+ readonly [uniffiTypeNameSymbol]: "DlcError";
799
819
  name: string;
800
820
  message: string;
801
821
  stack?: string;
@@ -803,83 +823,92 @@ export declare const ExtendedKey: {
803
823
  };
804
824
  isError(error: unknown): error is Error;
805
825
  };
806
- InvalidXpub: {
807
- new (message: string): {
808
- readonly tag: ExtendedKey_Tags.InvalidXpub;
809
- /**
810
- * @private
811
- * This field is private and should not be used.
812
- */
813
- readonly [uniffiTypeNameSymbol]: string;
826
+ KeyError: {
827
+ new (inner: {
828
+ key: ExtendedKey;
829
+ }): {
830
+ readonly tag: DlcError_Tags.KeyError;
831
+ readonly inner: Readonly<{
832
+ key: ExtendedKey;
833
+ }>;
814
834
  /**
815
835
  * @private
816
- * This field is private and should not be used.
836
+ * This field is private and should not be used, use `tag` instead.
817
837
  */
818
- readonly [variantOrdinalSymbol]: 3;
838
+ readonly [uniffiTypeNameSymbol]: "DlcError";
819
839
  name: string;
820
840
  message: string;
821
841
  stack?: string;
822
842
  cause?: unknown;
823
843
  };
824
- instanceOf(e: any): e is {
825
- readonly tag: ExtendedKey_Tags.InvalidXpub;
826
- /**
827
- * @private
828
- * This field is private and should not be used.
829
- */
830
- readonly [uniffiTypeNameSymbol]: string;
844
+ "new"(inner: {
845
+ key: ExtendedKey;
846
+ }): {
847
+ readonly tag: DlcError_Tags.KeyError;
848
+ readonly inner: Readonly<{
849
+ key: ExtendedKey;
850
+ }>;
831
851
  /**
832
852
  * @private
833
- * This field is private and should not be used.
853
+ * This field is private and should not be used, use `tag` instead.
834
854
  */
835
- readonly [variantOrdinalSymbol]: 3;
855
+ readonly [uniffiTypeNameSymbol]: "DlcError";
836
856
  name: string;
837
857
  message: string;
838
858
  stack?: string;
839
859
  cause?: unknown;
840
860
  };
841
- isError(error: unknown): error is Error;
842
- };
843
- InvalidDerivationPath: {
844
- new (message: string): {
845
- readonly tag: ExtendedKey_Tags.InvalidDerivationPath;
846
- /**
847
- * @private
848
- * This field is private and should not be used.
849
- */
850
- readonly [uniffiTypeNameSymbol]: string;
861
+ instanceOf(obj: any): obj is {
862
+ readonly tag: DlcError_Tags.KeyError;
863
+ readonly inner: Readonly<{
864
+ key: ExtendedKey;
865
+ }>;
851
866
  /**
852
867
  * @private
853
- * This field is private and should not be used.
868
+ * This field is private and should not be used, use `tag` instead.
854
869
  */
855
- readonly [variantOrdinalSymbol]: 4;
870
+ readonly [uniffiTypeNameSymbol]: "DlcError";
856
871
  name: string;
857
872
  message: string;
858
873
  stack?: string;
859
874
  cause?: unknown;
860
875
  };
861
- instanceOf(e: any): e is {
862
- readonly tag: ExtendedKey_Tags.InvalidDerivationPath;
876
+ hasInner(obj: any): obj is {
877
+ readonly tag: DlcError_Tags.KeyError;
878
+ readonly inner: Readonly<{
879
+ key: ExtendedKey;
880
+ }>;
863
881
  /**
864
882
  * @private
865
- * This field is private and should not be used.
883
+ * This field is private and should not be used, use `tag` instead.
866
884
  */
867
- readonly [uniffiTypeNameSymbol]: string;
885
+ readonly [uniffiTypeNameSymbol]: "DlcError";
886
+ name: string;
887
+ message: string;
888
+ stack?: string;
889
+ cause?: unknown;
890
+ };
891
+ getInner(obj: {
892
+ readonly tag: DlcError_Tags.KeyError;
893
+ readonly inner: Readonly<{
894
+ key: ExtendedKey;
895
+ }>;
868
896
  /**
869
897
  * @private
870
- * This field is private and should not be used.
898
+ * This field is private and should not be used, use `tag` instead.
871
899
  */
872
- readonly [variantOrdinalSymbol]: 4;
900
+ readonly [uniffiTypeNameSymbol]: "DlcError";
873
901
  name: string;
874
902
  message: string;
875
903
  stack?: string;
876
904
  cause?: unknown;
877
- };
905
+ }): Readonly<{
906
+ key: ExtendedKey;
907
+ }>;
878
908
  isError(error: unknown): error is Error;
879
909
  };
880
- instanceOf: (e: any) => e is ExtendedKey;
881
- };
882
- export type ExtendedKey = InstanceType<typeof ExtendedKey[keyof Omit<typeof ExtendedKey, 'instanceOf'>]>;
910
+ }>;
911
+ export type DlcError = InstanceType<(typeof DlcError)['InvalidSignature' | 'InvalidPublicKey' | 'InvalidTransaction' | 'InsufficientFunds' | 'InvalidArgument' | 'SerializationError' | 'Secp256k1Error' | 'MiniscriptError' | 'InvalidNetwork' | 'KeyError']>;
883
912
  /**
884
913
  * This should be called before anything else.
885
914
  *
@@ -899,98 +928,98 @@ declare const _default: Readonly<{
899
928
  write(value: AdaptorSignature, into: RustBuffer): void;
900
929
  allocationSize(value: AdaptorSignature): number;
901
930
  lift(value: UniffiByteArray): AdaptorSignature;
902
- lower(value: AdaptorSignature): UniffiByteArray;
931
+ lower(value: AdaptorSignature, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
903
932
  };
904
933
  FfiConverterTypeCetAdaptorSignatureDebugInfo: {
905
934
  read(from: RustBuffer): CetAdaptorSignatureDebugInfo;
906
935
  write(value: CetAdaptorSignatureDebugInfo, into: RustBuffer): void;
907
936
  allocationSize(value: CetAdaptorSignatureDebugInfo): number;
908
937
  lift(value: UniffiByteArray): CetAdaptorSignatureDebugInfo;
909
- lower(value: CetAdaptorSignatureDebugInfo): UniffiByteArray;
938
+ lower(value: CetAdaptorSignatureDebugInfo, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
910
939
  };
911
940
  FfiConverterTypeChangeOutputAndFees: {
912
941
  read(from: RustBuffer): ChangeOutputAndFees;
913
942
  write(value: ChangeOutputAndFees, into: RustBuffer): void;
914
943
  allocationSize(value: ChangeOutputAndFees): number;
915
944
  lift(value: UniffiByteArray): ChangeOutputAndFees;
916
- lower(value: ChangeOutputAndFees): UniffiByteArray;
945
+ lower(value: ChangeOutputAndFees, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
917
946
  };
918
947
  FfiConverterTypeDLCError: {
919
948
  read(from: RustBuffer): DlcError;
920
949
  write(value: DlcError, into: RustBuffer): void;
921
950
  allocationSize(value: DlcError): number;
922
951
  lift(value: UniffiByteArray): DlcError;
923
- lower(value: DlcError): UniffiByteArray;
952
+ lower(value: DlcError, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
924
953
  };
925
954
  FfiConverterTypeDlcInputInfo: {
926
955
  read(from: RustBuffer): DlcInputInfo;
927
956
  write(value: DlcInputInfo, into: RustBuffer): void;
928
957
  allocationSize(value: DlcInputInfo): number;
929
958
  lift(value: UniffiByteArray): DlcInputInfo;
930
- lower(value: DlcInputInfo): UniffiByteArray;
959
+ lower(value: DlcInputInfo, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
931
960
  };
932
961
  FfiConverterTypeDlcTransactions: {
933
962
  read(from: RustBuffer): DlcTransactions;
934
963
  write(value: DlcTransactions, into: RustBuffer): void;
935
964
  allocationSize(value: DlcTransactions): number;
936
965
  lift(value: UniffiByteArray): DlcTransactions;
937
- lower(value: DlcTransactions): UniffiByteArray;
966
+ lower(value: DlcTransactions, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
938
967
  };
939
968
  FfiConverterTypeExtendedKey: {
940
969
  read(from: RustBuffer): ExtendedKey;
941
970
  write(value: ExtendedKey, into: RustBuffer): void;
942
971
  allocationSize(value: ExtendedKey): number;
943
972
  lift(value: UniffiByteArray): ExtendedKey;
944
- lower(value: ExtendedKey): UniffiByteArray;
973
+ lower(value: ExtendedKey, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
945
974
  };
946
975
  FfiConverterTypeOracleInfo: {
947
976
  read(from: RustBuffer): OracleInfo;
948
977
  write(value: OracleInfo, into: RustBuffer): void;
949
978
  allocationSize(value: OracleInfo): number;
950
979
  lift(value: UniffiByteArray): OracleInfo;
951
- lower(value: OracleInfo): UniffiByteArray;
980
+ lower(value: OracleInfo, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
952
981
  };
953
982
  FfiConverterTypePartyParams: {
954
983
  read(from: RustBuffer): PartyParams;
955
984
  write(value: PartyParams, into: RustBuffer): void;
956
985
  allocationSize(value: PartyParams): number;
957
986
  lift(value: UniffiByteArray): PartyParams;
958
- lower(value: PartyParams): UniffiByteArray;
987
+ lower(value: PartyParams, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
959
988
  };
960
989
  FfiConverterTypePayout: {
961
990
  read(from: RustBuffer): Payout;
962
991
  write(value: Payout, into: RustBuffer): void;
963
992
  allocationSize(value: Payout): number;
964
993
  lift(value: UniffiByteArray): Payout;
965
- lower(value: Payout): UniffiByteArray;
994
+ lower(value: Payout, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
966
995
  };
967
996
  FfiConverterTypeTransaction: {
968
997
  read(from: RustBuffer): Transaction;
969
998
  write(value: Transaction, into: RustBuffer): void;
970
999
  allocationSize(value: Transaction): number;
971
1000
  lift(value: UniffiByteArray): Transaction;
972
- lower(value: Transaction): UniffiByteArray;
1001
+ lower(value: Transaction, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
973
1002
  };
974
1003
  FfiConverterTypeTxInput: {
975
1004
  read(from: RustBuffer): TxInput;
976
1005
  write(value: TxInput, into: RustBuffer): void;
977
1006
  allocationSize(value: TxInput): number;
978
1007
  lift(value: UniffiByteArray): TxInput;
979
- lower(value: TxInput): UniffiByteArray;
1008
+ lower(value: TxInput, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
980
1009
  };
981
1010
  FfiConverterTypeTxInputInfo: {
982
1011
  read(from: RustBuffer): TxInputInfo;
983
1012
  write(value: TxInputInfo, into: RustBuffer): void;
984
1013
  allocationSize(value: TxInputInfo): number;
985
1014
  lift(value: UniffiByteArray): TxInputInfo;
986
- lower(value: TxInputInfo): UniffiByteArray;
1015
+ lower(value: TxInputInfo, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
987
1016
  };
988
1017
  FfiConverterTypeTxOutput: {
989
1018
  read(from: RustBuffer): TxOutput;
990
1019
  write(value: TxOutput, into: RustBuffer): void;
991
1020
  allocationSize(value: TxOutput): number;
992
1021
  lift(value: UniffiByteArray): TxOutput;
993
- lower(value: TxOutput): UniffiByteArray;
1022
+ lower(value: TxOutput, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
994
1023
  };
995
1024
  };
996
1025
  }>;