11namespace bdk {};
22
3+ // ------------------------------------------------------------------------
4+ // bdk crate - error module
5+ // ------------------------------------------------------------------------
6+
7+ [Error]
8+ enum Alpha3Error {
9+ "Generic"
10+ };
11+
12+ [Error]
13+ interface CalculateFeeError {
14+ MissingTxOut(sequence<OutPoint> out_points);
15+ NegativeFee(i64 fee);
16+ };
17+
318// ------------------------------------------------------------------------
419// bdk crate - types module
520// ------------------------------------------------------------------------
@@ -36,7 +51,7 @@ dictionary Balance {
3651 u64 total;
3752};
3853
39- dictionary LocalUtxo {
54+ dictionary LocalOutput {
4055 OutPoint outpoint;
4156 TxOut txout;
4257 KeychainKind keychain;
@@ -52,42 +67,6 @@ dictionary TxOut {
5267// bdk crate - wallet module
5368// ------------------------------------------------------------------------
5469
55- [Error]
56- enum BdkError {
57- "Generic",
58- "NoRecipients",
59- "NoUtxosSelected",
60- "OutputBelowDustLimit",
61- "InsufficientFunds",
62- "BnBTotalTriesExceeded",
63- "BnBNoExactMatch",
64- "UnknownUtxo",
65- "TransactionNotFound",
66- "TransactionConfirmed",
67- "IrreplaceableTransaction",
68- "FeeRateTooLow",
69- "FeeTooLow",
70- "FeeRateUnavailable",
71- "MissingKeyOrigin",
72- "Key",
73- "ChecksumMismatch",
74- "SpendingPolicyRequired",
75- "InvalidPolicyPathError",
76- "Signer",
77- "InvalidOutpoint",
78- "Descriptor",
79- "Miniscript",
80- "MiniscriptPsbt",
81- "Bip32",
82- "Psbt",
83- };
84-
85- [Error]
86- interface CalculateFeeError {
87- MissingTxOut(sequence<OutPoint> out_points);
88- NegativeFee(i64 fee);
89- };
90-
9170interface FeeRate {
9271 f32 as_sat_per_vb();
9372 f32 sat_per_kwu();
@@ -100,7 +79,7 @@ enum ChangeSpendPolicy {
10079};
10180
10281interface Wallet {
103- [Name=new_no_persist, Throws=BdkError ]
82+ [Name=new_no_persist, Throws=Alpha3Error ]
10483 constructor(Descriptor descriptor, Descriptor? change_descriptor, Network network);
10584
10685 AddressInfo get_address(AddressIndex address_index);
@@ -113,10 +92,10 @@ interface Wallet {
11392
11493 boolean is_mine([ByRef] Script script);
11594
116- [Throws=BdkError ]
95+ [Throws=Alpha3Error ]
11796 void apply_update(Update update);
11897
119- [Throws=BdkError ]
98+ [Throws=Alpha3Error ]
12099 boolean sign(PartiallySignedTransaction psbt);
121100
122101 SentAndReceivedValues sent_and_received([ByRef] Transaction tx);
@@ -165,7 +144,7 @@ interface TxBuilder {
165144
166145 TxBuilder enable_rbf_with_sequence(u32 nsequence);
167146
168- [Throws=BdkError ]
147+ [Throws=Alpha3Error ]
169148 PartiallySignedTransaction finish([ByRef] Wallet wallet);
170149};
171150
@@ -178,7 +157,7 @@ interface BumpFeeTxBuilder {
178157
179158 BumpFeeTxBuilder enable_rbf_with_sequence(u32 nsequence);
180159
181- [Throws=BdkError ]
160+ [Throws=Alpha3Error ]
182161 PartiallySignedTransaction finish([ByRef] Wallet wallet);
183162};
184163
@@ -189,30 +168,30 @@ interface BumpFeeTxBuilder {
189168interface Mnemonic {
190169 constructor(WordCount word_count);
191170
192- [Name=from_string, Throws=BdkError ]
171+ [Name=from_string, Throws=Alpha3Error ]
193172 constructor(string mnemonic);
194173
195- [Name=from_entropy, Throws=BdkError ]
174+ [Name=from_entropy, Throws=Alpha3Error ]
196175 constructor(sequence<u8> entropy);
197176
198177 string as_string();
199178};
200179
201180interface DerivationPath {
202- [Throws=BdkError ]
181+ [Throws=Alpha3Error ]
203182 constructor(string path);
204183};
205184
206185interface DescriptorSecretKey {
207186 constructor(Network network, [ByRef] Mnemonic mnemonic, string? password);
208187
209- [Name=from_string, Throws=BdkError ]
188+ [Name=from_string, Throws=Alpha3Error ]
210189 constructor(string secret_key);
211190
212- [Throws=BdkError ]
191+ [Throws=Alpha3Error ]
213192 DescriptorSecretKey derive([ByRef] DerivationPath path);
214193
215- [Throws=BdkError ]
194+ [Throws=Alpha3Error ]
216195 DescriptorSecretKey extend([ByRef] DerivationPath path);
217196
218197 DescriptorPublicKey as_public();
@@ -223,20 +202,20 @@ interface DescriptorSecretKey {
223202};
224203
225204interface DescriptorPublicKey {
226- [Name=from_string, Throws=BdkError ]
205+ [Name=from_string, Throws=Alpha3Error ]
227206 constructor(string public_key);
228207
229- [Throws=BdkError ]
208+ [Throws=Alpha3Error ]
230209 DescriptorPublicKey derive([ByRef] DerivationPath path);
231210
232- [Throws=BdkError ]
211+ [Throws=Alpha3Error ]
233212 DescriptorPublicKey extend([ByRef] DerivationPath path);
234213
235214 string as_string();
236215};
237216
238217interface Descriptor {
239- [Throws=BdkError ]
218+ [Throws=Alpha3Error ]
240219 constructor(string descriptor, Network network);
241220
242221 [Name=new_bip44]
@@ -275,10 +254,10 @@ interface Descriptor {
275254interface EsploraClient {
276255 constructor(string url);
277256
278- [Throws=BdkError ]
257+ [Throws=Alpha3Error ]
279258 Update scan(Wallet wallet, u64 stop_gap, u64 parallel_requests);
280259
281- [Throws=BdkError ]
260+ [Throws=Alpha3Error ]
282261 void broadcast([ByRef] Transaction transaction);
283262};
284263
@@ -322,7 +301,7 @@ enum WordCount {
322301};
323302
324303interface Address {
325- [Throws=BdkError ]
304+ [Throws=Alpha3Error ]
326305 constructor(string address, Network network);
327306
328307 Network network();
@@ -337,7 +316,7 @@ interface Address {
337316};
338317
339318interface Transaction {
340- [Throws=BdkError ]
319+ [Throws=Alpha3Error ]
341320 constructor(sequence<u8> transaction_bytes);
342321
343322 string txid();
@@ -356,7 +335,7 @@ interface Transaction {
356335};
357336
358337interface PartiallySignedTransaction {
359- [Throws=BdkError ]
338+ [Throws=Alpha3Error ]
360339 constructor(string psbt_base64);
361340
362341 string serialize();
@@ -367,4 +346,4 @@ interface PartiallySignedTransaction {
367346dictionary OutPoint {
368347 string txid;
369348 u32 vout;
370- };
349+ };
0 commit comments