bitcoin_rpc_midas/responses/
v30_responses.rs

1//! Generated RPC response types
2use serde::{Deserialize, Serialize};
3
4/// Stops current wallet rescan triggered by an RPC call, e.g. by a rescanblockchain call.
5/// Note: Use \"getwalletinfo\" to query the scanning progress.
6#[derive(Debug, Deserialize, Serialize)]
7#[serde(transparent)]
8pub struct AbortrescanResponse(pub bool);
9
10/// Open an outbound connection to a specified node. This RPC is for testing only.
11#[derive(Debug, Deserialize, Serialize)]
12pub struct AddconnectionResponse {
13    pub address: String,
14    pub connection_type: String,
15}
16
17/// Add the address of a potential peer to an address manager table. This RPC is for testing only.
18#[derive(Debug, Deserialize, Serialize)]
19pub struct AddpeeraddressResponse {
20    pub success: bool,
21    #[serde(skip_serializing_if = "Option::is_none")]
22    pub error: Option<String>,
23}
24
25/// Analyzes and provides information about the current status of a PSBT and its inputs
26#[derive(Debug, Deserialize, Serialize)]
27pub struct AnalyzepsbtResponse {
28    #[serde(skip_serializing_if = "Option::is_none")]
29    pub inputs: Option<Vec<serde_json::Value>>,
30    #[serde(skip_serializing_if = "Option::is_none")]
31    pub estimated_vsize: Option<u64>,
32    #[serde(skip_serializing_if = "Option::is_none")]
33    pub estimated_feerate: Option<f64>,
34    #[serde(skip_serializing_if = "Option::is_none")]
35    pub fee: Option<f64>,
36    pub next: String,
37    #[serde(skip_serializing_if = "Option::is_none")]
38    pub error: Option<String>,
39}
40
41/// Bumps the fee of a transaction T, replacing it with a new transaction B.
42/// A transaction with the given txid must be in the wallet.
43/// The command will pay the additional fee by reducing change outputs or adding inputs when necessary.
44/// It may add a new change output if one does not already exist.
45/// All inputs in the original transaction will be included in the replacement transaction.
46/// The command will fail if the wallet or mempool contains a transaction that spends one of T's outputs.
47/// By default, the new fee will be calculated automatically using the estimatesmartfee RPC.
48/// The user can specify a confirmation target for estimatesmartfee.
49/// Alternatively, the user can specify a fee rate in sat/vB for the new transaction.
50/// At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee
51/// returned by getnetworkinfo) to enter the node's mempool.
52/// * WARNING: before version 0.21, fee_rate was in BTC/kvB. As of 0.21, fee_rate is in sat/vB. *
53#[derive(Debug, Deserialize, Serialize)]
54pub struct BumpfeeResponse {
55    pub txid: bitcoin::Txid,
56    pub origfee: f64,
57    pub fee: f64,
58    pub errors: Vec<serde_json::Value>,
59}
60
61/// Combine multiple partially signed Bitcoin transactions into one transaction.
62/// Implements the Combiner role.
63#[derive(Debug, Deserialize, Serialize)]
64#[serde(transparent)]
65pub struct CombinepsbtResponse(pub String);
66
67/// Combine multiple partially signed transactions into one transaction.
68/// The combined transaction may be another partially signed transaction or a
69/// fully signed transaction.
70#[derive(Debug, Deserialize, Serialize)]
71#[serde(transparent)]
72pub struct CombinerawtransactionResponse(pub String);
73
74/// Converts a network serialized transaction to a PSBT. This should be used only with createrawtransaction and fundrawtransaction
75/// createpsbt and walletcreatefundedpsbt should be used for new applications.
76#[derive(Debug, Deserialize, Serialize)]
77#[serde(transparent)]
78pub struct ConverttopsbtResponse(pub String);
79
80/// Creates a multi-signature address with n signatures of m keys required.
81/// It returns a json object with the address and redeemScript.
82#[derive(Debug, Deserialize, Serialize)]
83pub struct CreatemultisigResponse {
84    pub address: String,
85    #[serde(rename = "redeemScript")]
86    pub redeem_script: String,
87    pub descriptor: String,
88    #[serde(skip_serializing_if = "Option::is_none")]
89    pub warnings: Option<Vec<serde_json::Value>>,
90}
91
92/// Creates a transaction in the Partially Signed Transaction format.
93/// Implements the Creator role.
94/// Note that the transaction's inputs are not signed, and
95/// it is not stored in the wallet or transmitted to the network.
96#[derive(Debug, Deserialize, Serialize)]
97#[serde(transparent)]
98pub struct CreatepsbtResponse(pub String);
99
100/// Create a transaction spending the given inputs and creating new outputs.
101/// Outputs can be addresses or data.
102/// Returns hex-encoded raw transaction.
103/// Note that the transaction's inputs are not signed, and
104/// it is not stored in the wallet or transmitted to the network.
105#[derive(Debug, Deserialize, Serialize)]
106#[serde(transparent)]
107pub struct CreaterawtransactionResponse(pub String);
108
109/// Creates and loads a new wallet.
110#[derive(Debug, Deserialize, Serialize)]
111pub struct CreatewalletResponse {
112    pub name: String,
113    #[serde(skip_serializing_if = "Option::is_none")]
114    pub warnings: Option<Vec<serde_json::Value>>,
115}
116
117/// Creates the wallet's descriptor for the given address type. The address type must be one that the wallet does not already have a descriptor for.
118/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
119#[derive(Debug, Deserialize, Serialize)]
120pub struct CreatewalletdescriptorResponse {
121    pub descs: Vec<serde_json::Value>,
122}
123
124/// Return a JSON object representing the serialized, base64-encoded partially signed Bitcoin transaction.
125#[derive(Debug, Deserialize, Serialize)]
126pub struct DecodepsbtResponse {
127    pub tx: serde_json::Value,
128    pub global_xpubs: Vec<serde_json::Value>,
129    pub psbt_version: u32,
130    pub proprietary: Vec<serde_json::Value>,
131    pub unknown: serde_json::Value,
132    pub inputs: Vec<serde_json::Value>,
133    pub outputs: Vec<serde_json::Value>,
134    #[serde(skip_serializing_if = "Option::is_none")]
135    pub fee: Option<f64>,
136}
137
138/// Return a JSON object representing the serialized, hex-encoded transaction.
139#[derive(Debug, Deserialize, Serialize)]
140pub struct DecoderawtransactionResponse {
141    pub txid: bitcoin::Txid,
142    pub hash: String,
143    pub size: u64,
144    pub vsize: u64,
145    pub weight: u64,
146    pub version: u32,
147    pub locktime: serde_json::Value,
148    pub vin: Vec<serde_json::Value>,
149    pub vout: Vec<serde_json::Value>,
150}
151
152/// Decode a hex-encoded script.
153#[derive(Debug, Deserialize, Serialize)]
154pub struct DecodescriptResponse {
155    pub asm: String,
156    pub desc: String,
157    #[serde(rename = "type")]
158    pub r#type: String,
159    #[serde(skip_serializing_if = "Option::is_none")]
160    pub address: Option<String>,
161    #[serde(skip_serializing_if = "Option::is_none")]
162    pub p2sh: Option<String>,
163    #[serde(skip_serializing_if = "Option::is_none")]
164    pub segwit: Option<serde_json::Value>,
165}
166
167/// Derives one or more addresses corresponding to an output descriptor.
168/// Examples of output descriptors are:
169/// pkh(<pubkey>)                                     P2PKH outputs for the given pubkey
170/// wpkh(<pubkey>)                                    Native segwit P2PKH outputs for the given pubkey
171/// sh(multi(<n>,<pubkey>,<pubkey>,...))              P2SH-multisig outputs for the given threshold and pubkeys
172/// raw(<hex script>)                                 Outputs whose output script equals the specified hex-encoded bytes
173/// tr(<pubkey>,multi_a(<n>,<pubkey>,<pubkey>,...))   P2TR-multisig outputs for the given threshold and pubkeys
174///
175/// In the above, <pubkey> either refers to a fixed public key in hexadecimal notation, or to an xpub/xprv optionally followed by one
176/// or more path elements separated by \"/\", where \"h\" represents a hardened child key.
177/// For more information on output descriptors, see the documentation in the doc/descriptors.md file.
178#[derive(Debug, Deserialize, Serialize)]
179#[serde(untagged)]
180#[allow(clippy::large_enum_variant)]
181pub enum DeriveaddressesResponse {
182    Variant1(Vec<String>),
183    Variant2(Vec<Vec<String>>),
184}
185
186/// Update all segwit inputs in a PSBT with information from output descriptors, the UTXO set or the mempool.
187/// Then, sign the inputs we are able to with information from the output descriptors.
188#[derive(Debug, Deserialize, Serialize)]
189pub struct DescriptorprocesspsbtResponse {
190    pub psbt: String,
191    pub complete: bool,
192    #[serde(skip_serializing_if = "Option::is_none")]
193    pub hex: Option<String>,
194}
195
196/// Write the serialized UTXO set to a file. This can be used in loadtxoutset afterwards if this snapshot height is supported in the chainparams as well.
197///
198/// Unless the \"latest\" type is requested, the node will roll back to the requested height and network activity will be suspended during this process. Because of this it is discouraged to interact with the node in any other way during the execution of this call to avoid inconsistent results and race conditions, particularly RPCs that interact with blockstorage.
199///
200/// This call may take several minutes. Make sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)
201#[derive(Debug, Deserialize, Serialize)]
202pub struct DumptxoutsetResponse {
203    pub coins_written: u64,
204    pub base_hash: String,
205    pub base_height: u64,
206    pub path: String,
207    pub txoutset_hash: String,
208    pub nchaintx: u64,
209}
210
211/// Simply echo back the input arguments. This command is for testing.
212///
213/// It will return an internal bug report when arg9='trigger_internal_bug' is passed.
214///
215/// The difference between echo and echojson is that echojson has argument conversion enabled in the client-side table in bitcoin-cli and the GUI. There is no server-side difference.
216#[derive(Debug, Deserialize, Serialize)]
217#[serde(transparent)]
218pub struct EchoResponse(pub serde_json::Value);
219
220/// Echo back the input argument, passing it through a spawned process in a multiprocess build.
221/// This command is for testing.
222#[derive(Debug, Deserialize, Serialize)]
223#[serde(transparent)]
224pub struct EchoipcResponse(pub String);
225
226/// Simply echo back the input arguments. This command is for testing.
227///
228/// It will return an internal bug report when arg9='trigger_internal_bug' is passed.
229///
230/// The difference between echo and echojson is that echojson has argument conversion enabled in the client-side table in bitcoin-cli and the GUI. There is no server-side difference.
231#[derive(Debug, Deserialize, Serialize)]
232#[serde(transparent)]
233pub struct EchojsonResponse(pub serde_json::Value);
234
235/// Encrypts the wallet with 'passphrase'. This is for first time encryption.
236/// After this, any calls that interact with private keys such as sending or signing
237/// will require the passphrase to be set prior to making these calls.
238/// Use the walletpassphrase call for this, and then walletlock call.
239/// If the wallet is already encrypted, use the walletpassphrasechange call.
240/// ** IMPORTANT **
241/// For security reasons, the encryption process will generate a new HD seed, resulting
242/// in the creation of a fresh set of active descriptors. Therefore, it is crucial to
243/// securely back up the newly generated wallet file using the backupwallet RPC.
244#[derive(Debug, Deserialize, Serialize)]
245#[serde(transparent)]
246pub struct EncryptwalletResponse(pub String);
247
248/// Returns a list of external signers from -signer.
249#[derive(Debug, Deserialize, Serialize)]
250pub struct EnumeratesignersResponse {
251    pub signers: Vec<serde_json::Value>,
252}
253
254/// WARNING: This interface is unstable and may disappear or change!
255///
256/// WARNING: This is an advanced API call that is tightly coupled to the specific
257/// implementation of fee estimation. The parameters it can be called with
258/// and the results it returns will change if the internal implementation changes.
259///
260/// Estimates the approximate fee per kilobyte needed for a transaction to begin
261/// confirmation within conf_target blocks if possible. Uses virtual transaction size as
262/// defined in BIP 141 (witness data is discounted).
263#[derive(Debug, Deserialize, Serialize)]
264pub struct EstimaterawfeeResponse {
265    #[serde(skip_serializing_if = "Option::is_none")]
266    pub short: Option<serde_json::Value>,
267    #[serde(skip_serializing_if = "Option::is_none")]
268    pub medium: Option<serde_json::Value>,
269    #[serde(skip_serializing_if = "Option::is_none")]
270    pub long: Option<serde_json::Value>,
271}
272
273/// Estimates the approximate fee per kilobyte needed for a transaction to begin
274/// confirmation within conf_target blocks if possible and return the number of blocks
275/// for which the estimate is valid. Uses virtual transaction size as defined
276/// in BIP 141 (witness data is discounted).
277#[derive(Debug, Deserialize, Serialize)]
278pub struct EstimatesmartfeeResponse {
279    #[serde(skip_serializing_if = "Option::is_none")]
280    pub feerate: Option<f64>,
281    #[serde(skip_serializing_if = "Option::is_none")]
282    pub errors: Option<Vec<serde_json::Value>>,
283    pub blocks: u64,
284}
285
286/// Finalize the inputs of a PSBT. If the transaction is fully signed, it will produce a
287/// network serialized transaction which can be broadcast with sendrawtransaction. Otherwise a PSBT will be
288/// created which has the final_scriptSig and final_scriptwitness fields filled for inputs that are complete.
289/// Implements the Finalizer and Extractor roles.
290#[derive(Debug, Deserialize, Serialize)]
291pub struct FinalizepsbtResponse {
292    #[serde(skip_serializing_if = "Option::is_none")]
293    pub psbt: Option<String>,
294    #[serde(skip_serializing_if = "Option::is_none")]
295    pub hex: Option<String>,
296    pub complete: bool,
297}
298
299/// If the transaction has no inputs, they will be automatically selected to meet its out value.
300/// It will add at most one change output to the outputs.
301/// No existing outputs will be modified unless \"subtractFeeFromOutputs\" is specified.
302/// Note that inputs which were signed may need to be resigned after completion since in/outputs have been added.
303/// The inputs added will not be signed, use signrawtransactionwithkey
304/// or signrawtransactionwithwallet for that.
305/// All existing inputs must either have their previous output transaction be in the wallet
306/// or be in the UTXO set. Solving data must be provided for non-wallet inputs.
307/// Note that all inputs selected must be of standard form and P2SH scripts must be
308/// in the wallet using importdescriptors (to calculate fees).
309/// You can see whether this is the case by checking the \"solvable\" field in the listunspent output.
310/// Note that if specifying an exact fee rate, the resulting transaction may have a higher fee rate
311/// if the transaction has unconfirmed inputs. This is because the wallet will attempt to make the
312/// entire package have the given fee rate, not the resulting transaction.
313#[derive(Debug, Deserialize, Serialize)]
314pub struct FundrawtransactionResponse {
315    pub hex: String,
316    pub fee: f64,
317    pub changepos: u64,
318}
319
320/// Mine a set of ordered transactions to a specified address or descriptor and return the block hash.
321#[derive(Debug, Deserialize, Serialize)]
322pub struct GenerateblockResponse {
323    pub hash: String,
324    #[serde(skip_serializing_if = "Option::is_none")]
325    pub hex: Option<String>,
326}
327
328/// Mine to a specified address and return the block hashes.
329#[derive(Debug, Deserialize, Serialize)]
330#[serde(transparent)]
331pub struct GeneratetoaddressResponse(pub Vec<serde_json::Value>);
332
333/// Mine to a specified descriptor and return the block hashes.
334#[derive(Debug, Deserialize, Serialize)]
335#[serde(transparent)]
336pub struct GeneratetodescriptorResponse(pub Vec<serde_json::Value>);
337
338/// Returns information about the given added node, or all added nodes
339/// (note that onetry addnodes are not listed here)
340#[derive(Debug, Deserialize, Serialize)]
341#[serde(transparent)]
342pub struct GetaddednodeinfoResponse(pub Vec<serde_json::Value>);
343
344/// Returns the list of addresses assigned the specified label.
345#[derive(Debug, Deserialize, Serialize)]
346pub struct GetaddressesbylabelResponse {
347    pub address: serde_json::Value,
348}
349
350/// Return information about the given bitcoin address.
351/// Some of the information will only be present if the address is in the active wallet.
352#[derive(Debug, Deserialize, Serialize)]
353pub struct GetaddressinfoResponse {
354    pub address: String,
355    #[serde(rename = "scriptPubKey")]
356    pub script_pubkey: String,
357    pub ismine: bool,
358    pub iswatchonly: bool,
359    pub solvable: bool,
360    #[serde(skip_serializing_if = "Option::is_none")]
361    pub desc: Option<String>,
362    #[serde(skip_serializing_if = "Option::is_none")]
363    pub parent_desc: Option<String>,
364    #[serde(skip_serializing_if = "Option::is_none")]
365    pub isscript: Option<bool>,
366    pub ischange: bool,
367    pub iswitness: bool,
368    #[serde(skip_serializing_if = "Option::is_none")]
369    pub witness_version: Option<u32>,
370    #[serde(skip_serializing_if = "Option::is_none")]
371    pub witness_program: Option<String>,
372    #[serde(skip_serializing_if = "Option::is_none")]
373    pub script: Option<String>,
374    #[serde(skip_serializing_if = "Option::is_none")]
375    pub hex: Option<String>,
376    #[serde(skip_serializing_if = "Option::is_none")]
377    pub pubkeys: Option<Vec<String>>,
378    #[serde(skip_serializing_if = "Option::is_none")]
379    pub sigsrequired: Option<u64>,
380    #[serde(skip_serializing_if = "Option::is_none")]
381    pub pubkey: Option<String>,
382    #[serde(skip_serializing_if = "Option::is_none")]
383    pub embedded: Option<serde_json::Value>,
384    #[serde(skip_serializing_if = "Option::is_none")]
385    pub iscompressed: Option<bool>,
386    #[serde(skip_serializing_if = "Option::is_none")]
387    pub timestamp: Option<serde_json::Value>,
388    #[serde(skip_serializing_if = "Option::is_none")]
389    pub hdkeypath: Option<String>,
390    #[serde(skip_serializing_if = "Option::is_none")]
391    pub hdseedid: Option<String>,
392    #[serde(skip_serializing_if = "Option::is_none")]
393    pub hdmasterfingerprint: Option<String>,
394    pub labels: Vec<serde_json::Value>,
395}
396
397/// Provides information about the node's address manager by returning the number of addresses in the `new` and `tried` tables and their sum for all networks.
398#[derive(Debug, Deserialize, Serialize)]
399pub struct GetaddrmaninfoResponse {
400    pub network: serde_json::Value,
401}
402
403/// Returns the total available balance.
404/// The available balance is what the wallet considers currently spendable, and is
405/// thus affected by options which limit spendability such as -spendzeroconfchange.
406#[derive(Debug, Deserialize, Serialize)]
407#[serde(transparent)]
408pub struct GetbalanceResponse(pub f64);
409
410/// Returns an object with all balances in BTC.
411#[derive(Debug, Deserialize, Serialize)]
412pub struct GetbalancesResponse {
413    pub mine: serde_json::Value,
414    pub lastprocessedblock: serde_json::Value,
415}
416
417/// Returns the hash of the best (tip) block in the most-work fully-validated chain.
418#[derive(Debug, Deserialize, Serialize)]
419#[serde(transparent)]
420pub struct GetbestblockhashResponse(pub bitcoin::BlockHash);
421
422/// If verbosity is 0, returns a string that is serialized, hex-encoded data for block 'hash'.
423/// If verbosity is 1, returns an Object with information about block <hash>.
424/// If verbosity is 2, returns an Object with information about block <hash> and information about each transaction.
425/// If verbosity is 3, returns an Object with information about block <hash> and information about each transaction, including prevout information for inputs (only for unpruned blocks in the current best chain).
426#[derive(Debug, Deserialize, Serialize)]
427#[serde(untagged)]
428#[allow(clippy::large_enum_variant)]
429pub enum GetblockResponse {
430    Raw(String),
431    Verbose {
432        hash: String,
433        confirmations: u64,
434        size: u64,
435        strippedsize: u64,
436        weight: u64,
437        height: u64,
438        version: u32,
439        #[serde(rename = "versionHex")]
440        version_hex: String,
441        merkleroot: String,
442        tx: Vec<serde_json::Value>,
443        time: serde_json::Value,
444        mediantime: serde_json::Value,
445        nonce: u64,
446        bits: String,
447        target: String,
448        difficulty: f64,
449        chainwork: String,
450        #[serde(rename = "nTx")]
451        n_tx: u64,
452        #[serde(skip_serializing_if = "Option::is_none")]
453        previousblockhash: Option<bitcoin::BlockHash>,
454        #[serde(skip_serializing_if = "Option::is_none")]
455        nextblockhash: Option<bitcoin::BlockHash>,
456    },
457    Detailed {
458        field_0: serde_json::Value,
459        tx: Vec<serde_json::Value>,
460    },
461    Full {
462        field_0: serde_json::Value,
463        tx: Vec<serde_json::Value>,
464    },
465}
466
467/// Returns an object containing various state info regarding blockchain processing.
468#[derive(Debug, Deserialize, Serialize)]
469pub struct GetblockchaininfoResponse {
470    pub chain: String,
471    pub blocks: u64,
472    pub headers: u64,
473    pub bestblockhash: bitcoin::BlockHash,
474    pub bits: String,
475    pub target: String,
476    pub difficulty: f64,
477    pub time: serde_json::Value,
478    pub mediantime: serde_json::Value,
479    pub verificationprogress: f64,
480    pub initialblockdownload: bool,
481    pub chainwork: String,
482    pub size_on_disk: u64,
483    pub pruned: bool,
484    #[serde(skip_serializing_if = "Option::is_none")]
485    pub pruneheight: Option<u64>,
486    #[serde(skip_serializing_if = "Option::is_none")]
487    pub automatic_pruning: Option<bool>,
488    #[serde(skip_serializing_if = "Option::is_none")]
489    pub prune_target_size: Option<u64>,
490    #[serde(skip_serializing_if = "Option::is_none")]
491    pub signet_challenge: Option<String>,
492    pub warnings: Vec<serde_json::Value>,
493}
494
495/// Returns the height of the most-work fully-validated chain.
496/// The genesis block has height 0.
497#[derive(Debug, Deserialize, Serialize)]
498#[serde(transparent)]
499pub struct GetblockcountResponse(pub u64);
500
501/// Retrieve a BIP 157 content filter for a particular block.
502#[derive(Debug, Deserialize, Serialize)]
503pub struct GetblockfilterResponse {
504    pub filter: String,
505    pub header: String,
506}
507
508/// Attempt to fetch block from a given peer.
509///
510/// We must have the header for this block, e.g. using submitheader.
511/// The block will not have any undo data which can limit the usage of the block data in a context where the undo data is needed.
512/// Subsequent calls for the same block may cause the response from the previous peer to be ignored.
513/// Peers generally ignore requests for a stale block that they never fully verified, or one that is more than a month old.
514/// When a peer does not respond with a block, we will disconnect.
515/// Note: The block could be re-pruned as soon as it is received.
516///
517/// Returns an empty JSON object if the request was successfully scheduled.
518#[derive(Debug, Deserialize, Serialize)]
519#[serde(transparent)]
520pub struct GetblockfrompeerResponse(pub serde_json::Value);
521
522/// Returns hash of block in best-block-chain at height provided.
523#[derive(Debug, Deserialize, Serialize)]
524#[serde(transparent)]
525pub struct GetblockhashResponse(pub bitcoin::BlockHash);
526
527/// If verbose is false, returns a string that is serialized, hex-encoded data for blockheader 'hash'.
528/// If verbose is true, returns an Object with information about blockheader <hash>.
529#[derive(Debug, Deserialize, Serialize)]
530#[serde(untagged)]
531#[allow(clippy::large_enum_variant)]
532pub enum GetblockheaderResponse {
533    Verbose {
534        hash: String,
535        confirmations: u64,
536        height: u64,
537        version: u32,
538        #[serde(rename = "versionHex")]
539        version_hex: String,
540        merkleroot: String,
541        time: serde_json::Value,
542        mediantime: serde_json::Value,
543        nonce: u64,
544        bits: String,
545        target: String,
546        difficulty: f64,
547        chainwork: String,
548        #[serde(rename = "nTx")]
549        n_tx: u64,
550        #[serde(skip_serializing_if = "Option::is_none")]
551        previousblockhash: Option<bitcoin::BlockHash>,
552        #[serde(skip_serializing_if = "Option::is_none")]
553        nextblockhash: Option<bitcoin::BlockHash>,
554    },
555    Variant2(String),
556}
557
558/// Compute per block statistics for a given window. All amounts are in satoshis.
559/// It won't work for some heights with pruning.
560#[derive(Debug, Deserialize, Serialize)]
561pub struct GetblockstatsResponse {
562    #[serde(skip_serializing_if = "Option::is_none")]
563    pub avgfee: Option<f64>,
564    #[serde(skip_serializing_if = "Option::is_none")]
565    pub avgfeerate: Option<f64>,
566    #[serde(skip_serializing_if = "Option::is_none")]
567    pub avgtxsize: Option<u64>,
568    #[serde(skip_serializing_if = "Option::is_none")]
569    pub blockhash: Option<bitcoin::BlockHash>,
570    #[serde(skip_serializing_if = "Option::is_none")]
571    pub feerate_percentiles: Option<serde_json::Value>,
572    #[serde(skip_serializing_if = "Option::is_none")]
573    pub height: Option<u64>,
574    #[serde(skip_serializing_if = "Option::is_none")]
575    pub ins: Option<u64>,
576    #[serde(skip_serializing_if = "Option::is_none")]
577    pub maxfee: Option<f64>,
578    #[serde(skip_serializing_if = "Option::is_none")]
579    pub maxfeerate: Option<f64>,
580    #[serde(skip_serializing_if = "Option::is_none")]
581    pub maxtxsize: Option<u64>,
582    #[serde(skip_serializing_if = "Option::is_none")]
583    pub medianfee: Option<f64>,
584    #[serde(skip_serializing_if = "Option::is_none")]
585    pub mediantime: Option<u64>,
586    #[serde(skip_serializing_if = "Option::is_none")]
587    pub mediantxsize: Option<u64>,
588    #[serde(skip_serializing_if = "Option::is_none")]
589    pub minfee: Option<f64>,
590    #[serde(skip_serializing_if = "Option::is_none")]
591    pub minfeerate: Option<f64>,
592    #[serde(skip_serializing_if = "Option::is_none")]
593    pub mintxsize: Option<u64>,
594    #[serde(skip_serializing_if = "Option::is_none")]
595    pub outs: Option<u64>,
596    #[serde(skip_serializing_if = "Option::is_none")]
597    pub subsidy: Option<u64>,
598    #[serde(skip_serializing_if = "Option::is_none")]
599    pub swtotal_size: Option<u64>,
600    #[serde(skip_serializing_if = "Option::is_none")]
601    pub swtotal_weight: Option<u64>,
602    #[serde(skip_serializing_if = "Option::is_none")]
603    pub swtxs: Option<u64>,
604    #[serde(skip_serializing_if = "Option::is_none")]
605    pub time: Option<u64>,
606    #[serde(skip_serializing_if = "Option::is_none")]
607    pub total_out: Option<u64>,
608    #[serde(skip_serializing_if = "Option::is_none")]
609    pub total_size: Option<u64>,
610    #[serde(skip_serializing_if = "Option::is_none")]
611    pub total_weight: Option<u64>,
612    #[serde(skip_serializing_if = "Option::is_none")]
613    pub totalfee: Option<f64>,
614    #[serde(skip_serializing_if = "Option::is_none")]
615    pub txs: Option<u64>,
616    #[serde(skip_serializing_if = "Option::is_none")]
617    pub utxo_increase: Option<u64>,
618    #[serde(skip_serializing_if = "Option::is_none")]
619    pub utxo_size_inc: Option<u64>,
620    #[serde(skip_serializing_if = "Option::is_none")]
621    pub utxo_increase_actual: Option<u64>,
622    #[serde(skip_serializing_if = "Option::is_none")]
623    pub utxo_size_inc_actual: Option<u64>,
624}
625
626/// If the request parameters include a 'mode' key, that is used to explicitly select between the default 'template' request or a 'proposal'.
627/// It returns data needed to construct a block to work on.
628/// For full specification, see BIPs 22, 23, 9, and 145:
629/// https://github.com/bitcoin/bips/blob/master/bip-0022.mediawiki
630/// https://github.com/bitcoin/bips/blob/master/bip-0023.mediawiki
631/// https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki#getblocktemplate_changes
632/// https://github.com/bitcoin/bips/blob/master/bip-0145.mediawiki
633#[derive(Debug, Deserialize, Serialize)]
634#[serde(untagged)]
635#[allow(clippy::large_enum_variant)]
636pub enum GetblocktemplateResponse {
637    Accepted(String),
638    Variant3 {
639        version: u32,
640        rules: Vec<serde_json::Value>,
641        vbavailable: serde_json::Value,
642        capabilities: Vec<serde_json::Value>,
643        vbrequired: u64,
644        previousblockhash: bitcoin::BlockHash,
645        transactions: Vec<serde_json::Value>,
646        coinbaseaux: serde_json::Value,
647        coinbasevalue: u64,
648        longpollid: String,
649        target: String,
650        mintime: serde_json::Value,
651        mutable: Vec<serde_json::Value>,
652        noncerange: String,
653        sigoplimit: u64,
654        sizelimit: u64,
655        #[serde(skip_serializing_if = "Option::is_none")]
656        weightlimit: Option<u64>,
657        curtime: serde_json::Value,
658        bits: String,
659        height: u64,
660        #[serde(skip_serializing_if = "Option::is_none")]
661        signet_challenge: Option<String>,
662        #[serde(skip_serializing_if = "Option::is_none")]
663        default_witness_commitment: Option<String>,
664    },
665}
666
667/// Return information about chainstates.
668#[derive(Debug, Deserialize, Serialize)]
669pub struct GetchainstatesResponse {
670    pub headers: u64,
671    pub chainstates: Vec<serde_json::Value>,
672}
673
674/// Return information about all known tips in the block tree, including the main chain as well as orphaned branches.
675#[derive(Debug, Deserialize, Serialize)]
676#[serde(transparent)]
677pub struct GetchaintipsResponse(pub Vec<serde_json::Value>);
678
679/// Compute statistics about the total number and rate of transactions in the chain.
680#[derive(Debug, Deserialize, Serialize)]
681pub struct GetchaintxstatsResponse {
682    pub time: serde_json::Value,
683    #[serde(skip_serializing_if = "Option::is_none")]
684    pub txcount: Option<u64>,
685    pub window_final_block_hash: bitcoin::BlockHash,
686    pub window_final_block_height: u64,
687    pub window_block_count: u64,
688    #[serde(skip_serializing_if = "Option::is_none")]
689    pub window_interval: Option<u64>,
690    #[serde(skip_serializing_if = "Option::is_none")]
691    pub window_tx_count: Option<u64>,
692    #[serde(skip_serializing_if = "Option::is_none")]
693    pub txrate: Option<f64>,
694}
695
696/// Returns the number of connections to other nodes.
697#[derive(Debug, Deserialize, Serialize)]
698#[serde(transparent)]
699pub struct GetconnectioncountResponse(pub u64);
700
701/// Returns an object containing various state info regarding deployments of consensus changes.
702#[derive(Debug, Deserialize, Serialize)]
703pub struct GetdeploymentinfoResponse {
704    pub hash: String,
705    pub height: u64,
706    pub deployments: serde_json::Value,
707}
708
709/// Get spend and receive activity associated with a set of descriptors for a set of blocks. This command pairs well with the `relevant_blocks` output of `scanblocks()`.
710/// This call may take several minutes. If you encounter timeouts, try specifying no RPC timeout (bitcoin-cli -rpcclienttimeout=0)
711#[derive(Debug, Deserialize, Serialize)]
712pub struct GetdescriptoractivityResponse {
713    pub activity: Vec<serde_json::Value>,
714}
715
716/// Analyses a descriptor.
717#[derive(Debug, Deserialize, Serialize)]
718pub struct GetdescriptorinfoResponse {
719    pub descriptor: String,
720    #[serde(skip_serializing_if = "Option::is_none")]
721    pub multipath_expansion: Option<Vec<serde_json::Value>>,
722    pub checksum: String,
723    pub isrange: bool,
724    pub issolvable: bool,
725    pub hasprivatekeys: bool,
726}
727
728/// Returns the proof-of-work difficulty as a multiple of the minimum difficulty.
729#[derive(Debug, Deserialize, Serialize)]
730#[serde(transparent)]
731pub struct GetdifficultyResponse(pub f64);
732
733/// List all BIP 32 HD keys in the wallet and which descriptors use them.
734#[derive(Debug, Deserialize, Serialize)]
735#[serde(transparent)]
736pub struct GethdkeysResponse(pub Vec<serde_json::Value>);
737
738/// Returns the status of one or all available indices currently running in the node.
739#[derive(Debug, Deserialize, Serialize)]
740pub struct GetindexinfoResponse {
741    pub name: serde_json::Value,
742}
743
744/// Returns an object containing information about memory usage.
745#[derive(Debug, Deserialize, Serialize)]
746#[serde(untagged)]
747#[allow(clippy::large_enum_variant)]
748pub enum GetmemoryinfoResponse {
749    Variant1(serde_json::Value),
750    Variant2(String),
751}
752
753/// If txid is in the mempool, returns all in-mempool ancestors.
754#[derive(Debug, Deserialize, Serialize)]
755#[serde(untagged)]
756#[allow(clippy::large_enum_variant)]
757pub enum GetmempoolancestorsResponse {
758    Raw(Vec<String>),
759    Verbose(serde_json::Value),
760}
761
762/// If txid is in the mempool, returns all in-mempool descendants.
763#[derive(Debug, Deserialize, Serialize)]
764#[serde(untagged)]
765#[allow(clippy::large_enum_variant)]
766pub enum GetmempooldescendantsResponse {
767    Raw(Vec<String>),
768    Verbose(serde_json::Value),
769}
770
771/// Returns mempool data for given transaction
772#[derive(Debug, Deserialize, Serialize)]
773pub struct GetmempoolentryResponse {
774    pub vsize: u64,
775    pub weight: u64,
776    pub time: serde_json::Value,
777    pub height: u64,
778    pub descendantcount: u64,
779    pub descendantsize: u64,
780    pub ancestorcount: u64,
781    pub ancestorsize: u64,
782    pub wtxid: bitcoin::Txid,
783    pub fees: serde_json::Value,
784    pub depends: Vec<serde_json::Value>,
785    pub spentby: Vec<serde_json::Value>,
786    pub bip125_replaceable: bool,
787    pub unbroadcast: bool,
788}
789
790/// Returns details on the active state of the TX memory pool.
791#[derive(Debug, Deserialize, Serialize)]
792pub struct GetmempoolinfoResponse {
793    pub loaded: bool,
794    pub size: u64,
795    pub bytes: u64,
796    pub usage: u64,
797    pub total_fee: f64,
798    pub maxmempool: u64,
799    pub mempoolminfee: f64,
800    pub minrelaytxfee: f64,
801    pub incrementalrelayfee: f64,
802    pub unbroadcastcount: u64,
803    pub fullrbf: bool,
804    pub permitbaremultisig: bool,
805    pub maxdatacarriersize: u64,
806}
807
808/// Returns a json object containing mining-related information.
809#[derive(Debug, Deserialize, Serialize)]
810pub struct GetmininginfoResponse {
811    pub blocks: u64,
812    #[serde(skip_serializing_if = "Option::is_none")]
813    pub currentblockweight: Option<u64>,
814    #[serde(skip_serializing_if = "Option::is_none")]
815    pub currentblocktx: Option<u64>,
816    pub bits: String,
817    pub difficulty: f64,
818    pub target: String,
819    pub networkhashps: u64,
820    pub pooledtx: u64,
821    pub blockmintxfee: f64,
822    pub chain: String,
823    #[serde(skip_serializing_if = "Option::is_none")]
824    pub signet_challenge: Option<String>,
825    pub next: serde_json::Value,
826    pub warnings: Vec<serde_json::Value>,
827}
828
829/// Returns information about network traffic, including bytes in, bytes out,
830/// and current system time.
831#[derive(Debug, Deserialize, Serialize)]
832pub struct GetnettotalsResponse {
833    pub totalbytesrecv: u64,
834    pub totalbytessent: u64,
835    pub timemillis: serde_json::Value,
836    pub uploadtarget: serde_json::Value,
837}
838
839/// Returns the estimated network hashes per second based on the last n blocks.
840/// Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change.
841/// Pass in [height] to estimate the network speed at the time when a certain block was found.
842#[derive(Debug, Deserialize, Serialize)]
843#[serde(transparent)]
844pub struct GetnetworkhashpsResponse(pub u64);
845
846/// Returns an object containing various state info regarding P2P networking.
847#[derive(Debug, Deserialize, Serialize)]
848pub struct GetnetworkinfoResponse {
849    pub version: u32,
850    pub subversion: String,
851    pub protocolversion: u32,
852    pub localservices: String,
853    pub localservicesnames: Vec<serde_json::Value>,
854    pub localrelay: bool,
855    pub timeoffset: u64,
856    pub connections: u64,
857    pub connections_in: u64,
858    pub connections_out: u64,
859    pub networkactive: bool,
860    pub networks: Vec<serde_json::Value>,
861    pub relayfee: f64,
862    pub incrementalfee: f64,
863    pub localaddresses: Vec<String>,
864    pub warnings: Vec<serde_json::Value>,
865}
866
867/// Returns a new Bitcoin address for receiving payments.
868/// If 'label' is specified, it is added to the address book
869/// so payments received with the address will be associated with 'label'.
870#[derive(Debug, Deserialize, Serialize)]
871#[serde(transparent)]
872pub struct GetnewaddressResponse(pub String);
873
874/// Return known addresses, after filtering for quality and recency.
875/// These can potentially be used to find new peers in the network.
876/// The total number of addresses known to the node may be higher.
877#[derive(Debug, Deserialize, Serialize)]
878#[serde(transparent)]
879pub struct GetnodeaddressesResponse(pub Vec<serde_json::Value>);
880
881/// Shows transactions in the tx orphanage.
882///
883/// EXPERIMENTAL warning: this call may be changed in future releases.
884#[derive(Debug, Deserialize, Serialize)]
885#[serde(untagged)]
886#[allow(clippy::large_enum_variant)]
887pub enum GetorphantxsResponse {
888    Variant1(Vec<bitcoin::Txid>),
889    Variant2(Vec<serde_json::Value>),
890    Variant3(Vec<serde_json::Value>),
891}
892
893/// Returns data about each connected network peer as a json array of objects.
894#[derive(Debug, Deserialize, Serialize)]
895#[serde(transparent)]
896pub struct GetpeerinfoResponse(pub Vec<serde_json::Value>);
897
898/// Returns a map of all user-created (see prioritisetransaction) fee deltas by txid, and whether the tx is present in mempool.
899#[derive(Debug, Deserialize, Serialize)]
900pub struct GetprioritisedtransactionsResponse {
901    pub transactionid: serde_json::Value,
902}
903
904/// EXPERIMENTAL warning: this call may be changed in future releases.
905///
906/// Returns information on all address manager entries for the new and tried tables.
907#[derive(Debug, Deserialize, Serialize)]
908pub struct GetrawaddrmanResponse {
909    pub table: serde_json::Value,
910}
911
912/// Returns a new Bitcoin address, for receiving change.
913/// This is for use with raw transactions, NOT normal use.
914#[derive(Debug, Deserialize, Serialize)]
915#[serde(transparent)]
916pub struct GetrawchangeaddressResponse(pub String);
917
918/// Returns all transaction ids in memory pool as a json array of string transaction ids.
919///
920/// Hint: use getmempoolentry to fetch a specific transaction from the mempool.
921#[derive(Debug, Deserialize, Serialize)]
922#[serde(untagged)]
923#[allow(clippy::large_enum_variant)]
924pub enum GetrawmempoolResponse {
925    Raw(Vec<String>),
926    Verbose(serde_json::Value),
927    RawWithSequence { txids: Vec<bitcoin::Txid>, mempool_sequence: u64 },
928}
929
930/// By default, this call only returns a transaction if it is in the mempool. If -txindex is enabled
931/// and no blockhash argument is passed, it will return the transaction if it is in the mempool or any block.
932/// If a blockhash argument is passed, it will return the transaction if
933/// the specified block is available and the transaction is in that block.
934///
935/// Hint: Use gettransaction for wallet transactions.
936///
937/// If verbosity is 0 or omitted, returns the serialized transaction as a hex-encoded string.
938/// If verbosity is 1, returns a JSON Object with information about the transaction.
939/// If verbosity is 2, returns a JSON Object with information about the transaction, including fee and prevout information.
940#[derive(Debug, Deserialize, Serialize)]
941#[serde(untagged)]
942#[allow(clippy::large_enum_variant)]
943pub enum GetrawtransactionResponse {
944    Raw(String),
945    Verbose {
946        #[serde(skip_serializing_if = "Option::is_none")]
947        in_active_chain: Option<bool>,
948        #[serde(skip_serializing_if = "Option::is_none")]
949        blockhash: Option<bitcoin::BlockHash>,
950        #[serde(skip_serializing_if = "Option::is_none")]
951        confirmations: Option<u64>,
952        #[serde(skip_serializing_if = "Option::is_none")]
953        blocktime: Option<serde_json::Value>,
954        #[serde(skip_serializing_if = "Option::is_none")]
955        time: Option<u64>,
956        hex: String,
957        txid: bitcoin::Txid,
958        hash: String,
959        size: u64,
960        vsize: u64,
961        weight: u64,
962        version: u32,
963        locktime: serde_json::Value,
964        vin: Vec<serde_json::Value>,
965        vout: Vec<serde_json::Value>,
966    },
967    Detailed {
968        field_0: serde_json::Value,
969        #[serde(skip_serializing_if = "Option::is_none")]
970        fee: Option<f64>,
971        vin: Vec<serde_json::Value>,
972    },
973}
974
975/// Returns the total amount received by the given address in transactions with at least minconf confirmations.
976#[derive(Debug, Deserialize, Serialize)]
977#[serde(transparent)]
978pub struct GetreceivedbyaddressResponse(pub f64);
979
980/// Returns the total amount received by addresses with <label> in transactions with at least [minconf] confirmations.
981#[derive(Debug, Deserialize, Serialize)]
982#[serde(transparent)]
983pub struct GetreceivedbylabelResponse(pub f64);
984
985/// Returns details of the RPC server.
986#[derive(Debug, Deserialize, Serialize)]
987pub struct GetrpcinfoResponse {
988    pub active_commands: Vec<serde_json::Value>,
989    pub logpath: String,
990}
991
992/// Get detailed information about in-wallet transaction <txid>
993#[derive(Debug, Deserialize, Serialize)]
994pub struct GettransactionResponse {
995    pub amount: f64,
996    #[serde(skip_serializing_if = "Option::is_none")]
997    pub fee: Option<f64>,
998    pub confirmations: u64,
999    #[serde(skip_serializing_if = "Option::is_none")]
1000    pub generated: Option<bool>,
1001    #[serde(skip_serializing_if = "Option::is_none")]
1002    pub trusted: Option<bool>,
1003    #[serde(skip_serializing_if = "Option::is_none")]
1004    pub blockhash: Option<bitcoin::BlockHash>,
1005    #[serde(skip_serializing_if = "Option::is_none")]
1006    pub blockheight: Option<u64>,
1007    #[serde(skip_serializing_if = "Option::is_none")]
1008    pub blockindex: Option<u64>,
1009    #[serde(skip_serializing_if = "Option::is_none")]
1010    pub blocktime: Option<serde_json::Value>,
1011    pub txid: bitcoin::Txid,
1012    pub wtxid: bitcoin::Txid,
1013    pub walletconflicts: Vec<serde_json::Value>,
1014    #[serde(skip_serializing_if = "Option::is_none")]
1015    pub replaced_by_txid: Option<bitcoin::Txid>,
1016    #[serde(skip_serializing_if = "Option::is_none")]
1017    pub replaces_txid: Option<bitcoin::Txid>,
1018    pub mempoolconflicts: Vec<serde_json::Value>,
1019    #[serde(skip_serializing_if = "Option::is_none")]
1020    pub to: Option<String>,
1021    pub time: serde_json::Value,
1022    pub timereceived: serde_json::Value,
1023    #[serde(skip_serializing_if = "Option::is_none")]
1024    pub comment: Option<String>,
1025    pub bip125_replaceable: String,
1026    #[serde(skip_serializing_if = "Option::is_none")]
1027    pub parent_descs: Option<Vec<serde_json::Value>>,
1028    pub details: Vec<serde_json::Value>,
1029    pub hex: String,
1030    #[serde(skip_serializing_if = "Option::is_none")]
1031    pub decoded: Option<serde_json::Value>,
1032    pub lastprocessedblock: serde_json::Value,
1033}
1034
1035/// Returns details about an unspent transaction output.
1036#[derive(Debug, Deserialize, Serialize)]
1037#[serde(untagged)]
1038#[allow(clippy::large_enum_variant)]
1039pub enum GettxoutResponse {
1040    Variant2 {
1041        bestblock: String,
1042        confirmations: u64,
1043        value: f64,
1044        #[serde(rename = "scriptPubKey")]
1045        script_pubkey: serde_json::Value,
1046        coinbase: bool,
1047    },
1048}
1049
1050/// Returns a hex-encoded proof that \"txid\" was included in a block.
1051///
1052/// NOTE: By default this function only works sometimes. This is when there is an
1053/// unspent output in the utxo for this transaction. To make it always work,
1054/// you need to maintain a transaction index, using the -txindex command line option or
1055/// specify the block in which the transaction is included manually (by blockhash).
1056#[derive(Debug, Deserialize, Serialize)]
1057#[serde(transparent)]
1058pub struct GettxoutproofResponse(pub String);
1059
1060/// Returns statistics about the unspent transaction output set.
1061/// Note this call may take some time if you are not using coinstatsindex.
1062#[derive(Debug, Deserialize, Serialize)]
1063pub struct GettxoutsetinfoResponse {
1064    pub height: u64,
1065    pub bestblock: String,
1066    pub txouts: u64,
1067    pub bogosize: u64,
1068    #[serde(skip_serializing_if = "Option::is_none")]
1069    pub hash_serialized_3: Option<String>,
1070    #[serde(skip_serializing_if = "Option::is_none")]
1071    pub muhash: Option<String>,
1072    #[serde(skip_serializing_if = "Option::is_none")]
1073    pub transactions: Option<u64>,
1074    #[serde(skip_serializing_if = "Option::is_none")]
1075    pub disk_size: Option<u64>,
1076    pub total_amount: f64,
1077    #[serde(skip_serializing_if = "Option::is_none")]
1078    pub total_unspendable_amount: Option<f64>,
1079    #[serde(skip_serializing_if = "Option::is_none")]
1080    pub block_info: Option<serde_json::Value>,
1081}
1082
1083/// Scans the mempool to find transactions spending any of the given outputs
1084#[derive(Debug, Deserialize, Serialize)]
1085#[serde(transparent)]
1086pub struct GettxspendingprevoutResponse(pub Vec<serde_json::Value>);
1087
1088/// Returns an object containing various wallet state info.
1089#[derive(Debug, Deserialize, Serialize)]
1090pub struct GetwalletinfoResponse {
1091    pub walletname: String,
1092    pub walletversion: u32,
1093    pub format: String,
1094    pub txcount: u64,
1095    pub keypoolsize: u64,
1096    #[serde(skip_serializing_if = "Option::is_none")]
1097    pub keypoolsize_hd_internal: Option<u64>,
1098    #[serde(skip_serializing_if = "Option::is_none")]
1099    pub unlocked_until: Option<serde_json::Value>,
1100    pub paytxfee: f64,
1101    pub private_keys_enabled: bool,
1102    pub avoid_reuse: bool,
1103    pub scanning: serde_json::Value,
1104    pub descriptors: bool,
1105    pub external_signer: bool,
1106    pub blank: bool,
1107    #[serde(skip_serializing_if = "Option::is_none")]
1108    pub birthtime: Option<serde_json::Value>,
1109    pub flags: Vec<serde_json::Value>,
1110    pub lastprocessedblock: serde_json::Value,
1111}
1112
1113/// Returns information about the active ZeroMQ notifications.
1114#[derive(Debug, Deserialize, Serialize)]
1115#[serde(transparent)]
1116pub struct GetzmqnotificationsResponse(pub Vec<serde_json::Value>);
1117
1118/// List all commands, or get help for a specified command.
1119#[derive(Debug, Deserialize, Serialize)]
1120pub struct HelpResponse {}
1121
1122/// Import descriptors. This will trigger a rescan of the blockchain based on the earliest timestamp of all descriptors being imported. Requires a new wallet backup.
1123/// When importing descriptors with multipath key expressions, if the multipath specifier contains exactly two elements, the descriptor produced from the second element will be imported as an internal descriptor.
1124///
1125/// Note: This call can take over an hour to complete if using an early timestamp; during that time, other rpc calls
1126/// may report that the imported keys, addresses or scripts exist but related transactions are still missing.
1127/// The rescan is significantly faster if block filters are available (using startup option \"-blockfilterindex=1\").
1128#[derive(Debug, Deserialize, Serialize)]
1129#[serde(transparent)]
1130pub struct ImportdescriptorsResponse(pub Vec<serde_json::Value>);
1131
1132/// Import a mempool.dat file and attempt to add its contents to the mempool.
1133/// Warning: Importing untrusted files is dangerous, especially if metadata from the file is taken over.
1134#[derive(Debug, Deserialize, Serialize)]
1135#[serde(transparent)]
1136pub struct ImportmempoolResponse(pub serde_json::Value);
1137
1138/// Joins multiple distinct PSBTs with different inputs and outputs into one PSBT with inputs and outputs from all of the PSBTs
1139/// No input in any of the PSBTs can be in more than one of the PSBTs.
1140#[derive(Debug, Deserialize, Serialize)]
1141#[serde(transparent)]
1142pub struct JoinpsbtsResponse(pub String);
1143
1144/// Lists groups of addresses which have had their common ownership
1145/// made public by common use as inputs or as the resulting change
1146/// in past transactions
1147#[derive(Debug, Deserialize, Serialize)]
1148#[serde(transparent)]
1149pub struct ListaddressgroupingsResponse(pub Vec<serde_json::Value>);
1150
1151/// List all manually banned IPs/Subnets.
1152#[derive(Debug, Deserialize, Serialize)]
1153#[serde(transparent)]
1154pub struct ListbannedResponse(pub Vec<serde_json::Value>);
1155
1156/// List all descriptors present in a wallet.
1157#[derive(Debug, Deserialize, Serialize)]
1158pub struct ListdescriptorsResponse {
1159    pub wallet_name: String,
1160    pub descriptors: Vec<serde_json::Value>,
1161}
1162
1163/// Returns the list of all labels, or labels that are assigned to addresses with a specific purpose.
1164#[derive(Debug, Deserialize, Serialize)]
1165#[serde(transparent)]
1166pub struct ListlabelsResponse(pub Vec<serde_json::Value>);
1167
1168/// Returns list of temporarily unspendable outputs.
1169/// See the lockunspent call to lock and unlock transactions for spending.
1170#[derive(Debug, Deserialize, Serialize)]
1171#[serde(transparent)]
1172pub struct ListlockunspentResponse(pub Vec<serde_json::Value>);
1173
1174/// List balances by receiving address.
1175#[derive(Debug, Deserialize, Serialize)]
1176#[serde(transparent)]
1177pub struct ListreceivedbyaddressResponse(pub Vec<serde_json::Value>);
1178
1179/// List received transactions by label.
1180#[derive(Debug, Deserialize, Serialize)]
1181#[serde(transparent)]
1182pub struct ListreceivedbylabelResponse(pub Vec<serde_json::Value>);
1183
1184/// Get all transactions in blocks since block [blockhash], or all transactions if omitted.
1185/// If \"blockhash\" is no longer a part of the main chain, transactions from the fork point onward are included.
1186/// Additionally, if include_removed is set, transactions affecting the wallet which were removed are returned in the \"removed\" array.
1187#[derive(Debug, Deserialize, Serialize)]
1188pub struct ListsinceblockResponse {
1189    pub transactions: Vec<serde_json::Value>,
1190    #[serde(skip_serializing_if = "Option::is_none")]
1191    pub removed: Option<Vec<serde_json::Value>>,
1192    pub lastblock: String,
1193}
1194
1195/// If a label name is provided, this will return only incoming transactions paying to addresses with the specified label.
1196///
1197/// Returns up to 'count' most recent transactions skipping the first 'from' transactions.
1198#[derive(Debug, Deserialize, Serialize)]
1199#[serde(transparent)]
1200pub struct ListtransactionsResponse(pub Vec<serde_json::Value>);
1201
1202/// Returns array of unspent transaction outputs
1203/// with between minconf and maxconf (inclusive) confirmations.
1204/// Optionally filter to only include txouts paid to specified addresses.
1205#[derive(Debug, Deserialize, Serialize)]
1206#[serde(transparent)]
1207pub struct ListunspentResponse(pub Vec<serde_json::Value>);
1208
1209/// Returns a list of wallets in the wallet directory.
1210#[derive(Debug, Deserialize, Serialize)]
1211pub struct ListwalletdirResponse {
1212    pub wallets: Vec<String>,
1213}
1214
1215/// Returns a list of currently loaded wallets.
1216/// For full information on the wallet, use \"getwalletinfo\"
1217#[derive(Debug, Deserialize, Serialize)]
1218#[serde(transparent)]
1219pub struct ListwalletsResponse(pub Vec<serde_json::Value>);
1220
1221/// Load the serialized UTXO set from a file.
1222/// Once this snapshot is loaded, its contents will be deserialized into a second chainstate data structure, which is then used to sync to the network's tip. Meanwhile, the original chainstate will complete the initial block download process in the background, eventually validating up to the block that the snapshot is based upon.
1223///
1224/// The result is a usable bitcoind instance that is current with the network tip in a matter of minutes rather than hours. UTXO snapshot are typically obtained from third-party sources (HTTP, torrent, etc.) which is reasonable since their contents are always checked by hash.
1225///
1226/// You can find more information on this process in the `assumeutxo` design document (<https://github.com/bitcoin/bitcoin/blob/master/doc/design/assumeutxo.md>).
1227#[derive(Debug, Deserialize, Serialize)]
1228pub struct LoadtxoutsetResponse {
1229    pub coins_loaded: u64,
1230    pub tip_hash: String,
1231    pub base_height: u64,
1232    pub path: String,
1233}
1234
1235/// Loads a wallet from a wallet file or directory.
1236/// Note that all wallet command-line options used when starting bitcoind will be
1237/// applied to the new wallet.
1238#[derive(Debug, Deserialize, Serialize)]
1239pub struct LoadwalletResponse {
1240    pub name: String,
1241    #[serde(skip_serializing_if = "Option::is_none")]
1242    pub warnings: Option<Vec<serde_json::Value>>,
1243}
1244
1245/// Updates list of temporarily unspendable outputs.
1246/// Temporarily lock (unlock=false) or unlock (unlock=true) specified transaction outputs.
1247/// If no transaction outputs are specified when unlocking then all current locked transaction outputs are unlocked.
1248/// A locked transaction output will not be chosen by automatic coin selection, when spending bitcoins.
1249/// Manually selected coins are automatically unlocked.
1250/// Locks are stored in memory only, unless persistent=true, in which case they will be written to the
1251/// wallet database and loaded on node start. Unwritten (persistent=false) locks are always cleared
1252/// (by virtue of process exit) when a node stops or fails. Unlocking will clear both persistent and not.
1253/// Also see the listunspent call
1254#[derive(Debug, Deserialize, Serialize)]
1255#[serde(transparent)]
1256pub struct LockunspentResponse(pub bool);
1257
1258/// Gets and sets the logging configuration.
1259/// When called without an argument, returns the list of categories with status that are currently being debug logged or not.
1260/// When called with arguments, adds or removes categories from debug logging and return the lists above.
1261/// The arguments are evaluated in order \"include\", \"exclude\".
1262/// If an item is both included and excluded, it will thus end up being excluded.
1263/// The valid logging categories are: addrman, bench, blockstorage, cmpctblock, coindb, estimatefee, http, i2p, ipc, leveldb, libevent, mempool, mempoolrej, net, proxy, prune, qt, rand, reindex, rpc, scan, selectcoins, tor, txpackages, txreconciliation, validation, walletdb, zmq
1264/// In addition, the following are available as category names with special meanings:
1265/// - \"all\",  \"1\" : represent all logging categories.
1266#[derive(Debug, Deserialize, Serialize)]
1267pub struct LoggingResponse {
1268    pub category: bool,
1269}
1270
1271/// Migrate the wallet to a descriptor wallet.
1272/// A new wallet backup will need to be made.
1273///
1274/// The migration process will create a backup of the wallet before migrating. This backup
1275/// file will be named <wallet name>-<timestamp>.legacy.bak and can be found in the directory
1276/// for this wallet. In the event of an incorrect migration, the backup can be restored using restorewallet.
1277/// Encrypted wallets must have the passphrase provided as an argument to this call.
1278///
1279/// This RPC may take a long time to complete. Increasing the RPC client timeout is recommended.
1280#[derive(Debug, Deserialize, Serialize)]
1281pub struct MigratewalletResponse {
1282    pub wallet_name: String,
1283    #[serde(skip_serializing_if = "Option::is_none")]
1284    pub watchonly_name: Option<String>,
1285    #[serde(skip_serializing_if = "Option::is_none")]
1286    pub solvables_name: Option<String>,
1287    pub backup_path: String,
1288}
1289
1290/// Accepts the transaction into mined blocks at a higher (or lower) priority
1291#[derive(Debug, Deserialize, Serialize)]
1292#[serde(transparent)]
1293pub struct PrioritisetransactionResponse(pub bool);
1294
1295/// Attempts to delete block and undo data up to a specified height or timestamp, if eligible for pruning.
1296/// Requires `-prune` to be enabled at startup. While pruned data may be re-fetched in some cases (e.g., via `getblockfrompeer`), local deletion is irreversible.
1297#[derive(Debug, Deserialize, Serialize)]
1298#[serde(transparent)]
1299pub struct PruneblockchainResponse(pub u64);
1300
1301/// Bumps the fee of a transaction T, replacing it with a new transaction B.
1302/// Returns a PSBT instead of creating and signing a new transaction.
1303/// A transaction with the given txid must be in the wallet.
1304/// The command will pay the additional fee by reducing change outputs or adding inputs when necessary.
1305/// It may add a new change output if one does not already exist.
1306/// All inputs in the original transaction will be included in the replacement transaction.
1307/// The command will fail if the wallet or mempool contains a transaction that spends one of T's outputs.
1308/// By default, the new fee will be calculated automatically using the estimatesmartfee RPC.
1309/// The user can specify a confirmation target for estimatesmartfee.
1310/// Alternatively, the user can specify a fee rate in sat/vB for the new transaction.
1311/// At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee
1312/// returned by getnetworkinfo) to enter the node's mempool.
1313/// * WARNING: before version 0.21, fee_rate was in BTC/kvB. As of 0.21, fee_rate is in sat/vB. *
1314#[derive(Debug, Deserialize, Serialize)]
1315pub struct PsbtbumpfeeResponse {
1316    pub psbt: String,
1317    pub origfee: f64,
1318    pub fee: f64,
1319    pub errors: Vec<serde_json::Value>,
1320}
1321
1322/// Rescan the local blockchain for wallet related transactions.
1323/// Note: Use \"getwalletinfo\" to query the scanning progress.
1324/// The rescan is significantly faster if block filters are available
1325/// (using startup option \"-blockfilterindex=1\").
1326#[derive(Debug, Deserialize, Serialize)]
1327pub struct RescanblockchainResponse {
1328    pub start_height: u64,
1329    pub stop_height: u64,
1330}
1331
1332/// Restores and loads a wallet from backup.
1333///
1334/// The rescan is significantly faster if block filters are available
1335/// (using startup option \"-blockfilterindex=1\").
1336#[derive(Debug, Deserialize, Serialize)]
1337pub struct RestorewalletResponse {
1338    pub name: String,
1339    #[serde(skip_serializing_if = "Option::is_none")]
1340    pub warnings: Option<Vec<serde_json::Value>>,
1341}
1342
1343/// Dumps the mempool to disk. It will fail until the previous dump is fully loaded.
1344#[derive(Debug, Deserialize, Serialize)]
1345pub struct SavemempoolResponse {
1346    pub filename: String,
1347}
1348
1349/// Return relevant blockhashes for given descriptors (requires blockfilterindex).
1350/// This call may take several minutes. Make sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)
1351#[derive(Debug, Deserialize, Serialize)]
1352#[serde(untagged)]
1353#[allow(clippy::large_enum_variant)]
1354pub enum ScanblocksResponse {
1355    Started {
1356        from_height: u64,
1357        to_height: u64,
1358        relevant_blocks: Vec<serde_json::Value>,
1359        completed: bool,
1360    },
1361    Status {
1362        progress: u64,
1363        current_height: u64,
1364    },
1365    Aborted(bool),
1366}
1367
1368/// Scans the unspent transaction output set for entries that match certain output descriptors.
1369/// Examples of output descriptors are:
1370/// addr(<address>)                      Outputs whose output script corresponds to the specified address (does not include P2PK)
1371/// raw(<hex script>)                    Outputs whose output script equals the specified hex-encoded bytes
1372/// combo(<pubkey>)                      P2PK, P2PKH, P2WPKH, and P2SH-P2WPKH outputs for the given pubkey
1373/// pkh(<pubkey>)                        P2PKH outputs for the given pubkey
1374/// sh(multi(<n>,<pubkey>,<pubkey>,...)) P2SH-multisig outputs for the given threshold and pubkeys
1375/// tr(<pubkey>)                         P2TR
1376/// tr(<pubkey>,{pk(<pubkey>)})          P2TR with single fallback pubkey in tapscript
1377/// rawtr(<pubkey>)                      P2TR with the specified key as output key rather than inner
1378/// wsh(and_v(v:pk(<pubkey>),after(2)))  P2WSH miniscript with mandatory pubkey and a timelock
1379///
1380/// In the above, <pubkey> either refers to a fixed public key in hexadecimal notation, or to an xpub/xprv optionally followed by one
1381/// or more path elements separated by \"/\", and optionally ending in \"/*\" (unhardened), or \"/*'\" or \"/*h\" (hardened) to specify all
1382/// unhardened or hardened child keys.
1383/// In the latter case, a range needs to be specified by below if different from 1000.
1384/// For more information on output descriptors, see the documentation in the doc/descriptors.md file.
1385#[derive(Debug, Deserialize, Serialize)]
1386#[serde(untagged)]
1387#[allow(clippy::large_enum_variant)]
1388pub enum ScantxoutsetResponse {
1389    Started {
1390        success: bool,
1391        txouts: u64,
1392        height: u64,
1393        bestblock: String,
1394        unspents: Vec<serde_json::Value>,
1395        total_amount: f64,
1396    },
1397    Aborted(bool),
1398    Status(serde_json::Value),
1399}
1400
1401/// Return RPC command JSON Schema descriptions.
1402#[derive(Debug, Deserialize, Serialize)]
1403#[serde(transparent)]
1404pub struct SchemaResponse(pub serde_json::Value);
1405
1406/// EXPERIMENTAL warning: this call may be changed in future releases.
1407///
1408/// Send a transaction.
1409#[derive(Debug, Deserialize, Serialize)]
1410pub struct SendResponse {
1411    pub complete: bool,
1412    #[serde(skip_serializing_if = "Option::is_none")]
1413    pub txid: Option<bitcoin::Txid>,
1414    #[serde(skip_serializing_if = "Option::is_none")]
1415    pub hex: Option<String>,
1416    #[serde(skip_serializing_if = "Option::is_none")]
1417    pub psbt: Option<String>,
1418}
1419
1420/// EXPERIMENTAL warning: this call may be changed in future releases.
1421///
1422/// Spend the value of all (or specific) confirmed UTXOs and unconfirmed change in the wallet to one or more recipients.
1423/// Unconfirmed inbound UTXOs and locked UTXOs will not be spent. Sendall will respect the avoid_reuse wallet flag.
1424/// If your wallet contains many small inputs, either because it received tiny payments or as a result of accumulating change, consider using `send_max` to exclude inputs that are worth less than the fees needed to spend them.
1425#[derive(Debug, Deserialize, Serialize)]
1426pub struct SendallResponse {
1427    pub complete: bool,
1428    #[serde(skip_serializing_if = "Option::is_none")]
1429    pub txid: Option<bitcoin::Txid>,
1430    #[serde(skip_serializing_if = "Option::is_none")]
1431    pub hex: Option<String>,
1432    #[serde(skip_serializing_if = "Option::is_none")]
1433    pub psbt: Option<String>,
1434}
1435
1436/// Send multiple times. Amounts are double-precision floating point numbers.
1437/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
1438#[derive(Debug, Deserialize, Serialize)]
1439#[serde(untagged)]
1440#[allow(clippy::large_enum_variant)]
1441pub enum SendmanyResponse {
1442    Variant1(bitcoin::Txid),
1443    Variant2 { txid: bitcoin::Txid, fee_reason: String },
1444}
1445
1446/// Send a p2p message to a peer specified by id.
1447/// The message type and body must be provided, the message header will be generated.
1448/// This RPC is for testing only.
1449#[derive(Debug, Deserialize, Serialize)]
1450#[serde(transparent)]
1451pub struct SendmsgtopeerResponse(pub serde_json::Value);
1452
1453/// Submit a raw transaction (serialized, hex-encoded) to local node and network.
1454///
1455/// The transaction will be sent unconditionally to all peers, so using sendrawtransaction
1456/// for manual rebroadcast may degrade privacy by leaking the transaction's origin, as
1457/// nodes will normally not rebroadcast non-wallet transactions already in their mempool.
1458///
1459/// A specific exception, RPC_TRANSACTION_ALREADY_IN_UTXO_SET, may throw if the transaction cannot be added to the mempool.
1460///
1461/// Related RPCs: createrawtransaction, signrawtransactionwithkey
1462#[derive(Debug, Deserialize, Serialize)]
1463#[serde(transparent)]
1464pub struct SendrawtransactionResponse(pub String);
1465
1466/// Send an amount to a given address.
1467/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
1468#[derive(Debug, Deserialize, Serialize)]
1469#[serde(untagged)]
1470#[allow(clippy::large_enum_variant)]
1471pub enum SendtoaddressResponse {
1472    Variant1(bitcoin::Txid),
1473    Variant2 { txid: bitcoin::Txid, fee_reason: String },
1474}
1475
1476/// Disable/enable all p2p network activity.
1477#[derive(Debug, Deserialize, Serialize)]
1478#[serde(transparent)]
1479pub struct SetnetworkactiveResponse(pub bool);
1480
1481/// (DEPRECATED) Set the transaction fee rate in BTC/kvB for this wallet. Overrides the global -paytxfee command line parameter.
1482/// Can be deactivated by passing 0 as the fee. In that case automatic fee selection will be used by default.
1483#[derive(Debug, Deserialize, Serialize)]
1484#[serde(transparent)]
1485pub struct SettxfeeResponse(pub bool);
1486
1487/// Change the state of the given wallet flag for a wallet.
1488#[derive(Debug, Deserialize, Serialize)]
1489pub struct SetwalletflagResponse {
1490    pub flag_name: String,
1491    pub flag_state: bool,
1492    #[serde(skip_serializing_if = "Option::is_none")]
1493    pub warnings: Option<String>,
1494}
1495
1496/// Sign a message with the private key of an address
1497/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
1498#[derive(Debug, Deserialize, Serialize)]
1499#[serde(transparent)]
1500pub struct SignmessageResponse(pub String);
1501
1502/// Sign a message with the private key of an address
1503#[derive(Debug, Deserialize, Serialize)]
1504#[serde(transparent)]
1505pub struct SignmessagewithprivkeyResponse(pub String);
1506
1507/// Sign inputs for raw transaction (serialized, hex-encoded).
1508/// The second argument is an array of base58-encoded private
1509/// keys that will be the only keys used to sign the transaction.
1510/// The third optional argument (may be null) is an array of previous transaction outputs that
1511/// this transaction depends on but may not yet be in the block chain.
1512#[derive(Debug, Deserialize, Serialize)]
1513pub struct SignrawtransactionwithkeyResponse {
1514    pub hex: String,
1515    pub complete: bool,
1516    #[serde(skip_serializing_if = "Option::is_none")]
1517    pub errors: Option<Vec<serde_json::Value>>,
1518}
1519
1520/// Sign inputs for raw transaction (serialized, hex-encoded).
1521/// The second optional argument (may be null) is an array of previous transaction outputs that
1522/// this transaction depends on but may not yet be in the block chain.
1523/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
1524#[derive(Debug, Deserialize, Serialize)]
1525pub struct SignrawtransactionwithwalletResponse {
1526    pub hex: String,
1527    pub complete: bool,
1528    #[serde(skip_serializing_if = "Option::is_none")]
1529    pub errors: Option<Vec<serde_json::Value>>,
1530}
1531
1532/// Calculate the balance change resulting in the signing and broadcasting of the given transaction(s).
1533#[derive(Debug, Deserialize, Serialize)]
1534pub struct SimulaterawtransactionResponse {
1535    pub balance_change: f64,
1536}
1537
1538/// Request a graceful shutdown of Bitcoin Core.
1539#[derive(Debug, Deserialize, Serialize)]
1540#[serde(transparent)]
1541pub struct StopResponse(pub String);
1542
1543/// Attempts to submit new block to network.
1544/// See https://en.bitcoin.it/wiki/BIP_0022 for full specification.
1545#[derive(Debug, Deserialize, Serialize)]
1546#[serde(untagged)]
1547#[allow(clippy::large_enum_variant)]
1548pub enum SubmitblockResponse {
1549    Variant2(String),
1550}
1551
1552/// Submit a package of raw transactions (serialized, hex-encoded) to local node.
1553/// The package will be validated according to consensus and mempool policy rules. If any transaction passes, it will be accepted to mempool.
1554/// This RPC is experimental and the interface may be unstable. Refer to doc/policy/packages.md for documentation on package policies.
1555/// Warning: successful submission does not mean the transactions will propagate throughout the network.
1556#[derive(Debug, Deserialize, Serialize)]
1557pub struct SubmitpackageResponse {
1558    pub package_msg: String,
1559    pub tx_results: serde_json::Value,
1560    #[serde(skip_serializing_if = "Option::is_none")]
1561    pub replaced_transactions: Option<Vec<serde_json::Value>>,
1562}
1563
1564/// Returns result of mempool acceptance tests indicating if raw transaction(s) (serialized, hex-encoded) would be accepted by mempool.
1565///
1566/// If multiple transactions are passed in, parents must come before children and package policies apply: the transactions cannot conflict with any mempool transactions or each other.
1567///
1568/// If one transaction fails, other transactions may not be fully validated (the 'allowed' key will be blank).
1569///
1570/// The maximum number of transactions allowed is 25.
1571///
1572/// This checks if transactions violate the consensus or policy rules.
1573///
1574/// See sendrawtransaction call.
1575#[derive(Debug, Deserialize, Serialize)]
1576#[serde(transparent)]
1577pub struct TestmempoolacceptResponse(pub Vec<serde_json::Value>);
1578
1579/// Unloads the wallet referenced by the request endpoint or the wallet_name argument.
1580/// If both are specified, they must be identical.
1581#[derive(Debug, Deserialize, Serialize)]
1582pub struct UnloadwalletResponse {
1583    #[serde(skip_serializing_if = "Option::is_none")]
1584    pub warnings: Option<Vec<serde_json::Value>>,
1585}
1586
1587/// Returns the total uptime of the server.
1588#[derive(Debug, Deserialize, Serialize)]
1589#[serde(transparent)]
1590pub struct UptimeResponse(pub u64);
1591
1592/// Updates all segwit inputs and outputs in a PSBT with data from output descriptors, the UTXO set, txindex, or the mempool.
1593#[derive(Debug, Deserialize, Serialize)]
1594#[serde(transparent)]
1595pub struct UtxoupdatepsbtResponse(pub String);
1596
1597/// Return information about the given bitcoin address.
1598#[derive(Debug, Deserialize, Serialize)]
1599pub struct ValidateaddressResponse {
1600    pub isvalid: bool,
1601    #[serde(skip_serializing_if = "Option::is_none")]
1602    pub address: Option<String>,
1603    #[serde(rename = "scriptPubKey")]
1604    #[serde(skip_serializing_if = "Option::is_none")]
1605    pub script_pubkey: Option<String>,
1606    #[serde(skip_serializing_if = "Option::is_none")]
1607    pub isscript: Option<bool>,
1608    #[serde(skip_serializing_if = "Option::is_none")]
1609    pub iswitness: Option<bool>,
1610    #[serde(skip_serializing_if = "Option::is_none")]
1611    pub witness_version: Option<u32>,
1612    #[serde(skip_serializing_if = "Option::is_none")]
1613    pub witness_program: Option<String>,
1614    #[serde(skip_serializing_if = "Option::is_none")]
1615    pub error: Option<String>,
1616    #[serde(skip_serializing_if = "Option::is_none")]
1617    pub error_locations: Option<Vec<serde_json::Value>>,
1618}
1619
1620/// Verifies blockchain database.
1621#[derive(Debug, Deserialize, Serialize)]
1622#[serde(transparent)]
1623pub struct VerifychainResponse(pub bool);
1624
1625/// Verify a signed message.
1626#[derive(Debug, Deserialize, Serialize)]
1627#[serde(transparent)]
1628pub struct VerifymessageResponse(pub bool);
1629
1630/// Verifies that a proof points to a transaction in a block, returning the transaction it commits to
1631/// and throwing an RPC error if the block is not in our best chain
1632#[derive(Debug, Deserialize, Serialize)]
1633#[serde(transparent)]
1634pub struct VerifytxoutproofResponse(pub Vec<serde_json::Value>);
1635
1636/// Waits for a specific new block and returns useful info about it.
1637///
1638/// Returns the current block on timeout or exit.
1639///
1640/// Make sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)
1641#[derive(Debug, Deserialize, Serialize)]
1642pub struct WaitforblockResponse {
1643    pub hash: String,
1644    pub height: u64,
1645}
1646
1647/// Waits for (at least) block height and returns the height and hash
1648/// of the current tip.
1649///
1650/// Returns the current block on timeout or exit.
1651///
1652/// Make sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)
1653#[derive(Debug, Deserialize, Serialize)]
1654pub struct WaitforblockheightResponse {
1655    pub hash: String,
1656    pub height: u64,
1657}
1658
1659/// Waits for any new block and returns useful info about it.
1660///
1661/// Returns the current block on timeout or exit.
1662///
1663/// Make sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)
1664#[derive(Debug, Deserialize, Serialize)]
1665pub struct WaitfornewblockResponse {
1666    pub hash: String,
1667    pub height: u64,
1668}
1669
1670/// Creates and funds a transaction in the Partially Signed Transaction format.
1671/// Implements the Creator and Updater roles.
1672/// All existing inputs must either have their previous output transaction be in the wallet
1673/// or be in the UTXO set. Solving data must be provided for non-wallet inputs.
1674#[derive(Debug, Deserialize, Serialize)]
1675pub struct WalletcreatefundedpsbtResponse {
1676    pub psbt: String,
1677    pub fee: f64,
1678    pub changepos: u64,
1679}
1680
1681/// Display address on an external signer for verification.
1682#[derive(Debug, Deserialize, Serialize)]
1683pub struct WalletdisplayaddressResponse {
1684    pub address: String,
1685}
1686
1687/// Update a PSBT with input information from our wallet and then sign inputs
1688/// that we can sign for.
1689/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
1690#[derive(Debug, Deserialize, Serialize)]
1691pub struct WalletprocesspsbtResponse {
1692    pub psbt: String,
1693    pub complete: bool,
1694    #[serde(skip_serializing_if = "Option::is_none")]
1695    pub hex: Option<String>,
1696}