Skip to main content

ethos_bitcoind/types/
responses.rs

1//! Generated version-specific RPC response types
2//!
3//! Generated for Bitcoin Core v30.2
4//!
5//! These types are version-specific and may not match other versions.
6use std::collections::HashMap;
7use std::str::FromStr;
8
9use serde::{Deserialize, Serialize};
10
11/// Type alias for Amount
12pub type Amount = bitcoin::Amount;
13
14#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
15pub struct AnalyzePsbtInput {
16    /// Whether a UTXO is provided
17    pub has_utxo: bool,
18    /// Whether the input is finalized
19    pub is_final: bool,
20    /// Things that are missing that are required to complete this input
21    pub missing: Option<AnalyzePsbtMissing>,
22    /// Role of the next person that this input needs to go to
23    pub next: Option<String>,
24}
25
26/// Things that are missing that are required to complete this input
27#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
28pub struct AnalyzePsbtMissing {
29    #[serde(rename = "pubkeys")]
30    pub pub_keys: Option<Vec<String>>,
31    pub signatures: Option<Vec<String>>,
32    /// Hash160 of the redeem script that is missing
33    #[serde(rename = "redeemscript")]
34    pub redeem_script: Option<bitcoin::ScriptBuf>,
35    /// SHA256 of the witness script that is missing
36    #[serde(rename = "witnessscript")]
37    pub witness_script: Option<bitcoin::ScriptBuf>,
38}
39
40/// Type alias for BlockHash
41pub type BlockHash = bitcoin::BlockHash;
42
43#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
44pub struct DecodePsbtBip32Derivs {
45    /// The public key with the derivation path as the value.
46    pub pubkey: String,
47    /// The fingerprint of the master key
48    pub master_fingerprint: String,
49    /// The path
50    pub path: String,
51}
52
53#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
54pub struct DecodePsbtFinalScriptSig {
55    /// Disassembly of the final signature script
56    pub asm: String,
57    /// The raw final signature script bytes, hex-encoded
58    pub hex: String,
59}
60
61#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
62pub struct DecodePsbtGlobalXpubs {
63    /// The extended public key this path corresponds to
64    pub xpub: String,
65    /// The fingerprint of the master key
66    pub master_fingerprint: String,
67    /// The path
68    pub path: String,
69}
70
71#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
72pub struct DecodePsbtHash160Preimages {
73    /// The hash and preimage that corresponds to it.
74    pub hash: String,
75}
76
77#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
78pub struct DecodePsbtHash256Preimages {
79    /// The hash and preimage that corresponds to it.
80    pub hash: String,
81}
82
83#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
84pub struct DecodePsbtInput {
85    /// Decoded network transaction for non-witness UTXOs
86    pub non_witness_utxo: Option<DecodePsbtNonWitnessUtxo>,
87    /// Transaction output for witness UTXOs
88    pub witness_utxo: Option<DecodePsbtWitnessUtxo>,
89    pub partial_signatures: Option<DecodePsbtPartialSignatures>,
90    /// The sighash type to be used
91    #[serde(rename = "sighash")]
92    pub sig_hash: Option<String>,
93    pub redeem_script: Option<DecodePsbtRedeemScript>,
94    pub witness_script: Option<DecodePsbtWitnessScript>,
95    pub bip32_derivs: Option<Vec<DecodePsbtBip32Derivs>>,
96    #[serde(rename = "final_scriptSig")]
97    pub final_script_sig: Option<DecodePsbtFinalScriptSig>,
98    #[serde(rename = "final_scriptwitness")]
99    pub final_script_witness: Option<Vec<String>>,
100    pub ripemd160_preimages: Option<DecodePsbtRipemd160Preimages>,
101    pub sha256_preimages: Option<DecodePsbtSha256Preimages>,
102    pub hash160_preimages: Option<DecodePsbtHash160Preimages>,
103    pub hash256_preimages: Option<DecodePsbtHash256Preimages>,
104    /// hex-encoded signature for the Taproot key path spend
105    pub taproot_key_path_sig: Option<String>,
106    pub taproot_script_path_sigs: Option<Vec<DecodePsbtSignature>>,
107    pub taproot_scripts: Option<Vec<DecodePsbtTaprootScripts>>,
108    pub taproot_bip32_derivs: Option<Vec<DecodePsbtTaprootBip32Derivs>>,
109    /// The hex-encoded Taproot x-only internal key
110    pub taproot_internal_key: Option<String>,
111    /// The hex-encoded Taproot merkle root
112    pub taproot_merkle_root: Option<String>,
113    pub musig2_participant_pubkeys: Option<Vec<DecodePsbtMusig2ParticipantPubkeys>>,
114    pub musig2_pubnonces: Option<Vec<DecodePsbtMusig2PubNonces>>,
115    pub musig2_partial_sigs: Option<Vec<DecodePsbtMusig2PartialSigs>>,
116    /// The unknown input fields
117    pub unknown: Option<DecodePsbtUnknown>,
118    /// The input proprietary map
119    pub proprietary: Option<Vec<DecodePsbtProprietary>>,
120}
121
122#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
123pub struct DecodePsbtMusig2PartialSigs {
124    /// The compressed public key of the participant that created this partial signature.
125    pub participant_pubkey: String,
126    /// The compressed aggregate public key for which this partial signature is for.
127    pub aggregate_pubkey: String,
128    /// The hash of the leaf script that contains the aggregate pubkey being signed for. Omitted when signing for the internal key.
129    pub leaf_hash: Option<String>,
130    /// The partial signature itself.
131    pub partial_sig: String,
132}
133
134#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
135pub struct DecodePsbtMusig2ParticipantPubkeys {
136    /// The compressed aggregate public key for which the participants create.
137    pub aggregate_pubkey: String,
138    pub participant_pubkeys: Vec<String>,
139}
140
141#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
142pub struct DecodePsbtMusig2PubNonces {
143    /// The compressed public key of the participant that created this pubnonce.
144    pub participant_pubkey: String,
145    /// The compressed aggregate public key for which this pubnonce is for.
146    pub aggregate_pubkey: String,
147    /// The hash of the leaf script that contains the aggregate pubkey being signed for. Omitted when signing for the internal key.
148    pub leaf_hash: Option<String>,
149    /// The public nonce itself.
150    #[serde(rename = "pubnonce")]
151    pub pub_nonce: String,
152}
153
154/// Decoded network transaction for non-witness UTXOs
155#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
156pub struct DecodePsbtNonWitnessUtxo {}
157
158#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
159pub struct DecodePsbtOutput {
160    pub redeem_script: Option<DecodePsbtRedeemScript>,
161    pub witness_script: Option<DecodePsbtWitnessScript>,
162    pub bip32_derivs: Option<Vec<DecodePsbtBip32Derivs>>,
163    /// The hex-encoded Taproot x-only internal key
164    pub taproot_internal_key: Option<String>,
165    /// The tuples that make up the Taproot tree, in depth first search order
166    pub taproot_tree: Option<Vec<DecodePsbtTuple>>,
167    pub taproot_bip32_derivs: Option<Vec<DecodePsbtTaprootBip32Derivs>>,
168    pub musig2_participant_pubkeys: Option<Vec<DecodePsbtMusig2ParticipantPubkeys>>,
169    /// The unknown output fields
170    pub unknown: Option<DecodePsbtUnknown>,
171    /// The output proprietary map
172    pub proprietary: Option<Vec<DecodePsbtProprietary>>,
173}
174
175#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
176pub struct DecodePsbtPartialSignatures {
177    /// The public key and signature that corresponds to it.
178    pub pubkey: String,
179}
180
181#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
182pub struct DecodePsbtProprietary {
183    /// The hex string for the proprietary identifier
184    pub identifier: String,
185    /// The number for the subtype
186    #[serde(rename = "subtype")]
187    pub sub_type: u64,
188    /// The hex for the key
189    pub key: String,
190    /// The hex for the value
191    pub value: String,
192}
193
194#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
195pub struct DecodePsbtRedeemScript {
196    /// Disassembly of the redeem script
197    pub asm: String,
198    /// The raw redeem script bytes, hex-encoded
199    pub hex: String,
200    /// The type, eg 'pubkeyhash'
201    #[serde(rename = "type")]
202    pub r#type: String,
203}
204
205#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
206pub struct DecodePsbtRipemd160Preimages {
207    /// The hash and preimage that corresponds to it.
208    pub hash: String,
209}
210
211#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
212pub struct DecodePsbtSha256Preimages {
213    /// The hash and preimage that corresponds to it.
214    pub hash: String,
215}
216
217/// The signature for the pubkey and leaf hash combination
218#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
219pub struct DecodePsbtSignature {
220    /// The x-only pubkey for this signature
221    pub pubkey: String,
222    /// The leaf hash for this signature
223    pub leaf_hash: String,
224    /// The signature itself
225    pub sig: String,
226}
227
228#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
229pub struct DecodePsbtTaprootBip32Derivs {
230    /// The x-only public key this path corresponds to
231    pub pubkey: String,
232    /// The fingerprint of the master key
233    pub master_fingerprint: String,
234    /// The path
235    pub path: String,
236    /// The hashes of the leaves this pubkey appears in
237    pub leaf_hashes: Vec<String>,
238}
239
240#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
241pub struct DecodePsbtTaprootScripts {
242    /// A leaf script
243    pub script: bitcoin::ScriptBuf,
244    /// The version number for the leaf script
245    pub leaf_ver: u64,
246    /// The control blocks for this script
247    pub control_blocks: Vec<String>,
248}
249
250/// A single leaf script in the taproot tree
251#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
252pub struct DecodePsbtTuple {
253    /// The depth of this element in the tree
254    pub depth: u64,
255    /// The version of this leaf
256    pub leaf_ver: u64,
257    /// The hex-encoded script itself
258    pub script: bitcoin::ScriptBuf,
259}
260
261/// The decoded network-serialized unsigned transaction.
262#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
263pub struct DecodePsbtTx {}
264
265/// The unknown global fields
266#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
267pub struct DecodePsbtUnknown {
268    /// (key-value pair) An unknown key-value pair
269    pub key: String,
270}
271
272#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
273pub struct DecodePsbtWitnessScript {
274    /// Disassembly of the witness script
275    pub asm: String,
276    /// The raw witness script bytes, hex-encoded
277    pub hex: String,
278    /// The type, eg 'pubkeyhash'
279    #[serde(rename = "type")]
280    pub r#type: String,
281}
282
283/// Transaction output for witness UTXOs
284#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
285pub struct DecodePsbtWitnessUtxo {
286    /// The value in BTC
287    #[serde(deserialize_with = "amount_from_btc_float")]
288    pub amount: bitcoin::Amount,
289    #[serde(rename = "scriptPubKey")]
290    pub script_pubkey: DecodedScriptPubKey,
291}
292
293/// Result of a witness output script wrapping this redeem script (not returned for types that should not be wrapped)
294#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
295pub struct DecodeScriptSegwit {
296    /// Disassembly of the output script
297    pub asm: String,
298    /// The raw output script bytes, hex-encoded
299    pub hex: String,
300    /// The type of the output script (e.g. witness_v0_keyhash or witness_v0_scripthash)
301    #[serde(rename = "type")]
302    pub r#type: String,
303    /// The Bitcoin address (only if a well-defined address exists)
304    pub address: Option<String>,
305    /// Inferred descriptor for the script
306    pub desc: String,
307    /// address of the P2SH script wrapping this witness redeem script
308    #[serde(rename = "p2sh-segwit")]
309    pub p2sh_segwit: String,
310}
311
312#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
313pub struct DecodedScriptPubKey {
314    /// Disassembly of the output script
315    pub asm: String,
316    /// Inferred descriptor for the output
317    pub desc: String,
318    /// The raw output script bytes, hex-encoded
319    pub hex: String,
320    /// The type, eg 'pubkeyhash'
321    #[serde(rename = "type")]
322    pub r#type: String,
323    /// The Bitcoin address (only if a well-defined address exists)
324    pub address: Option<String>,
325}
326
327#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
328pub struct EnumerateSignersSigners {
329    /// Master key fingerprint
330    pub fingerprint: String,
331    /// Device name
332    pub name: String,
333}
334
335/// information about the highest range of feerates to fail to meet the threshold
336#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
337pub struct EstimateRawFeeFail {}
338
339/// estimate for long time horizon
340#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
341pub struct EstimateRawFeeLong {}
342
343/// estimate for medium time horizon
344#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
345pub struct EstimateRawFeeMedium {}
346
347/// information about the lowest range of feerates to succeed in meeting the threshold
348#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
349pub struct EstimateRawFeePass {
350    /// start of feerate range
351    #[serde(rename = "startrange")]
352    pub start_range: u64,
353    /// end of feerate range
354    #[serde(rename = "endrange")]
355    pub end_range: u64,
356    /// number of txs over history horizon in the feerate range that were confirmed within target
357    #[serde(rename = "withintarget")]
358    pub within_target: u64,
359    /// number of txs over history horizon in the feerate range that were confirmed at any point
360    #[serde(rename = "totalconfirmed")]
361    pub total_confirmed: u64,
362    /// current number of txs in mempool in the feerate range unconfirmed for at least target blocks
363    #[serde(rename = "inmempool")]
364    pub in_mempool: u64,
365    /// number of txs over history horizon in the feerate range that left mempool unconfirmed after target
366    #[serde(rename = "leftmempool")]
367    pub left_mempool: u64,
368}
369
370/// estimate for short time horizon
371#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
372pub struct EstimateRawFeeShort {
373    /// estimate fee rate in BTC/kvB
374    #[serde(rename = "feerate")]
375    pub fee_rate: Option<f64>,
376    /// exponential decay (per block) for historical moving average of confirmation data
377    pub decay: u64,
378    /// The resolution of confirmation targets at this time horizon
379    pub scale: u64,
380    /// information about the lowest range of feerates to succeed in meeting the threshold
381    pub pass: Option<EstimateRawFeePass>,
382    /// information about the highest range of feerates to fail to meet the threshold
383    pub fail: Option<EstimateRawFeeFail>,
384    /// Errors encountered during processing (if there are any)
385    pub errors: Option<Vec<String>>,
386}
387
388#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
389pub struct GetAddedNodeInfoAddresses {
390    /// The bitcoin server IP and port we're connected to
391    pub address: String,
392    /// connection, inbound or outbound
393    pub connected: String,
394}
395
396#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
397pub struct GetAddedNodeInfoElement {
398    /// The node IP address or name (as provided to addnode)
399    #[serde(rename = "addednode")]
400    pub added_node: String,
401    /// If connected
402    pub connected: bool,
403    /// Only when connected = true
404    pub addresses: Vec<GetAddedNodeInfoAddresses>,
405}
406
407/// the network (ipv4, ipv6, onion, i2p, cjdns, all_networks)
408#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
409pub struct GetAddrManInfoNetwork {
410    /// number of addresses in the new table, which represent potential peers the node has discovered but hasn't yet successfully connected to.
411    pub new: u64,
412    /// number of addresses in the tried table, which represent peers the node has successfully connected to in the past.
413    pub tried: u64,
414    /// total number of addresses in both new/tried tables
415    pub total: u64,
416}
417
418/// Information about the address embedded in P2SH or P2WSH, if relevant and known.
419#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
420pub struct GetAddressInfoEmbedded {}
421
422/// json object with information about address
423#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
424pub struct GetAddressesByLabelAddress {
425    /// Purpose of address ("send" for sending address, "receive" for receiving address)
426    pub purpose: String,
427}
428
429/// hash and height of the block this information was generated on
430#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
431pub struct GetBalancesLastProcessedBlock {
432    /// hash of the block this information was generated on
433    pub hash: String,
434    /// height of the block this information was generated on
435    pub height: u64,
436}
437
438/// balances from outputs that the wallet can sign
439#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
440pub struct GetBalancesMine {
441    /// trusted balance (outputs created by the wallet or confirmed outputs)
442    #[serde(deserialize_with = "amount_from_btc_float")]
443    pub trusted: bitcoin::Amount,
444    /// untrusted pending balance (outputs created by others that are in the mempool)
445    #[serde(deserialize_with = "amount_from_btc_float")]
446    pub untrusted_pending: bitcoin::Amount,
447    /// balance from immature coinbase outputs
448    #[serde(deserialize_with = "amount_from_btc_float")]
449    pub immature: bitcoin::Amount,
450    /// (only present if avoid_reuse is set) balance from coins sent to addresses that were previously spent from (potentially privacy violating)
451    #[serde(deserialize_with = "option_amount_from_btc_float")]
452    pub used: Option<bitcoin::Amount>,
453}
454
455/// Type alias for GetBlockCoinbase
456pub type GetBlockCoinbase = String;
457
458/// Coinbase transaction metadata
459#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
460pub struct GetBlockCoinbaseTx {
461    /// The coinbase transaction version
462    pub version: u32,
463    /// The coinbase transaction's locktime (nLockTime)
464    #[serde(rename = "locktime")]
465    pub lock_time: u32,
466    /// The coinbase input's sequence number (nSequence)
467    pub sequence: u64,
468    /// The coinbase input's script
469    pub coinbase: String,
470    /// The coinbase input's first (and only) witness stack element, if present
471    pub witness: Option<String>,
472}
473
474/// Type alias for GetBlockStatsFeerate
475pub type GetBlockStatsFeerate = String;
476
477/// Feerates at the 10th, 25th, 50th, 75th, and 90th percentile weight unit (in satoshis per virtual byte)
478#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
479pub struct GetBlockStatsFeeratePercentiles {
480    /// The 10th percentile feerate
481    #[serde(rename = "10th_percentile_feerate")]
482    pub field_10th_percentile_feerate: u64,
483    /// The 25th percentile feerate
484    #[serde(rename = "25th_percentile_feerate")]
485    pub field_25th_percentile_feerate: u64,
486    /// The 50th percentile feerate
487    #[serde(rename = "50th_percentile_feerate")]
488    pub field_50th_percentile_feerate: u64,
489    /// The 75th percentile feerate
490    #[serde(rename = "75th_percentile_feerate")]
491    pub field_75th_percentile_feerate: u64,
492    /// The 90th percentile feerate
493    #[serde(rename = "90th_percentile_feerate")]
494    pub field_90th_percentile_feerate: u64,
495}
496
497/// data that should be included in the coinbase's scriptSig content
498#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
499pub struct GetBlockTemplateCoinbaseaux {
500    /// values must be in the coinbase (keys may be ignored)
501    pub key: String,
502}
503
504#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
505pub struct GetBlockTemplateTransactions {
506    /// transaction data encoded in hexadecimal (byte-for-byte)
507    pub data: String,
508    /// transaction hash excluding witness data, shown in byte-reversed hex
509    pub txid: bitcoin::Txid,
510    /// transaction hash including witness data, shown in byte-reversed hex
511    pub hash: String,
512    /// array of numbers
513    pub depends: Vec<String>,
514    /// difference in value between transaction inputs and outputs (in satoshis); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one
515    pub fee: f64,
516    /// total SigOps cost, as counted for purposes of block limits; if key is not present, sigop cost is unknown and clients MUST NOT assume it is zero
517    #[serde(rename = "sigops")]
518    pub sig_ops: u64,
519    /// total transaction weight, as counted for purposes of block limits
520    pub weight: u64,
521}
522
523/// set of pending, supported versionbit (BIP 9) softfork deployments
524#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
525pub struct GetBlockTemplateVbavailable {
526    /// identifies the bit number as indicating acceptance and readiness for the named softfork rule
527    #[serde(rename = "rulename")]
528    pub rule_name: u64,
529}
530
531#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
532pub struct GetBlockTx {
533    /// The transaction fee in BTC, omitted if block undo data is not available
534    pub fee: Option<f64>,
535}
536
537#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
538pub struct GetChainStatesChainstates {
539    /// number of blocks in this chainstate
540    pub blocks: u64,
541    /// blockhash of the tip
542    #[serde(rename = "bestblockhash")]
543    pub best_block_hash: String,
544    /// nBits: compact representation of the block difficulty target
545    pub bits: String,
546    /// The difficulty target
547    pub target: String,
548    /// difficulty of the tip
549    pub difficulty: f64,
550    /// progress towards the network tip
551    #[serde(rename = "verificationprogress")]
552    pub verification_progress: f64,
553    /// the base block of the snapshot this chainstate is based on, if any
554    pub snapshot_blockhash: Option<String>,
555    /// size of the coinsdb cache
556    pub coins_db_cache_bytes: u64,
557    /// size of the coinstip cache
558    pub coins_tip_cache_bytes: u64,
559    /// whether the chainstate is fully validated. True if all blocks in the chainstate were validated, false if the chain is based on a snapshot and the snapshot has not yet been validated.
560    pub validated: bool,
561}
562
563/// status of bip9 softforks (only for "bip9" type)
564#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
565pub struct GetDeploymentInfoBip9 {
566    /// the bit (0-28) in the block version field used to signal this softfork (only for "started" and "locked_in" status)
567    pub bit: Option<u64>,
568    /// the minimum median time past of a block at which the bit gains its meaning
569    pub start_time: u64,
570    /// the median time past of a block at which the deployment is considered failed if not yet locked in
571    pub timeout: u64,
572    /// minimum height of blocks for which the rules may be enforced
573    pub min_activation_height: u64,
574    /// status of deployment at specified block (one of "defined", "started", "locked_in", "active", "failed")
575    pub status: String,
576    /// height of the first block to which the status applies
577    pub since: u64,
578    /// status of deployment at the next block
579    pub status_next: String,
580    /// numeric statistics about signalling for a softfork (only for "started" and "locked_in" status)
581    pub statistics: Option<GetDeploymentInfoStatistics>,
582    /// indicates blocks that signalled with a # and blocks that did not with a -
583    pub signalling: Option<String>,
584}
585
586#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
587pub struct GetDeploymentInfoDeployments {
588    /// name of the deployment
589    pub xxxx: GetDeploymentInfoXxxx,
590}
591
592/// numeric statistics about signalling for a softfork (only for "started" and "locked_in" status)
593#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
594pub struct GetDeploymentInfoStatistics {
595    /// the length in blocks of the signalling period
596    pub period: u64,
597    /// the number of blocks with the version bit set required to activate the feature (only for "started" status)
598    pub threshold: Option<u64>,
599    /// the number of blocks elapsed since the beginning of the current period
600    pub elapsed: u64,
601    /// the number of blocks with the version bit set in the current period
602    pub count: u64,
603    /// returns false if there are not enough blocks left in this period to pass activation threshold (only for "started" status)
604    pub possible: Option<bool>,
605}
606
607/// name of the deployment
608#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
609pub struct GetDeploymentInfoXxxx {
610    /// one of "buried", "bip9"
611    #[serde(rename = "type")]
612    pub r#type: String,
613    /// height of the first block which the rules are or will be enforced (only for "buried" type, or "bip9" type with "active" status)
614    pub height: Option<u64>,
615    /// true if the rules are enforced for the mempool and the next block
616    pub active: bool,
617    /// status of bip9 softforks (only for "bip9" type)
618    pub bip9: Option<GetDeploymentInfoBip9>,
619}
620
621#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
622pub struct GetDescriptorActivityActivity {
623    /// always 'spend'
624    #[serde(rename = "type")]
625    pub r#type: String,
626    /// The total amount in BTC of the spent output
627    #[serde(deserialize_with = "amount_from_btc_float")]
628    pub amount: bitcoin::Amount,
629    /// The blockhash this spend appears in (omitted if unconfirmed)
630    #[serde(rename = "blockhash")]
631    pub block_hash: Option<bitcoin::BlockHash>,
632    /// Height of the spend (omitted if unconfirmed)
633    pub height: Option<u64>,
634    /// The txid of the spending transaction
635    pub spend_txid: String,
636    /// The input index of the spend
637    pub spend_vin: u64,
638    /// The txid of the prevout
639    pub prevout_txid: String,
640    /// The vout of the prevout
641    pub prevout_vout: u64,
642    pub prevout_spk: GetDescriptorActivityPrevoutSpk,
643}
644
645/// Type alias for GetDescriptorActivityOutput
646pub type GetDescriptorActivityOutput = String;
647
648#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
649pub struct GetDescriptorActivityOutputSpk {
650    /// Disassembly of the output script
651    pub asm: String,
652    /// Inferred descriptor for the output
653    pub desc: String,
654    /// The raw output script bytes, hex-encoded
655    pub hex: String,
656    /// The Bitcoin address (only if a well-defined address exists)
657    pub address: Option<String>,
658    /// The type (one of: nonstandard, anchor, pubkey, pubkeyhash, scripthash, multisig, nulldata, witness_v0_scripthash, witness_v0_keyhash, witness_v1_taproot, witness_unknown)
659    #[serde(rename = "type")]
660    pub r#type: String,
661}
662
663#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
664pub struct GetDescriptorActivityPrevoutSpk {
665    /// Disassembly of the output script
666    pub asm: String,
667    /// Inferred descriptor for the output
668    pub desc: String,
669    /// The raw output script bytes, hex-encoded
670    pub hex: String,
671    /// The Bitcoin address (only if a well-defined address exists)
672    pub address: Option<String>,
673    /// The type (one of: nonstandard, anchor, pubkey, pubkeyhash, scripthash, multisig, nulldata, witness_v0_scripthash, witness_v0_keyhash, witness_v1_taproot, witness_unknown)
674    #[serde(rename = "type")]
675    pub r#type: String,
676}
677
678#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
679pub struct GetHdKeysDescriptors {
680    /// Descriptor string representation
681    pub desc: String,
682    /// Whether this descriptor is currently used to generate new addresses
683    pub active: bool,
684}
685
686/// The name of the index
687#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
688pub struct GetIndexInfoName {
689    /// Whether the index is synced or not
690    pub synced: bool,
691    /// The block height to which the index is synced
692    pub best_block_height: u64,
693}
694
695/// Information about locked memory manager
696#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
697pub struct GetMemoryInfoLocked {
698    /// Number of bytes used
699    pub used: u64,
700    /// Number of bytes available in current arenas
701    pub free: u64,
702    /// Total number of bytes managed
703    pub total: u64,
704    /// Amount of bytes that succeeded locking. If this number is smaller than total, locking pages failed at some point and key data could be swapped to disk.
705    pub locked: u64,
706    /// Number allocated chunks
707    pub chunks_used: u64,
708    /// Number unused chunks
709    pub chunks_free: u64,
710}
711
712#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
713pub struct GetMempoolAncestorsFees {
714    /// transaction fee, denominated in BTC
715    #[serde(deserialize_with = "amount_from_btc_float")]
716    pub base: bitcoin::Amount,
717    /// transaction fee with fee deltas used for mining priority, denominated in BTC
718    #[serde(deserialize_with = "amount_from_btc_float")]
719    pub modified: bitcoin::Amount,
720    /// transaction fees of in-mempool ancestors (including this one) with fee deltas used for mining priority, denominated in BTC
721    #[serde(deserialize_with = "amount_from_btc_float")]
722    pub ancestor: bitcoin::Amount,
723    /// transaction fees of in-mempool descendants (including this one) with fee deltas used for mining priority, denominated in BTC
724    #[serde(deserialize_with = "amount_from_btc_float")]
725    pub descendant: bitcoin::Amount,
726    /// transaction fees of chunk, denominated in BTC
727    #[serde(deserialize_with = "amount_from_btc_float")]
728    pub chunk: bitcoin::Amount,
729}
730
731#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
732pub struct GetMempoolAncestorsTransactionid {
733    /// virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted.
734    #[serde(rename = "vsize")]
735    pub v_size: u64,
736    /// transaction weight as defined in BIP 141.
737    pub weight: u64,
738    /// local time transaction entered pool in seconds since 1 Jan 1970 GMT
739    pub time: u64,
740    /// block height when transaction entered pool
741    pub height: u64,
742    /// number of in-mempool descendant transactions (including this one)
743    #[serde(rename = "descendantcount")]
744    pub descendant_count: u64,
745    /// virtual transaction size of in-mempool descendants (including this one)
746    #[serde(rename = "descendantsize")]
747    pub descendant_size: u64,
748    /// number of in-mempool ancestor transactions (including this one)
749    #[serde(rename = "ancestorcount")]
750    pub ancestor_count: u64,
751    /// virtual transaction size of in-mempool ancestors (including this one)
752    #[serde(rename = "ancestorsize")]
753    pub ancestor_size: u64,
754    /// sigops-adjusted weight (as defined in BIP 141 and modified by '-bytespersigop') of this transaction's chunk
755    #[serde(rename = "chunkweight")]
756    pub chunk_weight: u64,
757    /// hash of serialized transaction, including witness data
758    #[serde(rename = "wtxid")]
759    pub w_txid: String,
760    pub fees: GetMempoolAncestorsFees,
761    /// unconfirmed transactions used as inputs for this transaction
762    pub depends: Vec<String>,
763    /// unconfirmed transactions spending outputs from this transaction
764    #[serde(rename = "spentby")]
765    pub spent_by: Vec<String>,
766    /// Whether this transaction signals BIP125 replaceability or has an unconfirmed ancestor signaling BIP125 replaceability. (DEPRECATED)
767    #[serde(rename = "bip125-replaceable")]
768    pub bip125_replaceable: bool,
769    /// Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers)
770    pub unbroadcast: bool,
771}
772
773#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
774pub struct GetMempoolDescendantsFees {
775    /// transaction fee, denominated in BTC
776    #[serde(deserialize_with = "amount_from_btc_float")]
777    pub base: bitcoin::Amount,
778    /// transaction fee with fee deltas used for mining priority, denominated in BTC
779    #[serde(deserialize_with = "amount_from_btc_float")]
780    pub modified: bitcoin::Amount,
781    /// transaction fees of in-mempool ancestors (including this one) with fee deltas used for mining priority, denominated in BTC
782    #[serde(deserialize_with = "amount_from_btc_float")]
783    pub ancestor: bitcoin::Amount,
784    /// transaction fees of in-mempool descendants (including this one) with fee deltas used for mining priority, denominated in BTC
785    #[serde(deserialize_with = "amount_from_btc_float")]
786    pub descendant: bitcoin::Amount,
787    /// transaction fees of chunk, denominated in BTC
788    #[serde(deserialize_with = "amount_from_btc_float")]
789    pub chunk: bitcoin::Amount,
790}
791
792#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
793pub struct GetMempoolDescendantsTransactionid {
794    /// virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted.
795    #[serde(rename = "vsize")]
796    pub v_size: u64,
797    /// transaction weight as defined in BIP 141.
798    pub weight: u64,
799    /// local time transaction entered pool in seconds since 1 Jan 1970 GMT
800    pub time: u64,
801    /// block height when transaction entered pool
802    pub height: u64,
803    /// number of in-mempool descendant transactions (including this one)
804    #[serde(rename = "descendantcount")]
805    pub descendant_count: u64,
806    /// virtual transaction size of in-mempool descendants (including this one)
807    #[serde(rename = "descendantsize")]
808    pub descendant_size: u64,
809    /// number of in-mempool ancestor transactions (including this one)
810    #[serde(rename = "ancestorcount")]
811    pub ancestor_count: u64,
812    /// virtual transaction size of in-mempool ancestors (including this one)
813    #[serde(rename = "ancestorsize")]
814    pub ancestor_size: u64,
815    /// sigops-adjusted weight (as defined in BIP 141 and modified by '-bytespersigop') of this transaction's chunk
816    #[serde(rename = "chunkweight")]
817    pub chunk_weight: u64,
818    /// hash of serialized transaction, including witness data
819    #[serde(rename = "wtxid")]
820    pub w_txid: String,
821    pub fees: GetMempoolDescendantsFees,
822    /// unconfirmed transactions used as inputs for this transaction
823    pub depends: Vec<String>,
824    /// unconfirmed transactions spending outputs from this transaction
825    #[serde(rename = "spentby")]
826    pub spent_by: Vec<String>,
827    /// Whether this transaction signals BIP125 replaceability or has an unconfirmed ancestor signaling BIP125 replaceability. (DEPRECATED)
828    #[serde(rename = "bip125-replaceable")]
829    pub bip125_replaceable: bool,
830    /// Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers)
831    pub unbroadcast: bool,
832}
833
834#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
835pub struct GetMempoolEntryFees {
836    /// transaction fee, denominated in BTC
837    #[serde(deserialize_with = "amount_from_btc_float")]
838    pub base: bitcoin::Amount,
839    /// transaction fee with fee deltas used for mining priority, denominated in BTC
840    #[serde(deserialize_with = "amount_from_btc_float")]
841    pub modified: bitcoin::Amount,
842    /// transaction fees of in-mempool ancestors (including this one) with fee deltas used for mining priority, denominated in BTC
843    #[serde(deserialize_with = "amount_from_btc_float")]
844    pub ancestor: bitcoin::Amount,
845    /// transaction fees of in-mempool descendants (including this one) with fee deltas used for mining priority, denominated in BTC
846    #[serde(deserialize_with = "amount_from_btc_float")]
847    pub descendant: bitcoin::Amount,
848    /// transaction fees of chunk, denominated in BTC
849    #[serde(deserialize_with = "amount_from_btc_float")]
850    pub chunk: bitcoin::Amount,
851}
852
853/// The next block
854#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
855pub struct GetMiningInfoNext {
856    /// The next height
857    pub height: u64,
858    /// The next target nBits
859    pub bits: String,
860    /// The next difficulty
861    pub difficulty: f64,
862    /// The next target
863    pub target: String,
864}
865
866#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
867pub struct GetNetTotalsUploadTarget {
868    /// Length of the measuring timeframe in seconds
869    pub timeframe: u64,
870    /// Target in bytes
871    pub target: u64,
872    /// True if target is reached
873    pub target_reached: bool,
874    /// True if serving historical blocks
875    pub serve_historical_blocks: bool,
876    /// Bytes left in current time cycle
877    pub bytes_left_in_cycle: u64,
878    /// Seconds left in current time cycle
879    pub time_left_in_cycle: u64,
880}
881
882#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
883pub struct GetNetworkInfoLocalAddresses {
884    /// network address
885    pub address: String,
886    /// network port
887    pub port: u16,
888    /// relative score
889    pub score: u64,
890}
891
892#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
893pub struct GetNetworkInfoNetworks {
894    /// network (ipv4, ipv6, onion, i2p, cjdns)
895    pub name: String,
896    /// is the network limited using -onlynet?
897    pub limited: bool,
898    /// is the network reachable?
899    pub reachable: bool,
900    /// ("host:port") the proxy that is used for this network, or empty if none
901    pub proxy: String,
902    /// Whether randomized credentials are used
903    pub proxy_randomize_credentials: bool,
904}
905
906#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
907pub struct GetNodeAddressesElement {
908    /// The UNIX epoch time when the node was last seen
909    pub time: u64,
910    /// The services offered by the node
911    pub services: u64,
912    /// The address of the node
913    pub address: String,
914    /// The port number of the node
915    pub port: u16,
916    /// The network (ipv4, ipv6, onion, i2p, cjdns) the node connected through
917    pub network: String,
918}
919
920#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
921pub struct GetPeerInfoBytesRecvPerMsg {
922    /// The total bytes received aggregated by message type
923    /// When a message type is not listed in this json object, the bytes received are 0.
924    /// Only known message types can appear as keys in the object and all bytes received
925    /// of unknown message types are listed under '*other*'.
926    pub msg: u64,
927}
928
929#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
930pub struct GetPeerInfoBytesSentPerMsg {
931    /// The total bytes sent aggregated by message type
932    /// When a message type is not listed in this json object, the bytes sent are 0.
933    /// Only known message types can appear as keys in the object.
934    pub msg: u64,
935}
936
937#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
938pub struct GetPeerInfoElement {
939    /// Peer index
940    pub id: u64,
941    /// (host:port) The IP address/hostname optionally followed by :port of the peer
942    pub addr: String,
943    /// (ip:port) Bind address of the connection to the peer
944    #[serde(rename = "addrbind")]
945    pub addr_bind: Option<String>,
946    /// (ip:port) Local address as reported by the peer
947    #[serde(rename = "addrlocal")]
948    pub addr_local: Option<String>,
949    /// Network (ipv4, ipv6, onion, i2p, cjdns, not_publicly_routable)
950    pub network: String,
951    /// Mapped AS (Autonomous System) number at the end of the BGP route to the peer, used for diversifying
952    /// peer selection (only displayed if the -asmap config option is set)
953    pub mapped_as: Option<u64>,
954    /// The services offered
955    pub services: String,
956    /// the services offered, in human-readable form
957    #[serde(rename = "servicesnames")]
958    pub services_names: Vec<String>,
959    /// Whether we relay transactions to this peer
960    #[serde(rename = "relaytxes")]
961    pub relay_txes: bool,
962    /// Mempool sequence number of this peer's last INV
963    pub last_inv_sequence: u64,
964    /// How many txs we have queued to announce to this peer
965    pub inv_to_send: u64,
966    /// The UNIX epoch time of the last send
967    #[serde(rename = "lastsend")]
968    pub last_send: u64,
969    /// The UNIX epoch time of the last receive
970    #[serde(rename = "lastrecv")]
971    pub last_recv: u64,
972    /// The UNIX epoch time of the last valid transaction received from this peer
973    pub last_transaction: u64,
974    /// The UNIX epoch time of the last block received from this peer
975    pub last_block: u64,
976    /// The total bytes sent
977    #[serde(rename = "bytessent")]
978    pub bytes_sent: u64,
979    /// The total bytes received
980    #[serde(rename = "bytesrecv")]
981    pub bytes_recv: u64,
982    /// The UNIX epoch time of the connection
983    #[serde(rename = "conntime")]
984    pub conn_time: u64,
985    /// The time offset in seconds
986    #[serde(rename = "timeoffset")]
987    pub time_offset: u64,
988    /// The last ping time in seconds, if any
989    #[serde(rename = "pingtime")]
990    pub ping_time: Option<u64>,
991    /// The minimum observed ping time in seconds, if any
992    #[serde(rename = "minping")]
993    pub min_ping: Option<u64>,
994    /// The duration in seconds of an outstanding ping (if non-zero)
995    #[serde(rename = "pingwait")]
996    pub ping_wait: Option<u64>,
997    /// The peer version, such as 70001
998    pub version: u32,
999    /// The string version
1000    pub subver: String,
1001    /// Inbound (true) or Outbound (false)
1002    pub inbound: bool,
1003    /// Whether we selected peer as (compact blocks) high-bandwidth peer
1004    pub bip152_hb_to: bool,
1005    /// Whether peer selected us as (compact blocks) high-bandwidth peer
1006    pub bip152_hb_from: bool,
1007    /// (DEPRECATED, returned only if config option -deprecatedrpc=startingheight is passed) The starting height (block) of the peer
1008    #[serde(rename = "startingheight")]
1009    pub starting_height: Option<u64>,
1010    /// The current height of header pre-synchronization with this peer, or -1 if no low-work sync is in progress
1011    pub presynced_headers: u64,
1012    /// The last header we have in common with this peer
1013    pub synced_headers: u64,
1014    /// The last block we have in common with this peer
1015    pub synced_blocks: u64,
1016    #[serde(rename = "inflight")]
1017    pub in_flight: Vec<String>,
1018    /// Whether we participate in address relay with this peer
1019    pub addr_relay_enabled: bool,
1020    /// The total number of addresses processed, excluding those dropped due to rate limiting
1021    pub addr_processed: u64,
1022    /// The total number of addresses dropped due to rate limiting
1023    pub addr_rate_limited: u64,
1024    /// Any special permissions that have been granted to this peer
1025    pub permissions: Vec<String>,
1026    /// The minimum fee rate for transactions this peer accepts
1027    #[serde(rename = "minfeefilter")]
1028    pub min_fee_filter: u64,
1029    #[serde(rename = "bytessent_per_msg")]
1030    pub bytes_sent_per_msg: std::collections::HashMap<String, u64>,
1031    #[serde(rename = "bytesrecv_per_msg")]
1032    pub bytes_recv_per_msg: std::collections::HashMap<String, u64>,
1033    /// Type of connection:
1034    /// outbound-full-relay (default automatic connections),
1035    /// block-relay-only (does not relay transactions or addresses),
1036    /// inbound (initiated by the peer),
1037    /// manual (added via addnode RPC or -addnode/-connect configuration options),
1038    /// addr-fetch (short-lived automatic connection for soliciting addresses),
1039    /// feeler (short-lived automatic connection for testing addresses),
1040    /// private-broadcast (short-lived automatic connection for broadcasting privacy-sensitive transactions).
1041    /// Please note this output is unlikely to be stable in upcoming releases as we iterate to
1042    /// best capture connection behaviors.
1043    pub connection_type: String,
1044    /// Type of transport protocol:
1045    /// detecting (peer could be v1 or v2),
1046    /// v1 (plaintext transport protocol),
1047    /// v2 (BIP324 encrypted transport protocol).
1048    pub transport_protocol_type: String,
1049    /// The session ID for this connection, or "" if there is none ("v2" transport protocol only).
1050    pub session_id: String,
1051}
1052
1053#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1054pub struct GetPrioritisedTransactionsTransactionId {
1055    /// transaction fee delta in satoshis
1056    pub fee_delta: u64,
1057    /// whether this transaction is currently in mempool
1058    pub in_mempool: bool,
1059    /// modified fee in satoshis. Only returned if in_mempool=true
1060    pub modified_fee: Option<u64>,
1061}
1062
1063/// Type alias for GetRawAddrManBucket
1064pub type GetRawAddrManBucket = String;
1065
1066/// the location in the address manager table (&lt;bucket&gt;/&lt;position&gt;)
1067#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1068pub struct GetRawAddrManBucketPosition {
1069    /// The address of the node
1070    pub address: String,
1071    /// Mapped AS (Autonomous System) number at the end of the BGP route to the peer, used for diversifying peer selection (only displayed if the -asmap config option is set)
1072    pub mapped_as: Option<u64>,
1073    /// The port number of the node
1074    pub port: u16,
1075    /// The network (ipv4, ipv6, onion, i2p, cjdns) of the address
1076    pub network: String,
1077    /// The services offered by the node
1078    pub services: u64,
1079    /// The UNIX epoch time when the node was last seen
1080    pub time: u64,
1081    /// The address that relayed the address to us
1082    pub source: String,
1083    /// The network (ipv4, ipv6, onion, i2p, cjdns) of the source address
1084    pub source_network: String,
1085    /// Mapped AS (Autonomous System) number at the end of the BGP route to the source, used for diversifying peer selection (only displayed if the -asmap config option is set)
1086    pub source_mapped_as: Option<u64>,
1087}
1088
1089/// buckets with addresses in the address manager table ( new, tried )
1090#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1091pub struct GetRawAddrManTable {
1092    /// the location in the address manager table (&lt;bucket&gt;/&lt;position&gt;)
1093    #[serde(rename = "bucket/position")]
1094    pub bucket_position: GetRawAddrManBucketPosition,
1095}
1096
1097/// Type alias for GetRpcInfoActive
1098pub type GetRpcInfoActive = String;
1099
1100/// Information about an active command
1101#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1102pub struct GetRpcInfoActiveCommands {
1103    /// The name of the RPC command
1104    pub method: String,
1105    /// The running time in microseconds
1106    pub duration: u64,
1107}
1108
1109/// The decoded transaction (only present when `verbose` is passed)
1110#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1111pub struct GetTransactionDecoded {
1112    /// The transaction id
1113    pub txid: bitcoin::Txid,
1114    /// The transaction hash (differs from txid for witness transactions)
1115    pub hash: String,
1116    /// The serialized transaction size
1117    pub size: u64,
1118    /// The virtual transaction size (differs from size for witness transactions)
1119    #[serde(rename = "vsize")]
1120    pub v_size: u64,
1121    /// The transaction's weight (between vsize*4-3 and vsize*4)
1122    pub weight: u64,
1123    /// The version
1124    pub version: u32,
1125    /// The lock time
1126    #[serde(rename = "locktime")]
1127    pub lock_time: u64,
1128    pub vin: Vec<DecodedVin>,
1129    pub vout: Vec<DecodedVout>,
1130}
1131
1132#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1133pub struct GetTransactionDetails {
1134    /// The bitcoin address involved in the transaction.
1135    pub address: Option<String>,
1136    /// The transaction category.
1137    /// "send"                  Transactions sent.
1138    /// "receive"               Non-coinbase transactions received.
1139    /// "generate"              Coinbase transactions received with more than 100 confirmations.
1140    /// "immature"              Coinbase transactions received with 100 or fewer confirmations.
1141    /// "orphan"                Orphaned coinbase transactions received.
1142    pub category: String,
1143    /// The amount in BTC
1144    #[serde(deserialize_with = "amount_from_btc_float")]
1145    pub amount: bitcoin::Amount,
1146    /// A comment for the address/transaction, if any
1147    pub label: Option<String>,
1148    /// the vout value
1149    pub vout: u64,
1150    /// The amount of the fee in BTC. This is negative and only available for the
1151    /// 'send' category of transactions.
1152    #[serde(deserialize_with = "option_amount_from_btc_float")]
1153    pub fee: Option<bitcoin::Amount>,
1154    /// 'true' if the transaction has been abandoned (inputs are respendable).
1155    pub abandoned: bool,
1156    /// Only if 'category' is 'received'. List of parent descriptors for the output script of this coin.
1157    pub parent_descs: Option<Vec<String>>,
1158}
1159
1160/// hash and height of the block this information was generated on
1161#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1162pub struct GetTransactionLastProcessedBlock {
1163    /// hash of the block this information was generated on
1164    pub hash: String,
1165    /// height of the block this information was generated on
1166    pub height: u64,
1167}
1168
1169/// Type alias for GetTxOutSetInfoBlock
1170pub type GetTxOutSetInfoBlock = String;
1171
1172/// Info on amounts in the block at this block height (only available if coinstatsindex is used)
1173#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1174pub struct GetTxOutSetInfoBlockInfo {
1175    /// Total amount of all prevouts spent in this block
1176    #[serde(deserialize_with = "amount_from_btc_float")]
1177    pub prevout_spent: bitcoin::Amount,
1178    /// Coinbase subsidy amount of this block
1179    #[serde(deserialize_with = "amount_from_btc_float")]
1180    pub coinbase: bitcoin::Amount,
1181    /// Total amount of new outputs created by this block
1182    #[serde(deserialize_with = "amount_from_btc_float")]
1183    pub new_outputs_ex_coinbase: bitcoin::Amount,
1184    /// Total amount of unspendable outputs created in this block
1185    #[serde(deserialize_with = "amount_from_btc_float")]
1186    pub unspendable: bitcoin::Amount,
1187    /// Detailed view of the unspendable categories
1188    pub unspendables: GetTxOutSetInfoUnspendables,
1189}
1190
1191/// Detailed view of the unspendable categories
1192#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1193pub struct GetTxOutSetInfoUnspendables {
1194    /// The unspendable amount of the Genesis block subsidy
1195    #[serde(deserialize_with = "amount_from_btc_float")]
1196    pub genesis_block: bitcoin::Amount,
1197    /// Transactions overridden by duplicates (no longer possible with BIP30)
1198    #[serde(deserialize_with = "amount_from_btc_float")]
1199    pub bip30: bitcoin::Amount,
1200    /// Amounts sent to scripts that are unspendable (for example OP_RETURN outputs)
1201    #[serde(deserialize_with = "amount_from_btc_float")]
1202    pub scripts: bitcoin::Amount,
1203    /// Fee rewards that miners did not claim in their coinbase transaction
1204    #[serde(deserialize_with = "amount_from_btc_float")]
1205    pub unclaimed_rewards: bitcoin::Amount,
1206}
1207
1208/// hash and height of the block this information was generated on
1209#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1210pub struct GetWalletInfoLastProcessedBlock {
1211    /// hash of the block this information was generated on
1212    pub hash: String,
1213    /// height of the block this information was generated on
1214    pub height: u64,
1215}
1216
1217/// current scanning details, or false if no scan is in progress
1218#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1219pub struct GetWalletInfoScanning {
1220    /// elapsed seconds since scan start
1221    pub duration: u64,
1222    /// scanning progress percentage \[0.0, 1.0\]
1223    pub progress: u64,
1224}
1225
1226#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1227pub struct ImportDescriptorsError {}
1228
1229#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1230pub struct ListBannedElement {
1231    /// The IP/Subnet of the banned node
1232    pub address: String,
1233    /// The UNIX epoch time the ban was created
1234    pub ban_created: u64,
1235    /// The UNIX epoch time the ban expires
1236    pub banned_until: u64,
1237    /// The ban duration, in seconds
1238    pub ban_duration: u64,
1239    /// The time remaining until the ban expires, in seconds
1240    pub time_remaining: u64,
1241}
1242
1243#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1244pub struct ListDescriptorsDescriptors {
1245    /// Descriptor string representation
1246    pub desc: String,
1247    /// The creation time of the descriptor
1248    pub timestamp: u64,
1249    /// Whether this descriptor is currently used to generate new addresses
1250    pub active: bool,
1251    /// True if this descriptor is used to generate change addresses. False if this descriptor is used to generate receiving addresses; defined only for active descriptors
1252    pub internal: Option<bool>,
1253    /// Defined only for ranged descriptors
1254    pub range: Option<ListDescriptorsRange>,
1255    /// Same as next_index field. Kept for compatibility reason.
1256    pub next: Option<u64>,
1257    /// The next index to generate addresses from; defined only for ranged descriptors
1258    pub next_index: Option<u64>,
1259}
1260
1261/// Defined only for ranged descriptors
1262#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1263pub struct ListDescriptorsRange {
1264    /// Range start inclusive
1265    pub field_0: u64,
1266    /// Range end inclusive
1267    pub field_1: u64,
1268}
1269
1270#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1271pub struct ListLockUnspentElement {
1272    /// The transaction id locked
1273    pub txid: bitcoin::Txid,
1274    /// The vout value
1275    pub vout: u64,
1276}
1277
1278#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1279pub struct ListReceivedByAddressElement {
1280    /// The receiving address
1281    pub address: String,
1282    /// The total amount in BTC received by the address
1283    #[serde(deserialize_with = "amount_from_btc_float")]
1284    pub amount: bitcoin::Amount,
1285    /// The number of confirmations of the most recent transaction included
1286    pub confirmations: i64,
1287    /// The label of the receiving address. The default label is ""
1288    pub label: String,
1289    pub txids: Vec<bitcoin::Txid>,
1290}
1291
1292#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1293pub struct ListReceivedByLabelElement {
1294    /// The total amount received by addresses with this label
1295    #[serde(deserialize_with = "amount_from_btc_float")]
1296    pub amount: bitcoin::Amount,
1297    /// The number of confirmations of the most recent transaction included
1298    pub confirmations: i64,
1299    /// The label of the receiving address. The default label is ""
1300    pub label: String,
1301}
1302
1303#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1304pub struct ListSinceBlockTransactions {
1305    /// The bitcoin address of the transaction (not returned if the output does not have an address, e.g. OP_RETURN null data).
1306    pub address: Option<String>,
1307    /// The transaction category.
1308    /// "send"                  Transactions sent.
1309    /// "receive"               Non-coinbase transactions received.
1310    /// "generate"              Coinbase transactions received with more than 100 confirmations.
1311    /// "immature"              Coinbase transactions received with 100 or fewer confirmations.
1312    /// "orphan"                Orphaned coinbase transactions received.
1313    pub category: String,
1314    /// The amount in BTC. This is negative for the 'send' category, and is positive
1315    /// for all other categories
1316    #[serde(deserialize_with = "amount_from_btc_float")]
1317    pub amount: bitcoin::Amount,
1318    /// the vout value
1319    pub vout: u64,
1320    /// The amount of the fee in BTC. This is negative and only available for the
1321    /// 'send' category of transactions.
1322    #[serde(deserialize_with = "option_amount_from_btc_float")]
1323    pub fee: Option<bitcoin::Amount>,
1324    /// The number of confirmations for the transaction. Negative confirmations means the
1325    /// transaction conflicted that many blocks ago.
1326    pub confirmations: i64,
1327    /// Only present if the transaction's only input is a coinbase one.
1328    pub generated: Option<bool>,
1329    /// Whether we consider the transaction to be trusted and safe to spend from.
1330    /// Only present when the transaction has 0 confirmations (or negative confirmations, if conflicted).
1331    pub trusted: Option<bool>,
1332    /// The block hash containing the transaction.
1333    #[serde(rename = "blockhash")]
1334    pub block_hash: Option<bitcoin::BlockHash>,
1335    /// The block height containing the transaction.
1336    #[serde(rename = "blockheight")]
1337    pub block_height: Option<u64>,
1338    /// The index of the transaction in the block that includes it.
1339    #[serde(rename = "blockindex")]
1340    pub block_index: Option<u64>,
1341    /// The block time expressed in UNIX epoch time.
1342    #[serde(rename = "blocktime")]
1343    pub block_time: Option<u64>,
1344    /// The transaction id.
1345    pub txid: bitcoin::Txid,
1346    /// The hash of serialized transaction, including witness data.
1347    #[serde(rename = "wtxid")]
1348    pub w_txid: String,
1349    /// Confirmed transactions that have been detected by the wallet to conflict with this transaction.
1350    #[serde(rename = "walletconflicts")]
1351    pub wallet_conflicts: Vec<String>,
1352    /// Only if 'category' is 'send'. The txid if this tx was replaced.
1353    pub replaced_by_txid: Option<String>,
1354    /// Only if 'category' is 'send'. The txid if this tx replaces another.
1355    pub replaces_txid: Option<String>,
1356    /// Transactions in the mempool that directly conflict with either this transaction or an ancestor transaction
1357    #[serde(rename = "mempoolconflicts")]
1358    pub mempool_conflicts: Vec<String>,
1359    /// If a comment to is associated with the transaction.
1360    pub to: Option<String>,
1361    /// The transaction time expressed in UNIX epoch time.
1362    pub time: u64,
1363    /// The time received expressed in UNIX epoch time.
1364    #[serde(rename = "timereceived")]
1365    pub time_received: u64,
1366    /// If a comment is associated with the transaction, only present if not empty.
1367    pub comment: Option<String>,
1368    /// ("yes|no|unknown") Whether this transaction signals BIP125 replaceability or has an unconfirmed ancestor signaling BIP125 replaceability.
1369    /// May be unknown for unconfirmed transactions not in the mempool because their unconfirmed ancestors are unknown.
1370    #[serde(rename = "bip125-replaceable")]
1371    pub bip125_replaceable: String,
1372    /// Only if 'category' is 'received'. List of parent descriptors for the output script of this coin.
1373    pub parent_descs: Option<Vec<String>>,
1374    /// 'true' if the transaction has been abandoned (inputs are respendable).
1375    pub abandoned: bool,
1376    /// A comment for the address/transaction, if any
1377    pub label: Option<String>,
1378}
1379
1380#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1381pub struct ListTransactionsElement {
1382    /// The bitcoin address of the transaction (not returned if the output does not have an address, e.g. OP_RETURN null data).
1383    pub address: Option<String>,
1384    /// The transaction category.
1385    /// "send"                  Transactions sent.
1386    /// "receive"               Non-coinbase transactions received.
1387    /// "generate"              Coinbase transactions received with more than 100 confirmations.
1388    /// "immature"              Coinbase transactions received with 100 or fewer confirmations.
1389    /// "orphan"                Orphaned coinbase transactions received.
1390    pub category: String,
1391    /// The amount in BTC. This is negative for the 'send' category, and is positive
1392    /// for all other categories
1393    #[serde(deserialize_with = "amount_from_btc_float")]
1394    pub amount: bitcoin::Amount,
1395    /// A comment for the address/transaction, if any
1396    pub label: Option<String>,
1397    /// the vout value
1398    pub vout: u64,
1399    /// The amount of the fee in BTC. This is negative and only available for the
1400    /// 'send' category of transactions.
1401    #[serde(deserialize_with = "option_amount_from_btc_float")]
1402    pub fee: Option<bitcoin::Amount>,
1403    /// The number of confirmations for the transaction. Negative confirmations means the
1404    /// transaction conflicted that many blocks ago.
1405    pub confirmations: i64,
1406    /// Only present if the transaction's only input is a coinbase one.
1407    pub generated: Option<bool>,
1408    /// Whether we consider the transaction to be trusted and safe to spend from.
1409    /// Only present when the transaction has 0 confirmations (or negative confirmations, if conflicted).
1410    pub trusted: Option<bool>,
1411    /// The block hash containing the transaction.
1412    #[serde(rename = "blockhash")]
1413    pub block_hash: Option<bitcoin::BlockHash>,
1414    /// The block height containing the transaction.
1415    #[serde(rename = "blockheight")]
1416    pub block_height: Option<u64>,
1417    /// The index of the transaction in the block that includes it.
1418    #[serde(rename = "blockindex")]
1419    pub block_index: Option<u64>,
1420    /// The block time expressed in UNIX epoch time.
1421    #[serde(rename = "blocktime")]
1422    pub block_time: Option<u64>,
1423    /// The transaction id.
1424    pub txid: bitcoin::Txid,
1425    /// The hash of serialized transaction, including witness data.
1426    #[serde(rename = "wtxid")]
1427    pub w_txid: String,
1428    /// Confirmed transactions that have been detected by the wallet to conflict with this transaction.
1429    #[serde(rename = "walletconflicts")]
1430    pub wallet_conflicts: Vec<String>,
1431    /// Only if 'category' is 'send'. The txid if this tx was replaced.
1432    pub replaced_by_txid: Option<String>,
1433    /// Only if 'category' is 'send'. The txid if this tx replaces another.
1434    pub replaces_txid: Option<String>,
1435    /// Transactions in the mempool that directly conflict with either this transaction or an ancestor transaction
1436    #[serde(rename = "mempoolconflicts")]
1437    pub mempool_conflicts: Vec<String>,
1438    /// If a comment to is associated with the transaction.
1439    pub to: Option<String>,
1440    /// The transaction time expressed in UNIX epoch time.
1441    pub time: u64,
1442    /// The time received expressed in UNIX epoch time.
1443    #[serde(rename = "timereceived")]
1444    pub time_received: u64,
1445    /// If a comment is associated with the transaction, only present if not empty.
1446    pub comment: Option<String>,
1447    /// ("yes|no|unknown") Whether this transaction signals BIP125 replaceability or has an unconfirmed ancestor signaling BIP125 replaceability.
1448    /// May be unknown for unconfirmed transactions not in the mempool because their unconfirmed ancestors are unknown.
1449    #[serde(rename = "bip125-replaceable")]
1450    pub bip125_replaceable: String,
1451    /// Only if 'category' is 'received'. List of parent descriptors for the output script of this coin.
1452    pub parent_descs: Option<Vec<String>>,
1453    /// 'true' if the transaction has been abandoned (inputs are respendable).
1454    pub abandoned: bool,
1455}
1456
1457#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1458pub struct ListUnspentElement {
1459    /// the transaction id
1460    pub txid: bitcoin::Txid,
1461    /// the vout value
1462    pub vout: u64,
1463    /// the bitcoin address
1464    pub address: Option<String>,
1465    /// The associated label, or "" for the default label
1466    pub label: Option<String>,
1467    /// the output script
1468    #[serde(rename = "scriptPubKey")]
1469    pub script_pubkey: bitcoin::ScriptBuf,
1470    /// the transaction output amount in BTC
1471    #[serde(deserialize_with = "amount_from_btc_float")]
1472    pub amount: bitcoin::Amount,
1473    /// The number of confirmations
1474    pub confirmations: i64,
1475    /// The number of in-mempool ancestor transactions, including this one (if transaction is in the mempool)
1476    #[serde(rename = "ancestorcount")]
1477    pub ancestor_count: Option<u64>,
1478    /// The virtual transaction size of in-mempool ancestors, including this one (if transaction is in the mempool)
1479    #[serde(rename = "ancestorsize")]
1480    pub ancestor_size: Option<u64>,
1481    /// The total fees of in-mempool ancestors (including this one) with fee deltas used for mining priority in sat (if transaction is in the mempool)
1482    #[serde(rename = "ancestorfees")]
1483    #[serde(deserialize_with = "option_amount_from_btc_float")]
1484    pub ancestor_fees: Option<bitcoin::Amount>,
1485    /// The redeem script if the output script is P2SH
1486    #[serde(rename = "redeemScript")]
1487    pub redeem_script: Option<bitcoin::ScriptBuf>,
1488    /// witness script if the output script is P2WSH or P2SH-P2WSH
1489    #[serde(rename = "witnessScript")]
1490    pub witness_script: Option<bitcoin::ScriptBuf>,
1491    /// (DEPRECATED) Always true
1492    pub spendable: bool,
1493    /// Whether we know how to spend this output, ignoring the lack of keys
1494    pub solvable: bool,
1495    /// (only present if avoid_reuse is set) Whether this output is reused/dirty (sent to an address that was previously spent from)
1496    pub reused: Option<bool>,
1497    /// (only when solvable) A descriptor for spending this output
1498    pub desc: Option<String>,
1499    /// List of parent descriptors for the output script of this coin.
1500    pub parent_descs: Vec<String>,
1501    /// Whether this output is considered safe to spend. Unconfirmed transactions
1502    /// from outside keys and unconfirmed replacement transactions are considered unsafe
1503    /// and are not eligible for spending by fundrawtransaction and sendtoaddress.
1504    pub safe: bool,
1505}
1506
1507#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1508pub struct ListWalletDirWallets {
1509    /// The wallet name
1510    pub name: String,
1511    /// Warning messages, if any, related to loading the wallet.
1512    pub warnings: Option<Vec<String>>,
1513}
1514
1515#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1516pub struct ScanTxOutSetUnspents {
1517    /// The transaction id
1518    pub txid: bitcoin::Txid,
1519    /// The vout value
1520    pub vout: u64,
1521    /// The output script
1522    #[serde(rename = "scriptPubKey")]
1523    pub script_pubkey: bitcoin::ScriptBuf,
1524    /// A specialized descriptor for the matched output script
1525    pub desc: String,
1526    /// The total amount in BTC of the unspent output
1527    #[serde(deserialize_with = "amount_from_btc_float")]
1528    pub amount: bitcoin::Amount,
1529    /// Whether this is a coinbase output
1530    pub coinbase: bool,
1531    /// Height of the unspent transaction output
1532    pub height: u64,
1533    /// Blockhash of the unspent transaction output
1534    #[serde(rename = "blockhash")]
1535    pub block_hash: bitcoin::BlockHash,
1536    /// Number of confirmations of the unspent transaction output when the scan was done
1537    pub confirmations: i64,
1538}
1539
1540#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1541pub struct SignRawTransactionWithKeyErrors {
1542    /// The hash of the referenced, previous transaction
1543    pub txid: bitcoin::Txid,
1544    /// The index of the output to spent and used as input
1545    pub vout: u64,
1546    pub witness: Vec<String>,
1547    /// The hex-encoded signature script
1548    #[serde(rename = "scriptSig")]
1549    pub script_sig: String,
1550    /// Script sequence number
1551    pub sequence: u64,
1552    /// Verification or signing error related to the input
1553    pub error: String,
1554}
1555
1556#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1557pub struct SignRawTransactionWithWalletErrors {
1558    /// The hash of the referenced, previous transaction
1559    pub txid: bitcoin::Txid,
1560    /// The index of the output to spent and used as input
1561    pub vout: u64,
1562    pub witness: Vec<String>,
1563    /// The hex-encoded signature script
1564    #[serde(rename = "scriptSig")]
1565    pub script_sig: String,
1566    /// Script sequence number
1567    pub sequence: u64,
1568    /// Verification or signing error related to the input
1569    pub error: String,
1570}
1571
1572/// Transaction fees
1573#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1574pub struct SubmitPackageFees {
1575    /// transaction fee in BTC
1576    #[serde(deserialize_with = "amount_from_btc_float")]
1577    pub base: bitcoin::Amount,
1578    /// if the transaction was not already in the mempool, the effective feerate in BTC per KvB. For example, the package feerate and/or feerate with modified fees from prioritisetransaction.
1579    #[serde(rename = "effective-feerate")]
1580    #[serde(deserialize_with = "option_amount_from_btc_float")]
1581    pub effective_feerate: Option<bitcoin::Amount>,
1582    /// if effective-feerate is provided, the wtxids of the transactions whose fees and vsizes are included in effective-feerate.
1583    #[serde(rename = "effective-includes")]
1584    pub effective_includes: Option<Vec<String>>,
1585}
1586
1587/// The transaction results keyed by wtxid. An entry is returned for every submitted wtxid.
1588#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1589pub struct SubmitPackageTxResults {
1590    /// transaction wtxid
1591    #[serde(rename = "wtxid")]
1592    pub w_txid: SubmitPackageWtxid,
1593}
1594
1595/// transaction wtxid
1596#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1597pub struct SubmitPackageWtxid {
1598    /// The transaction hash in hex
1599    pub txid: bitcoin::Txid,
1600    /// The wtxid of a different transaction with the same txid but different witness found in the mempool. This means the submitted transaction was ignored.
1601    #[serde(rename = "other-wtxid")]
1602    pub other_wtxid: Option<String>,
1603    /// Sigops-adjusted virtual transaction size.
1604    #[serde(rename = "vsize")]
1605    pub v_size: Option<u64>,
1606    /// Transaction fees
1607    pub fees: Option<SubmitPackageFees>,
1608    /// Error string if rejected from mempool, or "package-not-validated" when the package aborts before any per-tx processing.
1609    pub error: Option<String>,
1610}
1611
1612/// Transaction fees (only present if 'allowed' is true)
1613#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1614pub struct TestMempoolAcceptFees {
1615    /// transaction fee in BTC
1616    #[serde(deserialize_with = "amount_from_btc_float")]
1617    pub base: bitcoin::Amount,
1618    /// the effective feerate in BTC per KvB. May differ from the base feerate if, for example, there are modified fees from prioritisetransaction or a package feerate was used.
1619    #[serde(rename = "effective-feerate")]
1620    #[serde(deserialize_with = "amount_from_btc_float")]
1621    pub effective_feerate: bitcoin::Amount,
1622    /// transactions whose fees and vsizes are included in effective-feerate.
1623    #[serde(rename = "effective-includes")]
1624    pub effective_includes: Vec<String>,
1625}
1626
1627/// Type alias for Txid
1628pub type Txid = bitcoin::Txid;
1629
1630/// Script sig in decoded tx input.
1631/// See: <https://github.com/bitcoin/bitcoin/blob/744d47fcee0d32a71154292699bfdecf954a6065/src/core_io.cpp#L458-L461>
1632#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1633pub struct DecodedScriptSig {
1634    /// scriptSig in human-readable assembly form.
1635    pub asm: String,
1636    /// scriptSig serialized as hex.
1637    pub hex: String,
1638}
1639
1640/// Previous output (prevout) in decoded tx input; present for getblock verbosity 3.
1641#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1642pub struct DecodedPrevout {
1643    /// True if the prevout was created by a coinbase transaction.
1644    pub generated: bool,
1645    /// Block height where the prevout was created.
1646    pub height: i64,
1647    /// Decoded script pubkey of the prevout output.
1648    #[serde(rename = "scriptPubKey")]
1649    pub script_pubkey: DecodedScriptPubKey,
1650    /// Value of the prevout output in BTC.
1651    pub value: f64,
1652}
1653
1654/// Transaction input in decoded tx; prevout is None for getblock verbosity 2, Some for verbosity 3.
1655#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1656pub struct DecodedVin {
1657    /// Transaction id of the previous output being spent.
1658    pub txid: String,
1659    /// Index of the previous output being spent.
1660    pub vout: u32,
1661    /// Decoded scriptSig for this input, when present.
1662    #[serde(rename = "scriptSig", default, skip_serializing_if = "Option::is_none")]
1663    pub script_sig: Option<DecodedScriptSig>,
1664    /// Input sequence number.
1665    pub sequence: u64,
1666    /// Witness stack items for this input (if any).
1667    #[serde(rename = "txinwitness", default, skip_serializing_if = "Option::is_none")]
1668    pub tx_in_witness: Option<Vec<String>>,
1669    /// Decoded details of the previous output when verbosity includes prevout.
1670    #[serde(default, skip_serializing_if = "Option::is_none")]
1671    pub prevout: Option<DecodedPrevout>,
1672}
1673
1674/// Transaction output in decoded tx; mirrors Core vout object.
1675/// See: <https://github.com/bitcoin/bitcoin/blob/744d47fcee0d32a71154292699bfdecf954a6065/src/core_io.cpp#L495-L519>
1676#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1677pub struct DecodedVout {
1678    /// Value in BTC of this output.
1679    pub value: f64,
1680    /// Index of this output within the transaction.
1681    pub n: u32,
1682    /// Decoded script pubkey of this output.
1683    #[serde(rename = "scriptPubKey")]
1684    pub script_pubkey: DecodedScriptPubKey,
1685}
1686
1687/// Decoded transaction details (getblock verbosity 2/3 and getrawtransaction verbose).
1688#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1689pub struct DecodedTxDetails {
1690    /// Transaction id.
1691    pub txid: String,
1692    /// Witness transaction id (wtxid).
1693    pub hash: String,
1694    /// Transaction version.
1695    pub version: i32,
1696    /// Total serialized size of the transaction in bytes.
1697    pub size: u32,
1698    /// Virtual transaction size (vsize) as defined in BIP 141.
1699    pub vsize: u32,
1700    /// Transaction weight as defined in BIP 141.
1701    pub weight: u32,
1702    /// Transaction locktime.
1703    pub locktime: u32,
1704    /// List of transaction inputs.
1705    pub vin: Vec<DecodedVin>,
1706    /// List of transaction outputs.
1707    pub vout: Vec<DecodedVout>,
1708    /// Fee paid by the transaction, when undo data is available.
1709    #[serde(default, skip_serializing_if = "Option::is_none")]
1710    pub fee: Option<f64>,
1711    /// Raw transaction serialized as hex (consistent with getrawtransaction verbose output).
1712    pub hex: String,
1713}
1714
1715/// Hex-encoded block data returned by getblock with verbosity 0.
1716#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1717pub struct GetBlockV0 {
1718    /// Serialized block as a hex string.
1719    pub hex: String,
1720}
1721
1722/// Verbose block view with decoded transactions (built from getblock verbosities 1 and 2).
1723#[derive(Debug, Clone, PartialEq, Serialize)]
1724pub struct GetBlockWithTxsResponse {
1725    /// Block header and summary information from getblock verbosity 1.
1726    pub base: GetBlockResponse,
1727    /// Fully decoded transactions in the block, matching getblock verbosity 2.
1728    pub decoded_txs: Vec<DecodedTxDetails>,
1729}
1730
1731/// Verbose block view with decoded transactions and prevout metadata (getblock verbosity 3).
1732#[derive(Debug, Clone, PartialEq, Serialize)]
1733pub struct GetBlockWithPrevoutResponse {
1734    /// Verbose block view with prevout-rich inputs; wraps the verbosity-2 representation.
1735    pub inner: GetBlockWithTxsResponse,
1736}
1737
1738/// One transaction entry in getblocktemplate "transactions" array (BIP 22/23/145).
1739#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1740pub struct GetBlockTemplateTransaction {
1741    /// Transaction data encoded in hexadecimal (byte-for-byte).
1742    pub data: String,
1743    /// 1-based indexes of transactions in the 'transactions' list that must be present before this one.
1744    pub depends: Vec<i64>,
1745    /// Difference in value between inputs and outputs (satoshis); absent when unknown.
1746    #[serde(default, skip_serializing_if = "Option::is_none")]
1747    pub fee: Option<i64>,
1748    /// Transaction hash including witness data (byte-reversed hex).
1749    pub hash: String,
1750    /// Total SigOps cost for block limits; absent when unknown.
1751    #[serde(default, skip_serializing_if = "Option::is_none")]
1752    pub sigops: Option<i64>,
1753    /// Transaction hash excluding witness data (byte-reversed hex).
1754    pub txid: String,
1755    /// Total transaction weight for block limits.
1756    pub weight: i64,
1757}
1758
1759/// Response for the `AbandonTransaction` RPC method
1760///
1761/// This method returns a primitive value wrapped in a transparent struct.
1762#[derive(Debug, Clone, PartialEq, Serialize)]
1763pub struct AbandonTransactionResponse {
1764    /// Wrapped primitive value
1765    pub value: (),
1766}
1767
1768impl<'de> serde::Deserialize<'de> for AbandonTransactionResponse {
1769    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1770    where
1771        D: serde::Deserializer<'de>,
1772    {
1773        use std::fmt;
1774
1775        use serde::de::{self, Visitor};
1776
1777        struct PrimitiveWrapperVisitor;
1778
1779        #[allow(unused_variables, clippy::needless_lifetimes)]
1780        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
1781            type Value = AbandonTransactionResponse;
1782
1783            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
1784                formatter.write_str("a primitive value or an object with 'value' field")
1785            }
1786
1787            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
1788            where
1789                E: de::Error,
1790            {
1791                Ok(AbandonTransactionResponse { value: () })
1792            }
1793
1794            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
1795            where
1796                E: de::Error,
1797            {
1798                Ok(AbandonTransactionResponse { value: () })
1799            }
1800
1801            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
1802            where
1803                E: de::Error,
1804            {
1805                Ok(AbandonTransactionResponse { value: () })
1806            }
1807
1808            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
1809            where
1810                E: de::Error,
1811            {
1812                Ok(AbandonTransactionResponse { value: () })
1813            }
1814
1815            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
1816            where
1817                E: de::Error,
1818            {
1819                Ok(AbandonTransactionResponse { value: () })
1820            }
1821
1822            fn visit_none<E>(self) -> Result<Self::Value, E>
1823            where
1824                E: de::Error,
1825            {
1826                Ok(AbandonTransactionResponse { value: () })
1827            }
1828
1829            fn visit_unit<E>(self) -> Result<Self::Value, E>
1830            where
1831                E: de::Error,
1832            {
1833                Ok(AbandonTransactionResponse { value: () })
1834            }
1835
1836            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
1837            where
1838                M: de::MapAccess<'de>,
1839            {
1840                let mut value = None;
1841                while let Some(key) = map.next_key::<String>()? {
1842                    if key == "value" {
1843                        if value.is_some() {
1844                            return Err(de::Error::duplicate_field("value"));
1845                        }
1846                        value = Some(map.next_value::<()>()?);
1847                    } else {
1848                        let _ = map.next_value::<de::IgnoredAny>()?;
1849                    }
1850                }
1851                value.ok_or_else(|| de::Error::missing_field("value"))?;
1852                Ok(AbandonTransactionResponse { value: () })
1853            }
1854        }
1855
1856        deserializer.deserialize_any(PrimitiveWrapperVisitor)
1857    }
1858}
1859
1860impl std::ops::Deref for AbandonTransactionResponse {
1861    type Target = ();
1862    fn deref(&self) -> &Self::Target { &self.value }
1863}
1864
1865impl std::ops::DerefMut for AbandonTransactionResponse {
1866    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
1867}
1868
1869impl AsRef<()> for AbandonTransactionResponse {
1870    fn as_ref(&self) -> &() { &self.value }
1871}
1872
1873impl From<()> for AbandonTransactionResponse {
1874    fn from(value: ()) -> Self { Self { value } }
1875}
1876
1877impl From<AbandonTransactionResponse> for () {
1878    fn from(wrapper: AbandonTransactionResponse) -> Self { wrapper.value }
1879}
1880
1881/// Response for the `AbortRescan` RPC method
1882///
1883/// This method returns a primitive value wrapped in a transparent struct.
1884#[derive(Debug, Clone, PartialEq, Serialize)]
1885pub struct AbortRescanResponse {
1886    /// Wrapped primitive value
1887    pub value: bool,
1888}
1889
1890impl<'de> serde::Deserialize<'de> for AbortRescanResponse {
1891    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1892    where
1893        D: serde::Deserializer<'de>,
1894    {
1895        use std::fmt;
1896
1897        use serde::de::{self, Visitor};
1898
1899        struct PrimitiveWrapperVisitor;
1900
1901        #[allow(unused_variables, clippy::needless_lifetimes)]
1902        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
1903            type Value = AbortRescanResponse;
1904
1905            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
1906                formatter.write_str("a primitive value or an object with 'value' field")
1907            }
1908
1909            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
1910            where
1911                E: de::Error,
1912            {
1913                Ok(AbortRescanResponse { value: v != 0 })
1914            }
1915
1916            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
1917            where
1918                E: de::Error,
1919            {
1920                Ok(AbortRescanResponse { value: v != 0 })
1921            }
1922
1923            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
1924            where
1925                E: de::Error,
1926            {
1927                Ok(AbortRescanResponse { value: v != 0.0 })
1928            }
1929
1930            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
1931            where
1932                E: de::Error,
1933            {
1934                let value = v.parse::<bool>().map_err(de::Error::custom)?;
1935                Ok(AbortRescanResponse { value })
1936            }
1937
1938            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
1939            where
1940                E: de::Error,
1941            {
1942                Ok(AbortRescanResponse { value: v })
1943            }
1944
1945            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
1946            where
1947                M: de::MapAccess<'de>,
1948            {
1949                let mut value = None;
1950                while let Some(key) = map.next_key::<String>()? {
1951                    if key == "value" {
1952                        if value.is_some() {
1953                            return Err(de::Error::duplicate_field("value"));
1954                        }
1955                        value = Some(map.next_value()?);
1956                    } else {
1957                        let _ = map.next_value::<de::IgnoredAny>()?;
1958                    }
1959                }
1960                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
1961                Ok(AbortRescanResponse { value })
1962            }
1963        }
1964
1965        deserializer.deserialize_any(PrimitiveWrapperVisitor)
1966    }
1967}
1968
1969impl std::ops::Deref for AbortRescanResponse {
1970    type Target = bool;
1971    fn deref(&self) -> &Self::Target { &self.value }
1972}
1973
1974impl std::ops::DerefMut for AbortRescanResponse {
1975    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
1976}
1977
1978impl AsRef<bool> for AbortRescanResponse {
1979    fn as_ref(&self) -> &bool { &self.value }
1980}
1981
1982impl From<bool> for AbortRescanResponse {
1983    fn from(value: bool) -> Self { Self { value } }
1984}
1985
1986impl From<AbortRescanResponse> for bool {
1987    fn from(wrapper: AbortRescanResponse) -> Self { wrapper.value }
1988}
1989
1990/// Response for the `AddConnection` RPC method
1991#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
1992#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
1993pub struct AddConnectionResponse {
1994    /// Address of newly added connection.
1995    pub address: String,
1996    /// Type of connection opened.
1997    pub connection_type: String,
1998}
1999
2000/// Response for the `AddNode` RPC method
2001///
2002/// This method returns a primitive value wrapped in a transparent struct.
2003#[derive(Debug, Clone, PartialEq, Serialize)]
2004pub struct AddNodeResponse {
2005    /// Wrapped primitive value
2006    pub value: (),
2007}
2008
2009impl<'de> serde::Deserialize<'de> for AddNodeResponse {
2010    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2011    where
2012        D: serde::Deserializer<'de>,
2013    {
2014        use std::fmt;
2015
2016        use serde::de::{self, Visitor};
2017
2018        struct PrimitiveWrapperVisitor;
2019
2020        #[allow(unused_variables, clippy::needless_lifetimes)]
2021        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
2022            type Value = AddNodeResponse;
2023
2024            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
2025                formatter.write_str("a primitive value or an object with 'value' field")
2026            }
2027
2028            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
2029            where
2030                E: de::Error,
2031            {
2032                Ok(AddNodeResponse { value: () })
2033            }
2034
2035            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
2036            where
2037                E: de::Error,
2038            {
2039                Ok(AddNodeResponse { value: () })
2040            }
2041
2042            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
2043            where
2044                E: de::Error,
2045            {
2046                Ok(AddNodeResponse { value: () })
2047            }
2048
2049            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
2050            where
2051                E: de::Error,
2052            {
2053                Ok(AddNodeResponse { value: () })
2054            }
2055
2056            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
2057            where
2058                E: de::Error,
2059            {
2060                Ok(AddNodeResponse { value: () })
2061            }
2062
2063            fn visit_none<E>(self) -> Result<Self::Value, E>
2064            where
2065                E: de::Error,
2066            {
2067                Ok(AddNodeResponse { value: () })
2068            }
2069
2070            fn visit_unit<E>(self) -> Result<Self::Value, E>
2071            where
2072                E: de::Error,
2073            {
2074                Ok(AddNodeResponse { value: () })
2075            }
2076
2077            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
2078            where
2079                M: de::MapAccess<'de>,
2080            {
2081                let mut value = None;
2082                while let Some(key) = map.next_key::<String>()? {
2083                    if key == "value" {
2084                        if value.is_some() {
2085                            return Err(de::Error::duplicate_field("value"));
2086                        }
2087                        value = Some(map.next_value::<()>()?);
2088                    } else {
2089                        let _ = map.next_value::<de::IgnoredAny>()?;
2090                    }
2091                }
2092                value.ok_or_else(|| de::Error::missing_field("value"))?;
2093                Ok(AddNodeResponse { value: () })
2094            }
2095        }
2096
2097        deserializer.deserialize_any(PrimitiveWrapperVisitor)
2098    }
2099}
2100
2101impl std::ops::Deref for AddNodeResponse {
2102    type Target = ();
2103    fn deref(&self) -> &Self::Target { &self.value }
2104}
2105
2106impl std::ops::DerefMut for AddNodeResponse {
2107    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
2108}
2109
2110impl AsRef<()> for AddNodeResponse {
2111    fn as_ref(&self) -> &() { &self.value }
2112}
2113
2114impl From<()> for AddNodeResponse {
2115    fn from(value: ()) -> Self { Self { value } }
2116}
2117
2118impl From<AddNodeResponse> for () {
2119    fn from(wrapper: AddNodeResponse) -> Self { wrapper.value }
2120}
2121
2122/// Response for the `AddPeerAddress` RPC method
2123#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
2124#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
2125pub struct AddPeerAddressResponse {
2126    /// whether the peer address was successfully added to the address manager table
2127    pub success: bool,
2128    /// error description, if the address could not be added
2129    pub error: Option<String>,
2130}
2131
2132/// Response for the `AnalyzePsbt` RPC method
2133#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
2134#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
2135pub struct AnalyzePsbtResponse {
2136    pub inputs: Option<Vec<AnalyzePsbtInput>>,
2137    /// Estimated vsize of the final signed transaction
2138    pub estimated_vsize: Option<u64>,
2139    /// Estimated feerate of the final signed transaction in BTC/kvB. Shown only if all UTXO slots in the PSBT have been filled
2140    pub estimated_feerate: Option<f64>,
2141    /// The transaction fee paid. Shown only if all UTXO slots in the PSBT have been filled
2142    #[serde(default)]
2143    #[serde(deserialize_with = "option_amount_from_btc_float")]
2144    pub fee: Option<bitcoin::Amount>,
2145    /// Role of the next person that this psbt needs to go to
2146    pub next: String,
2147    /// Error message (if there is one)
2148    pub error: Option<String>,
2149}
2150
2151/// Response for the `BackupWallet` RPC method
2152///
2153/// This method returns a primitive value wrapped in a transparent struct.
2154#[derive(Debug, Clone, PartialEq, Serialize)]
2155pub struct BackupWalletResponse {
2156    /// Wrapped primitive value
2157    pub value: (),
2158}
2159
2160impl<'de> serde::Deserialize<'de> for BackupWalletResponse {
2161    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2162    where
2163        D: serde::Deserializer<'de>,
2164    {
2165        use std::fmt;
2166
2167        use serde::de::{self, Visitor};
2168
2169        struct PrimitiveWrapperVisitor;
2170
2171        #[allow(unused_variables, clippy::needless_lifetimes)]
2172        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
2173            type Value = BackupWalletResponse;
2174
2175            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
2176                formatter.write_str("a primitive value or an object with 'value' field")
2177            }
2178
2179            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
2180            where
2181                E: de::Error,
2182            {
2183                Ok(BackupWalletResponse { value: () })
2184            }
2185
2186            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
2187            where
2188                E: de::Error,
2189            {
2190                Ok(BackupWalletResponse { value: () })
2191            }
2192
2193            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
2194            where
2195                E: de::Error,
2196            {
2197                Ok(BackupWalletResponse { value: () })
2198            }
2199
2200            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
2201            where
2202                E: de::Error,
2203            {
2204                Ok(BackupWalletResponse { value: () })
2205            }
2206
2207            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
2208            where
2209                E: de::Error,
2210            {
2211                Ok(BackupWalletResponse { value: () })
2212            }
2213
2214            fn visit_none<E>(self) -> Result<Self::Value, E>
2215            where
2216                E: de::Error,
2217            {
2218                Ok(BackupWalletResponse { value: () })
2219            }
2220
2221            fn visit_unit<E>(self) -> Result<Self::Value, E>
2222            where
2223                E: de::Error,
2224            {
2225                Ok(BackupWalletResponse { value: () })
2226            }
2227
2228            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
2229            where
2230                M: de::MapAccess<'de>,
2231            {
2232                let mut value = None;
2233                while let Some(key) = map.next_key::<String>()? {
2234                    if key == "value" {
2235                        if value.is_some() {
2236                            return Err(de::Error::duplicate_field("value"));
2237                        }
2238                        value = Some(map.next_value::<()>()?);
2239                    } else {
2240                        let _ = map.next_value::<de::IgnoredAny>()?;
2241                    }
2242                }
2243                value.ok_or_else(|| de::Error::missing_field("value"))?;
2244                Ok(BackupWalletResponse { value: () })
2245            }
2246        }
2247
2248        deserializer.deserialize_any(PrimitiveWrapperVisitor)
2249    }
2250}
2251
2252impl std::ops::Deref for BackupWalletResponse {
2253    type Target = ();
2254    fn deref(&self) -> &Self::Target { &self.value }
2255}
2256
2257impl std::ops::DerefMut for BackupWalletResponse {
2258    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
2259}
2260
2261impl AsRef<()> for BackupWalletResponse {
2262    fn as_ref(&self) -> &() { &self.value }
2263}
2264
2265impl From<()> for BackupWalletResponse {
2266    fn from(value: ()) -> Self { Self { value } }
2267}
2268
2269impl From<BackupWalletResponse> for () {
2270    fn from(wrapper: BackupWalletResponse) -> Self { wrapper.value }
2271}
2272
2273/// Response for the `BumpFee` RPC method
2274#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
2275#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
2276pub struct BumpFeeResponse {
2277    /// The id of the new transaction.
2278    pub txid: bitcoin::Txid,
2279    /// The fee of the replaced transaction.
2280    #[serde(rename = "origfee")]
2281    #[serde(deserialize_with = "amount_from_btc_float")]
2282    pub orig_fee: bitcoin::Amount,
2283    /// The fee of the new transaction.
2284    #[serde(deserialize_with = "amount_from_btc_float")]
2285    pub fee: bitcoin::Amount,
2286    /// Errors encountered during processing (may be empty).
2287    pub errors: Vec<String>,
2288}
2289
2290/// Response for the `ClearBanned` RPC method
2291///
2292/// This method returns a primitive value wrapped in a transparent struct.
2293#[derive(Debug, Clone, PartialEq, Serialize)]
2294pub struct ClearBannedResponse {
2295    /// Wrapped primitive value
2296    pub value: (),
2297}
2298
2299impl<'de> serde::Deserialize<'de> for ClearBannedResponse {
2300    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2301    where
2302        D: serde::Deserializer<'de>,
2303    {
2304        use std::fmt;
2305
2306        use serde::de::{self, Visitor};
2307
2308        struct PrimitiveWrapperVisitor;
2309
2310        #[allow(unused_variables, clippy::needless_lifetimes)]
2311        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
2312            type Value = ClearBannedResponse;
2313
2314            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
2315                formatter.write_str("a primitive value or an object with 'value' field")
2316            }
2317
2318            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
2319            where
2320                E: de::Error,
2321            {
2322                Ok(ClearBannedResponse { value: () })
2323            }
2324
2325            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
2326            where
2327                E: de::Error,
2328            {
2329                Ok(ClearBannedResponse { value: () })
2330            }
2331
2332            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
2333            where
2334                E: de::Error,
2335            {
2336                Ok(ClearBannedResponse { value: () })
2337            }
2338
2339            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
2340            where
2341                E: de::Error,
2342            {
2343                Ok(ClearBannedResponse { value: () })
2344            }
2345
2346            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
2347            where
2348                E: de::Error,
2349            {
2350                Ok(ClearBannedResponse { value: () })
2351            }
2352
2353            fn visit_none<E>(self) -> Result<Self::Value, E>
2354            where
2355                E: de::Error,
2356            {
2357                Ok(ClearBannedResponse { value: () })
2358            }
2359
2360            fn visit_unit<E>(self) -> Result<Self::Value, E>
2361            where
2362                E: de::Error,
2363            {
2364                Ok(ClearBannedResponse { value: () })
2365            }
2366
2367            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
2368            where
2369                M: de::MapAccess<'de>,
2370            {
2371                let mut value = None;
2372                while let Some(key) = map.next_key::<String>()? {
2373                    if key == "value" {
2374                        if value.is_some() {
2375                            return Err(de::Error::duplicate_field("value"));
2376                        }
2377                        value = Some(map.next_value::<()>()?);
2378                    } else {
2379                        let _ = map.next_value::<de::IgnoredAny>()?;
2380                    }
2381                }
2382                value.ok_or_else(|| de::Error::missing_field("value"))?;
2383                Ok(ClearBannedResponse { value: () })
2384            }
2385        }
2386
2387        deserializer.deserialize_any(PrimitiveWrapperVisitor)
2388    }
2389}
2390
2391impl std::ops::Deref for ClearBannedResponse {
2392    type Target = ();
2393    fn deref(&self) -> &Self::Target { &self.value }
2394}
2395
2396impl std::ops::DerefMut for ClearBannedResponse {
2397    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
2398}
2399
2400impl AsRef<()> for ClearBannedResponse {
2401    fn as_ref(&self) -> &() { &self.value }
2402}
2403
2404impl From<()> for ClearBannedResponse {
2405    fn from(value: ()) -> Self { Self { value } }
2406}
2407
2408impl From<ClearBannedResponse> for () {
2409    fn from(wrapper: ClearBannedResponse) -> Self { wrapper.value }
2410}
2411
2412/// Response for the `CombinePsbt` RPC method
2413///
2414/// This method returns a primitive value wrapped in a transparent struct.
2415#[derive(Debug, Clone, PartialEq, Serialize)]
2416pub struct CombinePsbtResponse {
2417    /// Wrapped primitive value
2418    pub value: String,
2419}
2420
2421impl<'de> serde::Deserialize<'de> for CombinePsbtResponse {
2422    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2423    where
2424        D: serde::Deserializer<'de>,
2425    {
2426        use std::fmt;
2427
2428        use serde::de::{self, Visitor};
2429
2430        struct PrimitiveWrapperVisitor;
2431
2432        #[allow(unused_variables, clippy::needless_lifetimes)]
2433        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
2434            type Value = CombinePsbtResponse;
2435
2436            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
2437                formatter.write_str("a primitive value or an object with 'value' field")
2438            }
2439
2440            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
2441            where
2442                E: de::Error,
2443            {
2444                Ok(CombinePsbtResponse { value: v.to_string() })
2445            }
2446
2447            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
2448            where
2449                E: de::Error,
2450            {
2451                Ok(CombinePsbtResponse { value: v.to_string() })
2452            }
2453
2454            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
2455            where
2456                E: de::Error,
2457            {
2458                Ok(CombinePsbtResponse { value: v.to_string() })
2459            }
2460
2461            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
2462            where
2463                E: de::Error,
2464            {
2465                Ok(CombinePsbtResponse { value: v.to_string() })
2466            }
2467
2468            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
2469            where
2470                E: de::Error,
2471            {
2472                Ok(CombinePsbtResponse { value: v.to_string() })
2473            }
2474
2475            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
2476            where
2477                M: de::MapAccess<'de>,
2478            {
2479                let mut value = None;
2480                while let Some(key) = map.next_key::<String>()? {
2481                    if key == "value" {
2482                        if value.is_some() {
2483                            return Err(de::Error::duplicate_field("value"));
2484                        }
2485                        value = Some(map.next_value()?);
2486                    } else {
2487                        let _ = map.next_value::<de::IgnoredAny>()?;
2488                    }
2489                }
2490                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
2491                Ok(CombinePsbtResponse { value })
2492            }
2493        }
2494
2495        deserializer.deserialize_any(PrimitiveWrapperVisitor)
2496    }
2497}
2498
2499impl std::ops::Deref for CombinePsbtResponse {
2500    type Target = String;
2501    fn deref(&self) -> &Self::Target { &self.value }
2502}
2503
2504impl std::ops::DerefMut for CombinePsbtResponse {
2505    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
2506}
2507
2508impl AsRef<String> for CombinePsbtResponse {
2509    fn as_ref(&self) -> &String { &self.value }
2510}
2511
2512impl From<String> for CombinePsbtResponse {
2513    fn from(value: String) -> Self { Self { value } }
2514}
2515
2516impl From<CombinePsbtResponse> for String {
2517    fn from(wrapper: CombinePsbtResponse) -> Self { wrapper.value }
2518}
2519
2520/// Response for the `CombineRawTransaction` RPC method
2521///
2522/// This method returns a primitive value wrapped in a transparent struct.
2523#[derive(Debug, Clone, PartialEq, Serialize)]
2524pub struct CombineRawTransactionResponse {
2525    /// Wrapped primitive value
2526    pub value: String,
2527}
2528
2529impl<'de> serde::Deserialize<'de> for CombineRawTransactionResponse {
2530    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2531    where
2532        D: serde::Deserializer<'de>,
2533    {
2534        use std::fmt;
2535
2536        use serde::de::{self, Visitor};
2537
2538        struct PrimitiveWrapperVisitor;
2539
2540        #[allow(unused_variables, clippy::needless_lifetimes)]
2541        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
2542            type Value = CombineRawTransactionResponse;
2543
2544            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
2545                formatter.write_str("a primitive value or an object with 'value' field")
2546            }
2547
2548            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
2549            where
2550                E: de::Error,
2551            {
2552                Ok(CombineRawTransactionResponse { value: v.to_string() })
2553            }
2554
2555            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
2556            where
2557                E: de::Error,
2558            {
2559                Ok(CombineRawTransactionResponse { value: v.to_string() })
2560            }
2561
2562            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
2563            where
2564                E: de::Error,
2565            {
2566                Ok(CombineRawTransactionResponse { value: v.to_string() })
2567            }
2568
2569            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
2570            where
2571                E: de::Error,
2572            {
2573                Ok(CombineRawTransactionResponse { value: v.to_string() })
2574            }
2575
2576            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
2577            where
2578                E: de::Error,
2579            {
2580                Ok(CombineRawTransactionResponse { value: v.to_string() })
2581            }
2582
2583            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
2584            where
2585                M: de::MapAccess<'de>,
2586            {
2587                let mut value = None;
2588                while let Some(key) = map.next_key::<String>()? {
2589                    if key == "value" {
2590                        if value.is_some() {
2591                            return Err(de::Error::duplicate_field("value"));
2592                        }
2593                        value = Some(map.next_value()?);
2594                    } else {
2595                        let _ = map.next_value::<de::IgnoredAny>()?;
2596                    }
2597                }
2598                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
2599                Ok(CombineRawTransactionResponse { value })
2600            }
2601        }
2602
2603        deserializer.deserialize_any(PrimitiveWrapperVisitor)
2604    }
2605}
2606
2607impl std::ops::Deref for CombineRawTransactionResponse {
2608    type Target = String;
2609    fn deref(&self) -> &Self::Target { &self.value }
2610}
2611
2612impl std::ops::DerefMut for CombineRawTransactionResponse {
2613    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
2614}
2615
2616impl AsRef<String> for CombineRawTransactionResponse {
2617    fn as_ref(&self) -> &String { &self.value }
2618}
2619
2620impl From<String> for CombineRawTransactionResponse {
2621    fn from(value: String) -> Self { Self { value } }
2622}
2623
2624impl From<CombineRawTransactionResponse> for String {
2625    fn from(wrapper: CombineRawTransactionResponse) -> Self { wrapper.value }
2626}
2627
2628/// Response for the `ConvertToPsbt` RPC method
2629///
2630/// This method returns a primitive value wrapped in a transparent struct.
2631#[derive(Debug, Clone, PartialEq, Serialize)]
2632pub struct ConvertToPsbtResponse {
2633    /// Wrapped primitive value
2634    pub value: String,
2635}
2636
2637impl<'de> serde::Deserialize<'de> for ConvertToPsbtResponse {
2638    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2639    where
2640        D: serde::Deserializer<'de>,
2641    {
2642        use std::fmt;
2643
2644        use serde::de::{self, Visitor};
2645
2646        struct PrimitiveWrapperVisitor;
2647
2648        #[allow(unused_variables, clippy::needless_lifetimes)]
2649        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
2650            type Value = ConvertToPsbtResponse;
2651
2652            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
2653                formatter.write_str("a primitive value or an object with 'value' field")
2654            }
2655
2656            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
2657            where
2658                E: de::Error,
2659            {
2660                Ok(ConvertToPsbtResponse { value: v.to_string() })
2661            }
2662
2663            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
2664            where
2665                E: de::Error,
2666            {
2667                Ok(ConvertToPsbtResponse { value: v.to_string() })
2668            }
2669
2670            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
2671            where
2672                E: de::Error,
2673            {
2674                Ok(ConvertToPsbtResponse { value: v.to_string() })
2675            }
2676
2677            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
2678            where
2679                E: de::Error,
2680            {
2681                Ok(ConvertToPsbtResponse { value: v.to_string() })
2682            }
2683
2684            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
2685            where
2686                E: de::Error,
2687            {
2688                Ok(ConvertToPsbtResponse { value: v.to_string() })
2689            }
2690
2691            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
2692            where
2693                M: de::MapAccess<'de>,
2694            {
2695                let mut value = None;
2696                while let Some(key) = map.next_key::<String>()? {
2697                    if key == "value" {
2698                        if value.is_some() {
2699                            return Err(de::Error::duplicate_field("value"));
2700                        }
2701                        value = Some(map.next_value()?);
2702                    } else {
2703                        let _ = map.next_value::<de::IgnoredAny>()?;
2704                    }
2705                }
2706                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
2707                Ok(ConvertToPsbtResponse { value })
2708            }
2709        }
2710
2711        deserializer.deserialize_any(PrimitiveWrapperVisitor)
2712    }
2713}
2714
2715impl std::ops::Deref for ConvertToPsbtResponse {
2716    type Target = String;
2717    fn deref(&self) -> &Self::Target { &self.value }
2718}
2719
2720impl std::ops::DerefMut for ConvertToPsbtResponse {
2721    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
2722}
2723
2724impl AsRef<String> for ConvertToPsbtResponse {
2725    fn as_ref(&self) -> &String { &self.value }
2726}
2727
2728impl From<String> for ConvertToPsbtResponse {
2729    fn from(value: String) -> Self { Self { value } }
2730}
2731
2732impl From<ConvertToPsbtResponse> for String {
2733    fn from(wrapper: ConvertToPsbtResponse) -> Self { wrapper.value }
2734}
2735
2736/// Response for the `CreateMultisig` RPC method
2737#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
2738#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
2739pub struct CreateMultisigResponse {
2740    /// The value of the new multisig address.
2741    pub address: String,
2742    /// The string value of the hex-encoded redemption script.
2743    #[serde(rename = "redeemScript")]
2744    pub redeem_script: bitcoin::ScriptBuf,
2745    /// The descriptor for this multisig
2746    pub descriptor: String,
2747    /// Any warnings resulting from the creation of this multisig
2748    pub warnings: Option<Vec<String>>,
2749}
2750
2751/// Response for the `CreatePsbt` RPC method
2752///
2753/// This method returns a primitive value wrapped in a transparent struct.
2754#[derive(Debug, Clone, PartialEq, Serialize)]
2755pub struct CreatePsbtResponse {
2756    /// Wrapped primitive value
2757    pub value: String,
2758}
2759
2760impl<'de> serde::Deserialize<'de> for CreatePsbtResponse {
2761    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2762    where
2763        D: serde::Deserializer<'de>,
2764    {
2765        use std::fmt;
2766
2767        use serde::de::{self, Visitor};
2768
2769        struct PrimitiveWrapperVisitor;
2770
2771        #[allow(unused_variables, clippy::needless_lifetimes)]
2772        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
2773            type Value = CreatePsbtResponse;
2774
2775            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
2776                formatter.write_str("a primitive value or an object with 'value' field")
2777            }
2778
2779            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
2780            where
2781                E: de::Error,
2782            {
2783                Ok(CreatePsbtResponse { value: v.to_string() })
2784            }
2785
2786            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
2787            where
2788                E: de::Error,
2789            {
2790                Ok(CreatePsbtResponse { value: v.to_string() })
2791            }
2792
2793            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
2794            where
2795                E: de::Error,
2796            {
2797                Ok(CreatePsbtResponse { value: v.to_string() })
2798            }
2799
2800            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
2801            where
2802                E: de::Error,
2803            {
2804                Ok(CreatePsbtResponse { value: v.to_string() })
2805            }
2806
2807            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
2808            where
2809                E: de::Error,
2810            {
2811                Ok(CreatePsbtResponse { value: v.to_string() })
2812            }
2813
2814            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
2815            where
2816                M: de::MapAccess<'de>,
2817            {
2818                let mut value = None;
2819                while let Some(key) = map.next_key::<String>()? {
2820                    if key == "value" {
2821                        if value.is_some() {
2822                            return Err(de::Error::duplicate_field("value"));
2823                        }
2824                        value = Some(map.next_value()?);
2825                    } else {
2826                        let _ = map.next_value::<de::IgnoredAny>()?;
2827                    }
2828                }
2829                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
2830                Ok(CreatePsbtResponse { value })
2831            }
2832        }
2833
2834        deserializer.deserialize_any(PrimitiveWrapperVisitor)
2835    }
2836}
2837
2838impl std::ops::Deref for CreatePsbtResponse {
2839    type Target = String;
2840    fn deref(&self) -> &Self::Target { &self.value }
2841}
2842
2843impl std::ops::DerefMut for CreatePsbtResponse {
2844    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
2845}
2846
2847impl AsRef<String> for CreatePsbtResponse {
2848    fn as_ref(&self) -> &String { &self.value }
2849}
2850
2851impl From<String> for CreatePsbtResponse {
2852    fn from(value: String) -> Self { Self { value } }
2853}
2854
2855impl From<CreatePsbtResponse> for String {
2856    fn from(wrapper: CreatePsbtResponse) -> Self { wrapper.value }
2857}
2858
2859/// Response for the `CreateRawTransaction` RPC method
2860///
2861/// This method returns a primitive value wrapped in a transparent struct.
2862#[derive(Debug, Clone, PartialEq, Serialize)]
2863pub struct CreateRawTransactionResponse {
2864    /// Wrapped primitive value
2865    pub value: String,
2866}
2867
2868impl<'de> serde::Deserialize<'de> for CreateRawTransactionResponse {
2869    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2870    where
2871        D: serde::Deserializer<'de>,
2872    {
2873        use std::fmt;
2874
2875        use serde::de::{self, Visitor};
2876
2877        struct PrimitiveWrapperVisitor;
2878
2879        #[allow(unused_variables, clippy::needless_lifetimes)]
2880        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
2881            type Value = CreateRawTransactionResponse;
2882
2883            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
2884                formatter.write_str("a primitive value or an object with 'value' field")
2885            }
2886
2887            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
2888            where
2889                E: de::Error,
2890            {
2891                Ok(CreateRawTransactionResponse { value: v.to_string() })
2892            }
2893
2894            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
2895            where
2896                E: de::Error,
2897            {
2898                Ok(CreateRawTransactionResponse { value: v.to_string() })
2899            }
2900
2901            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
2902            where
2903                E: de::Error,
2904            {
2905                Ok(CreateRawTransactionResponse { value: v.to_string() })
2906            }
2907
2908            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
2909            where
2910                E: de::Error,
2911            {
2912                Ok(CreateRawTransactionResponse { value: v.to_string() })
2913            }
2914
2915            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
2916            where
2917                E: de::Error,
2918            {
2919                Ok(CreateRawTransactionResponse { value: v.to_string() })
2920            }
2921
2922            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
2923            where
2924                M: de::MapAccess<'de>,
2925            {
2926                let mut value = None;
2927                while let Some(key) = map.next_key::<String>()? {
2928                    if key == "value" {
2929                        if value.is_some() {
2930                            return Err(de::Error::duplicate_field("value"));
2931                        }
2932                        value = Some(map.next_value()?);
2933                    } else {
2934                        let _ = map.next_value::<de::IgnoredAny>()?;
2935                    }
2936                }
2937                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
2938                Ok(CreateRawTransactionResponse { value })
2939            }
2940        }
2941
2942        deserializer.deserialize_any(PrimitiveWrapperVisitor)
2943    }
2944}
2945
2946impl std::ops::Deref for CreateRawTransactionResponse {
2947    type Target = String;
2948    fn deref(&self) -> &Self::Target { &self.value }
2949}
2950
2951impl std::ops::DerefMut for CreateRawTransactionResponse {
2952    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
2953}
2954
2955impl AsRef<String> for CreateRawTransactionResponse {
2956    fn as_ref(&self) -> &String { &self.value }
2957}
2958
2959impl From<String> for CreateRawTransactionResponse {
2960    fn from(value: String) -> Self { Self { value } }
2961}
2962
2963impl From<CreateRawTransactionResponse> for String {
2964    fn from(wrapper: CreateRawTransactionResponse) -> Self { wrapper.value }
2965}
2966
2967/// Response for the `CreateWallet` RPC method
2968#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
2969#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
2970pub struct CreateWalletResponse {
2971    /// The wallet name if created successfully. If the wallet was created using a full path, the wallet_name will be the full path.
2972    pub name: String,
2973    /// Warning messages, if any, related to creating and loading the wallet.
2974    pub warnings: Option<Vec<String>>,
2975}
2976
2977/// Response for the `CreateWalletDescriptor` RPC method
2978#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
2979#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
2980pub struct CreateWalletDescriptorResponse {
2981    /// The public descriptors that were added to the wallet
2982    pub descs: Vec<String>,
2983}
2984
2985/// Response for the `DecodePsbt` RPC method
2986#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
2987#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
2988pub struct DecodePsbtResponse {
2989    /// The decoded network-serialized unsigned transaction.
2990    pub tx: DecodePsbtTx,
2991    pub global_xpubs: Vec<DecodePsbtGlobalXpubs>,
2992    /// The PSBT version number. Not to be confused with the unsigned transaction version
2993    pub psbt_version: u64,
2994    /// The global proprietary map
2995    pub proprietary: Vec<DecodePsbtProprietary>,
2996    /// The unknown global fields
2997    pub unknown: DecodePsbtUnknown,
2998    pub inputs: Vec<DecodePsbtInput>,
2999    pub outputs: Vec<DecodePsbtOutput>,
3000    /// The transaction fee paid if all UTXOs slots in the PSBT have been filled.
3001    #[serde(deserialize_with = "option_amount_from_btc_float")]
3002    pub fee: Option<bitcoin::Amount>,
3003}
3004
3005/// Response for the `DecodeRawTransaction` RPC method
3006#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
3007#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
3008pub struct DecodeRawTransactionResponse {
3009    /// The transaction id
3010    pub txid: bitcoin::Txid,
3011    /// The transaction hash (differs from txid for witness transactions)
3012    pub hash: String,
3013    /// The serialized transaction size
3014    pub size: u64,
3015    /// The virtual transaction size (differs from size for witness transactions)
3016    #[serde(rename = "vsize")]
3017    pub v_size: u64,
3018    /// The transaction's weight (between vsize*4-3 and vsize*4)
3019    pub weight: u64,
3020    /// The version
3021    pub version: u32,
3022    /// The lock time
3023    #[serde(rename = "locktime")]
3024    pub lock_time: u64,
3025    pub vin: Vec<DecodedVin>,
3026    pub vout: Vec<DecodedVout>,
3027}
3028
3029/// Response for the `DecodeScript` RPC method
3030#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
3031#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
3032pub struct DecodeScriptResponse {
3033    /// Disassembly of the script
3034    pub asm: String,
3035    /// Inferred descriptor for the script
3036    pub desc: String,
3037    /// The output type (e.g. nonstandard, anchor, pubkey, pubkeyhash, scripthash, multisig, nulldata, witness_v0_scripthash, witness_v0_keyhash, witness_v1_taproot, witness_unknown)
3038    #[serde(rename = "type")]
3039    pub r#type: String,
3040    /// The Bitcoin address (only if a well-defined address exists)
3041    pub address: Option<String>,
3042    /// address of P2SH script wrapping this redeem script (not returned for types that should not be wrapped)
3043    pub p2sh: Option<String>,
3044    /// Result of a witness output script wrapping this redeem script (not returned for types that should not be wrapped)
3045    pub segwit: Option<DecodeScriptSegwit>,
3046}
3047
3048/// Response for the `DeriveAddresses` RPC method
3049///
3050/// This method returns an array wrapped in a transparent struct.
3051#[derive(Debug, Clone, PartialEq, Serialize)]
3052pub struct DeriveAddressesResponse {
3053    /// Wrapped array value
3054    pub value: Vec<String>,
3055}
3056
3057impl<'de> serde::Deserialize<'de> for DeriveAddressesResponse {
3058    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
3059    where
3060        D: serde::Deserializer<'de>,
3061    {
3062        let value = Vec::<String>::deserialize(deserializer)?;
3063        Ok(Self { value })
3064    }
3065}
3066
3067impl From<Vec<String>> for DeriveAddressesResponse {
3068    fn from(value: Vec<String>) -> Self { Self { value } }
3069}
3070
3071impl From<DeriveAddressesResponse> for Vec<String> {
3072    fn from(wrapper: DeriveAddressesResponse) -> Self { wrapper.value }
3073}
3074
3075/// Response for the `DescriptorProcessPsbt` RPC method
3076#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
3077#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
3078pub struct DescriptorProcessPsbtResponse {
3079    /// The base64-encoded partially signed transaction
3080    pub psbt: String,
3081    /// If the transaction has a complete set of signatures
3082    pub complete: bool,
3083    /// The hex-encoded network transaction if complete
3084    pub hex: Option<String>,
3085}
3086
3087/// Response for the `DisconnectNode` RPC method
3088///
3089/// This method returns a primitive value wrapped in a transparent struct.
3090#[derive(Debug, Clone, PartialEq, Serialize)]
3091pub struct DisconnectNodeResponse {
3092    /// Wrapped primitive value
3093    pub value: (),
3094}
3095
3096impl<'de> serde::Deserialize<'de> for DisconnectNodeResponse {
3097    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
3098    where
3099        D: serde::Deserializer<'de>,
3100    {
3101        use std::fmt;
3102
3103        use serde::de::{self, Visitor};
3104
3105        struct PrimitiveWrapperVisitor;
3106
3107        #[allow(unused_variables, clippy::needless_lifetimes)]
3108        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
3109            type Value = DisconnectNodeResponse;
3110
3111            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
3112                formatter.write_str("a primitive value or an object with 'value' field")
3113            }
3114
3115            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
3116            where
3117                E: de::Error,
3118            {
3119                Ok(DisconnectNodeResponse { value: () })
3120            }
3121
3122            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
3123            where
3124                E: de::Error,
3125            {
3126                Ok(DisconnectNodeResponse { value: () })
3127            }
3128
3129            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
3130            where
3131                E: de::Error,
3132            {
3133                Ok(DisconnectNodeResponse { value: () })
3134            }
3135
3136            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
3137            where
3138                E: de::Error,
3139            {
3140                Ok(DisconnectNodeResponse { value: () })
3141            }
3142
3143            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
3144            where
3145                E: de::Error,
3146            {
3147                Ok(DisconnectNodeResponse { value: () })
3148            }
3149
3150            fn visit_none<E>(self) -> Result<Self::Value, E>
3151            where
3152                E: de::Error,
3153            {
3154                Ok(DisconnectNodeResponse { value: () })
3155            }
3156
3157            fn visit_unit<E>(self) -> Result<Self::Value, E>
3158            where
3159                E: de::Error,
3160            {
3161                Ok(DisconnectNodeResponse { value: () })
3162            }
3163
3164            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
3165            where
3166                M: de::MapAccess<'de>,
3167            {
3168                let mut value = None;
3169                while let Some(key) = map.next_key::<String>()? {
3170                    if key == "value" {
3171                        if value.is_some() {
3172                            return Err(de::Error::duplicate_field("value"));
3173                        }
3174                        value = Some(map.next_value::<()>()?);
3175                    } else {
3176                        let _ = map.next_value::<de::IgnoredAny>()?;
3177                    }
3178                }
3179                value.ok_or_else(|| de::Error::missing_field("value"))?;
3180                Ok(DisconnectNodeResponse { value: () })
3181            }
3182        }
3183
3184        deserializer.deserialize_any(PrimitiveWrapperVisitor)
3185    }
3186}
3187
3188impl std::ops::Deref for DisconnectNodeResponse {
3189    type Target = ();
3190    fn deref(&self) -> &Self::Target { &self.value }
3191}
3192
3193impl std::ops::DerefMut for DisconnectNodeResponse {
3194    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
3195}
3196
3197impl AsRef<()> for DisconnectNodeResponse {
3198    fn as_ref(&self) -> &() { &self.value }
3199}
3200
3201impl From<()> for DisconnectNodeResponse {
3202    fn from(value: ()) -> Self { Self { value } }
3203}
3204
3205impl From<DisconnectNodeResponse> for () {
3206    fn from(wrapper: DisconnectNodeResponse) -> Self { wrapper.value }
3207}
3208
3209/// Response for the `DumpTxOutSet` RPC method
3210#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
3211#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
3212pub struct DumpTxOutSetResponse {
3213    /// the number of coins written in the snapshot
3214    pub coins_written: u64,
3215    /// the hash of the base of the snapshot
3216    pub base_hash: String,
3217    /// the height of the base of the snapshot
3218    pub base_height: u64,
3219    /// the absolute path that the snapshot was written to
3220    pub path: String,
3221    /// the hash of the UTXO set contents
3222    pub txoutset_hash: String,
3223    /// the number of transactions in the chain up to and including the base block
3224    #[serde(rename = "nchaintx")]
3225    pub n_chain_tx: u64,
3226}
3227
3228/// Response for the `Echo` RPC method
3229///
3230/// This method returns arbitrary JSON (e.g. string, object, array) as a single value.
3231#[derive(Debug, Clone, PartialEq, Serialize)]
3232pub struct EchoResponse {
3233    /// Wrapped JSON value
3234    pub value: serde_json::Value,
3235}
3236
3237impl<'de> serde::Deserialize<'de> for EchoResponse {
3238    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
3239    where
3240        D: serde::Deserializer<'de>,
3241    {
3242        let value = serde_json::Value::deserialize(deserializer)?;
3243        Ok(Self { value })
3244    }
3245}
3246
3247impl From<serde_json::Value> for EchoResponse {
3248    fn from(value: serde_json::Value) -> Self { Self { value } }
3249}
3250
3251/// Response for the `Echoipc` RPC method
3252///
3253/// This method returns a primitive value wrapped in a transparent struct.
3254#[derive(Debug, Clone, PartialEq, Serialize)]
3255pub struct EchoipcResponse {
3256    /// Wrapped primitive value
3257    pub value: String,
3258}
3259
3260impl<'de> serde::Deserialize<'de> for EchoipcResponse {
3261    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
3262    where
3263        D: serde::Deserializer<'de>,
3264    {
3265        use std::fmt;
3266
3267        use serde::de::{self, Visitor};
3268
3269        struct PrimitiveWrapperVisitor;
3270
3271        #[allow(unused_variables, clippy::needless_lifetimes)]
3272        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
3273            type Value = EchoipcResponse;
3274
3275            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
3276                formatter.write_str("a primitive value or an object with 'value' field")
3277            }
3278
3279            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
3280            where
3281                E: de::Error,
3282            {
3283                Ok(EchoipcResponse { value: v.to_string() })
3284            }
3285
3286            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
3287            where
3288                E: de::Error,
3289            {
3290                Ok(EchoipcResponse { value: v.to_string() })
3291            }
3292
3293            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
3294            where
3295                E: de::Error,
3296            {
3297                Ok(EchoipcResponse { value: v.to_string() })
3298            }
3299
3300            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
3301            where
3302                E: de::Error,
3303            {
3304                Ok(EchoipcResponse { value: v.to_string() })
3305            }
3306
3307            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
3308            where
3309                E: de::Error,
3310            {
3311                Ok(EchoipcResponse { value: v.to_string() })
3312            }
3313
3314            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
3315            where
3316                M: de::MapAccess<'de>,
3317            {
3318                let mut value = None;
3319                while let Some(key) = map.next_key::<String>()? {
3320                    if key == "value" {
3321                        if value.is_some() {
3322                            return Err(de::Error::duplicate_field("value"));
3323                        }
3324                        value = Some(map.next_value()?);
3325                    } else {
3326                        let _ = map.next_value::<de::IgnoredAny>()?;
3327                    }
3328                }
3329                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
3330                Ok(EchoipcResponse { value })
3331            }
3332        }
3333
3334        deserializer.deserialize_any(PrimitiveWrapperVisitor)
3335    }
3336}
3337
3338impl std::ops::Deref for EchoipcResponse {
3339    type Target = String;
3340    fn deref(&self) -> &Self::Target { &self.value }
3341}
3342
3343impl std::ops::DerefMut for EchoipcResponse {
3344    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
3345}
3346
3347impl AsRef<String> for EchoipcResponse {
3348    fn as_ref(&self) -> &String { &self.value }
3349}
3350
3351impl From<String> for EchoipcResponse {
3352    fn from(value: String) -> Self { Self { value } }
3353}
3354
3355impl From<EchoipcResponse> for String {
3356    fn from(wrapper: EchoipcResponse) -> Self { wrapper.value }
3357}
3358
3359/// Response for the `Echojson` RPC method
3360///
3361/// This method returns arbitrary JSON (e.g. string, object, array) as a single value.
3362#[derive(Debug, Clone, PartialEq, Serialize)]
3363pub struct EchojsonResponse {
3364    /// Wrapped JSON value
3365    pub value: serde_json::Value,
3366}
3367
3368impl<'de> serde::Deserialize<'de> for EchojsonResponse {
3369    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
3370    where
3371        D: serde::Deserializer<'de>,
3372    {
3373        let value = serde_json::Value::deserialize(deserializer)?;
3374        Ok(Self { value })
3375    }
3376}
3377
3378impl From<serde_json::Value> for EchojsonResponse {
3379    fn from(value: serde_json::Value) -> Self { Self { value } }
3380}
3381
3382/// Response for the `EncryptWallet` RPC method
3383///
3384/// This method returns a primitive value wrapped in a transparent struct.
3385#[derive(Debug, Clone, PartialEq, Serialize)]
3386pub struct EncryptWalletResponse {
3387    /// Wrapped primitive value
3388    pub value: String,
3389}
3390
3391impl<'de> serde::Deserialize<'de> for EncryptWalletResponse {
3392    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
3393    where
3394        D: serde::Deserializer<'de>,
3395    {
3396        use std::fmt;
3397
3398        use serde::de::{self, Visitor};
3399
3400        struct PrimitiveWrapperVisitor;
3401
3402        #[allow(unused_variables, clippy::needless_lifetimes)]
3403        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
3404            type Value = EncryptWalletResponse;
3405
3406            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
3407                formatter.write_str("a primitive value or an object with 'value' field")
3408            }
3409
3410            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
3411            where
3412                E: de::Error,
3413            {
3414                Ok(EncryptWalletResponse { value: v.to_string() })
3415            }
3416
3417            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
3418            where
3419                E: de::Error,
3420            {
3421                Ok(EncryptWalletResponse { value: v.to_string() })
3422            }
3423
3424            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
3425            where
3426                E: de::Error,
3427            {
3428                Ok(EncryptWalletResponse { value: v.to_string() })
3429            }
3430
3431            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
3432            where
3433                E: de::Error,
3434            {
3435                Ok(EncryptWalletResponse { value: v.to_string() })
3436            }
3437
3438            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
3439            where
3440                E: de::Error,
3441            {
3442                Ok(EncryptWalletResponse { value: v.to_string() })
3443            }
3444
3445            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
3446            where
3447                M: de::MapAccess<'de>,
3448            {
3449                let mut value = None;
3450                while let Some(key) = map.next_key::<String>()? {
3451                    if key == "value" {
3452                        if value.is_some() {
3453                            return Err(de::Error::duplicate_field("value"));
3454                        }
3455                        value = Some(map.next_value()?);
3456                    } else {
3457                        let _ = map.next_value::<de::IgnoredAny>()?;
3458                    }
3459                }
3460                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
3461                Ok(EncryptWalletResponse { value })
3462            }
3463        }
3464
3465        deserializer.deserialize_any(PrimitiveWrapperVisitor)
3466    }
3467}
3468
3469impl std::ops::Deref for EncryptWalletResponse {
3470    type Target = String;
3471    fn deref(&self) -> &Self::Target { &self.value }
3472}
3473
3474impl std::ops::DerefMut for EncryptWalletResponse {
3475    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
3476}
3477
3478impl AsRef<String> for EncryptWalletResponse {
3479    fn as_ref(&self) -> &String { &self.value }
3480}
3481
3482impl From<String> for EncryptWalletResponse {
3483    fn from(value: String) -> Self { Self { value } }
3484}
3485
3486impl From<EncryptWalletResponse> for String {
3487    fn from(wrapper: EncryptWalletResponse) -> Self { wrapper.value }
3488}
3489
3490/// Response for the `EnumerateSigners` RPC method
3491#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
3492#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
3493pub struct EnumerateSignersResponse {
3494    pub signers: Vec<EnumerateSignersSigners>,
3495}
3496
3497/// Response for the `EstimateRawFee` RPC method
3498///
3499/// Results are returned for any horizon which tracks blocks up to the confirmation target
3500#[derive(Debug, Clone, PartialEq, Serialize)]
3501pub struct EstimateRawFeeResponse {
3502    /// estimate for short time horizon
3503    pub short: Option<EstimateRawFeeShort>,
3504    /// estimate for medium time horizon
3505    pub medium: Option<EstimateRawFeeMedium>,
3506    /// estimate for long time horizon
3507    pub long: Option<EstimateRawFeeLong>,
3508}
3509impl<'de> serde::Deserialize<'de> for EstimateRawFeeResponse {
3510    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
3511    where
3512        D: serde::Deserializer<'de>,
3513    {
3514        use std::fmt;
3515
3516        use serde::de::{self, Visitor};
3517
3518        struct ConditionalResponseVisitor;
3519
3520        #[allow(clippy::needless_lifetimes)]
3521        impl<'de> Visitor<'de> for ConditionalResponseVisitor {
3522            type Value = EstimateRawFeeResponse;
3523
3524            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
3525                formatter.write_str("string or object")
3526            }
3527
3528            fn visit_str<E>(self, _v: &str) -> Result<Self::Value, E>
3529            where
3530                E: de::Error,
3531            {
3532                Ok(EstimateRawFeeResponse { short: None, medium: None, long: None })
3533            }
3534
3535            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
3536            where
3537                M: de::MapAccess<'de>,
3538            {
3539                let mut short = None;
3540                let mut medium = None;
3541                let mut long = None;
3542                while let Some(key) = map.next_key::<String>()? {
3543                    if key == "short" {
3544                        if short.is_some() {
3545                            return Err(de::Error::duplicate_field("short"));
3546                        }
3547                        short = Some(map.next_value::<EstimateRawFeeShort>()?);
3548                    }
3549                    if key == "medium" {
3550                        if medium.is_some() {
3551                            return Err(de::Error::duplicate_field("medium"));
3552                        }
3553                        medium = Some(map.next_value::<EstimateRawFeeMedium>()?);
3554                    }
3555                    if key == "long" {
3556                        if long.is_some() {
3557                            return Err(de::Error::duplicate_field("long"));
3558                        }
3559                        long = Some(map.next_value::<EstimateRawFeeLong>()?);
3560                    } else {
3561                        let _ = map.next_value::<de::IgnoredAny>()?;
3562                    }
3563                }
3564                Ok(EstimateRawFeeResponse { short, medium, long })
3565            }
3566        }
3567
3568        deserializer.deserialize_any(ConditionalResponseVisitor)
3569    }
3570}
3571
3572/// Response for the `EstimateSmartFee` RPC method
3573#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
3574#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
3575pub struct EstimateSmartFeeResponse {
3576    /// estimate fee rate in BTC/kvB (only present if no errors were encountered)
3577    #[serde(rename = "feerate")]
3578    pub fee_rate: Option<f64>,
3579    /// Errors encountered during processing (if there are any)
3580    pub errors: Option<Vec<String>>,
3581    /// block number where estimate was found
3582    /// The request target will be clamped between 2 and the highest target
3583    /// fee estimation is able to return based on how long it has been running.
3584    /// An error is returned if not enough transactions and blocks
3585    /// have been observed to make an estimate for any number of blocks.
3586    pub blocks: u64,
3587}
3588
3589/// Response for the `FinalizePsbt` RPC method
3590#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
3591#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
3592pub struct FinalizePsbtResponse {
3593    /// The base64-encoded partially signed transaction if not extracted
3594    pub psbt: Option<String>,
3595    /// The hex-encoded network transaction if extracted
3596    pub hex: Option<String>,
3597    /// If the transaction has a complete set of signatures
3598    pub complete: bool,
3599}
3600
3601/// Response for the `FundRawTransaction` RPC method
3602#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
3603#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
3604pub struct FundRawTransactionResponse {
3605    /// The resulting raw transaction (hex-encoded string)
3606    pub hex: String,
3607    /// Fee in BTC the resulting transaction pays
3608    #[serde(deserialize_with = "amount_from_btc_float")]
3609    pub fee: bitcoin::Amount,
3610    /// The position of the added change output, or -1
3611    pub changepos: i64,
3612}
3613
3614/// Response for the `Generate` RPC method
3615///
3616/// This method returns no meaningful data.
3617#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
3618pub struct GenerateResponse;
3619
3620/// Response for the `GenerateBlock` RPC method
3621#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
3622#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
3623pub struct GenerateBlockResponse {
3624    /// hash of generated block
3625    pub hash: String,
3626    /// hex of generated block, only present when submit=false
3627    pub hex: Option<String>,
3628}
3629
3630/// Response for the `GenerateToAddress` RPC method
3631///
3632/// This method returns an array wrapped in a transparent struct.
3633#[derive(Debug, Clone, PartialEq, Serialize)]
3634pub struct GenerateToAddressResponse {
3635    /// Wrapped array value
3636    pub value: Vec<serde_json::Value>,
3637}
3638
3639impl<'de> serde::Deserialize<'de> for GenerateToAddressResponse {
3640    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
3641    where
3642        D: serde::Deserializer<'de>,
3643    {
3644        let value = Vec::<serde_json::Value>::deserialize(deserializer)?;
3645        Ok(Self { value })
3646    }
3647}
3648
3649impl From<Vec<serde_json::Value>> for GenerateToAddressResponse {
3650    fn from(value: Vec<serde_json::Value>) -> Self { Self { value } }
3651}
3652
3653impl From<GenerateToAddressResponse> for Vec<serde_json::Value> {
3654    fn from(wrapper: GenerateToAddressResponse) -> Self { wrapper.value }
3655}
3656
3657/// Response for the `GenerateToDescriptor` RPC method
3658///
3659/// This method returns an array wrapped in a transparent struct.
3660#[derive(Debug, Clone, PartialEq, Serialize)]
3661pub struct GenerateToDescriptorResponse {
3662    /// Wrapped array value
3663    pub value: Vec<serde_json::Value>,
3664}
3665
3666impl<'de> serde::Deserialize<'de> for GenerateToDescriptorResponse {
3667    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
3668    where
3669        D: serde::Deserializer<'de>,
3670    {
3671        let value = Vec::<serde_json::Value>::deserialize(deserializer)?;
3672        Ok(Self { value })
3673    }
3674}
3675
3676impl From<Vec<serde_json::Value>> for GenerateToDescriptorResponse {
3677    fn from(value: Vec<serde_json::Value>) -> Self { Self { value } }
3678}
3679
3680impl From<GenerateToDescriptorResponse> for Vec<serde_json::Value> {
3681    fn from(wrapper: GenerateToDescriptorResponse) -> Self { wrapper.value }
3682}
3683
3684/// Response for the `GetAddedNodeInfo` RPC method
3685///
3686/// This method returns an array wrapped in a transparent struct.
3687#[derive(Debug, Clone, PartialEq, Serialize)]
3688pub struct GetAddedNodeInfoResponse {
3689    /// Wrapped array value
3690    pub value: Vec<GetAddedNodeInfoElement>,
3691}
3692
3693impl<'de> serde::Deserialize<'de> for GetAddedNodeInfoResponse {
3694    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
3695    where
3696        D: serde::Deserializer<'de>,
3697    {
3698        let value = Vec::<GetAddedNodeInfoElement>::deserialize(deserializer)?;
3699        Ok(Self { value })
3700    }
3701}
3702
3703impl From<Vec<GetAddedNodeInfoElement>> for GetAddedNodeInfoResponse {
3704    fn from(value: Vec<GetAddedNodeInfoElement>) -> Self { Self { value } }
3705}
3706
3707impl From<GetAddedNodeInfoResponse> for Vec<GetAddedNodeInfoElement> {
3708    fn from(wrapper: GetAddedNodeInfoResponse) -> Self { wrapper.value }
3709}
3710
3711/// Response for the `GetAddressesByLabel` RPC method
3712///
3713/// json object with addresses as keys
3714#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
3715#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
3716pub struct GetAddressesByLabelResponse {
3717    /// json object with information about address
3718    pub address: GetAddressesByLabelAddress,
3719}
3720
3721/// Response for the `GetAddressInfo` RPC method
3722#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
3723#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
3724pub struct GetAddressInfoResponse {
3725    /// The bitcoin address validated.
3726    pub address: String,
3727    /// The hex-encoded output script generated by the address.
3728    #[serde(rename = "scriptPubKey")]
3729    pub script_pubkey: bitcoin::ScriptBuf,
3730    /// If the address is yours.
3731    #[serde(rename = "ismine")]
3732    pub is_mine: bool,
3733    /// (DEPRECATED) Always false.
3734    #[serde(rename = "iswatchonly")]
3735    pub is_watch_only: bool,
3736    /// If we know how to spend coins sent to this address, ignoring the possible lack of private keys.
3737    pub solvable: bool,
3738    /// A descriptor for spending coins sent to this address (only when solvable).
3739    pub desc: Option<String>,
3740    /// The descriptor used to derive this address if this is a descriptor wallet
3741    pub parent_desc: Option<String>,
3742    /// If the key is a script.
3743    #[serde(rename = "isscript")]
3744    pub is_script: Option<bool>,
3745    /// If the address was used for change output.
3746    pub ischange: bool,
3747    /// If the address is a witness address.
3748    #[serde(rename = "iswitness")]
3749    pub is_witness: bool,
3750    /// The version number of the witness program.
3751    pub witness_version: Option<u64>,
3752    /// The hex value of the witness program.
3753    pub witness_program: Option<String>,
3754    /// The output script type. Only if isscript is true and the redeemscript is known. Possible
3755    /// types: nonstandard, pubkey, pubkeyhash, scripthash, multisig, nulldata, witness_v0_keyhash,
3756    /// witness_v0_scripthash, witness_unknown.
3757    pub script: Option<bitcoin::ScriptBuf>,
3758    /// The redeemscript for the p2sh address.
3759    pub hex: Option<String>,
3760    /// Array of pubkeys associated with the known redeemscript (only if script is multisig).
3761    #[serde(rename = "pubkeys")]
3762    pub pub_keys: Option<Vec<String>>,
3763    /// The number of signatures required to spend multisig output (only if script is multisig).
3764    #[serde(rename = "sigsrequired")]
3765    pub sigs_required: Option<u64>,
3766    /// The hex value of the raw public key for single-key addresses (possibly embedded in P2SH or P2WSH).
3767    pub pubkey: Option<String>,
3768    /// Information about the address embedded in P2SH or P2WSH, if relevant and known.
3769    pub embedded: Option<GetAddressInfoEmbedded>,
3770    /// If the pubkey is compressed.
3771    #[serde(rename = "iscompressed")]
3772    pub is_compressed: Option<bool>,
3773    /// The creation time of the key, if available, expressed in UNIX epoch time.
3774    pub timestamp: Option<u64>,
3775    /// The HD keypath, if the key is HD and available.
3776    #[serde(rename = "hdkeypath")]
3777    pub hd_key_path: Option<String>,
3778    /// The Hash160 of the HD seed.
3779    #[serde(rename = "hdseedid")]
3780    pub hd_seed_id: Option<String>,
3781    /// The fingerprint of the master key.
3782    #[serde(rename = "hdmasterfingerprint")]
3783    pub hd_master_fingerprint: Option<String>,
3784    /// Array of labels associated with the address. Currently limited to one label but returned
3785    /// as an array to keep the API stable if multiple labels are enabled in the future.
3786    pub labels: Vec<String>,
3787}
3788
3789/// Response for the `GetAddrManInfo` RPC method
3790///
3791/// json object with network type as keys
3792#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
3793#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
3794pub struct GetAddrManInfoResponse {
3795    /// the network (ipv4, ipv6, onion, i2p, cjdns, all_networks)
3796    #[serde(default)]
3797    pub network: Option<GetAddrManInfoNetwork>,
3798}
3799
3800/// Response for the `GetBalance` RPC method
3801///
3802/// This method returns a primitive value wrapped in a transparent struct.
3803#[derive(Debug, Clone, PartialEq, Serialize)]
3804pub struct GetBalanceResponse {
3805    /// Wrapped primitive value
3806    pub value: bitcoin::Amount,
3807}
3808
3809impl<'de> serde::Deserialize<'de> for GetBalanceResponse {
3810    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
3811    where
3812        D: serde::Deserializer<'de>,
3813    {
3814        use std::fmt;
3815
3816        use serde::de::{self, Visitor};
3817
3818        struct PrimitiveWrapperVisitor;
3819
3820        #[allow(unused_variables, clippy::needless_lifetimes)]
3821        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
3822            type Value = GetBalanceResponse;
3823
3824            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
3825                formatter.write_str("a primitive value or an object with 'value' field")
3826            }
3827
3828            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
3829            where
3830                E: de::Error,
3831            {
3832                Ok(GetBalanceResponse { value: bitcoin::Amount::from_sat(v) })
3833            }
3834
3835            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
3836            where
3837                E: de::Error,
3838            {
3839                if v < 0 {
3840                    return Err(de::Error::custom(format!("Amount cannot be negative: {}", v)));
3841                }
3842                Ok(GetBalanceResponse { value: bitcoin::Amount::from_sat(v as u64) })
3843            }
3844
3845            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
3846            where
3847                E: de::Error,
3848            {
3849                let amount = bitcoin::Amount::from_btc(v)
3850                    .map_err(|e| de::Error::custom(format!("Invalid BTC amount: {}", e)))?;
3851                Ok(GetBalanceResponse { value: amount })
3852            }
3853
3854            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
3855            where
3856                E: de::Error,
3857            {
3858                let value = v.parse::<bitcoin::Amount>().map_err(de::Error::custom)?;
3859                Ok(GetBalanceResponse { value })
3860            }
3861
3862            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
3863            where
3864                E: de::Error,
3865            {
3866                Err(de::Error::custom("cannot convert bool to bitcoin::Amount"))
3867            }
3868
3869            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
3870            where
3871                M: de::MapAccess<'de>,
3872            {
3873                let mut value = None;
3874                while let Some(key) = map.next_key::<String>()? {
3875                    if key == "value" {
3876                        if value.is_some() {
3877                            return Err(de::Error::duplicate_field("value"));
3878                        }
3879                        value = Some(map.next_value()?);
3880                    } else {
3881                        let _ = map.next_value::<de::IgnoredAny>()?;
3882                    }
3883                }
3884                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
3885                Ok(GetBalanceResponse { value })
3886            }
3887        }
3888
3889        deserializer.deserialize_any(PrimitiveWrapperVisitor)
3890    }
3891}
3892
3893impl std::ops::Deref for GetBalanceResponse {
3894    type Target = bitcoin::Amount;
3895    fn deref(&self) -> &Self::Target { &self.value }
3896}
3897
3898impl std::ops::DerefMut for GetBalanceResponse {
3899    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
3900}
3901
3902impl AsRef<bitcoin::Amount> for GetBalanceResponse {
3903    fn as_ref(&self) -> &bitcoin::Amount { &self.value }
3904}
3905
3906impl From<bitcoin::Amount> for GetBalanceResponse {
3907    fn from(value: bitcoin::Amount) -> Self { Self { value } }
3908}
3909
3910impl From<GetBalanceResponse> for bitcoin::Amount {
3911    fn from(wrapper: GetBalanceResponse) -> Self { wrapper.value }
3912}
3913
3914/// Response for the `GetBalances` RPC method
3915#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
3916#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
3917pub struct GetBalancesResponse {
3918    /// balances from outputs that the wallet can sign
3919    pub mine: GetBalancesMine,
3920    /// hash and height of the block this information was generated on
3921    #[serde(rename = "lastprocessedblock")]
3922    pub last_processed_block: GetBalancesLastProcessedBlock,
3923}
3924
3925/// Response for the `GetBestBlockHash` RPC method
3926///
3927/// This method returns a primitive value wrapped in a transparent struct.
3928#[derive(Debug, Clone, PartialEq, Serialize)]
3929pub struct GetBestBlockHashResponse {
3930    /// Wrapped primitive value
3931    pub value: String,
3932}
3933
3934impl<'de> serde::Deserialize<'de> for GetBestBlockHashResponse {
3935    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
3936    where
3937        D: serde::Deserializer<'de>,
3938    {
3939        use std::fmt;
3940
3941        use serde::de::{self, Visitor};
3942
3943        struct PrimitiveWrapperVisitor;
3944
3945        #[allow(unused_variables, clippy::needless_lifetimes)]
3946        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
3947            type Value = GetBestBlockHashResponse;
3948
3949            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
3950                formatter.write_str("a primitive value or an object with 'value' field")
3951            }
3952
3953            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
3954            where
3955                E: de::Error,
3956            {
3957                Ok(GetBestBlockHashResponse { value: v.to_string() })
3958            }
3959
3960            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
3961            where
3962                E: de::Error,
3963            {
3964                Ok(GetBestBlockHashResponse { value: v.to_string() })
3965            }
3966
3967            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
3968            where
3969                E: de::Error,
3970            {
3971                Ok(GetBestBlockHashResponse { value: v.to_string() })
3972            }
3973
3974            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
3975            where
3976                E: de::Error,
3977            {
3978                Ok(GetBestBlockHashResponse { value: v.to_string() })
3979            }
3980
3981            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
3982            where
3983                E: de::Error,
3984            {
3985                Ok(GetBestBlockHashResponse { value: v.to_string() })
3986            }
3987
3988            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
3989            where
3990                M: de::MapAccess<'de>,
3991            {
3992                let mut value = None;
3993                while let Some(key) = map.next_key::<String>()? {
3994                    if key == "value" {
3995                        if value.is_some() {
3996                            return Err(de::Error::duplicate_field("value"));
3997                        }
3998                        value = Some(map.next_value()?);
3999                    } else {
4000                        let _ = map.next_value::<de::IgnoredAny>()?;
4001                    }
4002                }
4003                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
4004                Ok(GetBestBlockHashResponse { value })
4005            }
4006        }
4007
4008        deserializer.deserialize_any(PrimitiveWrapperVisitor)
4009    }
4010}
4011
4012impl std::ops::Deref for GetBestBlockHashResponse {
4013    type Target = String;
4014    fn deref(&self) -> &Self::Target { &self.value }
4015}
4016
4017impl std::ops::DerefMut for GetBestBlockHashResponse {
4018    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
4019}
4020
4021impl AsRef<String> for GetBestBlockHashResponse {
4022    fn as_ref(&self) -> &String { &self.value }
4023}
4024
4025impl From<String> for GetBestBlockHashResponse {
4026    fn from(value: String) -> Self { Self { value } }
4027}
4028
4029impl From<GetBestBlockHashResponse> for String {
4030    fn from(wrapper: GetBestBlockHashResponse) -> Self { wrapper.value }
4031}
4032
4033/// Response for the `GetBlock` RPC method
4034#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
4035#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
4036pub struct GetBlockResponse {
4037    /// the block hash (same as provided)
4038    pub hash: String,
4039    /// The number of confirmations, or -1 if the block is not on the main chain
4040    pub confirmations: i64,
4041    /// The block size
4042    pub size: u64,
4043    /// The block size excluding witness data
4044    #[serde(rename = "strippedsize")]
4045    pub stripped_size: u64,
4046    /// The block weight as defined in BIP 141
4047    pub weight: u64,
4048    /// Coinbase transaction metadata
4049    pub coinbase_tx: GetBlockCoinbaseTx,
4050    /// The block height or index
4051    pub height: u64,
4052    /// The block version
4053    pub version: u32,
4054    /// The block version formatted in hexadecimal
4055    #[serde(rename = "versionHex")]
4056    pub version_hex: String,
4057    /// The merkle root
4058    #[serde(rename = "merkleroot")]
4059    pub merkle_root: String,
4060    /// The transaction ids
4061    pub tx: Vec<bitcoin::Txid>,
4062    /// The block time expressed in UNIX epoch time
4063    pub time: u64,
4064    /// The median block time expressed in UNIX epoch time
4065    #[serde(rename = "mediantime")]
4066    pub median_time: u64,
4067    /// The nonce
4068    pub nonce: u64,
4069    /// nBits: compact representation of the block difficulty target
4070    pub bits: String,
4071    /// The difficulty target
4072    pub target: String,
4073    /// The difficulty
4074    pub difficulty: f64,
4075    /// Expected number of hashes required to produce the chain up to this block (in hex)
4076    #[serde(rename = "chainwork")]
4077    pub chain_work: String,
4078    /// The number of transactions in the block
4079    pub nTx: u64,
4080    /// The hash of the previous block (if available)
4081    #[serde(rename = "previousblockhash")]
4082    pub previous_block_hash: Option<String>,
4083    /// The hash of the next block (if available)
4084    #[serde(rename = "nextblockhash")]
4085    pub next_block_hash: Option<String>,
4086}
4087
4088/// Response for the `GetBlockchainInfo` RPC method
4089#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
4090#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
4091pub struct GetBlockchainInfoResponse {
4092    /// current network name (main, test, testnet4, signet, regtest)
4093    pub chain: String,
4094    /// the height of the most-work fully-validated chain. The genesis block has height 0
4095    pub blocks: u64,
4096    /// the current number of headers we have validated
4097    pub headers: u64,
4098    /// the hash of the currently best block
4099    #[serde(rename = "bestblockhash")]
4100    pub best_block_hash: String,
4101    /// nBits: compact representation of the block difficulty target
4102    pub bits: String,
4103    /// The difficulty target
4104    pub target: String,
4105    /// the current difficulty
4106    pub difficulty: f64,
4107    /// The block time expressed in UNIX epoch time
4108    pub time: u64,
4109    /// The median block time expressed in UNIX epoch time
4110    #[serde(rename = "mediantime")]
4111    pub median_time: u64,
4112    /// estimate of verification progress \[0..1\]
4113    #[serde(rename = "verificationprogress")]
4114    pub verification_progress: f64,
4115    /// (debug information) estimate of whether this node is in Initial Block Download mode
4116    #[serde(rename = "initialblockdownload")]
4117    pub initial_block_download: bool,
4118    /// total amount of work in active chain, in hexadecimal
4119    #[serde(rename = "chainwork")]
4120    pub chain_work: String,
4121    /// the estimated size of the block and undo files on disk
4122    pub size_on_disk: u64,
4123    /// if the blocks are subject to pruning
4124    pub pruned: bool,
4125    /// the first block unpruned, all previous blocks were pruned (only present if pruning is enabled)
4126    #[serde(rename = "pruneheight")]
4127    pub prune_height: Option<u64>,
4128    /// whether automatic pruning is enabled (only present if pruning is enabled)
4129    pub automatic_pruning: Option<bool>,
4130    /// the target size used by pruning (only present if automatic pruning is enabled)
4131    pub prune_target_size: Option<u64>,
4132    /// the block challenge (aka. block script), in hexadecimal (only present if the current network is a signet)
4133    pub signet_challenge: Option<String>,
4134    /// any network and blockchain warnings (run with `-deprecatedrpc=warnings` to return the latest warning as a single string)
4135    pub warnings: Vec<String>,
4136}
4137
4138/// Response for the `GetBlockCount` RPC method
4139///
4140/// This method returns a primitive value wrapped in a transparent struct.
4141#[derive(Debug, Clone, PartialEq, Serialize)]
4142pub struct GetBlockCountResponse {
4143    /// Wrapped primitive value
4144    pub value: u64,
4145}
4146
4147impl<'de> serde::Deserialize<'de> for GetBlockCountResponse {
4148    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
4149    where
4150        D: serde::Deserializer<'de>,
4151    {
4152        use std::fmt;
4153
4154        use serde::de::{self, Visitor};
4155
4156        struct PrimitiveWrapperVisitor;
4157
4158        #[allow(unused_variables, clippy::needless_lifetimes)]
4159        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
4160            type Value = GetBlockCountResponse;
4161
4162            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
4163                formatter.write_str("a primitive value or an object with 'value' field")
4164            }
4165
4166            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
4167            where
4168                E: de::Error,
4169            {
4170                Ok(GetBlockCountResponse { value: v })
4171            }
4172
4173            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
4174            where
4175                E: de::Error,
4176            {
4177                Ok(GetBlockCountResponse { value: v as u64 })
4178            }
4179
4180            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
4181            where
4182                E: de::Error,
4183            {
4184                Ok(GetBlockCountResponse { value: v as u64 })
4185            }
4186
4187            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
4188            where
4189                E: de::Error,
4190            {
4191                let value = v.parse::<u64>().map_err(de::Error::custom)?;
4192                Ok(GetBlockCountResponse { value })
4193            }
4194
4195            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
4196            where
4197                E: de::Error,
4198            {
4199                Ok(GetBlockCountResponse { value: v as u64 })
4200            }
4201
4202            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
4203            where
4204                M: de::MapAccess<'de>,
4205            {
4206                let mut value = None;
4207                while let Some(key) = map.next_key::<String>()? {
4208                    if key == "value" {
4209                        if value.is_some() {
4210                            return Err(de::Error::duplicate_field("value"));
4211                        }
4212                        value = Some(map.next_value()?);
4213                    } else {
4214                        let _ = map.next_value::<de::IgnoredAny>()?;
4215                    }
4216                }
4217                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
4218                Ok(GetBlockCountResponse { value })
4219            }
4220        }
4221
4222        deserializer.deserialize_any(PrimitiveWrapperVisitor)
4223    }
4224}
4225
4226impl std::ops::Deref for GetBlockCountResponse {
4227    type Target = u64;
4228    fn deref(&self) -> &Self::Target { &self.value }
4229}
4230
4231impl std::ops::DerefMut for GetBlockCountResponse {
4232    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
4233}
4234
4235impl AsRef<u64> for GetBlockCountResponse {
4236    fn as_ref(&self) -> &u64 { &self.value }
4237}
4238
4239impl From<u64> for GetBlockCountResponse {
4240    fn from(value: u64) -> Self { Self { value } }
4241}
4242
4243impl From<GetBlockCountResponse> for u64 {
4244    fn from(wrapper: GetBlockCountResponse) -> Self { wrapper.value }
4245}
4246
4247/// Response for the `GetBlockFilter` RPC method
4248#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
4249#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
4250pub struct GetBlockFilterResponse {
4251    /// the hex-encoded filter data
4252    pub filter: String,
4253    /// the hex-encoded filter header
4254    pub header: String,
4255}
4256
4257/// Response for the `GetBlockFromPeer` RPC method
4258///
4259/// This method returns no meaningful data.
4260#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
4261pub struct GetBlockFromPeerResponse;
4262
4263/// Response for the `GetBlockHash` RPC method
4264///
4265/// This method returns a primitive value wrapped in a transparent struct.
4266#[derive(Debug, Clone, PartialEq, Serialize)]
4267pub struct GetBlockHashResponse {
4268    /// Wrapped primitive value
4269    pub value: String,
4270}
4271
4272impl<'de> serde::Deserialize<'de> for GetBlockHashResponse {
4273    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
4274    where
4275        D: serde::Deserializer<'de>,
4276    {
4277        use std::fmt;
4278
4279        use serde::de::{self, Visitor};
4280
4281        struct PrimitiveWrapperVisitor;
4282
4283        #[allow(unused_variables, clippy::needless_lifetimes)]
4284        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
4285            type Value = GetBlockHashResponse;
4286
4287            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
4288                formatter.write_str("a primitive value or an object with 'value' field")
4289            }
4290
4291            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
4292            where
4293                E: de::Error,
4294            {
4295                Ok(GetBlockHashResponse { value: v.to_string() })
4296            }
4297
4298            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
4299            where
4300                E: de::Error,
4301            {
4302                Ok(GetBlockHashResponse { value: v.to_string() })
4303            }
4304
4305            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
4306            where
4307                E: de::Error,
4308            {
4309                Ok(GetBlockHashResponse { value: v.to_string() })
4310            }
4311
4312            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
4313            where
4314                E: de::Error,
4315            {
4316                Ok(GetBlockHashResponse { value: v.to_string() })
4317            }
4318
4319            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
4320            where
4321                E: de::Error,
4322            {
4323                Ok(GetBlockHashResponse { value: v.to_string() })
4324            }
4325
4326            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
4327            where
4328                M: de::MapAccess<'de>,
4329            {
4330                let mut value = None;
4331                while let Some(key) = map.next_key::<String>()? {
4332                    if key == "value" {
4333                        if value.is_some() {
4334                            return Err(de::Error::duplicate_field("value"));
4335                        }
4336                        value = Some(map.next_value()?);
4337                    } else {
4338                        let _ = map.next_value::<de::IgnoredAny>()?;
4339                    }
4340                }
4341                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
4342                Ok(GetBlockHashResponse { value })
4343            }
4344        }
4345
4346        deserializer.deserialize_any(PrimitiveWrapperVisitor)
4347    }
4348}
4349
4350impl std::ops::Deref for GetBlockHashResponse {
4351    type Target = String;
4352    fn deref(&self) -> &Self::Target { &self.value }
4353}
4354
4355impl std::ops::DerefMut for GetBlockHashResponse {
4356    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
4357}
4358
4359impl AsRef<String> for GetBlockHashResponse {
4360    fn as_ref(&self) -> &String { &self.value }
4361}
4362
4363impl From<String> for GetBlockHashResponse {
4364    fn from(value: String) -> Self { Self { value } }
4365}
4366
4367impl From<GetBlockHashResponse> for String {
4368    fn from(wrapper: GetBlockHashResponse) -> Self { wrapper.value }
4369}
4370
4371/// Response for the `GetBlockHeader` RPC method
4372#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
4373#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
4374pub struct GetBlockHeaderResponse {
4375    /// the block hash (same as provided)
4376    pub hash: String,
4377    /// The number of confirmations, or -1 if the block is not on the main chain
4378    pub confirmations: i64,
4379    /// The block height or index
4380    pub height: u64,
4381    /// The block version
4382    pub version: u32,
4383    /// The block version formatted in hexadecimal
4384    #[serde(rename = "versionHex")]
4385    pub version_hex: String,
4386    /// The merkle root
4387    #[serde(rename = "merkleroot")]
4388    pub merkle_root: String,
4389    /// The block time expressed in UNIX epoch time
4390    pub time: u64,
4391    /// The median block time expressed in UNIX epoch time
4392    #[serde(rename = "mediantime")]
4393    pub median_time: u64,
4394    /// The nonce
4395    pub nonce: u64,
4396    /// nBits: compact representation of the block difficulty target
4397    pub bits: String,
4398    /// The difficulty target
4399    pub target: String,
4400    /// The difficulty
4401    pub difficulty: f64,
4402    /// Expected number of hashes required to produce the current chain
4403    #[serde(rename = "chainwork")]
4404    pub chain_work: String,
4405    /// The number of transactions in the block
4406    pub nTx: u64,
4407    /// The hash of the previous block (if available)
4408    #[serde(rename = "previousblockhash")]
4409    pub previous_block_hash: Option<String>,
4410    /// The hash of the next block (if available)
4411    #[serde(rename = "nextblockhash")]
4412    pub next_block_hash: Option<String>,
4413}
4414
4415/// Response for the `GetBlockStats` RPC method
4416#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
4417#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
4418pub struct GetBlockStatsResponse {
4419    /// Average fee in the block
4420    pub avgfee: Option<u64>,
4421    /// Average feerate (in satoshis per virtual byte)
4422    #[serde(rename = "avgfeerate")]
4423    pub avg_fee_rate: Option<u64>,
4424    /// Average transaction size
4425    #[serde(rename = "avgtxsize")]
4426    pub avg_tx_size: Option<u64>,
4427    /// The block hash (to check for potential reorgs)
4428    #[serde(rename = "blockhash")]
4429    pub block_hash: Option<bitcoin::BlockHash>,
4430    /// Feerates at the 10th, 25th, 50th, 75th, and 90th percentile weight unit (in satoshis per virtual byte)
4431    pub feerate_percentiles: Option<GetBlockStatsFeeratePercentiles>,
4432    /// The height of the block
4433    pub height: Option<u64>,
4434    /// The number of inputs (excluding coinbase)
4435    pub ins: Option<u64>,
4436    /// Maximum fee in the block
4437    #[serde(rename = "maxfee")]
4438    pub max_fee: Option<u64>,
4439    /// Maximum feerate (in satoshis per virtual byte)
4440    #[serde(rename = "maxfeerate")]
4441    pub max_fee_rate: Option<f64>,
4442    /// Maximum transaction size
4443    #[serde(rename = "maxtxsize")]
4444    pub max_tx_size: Option<u64>,
4445    /// Truncated median fee in the block
4446    pub medianfee: Option<u64>,
4447    /// The block median time past
4448    #[serde(rename = "mediantime")]
4449    pub median_time: Option<u64>,
4450    /// Truncated median transaction size
4451    #[serde(rename = "mediantxsize")]
4452    pub median_tx_size: Option<u64>,
4453    /// Minimum fee in the block
4454    #[serde(rename = "minfee")]
4455    pub min_fee: Option<u64>,
4456    /// Minimum feerate (in satoshis per virtual byte)
4457    #[serde(rename = "minfeerate")]
4458    pub min_fee_rate: Option<u64>,
4459    /// Minimum transaction size
4460    #[serde(rename = "mintxsize")]
4461    pub min_tx_size: Option<u64>,
4462    /// The number of outputs
4463    pub outs: Option<u64>,
4464    /// The block subsidy
4465    pub subsidy: Option<u64>,
4466    /// Total size of all segwit transactions
4467    #[serde(rename = "swtotal_size")]
4468    pub sw_total_size: Option<u64>,
4469    /// Total weight of all segwit transactions
4470    #[serde(rename = "swtotal_weight")]
4471    pub sw_total_weight: Option<u64>,
4472    /// The number of segwit transactions
4473    #[serde(rename = "swtxs")]
4474    pub sw_txs: Option<u64>,
4475    /// The block time
4476    pub time: Option<u64>,
4477    /// Total amount in all outputs (excluding coinbase and thus reward \[ie subsidy + totalfee\])
4478    pub total_out: Option<u64>,
4479    /// Total size of all non-coinbase transactions
4480    pub total_size: Option<u64>,
4481    /// Total weight of all non-coinbase transactions
4482    pub total_weight: Option<u64>,
4483    /// The fee total
4484    #[serde(rename = "totalfee")]
4485    pub total_fee: Option<u64>,
4486    /// The number of transactions (including coinbase)
4487    pub txs: Option<u64>,
4488    /// The increase/decrease in the number of unspent outputs (not discounting op_return and similar)
4489    pub utxo_increase: Option<u64>,
4490    /// The increase/decrease in size for the utxo index (not discounting op_return and similar)
4491    pub utxo_size_inc: Option<u64>,
4492    /// The increase/decrease in the number of unspent outputs, not counting unspendables
4493    pub utxo_increase_actual: Option<u64>,
4494    /// The increase/decrease in size for the utxo index, not counting unspendables
4495    pub utxo_size_inc_actual: Option<u64>,
4496}
4497
4498/// Response for the `GetBlockTemplate` RPC method
4499#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
4500#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
4501pub struct GetBlockTemplateResponse {
4502    pub field_0_1: (),
4503    /// The preferred block version
4504    pub version: u32,
4505    /// specific block rules that are to be enforced
4506    pub rules: Vec<String>,
4507    /// set of pending, supported versionbit (BIP 9) softfork deployments
4508    #[serde(rename = "vbavailable")]
4509    pub vb_available: HashMap<String, u32>,
4510    pub capabilities: Vec<String>,
4511    /// bit mask of versionbits the server requires set in submissions
4512    #[serde(rename = "vbrequired")]
4513    pub vb_required: u64,
4514    /// The hash of current highest block
4515    #[serde(rename = "previousblockhash")]
4516    pub previous_block_hash: String,
4517    /// contents of non-coinbase transactions that should be included in the next block
4518    pub transactions: Vec<GetBlockTemplateTransaction>,
4519    /// data that should be included in the coinbase's scriptSig content
4520    #[serde(rename = "coinbaseaux")]
4521    pub coinbase_aux: HashMap<String, String>,
4522    /// maximum allowable input to coinbase transaction, including the generation award and transaction fees (in satoshis)
4523    #[serde(rename = "coinbasevalue")]
4524    pub coinbase_value: u64,
4525    /// an id to include with a request to longpoll on an update to this template
4526    #[serde(rename = "longpollid")]
4527    pub longpoll_id: String,
4528    /// The hash target
4529    pub target: String,
4530    /// The minimum timestamp appropriate for the next block time, expressed in UNIX epoch time. Adjusted for the proposed BIP94 timewarp rule.
4531    pub mintime: u64,
4532    /// list of ways the block template may be changed
4533    pub mutable: Vec<String>,
4534    /// A range of valid nonces
4535    #[serde(rename = "noncerange")]
4536    pub nonce_range: String,
4537    /// limit of sigops in blocks
4538    #[serde(rename = "sigoplimit")]
4539    pub sigop_limit: u64,
4540    /// limit of block size
4541    #[serde(rename = "sizelimit")]
4542    pub size_limit: u64,
4543    /// limit of block weight
4544    #[serde(rename = "weightlimit")]
4545    pub weight_limit: Option<u64>,
4546    /// current timestamp in UNIX epoch time. Adjusted for the proposed BIP94 timewarp rule.
4547    #[serde(rename = "curtime")]
4548    pub cur_time: u64,
4549    /// compressed target of next block
4550    pub bits: String,
4551    /// The height of the next block
4552    pub height: u64,
4553    /// Only on signet
4554    pub signet_challenge: Option<String>,
4555    /// a valid witness commitment for the unmodified block template
4556    pub default_witness_commitment: Option<String>,
4557}
4558
4559/// Response for the `GetChainStates` RPC method
4560#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
4561#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
4562pub struct GetChainStatesResponse {
4563    /// the number of headers seen so far
4564    pub headers: u64,
4565    /// list of the chainstates ordered by work, with the most-work (active) chainstate last
4566    pub chainstates: Vec<GetChainStatesChainstates>,
4567}
4568
4569/// Response for the `GetChainTips` RPC method
4570#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
4571#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
4572pub struct GetChainTipsResponse {
4573    pub field: serde_json::Value,
4574}
4575
4576/// Response for the `GetChainTxStats` RPC method
4577#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
4578#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
4579pub struct GetChainTxStatsResponse {
4580    /// The timestamp for the final block in the window, expressed in UNIX epoch time
4581    pub time: u64,
4582    /// The total number of transactions in the chain up to that point, if known. It may be unknown when using assumeutxo.
4583    #[serde(rename = "txcount")]
4584    pub tx_count: Option<u64>,
4585    /// The hash of the final block in the window
4586    pub window_final_block_hash: String,
4587    /// The height of the final block in the window.
4588    pub window_final_block_height: u64,
4589    /// Size of the window in number of blocks
4590    pub window_block_count: u64,
4591    /// The elapsed time in the window in seconds. Only returned if "window_block_count" is &gt; 0
4592    pub window_interval: Option<u64>,
4593    /// The number of transactions in the window. Only returned if "window_block_count" is &gt; 0 and if txcount exists for the start and end of the window.
4594    pub window_tx_count: Option<u64>,
4595    /// The average rate of transactions per second in the window. Only returned if "window_interval" is &gt; 0 and if window_tx_count exists.
4596    #[serde(rename = "txrate")]
4597    pub tx_rate: Option<u64>,
4598}
4599
4600/// Response for the `GetConnectionCount` RPC method
4601///
4602/// This method returns a primitive value wrapped in a transparent struct.
4603#[derive(Debug, Clone, PartialEq, Serialize)]
4604pub struct GetConnectionCountResponse {
4605    /// Wrapped primitive value
4606    pub value: u64,
4607}
4608
4609impl<'de> serde::Deserialize<'de> for GetConnectionCountResponse {
4610    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
4611    where
4612        D: serde::Deserializer<'de>,
4613    {
4614        use std::fmt;
4615
4616        use serde::de::{self, Visitor};
4617
4618        struct PrimitiveWrapperVisitor;
4619
4620        #[allow(unused_variables, clippy::needless_lifetimes)]
4621        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
4622            type Value = GetConnectionCountResponse;
4623
4624            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
4625                formatter.write_str("a primitive value or an object with 'value' field")
4626            }
4627
4628            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
4629            where
4630                E: de::Error,
4631            {
4632                Ok(GetConnectionCountResponse { value: v })
4633            }
4634
4635            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
4636            where
4637                E: de::Error,
4638            {
4639                Ok(GetConnectionCountResponse { value: v as u64 })
4640            }
4641
4642            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
4643            where
4644                E: de::Error,
4645            {
4646                Ok(GetConnectionCountResponse { value: v as u64 })
4647            }
4648
4649            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
4650            where
4651                E: de::Error,
4652            {
4653                let value = v.parse::<u64>().map_err(de::Error::custom)?;
4654                Ok(GetConnectionCountResponse { value })
4655            }
4656
4657            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
4658            where
4659                E: de::Error,
4660            {
4661                Ok(GetConnectionCountResponse { value: v as u64 })
4662            }
4663
4664            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
4665            where
4666                M: de::MapAccess<'de>,
4667            {
4668                let mut value = None;
4669                while let Some(key) = map.next_key::<String>()? {
4670                    if key == "value" {
4671                        if value.is_some() {
4672                            return Err(de::Error::duplicate_field("value"));
4673                        }
4674                        value = Some(map.next_value()?);
4675                    } else {
4676                        let _ = map.next_value::<de::IgnoredAny>()?;
4677                    }
4678                }
4679                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
4680                Ok(GetConnectionCountResponse { value })
4681            }
4682        }
4683
4684        deserializer.deserialize_any(PrimitiveWrapperVisitor)
4685    }
4686}
4687
4688impl std::ops::Deref for GetConnectionCountResponse {
4689    type Target = u64;
4690    fn deref(&self) -> &Self::Target { &self.value }
4691}
4692
4693impl std::ops::DerefMut for GetConnectionCountResponse {
4694    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
4695}
4696
4697impl AsRef<u64> for GetConnectionCountResponse {
4698    fn as_ref(&self) -> &u64 { &self.value }
4699}
4700
4701impl From<u64> for GetConnectionCountResponse {
4702    fn from(value: u64) -> Self { Self { value } }
4703}
4704
4705impl From<GetConnectionCountResponse> for u64 {
4706    fn from(wrapper: GetConnectionCountResponse) -> Self { wrapper.value }
4707}
4708
4709/// Response for the `GetDeploymentInfo` RPC method
4710#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
4711#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
4712pub struct GetDeploymentInfoResponse {
4713    /// requested block hash (or tip)
4714    pub hash: String,
4715    /// requested block height (or tip)
4716    pub height: u64,
4717    /// script verify flags for the block
4718    pub script_flags: Vec<String>,
4719    pub deployments: GetDeploymentInfoDeployments,
4720}
4721
4722/// Response for the `GetDescriptorActivity` RPC method
4723#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
4724#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
4725pub struct GetDescriptorActivityResponse {
4726    /// events
4727    pub activity: serde_json::Value,
4728}
4729
4730/// Response for the `GetDescriptorInfo` RPC method
4731#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
4732#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
4733pub struct GetDescriptorInfoResponse {
4734    /// The descriptor in canonical form, without private keys. For a multipath descriptor, only the first will be returned.
4735    pub descriptor: String,
4736    /// All descriptors produced by expanding multipath derivation elements. Only if the provided descriptor specifies multipath derivation elements.
4737    pub multipath_expansion: Option<Vec<String>>,
4738    /// The checksum for the input descriptor
4739    pub checksum: String,
4740    /// Whether the descriptor is ranged
4741    #[serde(rename = "isrange")]
4742    pub is_range: bool,
4743    /// Whether the descriptor is solvable
4744    #[serde(rename = "issolvable")]
4745    pub is_solvable: bool,
4746    /// Whether the input descriptor contained at least one private key
4747    #[serde(rename = "hasprivatekeys")]
4748    pub has_private_keys: bool,
4749}
4750
4751/// Response for the `GetDifficulty` RPC method
4752///
4753/// This method returns a primitive value wrapped in a transparent struct.
4754#[derive(Debug, Clone, PartialEq, Serialize)]
4755pub struct GetDifficultyResponse {
4756    /// Wrapped primitive value
4757    pub value: u64,
4758}
4759
4760impl<'de> serde::Deserialize<'de> for GetDifficultyResponse {
4761    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
4762    where
4763        D: serde::Deserializer<'de>,
4764    {
4765        use std::fmt;
4766
4767        use serde::de::{self, Visitor};
4768
4769        struct PrimitiveWrapperVisitor;
4770
4771        #[allow(unused_variables, clippy::needless_lifetimes)]
4772        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
4773            type Value = GetDifficultyResponse;
4774
4775            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
4776                formatter.write_str("a primitive value or an object with 'value' field")
4777            }
4778
4779            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
4780            where
4781                E: de::Error,
4782            {
4783                Ok(GetDifficultyResponse { value: v })
4784            }
4785
4786            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
4787            where
4788                E: de::Error,
4789            {
4790                Ok(GetDifficultyResponse { value: v as u64 })
4791            }
4792
4793            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
4794            where
4795                E: de::Error,
4796            {
4797                Ok(GetDifficultyResponse { value: v as u64 })
4798            }
4799
4800            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
4801            where
4802                E: de::Error,
4803            {
4804                let value = v.parse::<u64>().map_err(de::Error::custom)?;
4805                Ok(GetDifficultyResponse { value })
4806            }
4807
4808            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
4809            where
4810                E: de::Error,
4811            {
4812                Ok(GetDifficultyResponse { value: v as u64 })
4813            }
4814
4815            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
4816            where
4817                M: de::MapAccess<'de>,
4818            {
4819                let mut value = None;
4820                while let Some(key) = map.next_key::<String>()? {
4821                    if key == "value" {
4822                        if value.is_some() {
4823                            return Err(de::Error::duplicate_field("value"));
4824                        }
4825                        value = Some(map.next_value()?);
4826                    } else {
4827                        let _ = map.next_value::<de::IgnoredAny>()?;
4828                    }
4829                }
4830                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
4831                Ok(GetDifficultyResponse { value })
4832            }
4833        }
4834
4835        deserializer.deserialize_any(PrimitiveWrapperVisitor)
4836    }
4837}
4838
4839impl std::ops::Deref for GetDifficultyResponse {
4840    type Target = u64;
4841    fn deref(&self) -> &Self::Target { &self.value }
4842}
4843
4844impl std::ops::DerefMut for GetDifficultyResponse {
4845    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
4846}
4847
4848impl AsRef<u64> for GetDifficultyResponse {
4849    fn as_ref(&self) -> &u64 { &self.value }
4850}
4851
4852impl From<u64> for GetDifficultyResponse {
4853    fn from(value: u64) -> Self { Self { value } }
4854}
4855
4856impl From<GetDifficultyResponse> for u64 {
4857    fn from(wrapper: GetDifficultyResponse) -> Self { wrapper.value }
4858}
4859
4860/// Response for the `GetHdKeys` RPC method
4861#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
4862#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
4863pub struct GetHdKeysResponse {
4864    pub field: serde_json::Value,
4865}
4866
4867/// Response for the `GetIndexInfo` RPC method
4868#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
4869#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
4870pub struct GetIndexInfoResponse {
4871    /// The name of the index
4872    #[serde(default)]
4873    pub name: Option<GetIndexInfoName>,
4874}
4875
4876/// Response for the `GetMemoryInfo` RPC method
4877#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
4878#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
4879pub struct GetMemoryInfoResponse {
4880    /// Information about locked memory manager
4881    pub locked: GetMemoryInfoLocked,
4882}
4883
4884/// Response for the `GetMempoolAncestors` RPC method
4885#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
4886#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
4887pub struct GetMempoolAncestorsResponse {
4888    pub field_0: Vec<String>,
4889    #[serde(rename = "transactionid")]
4890    pub transaction_id: bitcoin::Txid,
4891}
4892
4893/// Response for the `GetMempoolDescendants` RPC method
4894#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
4895#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
4896pub struct GetMempoolDescendantsResponse {
4897    pub field_0: Vec<String>,
4898    #[serde(rename = "transactionid")]
4899    pub transaction_id: bitcoin::Txid,
4900}
4901
4902/// Response for the `GetMempoolEntry` RPC method
4903#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
4904#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
4905pub struct GetMempoolEntryResponse {
4906    /// virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted.
4907    #[serde(rename = "vsize")]
4908    pub v_size: u64,
4909    /// transaction weight as defined in BIP 141.
4910    pub weight: u64,
4911    /// local time transaction entered pool in seconds since 1 Jan 1970 GMT
4912    pub time: u64,
4913    /// block height when transaction entered pool
4914    pub height: u64,
4915    /// number of in-mempool descendant transactions (including this one)
4916    #[serde(rename = "descendantcount")]
4917    pub descendant_count: u64,
4918    /// virtual transaction size of in-mempool descendants (including this one)
4919    #[serde(rename = "descendantsize")]
4920    pub descendant_size: u64,
4921    /// number of in-mempool ancestor transactions (including this one)
4922    #[serde(rename = "ancestorcount")]
4923    pub ancestor_count: u64,
4924    /// virtual transaction size of in-mempool ancestors (including this one)
4925    #[serde(rename = "ancestorsize")]
4926    pub ancestor_size: u64,
4927    /// sigops-adjusted weight (as defined in BIP 141 and modified by '-bytespersigop') of this transaction's chunk
4928    #[serde(rename = "chunkweight")]
4929    pub chunk_weight: u64,
4930    /// hash of serialized transaction, including witness data
4931    #[serde(rename = "wtxid")]
4932    pub w_txid: String,
4933    pub fees: GetMempoolEntryFees,
4934    /// unconfirmed transactions used as inputs for this transaction
4935    pub depends: Vec<String>,
4936    /// unconfirmed transactions spending outputs from this transaction
4937    #[serde(rename = "spentby")]
4938    pub spent_by: Vec<String>,
4939    /// Whether this transaction signals BIP125 replaceability or has an unconfirmed ancestor signaling BIP125 replaceability. (DEPRECATED)
4940    #[serde(rename = "bip125-replaceable")]
4941    pub bip125_replaceable: bool,
4942    /// Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers)
4943    pub unbroadcast: bool,
4944}
4945
4946/// Response for the `GetMempoolInfo` RPC method
4947#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
4948#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
4949pub struct GetMempoolInfoResponse {
4950    /// True if the initial load attempt of the persisted mempool finished
4951    pub loaded: bool,
4952    /// Current tx count
4953    pub size: u64,
4954    /// Sum of all virtual transaction sizes as defined in BIP 141. Differs from actual serialized size because witness data is discounted
4955    pub bytes: u64,
4956    /// Total memory usage for the mempool
4957    pub usage: u64,
4958    /// Total fees for the mempool in BTC, ignoring modified fees through prioritisetransaction
4959    pub total_fee: f64,
4960    /// Maximum memory usage for the mempool
4961    #[serde(rename = "maxmempool")]
4962    pub max_mempool: u64,
4963    /// Minimum fee rate in BTC/kvB for tx to be accepted. Is the maximum of minrelaytxfee and minimum mempool fee
4964    #[serde(rename = "mempoolminfee")]
4965    pub mempool_min_fee: f64,
4966    /// Current minimum relay fee for transactions
4967    #[serde(rename = "minrelaytxfee")]
4968    pub min_relay_tx_fee: f64,
4969    /// minimum fee rate increment for mempool limiting or replacement in BTC/kvB
4970    #[serde(rename = "incrementalrelayfee")]
4971    pub incremental_relay_fee: f64,
4972    /// Current number of transactions that haven't passed initial broadcast yet
4973    #[serde(rename = "unbroadcastcount")]
4974    pub unbroadcast_count: u64,
4975    /// True if the mempool accepts RBF without replaceability signaling inspection (DEPRECATED)
4976    #[serde(rename = "fullrbf")]
4977    pub full_rbf: bool,
4978    /// True if the mempool accepts transactions with bare multisig outputs
4979    #[serde(rename = "permitbaremultisig")]
4980    pub permit_bare_multisig: Option<bool>,
4981    /// Maximum number of bytes that can be used by OP_RETURN outputs in the mempool
4982    #[serde(rename = "maxdatacarriersize")]
4983    pub max_data_carrier_size: Option<u64>,
4984    /// Maximum number of transactions that can be in a cluster (configured by -limitclustercount)
4985    #[serde(rename = "limitclustercount")]
4986    pub limit_cluster_count: Option<u64>,
4987    /// Maximum size of a cluster in virtual bytes (configured by -limitclustersize)
4988    #[serde(rename = "limitclustersize")]
4989    pub limit_cluster_size: Option<u64>,
4990    /// If the mempool is in a known-optimal transaction ordering
4991    pub optimal: bool,
4992}
4993
4994/// Response for the `GetMiningInfo` RPC method
4995#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
4996#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
4997pub struct GetMiningInfoResponse {
4998    /// The current block
4999    pub blocks: u64,
5000    /// The block weight (including reserved weight for block header, txs count and coinbase tx) of the last assembled block (only present if a block was ever assembled)
5001    #[serde(rename = "currentblockweight")]
5002    pub current_block_weight: Option<u64>,
5003    /// The number of block transactions (excluding coinbase) of the last assembled block (only present if a block was ever assembled)
5004    #[serde(rename = "currentblocktx")]
5005    pub current_block_tx: Option<u64>,
5006    /// The current nBits, compact representation of the block difficulty target
5007    pub bits: String,
5008    /// The current difficulty
5009    pub difficulty: f64,
5010    /// The current target
5011    pub target: String,
5012    /// The network hashes per second
5013    #[serde(rename = "networkhashps")]
5014    pub network_hashps: f64,
5015    /// The size of the mempool
5016    #[serde(rename = "pooledtx")]
5017    pub pooled_tx: u64,
5018    /// Minimum feerate of packages selected for block inclusion in BTC/kvB
5019    #[serde(rename = "blockmintxfee")]
5020    pub block_min_tx_fee: Option<f64>,
5021    /// current network name (main, test, testnet4, signet, regtest)
5022    pub chain: String,
5023    /// The block challenge (aka. block script), in hexadecimal (only present if the current network is a signet)
5024    pub signet_challenge: Option<String>,
5025    /// The next block
5026    pub next: GetMiningInfoNext,
5027    /// any network and blockchain warnings (run with `-deprecatedrpc=warnings` to return the latest warning as a single string)
5028    pub warnings: Vec<String>,
5029}
5030
5031/// Response for the `GetNetTotals` RPC method
5032#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
5033#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
5034pub struct GetNetTotalsResponse {
5035    /// Total bytes received
5036    #[serde(rename = "totalbytesrecv")]
5037    pub total_bytes_recv: u64,
5038    /// Total bytes sent
5039    #[serde(rename = "totalbytessent")]
5040    pub total_bytes_sent: u64,
5041    /// Current system UNIX epoch time in milliseconds
5042    #[serde(rename = "timemillis")]
5043    pub time_millis: u64,
5044    #[serde(rename = "uploadtarget")]
5045    pub upload_target: GetNetTotalsUploadTarget,
5046}
5047
5048/// Response for the `GetNetworkHashPs` RPC method
5049///
5050/// This method returns a primitive value wrapped in a transparent struct.
5051#[derive(Debug, Clone, PartialEq, Serialize)]
5052pub struct GetNetworkHashPsResponse {
5053    /// Wrapped primitive value
5054    pub value: u64,
5055}
5056
5057impl<'de> serde::Deserialize<'de> for GetNetworkHashPsResponse {
5058    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
5059    where
5060        D: serde::Deserializer<'de>,
5061    {
5062        use std::fmt;
5063
5064        use serde::de::{self, Visitor};
5065
5066        struct PrimitiveWrapperVisitor;
5067
5068        #[allow(unused_variables, clippy::needless_lifetimes)]
5069        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
5070            type Value = GetNetworkHashPsResponse;
5071
5072            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
5073                formatter.write_str("a primitive value or an object with 'value' field")
5074            }
5075
5076            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
5077            where
5078                E: de::Error,
5079            {
5080                Ok(GetNetworkHashPsResponse { value: v })
5081            }
5082
5083            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
5084            where
5085                E: de::Error,
5086            {
5087                Ok(GetNetworkHashPsResponse { value: v as u64 })
5088            }
5089
5090            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
5091            where
5092                E: de::Error,
5093            {
5094                Ok(GetNetworkHashPsResponse { value: v as u64 })
5095            }
5096
5097            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
5098            where
5099                E: de::Error,
5100            {
5101                let value = v.parse::<u64>().map_err(de::Error::custom)?;
5102                Ok(GetNetworkHashPsResponse { value })
5103            }
5104
5105            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
5106            where
5107                E: de::Error,
5108            {
5109                Ok(GetNetworkHashPsResponse { value: v as u64 })
5110            }
5111
5112            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
5113            where
5114                M: de::MapAccess<'de>,
5115            {
5116                let mut value = None;
5117                while let Some(key) = map.next_key::<String>()? {
5118                    if key == "value" {
5119                        if value.is_some() {
5120                            return Err(de::Error::duplicate_field("value"));
5121                        }
5122                        value = Some(map.next_value()?);
5123                    } else {
5124                        let _ = map.next_value::<de::IgnoredAny>()?;
5125                    }
5126                }
5127                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
5128                Ok(GetNetworkHashPsResponse { value })
5129            }
5130        }
5131
5132        deserializer.deserialize_any(PrimitiveWrapperVisitor)
5133    }
5134}
5135
5136impl std::ops::Deref for GetNetworkHashPsResponse {
5137    type Target = u64;
5138    fn deref(&self) -> &Self::Target { &self.value }
5139}
5140
5141impl std::ops::DerefMut for GetNetworkHashPsResponse {
5142    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
5143}
5144
5145impl AsRef<u64> for GetNetworkHashPsResponse {
5146    fn as_ref(&self) -> &u64 { &self.value }
5147}
5148
5149impl From<u64> for GetNetworkHashPsResponse {
5150    fn from(value: u64) -> Self { Self { value } }
5151}
5152
5153impl From<GetNetworkHashPsResponse> for u64 {
5154    fn from(wrapper: GetNetworkHashPsResponse) -> Self { wrapper.value }
5155}
5156
5157/// Response for the `GetNetworkInfo` RPC method
5158#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
5159#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
5160pub struct GetNetworkInfoResponse {
5161    /// the server version
5162    pub version: u32,
5163    /// the server subversion string
5164    pub subversion: String,
5165    /// the protocol version
5166    #[serde(rename = "protocolversion")]
5167    pub protocol_version: u64,
5168    /// the services we offer to the network
5169    #[serde(rename = "localservices")]
5170    pub local_services: String,
5171    /// the services we offer to the network, in human-readable form
5172    #[serde(rename = "localservicesnames")]
5173    pub local_services_names: Vec<String>,
5174    /// true if transaction relay is requested from peers
5175    #[serde(rename = "localrelay")]
5176    pub local_relay: bool,
5177    /// the time offset
5178    #[serde(rename = "timeoffset")]
5179    pub time_offset: u64,
5180    /// the total number of connections
5181    pub connections: u64,
5182    /// the number of inbound connections
5183    pub connections_in: u64,
5184    /// the number of outbound connections
5185    pub connections_out: u64,
5186    /// whether p2p networking is enabled
5187    #[serde(rename = "networkactive")]
5188    pub network_active: bool,
5189    /// information per network
5190    pub networks: Vec<GetNetworkInfoNetworks>,
5191    /// minimum relay fee rate for transactions in BTC/kvB
5192    #[serde(rename = "relayfee")]
5193    pub relay_fee: f64,
5194    /// minimum fee rate increment for mempool limiting or replacement in BTC/kvB
5195    #[serde(rename = "incrementalfee")]
5196    pub incremental_fee: f64,
5197    /// list of local addresses
5198    #[serde(rename = "localaddresses")]
5199    pub local_addresses: Vec<GetNetworkInfoLocalAddresses>,
5200    /// any network and blockchain warnings (run with `-deprecatedrpc=warnings` to return the latest warning as a single string)
5201    pub warnings: Vec<String>,
5202}
5203
5204/// Response for the `GetNewAddress` RPC method
5205///
5206/// This method returns a primitive value wrapped in a transparent struct.
5207#[derive(Debug, Clone, PartialEq, Serialize)]
5208pub struct GetNewAddressResponse {
5209    /// Wrapped primitive value
5210    pub value: String,
5211}
5212
5213impl<'de> serde::Deserialize<'de> for GetNewAddressResponse {
5214    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
5215    where
5216        D: serde::Deserializer<'de>,
5217    {
5218        use std::fmt;
5219
5220        use serde::de::{self, Visitor};
5221
5222        struct PrimitiveWrapperVisitor;
5223
5224        #[allow(unused_variables, clippy::needless_lifetimes)]
5225        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
5226            type Value = GetNewAddressResponse;
5227
5228            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
5229                formatter.write_str("a primitive value or an object with 'value' field")
5230            }
5231
5232            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
5233            where
5234                E: de::Error,
5235            {
5236                Ok(GetNewAddressResponse { value: v.to_string() })
5237            }
5238
5239            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
5240            where
5241                E: de::Error,
5242            {
5243                Ok(GetNewAddressResponse { value: v.to_string() })
5244            }
5245
5246            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
5247            where
5248                E: de::Error,
5249            {
5250                Ok(GetNewAddressResponse { value: v.to_string() })
5251            }
5252
5253            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
5254            where
5255                E: de::Error,
5256            {
5257                Ok(GetNewAddressResponse { value: v.to_string() })
5258            }
5259
5260            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
5261            where
5262                E: de::Error,
5263            {
5264                Ok(GetNewAddressResponse { value: v.to_string() })
5265            }
5266
5267            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
5268            where
5269                M: de::MapAccess<'de>,
5270            {
5271                let mut value = None;
5272                while let Some(key) = map.next_key::<String>()? {
5273                    if key == "value" {
5274                        if value.is_some() {
5275                            return Err(de::Error::duplicate_field("value"));
5276                        }
5277                        value = Some(map.next_value()?);
5278                    } else {
5279                        let _ = map.next_value::<de::IgnoredAny>()?;
5280                    }
5281                }
5282                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
5283                Ok(GetNewAddressResponse { value })
5284            }
5285        }
5286
5287        deserializer.deserialize_any(PrimitiveWrapperVisitor)
5288    }
5289}
5290
5291impl std::ops::Deref for GetNewAddressResponse {
5292    type Target = String;
5293    fn deref(&self) -> &Self::Target { &self.value }
5294}
5295
5296impl std::ops::DerefMut for GetNewAddressResponse {
5297    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
5298}
5299
5300impl AsRef<String> for GetNewAddressResponse {
5301    fn as_ref(&self) -> &String { &self.value }
5302}
5303
5304impl From<String> for GetNewAddressResponse {
5305    fn from(value: String) -> Self { Self { value } }
5306}
5307
5308impl From<GetNewAddressResponse> for String {
5309    fn from(wrapper: GetNewAddressResponse) -> Self { wrapper.value }
5310}
5311
5312/// Response for the `GetNodeAddresses` RPC method
5313///
5314/// This method returns an array wrapped in a transparent struct.
5315#[derive(Debug, Clone, PartialEq, Serialize)]
5316pub struct GetNodeAddressesResponse {
5317    /// Wrapped array value
5318    pub value: Vec<GetNodeAddressesElement>,
5319}
5320
5321impl<'de> serde::Deserialize<'de> for GetNodeAddressesResponse {
5322    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
5323    where
5324        D: serde::Deserializer<'de>,
5325    {
5326        let value = Vec::<GetNodeAddressesElement>::deserialize(deserializer)?;
5327        Ok(Self { value })
5328    }
5329}
5330
5331impl From<Vec<GetNodeAddressesElement>> for GetNodeAddressesResponse {
5332    fn from(value: Vec<GetNodeAddressesElement>) -> Self { Self { value } }
5333}
5334
5335impl From<GetNodeAddressesResponse> for Vec<GetNodeAddressesElement> {
5336    fn from(wrapper: GetNodeAddressesResponse) -> Self { wrapper.value }
5337}
5338
5339/// Response for the `GetOrphanTxs` RPC method
5340///
5341/// This method returns an array wrapped in a transparent struct.
5342#[derive(Debug, Clone, PartialEq, Serialize)]
5343pub struct GetOrphanTxsResponse {
5344    /// Wrapped array value
5345    pub value: Vec<String>,
5346}
5347
5348impl<'de> serde::Deserialize<'de> for GetOrphanTxsResponse {
5349    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
5350    where
5351        D: serde::Deserializer<'de>,
5352    {
5353        let value = Vec::<String>::deserialize(deserializer)?;
5354        Ok(Self { value })
5355    }
5356}
5357
5358impl From<Vec<String>> for GetOrphanTxsResponse {
5359    fn from(value: Vec<String>) -> Self { Self { value } }
5360}
5361
5362impl From<GetOrphanTxsResponse> for Vec<String> {
5363    fn from(wrapper: GetOrphanTxsResponse) -> Self { wrapper.value }
5364}
5365
5366/// Response for the `GetPeerInfo` RPC method
5367///
5368/// This method returns an array wrapped in a transparent struct.
5369#[derive(Debug, Clone, PartialEq, Serialize)]
5370pub struct GetPeerInfoResponse {
5371    /// Wrapped array value
5372    pub value: Vec<GetPeerInfoElement>,
5373}
5374
5375impl<'de> serde::Deserialize<'de> for GetPeerInfoResponse {
5376    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
5377    where
5378        D: serde::Deserializer<'de>,
5379    {
5380        let value = Vec::<GetPeerInfoElement>::deserialize(deserializer)?;
5381        Ok(Self { value })
5382    }
5383}
5384
5385impl From<Vec<GetPeerInfoElement>> for GetPeerInfoResponse {
5386    fn from(value: Vec<GetPeerInfoElement>) -> Self { Self { value } }
5387}
5388
5389impl From<GetPeerInfoResponse> for Vec<GetPeerInfoElement> {
5390    fn from(wrapper: GetPeerInfoResponse) -> Self { wrapper.value }
5391}
5392
5393/// Response for the `GetPrioritisedTransactions` RPC method
5394///
5395/// prioritisation keyed by txid
5396#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
5397#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
5398pub struct GetPrioritisedTransactionsResponse {
5399    #[serde(rename = "<transactionid>")]
5400    pub transactionid: GetPrioritisedTransactionsTransactionId,
5401}
5402
5403/// Response for the `GetRawAddrMan` RPC method
5404#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
5405#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
5406pub struct GetRawAddrManResponse {
5407    /// buckets with addresses in the address manager table ( new, tried )
5408    #[serde(default)]
5409    pub table: Option<GetRawAddrManTable>,
5410}
5411
5412/// Response for the `GetRawChangeAddress` RPC method
5413///
5414/// This method returns a primitive value wrapped in a transparent struct.
5415#[derive(Debug, Clone, PartialEq, Serialize)]
5416pub struct GetRawChangeAddressResponse {
5417    /// Wrapped primitive value
5418    pub value: String,
5419}
5420
5421impl<'de> serde::Deserialize<'de> for GetRawChangeAddressResponse {
5422    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
5423    where
5424        D: serde::Deserializer<'de>,
5425    {
5426        use std::fmt;
5427
5428        use serde::de::{self, Visitor};
5429
5430        struct PrimitiveWrapperVisitor;
5431
5432        #[allow(unused_variables, clippy::needless_lifetimes)]
5433        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
5434            type Value = GetRawChangeAddressResponse;
5435
5436            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
5437                formatter.write_str("a primitive value or an object with 'value' field")
5438            }
5439
5440            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
5441            where
5442                E: de::Error,
5443            {
5444                Ok(GetRawChangeAddressResponse { value: v.to_string() })
5445            }
5446
5447            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
5448            where
5449                E: de::Error,
5450            {
5451                Ok(GetRawChangeAddressResponse { value: v.to_string() })
5452            }
5453
5454            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
5455            where
5456                E: de::Error,
5457            {
5458                Ok(GetRawChangeAddressResponse { value: v.to_string() })
5459            }
5460
5461            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
5462            where
5463                E: de::Error,
5464            {
5465                Ok(GetRawChangeAddressResponse { value: v.to_string() })
5466            }
5467
5468            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
5469            where
5470                E: de::Error,
5471            {
5472                Ok(GetRawChangeAddressResponse { value: v.to_string() })
5473            }
5474
5475            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
5476            where
5477                M: de::MapAccess<'de>,
5478            {
5479                let mut value = None;
5480                while let Some(key) = map.next_key::<String>()? {
5481                    if key == "value" {
5482                        if value.is_some() {
5483                            return Err(de::Error::duplicate_field("value"));
5484                        }
5485                        value = Some(map.next_value()?);
5486                    } else {
5487                        let _ = map.next_value::<de::IgnoredAny>()?;
5488                    }
5489                }
5490                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
5491                Ok(GetRawChangeAddressResponse { value })
5492            }
5493        }
5494
5495        deserializer.deserialize_any(PrimitiveWrapperVisitor)
5496    }
5497}
5498
5499impl std::ops::Deref for GetRawChangeAddressResponse {
5500    type Target = String;
5501    fn deref(&self) -> &Self::Target { &self.value }
5502}
5503
5504impl std::ops::DerefMut for GetRawChangeAddressResponse {
5505    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
5506}
5507
5508impl AsRef<String> for GetRawChangeAddressResponse {
5509    fn as_ref(&self) -> &String { &self.value }
5510}
5511
5512impl From<String> for GetRawChangeAddressResponse {
5513    fn from(value: String) -> Self { Self { value } }
5514}
5515
5516impl From<GetRawChangeAddressResponse> for String {
5517    fn from(wrapper: GetRawChangeAddressResponse) -> Self { wrapper.value }
5518}
5519
5520/// Response for the `GetRawMempool` RPC method
5521///
5522/// This method returns an array wrapped in a transparent struct.
5523#[derive(Debug, Clone, PartialEq, Serialize)]
5524pub struct GetRawMempoolResponse {
5525    /// Wrapped array value
5526    pub value: Vec<String>,
5527}
5528
5529impl<'de> serde::Deserialize<'de> for GetRawMempoolResponse {
5530    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
5531    where
5532        D: serde::Deserializer<'de>,
5533    {
5534        let value = Vec::<String>::deserialize(deserializer)?;
5535        Ok(Self { value })
5536    }
5537}
5538
5539impl From<Vec<String>> for GetRawMempoolResponse {
5540    fn from(value: Vec<String>) -> Self { Self { value } }
5541}
5542
5543impl From<GetRawMempoolResponse> for Vec<String> {
5544    fn from(wrapper: GetRawMempoolResponse) -> Self { wrapper.value }
5545}
5546
5547/// Response for the `GetRawTransaction` RPC method
5548#[derive(Debug, Clone, PartialEq, Serialize)]
5549pub struct GetRawTransactionResponse {
5550    /// The serialized transaction as a hex-encoded string for 'txid'
5551    pub data: Option<String>,
5552    /// Whether specified block is in the active chain or not (only present with explicit "blockhash" argument)
5553    pub in_active_chain: Option<bool>,
5554    /// the block hash
5555    #[serde(rename = "blockhash")]
5556    pub block_hash: Option<bitcoin::BlockHash>,
5557    /// The confirmations
5558    pub confirmations: Option<i64>,
5559    /// The block time expressed in UNIX epoch time
5560    #[serde(rename = "blocktime")]
5561    pub block_time: Option<u64>,
5562    /// Same as "blocktime"
5563    pub time: Option<u64>,
5564    /// The serialized, hex-encoded data for 'txid'
5565    pub hex: Option<String>,
5566    /// The transaction id (same as provided)
5567    pub txid: Option<bitcoin::Txid>,
5568    /// The transaction hash (differs from txid for witness transactions)
5569    pub hash: Option<String>,
5570    /// The serialized transaction size
5571    pub size: Option<u64>,
5572    /// The virtual transaction size (differs from size for witness transactions)
5573    #[serde(rename = "vsize")]
5574    pub v_size: Option<u64>,
5575    /// The transaction's weight (between vsize*4-3 and vsize*4)
5576    pub weight: Option<u64>,
5577    /// The version
5578    pub version: Option<u32>,
5579    /// The lock time
5580    #[serde(rename = "locktime")]
5581    pub lock_time: Option<u64>,
5582    pub vin: Option<Vec<DecodedVin>>,
5583    pub vout: Option<Vec<DecodedVout>>,
5584    /// transaction fee in BTC, omitted if block undo data is not available
5585    pub fee: Option<f64>,
5586    pub vin_1: Option<Vec<DecodedVin>>,
5587}
5588impl<'de> serde::Deserialize<'de> for GetRawTransactionResponse {
5589    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
5590    where
5591        D: serde::Deserializer<'de>,
5592    {
5593        use std::fmt;
5594
5595        use serde::de::{self, Visitor};
5596
5597        struct ConditionalResponseVisitor;
5598
5599        #[allow(clippy::needless_lifetimes)]
5600        impl<'de> Visitor<'de> for ConditionalResponseVisitor {
5601            type Value = GetRawTransactionResponse;
5602
5603            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
5604                formatter.write_str("string or object")
5605            }
5606
5607            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
5608            where
5609                E: de::Error,
5610            {
5611                let data = v.to_string();
5612                Ok(GetRawTransactionResponse {
5613                    data: Some(data),
5614                    in_active_chain: None,
5615                    block_hash: None,
5616                    confirmations: None,
5617                    block_time: None,
5618                    time: None,
5619                    hex: None,
5620                    txid: None,
5621                    hash: None,
5622                    size: None,
5623                    v_size: None,
5624                    weight: None,
5625                    version: None,
5626                    lock_time: None,
5627                    vin: None,
5628                    vout: None,
5629                    fee: None,
5630                    vin_1: None,
5631                })
5632            }
5633
5634            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
5635            where
5636                M: de::MapAccess<'de>,
5637            {
5638                let mut data = None;
5639                let mut in_active_chain = None;
5640                let mut block_hash = None;
5641                let mut confirmations = None;
5642                let mut block_time = None;
5643                let mut time = None;
5644                let mut hex = None;
5645                let mut txid = None;
5646                let mut hash = None;
5647                let mut size = None;
5648                let mut v_size = None;
5649                let mut weight = None;
5650                let mut version = None;
5651                let mut lock_time = None;
5652                let mut vin = None;
5653                let mut vout = None;
5654                let mut fee = None;
5655                let mut vin_1 = None;
5656                while let Some(key) = map.next_key::<String>()? {
5657                    if key == "data" {
5658                        if data.is_some() {
5659                            return Err(de::Error::duplicate_field("data"));
5660                        }
5661                        data = Some(map.next_value::<String>()?);
5662                    }
5663                    if key == "in_active_chain" {
5664                        if in_active_chain.is_some() {
5665                            return Err(de::Error::duplicate_field("in_active_chain"));
5666                        }
5667                        in_active_chain = Some(map.next_value::<bool>()?);
5668                    }
5669                    if key == "blockhash" {
5670                        if block_hash.is_some() {
5671                            return Err(de::Error::duplicate_field("blockhash"));
5672                        }
5673                        block_hash = Some(map.next_value::<bitcoin::BlockHash>()?);
5674                    }
5675                    if key == "confirmations" {
5676                        if confirmations.is_some() {
5677                            return Err(de::Error::duplicate_field("confirmations"));
5678                        }
5679                        confirmations = Some(map.next_value::<i64>()?);
5680                    }
5681                    if key == "blocktime" {
5682                        if block_time.is_some() {
5683                            return Err(de::Error::duplicate_field("blocktime"));
5684                        }
5685                        block_time = Some(map.next_value::<u64>()?);
5686                    }
5687                    if key == "time" {
5688                        if time.is_some() {
5689                            return Err(de::Error::duplicate_field("time"));
5690                        }
5691                        time = Some(map.next_value::<u64>()?);
5692                    }
5693                    if key == "hex" {
5694                        if hex.is_some() {
5695                            return Err(de::Error::duplicate_field("hex"));
5696                        }
5697                        hex = Some(map.next_value::<String>()?);
5698                    }
5699                    if key == "txid" {
5700                        if txid.is_some() {
5701                            return Err(de::Error::duplicate_field("txid"));
5702                        }
5703                        txid = Some(map.next_value::<bitcoin::Txid>()?);
5704                    }
5705                    if key == "hash" {
5706                        if hash.is_some() {
5707                            return Err(de::Error::duplicate_field("hash"));
5708                        }
5709                        hash = Some(map.next_value::<String>()?);
5710                    }
5711                    if key == "size" {
5712                        if size.is_some() {
5713                            return Err(de::Error::duplicate_field("size"));
5714                        }
5715                        size = Some(map.next_value::<u64>()?);
5716                    }
5717                    if key == "vsize" {
5718                        if v_size.is_some() {
5719                            return Err(de::Error::duplicate_field("vsize"));
5720                        }
5721                        v_size = Some(map.next_value::<u64>()?);
5722                    }
5723                    if key == "weight" {
5724                        if weight.is_some() {
5725                            return Err(de::Error::duplicate_field("weight"));
5726                        }
5727                        weight = Some(map.next_value::<u64>()?);
5728                    }
5729                    if key == "version" {
5730                        if version.is_some() {
5731                            return Err(de::Error::duplicate_field("version"));
5732                        }
5733                        version = Some(map.next_value::<u32>()?);
5734                    }
5735                    if key == "locktime" {
5736                        if lock_time.is_some() {
5737                            return Err(de::Error::duplicate_field("locktime"));
5738                        }
5739                        lock_time = Some(map.next_value::<u64>()?);
5740                    }
5741                    if key == "vin" {
5742                        if vin.is_some() {
5743                            return Err(de::Error::duplicate_field("vin"));
5744                        }
5745                        vin = Some(map.next_value::<Vec<DecodedVin>>()?);
5746                    }
5747                    if key == "vout" {
5748                        if vout.is_some() {
5749                            return Err(de::Error::duplicate_field("vout"));
5750                        }
5751                        vout = Some(map.next_value::<Vec<DecodedVout>>()?);
5752                    }
5753                    if key == "fee" {
5754                        if fee.is_some() {
5755                            return Err(de::Error::duplicate_field("fee"));
5756                        }
5757                        fee = Some(map.next_value::<f64>()?);
5758                    }
5759                    if key == "vin_1" {
5760                        if vin_1.is_some() {
5761                            return Err(de::Error::duplicate_field("vin_1"));
5762                        }
5763                        vin_1 = Some(map.next_value::<Vec<DecodedVin>>()?);
5764                    } else {
5765                        let _ = map.next_value::<de::IgnoredAny>()?;
5766                    }
5767                }
5768                Ok(GetRawTransactionResponse {
5769                    data,
5770                    in_active_chain,
5771                    block_hash,
5772                    confirmations,
5773                    block_time,
5774                    time,
5775                    hex,
5776                    txid,
5777                    hash,
5778                    size,
5779                    v_size,
5780                    weight,
5781                    version,
5782                    lock_time,
5783                    vin,
5784                    vout,
5785                    fee,
5786                    vin_1,
5787                })
5788            }
5789        }
5790
5791        deserializer.deserialize_any(ConditionalResponseVisitor)
5792    }
5793}
5794
5795/// Response for the `GetReceivedByAddress` RPC method
5796///
5797/// This method returns a primitive value wrapped in a transparent struct.
5798#[derive(Debug, Clone, PartialEq, Serialize)]
5799pub struct GetReceivedByAddressResponse {
5800    /// Wrapped primitive value
5801    pub value: bitcoin::Amount,
5802}
5803
5804impl<'de> serde::Deserialize<'de> for GetReceivedByAddressResponse {
5805    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
5806    where
5807        D: serde::Deserializer<'de>,
5808    {
5809        use std::fmt;
5810
5811        use serde::de::{self, Visitor};
5812
5813        struct PrimitiveWrapperVisitor;
5814
5815        #[allow(unused_variables, clippy::needless_lifetimes)]
5816        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
5817            type Value = GetReceivedByAddressResponse;
5818
5819            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
5820                formatter.write_str("a primitive value or an object with 'value' field")
5821            }
5822
5823            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
5824            where
5825                E: de::Error,
5826            {
5827                Ok(GetReceivedByAddressResponse { value: bitcoin::Amount::from_sat(v) })
5828            }
5829
5830            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
5831            where
5832                E: de::Error,
5833            {
5834                if v < 0 {
5835                    return Err(de::Error::custom(format!("Amount cannot be negative: {}", v)));
5836                }
5837                Ok(GetReceivedByAddressResponse { value: bitcoin::Amount::from_sat(v as u64) })
5838            }
5839
5840            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
5841            where
5842                E: de::Error,
5843            {
5844                let amount = bitcoin::Amount::from_btc(v)
5845                    .map_err(|e| de::Error::custom(format!("Invalid BTC amount: {}", e)))?;
5846                Ok(GetReceivedByAddressResponse { value: amount })
5847            }
5848
5849            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
5850            where
5851                E: de::Error,
5852            {
5853                let value = v.parse::<bitcoin::Amount>().map_err(de::Error::custom)?;
5854                Ok(GetReceivedByAddressResponse { value })
5855            }
5856
5857            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
5858            where
5859                E: de::Error,
5860            {
5861                Err(de::Error::custom("cannot convert bool to bitcoin::Amount"))
5862            }
5863
5864            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
5865            where
5866                M: de::MapAccess<'de>,
5867            {
5868                let mut value = None;
5869                while let Some(key) = map.next_key::<String>()? {
5870                    if key == "value" {
5871                        if value.is_some() {
5872                            return Err(de::Error::duplicate_field("value"));
5873                        }
5874                        value = Some(map.next_value()?);
5875                    } else {
5876                        let _ = map.next_value::<de::IgnoredAny>()?;
5877                    }
5878                }
5879                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
5880                Ok(GetReceivedByAddressResponse { value })
5881            }
5882        }
5883
5884        deserializer.deserialize_any(PrimitiveWrapperVisitor)
5885    }
5886}
5887
5888impl std::ops::Deref for GetReceivedByAddressResponse {
5889    type Target = bitcoin::Amount;
5890    fn deref(&self) -> &Self::Target { &self.value }
5891}
5892
5893impl std::ops::DerefMut for GetReceivedByAddressResponse {
5894    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
5895}
5896
5897impl AsRef<bitcoin::Amount> for GetReceivedByAddressResponse {
5898    fn as_ref(&self) -> &bitcoin::Amount { &self.value }
5899}
5900
5901impl From<bitcoin::Amount> for GetReceivedByAddressResponse {
5902    fn from(value: bitcoin::Amount) -> Self { Self { value } }
5903}
5904
5905impl From<GetReceivedByAddressResponse> for bitcoin::Amount {
5906    fn from(wrapper: GetReceivedByAddressResponse) -> Self { wrapper.value }
5907}
5908
5909/// Response for the `GetReceivedByLabel` RPC method
5910///
5911/// This method returns a primitive value wrapped in a transparent struct.
5912#[derive(Debug, Clone, PartialEq, Serialize)]
5913pub struct GetReceivedByLabelResponse {
5914    /// Wrapped primitive value
5915    pub value: bitcoin::Amount,
5916}
5917
5918impl<'de> serde::Deserialize<'de> for GetReceivedByLabelResponse {
5919    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
5920    where
5921        D: serde::Deserializer<'de>,
5922    {
5923        use std::fmt;
5924
5925        use serde::de::{self, Visitor};
5926
5927        struct PrimitiveWrapperVisitor;
5928
5929        #[allow(unused_variables, clippy::needless_lifetimes)]
5930        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
5931            type Value = GetReceivedByLabelResponse;
5932
5933            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
5934                formatter.write_str("a primitive value or an object with 'value' field")
5935            }
5936
5937            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
5938            where
5939                E: de::Error,
5940            {
5941                Ok(GetReceivedByLabelResponse { value: bitcoin::Amount::from_sat(v) })
5942            }
5943
5944            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
5945            where
5946                E: de::Error,
5947            {
5948                if v < 0 {
5949                    return Err(de::Error::custom(format!("Amount cannot be negative: {}", v)));
5950                }
5951                Ok(GetReceivedByLabelResponse { value: bitcoin::Amount::from_sat(v as u64) })
5952            }
5953
5954            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
5955            where
5956                E: de::Error,
5957            {
5958                let amount = bitcoin::Amount::from_btc(v)
5959                    .map_err(|e| de::Error::custom(format!("Invalid BTC amount: {}", e)))?;
5960                Ok(GetReceivedByLabelResponse { value: amount })
5961            }
5962
5963            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
5964            where
5965                E: de::Error,
5966            {
5967                let value = v.parse::<bitcoin::Amount>().map_err(de::Error::custom)?;
5968                Ok(GetReceivedByLabelResponse { value })
5969            }
5970
5971            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
5972            where
5973                E: de::Error,
5974            {
5975                Err(de::Error::custom("cannot convert bool to bitcoin::Amount"))
5976            }
5977
5978            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
5979            where
5980                M: de::MapAccess<'de>,
5981            {
5982                let mut value = None;
5983                while let Some(key) = map.next_key::<String>()? {
5984                    if key == "value" {
5985                        if value.is_some() {
5986                            return Err(de::Error::duplicate_field("value"));
5987                        }
5988                        value = Some(map.next_value()?);
5989                    } else {
5990                        let _ = map.next_value::<de::IgnoredAny>()?;
5991                    }
5992                }
5993                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
5994                Ok(GetReceivedByLabelResponse { value })
5995            }
5996        }
5997
5998        deserializer.deserialize_any(PrimitiveWrapperVisitor)
5999    }
6000}
6001
6002impl std::ops::Deref for GetReceivedByLabelResponse {
6003    type Target = bitcoin::Amount;
6004    fn deref(&self) -> &Self::Target { &self.value }
6005}
6006
6007impl std::ops::DerefMut for GetReceivedByLabelResponse {
6008    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
6009}
6010
6011impl AsRef<bitcoin::Amount> for GetReceivedByLabelResponse {
6012    fn as_ref(&self) -> &bitcoin::Amount { &self.value }
6013}
6014
6015impl From<bitcoin::Amount> for GetReceivedByLabelResponse {
6016    fn from(value: bitcoin::Amount) -> Self { Self { value } }
6017}
6018
6019impl From<GetReceivedByLabelResponse> for bitcoin::Amount {
6020    fn from(wrapper: GetReceivedByLabelResponse) -> Self { wrapper.value }
6021}
6022
6023/// Response for the `GetRpcInfo` RPC method
6024#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
6025#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
6026pub struct GetRpcInfoResponse {
6027    /// All active commands
6028    pub active_commands: Vec<GetRpcInfoActiveCommands>,
6029    /// The complete file path to the debug log
6030    pub logpath: String,
6031}
6032
6033/// Response for the `GetTransaction` RPC method
6034#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
6035#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
6036pub struct GetTransactionResponse {
6037    /// The amount in BTC
6038    #[serde(deserialize_with = "amount_from_btc_float")]
6039    pub amount: bitcoin::Amount,
6040    /// The amount of the fee in BTC. This is negative and only available for the
6041    /// 'send' category of transactions.
6042    #[serde(deserialize_with = "option_amount_from_btc_float")]
6043    pub fee: Option<bitcoin::Amount>,
6044    /// The number of confirmations for the transaction. Negative confirmations means the
6045    /// transaction conflicted that many blocks ago.
6046    pub confirmations: i64,
6047    /// Only present if the transaction's only input is a coinbase one.
6048    pub generated: Option<bool>,
6049    /// Whether we consider the transaction to be trusted and safe to spend from.
6050    /// Only present when the transaction has 0 confirmations (or negative confirmations, if conflicted).
6051    pub trusted: Option<bool>,
6052    /// The block hash containing the transaction.
6053    #[serde(rename = "blockhash")]
6054    pub block_hash: Option<bitcoin::BlockHash>,
6055    /// The block height containing the transaction.
6056    #[serde(rename = "blockheight")]
6057    pub block_height: Option<u64>,
6058    /// The index of the transaction in the block that includes it.
6059    #[serde(rename = "blockindex")]
6060    pub block_index: Option<u64>,
6061    /// The block time expressed in UNIX epoch time.
6062    #[serde(rename = "blocktime")]
6063    pub block_time: Option<u64>,
6064    /// The transaction id.
6065    pub txid: bitcoin::Txid,
6066    /// The hash of serialized transaction, including witness data.
6067    #[serde(rename = "wtxid")]
6068    pub w_txid: String,
6069    /// Confirmed transactions that have been detected by the wallet to conflict with this transaction.
6070    #[serde(rename = "walletconflicts")]
6071    pub wallet_conflicts: Vec<String>,
6072    /// Only if 'category' is 'send'. The txid if this tx was replaced.
6073    pub replaced_by_txid: Option<String>,
6074    /// Only if 'category' is 'send'. The txid if this tx replaces another.
6075    pub replaces_txid: Option<String>,
6076    /// Transactions in the mempool that directly conflict with either this transaction or an ancestor transaction
6077    #[serde(rename = "mempoolconflicts")]
6078    pub mempool_conflicts: Vec<String>,
6079    /// If a comment to is associated with the transaction.
6080    pub to: Option<String>,
6081    /// The transaction time expressed in UNIX epoch time.
6082    pub time: u64,
6083    /// The time received expressed in UNIX epoch time.
6084    #[serde(rename = "timereceived")]
6085    pub time_received: u64,
6086    /// If a comment is associated with the transaction, only present if not empty.
6087    pub comment: Option<String>,
6088    /// ("yes|no|unknown") Whether this transaction signals BIP125 replaceability or has an unconfirmed ancestor signaling BIP125 replaceability.
6089    /// May be unknown for unconfirmed transactions not in the mempool because their unconfirmed ancestors are unknown.
6090    #[serde(rename = "bip125-replaceable")]
6091    pub bip125_replaceable: String,
6092    /// Only if 'category' is 'received'. List of parent descriptors for the output script of this coin.
6093    pub parent_descs: Option<Vec<String>>,
6094    pub details: Vec<GetTransactionDetails>,
6095    /// Raw data for transaction
6096    pub hex: String,
6097    /// The decoded transaction (only present when `verbose` is passed)
6098    pub decoded: Option<GetTransactionDecoded>,
6099    /// hash and height of the block this information was generated on
6100    #[serde(rename = "lastprocessedblock")]
6101    pub last_processed_block: GetTransactionLastProcessedBlock,
6102}
6103
6104/// Response for the `GetTxOut` RPC method
6105#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
6106#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
6107pub struct GetTxOutResponse {
6108    pub field_0_1: (),
6109    /// The hash of the block at the tip of the chain
6110    #[serde(rename = "bestblock")]
6111    pub best_block: String,
6112    /// The number of confirmations
6113    pub confirmations: i64,
6114    /// The transaction value in BTC
6115    #[serde(deserialize_with = "amount_from_btc_float")]
6116    pub value: bitcoin::Amount,
6117    #[serde(rename = "scriptPubKey")]
6118    pub script_pubkey: DecodedScriptPubKey,
6119    /// Coinbase or not
6120    pub coinbase: bool,
6121}
6122
6123/// Response for the `GetTxOutProof` RPC method
6124///
6125/// This method returns a primitive value wrapped in a transparent struct.
6126#[derive(Debug, Clone, PartialEq, Serialize)]
6127pub struct GetTxOutProofResponse {
6128    /// Wrapped primitive value
6129    pub value: String,
6130}
6131
6132impl<'de> serde::Deserialize<'de> for GetTxOutProofResponse {
6133    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
6134    where
6135        D: serde::Deserializer<'de>,
6136    {
6137        use std::fmt;
6138
6139        use serde::de::{self, Visitor};
6140
6141        struct PrimitiveWrapperVisitor;
6142
6143        #[allow(unused_variables, clippy::needless_lifetimes)]
6144        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
6145            type Value = GetTxOutProofResponse;
6146
6147            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
6148                formatter.write_str("a primitive value or an object with 'value' field")
6149            }
6150
6151            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
6152            where
6153                E: de::Error,
6154            {
6155                Ok(GetTxOutProofResponse { value: v.to_string() })
6156            }
6157
6158            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
6159            where
6160                E: de::Error,
6161            {
6162                Ok(GetTxOutProofResponse { value: v.to_string() })
6163            }
6164
6165            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
6166            where
6167                E: de::Error,
6168            {
6169                Ok(GetTxOutProofResponse { value: v.to_string() })
6170            }
6171
6172            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
6173            where
6174                E: de::Error,
6175            {
6176                Ok(GetTxOutProofResponse { value: v.to_string() })
6177            }
6178
6179            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
6180            where
6181                E: de::Error,
6182            {
6183                Ok(GetTxOutProofResponse { value: v.to_string() })
6184            }
6185
6186            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
6187            where
6188                M: de::MapAccess<'de>,
6189            {
6190                let mut value = None;
6191                while let Some(key) = map.next_key::<String>()? {
6192                    if key == "value" {
6193                        if value.is_some() {
6194                            return Err(de::Error::duplicate_field("value"));
6195                        }
6196                        value = Some(map.next_value()?);
6197                    } else {
6198                        let _ = map.next_value::<de::IgnoredAny>()?;
6199                    }
6200                }
6201                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
6202                Ok(GetTxOutProofResponse { value })
6203            }
6204        }
6205
6206        deserializer.deserialize_any(PrimitiveWrapperVisitor)
6207    }
6208}
6209
6210impl std::ops::Deref for GetTxOutProofResponse {
6211    type Target = String;
6212    fn deref(&self) -> &Self::Target { &self.value }
6213}
6214
6215impl std::ops::DerefMut for GetTxOutProofResponse {
6216    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
6217}
6218
6219impl AsRef<String> for GetTxOutProofResponse {
6220    fn as_ref(&self) -> &String { &self.value }
6221}
6222
6223impl From<String> for GetTxOutProofResponse {
6224    fn from(value: String) -> Self { Self { value } }
6225}
6226
6227impl From<GetTxOutProofResponse> for String {
6228    fn from(wrapper: GetTxOutProofResponse) -> Self { wrapper.value }
6229}
6230
6231/// Response for the `GetTxOutSetInfo` RPC method
6232#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
6233#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
6234pub struct GetTxOutSetInfoResponse {
6235    /// The block height (index) of the returned statistics
6236    pub height: u64,
6237    /// The hash of the block at which these statistics are calculated
6238    #[serde(rename = "bestblock")]
6239    pub best_block: String,
6240    /// The number of unspent transaction outputs
6241    pub txouts: u64,
6242    /// Database-independent, meaningless metric indicating the UTXO set size
6243    #[serde(rename = "bogosize")]
6244    pub bogo_size: u64,
6245    /// The serialized hash (only present if 'hash_serialized_3' hash_type is chosen)
6246    pub hash_serialized_3: Option<String>,
6247    /// The serialized hash (only present if 'muhash' hash_type is chosen)
6248    pub muhash: Option<String>,
6249    /// The number of transactions with unspent outputs (not available when coinstatsindex is used)
6250    pub transactions: Option<u64>,
6251    /// The estimated size of the chainstate on disk (not available when coinstatsindex is used)
6252    pub disk_size: Option<u64>,
6253    /// The total amount of coins in the UTXO set
6254    #[serde(deserialize_with = "amount_from_btc_float")]
6255    pub total_amount: bitcoin::Amount,
6256    /// The total amount of coins permanently excluded from the UTXO set (only available if coinstatsindex is used)
6257    #[serde(default)]
6258    #[serde(deserialize_with = "option_amount_from_btc_float")]
6259    pub total_unspendable_amount: Option<bitcoin::Amount>,
6260    /// Info on amounts in the block at this block height (only available if coinstatsindex is used)
6261    pub block_info: Option<GetTxOutSetInfoBlockInfo>,
6262}
6263
6264/// Response for the `GetTxSpendingPrevOut` RPC method
6265#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
6266#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
6267pub struct GetTxSpendingPrevOutResponse {
6268    pub field: serde_json::Value,
6269}
6270
6271/// Response for the `GetWalletInfo` RPC method
6272#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
6273#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
6274pub struct GetWalletInfoResponse {
6275    /// the wallet name
6276    #[serde(rename = "walletname")]
6277    pub wallet_name: String,
6278    /// (DEPRECATED) only related to unsupported legacy wallet, returns the latest version 169900 for backwards compatibility
6279    #[serde(rename = "walletversion")]
6280    pub wallet_version: u64,
6281    /// the database format (only sqlite)
6282    pub format: String,
6283    /// the total number of transactions in the wallet
6284    #[serde(rename = "txcount")]
6285    pub tx_count: u64,
6286    /// how many new keys are pre-generated (only counts external keys)
6287    #[serde(rename = "keypoolsize")]
6288    pub key_pool_size: u64,
6289    /// how many new keys are pre-generated for internal use (used for change outputs, only appears if the wallet is using this feature, otherwise external keys are used)
6290    pub keypoolsize_hd_internal: Option<u64>,
6291    /// the UNIX epoch time until which the wallet is unlocked for transfers, or 0 if the wallet is locked (only present for passphrase-encrypted wallets)
6292    pub unlocked_until: Option<u64>,
6293    /// false if privatekeys are disabled for this wallet (enforced watch-only wallet)
6294    pub private_keys_enabled: bool,
6295    /// whether this wallet tracks clean/dirty coins in terms of reuse
6296    pub avoid_reuse: bool,
6297    /// current scanning details, or false if no scan is in progress
6298    pub scanning: GetWalletInfoScanning,
6299    /// whether this wallet uses descriptors for output script management
6300    pub descriptors: bool,
6301    /// whether this wallet is configured to use an external signer such as a hardware wallet
6302    pub external_signer: bool,
6303    /// Whether this wallet intentionally does not contain any keys, scripts, or descriptors
6304    pub blank: bool,
6305    /// The start time for blocks scanning. It could be modified by (re)importing any descriptor with an earlier timestamp.
6306    #[serde(rename = "birthtime")]
6307    pub birth_time: Option<u64>,
6308    /// The flags currently set on the wallet
6309    pub flags: Vec<String>,
6310    /// hash and height of the block this information was generated on
6311    #[serde(rename = "lastprocessedblock")]
6312    pub last_processed_block: GetWalletInfoLastProcessedBlock,
6313}
6314
6315/// Response for the `Help` RPC method
6316///
6317/// This method returns a primitive value wrapped in a transparent struct.
6318#[derive(Debug, Clone, PartialEq, Serialize)]
6319pub struct HelpResponse {
6320    /// Wrapped primitive value
6321    pub value: String,
6322}
6323
6324impl<'de> serde::Deserialize<'de> for HelpResponse {
6325    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
6326    where
6327        D: serde::Deserializer<'de>,
6328    {
6329        use std::fmt;
6330
6331        use serde::de::{self, Visitor};
6332
6333        struct PrimitiveWrapperVisitor;
6334
6335        #[allow(unused_variables, clippy::needless_lifetimes)]
6336        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
6337            type Value = HelpResponse;
6338
6339            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
6340                formatter.write_str("a primitive value or an object with 'value' field")
6341            }
6342
6343            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
6344            where
6345                E: de::Error,
6346            {
6347                Ok(HelpResponse { value: v.to_string() })
6348            }
6349
6350            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
6351            where
6352                E: de::Error,
6353            {
6354                Ok(HelpResponse { value: v.to_string() })
6355            }
6356
6357            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
6358            where
6359                E: de::Error,
6360            {
6361                Ok(HelpResponse { value: v.to_string() })
6362            }
6363
6364            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
6365            where
6366                E: de::Error,
6367            {
6368                Ok(HelpResponse { value: v.to_string() })
6369            }
6370
6371            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
6372            where
6373                E: de::Error,
6374            {
6375                Ok(HelpResponse { value: v.to_string() })
6376            }
6377
6378            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
6379            where
6380                M: de::MapAccess<'de>,
6381            {
6382                let mut value = None;
6383                while let Some(key) = map.next_key::<String>()? {
6384                    if key == "value" {
6385                        if value.is_some() {
6386                            return Err(de::Error::duplicate_field("value"));
6387                        }
6388                        value = Some(map.next_value()?);
6389                    } else {
6390                        let _ = map.next_value::<de::IgnoredAny>()?;
6391                    }
6392                }
6393                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
6394                Ok(HelpResponse { value })
6395            }
6396        }
6397
6398        deserializer.deserialize_any(PrimitiveWrapperVisitor)
6399    }
6400}
6401
6402impl std::ops::Deref for HelpResponse {
6403    type Target = String;
6404    fn deref(&self) -> &Self::Target { &self.value }
6405}
6406
6407impl std::ops::DerefMut for HelpResponse {
6408    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
6409}
6410
6411impl AsRef<String> for HelpResponse {
6412    fn as_ref(&self) -> &String { &self.value }
6413}
6414
6415impl From<String> for HelpResponse {
6416    fn from(value: String) -> Self { Self { value } }
6417}
6418
6419impl From<HelpResponse> for String {
6420    fn from(wrapper: HelpResponse) -> Self { wrapper.value }
6421}
6422
6423/// Response for the `ImportDescriptors` RPC method
6424///
6425/// Response is an array with the same size as the input that has the execution result
6426#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
6427#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
6428pub struct ImportDescriptorsResponse {
6429    pub field: serde_json::Value,
6430}
6431
6432/// Response for the `ImportMempool` RPC method
6433///
6434/// This method returns no meaningful data.
6435#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
6436pub struct ImportMempoolResponse;
6437
6438/// Response for the `ImportPrunedFunds` RPC method
6439///
6440/// This method returns a primitive value wrapped in a transparent struct.
6441#[derive(Debug, Clone, PartialEq, Serialize)]
6442pub struct ImportPrunedFundsResponse {
6443    /// Wrapped primitive value
6444    pub value: (),
6445}
6446
6447impl<'de> serde::Deserialize<'de> for ImportPrunedFundsResponse {
6448    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
6449    where
6450        D: serde::Deserializer<'de>,
6451    {
6452        use std::fmt;
6453
6454        use serde::de::{self, Visitor};
6455
6456        struct PrimitiveWrapperVisitor;
6457
6458        #[allow(unused_variables, clippy::needless_lifetimes)]
6459        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
6460            type Value = ImportPrunedFundsResponse;
6461
6462            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
6463                formatter.write_str("a primitive value or an object with 'value' field")
6464            }
6465
6466            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
6467            where
6468                E: de::Error,
6469            {
6470                Ok(ImportPrunedFundsResponse { value: () })
6471            }
6472
6473            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
6474            where
6475                E: de::Error,
6476            {
6477                Ok(ImportPrunedFundsResponse { value: () })
6478            }
6479
6480            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
6481            where
6482                E: de::Error,
6483            {
6484                Ok(ImportPrunedFundsResponse { value: () })
6485            }
6486
6487            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
6488            where
6489                E: de::Error,
6490            {
6491                Ok(ImportPrunedFundsResponse { value: () })
6492            }
6493
6494            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
6495            where
6496                E: de::Error,
6497            {
6498                Ok(ImportPrunedFundsResponse { value: () })
6499            }
6500
6501            fn visit_none<E>(self) -> Result<Self::Value, E>
6502            where
6503                E: de::Error,
6504            {
6505                Ok(ImportPrunedFundsResponse { value: () })
6506            }
6507
6508            fn visit_unit<E>(self) -> Result<Self::Value, E>
6509            where
6510                E: de::Error,
6511            {
6512                Ok(ImportPrunedFundsResponse { value: () })
6513            }
6514
6515            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
6516            where
6517                M: de::MapAccess<'de>,
6518            {
6519                let mut value = None;
6520                while let Some(key) = map.next_key::<String>()? {
6521                    if key == "value" {
6522                        if value.is_some() {
6523                            return Err(de::Error::duplicate_field("value"));
6524                        }
6525                        value = Some(map.next_value::<()>()?);
6526                    } else {
6527                        let _ = map.next_value::<de::IgnoredAny>()?;
6528                    }
6529                }
6530                value.ok_or_else(|| de::Error::missing_field("value"))?;
6531                Ok(ImportPrunedFundsResponse { value: () })
6532            }
6533        }
6534
6535        deserializer.deserialize_any(PrimitiveWrapperVisitor)
6536    }
6537}
6538
6539impl std::ops::Deref for ImportPrunedFundsResponse {
6540    type Target = ();
6541    fn deref(&self) -> &Self::Target { &self.value }
6542}
6543
6544impl std::ops::DerefMut for ImportPrunedFundsResponse {
6545    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
6546}
6547
6548impl AsRef<()> for ImportPrunedFundsResponse {
6549    fn as_ref(&self) -> &() { &self.value }
6550}
6551
6552impl From<()> for ImportPrunedFundsResponse {
6553    fn from(value: ()) -> Self { Self { value } }
6554}
6555
6556impl From<ImportPrunedFundsResponse> for () {
6557    fn from(wrapper: ImportPrunedFundsResponse) -> Self { wrapper.value }
6558}
6559
6560/// Response for the `InvalidateBlock` RPC method
6561///
6562/// This method returns a primitive value wrapped in a transparent struct.
6563#[derive(Debug, Clone, PartialEq, Serialize)]
6564pub struct InvalidateBlockResponse {
6565    /// Wrapped primitive value
6566    pub value: (),
6567}
6568
6569impl<'de> serde::Deserialize<'de> for InvalidateBlockResponse {
6570    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
6571    where
6572        D: serde::Deserializer<'de>,
6573    {
6574        use std::fmt;
6575
6576        use serde::de::{self, Visitor};
6577
6578        struct PrimitiveWrapperVisitor;
6579
6580        #[allow(unused_variables, clippy::needless_lifetimes)]
6581        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
6582            type Value = InvalidateBlockResponse;
6583
6584            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
6585                formatter.write_str("a primitive value or an object with 'value' field")
6586            }
6587
6588            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
6589            where
6590                E: de::Error,
6591            {
6592                Ok(InvalidateBlockResponse { value: () })
6593            }
6594
6595            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
6596            where
6597                E: de::Error,
6598            {
6599                Ok(InvalidateBlockResponse { value: () })
6600            }
6601
6602            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
6603            where
6604                E: de::Error,
6605            {
6606                Ok(InvalidateBlockResponse { value: () })
6607            }
6608
6609            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
6610            where
6611                E: de::Error,
6612            {
6613                Ok(InvalidateBlockResponse { value: () })
6614            }
6615
6616            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
6617            where
6618                E: de::Error,
6619            {
6620                Ok(InvalidateBlockResponse { value: () })
6621            }
6622
6623            fn visit_none<E>(self) -> Result<Self::Value, E>
6624            where
6625                E: de::Error,
6626            {
6627                Ok(InvalidateBlockResponse { value: () })
6628            }
6629
6630            fn visit_unit<E>(self) -> Result<Self::Value, E>
6631            where
6632                E: de::Error,
6633            {
6634                Ok(InvalidateBlockResponse { value: () })
6635            }
6636
6637            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
6638            where
6639                M: de::MapAccess<'de>,
6640            {
6641                let mut value = None;
6642                while let Some(key) = map.next_key::<String>()? {
6643                    if key == "value" {
6644                        if value.is_some() {
6645                            return Err(de::Error::duplicate_field("value"));
6646                        }
6647                        value = Some(map.next_value::<()>()?);
6648                    } else {
6649                        let _ = map.next_value::<de::IgnoredAny>()?;
6650                    }
6651                }
6652                value.ok_or_else(|| de::Error::missing_field("value"))?;
6653                Ok(InvalidateBlockResponse { value: () })
6654            }
6655        }
6656
6657        deserializer.deserialize_any(PrimitiveWrapperVisitor)
6658    }
6659}
6660
6661impl std::ops::Deref for InvalidateBlockResponse {
6662    type Target = ();
6663    fn deref(&self) -> &Self::Target { &self.value }
6664}
6665
6666impl std::ops::DerefMut for InvalidateBlockResponse {
6667    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
6668}
6669
6670impl AsRef<()> for InvalidateBlockResponse {
6671    fn as_ref(&self) -> &() { &self.value }
6672}
6673
6674impl From<()> for InvalidateBlockResponse {
6675    fn from(value: ()) -> Self { Self { value } }
6676}
6677
6678impl From<InvalidateBlockResponse> for () {
6679    fn from(wrapper: InvalidateBlockResponse) -> Self { wrapper.value }
6680}
6681
6682/// Response for the `JoinPsbts` RPC method
6683///
6684/// This method returns a primitive value wrapped in a transparent struct.
6685#[derive(Debug, Clone, PartialEq, Serialize)]
6686pub struct JoinPsbtsResponse {
6687    /// Wrapped primitive value
6688    pub value: String,
6689}
6690
6691impl<'de> serde::Deserialize<'de> for JoinPsbtsResponse {
6692    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
6693    where
6694        D: serde::Deserializer<'de>,
6695    {
6696        use std::fmt;
6697
6698        use serde::de::{self, Visitor};
6699
6700        struct PrimitiveWrapperVisitor;
6701
6702        #[allow(unused_variables, clippy::needless_lifetimes)]
6703        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
6704            type Value = JoinPsbtsResponse;
6705
6706            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
6707                formatter.write_str("a primitive value or an object with 'value' field")
6708            }
6709
6710            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
6711            where
6712                E: de::Error,
6713            {
6714                Ok(JoinPsbtsResponse { value: v.to_string() })
6715            }
6716
6717            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
6718            where
6719                E: de::Error,
6720            {
6721                Ok(JoinPsbtsResponse { value: v.to_string() })
6722            }
6723
6724            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
6725            where
6726                E: de::Error,
6727            {
6728                Ok(JoinPsbtsResponse { value: v.to_string() })
6729            }
6730
6731            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
6732            where
6733                E: de::Error,
6734            {
6735                Ok(JoinPsbtsResponse { value: v.to_string() })
6736            }
6737
6738            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
6739            where
6740                E: de::Error,
6741            {
6742                Ok(JoinPsbtsResponse { value: v.to_string() })
6743            }
6744
6745            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
6746            where
6747                M: de::MapAccess<'de>,
6748            {
6749                let mut value = None;
6750                while let Some(key) = map.next_key::<String>()? {
6751                    if key == "value" {
6752                        if value.is_some() {
6753                            return Err(de::Error::duplicate_field("value"));
6754                        }
6755                        value = Some(map.next_value()?);
6756                    } else {
6757                        let _ = map.next_value::<de::IgnoredAny>()?;
6758                    }
6759                }
6760                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
6761                Ok(JoinPsbtsResponse { value })
6762            }
6763        }
6764
6765        deserializer.deserialize_any(PrimitiveWrapperVisitor)
6766    }
6767}
6768
6769impl std::ops::Deref for JoinPsbtsResponse {
6770    type Target = String;
6771    fn deref(&self) -> &Self::Target { &self.value }
6772}
6773
6774impl std::ops::DerefMut for JoinPsbtsResponse {
6775    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
6776}
6777
6778impl AsRef<String> for JoinPsbtsResponse {
6779    fn as_ref(&self) -> &String { &self.value }
6780}
6781
6782impl From<String> for JoinPsbtsResponse {
6783    fn from(value: String) -> Self { Self { value } }
6784}
6785
6786impl From<JoinPsbtsResponse> for String {
6787    fn from(wrapper: JoinPsbtsResponse) -> Self { wrapper.value }
6788}
6789
6790/// Response for the `KeypoolRefill` RPC method
6791///
6792/// This method returns a primitive value wrapped in a transparent struct.
6793#[derive(Debug, Clone, PartialEq, Serialize)]
6794pub struct KeypoolRefillResponse {
6795    /// Wrapped primitive value
6796    pub value: (),
6797}
6798
6799impl<'de> serde::Deserialize<'de> for KeypoolRefillResponse {
6800    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
6801    where
6802        D: serde::Deserializer<'de>,
6803    {
6804        use std::fmt;
6805
6806        use serde::de::{self, Visitor};
6807
6808        struct PrimitiveWrapperVisitor;
6809
6810        #[allow(unused_variables, clippy::needless_lifetimes)]
6811        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
6812            type Value = KeypoolRefillResponse;
6813
6814            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
6815                formatter.write_str("a primitive value or an object with 'value' field")
6816            }
6817
6818            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
6819            where
6820                E: de::Error,
6821            {
6822                Ok(KeypoolRefillResponse { value: () })
6823            }
6824
6825            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
6826            where
6827                E: de::Error,
6828            {
6829                Ok(KeypoolRefillResponse { value: () })
6830            }
6831
6832            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
6833            where
6834                E: de::Error,
6835            {
6836                Ok(KeypoolRefillResponse { value: () })
6837            }
6838
6839            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
6840            where
6841                E: de::Error,
6842            {
6843                Ok(KeypoolRefillResponse { value: () })
6844            }
6845
6846            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
6847            where
6848                E: de::Error,
6849            {
6850                Ok(KeypoolRefillResponse { value: () })
6851            }
6852
6853            fn visit_none<E>(self) -> Result<Self::Value, E>
6854            where
6855                E: de::Error,
6856            {
6857                Ok(KeypoolRefillResponse { value: () })
6858            }
6859
6860            fn visit_unit<E>(self) -> Result<Self::Value, E>
6861            where
6862                E: de::Error,
6863            {
6864                Ok(KeypoolRefillResponse { value: () })
6865            }
6866
6867            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
6868            where
6869                M: de::MapAccess<'de>,
6870            {
6871                let mut value = None;
6872                while let Some(key) = map.next_key::<String>()? {
6873                    if key == "value" {
6874                        if value.is_some() {
6875                            return Err(de::Error::duplicate_field("value"));
6876                        }
6877                        value = Some(map.next_value::<()>()?);
6878                    } else {
6879                        let _ = map.next_value::<de::IgnoredAny>()?;
6880                    }
6881                }
6882                value.ok_or_else(|| de::Error::missing_field("value"))?;
6883                Ok(KeypoolRefillResponse { value: () })
6884            }
6885        }
6886
6887        deserializer.deserialize_any(PrimitiveWrapperVisitor)
6888    }
6889}
6890
6891impl std::ops::Deref for KeypoolRefillResponse {
6892    type Target = ();
6893    fn deref(&self) -> &Self::Target { &self.value }
6894}
6895
6896impl std::ops::DerefMut for KeypoolRefillResponse {
6897    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
6898}
6899
6900impl AsRef<()> for KeypoolRefillResponse {
6901    fn as_ref(&self) -> &() { &self.value }
6902}
6903
6904impl From<()> for KeypoolRefillResponse {
6905    fn from(value: ()) -> Self { Self { value } }
6906}
6907
6908impl From<KeypoolRefillResponse> for () {
6909    fn from(wrapper: KeypoolRefillResponse) -> Self { wrapper.value }
6910}
6911
6912/// Response for the `ListAddressGroupings` RPC method
6913///
6914/// This method returns an array wrapped in a transparent struct.
6915#[derive(Debug, Clone, PartialEq, Serialize)]
6916pub struct ListAddressGroupingsResponse {
6917    /// Wrapped array value
6918    pub value: Vec<serde_json::Value>,
6919}
6920
6921impl<'de> serde::Deserialize<'de> for ListAddressGroupingsResponse {
6922    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
6923    where
6924        D: serde::Deserializer<'de>,
6925    {
6926        let value = Vec::<serde_json::Value>::deserialize(deserializer)?;
6927        Ok(Self { value })
6928    }
6929}
6930
6931impl From<Vec<serde_json::Value>> for ListAddressGroupingsResponse {
6932    fn from(value: Vec<serde_json::Value>) -> Self { Self { value } }
6933}
6934
6935impl From<ListAddressGroupingsResponse> for Vec<serde_json::Value> {
6936    fn from(wrapper: ListAddressGroupingsResponse) -> Self { wrapper.value }
6937}
6938
6939/// Response for the `ListBanned` RPC method
6940///
6941/// This method returns an array wrapped in a transparent struct.
6942#[derive(Debug, Clone, PartialEq, Serialize)]
6943pub struct ListBannedResponse {
6944    /// Wrapped array value
6945    pub value: Vec<ListBannedElement>,
6946}
6947
6948impl<'de> serde::Deserialize<'de> for ListBannedResponse {
6949    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
6950    where
6951        D: serde::Deserializer<'de>,
6952    {
6953        let value = Vec::<ListBannedElement>::deserialize(deserializer)?;
6954        Ok(Self { value })
6955    }
6956}
6957
6958impl From<Vec<ListBannedElement>> for ListBannedResponse {
6959    fn from(value: Vec<ListBannedElement>) -> Self { Self { value } }
6960}
6961
6962impl From<ListBannedResponse> for Vec<ListBannedElement> {
6963    fn from(wrapper: ListBannedResponse) -> Self { wrapper.value }
6964}
6965
6966/// Response for the `ListDescriptors` RPC method
6967#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
6968#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
6969pub struct ListDescriptorsResponse {
6970    /// Name of wallet this operation was performed on
6971    pub wallet_name: String,
6972    /// Array of descriptor objects (sorted by descriptor string representation)
6973    pub descriptors: Vec<ListDescriptorsDescriptors>,
6974}
6975
6976/// Response for the `ListLabels` RPC method
6977///
6978/// This method returns an array wrapped in a transparent struct.
6979#[derive(Debug, Clone, PartialEq, Serialize)]
6980pub struct ListLabelsResponse {
6981    /// Wrapped array value
6982    pub value: Vec<serde_json::Value>,
6983}
6984
6985impl<'de> serde::Deserialize<'de> for ListLabelsResponse {
6986    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
6987    where
6988        D: serde::Deserializer<'de>,
6989    {
6990        let value = Vec::<serde_json::Value>::deserialize(deserializer)?;
6991        Ok(Self { value })
6992    }
6993}
6994
6995impl From<Vec<serde_json::Value>> for ListLabelsResponse {
6996    fn from(value: Vec<serde_json::Value>) -> Self { Self { value } }
6997}
6998
6999impl From<ListLabelsResponse> for Vec<serde_json::Value> {
7000    fn from(wrapper: ListLabelsResponse) -> Self { wrapper.value }
7001}
7002
7003/// Response for the `ListLockUnspent` RPC method
7004///
7005/// This method returns an array wrapped in a transparent struct.
7006#[derive(Debug, Clone, PartialEq, Serialize)]
7007pub struct ListLockUnspentResponse {
7008    /// Wrapped array value
7009    pub value: Vec<ListLockUnspentElement>,
7010}
7011
7012impl<'de> serde::Deserialize<'de> for ListLockUnspentResponse {
7013    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
7014    where
7015        D: serde::Deserializer<'de>,
7016    {
7017        let value = Vec::<ListLockUnspentElement>::deserialize(deserializer)?;
7018        Ok(Self { value })
7019    }
7020}
7021
7022impl From<Vec<ListLockUnspentElement>> for ListLockUnspentResponse {
7023    fn from(value: Vec<ListLockUnspentElement>) -> Self { Self { value } }
7024}
7025
7026impl From<ListLockUnspentResponse> for Vec<ListLockUnspentElement> {
7027    fn from(wrapper: ListLockUnspentResponse) -> Self { wrapper.value }
7028}
7029
7030/// Response for the `ListReceivedByAddress` RPC method
7031///
7032/// This method returns an array wrapped in a transparent struct.
7033#[derive(Debug, Clone, PartialEq, Serialize)]
7034pub struct ListReceivedByAddressResponse {
7035    /// Wrapped array value
7036    pub value: Vec<ListReceivedByAddressElement>,
7037}
7038
7039impl<'de> serde::Deserialize<'de> for ListReceivedByAddressResponse {
7040    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
7041    where
7042        D: serde::Deserializer<'de>,
7043    {
7044        let value = Vec::<ListReceivedByAddressElement>::deserialize(deserializer)?;
7045        Ok(Self { value })
7046    }
7047}
7048
7049impl From<Vec<ListReceivedByAddressElement>> for ListReceivedByAddressResponse {
7050    fn from(value: Vec<ListReceivedByAddressElement>) -> Self { Self { value } }
7051}
7052
7053impl From<ListReceivedByAddressResponse> for Vec<ListReceivedByAddressElement> {
7054    fn from(wrapper: ListReceivedByAddressResponse) -> Self { wrapper.value }
7055}
7056
7057/// Response for the `ListReceivedByLabel` RPC method
7058///
7059/// This method returns an array wrapped in a transparent struct.
7060#[derive(Debug, Clone, PartialEq, Serialize)]
7061pub struct ListReceivedByLabelResponse {
7062    /// Wrapped array value
7063    pub value: Vec<ListReceivedByLabelElement>,
7064}
7065
7066impl<'de> serde::Deserialize<'de> for ListReceivedByLabelResponse {
7067    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
7068    where
7069        D: serde::Deserializer<'de>,
7070    {
7071        let value = Vec::<ListReceivedByLabelElement>::deserialize(deserializer)?;
7072        Ok(Self { value })
7073    }
7074}
7075
7076impl From<Vec<ListReceivedByLabelElement>> for ListReceivedByLabelResponse {
7077    fn from(value: Vec<ListReceivedByLabelElement>) -> Self { Self { value } }
7078}
7079
7080impl From<ListReceivedByLabelResponse> for Vec<ListReceivedByLabelElement> {
7081    fn from(wrapper: ListReceivedByLabelResponse) -> Self { wrapper.value }
7082}
7083
7084/// Response for the `ListSinceBlock` RPC method
7085#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
7086#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
7087pub struct ListSinceBlockResponse {
7088    pub transactions: Vec<ListSinceBlockTransactions>,
7089    /// &lt;structure is the same as "transactions" above, only present if include_removed=true&gt;
7090    /// Note: transactions that were re-added in the active chain will appear as-is in this array, and may thus have a positive confirmation count.
7091    pub removed: Option<Vec<String>>,
7092    /// The hash of the block (target_confirmations-1) from the best block on the main chain, or the genesis hash if the referenced block does not exist yet. This is typically used to feed back into listsinceblock the next time you call it. So you would generally use a target_confirmations of say 6, so you will be continually re-notified of transactions until they've reached 6 confirmations plus any new ones
7093    #[serde(rename = "lastblock")]
7094    pub last_block: String,
7095}
7096
7097/// Response for the `ListTransactions` RPC method
7098///
7099/// This method returns an array wrapped in a transparent struct.
7100#[derive(Debug, Clone, PartialEq, Serialize)]
7101pub struct ListTransactionsResponse {
7102    /// Wrapped array value
7103    pub value: Vec<ListTransactionsElement>,
7104}
7105
7106impl<'de> serde::Deserialize<'de> for ListTransactionsResponse {
7107    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
7108    where
7109        D: serde::Deserializer<'de>,
7110    {
7111        let value = Vec::<ListTransactionsElement>::deserialize(deserializer)?;
7112        Ok(Self { value })
7113    }
7114}
7115
7116impl From<Vec<ListTransactionsElement>> for ListTransactionsResponse {
7117    fn from(value: Vec<ListTransactionsElement>) -> Self { Self { value } }
7118}
7119
7120impl From<ListTransactionsResponse> for Vec<ListTransactionsElement> {
7121    fn from(wrapper: ListTransactionsResponse) -> Self { wrapper.value }
7122}
7123
7124/// Response for the `ListUnspent` RPC method
7125///
7126/// This method returns an array wrapped in a transparent struct.
7127#[derive(Debug, Clone, PartialEq, Serialize)]
7128pub struct ListUnspentResponse {
7129    /// Wrapped array value
7130    pub value: Vec<ListUnspentElement>,
7131}
7132
7133impl<'de> serde::Deserialize<'de> for ListUnspentResponse {
7134    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
7135    where
7136        D: serde::Deserializer<'de>,
7137    {
7138        let value = Vec::<ListUnspentElement>::deserialize(deserializer)?;
7139        Ok(Self { value })
7140    }
7141}
7142
7143impl From<Vec<ListUnspentElement>> for ListUnspentResponse {
7144    fn from(value: Vec<ListUnspentElement>) -> Self { Self { value } }
7145}
7146
7147impl From<ListUnspentResponse> for Vec<ListUnspentElement> {
7148    fn from(wrapper: ListUnspentResponse) -> Self { wrapper.value }
7149}
7150
7151/// Response for the `ListWalletDir` RPC method
7152#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
7153#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
7154pub struct ListWalletDirResponse {
7155    pub wallets: Vec<ListWalletDirWallets>,
7156}
7157
7158/// Response for the `ListWallets` RPC method
7159///
7160/// This method returns an array wrapped in a transparent struct.
7161#[derive(Debug, Clone, PartialEq, Serialize)]
7162pub struct ListWalletsResponse {
7163    /// Wrapped array value
7164    pub value: Vec<serde_json::Value>,
7165}
7166
7167impl<'de> serde::Deserialize<'de> for ListWalletsResponse {
7168    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
7169    where
7170        D: serde::Deserializer<'de>,
7171    {
7172        let value = Vec::<serde_json::Value>::deserialize(deserializer)?;
7173        Ok(Self { value })
7174    }
7175}
7176
7177impl From<Vec<serde_json::Value>> for ListWalletsResponse {
7178    fn from(value: Vec<serde_json::Value>) -> Self { Self { value } }
7179}
7180
7181impl From<ListWalletsResponse> for Vec<serde_json::Value> {
7182    fn from(wrapper: ListWalletsResponse) -> Self { wrapper.value }
7183}
7184
7185/// Response for the `LoadTxOutSet` RPC method
7186#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
7187#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
7188pub struct LoadTxOutSetResponse {
7189    /// the number of coins loaded from the snapshot
7190    pub coins_loaded: u64,
7191    /// the hash of the base of the snapshot
7192    pub tip_hash: String,
7193    /// the height of the base of the snapshot
7194    pub base_height: u64,
7195    /// the absolute path that the snapshot was loaded from
7196    pub path: String,
7197}
7198
7199/// Response for the `LoadWallet` RPC method
7200#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
7201#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
7202pub struct LoadWalletResponse {
7203    /// The wallet name if loaded successfully.
7204    pub name: String,
7205    /// Warning messages, if any, related to loading the wallet.
7206    pub warnings: Option<Vec<String>>,
7207}
7208
7209/// Response for the `LockUnspent` RPC method
7210///
7211/// This method returns a primitive value wrapped in a transparent struct.
7212#[derive(Debug, Clone, PartialEq, Serialize)]
7213pub struct LockUnspentResponse {
7214    /// Wrapped primitive value
7215    pub value: bool,
7216}
7217
7218impl<'de> serde::Deserialize<'de> for LockUnspentResponse {
7219    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
7220    where
7221        D: serde::Deserializer<'de>,
7222    {
7223        use std::fmt;
7224
7225        use serde::de::{self, Visitor};
7226
7227        struct PrimitiveWrapperVisitor;
7228
7229        #[allow(unused_variables, clippy::needless_lifetimes)]
7230        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
7231            type Value = LockUnspentResponse;
7232
7233            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
7234                formatter.write_str("a primitive value or an object with 'value' field")
7235            }
7236
7237            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
7238            where
7239                E: de::Error,
7240            {
7241                Ok(LockUnspentResponse { value: v != 0 })
7242            }
7243
7244            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
7245            where
7246                E: de::Error,
7247            {
7248                Ok(LockUnspentResponse { value: v != 0 })
7249            }
7250
7251            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
7252            where
7253                E: de::Error,
7254            {
7255                Ok(LockUnspentResponse { value: v != 0.0 })
7256            }
7257
7258            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
7259            where
7260                E: de::Error,
7261            {
7262                let value = v.parse::<bool>().map_err(de::Error::custom)?;
7263                Ok(LockUnspentResponse { value })
7264            }
7265
7266            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
7267            where
7268                E: de::Error,
7269            {
7270                Ok(LockUnspentResponse { value: v })
7271            }
7272
7273            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
7274            where
7275                M: de::MapAccess<'de>,
7276            {
7277                let mut value = None;
7278                while let Some(key) = map.next_key::<String>()? {
7279                    if key == "value" {
7280                        if value.is_some() {
7281                            return Err(de::Error::duplicate_field("value"));
7282                        }
7283                        value = Some(map.next_value()?);
7284                    } else {
7285                        let _ = map.next_value::<de::IgnoredAny>()?;
7286                    }
7287                }
7288                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
7289                Ok(LockUnspentResponse { value })
7290            }
7291        }
7292
7293        deserializer.deserialize_any(PrimitiveWrapperVisitor)
7294    }
7295}
7296
7297impl std::ops::Deref for LockUnspentResponse {
7298    type Target = bool;
7299    fn deref(&self) -> &Self::Target { &self.value }
7300}
7301
7302impl std::ops::DerefMut for LockUnspentResponse {
7303    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
7304}
7305
7306impl AsRef<bool> for LockUnspentResponse {
7307    fn as_ref(&self) -> &bool { &self.value }
7308}
7309
7310impl From<bool> for LockUnspentResponse {
7311    fn from(value: bool) -> Self { Self { value } }
7312}
7313
7314impl From<LockUnspentResponse> for bool {
7315    fn from(wrapper: LockUnspentResponse) -> Self { wrapper.value }
7316}
7317
7318/// Response for the `Logging` RPC method
7319///
7320/// keys are the logging categories, and values indicates its status
7321#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
7322#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
7323pub struct LoggingResponse {
7324    /// if being debug logged or not. false:inactive, true:active
7325    #[serde(default)]
7326    pub category: Option<bool>,
7327}
7328
7329/// Response for the `MigrateWallet` RPC method
7330#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
7331#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
7332pub struct MigrateWalletResponse {
7333    /// The name of the primary migrated wallet
7334    pub wallet_name: String,
7335    /// The name of the migrated wallet containing the watchonly scripts
7336    pub watchonly_name: Option<String>,
7337    /// The name of the migrated wallet containing solvable but not watched scripts
7338    pub solvables_name: Option<String>,
7339    /// The location of the backup of the original wallet
7340    pub backup_path: String,
7341}
7342
7343/// Response for the `MockScheduler` RPC method
7344///
7345/// This method returns a primitive value wrapped in a transparent struct.
7346#[derive(Debug, Clone, PartialEq, Serialize)]
7347pub struct MockSchedulerResponse {
7348    /// Wrapped primitive value
7349    pub value: (),
7350}
7351
7352impl<'de> serde::Deserialize<'de> for MockSchedulerResponse {
7353    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
7354    where
7355        D: serde::Deserializer<'de>,
7356    {
7357        use std::fmt;
7358
7359        use serde::de::{self, Visitor};
7360
7361        struct PrimitiveWrapperVisitor;
7362
7363        #[allow(unused_variables, clippy::needless_lifetimes)]
7364        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
7365            type Value = MockSchedulerResponse;
7366
7367            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
7368                formatter.write_str("a primitive value or an object with 'value' field")
7369            }
7370
7371            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
7372            where
7373                E: de::Error,
7374            {
7375                Ok(MockSchedulerResponse { value: () })
7376            }
7377
7378            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
7379            where
7380                E: de::Error,
7381            {
7382                Ok(MockSchedulerResponse { value: () })
7383            }
7384
7385            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
7386            where
7387                E: de::Error,
7388            {
7389                Ok(MockSchedulerResponse { value: () })
7390            }
7391
7392            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
7393            where
7394                E: de::Error,
7395            {
7396                Ok(MockSchedulerResponse { value: () })
7397            }
7398
7399            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
7400            where
7401                E: de::Error,
7402            {
7403                Ok(MockSchedulerResponse { value: () })
7404            }
7405
7406            fn visit_none<E>(self) -> Result<Self::Value, E>
7407            where
7408                E: de::Error,
7409            {
7410                Ok(MockSchedulerResponse { value: () })
7411            }
7412
7413            fn visit_unit<E>(self) -> Result<Self::Value, E>
7414            where
7415                E: de::Error,
7416            {
7417                Ok(MockSchedulerResponse { value: () })
7418            }
7419
7420            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
7421            where
7422                M: de::MapAccess<'de>,
7423            {
7424                let mut value = None;
7425                while let Some(key) = map.next_key::<String>()? {
7426                    if key == "value" {
7427                        if value.is_some() {
7428                            return Err(de::Error::duplicate_field("value"));
7429                        }
7430                        value = Some(map.next_value::<()>()?);
7431                    } else {
7432                        let _ = map.next_value::<de::IgnoredAny>()?;
7433                    }
7434                }
7435                value.ok_or_else(|| de::Error::missing_field("value"))?;
7436                Ok(MockSchedulerResponse { value: () })
7437            }
7438        }
7439
7440        deserializer.deserialize_any(PrimitiveWrapperVisitor)
7441    }
7442}
7443
7444impl std::ops::Deref for MockSchedulerResponse {
7445    type Target = ();
7446    fn deref(&self) -> &Self::Target { &self.value }
7447}
7448
7449impl std::ops::DerefMut for MockSchedulerResponse {
7450    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
7451}
7452
7453impl AsRef<()> for MockSchedulerResponse {
7454    fn as_ref(&self) -> &() { &self.value }
7455}
7456
7457impl From<()> for MockSchedulerResponse {
7458    fn from(value: ()) -> Self { Self { value } }
7459}
7460
7461impl From<MockSchedulerResponse> for () {
7462    fn from(wrapper: MockSchedulerResponse) -> Self { wrapper.value }
7463}
7464
7465/// Response for the `Ping` RPC method
7466///
7467/// This method returns a primitive value wrapped in a transparent struct.
7468#[derive(Debug, Clone, PartialEq, Serialize)]
7469pub struct PingResponse {
7470    /// Wrapped primitive value
7471    pub value: (),
7472}
7473
7474impl<'de> serde::Deserialize<'de> for PingResponse {
7475    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
7476    where
7477        D: serde::Deserializer<'de>,
7478    {
7479        use std::fmt;
7480
7481        use serde::de::{self, Visitor};
7482
7483        struct PrimitiveWrapperVisitor;
7484
7485        #[allow(unused_variables, clippy::needless_lifetimes)]
7486        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
7487            type Value = PingResponse;
7488
7489            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
7490                formatter.write_str("a primitive value or an object with 'value' field")
7491            }
7492
7493            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
7494            where
7495                E: de::Error,
7496            {
7497                Ok(PingResponse { value: () })
7498            }
7499
7500            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
7501            where
7502                E: de::Error,
7503            {
7504                Ok(PingResponse { value: () })
7505            }
7506
7507            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
7508            where
7509                E: de::Error,
7510            {
7511                Ok(PingResponse { value: () })
7512            }
7513
7514            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
7515            where
7516                E: de::Error,
7517            {
7518                Ok(PingResponse { value: () })
7519            }
7520
7521            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
7522            where
7523                E: de::Error,
7524            {
7525                Ok(PingResponse { value: () })
7526            }
7527
7528            fn visit_none<E>(self) -> Result<Self::Value, E>
7529            where
7530                E: de::Error,
7531            {
7532                Ok(PingResponse { value: () })
7533            }
7534
7535            fn visit_unit<E>(self) -> Result<Self::Value, E>
7536            where
7537                E: de::Error,
7538            {
7539                Ok(PingResponse { value: () })
7540            }
7541
7542            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
7543            where
7544                M: de::MapAccess<'de>,
7545            {
7546                let mut value = None;
7547                while let Some(key) = map.next_key::<String>()? {
7548                    if key == "value" {
7549                        if value.is_some() {
7550                            return Err(de::Error::duplicate_field("value"));
7551                        }
7552                        value = Some(map.next_value::<()>()?);
7553                    } else {
7554                        let _ = map.next_value::<de::IgnoredAny>()?;
7555                    }
7556                }
7557                value.ok_or_else(|| de::Error::missing_field("value"))?;
7558                Ok(PingResponse { value: () })
7559            }
7560        }
7561
7562        deserializer.deserialize_any(PrimitiveWrapperVisitor)
7563    }
7564}
7565
7566impl std::ops::Deref for PingResponse {
7567    type Target = ();
7568    fn deref(&self) -> &Self::Target { &self.value }
7569}
7570
7571impl std::ops::DerefMut for PingResponse {
7572    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
7573}
7574
7575impl AsRef<()> for PingResponse {
7576    fn as_ref(&self) -> &() { &self.value }
7577}
7578
7579impl From<()> for PingResponse {
7580    fn from(value: ()) -> Self { Self { value } }
7581}
7582
7583impl From<PingResponse> for () {
7584    fn from(wrapper: PingResponse) -> Self { wrapper.value }
7585}
7586
7587/// Response for the `PreciousBlock` RPC method
7588///
7589/// This method returns a primitive value wrapped in a transparent struct.
7590#[derive(Debug, Clone, PartialEq, Serialize)]
7591pub struct PreciousBlockResponse {
7592    /// Wrapped primitive value
7593    pub value: (),
7594}
7595
7596impl<'de> serde::Deserialize<'de> for PreciousBlockResponse {
7597    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
7598    where
7599        D: serde::Deserializer<'de>,
7600    {
7601        use std::fmt;
7602
7603        use serde::de::{self, Visitor};
7604
7605        struct PrimitiveWrapperVisitor;
7606
7607        #[allow(unused_variables, clippy::needless_lifetimes)]
7608        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
7609            type Value = PreciousBlockResponse;
7610
7611            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
7612                formatter.write_str("a primitive value or an object with 'value' field")
7613            }
7614
7615            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
7616            where
7617                E: de::Error,
7618            {
7619                Ok(PreciousBlockResponse { value: () })
7620            }
7621
7622            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
7623            where
7624                E: de::Error,
7625            {
7626                Ok(PreciousBlockResponse { value: () })
7627            }
7628
7629            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
7630            where
7631                E: de::Error,
7632            {
7633                Ok(PreciousBlockResponse { value: () })
7634            }
7635
7636            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
7637            where
7638                E: de::Error,
7639            {
7640                Ok(PreciousBlockResponse { value: () })
7641            }
7642
7643            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
7644            where
7645                E: de::Error,
7646            {
7647                Ok(PreciousBlockResponse { value: () })
7648            }
7649
7650            fn visit_none<E>(self) -> Result<Self::Value, E>
7651            where
7652                E: de::Error,
7653            {
7654                Ok(PreciousBlockResponse { value: () })
7655            }
7656
7657            fn visit_unit<E>(self) -> Result<Self::Value, E>
7658            where
7659                E: de::Error,
7660            {
7661                Ok(PreciousBlockResponse { value: () })
7662            }
7663
7664            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
7665            where
7666                M: de::MapAccess<'de>,
7667            {
7668                let mut value = None;
7669                while let Some(key) = map.next_key::<String>()? {
7670                    if key == "value" {
7671                        if value.is_some() {
7672                            return Err(de::Error::duplicate_field("value"));
7673                        }
7674                        value = Some(map.next_value::<()>()?);
7675                    } else {
7676                        let _ = map.next_value::<de::IgnoredAny>()?;
7677                    }
7678                }
7679                value.ok_or_else(|| de::Error::missing_field("value"))?;
7680                Ok(PreciousBlockResponse { value: () })
7681            }
7682        }
7683
7684        deserializer.deserialize_any(PrimitiveWrapperVisitor)
7685    }
7686}
7687
7688impl std::ops::Deref for PreciousBlockResponse {
7689    type Target = ();
7690    fn deref(&self) -> &Self::Target { &self.value }
7691}
7692
7693impl std::ops::DerefMut for PreciousBlockResponse {
7694    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
7695}
7696
7697impl AsRef<()> for PreciousBlockResponse {
7698    fn as_ref(&self) -> &() { &self.value }
7699}
7700
7701impl From<()> for PreciousBlockResponse {
7702    fn from(value: ()) -> Self { Self { value } }
7703}
7704
7705impl From<PreciousBlockResponse> for () {
7706    fn from(wrapper: PreciousBlockResponse) -> Self { wrapper.value }
7707}
7708
7709/// Response for the `PrioritiseTransaction` RPC method
7710///
7711/// This method returns a primitive value wrapped in a transparent struct.
7712#[derive(Debug, Clone, PartialEq, Serialize)]
7713pub struct PrioritiseTransactionResponse {
7714    /// Wrapped primitive value
7715    pub value: bool,
7716}
7717
7718impl<'de> serde::Deserialize<'de> for PrioritiseTransactionResponse {
7719    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
7720    where
7721        D: serde::Deserializer<'de>,
7722    {
7723        use std::fmt;
7724
7725        use serde::de::{self, Visitor};
7726
7727        struct PrimitiveWrapperVisitor;
7728
7729        #[allow(unused_variables, clippy::needless_lifetimes)]
7730        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
7731            type Value = PrioritiseTransactionResponse;
7732
7733            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
7734                formatter.write_str("a primitive value or an object with 'value' field")
7735            }
7736
7737            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
7738            where
7739                E: de::Error,
7740            {
7741                Ok(PrioritiseTransactionResponse { value: v != 0 })
7742            }
7743
7744            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
7745            where
7746                E: de::Error,
7747            {
7748                Ok(PrioritiseTransactionResponse { value: v != 0 })
7749            }
7750
7751            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
7752            where
7753                E: de::Error,
7754            {
7755                Ok(PrioritiseTransactionResponse { value: v != 0.0 })
7756            }
7757
7758            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
7759            where
7760                E: de::Error,
7761            {
7762                let value = v.parse::<bool>().map_err(de::Error::custom)?;
7763                Ok(PrioritiseTransactionResponse { value })
7764            }
7765
7766            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
7767            where
7768                E: de::Error,
7769            {
7770                Ok(PrioritiseTransactionResponse { value: v })
7771            }
7772
7773            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
7774            where
7775                M: de::MapAccess<'de>,
7776            {
7777                let mut value = None;
7778                while let Some(key) = map.next_key::<String>()? {
7779                    if key == "value" {
7780                        if value.is_some() {
7781                            return Err(de::Error::duplicate_field("value"));
7782                        }
7783                        value = Some(map.next_value()?);
7784                    } else {
7785                        let _ = map.next_value::<de::IgnoredAny>()?;
7786                    }
7787                }
7788                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
7789                Ok(PrioritiseTransactionResponse { value })
7790            }
7791        }
7792
7793        deserializer.deserialize_any(PrimitiveWrapperVisitor)
7794    }
7795}
7796
7797impl std::ops::Deref for PrioritiseTransactionResponse {
7798    type Target = bool;
7799    fn deref(&self) -> &Self::Target { &self.value }
7800}
7801
7802impl std::ops::DerefMut for PrioritiseTransactionResponse {
7803    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
7804}
7805
7806impl AsRef<bool> for PrioritiseTransactionResponse {
7807    fn as_ref(&self) -> &bool { &self.value }
7808}
7809
7810impl From<bool> for PrioritiseTransactionResponse {
7811    fn from(value: bool) -> Self { Self { value } }
7812}
7813
7814impl From<PrioritiseTransactionResponse> for bool {
7815    fn from(wrapper: PrioritiseTransactionResponse) -> Self { wrapper.value }
7816}
7817
7818/// Response for the `PruneBlockchain` RPC method
7819///
7820/// This method returns a primitive value wrapped in a transparent struct.
7821#[derive(Debug, Clone, PartialEq, Serialize)]
7822pub struct PruneBlockchainResponse {
7823    /// Wrapped primitive value
7824    pub value: u64,
7825}
7826
7827impl<'de> serde::Deserialize<'de> for PruneBlockchainResponse {
7828    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
7829    where
7830        D: serde::Deserializer<'de>,
7831    {
7832        use std::fmt;
7833
7834        use serde::de::{self, Visitor};
7835
7836        struct PrimitiveWrapperVisitor;
7837
7838        #[allow(unused_variables, clippy::needless_lifetimes)]
7839        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
7840            type Value = PruneBlockchainResponse;
7841
7842            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
7843                formatter.write_str("a primitive value or an object with 'value' field")
7844            }
7845
7846            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
7847            where
7848                E: de::Error,
7849            {
7850                Ok(PruneBlockchainResponse { value: v })
7851            }
7852
7853            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
7854            where
7855                E: de::Error,
7856            {
7857                Ok(PruneBlockchainResponse { value: v as u64 })
7858            }
7859
7860            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
7861            where
7862                E: de::Error,
7863            {
7864                Ok(PruneBlockchainResponse { value: v as u64 })
7865            }
7866
7867            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
7868            where
7869                E: de::Error,
7870            {
7871                let value = v.parse::<u64>().map_err(de::Error::custom)?;
7872                Ok(PruneBlockchainResponse { value })
7873            }
7874
7875            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
7876            where
7877                E: de::Error,
7878            {
7879                Ok(PruneBlockchainResponse { value: v as u64 })
7880            }
7881
7882            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
7883            where
7884                M: de::MapAccess<'de>,
7885            {
7886                let mut value = None;
7887                while let Some(key) = map.next_key::<String>()? {
7888                    if key == "value" {
7889                        if value.is_some() {
7890                            return Err(de::Error::duplicate_field("value"));
7891                        }
7892                        value = Some(map.next_value()?);
7893                    } else {
7894                        let _ = map.next_value::<de::IgnoredAny>()?;
7895                    }
7896                }
7897                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
7898                Ok(PruneBlockchainResponse { value })
7899            }
7900        }
7901
7902        deserializer.deserialize_any(PrimitiveWrapperVisitor)
7903    }
7904}
7905
7906impl std::ops::Deref for PruneBlockchainResponse {
7907    type Target = u64;
7908    fn deref(&self) -> &Self::Target { &self.value }
7909}
7910
7911impl std::ops::DerefMut for PruneBlockchainResponse {
7912    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
7913}
7914
7915impl AsRef<u64> for PruneBlockchainResponse {
7916    fn as_ref(&self) -> &u64 { &self.value }
7917}
7918
7919impl From<u64> for PruneBlockchainResponse {
7920    fn from(value: u64) -> Self { Self { value } }
7921}
7922
7923impl From<PruneBlockchainResponse> for u64 {
7924    fn from(wrapper: PruneBlockchainResponse) -> Self { wrapper.value }
7925}
7926
7927/// Response for the `PsbtBumpFee` RPC method
7928#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
7929#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
7930pub struct PsbtBumpFeeResponse {
7931    /// The base64-encoded unsigned PSBT of the new transaction.
7932    pub psbt: String,
7933    /// The fee of the replaced transaction.
7934    #[serde(rename = "origfee")]
7935    #[serde(deserialize_with = "amount_from_btc_float")]
7936    pub orig_fee: bitcoin::Amount,
7937    /// The fee of the new transaction.
7938    #[serde(deserialize_with = "amount_from_btc_float")]
7939    pub fee: bitcoin::Amount,
7940    /// Errors encountered during processing (may be empty).
7941    pub errors: Vec<String>,
7942}
7943
7944/// Response for the `ReconsiderBlock` RPC method
7945///
7946/// This method returns a primitive value wrapped in a transparent struct.
7947#[derive(Debug, Clone, PartialEq, Serialize)]
7948pub struct ReconsiderBlockResponse {
7949    /// Wrapped primitive value
7950    pub value: (),
7951}
7952
7953impl<'de> serde::Deserialize<'de> for ReconsiderBlockResponse {
7954    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
7955    where
7956        D: serde::Deserializer<'de>,
7957    {
7958        use std::fmt;
7959
7960        use serde::de::{self, Visitor};
7961
7962        struct PrimitiveWrapperVisitor;
7963
7964        #[allow(unused_variables, clippy::needless_lifetimes)]
7965        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
7966            type Value = ReconsiderBlockResponse;
7967
7968            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
7969                formatter.write_str("a primitive value or an object with 'value' field")
7970            }
7971
7972            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
7973            where
7974                E: de::Error,
7975            {
7976                Ok(ReconsiderBlockResponse { value: () })
7977            }
7978
7979            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
7980            where
7981                E: de::Error,
7982            {
7983                Ok(ReconsiderBlockResponse { value: () })
7984            }
7985
7986            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
7987            where
7988                E: de::Error,
7989            {
7990                Ok(ReconsiderBlockResponse { value: () })
7991            }
7992
7993            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
7994            where
7995                E: de::Error,
7996            {
7997                Ok(ReconsiderBlockResponse { value: () })
7998            }
7999
8000            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
8001            where
8002                E: de::Error,
8003            {
8004                Ok(ReconsiderBlockResponse { value: () })
8005            }
8006
8007            fn visit_none<E>(self) -> Result<Self::Value, E>
8008            where
8009                E: de::Error,
8010            {
8011                Ok(ReconsiderBlockResponse { value: () })
8012            }
8013
8014            fn visit_unit<E>(self) -> Result<Self::Value, E>
8015            where
8016                E: de::Error,
8017            {
8018                Ok(ReconsiderBlockResponse { value: () })
8019            }
8020
8021            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
8022            where
8023                M: de::MapAccess<'de>,
8024            {
8025                let mut value = None;
8026                while let Some(key) = map.next_key::<String>()? {
8027                    if key == "value" {
8028                        if value.is_some() {
8029                            return Err(de::Error::duplicate_field("value"));
8030                        }
8031                        value = Some(map.next_value::<()>()?);
8032                    } else {
8033                        let _ = map.next_value::<de::IgnoredAny>()?;
8034                    }
8035                }
8036                value.ok_or_else(|| de::Error::missing_field("value"))?;
8037                Ok(ReconsiderBlockResponse { value: () })
8038            }
8039        }
8040
8041        deserializer.deserialize_any(PrimitiveWrapperVisitor)
8042    }
8043}
8044
8045impl std::ops::Deref for ReconsiderBlockResponse {
8046    type Target = ();
8047    fn deref(&self) -> &Self::Target { &self.value }
8048}
8049
8050impl std::ops::DerefMut for ReconsiderBlockResponse {
8051    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
8052}
8053
8054impl AsRef<()> for ReconsiderBlockResponse {
8055    fn as_ref(&self) -> &() { &self.value }
8056}
8057
8058impl From<()> for ReconsiderBlockResponse {
8059    fn from(value: ()) -> Self { Self { value } }
8060}
8061
8062impl From<ReconsiderBlockResponse> for () {
8063    fn from(wrapper: ReconsiderBlockResponse) -> Self { wrapper.value }
8064}
8065
8066/// Response for the `RemovePrunedFunds` RPC method
8067///
8068/// This method returns a primitive value wrapped in a transparent struct.
8069#[derive(Debug, Clone, PartialEq, Serialize)]
8070pub struct RemovePrunedFundsResponse {
8071    /// Wrapped primitive value
8072    pub value: (),
8073}
8074
8075impl<'de> serde::Deserialize<'de> for RemovePrunedFundsResponse {
8076    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
8077    where
8078        D: serde::Deserializer<'de>,
8079    {
8080        use std::fmt;
8081
8082        use serde::de::{self, Visitor};
8083
8084        struct PrimitiveWrapperVisitor;
8085
8086        #[allow(unused_variables, clippy::needless_lifetimes)]
8087        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
8088            type Value = RemovePrunedFundsResponse;
8089
8090            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
8091                formatter.write_str("a primitive value or an object with 'value' field")
8092            }
8093
8094            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
8095            where
8096                E: de::Error,
8097            {
8098                Ok(RemovePrunedFundsResponse { value: () })
8099            }
8100
8101            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
8102            where
8103                E: de::Error,
8104            {
8105                Ok(RemovePrunedFundsResponse { value: () })
8106            }
8107
8108            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
8109            where
8110                E: de::Error,
8111            {
8112                Ok(RemovePrunedFundsResponse { value: () })
8113            }
8114
8115            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
8116            where
8117                E: de::Error,
8118            {
8119                Ok(RemovePrunedFundsResponse { value: () })
8120            }
8121
8122            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
8123            where
8124                E: de::Error,
8125            {
8126                Ok(RemovePrunedFundsResponse { value: () })
8127            }
8128
8129            fn visit_none<E>(self) -> Result<Self::Value, E>
8130            where
8131                E: de::Error,
8132            {
8133                Ok(RemovePrunedFundsResponse { value: () })
8134            }
8135
8136            fn visit_unit<E>(self) -> Result<Self::Value, E>
8137            where
8138                E: de::Error,
8139            {
8140                Ok(RemovePrunedFundsResponse { value: () })
8141            }
8142
8143            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
8144            where
8145                M: de::MapAccess<'de>,
8146            {
8147                let mut value = None;
8148                while let Some(key) = map.next_key::<String>()? {
8149                    if key == "value" {
8150                        if value.is_some() {
8151                            return Err(de::Error::duplicate_field("value"));
8152                        }
8153                        value = Some(map.next_value::<()>()?);
8154                    } else {
8155                        let _ = map.next_value::<de::IgnoredAny>()?;
8156                    }
8157                }
8158                value.ok_or_else(|| de::Error::missing_field("value"))?;
8159                Ok(RemovePrunedFundsResponse { value: () })
8160            }
8161        }
8162
8163        deserializer.deserialize_any(PrimitiveWrapperVisitor)
8164    }
8165}
8166
8167impl std::ops::Deref for RemovePrunedFundsResponse {
8168    type Target = ();
8169    fn deref(&self) -> &Self::Target { &self.value }
8170}
8171
8172impl std::ops::DerefMut for RemovePrunedFundsResponse {
8173    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
8174}
8175
8176impl AsRef<()> for RemovePrunedFundsResponse {
8177    fn as_ref(&self) -> &() { &self.value }
8178}
8179
8180impl From<()> for RemovePrunedFundsResponse {
8181    fn from(value: ()) -> Self { Self { value } }
8182}
8183
8184impl From<RemovePrunedFundsResponse> for () {
8185    fn from(wrapper: RemovePrunedFundsResponse) -> Self { wrapper.value }
8186}
8187
8188/// Response for the `RescanBlockchain` RPC method
8189#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
8190#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
8191pub struct RescanBlockchainResponse {
8192    /// The block height where the rescan started (the requested height or 0)
8193    pub start_height: u64,
8194    /// The height of the last rescanned block. May be null in rare cases if there was a reorg and the call didn't scan any blocks because they were already scanned in the background.
8195    pub stop_height: u64,
8196}
8197
8198/// Response for the `RestoreWallet` RPC method
8199#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
8200#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
8201pub struct RestoreWalletResponse {
8202    /// The wallet name if restored successfully.
8203    pub name: String,
8204    /// Warning messages, if any, related to restoring and loading the wallet.
8205    pub warnings: Option<Vec<String>>,
8206}
8207
8208/// Response for the `SaveMempool` RPC method
8209#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
8210#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
8211pub struct SaveMempoolResponse {
8212    /// the directory and file where the mempool was saved
8213    pub filename: String,
8214}
8215
8216/// Response for the `ScanBlocks` RPC method
8217#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
8218#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
8219pub struct ScanBlocksResponse {
8220    pub field_0_1: (),
8221    /// The height we started the scan from
8222    pub from_height: u64,
8223    /// The height we ended the scan at
8224    pub to_height: u64,
8225    /// Blocks that may have matched a scanobject.
8226    pub relevant_blocks: Vec<String>,
8227    /// true if the scan process was not aborted
8228    pub completed: bool,
8229    /// Approximate percent complete
8230    pub progress: u64,
8231    /// Height of the block currently being scanned
8232    pub current_height: u64,
8233    /// True if scan will be aborted (not necessarily before this RPC returns), or false if there is no scan to abort
8234    pub success: bool,
8235}
8236
8237/// Response for the `ScanTxOutSet` RPC method
8238#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
8239#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
8240pub struct ScanTxOutSetResponse {
8241    /// Whether the scan was completed
8242    pub success: bool,
8243    /// The number of unspent transaction outputs scanned
8244    pub txouts: u64,
8245    /// The block height at which the scan was done
8246    pub height: u64,
8247    /// The hash of the block at the tip of the chain
8248    #[serde(rename = "bestblock")]
8249    pub best_block: String,
8250    pub unspents: Vec<ScanTxOutSetUnspents>,
8251    /// The total amount of all found unspent outputs in BTC
8252    #[serde(deserialize_with = "amount_from_btc_float")]
8253    pub total_amount: bitcoin::Amount,
8254    /// True if scan will be aborted (not necessarily before this RPC returns), or false if there is no scan to abort
8255    pub success_1: bool,
8256    /// Approximate percent complete
8257    pub progress: u64,
8258    pub field_3_1: (),
8259}
8260
8261/// Response for the `Send` RPC method
8262#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
8263#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
8264pub struct SendResponse {
8265    /// If the transaction has a complete set of signatures
8266    pub complete: bool,
8267    /// The transaction id for the send. Only 1 transaction is created regardless of the number of addresses.
8268    pub txid: Option<bitcoin::Txid>,
8269    /// If add_to_wallet is false, the hex-encoded raw transaction with signature(s)
8270    pub hex: Option<String>,
8271    /// If more signatures are needed, or if add_to_wallet is false, the base64-encoded (partially) signed transaction
8272    pub psbt: Option<String>,
8273}
8274
8275/// Response for the `SendAll` RPC method
8276#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
8277#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
8278pub struct SendAllResponse {
8279    /// If the transaction has a complete set of signatures
8280    pub complete: bool,
8281    /// The transaction id for the send. Only 1 transaction is created regardless of the number of addresses.
8282    pub txid: Option<bitcoin::Txid>,
8283    /// If add_to_wallet is false, the hex-encoded raw transaction with signature(s)
8284    pub hex: Option<String>,
8285    /// If more signatures are needed, or if add_to_wallet is false, the base64-encoded (partially) signed transaction
8286    pub psbt: Option<String>,
8287}
8288
8289/// Response for the `SendMany` RPC method
8290#[derive(Debug, Clone, PartialEq, Serialize)]
8291pub struct SendManyResponse {
8292    /// The transaction id for the send. Only 1 transaction is created regardless of
8293    /// the number of addresses.
8294    pub txid: Option<bitcoin::Txid>,
8295    /// The transaction fee reason.
8296    pub fee_reason: Option<String>,
8297}
8298impl<'de> serde::Deserialize<'de> for SendManyResponse {
8299    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
8300    where
8301        D: serde::Deserializer<'de>,
8302    {
8303        use std::fmt;
8304
8305        use serde::de::{self, Visitor};
8306
8307        struct ConditionalResponseVisitor;
8308
8309        #[allow(clippy::needless_lifetimes)]
8310        impl<'de> Visitor<'de> for ConditionalResponseVisitor {
8311            type Value = SendManyResponse;
8312
8313            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
8314                formatter.write_str("string or object")
8315            }
8316
8317            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
8318            where
8319                E: de::Error,
8320            {
8321                let txid = bitcoin::Txid::from_str(v).map_err(de::Error::custom)?;
8322                Ok(SendManyResponse { txid: Some(txid), fee_reason: None })
8323            }
8324
8325            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
8326            where
8327                M: de::MapAccess<'de>,
8328            {
8329                let mut txid = None;
8330                let mut fee_reason = None;
8331                while let Some(key) = map.next_key::<String>()? {
8332                    if key == "txid" {
8333                        if txid.is_some() {
8334                            return Err(de::Error::duplicate_field("txid"));
8335                        }
8336                        txid = Some(map.next_value::<bitcoin::Txid>()?);
8337                    }
8338                    if key == "fee_reason" {
8339                        if fee_reason.is_some() {
8340                            return Err(de::Error::duplicate_field("fee_reason"));
8341                        }
8342                        fee_reason = Some(map.next_value::<String>()?);
8343                    } else {
8344                        let _ = map.next_value::<de::IgnoredAny>()?;
8345                    }
8346                }
8347                Ok(SendManyResponse { txid, fee_reason })
8348            }
8349        }
8350
8351        deserializer.deserialize_any(ConditionalResponseVisitor)
8352    }
8353}
8354
8355/// Response for the `SendMsgToPeer` RPC method
8356///
8357/// This method returns no meaningful data.
8358#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
8359pub struct SendMsgToPeerResponse;
8360
8361/// Response for the `SendRawTransaction` RPC method
8362///
8363/// This method returns a primitive value wrapped in a transparent struct.
8364#[derive(Debug, Clone, PartialEq, Serialize)]
8365pub struct SendRawTransactionResponse {
8366    /// Wrapped primitive value
8367    pub value: String,
8368}
8369
8370impl<'de> serde::Deserialize<'de> for SendRawTransactionResponse {
8371    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
8372    where
8373        D: serde::Deserializer<'de>,
8374    {
8375        use std::fmt;
8376
8377        use serde::de::{self, Visitor};
8378
8379        struct PrimitiveWrapperVisitor;
8380
8381        #[allow(unused_variables, clippy::needless_lifetimes)]
8382        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
8383            type Value = SendRawTransactionResponse;
8384
8385            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
8386                formatter.write_str("a primitive value or an object with 'value' field")
8387            }
8388
8389            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
8390            where
8391                E: de::Error,
8392            {
8393                Ok(SendRawTransactionResponse { value: v.to_string() })
8394            }
8395
8396            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
8397            where
8398                E: de::Error,
8399            {
8400                Ok(SendRawTransactionResponse { value: v.to_string() })
8401            }
8402
8403            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
8404            where
8405                E: de::Error,
8406            {
8407                Ok(SendRawTransactionResponse { value: v.to_string() })
8408            }
8409
8410            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
8411            where
8412                E: de::Error,
8413            {
8414                Ok(SendRawTransactionResponse { value: v.to_string() })
8415            }
8416
8417            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
8418            where
8419                E: de::Error,
8420            {
8421                Ok(SendRawTransactionResponse { value: v.to_string() })
8422            }
8423
8424            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
8425            where
8426                M: de::MapAccess<'de>,
8427            {
8428                let mut value = None;
8429                while let Some(key) = map.next_key::<String>()? {
8430                    if key == "value" {
8431                        if value.is_some() {
8432                            return Err(de::Error::duplicate_field("value"));
8433                        }
8434                        value = Some(map.next_value()?);
8435                    } else {
8436                        let _ = map.next_value::<de::IgnoredAny>()?;
8437                    }
8438                }
8439                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
8440                Ok(SendRawTransactionResponse { value })
8441            }
8442        }
8443
8444        deserializer.deserialize_any(PrimitiveWrapperVisitor)
8445    }
8446}
8447
8448impl std::ops::Deref for SendRawTransactionResponse {
8449    type Target = String;
8450    fn deref(&self) -> &Self::Target { &self.value }
8451}
8452
8453impl std::ops::DerefMut for SendRawTransactionResponse {
8454    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
8455}
8456
8457impl AsRef<String> for SendRawTransactionResponse {
8458    fn as_ref(&self) -> &String { &self.value }
8459}
8460
8461impl From<String> for SendRawTransactionResponse {
8462    fn from(value: String) -> Self { Self { value } }
8463}
8464
8465impl From<SendRawTransactionResponse> for String {
8466    fn from(wrapper: SendRawTransactionResponse) -> Self { wrapper.value }
8467}
8468
8469/// Response for the `SendToAddress` RPC method
8470#[derive(Debug, Clone, PartialEq, Serialize)]
8471pub struct SendToAddressResponse {
8472    /// The transaction id.
8473    pub txid: Option<bitcoin::Txid>,
8474    /// The transaction fee reason.
8475    pub fee_reason: Option<String>,
8476}
8477impl<'de> serde::Deserialize<'de> for SendToAddressResponse {
8478    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
8479    where
8480        D: serde::Deserializer<'de>,
8481    {
8482        use std::fmt;
8483
8484        use serde::de::{self, Visitor};
8485
8486        struct ConditionalResponseVisitor;
8487
8488        #[allow(clippy::needless_lifetimes)]
8489        impl<'de> Visitor<'de> for ConditionalResponseVisitor {
8490            type Value = SendToAddressResponse;
8491
8492            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
8493                formatter.write_str("string or object")
8494            }
8495
8496            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
8497            where
8498                E: de::Error,
8499            {
8500                let txid = bitcoin::Txid::from_str(v).map_err(de::Error::custom)?;
8501                Ok(SendToAddressResponse { txid: Some(txid), fee_reason: None })
8502            }
8503
8504            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
8505            where
8506                M: de::MapAccess<'de>,
8507            {
8508                let mut txid = None;
8509                let mut fee_reason = None;
8510                while let Some(key) = map.next_key::<String>()? {
8511                    if key == "txid" {
8512                        if txid.is_some() {
8513                            return Err(de::Error::duplicate_field("txid"));
8514                        }
8515                        txid = Some(map.next_value::<bitcoin::Txid>()?);
8516                    }
8517                    if key == "fee_reason" {
8518                        if fee_reason.is_some() {
8519                            return Err(de::Error::duplicate_field("fee_reason"));
8520                        }
8521                        fee_reason = Some(map.next_value::<String>()?);
8522                    } else {
8523                        let _ = map.next_value::<de::IgnoredAny>()?;
8524                    }
8525                }
8526                Ok(SendToAddressResponse { txid, fee_reason })
8527            }
8528        }
8529
8530        deserializer.deserialize_any(ConditionalResponseVisitor)
8531    }
8532}
8533
8534/// Response for the `SetBan` RPC method
8535///
8536/// This method returns a primitive value wrapped in a transparent struct.
8537#[derive(Debug, Clone, PartialEq, Serialize)]
8538pub struct SetBanResponse {
8539    /// Wrapped primitive value
8540    pub value: (),
8541}
8542
8543impl<'de> serde::Deserialize<'de> for SetBanResponse {
8544    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
8545    where
8546        D: serde::Deserializer<'de>,
8547    {
8548        use std::fmt;
8549
8550        use serde::de::{self, Visitor};
8551
8552        struct PrimitiveWrapperVisitor;
8553
8554        #[allow(unused_variables, clippy::needless_lifetimes)]
8555        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
8556            type Value = SetBanResponse;
8557
8558            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
8559                formatter.write_str("a primitive value or an object with 'value' field")
8560            }
8561
8562            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
8563            where
8564                E: de::Error,
8565            {
8566                Ok(SetBanResponse { value: () })
8567            }
8568
8569            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
8570            where
8571                E: de::Error,
8572            {
8573                Ok(SetBanResponse { value: () })
8574            }
8575
8576            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
8577            where
8578                E: de::Error,
8579            {
8580                Ok(SetBanResponse { value: () })
8581            }
8582
8583            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
8584            where
8585                E: de::Error,
8586            {
8587                Ok(SetBanResponse { value: () })
8588            }
8589
8590            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
8591            where
8592                E: de::Error,
8593            {
8594                Ok(SetBanResponse { value: () })
8595            }
8596
8597            fn visit_none<E>(self) -> Result<Self::Value, E>
8598            where
8599                E: de::Error,
8600            {
8601                Ok(SetBanResponse { value: () })
8602            }
8603
8604            fn visit_unit<E>(self) -> Result<Self::Value, E>
8605            where
8606                E: de::Error,
8607            {
8608                Ok(SetBanResponse { value: () })
8609            }
8610
8611            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
8612            where
8613                M: de::MapAccess<'de>,
8614            {
8615                let mut value = None;
8616                while let Some(key) = map.next_key::<String>()? {
8617                    if key == "value" {
8618                        if value.is_some() {
8619                            return Err(de::Error::duplicate_field("value"));
8620                        }
8621                        value = Some(map.next_value::<()>()?);
8622                    } else {
8623                        let _ = map.next_value::<de::IgnoredAny>()?;
8624                    }
8625                }
8626                value.ok_or_else(|| de::Error::missing_field("value"))?;
8627                Ok(SetBanResponse { value: () })
8628            }
8629        }
8630
8631        deserializer.deserialize_any(PrimitiveWrapperVisitor)
8632    }
8633}
8634
8635impl std::ops::Deref for SetBanResponse {
8636    type Target = ();
8637    fn deref(&self) -> &Self::Target { &self.value }
8638}
8639
8640impl std::ops::DerefMut for SetBanResponse {
8641    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
8642}
8643
8644impl AsRef<()> for SetBanResponse {
8645    fn as_ref(&self) -> &() { &self.value }
8646}
8647
8648impl From<()> for SetBanResponse {
8649    fn from(value: ()) -> Self { Self { value } }
8650}
8651
8652impl From<SetBanResponse> for () {
8653    fn from(wrapper: SetBanResponse) -> Self { wrapper.value }
8654}
8655
8656/// Response for the `SetLabel` RPC method
8657///
8658/// This method returns a primitive value wrapped in a transparent struct.
8659#[derive(Debug, Clone, PartialEq, Serialize)]
8660pub struct SetLabelResponse {
8661    /// Wrapped primitive value
8662    pub value: (),
8663}
8664
8665impl<'de> serde::Deserialize<'de> for SetLabelResponse {
8666    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
8667    where
8668        D: serde::Deserializer<'de>,
8669    {
8670        use std::fmt;
8671
8672        use serde::de::{self, Visitor};
8673
8674        struct PrimitiveWrapperVisitor;
8675
8676        #[allow(unused_variables, clippy::needless_lifetimes)]
8677        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
8678            type Value = SetLabelResponse;
8679
8680            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
8681                formatter.write_str("a primitive value or an object with 'value' field")
8682            }
8683
8684            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
8685            where
8686                E: de::Error,
8687            {
8688                Ok(SetLabelResponse { value: () })
8689            }
8690
8691            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
8692            where
8693                E: de::Error,
8694            {
8695                Ok(SetLabelResponse { value: () })
8696            }
8697
8698            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
8699            where
8700                E: de::Error,
8701            {
8702                Ok(SetLabelResponse { value: () })
8703            }
8704
8705            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
8706            where
8707                E: de::Error,
8708            {
8709                Ok(SetLabelResponse { value: () })
8710            }
8711
8712            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
8713            where
8714                E: de::Error,
8715            {
8716                Ok(SetLabelResponse { value: () })
8717            }
8718
8719            fn visit_none<E>(self) -> Result<Self::Value, E>
8720            where
8721                E: de::Error,
8722            {
8723                Ok(SetLabelResponse { value: () })
8724            }
8725
8726            fn visit_unit<E>(self) -> Result<Self::Value, E>
8727            where
8728                E: de::Error,
8729            {
8730                Ok(SetLabelResponse { value: () })
8731            }
8732
8733            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
8734            where
8735                M: de::MapAccess<'de>,
8736            {
8737                let mut value = None;
8738                while let Some(key) = map.next_key::<String>()? {
8739                    if key == "value" {
8740                        if value.is_some() {
8741                            return Err(de::Error::duplicate_field("value"));
8742                        }
8743                        value = Some(map.next_value::<()>()?);
8744                    } else {
8745                        let _ = map.next_value::<de::IgnoredAny>()?;
8746                    }
8747                }
8748                value.ok_or_else(|| de::Error::missing_field("value"))?;
8749                Ok(SetLabelResponse { value: () })
8750            }
8751        }
8752
8753        deserializer.deserialize_any(PrimitiveWrapperVisitor)
8754    }
8755}
8756
8757impl std::ops::Deref for SetLabelResponse {
8758    type Target = ();
8759    fn deref(&self) -> &Self::Target { &self.value }
8760}
8761
8762impl std::ops::DerefMut for SetLabelResponse {
8763    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
8764}
8765
8766impl AsRef<()> for SetLabelResponse {
8767    fn as_ref(&self) -> &() { &self.value }
8768}
8769
8770impl From<()> for SetLabelResponse {
8771    fn from(value: ()) -> Self { Self { value } }
8772}
8773
8774impl From<SetLabelResponse> for () {
8775    fn from(wrapper: SetLabelResponse) -> Self { wrapper.value }
8776}
8777
8778/// Response for the `SetMockTime` RPC method
8779///
8780/// This method returns a primitive value wrapped in a transparent struct.
8781#[derive(Debug, Clone, PartialEq, Serialize)]
8782pub struct SetMockTimeResponse {
8783    /// Wrapped primitive value
8784    pub value: (),
8785}
8786
8787impl<'de> serde::Deserialize<'de> for SetMockTimeResponse {
8788    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
8789    where
8790        D: serde::Deserializer<'de>,
8791    {
8792        use std::fmt;
8793
8794        use serde::de::{self, Visitor};
8795
8796        struct PrimitiveWrapperVisitor;
8797
8798        #[allow(unused_variables, clippy::needless_lifetimes)]
8799        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
8800            type Value = SetMockTimeResponse;
8801
8802            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
8803                formatter.write_str("a primitive value or an object with 'value' field")
8804            }
8805
8806            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
8807            where
8808                E: de::Error,
8809            {
8810                Ok(SetMockTimeResponse { value: () })
8811            }
8812
8813            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
8814            where
8815                E: de::Error,
8816            {
8817                Ok(SetMockTimeResponse { value: () })
8818            }
8819
8820            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
8821            where
8822                E: de::Error,
8823            {
8824                Ok(SetMockTimeResponse { value: () })
8825            }
8826
8827            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
8828            where
8829                E: de::Error,
8830            {
8831                Ok(SetMockTimeResponse { value: () })
8832            }
8833
8834            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
8835            where
8836                E: de::Error,
8837            {
8838                Ok(SetMockTimeResponse { value: () })
8839            }
8840
8841            fn visit_none<E>(self) -> Result<Self::Value, E>
8842            where
8843                E: de::Error,
8844            {
8845                Ok(SetMockTimeResponse { value: () })
8846            }
8847
8848            fn visit_unit<E>(self) -> Result<Self::Value, E>
8849            where
8850                E: de::Error,
8851            {
8852                Ok(SetMockTimeResponse { value: () })
8853            }
8854
8855            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
8856            where
8857                M: de::MapAccess<'de>,
8858            {
8859                let mut value = None;
8860                while let Some(key) = map.next_key::<String>()? {
8861                    if key == "value" {
8862                        if value.is_some() {
8863                            return Err(de::Error::duplicate_field("value"));
8864                        }
8865                        value = Some(map.next_value::<()>()?);
8866                    } else {
8867                        let _ = map.next_value::<de::IgnoredAny>()?;
8868                    }
8869                }
8870                value.ok_or_else(|| de::Error::missing_field("value"))?;
8871                Ok(SetMockTimeResponse { value: () })
8872            }
8873        }
8874
8875        deserializer.deserialize_any(PrimitiveWrapperVisitor)
8876    }
8877}
8878
8879impl std::ops::Deref for SetMockTimeResponse {
8880    type Target = ();
8881    fn deref(&self) -> &Self::Target { &self.value }
8882}
8883
8884impl std::ops::DerefMut for SetMockTimeResponse {
8885    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
8886}
8887
8888impl AsRef<()> for SetMockTimeResponse {
8889    fn as_ref(&self) -> &() { &self.value }
8890}
8891
8892impl From<()> for SetMockTimeResponse {
8893    fn from(value: ()) -> Self { Self { value } }
8894}
8895
8896impl From<SetMockTimeResponse> for () {
8897    fn from(wrapper: SetMockTimeResponse) -> Self { wrapper.value }
8898}
8899
8900/// Response for the `SetNetworkActive` RPC method
8901///
8902/// This method returns a primitive value wrapped in a transparent struct.
8903#[derive(Debug, Clone, PartialEq, Serialize)]
8904pub struct SetNetworkActiveResponse {
8905    /// Wrapped primitive value
8906    pub value: bool,
8907}
8908
8909impl<'de> serde::Deserialize<'de> for SetNetworkActiveResponse {
8910    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
8911    where
8912        D: serde::Deserializer<'de>,
8913    {
8914        use std::fmt;
8915
8916        use serde::de::{self, Visitor};
8917
8918        struct PrimitiveWrapperVisitor;
8919
8920        #[allow(unused_variables, clippy::needless_lifetimes)]
8921        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
8922            type Value = SetNetworkActiveResponse;
8923
8924            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
8925                formatter.write_str("a primitive value or an object with 'value' field")
8926            }
8927
8928            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
8929            where
8930                E: de::Error,
8931            {
8932                Ok(SetNetworkActiveResponse { value: v != 0 })
8933            }
8934
8935            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
8936            where
8937                E: de::Error,
8938            {
8939                Ok(SetNetworkActiveResponse { value: v != 0 })
8940            }
8941
8942            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
8943            where
8944                E: de::Error,
8945            {
8946                Ok(SetNetworkActiveResponse { value: v != 0.0 })
8947            }
8948
8949            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
8950            where
8951                E: de::Error,
8952            {
8953                let value = v.parse::<bool>().map_err(de::Error::custom)?;
8954                Ok(SetNetworkActiveResponse { value })
8955            }
8956
8957            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
8958            where
8959                E: de::Error,
8960            {
8961                Ok(SetNetworkActiveResponse { value: v })
8962            }
8963
8964            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
8965            where
8966                M: de::MapAccess<'de>,
8967            {
8968                let mut value = None;
8969                while let Some(key) = map.next_key::<String>()? {
8970                    if key == "value" {
8971                        if value.is_some() {
8972                            return Err(de::Error::duplicate_field("value"));
8973                        }
8974                        value = Some(map.next_value()?);
8975                    } else {
8976                        let _ = map.next_value::<de::IgnoredAny>()?;
8977                    }
8978                }
8979                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
8980                Ok(SetNetworkActiveResponse { value })
8981            }
8982        }
8983
8984        deserializer.deserialize_any(PrimitiveWrapperVisitor)
8985    }
8986}
8987
8988impl std::ops::Deref for SetNetworkActiveResponse {
8989    type Target = bool;
8990    fn deref(&self) -> &Self::Target { &self.value }
8991}
8992
8993impl std::ops::DerefMut for SetNetworkActiveResponse {
8994    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
8995}
8996
8997impl AsRef<bool> for SetNetworkActiveResponse {
8998    fn as_ref(&self) -> &bool { &self.value }
8999}
9000
9001impl From<bool> for SetNetworkActiveResponse {
9002    fn from(value: bool) -> Self { Self { value } }
9003}
9004
9005impl From<SetNetworkActiveResponse> for bool {
9006    fn from(wrapper: SetNetworkActiveResponse) -> Self { wrapper.value }
9007}
9008
9009/// Response for the `SetWalletFlag` RPC method
9010#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
9011#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
9012pub struct SetWalletFlagResponse {
9013    /// The name of the flag that was modified
9014    pub flag_name: String,
9015    /// The new state of the flag
9016    pub flag_state: bool,
9017    /// Any warnings associated with the change
9018    pub warnings: Option<String>,
9019}
9020
9021/// Response for the `SignMessage` RPC method
9022///
9023/// This method returns a primitive value wrapped in a transparent struct.
9024#[derive(Debug, Clone, PartialEq, Serialize)]
9025pub struct SignMessageResponse {
9026    /// Wrapped primitive value
9027    pub value: String,
9028}
9029
9030impl<'de> serde::Deserialize<'de> for SignMessageResponse {
9031    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
9032    where
9033        D: serde::Deserializer<'de>,
9034    {
9035        use std::fmt;
9036
9037        use serde::de::{self, Visitor};
9038
9039        struct PrimitiveWrapperVisitor;
9040
9041        #[allow(unused_variables, clippy::needless_lifetimes)]
9042        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
9043            type Value = SignMessageResponse;
9044
9045            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
9046                formatter.write_str("a primitive value or an object with 'value' field")
9047            }
9048
9049            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
9050            where
9051                E: de::Error,
9052            {
9053                Ok(SignMessageResponse { value: v.to_string() })
9054            }
9055
9056            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
9057            where
9058                E: de::Error,
9059            {
9060                Ok(SignMessageResponse { value: v.to_string() })
9061            }
9062
9063            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
9064            where
9065                E: de::Error,
9066            {
9067                Ok(SignMessageResponse { value: v.to_string() })
9068            }
9069
9070            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
9071            where
9072                E: de::Error,
9073            {
9074                Ok(SignMessageResponse { value: v.to_string() })
9075            }
9076
9077            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
9078            where
9079                E: de::Error,
9080            {
9081                Ok(SignMessageResponse { value: v.to_string() })
9082            }
9083
9084            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
9085            where
9086                M: de::MapAccess<'de>,
9087            {
9088                let mut value = None;
9089                while let Some(key) = map.next_key::<String>()? {
9090                    if key == "value" {
9091                        if value.is_some() {
9092                            return Err(de::Error::duplicate_field("value"));
9093                        }
9094                        value = Some(map.next_value()?);
9095                    } else {
9096                        let _ = map.next_value::<de::IgnoredAny>()?;
9097                    }
9098                }
9099                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
9100                Ok(SignMessageResponse { value })
9101            }
9102        }
9103
9104        deserializer.deserialize_any(PrimitiveWrapperVisitor)
9105    }
9106}
9107
9108impl std::ops::Deref for SignMessageResponse {
9109    type Target = String;
9110    fn deref(&self) -> &Self::Target { &self.value }
9111}
9112
9113impl std::ops::DerefMut for SignMessageResponse {
9114    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
9115}
9116
9117impl AsRef<String> for SignMessageResponse {
9118    fn as_ref(&self) -> &String { &self.value }
9119}
9120
9121impl From<String> for SignMessageResponse {
9122    fn from(value: String) -> Self { Self { value } }
9123}
9124
9125impl From<SignMessageResponse> for String {
9126    fn from(wrapper: SignMessageResponse) -> Self { wrapper.value }
9127}
9128
9129/// Response for the `SignMessageWithPrivKey` RPC method
9130///
9131/// This method returns a primitive value wrapped in a transparent struct.
9132#[derive(Debug, Clone, PartialEq, Serialize)]
9133pub struct SignMessageWithPrivKeyResponse {
9134    /// Wrapped primitive value
9135    pub value: String,
9136}
9137
9138impl<'de> serde::Deserialize<'de> for SignMessageWithPrivKeyResponse {
9139    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
9140    where
9141        D: serde::Deserializer<'de>,
9142    {
9143        use std::fmt;
9144
9145        use serde::de::{self, Visitor};
9146
9147        struct PrimitiveWrapperVisitor;
9148
9149        #[allow(unused_variables, clippy::needless_lifetimes)]
9150        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
9151            type Value = SignMessageWithPrivKeyResponse;
9152
9153            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
9154                formatter.write_str("a primitive value or an object with 'value' field")
9155            }
9156
9157            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
9158            where
9159                E: de::Error,
9160            {
9161                Ok(SignMessageWithPrivKeyResponse { value: v.to_string() })
9162            }
9163
9164            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
9165            where
9166                E: de::Error,
9167            {
9168                Ok(SignMessageWithPrivKeyResponse { value: v.to_string() })
9169            }
9170
9171            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
9172            where
9173                E: de::Error,
9174            {
9175                Ok(SignMessageWithPrivKeyResponse { value: v.to_string() })
9176            }
9177
9178            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
9179            where
9180                E: de::Error,
9181            {
9182                Ok(SignMessageWithPrivKeyResponse { value: v.to_string() })
9183            }
9184
9185            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
9186            where
9187                E: de::Error,
9188            {
9189                Ok(SignMessageWithPrivKeyResponse { value: v.to_string() })
9190            }
9191
9192            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
9193            where
9194                M: de::MapAccess<'de>,
9195            {
9196                let mut value = None;
9197                while let Some(key) = map.next_key::<String>()? {
9198                    if key == "value" {
9199                        if value.is_some() {
9200                            return Err(de::Error::duplicate_field("value"));
9201                        }
9202                        value = Some(map.next_value()?);
9203                    } else {
9204                        let _ = map.next_value::<de::IgnoredAny>()?;
9205                    }
9206                }
9207                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
9208                Ok(SignMessageWithPrivKeyResponse { value })
9209            }
9210        }
9211
9212        deserializer.deserialize_any(PrimitiveWrapperVisitor)
9213    }
9214}
9215
9216impl std::ops::Deref for SignMessageWithPrivKeyResponse {
9217    type Target = String;
9218    fn deref(&self) -> &Self::Target { &self.value }
9219}
9220
9221impl std::ops::DerefMut for SignMessageWithPrivKeyResponse {
9222    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
9223}
9224
9225impl AsRef<String> for SignMessageWithPrivKeyResponse {
9226    fn as_ref(&self) -> &String { &self.value }
9227}
9228
9229impl From<String> for SignMessageWithPrivKeyResponse {
9230    fn from(value: String) -> Self { Self { value } }
9231}
9232
9233impl From<SignMessageWithPrivKeyResponse> for String {
9234    fn from(wrapper: SignMessageWithPrivKeyResponse) -> Self { wrapper.value }
9235}
9236
9237/// Response for the `SignRawTransactionWithKey` RPC method
9238#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
9239#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
9240pub struct SignRawTransactionWithKeyResponse {
9241    /// The hex-encoded raw transaction with signature(s)
9242    pub hex: String,
9243    /// If the transaction has a complete set of signatures
9244    pub complete: bool,
9245    /// Script verification errors (if there are any)
9246    pub errors: Option<Vec<SignRawTransactionWithKeyErrors>>,
9247}
9248
9249/// Response for the `SignRawTransactionWithWallet` RPC method
9250#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
9251#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
9252pub struct SignRawTransactionWithWalletResponse {
9253    /// The hex-encoded raw transaction with signature(s)
9254    pub hex: String,
9255    /// If the transaction has a complete set of signatures
9256    pub complete: bool,
9257    /// Script verification errors (if there are any)
9258    pub errors: Option<Vec<SignRawTransactionWithWalletErrors>>,
9259}
9260
9261/// Response for the `SimulateRawTransaction` RPC method
9262#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
9263#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
9264pub struct SimulateRawTransactionResponse {
9265    /// The wallet balance change (negative means decrease).
9266    #[serde(deserialize_with = "amount_from_btc_float")]
9267    pub balance_change: bitcoin::Amount,
9268}
9269
9270/// Response for the `Stop` RPC method
9271///
9272/// This method returns a primitive value wrapped in a transparent struct.
9273#[derive(Debug, Clone, PartialEq, Serialize)]
9274pub struct StopResponse {
9275    /// Wrapped primitive value
9276    pub value: String,
9277}
9278
9279impl<'de> serde::Deserialize<'de> for StopResponse {
9280    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
9281    where
9282        D: serde::Deserializer<'de>,
9283    {
9284        use std::fmt;
9285
9286        use serde::de::{self, Visitor};
9287
9288        struct PrimitiveWrapperVisitor;
9289
9290        #[allow(unused_variables, clippy::needless_lifetimes)]
9291        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
9292            type Value = StopResponse;
9293
9294            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
9295                formatter.write_str("a primitive value or an object with 'value' field")
9296            }
9297
9298            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
9299            where
9300                E: de::Error,
9301            {
9302                Ok(StopResponse { value: v.to_string() })
9303            }
9304
9305            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
9306            where
9307                E: de::Error,
9308            {
9309                Ok(StopResponse { value: v.to_string() })
9310            }
9311
9312            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
9313            where
9314                E: de::Error,
9315            {
9316                Ok(StopResponse { value: v.to_string() })
9317            }
9318
9319            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
9320            where
9321                E: de::Error,
9322            {
9323                Ok(StopResponse { value: v.to_string() })
9324            }
9325
9326            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
9327            where
9328                E: de::Error,
9329            {
9330                Ok(StopResponse { value: v.to_string() })
9331            }
9332
9333            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
9334            where
9335                M: de::MapAccess<'de>,
9336            {
9337                let mut value = None;
9338                while let Some(key) = map.next_key::<String>()? {
9339                    if key == "value" {
9340                        if value.is_some() {
9341                            return Err(de::Error::duplicate_field("value"));
9342                        }
9343                        value = Some(map.next_value()?);
9344                    } else {
9345                        let _ = map.next_value::<de::IgnoredAny>()?;
9346                    }
9347                }
9348                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
9349                Ok(StopResponse { value })
9350            }
9351        }
9352
9353        deserializer.deserialize_any(PrimitiveWrapperVisitor)
9354    }
9355}
9356
9357impl std::ops::Deref for StopResponse {
9358    type Target = String;
9359    fn deref(&self) -> &Self::Target { &self.value }
9360}
9361
9362impl std::ops::DerefMut for StopResponse {
9363    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
9364}
9365
9366impl AsRef<String> for StopResponse {
9367    fn as_ref(&self) -> &String { &self.value }
9368}
9369
9370impl From<String> for StopResponse {
9371    fn from(value: String) -> Self { Self { value } }
9372}
9373
9374impl From<StopResponse> for String {
9375    fn from(wrapper: StopResponse) -> Self { wrapper.value }
9376}
9377
9378/// Response for the `SubmitBlock` RPC method
9379#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
9380#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
9381pub struct SubmitBlockResponse {
9382    pub field_0_1: (),
9383    /// According to BIP22
9384    pub field_1_1: String,
9385}
9386
9387/// Response for the `SubmitHeader` RPC method
9388///
9389/// This method returns a primitive value wrapped in a transparent struct.
9390#[derive(Debug, Clone, PartialEq, Serialize)]
9391pub struct SubmitHeaderResponse {
9392    /// Wrapped primitive value
9393    pub value: (),
9394}
9395
9396impl<'de> serde::Deserialize<'de> for SubmitHeaderResponse {
9397    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
9398    where
9399        D: serde::Deserializer<'de>,
9400    {
9401        use std::fmt;
9402
9403        use serde::de::{self, Visitor};
9404
9405        struct PrimitiveWrapperVisitor;
9406
9407        #[allow(unused_variables, clippy::needless_lifetimes)]
9408        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
9409            type Value = SubmitHeaderResponse;
9410
9411            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
9412                formatter.write_str("a primitive value or an object with 'value' field")
9413            }
9414
9415            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
9416            where
9417                E: de::Error,
9418            {
9419                Ok(SubmitHeaderResponse { value: () })
9420            }
9421
9422            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
9423            where
9424                E: de::Error,
9425            {
9426                Ok(SubmitHeaderResponse { value: () })
9427            }
9428
9429            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
9430            where
9431                E: de::Error,
9432            {
9433                Ok(SubmitHeaderResponse { value: () })
9434            }
9435
9436            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
9437            where
9438                E: de::Error,
9439            {
9440                Ok(SubmitHeaderResponse { value: () })
9441            }
9442
9443            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
9444            where
9445                E: de::Error,
9446            {
9447                Ok(SubmitHeaderResponse { value: () })
9448            }
9449
9450            fn visit_none<E>(self) -> Result<Self::Value, E>
9451            where
9452                E: de::Error,
9453            {
9454                Ok(SubmitHeaderResponse { value: () })
9455            }
9456
9457            fn visit_unit<E>(self) -> Result<Self::Value, E>
9458            where
9459                E: de::Error,
9460            {
9461                Ok(SubmitHeaderResponse { value: () })
9462            }
9463
9464            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
9465            where
9466                M: de::MapAccess<'de>,
9467            {
9468                let mut value = None;
9469                while let Some(key) = map.next_key::<String>()? {
9470                    if key == "value" {
9471                        if value.is_some() {
9472                            return Err(de::Error::duplicate_field("value"));
9473                        }
9474                        value = Some(map.next_value::<()>()?);
9475                    } else {
9476                        let _ = map.next_value::<de::IgnoredAny>()?;
9477                    }
9478                }
9479                value.ok_or_else(|| de::Error::missing_field("value"))?;
9480                Ok(SubmitHeaderResponse { value: () })
9481            }
9482        }
9483
9484        deserializer.deserialize_any(PrimitiveWrapperVisitor)
9485    }
9486}
9487
9488impl std::ops::Deref for SubmitHeaderResponse {
9489    type Target = ();
9490    fn deref(&self) -> &Self::Target { &self.value }
9491}
9492
9493impl std::ops::DerefMut for SubmitHeaderResponse {
9494    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
9495}
9496
9497impl AsRef<()> for SubmitHeaderResponse {
9498    fn as_ref(&self) -> &() { &self.value }
9499}
9500
9501impl From<()> for SubmitHeaderResponse {
9502    fn from(value: ()) -> Self { Self { value } }
9503}
9504
9505impl From<SubmitHeaderResponse> for () {
9506    fn from(wrapper: SubmitHeaderResponse) -> Self { wrapper.value }
9507}
9508
9509/// Response for the `SubmitPackage` RPC method
9510#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
9511#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
9512pub struct SubmitPackageResponse {
9513    /// The transaction package result message. "success" indicates all transactions were accepted into or are already in the mempool.
9514    pub package_msg: String,
9515    /// The transaction results keyed by wtxid. An entry is returned for every submitted wtxid.
9516    #[serde(rename = "tx-results")]
9517    pub tx_results: SubmitPackageTxResults,
9518    /// List of txids of replaced transactions
9519    #[serde(rename = "replaced-transactions")]
9520    pub replaced_transactions: Option<Vec<String>>,
9521}
9522
9523/// Response for the `SyncWithValidationInterfaceQueue` RPC method
9524///
9525/// This method returns a primitive value wrapped in a transparent struct.
9526#[derive(Debug, Clone, PartialEq, Serialize)]
9527pub struct SyncWithValidationInterfaceQueueResponse {
9528    /// Wrapped primitive value
9529    pub value: (),
9530}
9531
9532impl<'de> serde::Deserialize<'de> for SyncWithValidationInterfaceQueueResponse {
9533    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
9534    where
9535        D: serde::Deserializer<'de>,
9536    {
9537        use std::fmt;
9538
9539        use serde::de::{self, Visitor};
9540
9541        struct PrimitiveWrapperVisitor;
9542
9543        #[allow(unused_variables, clippy::needless_lifetimes)]
9544        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
9545            type Value = SyncWithValidationInterfaceQueueResponse;
9546
9547            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
9548                formatter.write_str("a primitive value or an object with 'value' field")
9549            }
9550
9551            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
9552            where
9553                E: de::Error,
9554            {
9555                Ok(SyncWithValidationInterfaceQueueResponse { value: () })
9556            }
9557
9558            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
9559            where
9560                E: de::Error,
9561            {
9562                Ok(SyncWithValidationInterfaceQueueResponse { value: () })
9563            }
9564
9565            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
9566            where
9567                E: de::Error,
9568            {
9569                Ok(SyncWithValidationInterfaceQueueResponse { value: () })
9570            }
9571
9572            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
9573            where
9574                E: de::Error,
9575            {
9576                Ok(SyncWithValidationInterfaceQueueResponse { value: () })
9577            }
9578
9579            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
9580            where
9581                E: de::Error,
9582            {
9583                Ok(SyncWithValidationInterfaceQueueResponse { value: () })
9584            }
9585
9586            fn visit_none<E>(self) -> Result<Self::Value, E>
9587            where
9588                E: de::Error,
9589            {
9590                Ok(SyncWithValidationInterfaceQueueResponse { value: () })
9591            }
9592
9593            fn visit_unit<E>(self) -> Result<Self::Value, E>
9594            where
9595                E: de::Error,
9596            {
9597                Ok(SyncWithValidationInterfaceQueueResponse { value: () })
9598            }
9599
9600            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
9601            where
9602                M: de::MapAccess<'de>,
9603            {
9604                let mut value = None;
9605                while let Some(key) = map.next_key::<String>()? {
9606                    if key == "value" {
9607                        if value.is_some() {
9608                            return Err(de::Error::duplicate_field("value"));
9609                        }
9610                        value = Some(map.next_value::<()>()?);
9611                    } else {
9612                        let _ = map.next_value::<de::IgnoredAny>()?;
9613                    }
9614                }
9615                value.ok_or_else(|| de::Error::missing_field("value"))?;
9616                Ok(SyncWithValidationInterfaceQueueResponse { value: () })
9617            }
9618        }
9619
9620        deserializer.deserialize_any(PrimitiveWrapperVisitor)
9621    }
9622}
9623
9624impl std::ops::Deref for SyncWithValidationInterfaceQueueResponse {
9625    type Target = ();
9626    fn deref(&self) -> &Self::Target { &self.value }
9627}
9628
9629impl std::ops::DerefMut for SyncWithValidationInterfaceQueueResponse {
9630    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
9631}
9632
9633impl AsRef<()> for SyncWithValidationInterfaceQueueResponse {
9634    fn as_ref(&self) -> &() { &self.value }
9635}
9636
9637impl From<()> for SyncWithValidationInterfaceQueueResponse {
9638    fn from(value: ()) -> Self { Self { value } }
9639}
9640
9641impl From<SyncWithValidationInterfaceQueueResponse> for () {
9642    fn from(wrapper: SyncWithValidationInterfaceQueueResponse) -> Self { wrapper.value }
9643}
9644
9645/// Response for the `TestMempoolAccept` RPC method
9646///
9647/// The result of the mempool acceptance test for each raw transaction in the input array.
9648/// Returns results for each transaction in the same order they were passed in.
9649/// Transactions that cannot be fully validated due to failures in other transactions will not contain an 'allowed' result.
9650#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
9651#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
9652pub struct TestMempoolAcceptResponse {
9653    pub field: serde_json::Value,
9654}
9655
9656/// Response for the `UnloadWallet` RPC method
9657#[derive(Debug, Clone, PartialEq, Serialize)]
9658pub struct UnloadWalletResponse {
9659    /// Warning messages, if any, related to unloading the wallet.
9660    pub warnings: Option<Vec<String>>,
9661}
9662impl<'de> serde::Deserialize<'de> for UnloadWalletResponse {
9663    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
9664    where
9665        D: serde::Deserializer<'de>,
9666    {
9667        use std::fmt;
9668
9669        use serde::de::{self, Visitor};
9670
9671        struct ConditionalResponseVisitor;
9672
9673        #[allow(clippy::needless_lifetimes)]
9674        impl<'de> Visitor<'de> for ConditionalResponseVisitor {
9675            type Value = UnloadWalletResponse;
9676
9677            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
9678                formatter.write_str("string or object")
9679            }
9680
9681            fn visit_str<E>(self, _v: &str) -> Result<Self::Value, E>
9682            where
9683                E: de::Error,
9684            {
9685                Ok(UnloadWalletResponse { warnings: None })
9686            }
9687
9688            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
9689            where
9690                M: de::MapAccess<'de>,
9691            {
9692                let mut warnings = None;
9693                while let Some(key) = map.next_key::<String>()? {
9694                    if key == "warnings" {
9695                        if warnings.is_some() {
9696                            return Err(de::Error::duplicate_field("warnings"));
9697                        }
9698                        warnings = Some(map.next_value::<Vec<String>>()?);
9699                    } else {
9700                        let _ = map.next_value::<de::IgnoredAny>()?;
9701                    }
9702                }
9703                Ok(UnloadWalletResponse { warnings })
9704            }
9705        }
9706
9707        deserializer.deserialize_any(ConditionalResponseVisitor)
9708    }
9709}
9710
9711/// Response for the `Uptime` RPC method
9712///
9713/// This method returns a primitive value wrapped in a transparent struct.
9714#[derive(Debug, Clone, PartialEq, Serialize)]
9715pub struct UptimeResponse {
9716    /// Wrapped primitive value
9717    pub value: u64,
9718}
9719
9720impl<'de> serde::Deserialize<'de> for UptimeResponse {
9721    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
9722    where
9723        D: serde::Deserializer<'de>,
9724    {
9725        use std::fmt;
9726
9727        use serde::de::{self, Visitor};
9728
9729        struct PrimitiveWrapperVisitor;
9730
9731        #[allow(unused_variables, clippy::needless_lifetimes)]
9732        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
9733            type Value = UptimeResponse;
9734
9735            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
9736                formatter.write_str("a primitive value or an object with 'value' field")
9737            }
9738
9739            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
9740            where
9741                E: de::Error,
9742            {
9743                Ok(UptimeResponse { value: v })
9744            }
9745
9746            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
9747            where
9748                E: de::Error,
9749            {
9750                Ok(UptimeResponse { value: v as u64 })
9751            }
9752
9753            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
9754            where
9755                E: de::Error,
9756            {
9757                Ok(UptimeResponse { value: v as u64 })
9758            }
9759
9760            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
9761            where
9762                E: de::Error,
9763            {
9764                let value = v.parse::<u64>().map_err(de::Error::custom)?;
9765                Ok(UptimeResponse { value })
9766            }
9767
9768            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
9769            where
9770                E: de::Error,
9771            {
9772                Ok(UptimeResponse { value: v as u64 })
9773            }
9774
9775            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
9776            where
9777                M: de::MapAccess<'de>,
9778            {
9779                let mut value = None;
9780                while let Some(key) = map.next_key::<String>()? {
9781                    if key == "value" {
9782                        if value.is_some() {
9783                            return Err(de::Error::duplicate_field("value"));
9784                        }
9785                        value = Some(map.next_value()?);
9786                    } else {
9787                        let _ = map.next_value::<de::IgnoredAny>()?;
9788                    }
9789                }
9790                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
9791                Ok(UptimeResponse { value })
9792            }
9793        }
9794
9795        deserializer.deserialize_any(PrimitiveWrapperVisitor)
9796    }
9797}
9798
9799impl std::ops::Deref for UptimeResponse {
9800    type Target = u64;
9801    fn deref(&self) -> &Self::Target { &self.value }
9802}
9803
9804impl std::ops::DerefMut for UptimeResponse {
9805    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
9806}
9807
9808impl AsRef<u64> for UptimeResponse {
9809    fn as_ref(&self) -> &u64 { &self.value }
9810}
9811
9812impl From<u64> for UptimeResponse {
9813    fn from(value: u64) -> Self { Self { value } }
9814}
9815
9816impl From<UptimeResponse> for u64 {
9817    fn from(wrapper: UptimeResponse) -> Self { wrapper.value }
9818}
9819
9820/// Response for the `UtxoUpdatePsbt` RPC method
9821///
9822/// This method returns a primitive value wrapped in a transparent struct.
9823#[derive(Debug, Clone, PartialEq, Serialize)]
9824pub struct UtxoUpdatePsbtResponse {
9825    /// Wrapped primitive value
9826    pub value: String,
9827}
9828
9829impl<'de> serde::Deserialize<'de> for UtxoUpdatePsbtResponse {
9830    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
9831    where
9832        D: serde::Deserializer<'de>,
9833    {
9834        use std::fmt;
9835
9836        use serde::de::{self, Visitor};
9837
9838        struct PrimitiveWrapperVisitor;
9839
9840        #[allow(unused_variables, clippy::needless_lifetimes)]
9841        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
9842            type Value = UtxoUpdatePsbtResponse;
9843
9844            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
9845                formatter.write_str("a primitive value or an object with 'value' field")
9846            }
9847
9848            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
9849            where
9850                E: de::Error,
9851            {
9852                Ok(UtxoUpdatePsbtResponse { value: v.to_string() })
9853            }
9854
9855            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
9856            where
9857                E: de::Error,
9858            {
9859                Ok(UtxoUpdatePsbtResponse { value: v.to_string() })
9860            }
9861
9862            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
9863            where
9864                E: de::Error,
9865            {
9866                Ok(UtxoUpdatePsbtResponse { value: v.to_string() })
9867            }
9868
9869            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
9870            where
9871                E: de::Error,
9872            {
9873                Ok(UtxoUpdatePsbtResponse { value: v.to_string() })
9874            }
9875
9876            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
9877            where
9878                E: de::Error,
9879            {
9880                Ok(UtxoUpdatePsbtResponse { value: v.to_string() })
9881            }
9882
9883            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
9884            where
9885                M: de::MapAccess<'de>,
9886            {
9887                let mut value = None;
9888                while let Some(key) = map.next_key::<String>()? {
9889                    if key == "value" {
9890                        if value.is_some() {
9891                            return Err(de::Error::duplicate_field("value"));
9892                        }
9893                        value = Some(map.next_value()?);
9894                    } else {
9895                        let _ = map.next_value::<de::IgnoredAny>()?;
9896                    }
9897                }
9898                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
9899                Ok(UtxoUpdatePsbtResponse { value })
9900            }
9901        }
9902
9903        deserializer.deserialize_any(PrimitiveWrapperVisitor)
9904    }
9905}
9906
9907impl std::ops::Deref for UtxoUpdatePsbtResponse {
9908    type Target = String;
9909    fn deref(&self) -> &Self::Target { &self.value }
9910}
9911
9912impl std::ops::DerefMut for UtxoUpdatePsbtResponse {
9913    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
9914}
9915
9916impl AsRef<String> for UtxoUpdatePsbtResponse {
9917    fn as_ref(&self) -> &String { &self.value }
9918}
9919
9920impl From<String> for UtxoUpdatePsbtResponse {
9921    fn from(value: String) -> Self { Self { value } }
9922}
9923
9924impl From<UtxoUpdatePsbtResponse> for String {
9925    fn from(wrapper: UtxoUpdatePsbtResponse) -> Self { wrapper.value }
9926}
9927
9928/// Response for the `ValidateAddress` RPC method
9929#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
9930#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
9931pub struct ValidateAddressResponse {
9932    /// If the address is valid or not
9933    pub isvalid: bool,
9934    /// The bitcoin address validated
9935    pub address: Option<String>,
9936    /// The hex-encoded output script generated by the address
9937    #[serde(rename = "scriptPubKey")]
9938    pub script_pubkey: Option<bitcoin::ScriptBuf>,
9939    /// If the key is a script
9940    #[serde(rename = "isscript")]
9941    pub is_script: Option<bool>,
9942    /// If the address is a witness address
9943    #[serde(rename = "iswitness")]
9944    pub is_witness: Option<bool>,
9945    /// The version number of the witness program
9946    pub witness_version: Option<u64>,
9947    /// The hex value of the witness program
9948    pub witness_program: Option<String>,
9949    /// Error message, if any
9950    pub error: Option<String>,
9951    /// Indices of likely error locations in address, if known (e.g. Bech32 errors)
9952    pub error_locations: Option<Vec<String>>,
9953}
9954
9955/// Response for the `VerifyChain` RPC method
9956///
9957/// This method returns a primitive value wrapped in a transparent struct.
9958#[derive(Debug, Clone, PartialEq, Serialize)]
9959pub struct VerifyChainResponse {
9960    /// Wrapped primitive value
9961    pub value: bool,
9962}
9963
9964impl<'de> serde::Deserialize<'de> for VerifyChainResponse {
9965    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
9966    where
9967        D: serde::Deserializer<'de>,
9968    {
9969        use std::fmt;
9970
9971        use serde::de::{self, Visitor};
9972
9973        struct PrimitiveWrapperVisitor;
9974
9975        #[allow(unused_variables, clippy::needless_lifetimes)]
9976        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
9977            type Value = VerifyChainResponse;
9978
9979            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
9980                formatter.write_str("a primitive value or an object with 'value' field")
9981            }
9982
9983            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
9984            where
9985                E: de::Error,
9986            {
9987                Ok(VerifyChainResponse { value: v != 0 })
9988            }
9989
9990            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
9991            where
9992                E: de::Error,
9993            {
9994                Ok(VerifyChainResponse { value: v != 0 })
9995            }
9996
9997            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
9998            where
9999                E: de::Error,
10000            {
10001                Ok(VerifyChainResponse { value: v != 0.0 })
10002            }
10003
10004            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
10005            where
10006                E: de::Error,
10007            {
10008                let value = v.parse::<bool>().map_err(de::Error::custom)?;
10009                Ok(VerifyChainResponse { value })
10010            }
10011
10012            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
10013            where
10014                E: de::Error,
10015            {
10016                Ok(VerifyChainResponse { value: v })
10017            }
10018
10019            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
10020            where
10021                M: de::MapAccess<'de>,
10022            {
10023                let mut value = None;
10024                while let Some(key) = map.next_key::<String>()? {
10025                    if key == "value" {
10026                        if value.is_some() {
10027                            return Err(de::Error::duplicate_field("value"));
10028                        }
10029                        value = Some(map.next_value()?);
10030                    } else {
10031                        let _ = map.next_value::<de::IgnoredAny>()?;
10032                    }
10033                }
10034                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
10035                Ok(VerifyChainResponse { value })
10036            }
10037        }
10038
10039        deserializer.deserialize_any(PrimitiveWrapperVisitor)
10040    }
10041}
10042
10043impl std::ops::Deref for VerifyChainResponse {
10044    type Target = bool;
10045    fn deref(&self) -> &Self::Target { &self.value }
10046}
10047
10048impl std::ops::DerefMut for VerifyChainResponse {
10049    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
10050}
10051
10052impl AsRef<bool> for VerifyChainResponse {
10053    fn as_ref(&self) -> &bool { &self.value }
10054}
10055
10056impl From<bool> for VerifyChainResponse {
10057    fn from(value: bool) -> Self { Self { value } }
10058}
10059
10060impl From<VerifyChainResponse> for bool {
10061    fn from(wrapper: VerifyChainResponse) -> Self { wrapper.value }
10062}
10063
10064/// Response for the `VerifyMessage` RPC method
10065///
10066/// This method returns a primitive value wrapped in a transparent struct.
10067#[derive(Debug, Clone, PartialEq, Serialize)]
10068pub struct VerifyMessageResponse {
10069    /// Wrapped primitive value
10070    pub value: bool,
10071}
10072
10073impl<'de> serde::Deserialize<'de> for VerifyMessageResponse {
10074    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
10075    where
10076        D: serde::Deserializer<'de>,
10077    {
10078        use std::fmt;
10079
10080        use serde::de::{self, Visitor};
10081
10082        struct PrimitiveWrapperVisitor;
10083
10084        #[allow(unused_variables, clippy::needless_lifetimes)]
10085        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
10086            type Value = VerifyMessageResponse;
10087
10088            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
10089                formatter.write_str("a primitive value or an object with 'value' field")
10090            }
10091
10092            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
10093            where
10094                E: de::Error,
10095            {
10096                Ok(VerifyMessageResponse { value: v != 0 })
10097            }
10098
10099            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
10100            where
10101                E: de::Error,
10102            {
10103                Ok(VerifyMessageResponse { value: v != 0 })
10104            }
10105
10106            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
10107            where
10108                E: de::Error,
10109            {
10110                Ok(VerifyMessageResponse { value: v != 0.0 })
10111            }
10112
10113            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
10114            where
10115                E: de::Error,
10116            {
10117                let value = v.parse::<bool>().map_err(de::Error::custom)?;
10118                Ok(VerifyMessageResponse { value })
10119            }
10120
10121            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
10122            where
10123                E: de::Error,
10124            {
10125                Ok(VerifyMessageResponse { value: v })
10126            }
10127
10128            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
10129            where
10130                M: de::MapAccess<'de>,
10131            {
10132                let mut value = None;
10133                while let Some(key) = map.next_key::<String>()? {
10134                    if key == "value" {
10135                        if value.is_some() {
10136                            return Err(de::Error::duplicate_field("value"));
10137                        }
10138                        value = Some(map.next_value()?);
10139                    } else {
10140                        let _ = map.next_value::<de::IgnoredAny>()?;
10141                    }
10142                }
10143                let value = value.ok_or_else(|| de::Error::missing_field("value"))?;
10144                Ok(VerifyMessageResponse { value })
10145            }
10146        }
10147
10148        deserializer.deserialize_any(PrimitiveWrapperVisitor)
10149    }
10150}
10151
10152impl std::ops::Deref for VerifyMessageResponse {
10153    type Target = bool;
10154    fn deref(&self) -> &Self::Target { &self.value }
10155}
10156
10157impl std::ops::DerefMut for VerifyMessageResponse {
10158    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
10159}
10160
10161impl AsRef<bool> for VerifyMessageResponse {
10162    fn as_ref(&self) -> &bool { &self.value }
10163}
10164
10165impl From<bool> for VerifyMessageResponse {
10166    fn from(value: bool) -> Self { Self { value } }
10167}
10168
10169impl From<VerifyMessageResponse> for bool {
10170    fn from(wrapper: VerifyMessageResponse) -> Self { wrapper.value }
10171}
10172
10173/// Response for the `VerifyTxOutProof` RPC method
10174///
10175/// This method returns an array wrapped in a transparent struct.
10176#[derive(Debug, Clone, PartialEq, Serialize)]
10177pub struct VerifyTxOutProofResponse {
10178    /// Wrapped array value
10179    pub value: Vec<serde_json::Value>,
10180}
10181
10182impl<'de> serde::Deserialize<'de> for VerifyTxOutProofResponse {
10183    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
10184    where
10185        D: serde::Deserializer<'de>,
10186    {
10187        let value = Vec::<serde_json::Value>::deserialize(deserializer)?;
10188        Ok(Self { value })
10189    }
10190}
10191
10192impl From<Vec<serde_json::Value>> for VerifyTxOutProofResponse {
10193    fn from(value: Vec<serde_json::Value>) -> Self { Self { value } }
10194}
10195
10196impl From<VerifyTxOutProofResponse> for Vec<serde_json::Value> {
10197    fn from(wrapper: VerifyTxOutProofResponse) -> Self { wrapper.value }
10198}
10199
10200/// Response for the `WaitForBlock` RPC method
10201#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
10202#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
10203pub struct WaitForBlockResponse {
10204    /// The blockhash
10205    pub hash: String,
10206    /// Block height
10207    pub height: u64,
10208}
10209
10210/// Response for the `WaitForBlockHeight` RPC method
10211#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
10212#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
10213pub struct WaitForBlockHeightResponse {
10214    /// The blockhash
10215    pub hash: String,
10216    /// Block height
10217    pub height: u64,
10218}
10219
10220/// Response for the `WaitForNewBlock` RPC method
10221#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
10222#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
10223pub struct WaitForNewBlockResponse {
10224    /// The blockhash
10225    pub hash: String,
10226    /// Block height
10227    pub height: u64,
10228}
10229
10230/// Response for the `WalletCreateFundedPsbt` RPC method
10231#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
10232#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
10233pub struct WalletCreateFundedPsbtResponse {
10234    /// The resulting raw transaction (base64-encoded string)
10235    pub psbt: String,
10236    /// Fee in BTC the resulting transaction pays
10237    #[serde(deserialize_with = "amount_from_btc_float")]
10238    pub fee: bitcoin::Amount,
10239    /// The position of the added change output, or -1
10240    pub changepos: i64,
10241}
10242
10243/// Response for the `WalletDisplayAddress` RPC method
10244#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
10245#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
10246pub struct WalletDisplayAddressResponse {
10247    /// The address as confirmed by the signer
10248    pub address: String,
10249}
10250
10251/// Response for the `WalletLock` RPC method
10252///
10253/// This method returns a primitive value wrapped in a transparent struct.
10254#[derive(Debug, Clone, PartialEq, Serialize)]
10255pub struct WalletLockResponse {
10256    /// Wrapped primitive value
10257    pub value: (),
10258}
10259
10260impl<'de> serde::Deserialize<'de> for WalletLockResponse {
10261    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
10262    where
10263        D: serde::Deserializer<'de>,
10264    {
10265        use std::fmt;
10266
10267        use serde::de::{self, Visitor};
10268
10269        struct PrimitiveWrapperVisitor;
10270
10271        #[allow(unused_variables, clippy::needless_lifetimes)]
10272        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
10273            type Value = WalletLockResponse;
10274
10275            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
10276                formatter.write_str("a primitive value or an object with 'value' field")
10277            }
10278
10279            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
10280            where
10281                E: de::Error,
10282            {
10283                Ok(WalletLockResponse { value: () })
10284            }
10285
10286            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
10287            where
10288                E: de::Error,
10289            {
10290                Ok(WalletLockResponse { value: () })
10291            }
10292
10293            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
10294            where
10295                E: de::Error,
10296            {
10297                Ok(WalletLockResponse { value: () })
10298            }
10299
10300            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
10301            where
10302                E: de::Error,
10303            {
10304                Ok(WalletLockResponse { value: () })
10305            }
10306
10307            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
10308            where
10309                E: de::Error,
10310            {
10311                Ok(WalletLockResponse { value: () })
10312            }
10313
10314            fn visit_none<E>(self) -> Result<Self::Value, E>
10315            where
10316                E: de::Error,
10317            {
10318                Ok(WalletLockResponse { value: () })
10319            }
10320
10321            fn visit_unit<E>(self) -> Result<Self::Value, E>
10322            where
10323                E: de::Error,
10324            {
10325                Ok(WalletLockResponse { value: () })
10326            }
10327
10328            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
10329            where
10330                M: de::MapAccess<'de>,
10331            {
10332                let mut value = None;
10333                while let Some(key) = map.next_key::<String>()? {
10334                    if key == "value" {
10335                        if value.is_some() {
10336                            return Err(de::Error::duplicate_field("value"));
10337                        }
10338                        value = Some(map.next_value::<()>()?);
10339                    } else {
10340                        let _ = map.next_value::<de::IgnoredAny>()?;
10341                    }
10342                }
10343                value.ok_or_else(|| de::Error::missing_field("value"))?;
10344                Ok(WalletLockResponse { value: () })
10345            }
10346        }
10347
10348        deserializer.deserialize_any(PrimitiveWrapperVisitor)
10349    }
10350}
10351
10352impl std::ops::Deref for WalletLockResponse {
10353    type Target = ();
10354    fn deref(&self) -> &Self::Target { &self.value }
10355}
10356
10357impl std::ops::DerefMut for WalletLockResponse {
10358    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
10359}
10360
10361impl AsRef<()> for WalletLockResponse {
10362    fn as_ref(&self) -> &() { &self.value }
10363}
10364
10365impl From<()> for WalletLockResponse {
10366    fn from(value: ()) -> Self { Self { value } }
10367}
10368
10369impl From<WalletLockResponse> for () {
10370    fn from(wrapper: WalletLockResponse) -> Self { wrapper.value }
10371}
10372
10373/// Response for the `WalletPassphrase` RPC method
10374///
10375/// This method returns a primitive value wrapped in a transparent struct.
10376#[derive(Debug, Clone, PartialEq, Serialize)]
10377pub struct WalletPassphraseResponse {
10378    /// Wrapped primitive value
10379    pub value: (),
10380}
10381
10382impl<'de> serde::Deserialize<'de> for WalletPassphraseResponse {
10383    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
10384    where
10385        D: serde::Deserializer<'de>,
10386    {
10387        use std::fmt;
10388
10389        use serde::de::{self, Visitor};
10390
10391        struct PrimitiveWrapperVisitor;
10392
10393        #[allow(unused_variables, clippy::needless_lifetimes)]
10394        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
10395            type Value = WalletPassphraseResponse;
10396
10397            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
10398                formatter.write_str("a primitive value or an object with 'value' field")
10399            }
10400
10401            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
10402            where
10403                E: de::Error,
10404            {
10405                Ok(WalletPassphraseResponse { value: () })
10406            }
10407
10408            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
10409            where
10410                E: de::Error,
10411            {
10412                Ok(WalletPassphraseResponse { value: () })
10413            }
10414
10415            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
10416            where
10417                E: de::Error,
10418            {
10419                Ok(WalletPassphraseResponse { value: () })
10420            }
10421
10422            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
10423            where
10424                E: de::Error,
10425            {
10426                Ok(WalletPassphraseResponse { value: () })
10427            }
10428
10429            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
10430            where
10431                E: de::Error,
10432            {
10433                Ok(WalletPassphraseResponse { value: () })
10434            }
10435
10436            fn visit_none<E>(self) -> Result<Self::Value, E>
10437            where
10438                E: de::Error,
10439            {
10440                Ok(WalletPassphraseResponse { value: () })
10441            }
10442
10443            fn visit_unit<E>(self) -> Result<Self::Value, E>
10444            where
10445                E: de::Error,
10446            {
10447                Ok(WalletPassphraseResponse { value: () })
10448            }
10449
10450            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
10451            where
10452                M: de::MapAccess<'de>,
10453            {
10454                let mut value = None;
10455                while let Some(key) = map.next_key::<String>()? {
10456                    if key == "value" {
10457                        if value.is_some() {
10458                            return Err(de::Error::duplicate_field("value"));
10459                        }
10460                        value = Some(map.next_value::<()>()?);
10461                    } else {
10462                        let _ = map.next_value::<de::IgnoredAny>()?;
10463                    }
10464                }
10465                value.ok_or_else(|| de::Error::missing_field("value"))?;
10466                Ok(WalletPassphraseResponse { value: () })
10467            }
10468        }
10469
10470        deserializer.deserialize_any(PrimitiveWrapperVisitor)
10471    }
10472}
10473
10474impl std::ops::Deref for WalletPassphraseResponse {
10475    type Target = ();
10476    fn deref(&self) -> &Self::Target { &self.value }
10477}
10478
10479impl std::ops::DerefMut for WalletPassphraseResponse {
10480    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
10481}
10482
10483impl AsRef<()> for WalletPassphraseResponse {
10484    fn as_ref(&self) -> &() { &self.value }
10485}
10486
10487impl From<()> for WalletPassphraseResponse {
10488    fn from(value: ()) -> Self { Self { value } }
10489}
10490
10491impl From<WalletPassphraseResponse> for () {
10492    fn from(wrapper: WalletPassphraseResponse) -> Self { wrapper.value }
10493}
10494
10495/// Response for the `WalletPassphraseChange` RPC method
10496///
10497/// This method returns a primitive value wrapped in a transparent struct.
10498#[derive(Debug, Clone, PartialEq, Serialize)]
10499pub struct WalletPassphraseChangeResponse {
10500    /// Wrapped primitive value
10501    pub value: (),
10502}
10503
10504impl<'de> serde::Deserialize<'de> for WalletPassphraseChangeResponse {
10505    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
10506    where
10507        D: serde::Deserializer<'de>,
10508    {
10509        use std::fmt;
10510
10511        use serde::de::{self, Visitor};
10512
10513        struct PrimitiveWrapperVisitor;
10514
10515        #[allow(unused_variables, clippy::needless_lifetimes)]
10516        impl<'de> Visitor<'de> for PrimitiveWrapperVisitor {
10517            type Value = WalletPassphraseChangeResponse;
10518
10519            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
10520                formatter.write_str("a primitive value or an object with 'value' field")
10521            }
10522
10523            fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
10524            where
10525                E: de::Error,
10526            {
10527                Ok(WalletPassphraseChangeResponse { value: () })
10528            }
10529
10530            fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
10531            where
10532                E: de::Error,
10533            {
10534                Ok(WalletPassphraseChangeResponse { value: () })
10535            }
10536
10537            fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
10538            where
10539                E: de::Error,
10540            {
10541                Ok(WalletPassphraseChangeResponse { value: () })
10542            }
10543
10544            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
10545            where
10546                E: de::Error,
10547            {
10548                Ok(WalletPassphraseChangeResponse { value: () })
10549            }
10550
10551            fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
10552            where
10553                E: de::Error,
10554            {
10555                Ok(WalletPassphraseChangeResponse { value: () })
10556            }
10557
10558            fn visit_none<E>(self) -> Result<Self::Value, E>
10559            where
10560                E: de::Error,
10561            {
10562                Ok(WalletPassphraseChangeResponse { value: () })
10563            }
10564
10565            fn visit_unit<E>(self) -> Result<Self::Value, E>
10566            where
10567                E: de::Error,
10568            {
10569                Ok(WalletPassphraseChangeResponse { value: () })
10570            }
10571
10572            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
10573            where
10574                M: de::MapAccess<'de>,
10575            {
10576                let mut value = None;
10577                while let Some(key) = map.next_key::<String>()? {
10578                    if key == "value" {
10579                        if value.is_some() {
10580                            return Err(de::Error::duplicate_field("value"));
10581                        }
10582                        value = Some(map.next_value::<()>()?);
10583                    } else {
10584                        let _ = map.next_value::<de::IgnoredAny>()?;
10585                    }
10586                }
10587                value.ok_or_else(|| de::Error::missing_field("value"))?;
10588                Ok(WalletPassphraseChangeResponse { value: () })
10589            }
10590        }
10591
10592        deserializer.deserialize_any(PrimitiveWrapperVisitor)
10593    }
10594}
10595
10596impl std::ops::Deref for WalletPassphraseChangeResponse {
10597    type Target = ();
10598    fn deref(&self) -> &Self::Target { &self.value }
10599}
10600
10601impl std::ops::DerefMut for WalletPassphraseChangeResponse {
10602    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value }
10603}
10604
10605impl AsRef<()> for WalletPassphraseChangeResponse {
10606    fn as_ref(&self) -> &() { &self.value }
10607}
10608
10609impl From<()> for WalletPassphraseChangeResponse {
10610    fn from(value: ()) -> Self { Self { value } }
10611}
10612
10613impl From<WalletPassphraseChangeResponse> for () {
10614    fn from(wrapper: WalletPassphraseChangeResponse) -> Self { wrapper.value }
10615}
10616
10617/// Response for the `WalletProcessPsbt` RPC method
10618#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
10619#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
10620pub struct WalletProcessPsbtResponse {
10621    /// The base64-encoded partially signed transaction
10622    pub psbt: String,
10623    /// If the transaction has a complete set of signatures
10624    pub complete: bool,
10625    /// The hex-encoded network transaction if complete
10626    pub hex: Option<String>,
10627}
10628
10629/// Deserializer for bitcoin::Amount that handles both float (BTC) and integer (satoshis) formats
10630/// Bitcoin Core returns amounts as floats in BTC, but some fields may be integers in satoshis
10631fn amount_from_btc_float<'de, D>(deserializer: D) -> Result<bitcoin::Amount, D::Error>
10632where
10633    D: serde::Deserializer<'de>,
10634{
10635    use std::fmt;
10636
10637    use serde::de::{self, Visitor};
10638
10639    struct AmountVisitor;
10640
10641    impl Visitor<'_> for AmountVisitor {
10642        type Value = bitcoin::Amount;
10643
10644        fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
10645            formatter.write_str("a number (float BTC or integer satoshis)")
10646        }
10647
10648        fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
10649        where
10650            E: de::Error,
10651        {
10652            bitcoin::Amount::from_btc(v)
10653                .map_err(|e| E::custom(format!("Invalid BTC amount: {}", e)))
10654        }
10655
10656        fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
10657        where
10658            E: de::Error,
10659        {
10660            Ok(bitcoin::Amount::from_sat(v))
10661        }
10662
10663        fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
10664        where
10665            E: de::Error,
10666        {
10667            if v < 0 {
10668                return Err(E::custom(format!("Amount cannot be negative: {}", v)));
10669            }
10670            Ok(bitcoin::Amount::from_sat(v as u64))
10671        }
10672    }
10673
10674    deserializer.deserialize_any(AmountVisitor)
10675}
10676
10677/// Deserializer for Option<bitcoin::Amount> that handles both float (BTC) and integer (satoshis) formats
10678/// Bitcoin Core returns amounts as floats in BTC, but some fields may be integers in satoshis
10679/// This deserializer also handles null/None values
10680fn option_amount_from_btc_float<'de, D>(
10681    deserializer: D,
10682) -> Result<Option<bitcoin::Amount>, D::Error>
10683where
10684    D: serde::Deserializer<'de>,
10685{
10686    use std::fmt;
10687
10688    use serde::de::{self, Visitor};
10689
10690    struct OptionAmountVisitor;
10691
10692    #[allow(clippy::needless_lifetimes)]
10693    impl<'de> Visitor<'de> for OptionAmountVisitor {
10694        type Value = Option<bitcoin::Amount>;
10695
10696        fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
10697            formatter.write_str("an optional number (float BTC or integer satoshis)")
10698        }
10699
10700        fn visit_none<E>(self) -> Result<Self::Value, E>
10701        where
10702            E: de::Error,
10703        {
10704            Ok(None)
10705        }
10706
10707        fn visit_some<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
10708        where
10709            D: serde::Deserializer<'de>,
10710        {
10711            amount_from_btc_float(deserializer).map(Some)
10712        }
10713
10714        fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
10715        where
10716            E: de::Error,
10717        {
10718            bitcoin::Amount::from_btc(v)
10719                .map_err(|e| E::custom(format!("Invalid BTC amount: {}", e)))
10720                .map(Some)
10721        }
10722
10723        fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
10724        where
10725            E: de::Error,
10726        {
10727            Ok(Some(bitcoin::Amount::from_sat(v)))
10728        }
10729
10730        fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
10731        where
10732            E: de::Error,
10733        {
10734            if v < 0 {
10735                return Err(E::custom(format!("Amount cannot be negative: {}", v)));
10736            }
10737            Ok(Some(bitcoin::Amount::from_sat(v as u64)))
10738        }
10739    }
10740
10741    deserializer.deserialize_any(OptionAmountVisitor)
10742}