bitcoin_rpc_midas/test_node/params.rs
1//! Parameter structs for RPC method calls
2use bitcoin_rpc_types::HashOrHeight;
3use serde::Serialize;
4
5/// Mark in-wallet transaction <txid> as abandoned
6/// This will mark this transaction and all its in-wallet descendants as abandoned which will allow
7/// for their inputs to be respent. It can be used to replace "stuck" or evicted transactions.
8/// It only works on transactions which are not included in a block and are not currently in the mempool.
9/// It has no effect on transactions which are already abandoned.
10#[derive(Debug, Serialize)]
11pub struct AbandontransactionParams {
12 pub txid: bitcoin::Txid,
13}
14
15/// Open an outbound connection to a specified node. This RPC is for testing only.
16#[derive(Debug, Serialize)]
17pub struct AddconnectionParams {
18 pub address: String,
19 pub connection_type: String,
20 pub v2transport: bool,
21}
22
23/// Attempts to add or remove a node from the addnode list.
24/// Or try a connection to a node once.
25/// Nodes added using addnode (or -connect) are protected from DoS disconnection and are not required to be
26/// full nodes/support SegWit as other outbound peers are (though such peers will not be synced from).
27/// Addnode connections are limited to 8 at a time and are counted separately from the -maxconnections limit.
28#[derive(Debug, Serialize)]
29pub struct AddnodeParams {
30 pub node: String,
31 pub command: String,
32 pub v2transport: bool,
33}
34
35/// Add the address of a potential peer to an address manager table. This RPC is for testing only.
36#[derive(Debug, Serialize)]
37pub struct AddpeeraddressParams {
38 pub address: String,
39 pub port: u16,
40 pub tried: bool,
41}
42
43/// Analyzes and provides information about the current status of a PSBT and its inputs
44#[derive(Debug, Serialize)]
45pub struct AnalyzepsbtParams {
46 pub psbt: String,
47}
48
49/// Safely copies the current wallet file to the specified destination, which can either be a directory or a path with a filename.
50#[derive(Debug, Serialize)]
51pub struct BackupwalletParams {
52 pub destination: String,
53}
54
55/// Bumps the fee of a transaction T, replacing it with a new transaction B.
56/// A transaction with the given txid must be in the wallet.
57/// The command will pay the additional fee by reducing change outputs or adding inputs when necessary.
58/// It may add a new change output if one does not already exist.
59/// All inputs in the original transaction will be included in the replacement transaction.
60/// The command will fail if the wallet or mempool contains a transaction that spends one of T"s outputs.
61/// By default, the new fee will be calculated automatically using the estimatesmartfee RPC.
62/// The user can specify a confirmation target for estimatesmartfee.
63/// Alternatively, the user can specify a fee rate in sat/vB for the new transaction.
64/// At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee
65/// returned by getnetworkinfo) to enter the node"s mempool.
66/// * WARNING: before version 0.21, fee_rate was in BTC/kvB. As of 0.21, fee_rate is in sat/vB. *
67#[derive(Debug, Serialize)]
68pub struct BumpfeeParams {
69 pub txid: bitcoin::Txid,
70 pub options: serde_json::Value,
71}
72
73/// Combine multiple partially signed Bitcoin transactions into one transaction.
74/// Implements the Combiner role.
75#[derive(Debug, Serialize)]
76pub struct CombinepsbtParams {
77 pub txs: Vec<serde_json::Value>,
78}
79
80/// Combine multiple partially signed transactions into one transaction.
81/// The combined transaction may be another partially signed transaction or a
82/// fully signed transaction.
83#[derive(Debug, Serialize)]
84pub struct CombinerawtransactionParams {
85 pub txs: Vec<serde_json::Value>,
86}
87
88/// Converts a network serialized transaction to a PSBT. This should be used only with createrawtransaction and fundrawtransaction
89/// createpsbt and walletcreatefundedpsbt should be used for new applications.
90#[derive(Debug, Serialize)]
91pub struct ConverttopsbtParams {
92 pub hexstring: String,
93 pub permitsigdata: bool,
94 pub iswitness: bool,
95}
96
97/// Creates a multi-signature address with n signatures of m keys required.
98/// It returns a json object with the address and redeemScript.
99#[derive(Debug, Serialize)]
100pub struct CreatemultisigParams {
101 pub nrequired: u32,
102 pub keys: Vec<String>,
103 pub address_type: String,
104}
105
106/// Creates a transaction in the Partially Signed Transaction format.
107/// Implements the Creator role.
108/// Note that the transaction"s inputs are not signed, and
109/// it is not stored in the wallet or transmitted to the network.
110#[derive(Debug, Serialize)]
111pub struct CreatepsbtParams {
112 pub inputs: Vec<serde_json::Value>,
113 pub outputs: Vec<serde_json::Value>,
114 pub locktime: u32,
115 pub replaceable: bool,
116 pub version: u32,
117}
118
119/// Create a transaction spending the given inputs and creating new outputs.
120/// Outputs can be addresses or data.
121/// Returns hex-encoded raw transaction.
122/// Note that the transaction"s inputs are not signed, and
123/// it is not stored in the wallet or transmitted to the network.
124#[derive(Debug, Serialize)]
125pub struct CreaterawtransactionParams {
126 pub inputs: Vec<serde_json::Value>,
127 pub outputs: Vec<serde_json::Value>,
128 pub locktime: u32,
129 pub replaceable: bool,
130 pub version: u32,
131}
132
133/// Creates and loads a new wallet.
134#[derive(Debug, Serialize)]
135pub struct CreatewalletParams {
136 pub wallet_name: String,
137 pub disable_private_keys: bool,
138 pub blank: bool,
139 pub passphrase: String,
140 pub avoid_reuse: bool,
141 pub descriptors: bool,
142 pub load_on_startup: bool,
143 pub external_signer: bool,
144}
145
146/// Creates the wallet"s descriptor for the given address type. The address type must be one that the wallet does not already have a descriptor for.
147/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
148#[derive(Debug, Serialize)]
149pub struct CreatewalletdescriptorParams {
150 pub _type: String,
151 pub options: serde_json::Value,
152}
153
154/// Return a JSON object representing the serialized, base64-encoded partially signed Bitcoin transaction.
155#[derive(Debug, Serialize)]
156pub struct DecodepsbtParams {
157 pub psbt: String,
158}
159
160/// Return a JSON object representing the serialized, hex-encoded transaction.
161#[derive(Debug, Serialize)]
162pub struct DecoderawtransactionParams {
163 pub hexstring: String,
164 pub iswitness: bool,
165}
166
167/// Decode a hex-encoded script.
168#[derive(Debug, Serialize)]
169pub struct DecodescriptParams {
170 pub hexstring: String,
171}
172
173/// Derives one or more addresses corresponding to an output descriptor.
174/// Examples of output descriptors are:
175/// pkh(<pubkey>) P2PKH outputs for the given pubkey
176/// wpkh(<pubkey>) Native segwit P2PKH outputs for the given pubkey
177/// sh(multi(<n>,<pubkey>,<pubkey>,...)) P2SH-multisig outputs for the given threshold and pubkeys
178/// raw(<hex script>) Outputs whose output script equals the specified hex-encoded bytes
179/// tr(<pubkey>,multi_a(<n>,<pubkey>,<pubkey>,...)) P2TR-multisig outputs for the given threshold and pubkeys
180///
181/// In the above, <pubkey> either refers to a fixed public key in hexadecimal notation, or to an xpub/xprv optionally followed by one
182/// or more path elements separated by "/", where "h" represents a hardened child key.
183/// For more information on output descriptors, see the documentation in the doc/descriptors.md file.
184#[derive(Debug, Serialize)]
185pub struct DeriveaddressesParams {
186 pub descriptor: String,
187 pub range: serde_json::Value,
188}
189
190/// Update all segwit inputs in a PSBT with information from output descriptors, the UTXO set or the mempool.
191/// Then, sign the inputs we are able to with information from the output descriptors.
192#[derive(Debug, Serialize)]
193pub struct DescriptorprocesspsbtParams {
194 pub psbt: String,
195 pub descriptors: Vec<serde_json::Value>,
196 pub sighashtype: String,
197 pub bip32derivs: bool,
198 pub finalize: bool,
199}
200
201/// Immediately disconnects from the specified peer node.
202///
203/// Strictly one out of "address" and "nodeid" can be provided to identify the node.
204///
205/// To disconnect by nodeid, either set "address" to the empty string, or call using the named "nodeid" argument only.
206#[derive(Debug, Serialize)]
207pub struct DisconnectnodeParams {
208 pub address: String,
209 pub nodeid: u64,
210}
211
212/// Write the serialized UTXO set to a file. This can be used in loadtxoutset afterwards if this snapshot height is supported in the chainparams as well.
213///
214/// Unless the "latest" type is requested, the node will roll back to the requested height and network activity will be suspended during this process. Because of this it is discouraged to interact with the node in any other way during the execution of this call to avoid inconsistent results and race conditions, particularly RPCs that interact with blockstorage.
215///
216/// This call may take several minutes. Make sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)
217#[derive(Debug, Serialize)]
218pub struct DumptxoutsetParams {
219 pub path: String,
220 pub _type: String,
221 pub options: serde_json::Value,
222}
223
224/// Simply echo back the input arguments. This command is for testing.
225///
226/// It will return an internal bug report when arg9="trigger_internal_bug" is passed.
227///
228/// The difference between echo and echojson is that echojson has argument conversion enabled in the client-side table in bitcoin-cli and the GUI. There is no server-side difference.
229#[derive(Debug, Serialize)]
230pub struct EchoParams {
231 pub arg0: String,
232 pub arg1: String,
233 pub arg2: String,
234 pub arg3: String,
235 pub arg4: String,
236 pub arg5: String,
237 pub arg6: String,
238 pub arg7: String,
239 pub arg8: String,
240 pub arg9: String,
241}
242
243/// Echo back the input argument, passing it through a spawned process in a multiprocess build.
244/// This command is for testing.
245#[derive(Debug, Serialize)]
246pub struct EchoipcParams {
247 pub arg: String,
248}
249
250/// Simply echo back the input arguments. This command is for testing.
251///
252/// It will return an internal bug report when arg9="trigger_internal_bug" is passed.
253///
254/// The difference between echo and echojson is that echojson has argument conversion enabled in the client-side table in bitcoin-cli and the GUI. There is no server-side difference.
255#[derive(Debug, Serialize)]
256pub struct EchojsonParams {
257 pub arg0: String,
258 pub arg1: String,
259 pub arg2: String,
260 pub arg3: String,
261 pub arg4: String,
262 pub arg5: String,
263 pub arg6: String,
264 pub arg7: String,
265 pub arg8: String,
266 pub arg9: String,
267}
268
269/// Encrypts the wallet with "passphrase". This is for first time encryption.
270/// After this, any calls that interact with private keys such as sending or signing
271/// will require the passphrase to be set prior to making these calls.
272/// Use the walletpassphrase call for this, and then walletlock call.
273/// If the wallet is already encrypted, use the walletpassphrasechange call.
274/// ** IMPORTANT **
275/// For security reasons, the encryption process will generate a new HD seed, resulting
276/// in the creation of a fresh set of active descriptors. Therefore, it is crucial to
277/// securely back up the newly generated wallet file using the backupwallet RPC.
278#[derive(Debug, Serialize)]
279pub struct EncryptwalletParams {
280 pub passphrase: String,
281}
282
283/// WARNING: This interface is unstable and may disappear or change!
284///
285/// WARNING: This is an advanced API call that is tightly coupled to the specific
286/// implementation of fee estimation. The parameters it can be called with
287/// and the results it returns will change if the internal implementation changes.
288///
289/// Estimates the approximate fee per kilobyte needed for a transaction to begin
290/// confirmation within conf_target blocks if possible. Uses virtual transaction size as
291/// defined in BIP 141 (witness data is discounted).
292#[derive(Debug, Serialize)]
293pub struct EstimaterawfeeParams {
294 pub conf_target: u64,
295 pub threshold: u64,
296}
297
298/// Estimates the approximate fee per kilobyte needed for a transaction to begin
299/// confirmation within conf_target blocks if possible and return the number of blocks
300/// for which the estimate is valid. Uses virtual transaction size as defined
301/// in BIP 141 (witness data is discounted).
302#[derive(Debug, Serialize)]
303pub struct EstimatesmartfeeParams {
304 pub conf_target: u64,
305 pub estimate_mode: String,
306}
307
308/// Finalize the inputs of a PSBT. If the transaction is fully signed, it will produce a
309/// network serialized transaction which can be broadcast with sendrawtransaction. Otherwise a PSBT will be
310/// created which has the final_scriptSig and final_scriptwitness fields filled for inputs that are complete.
311/// Implements the Finalizer and Extractor roles.
312#[derive(Debug, Serialize)]
313pub struct FinalizepsbtParams {
314 pub psbt: String,
315 pub extract: bool,
316}
317
318/// If the transaction has no inputs, they will be automatically selected to meet its out value.
319/// It will add at most one change output to the outputs.
320/// No existing outputs will be modified unless "subtractFeeFromOutputs" is specified.
321/// Note that inputs which were signed may need to be resigned after completion since in/outputs have been added.
322/// The inputs added will not be signed, use signrawtransactionwithkey
323/// or signrawtransactionwithwallet for that.
324/// All existing inputs must either have their previous output transaction be in the wallet
325/// or be in the UTXO set. Solving data must be provided for non-wallet inputs.
326/// Note that all inputs selected must be of standard form and P2SH scripts must be
327/// in the wallet using importdescriptors (to calculate fees).
328/// You can see whether this is the case by checking the "solvable" field in the listunspent output.
329/// Note that if specifying an exact fee rate, the resulting transaction may have a higher fee rate
330/// if the transaction has unconfirmed inputs. This is because the wallet will attempt to make the
331/// entire package have the given fee rate, not the resulting transaction.
332#[derive(Debug, Serialize)]
333pub struct FundrawtransactionParams {
334 pub hexstring: String,
335 pub options: serde_json::Value,
336 pub iswitness: bool,
337}
338
339/// Mine a set of ordered transactions to a specified address or descriptor and return the block hash.
340#[derive(Debug, Serialize)]
341pub struct GenerateblockParams {
342 pub output: String,
343 pub transactions: Vec<serde_json::Value>,
344 pub submit: bool,
345}
346
347/// Mine to a specified address and return the block hashes.
348#[derive(Debug, Serialize)]
349pub struct GeneratetoaddressParams {
350 pub nblocks: u64,
351 pub address: String,
352 pub maxtries: u64,
353}
354
355/// Mine to a specified descriptor and return the block hashes.
356#[derive(Debug, Serialize)]
357pub struct GeneratetodescriptorParams {
358 pub num_blocks: u64,
359 pub descriptor: String,
360 pub maxtries: u64,
361}
362
363/// Returns information about the given added node, or all added nodes
364/// (note that onetry addnodes are not listed here)
365#[derive(Debug, Serialize)]
366pub struct GetaddednodeinfoParams {
367 pub node: String,
368}
369
370/// Returns the list of addresses assigned the specified label.
371#[derive(Debug, Serialize)]
372pub struct GetaddressesbylabelParams {
373 pub label: String,
374}
375
376/// Return information about the given bitcoin address.
377/// Some of the information will only be present if the address is in the active wallet.
378#[derive(Debug, Serialize)]
379pub struct GetaddressinfoParams {
380 pub address: String,
381}
382
383/// Returns the total available balance.
384/// The available balance is what the wallet considers currently spendable, and is
385/// thus affected by options which limit spendability such as -spendzeroconfchange.
386#[derive(Debug, Serialize)]
387pub struct GetbalanceParams {
388 pub dummy: Option<String>,
389 pub minconf: u32,
390 pub include_watchonly: bool,
391 pub avoid_reuse: bool,
392}
393
394/// If verbosity is 0, returns a string that is serialized, hex-encoded data for block "hash".
395/// If verbosity is 1, returns an Object with information about block <hash>.
396/// If verbosity is 2, returns an Object with information about block <hash> and information about each transaction.
397/// If verbosity is 3, returns an Object with information about block <hash> and information about each transaction, including prevout information for inputs (only for unpruned blocks in the current best chain).
398#[derive(Debug, Serialize)]
399pub struct GetblockParams {
400 pub blockhash: bitcoin::BlockHash,
401 pub verbosity: u32,
402}
403
404/// Retrieve a BIP 157 content filter for a particular block.
405#[derive(Debug, Serialize)]
406pub struct GetblockfilterParams {
407 pub blockhash: bitcoin::BlockHash,
408 pub filtertype: String,
409}
410
411/// Attempt to fetch block from a given peer.
412///
413/// We must have the header for this block, e.g. using submitheader.
414/// The block will not have any undo data which can limit the usage of the block data in a context where the undo data is needed.
415/// Subsequent calls for the same block may cause the response from the previous peer to be ignored.
416/// Peers generally ignore requests for a stale block that they never fully verified, or one that is more than a month old.
417/// When a peer does not respond with a block, we will disconnect.
418/// Note: The block could be re-pruned as soon as it is received.
419///
420/// Returns an empty JSON object if the request was successfully scheduled.
421#[derive(Debug, Serialize)]
422pub struct GetblockfrompeerParams {
423 pub blockhash: bitcoin::BlockHash,
424 pub peer_id: u64,
425}
426
427/// Returns hash of block in best-block-chain at height provided.
428#[derive(Debug, Serialize)]
429pub struct GetblockhashParams {
430 pub height: u64,
431}
432
433/// If verbose is false, returns a string that is serialized, hex-encoded data for blockheader "hash".
434/// If verbose is true, returns an Object with information about blockheader <hash>.
435#[derive(Debug, Serialize)]
436pub struct GetblockheaderParams {
437 pub blockhash: bitcoin::BlockHash,
438 pub verbose: bool,
439}
440
441/// Compute per block statistics for a given window. All amounts are in satoshis.
442/// It won"t work for some heights with pruning.
443#[derive(Debug, Serialize)]
444pub struct GetblockstatsParams {
445 pub hash_or_height: HashOrHeight,
446 pub stats: Vec<String>,
447}
448
449/// If the request parameters include a "mode" key, that is used to explicitly select between the default "template" request or a "proposal".
450/// It returns data needed to construct a block to work on.
451/// For full specification, see BIPs 22, 23, 9, and 145:
452/// https://github.com/bitcoin/bips/blob/master/bip-0022.mediawiki
453/// https://github.com/bitcoin/bips/blob/master/bip-0023.mediawiki
454/// https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki#getblocktemplate_changes
455/// https://github.com/bitcoin/bips/blob/master/bip-0145.mediawiki
456#[derive(Debug, Serialize)]
457pub struct GetblocktemplateParams {
458 pub template_request: serde_json::Value,
459}
460
461/// Compute statistics about the total number and rate of transactions in the chain.
462#[derive(Debug, Serialize)]
463pub struct GetchaintxstatsParams {
464 pub nblocks: u64,
465 pub blockhash: bitcoin::BlockHash,
466}
467
468/// Returns an object containing various state info regarding deployments of consensus changes.
469#[derive(Debug, Serialize)]
470pub struct GetdeploymentinfoParams {
471 pub blockhash: bitcoin::BlockHash,
472}
473
474/// Get spend and receive activity associated with a set of descriptors for a set of blocks. This command pairs well with the ``relevant_blocks`` output of ``scanblocks()``.
475/// This call may take several minutes. If you encounter timeouts, try specifying no RPC timeout (bitcoin-cli -rpcclienttimeout=0)
476#[derive(Debug, Serialize)]
477pub struct GetdescriptoractivityParams {
478 pub blockhashes: Vec<serde_json::Value>,
479 pub scanobjects: Vec<serde_json::Value>,
480 pub include_mempool: bool,
481}
482
483/// Analyses a descriptor.
484#[derive(Debug, Serialize)]
485pub struct GetdescriptorinfoParams {
486 pub descriptor: String,
487}
488
489/// List all BIP 32 HD keys in the wallet and which descriptors use them.
490#[derive(Debug, Serialize)]
491pub struct GethdkeysParams {
492 pub options: serde_json::Value,
493}
494
495/// Returns the status of one or all available indices currently running in the node.
496#[derive(Debug, Serialize)]
497pub struct GetindexinfoParams {
498 pub index_name: String,
499}
500
501/// Returns an object containing information about memory usage.
502#[derive(Debug, Serialize)]
503pub struct GetmemoryinfoParams {
504 pub mode: String,
505}
506
507/// If txid is in the mempool, returns all in-mempool ancestors.
508#[derive(Debug, Serialize)]
509pub struct GetmempoolancestorsParams {
510 pub txid: bitcoin::Txid,
511 pub verbose: bool,
512}
513
514/// If txid is in the mempool, returns all in-mempool descendants.
515#[derive(Debug, Serialize)]
516pub struct GetmempooldescendantsParams {
517 pub txid: bitcoin::Txid,
518 pub verbose: bool,
519}
520
521/// Returns mempool data for given transaction
522#[derive(Debug, Serialize)]
523pub struct GetmempoolentryParams {
524 pub txid: bitcoin::Txid,
525}
526
527/// Returns the estimated network hashes per second based on the last n blocks.
528/// Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change.
529/// Pass in [height] to estimate the network speed at the time when a certain block was found.
530#[derive(Debug, Serialize)]
531pub struct GetnetworkhashpsParams {
532 pub nblocks: u64,
533 pub height: u64,
534}
535
536/// Returns a new Bitcoin address for receiving payments.
537/// If "label" is specified, it is added to the address book
538/// so payments received with the address will be associated with "label".
539#[derive(Debug, Serialize)]
540pub struct GetnewaddressParams {
541 pub label: String,
542 pub address_type: String,
543}
544
545/// Return known addresses, after filtering for quality and recency.
546/// These can potentially be used to find new peers in the network.
547/// The total number of addresses known to the node may be higher.
548#[derive(Debug, Serialize)]
549pub struct GetnodeaddressesParams {
550 pub count: u64,
551 pub network: String,
552}
553
554/// Shows transactions in the tx orphanage.
555///
556/// EXPERIMENTAL warning: this call may be changed in future releases.
557#[derive(Debug, Serialize)]
558pub struct GetorphantxsParams {
559 pub verbosity: u32,
560}
561
562/// Returns a new Bitcoin address, for receiving change.
563/// This is for use with raw transactions, NOT normal use.
564#[derive(Debug, Serialize)]
565pub struct GetrawchangeaddressParams {
566 pub address_type: String,
567}
568
569/// Returns all transaction ids in memory pool as a json array of string transaction ids.
570///
571/// Hint: use getmempoolentry to fetch a specific transaction from the mempool.
572#[derive(Debug, Serialize)]
573pub struct GetrawmempoolParams {
574 pub verbose: bool,
575 pub mempool_sequence: bool,
576}
577
578/// By default, this call only returns a transaction if it is in the mempool. If -txindex is enabled
579/// and no blockhash argument is passed, it will return the transaction if it is in the mempool or any block.
580/// If a blockhash argument is passed, it will return the transaction if
581/// the specified block is available and the transaction is in that block.
582///
583/// Hint: Use gettransaction for wallet transactions.
584///
585/// If verbosity is 0 or omitted, returns the serialized transaction as a hex-encoded string.
586/// If verbosity is 1, returns a JSON Object with information about the transaction.
587/// If verbosity is 2, returns a JSON Object with information about the transaction, including fee and prevout information.
588#[derive(Debug, Serialize)]
589pub struct GetrawtransactionParams {
590 pub txid: bitcoin::Txid,
591 pub verbosity: u32,
592 pub blockhash: bitcoin::BlockHash,
593}
594
595/// Returns the total amount received by the given address in transactions with at least minconf confirmations.
596#[derive(Debug, Serialize)]
597pub struct GetreceivedbyaddressParams {
598 pub address: String,
599 pub minconf: u32,
600 pub include_immature_coinbase: bool,
601}
602
603/// Returns the total amount received by addresses with <label> in transactions with at least [minconf] confirmations.
604#[derive(Debug, Serialize)]
605pub struct GetreceivedbylabelParams {
606 pub label: String,
607 pub minconf: u32,
608 pub include_immature_coinbase: bool,
609}
610
611/// Get detailed information about in-wallet transaction <txid>
612#[derive(Debug, Serialize)]
613pub struct GettransactionParams {
614 pub txid: bitcoin::Txid,
615 pub include_watchonly: bool,
616 pub verbose: bool,
617}
618
619/// Returns details about an unspent transaction output.
620#[derive(Debug, Serialize)]
621pub struct GettxoutParams {
622 pub txid: bitcoin::Txid,
623 pub n: u32,
624 pub include_mempool: bool,
625}
626
627/// Returns a hex-encoded proof that "txid" was included in a block.
628///
629/// NOTE: By default this function only works sometimes. This is when there is an
630/// unspent output in the utxo for this transaction. To make it always work,
631/// you need to maintain a transaction index, using the -txindex command line option or
632/// specify the block in which the transaction is included manually (by blockhash).
633#[derive(Debug, Serialize)]
634pub struct GettxoutproofParams {
635 pub txids: Vec<bitcoin::Txid>,
636 pub blockhash: bitcoin::BlockHash,
637}
638
639/// Returns statistics about the unspent transaction output set.
640/// Note this call may take some time if you are not using coinstatsindex.
641#[derive(Debug, Serialize)]
642pub struct GettxoutsetinfoParams {
643 pub hash_type: String,
644 pub hash_or_height: HashOrHeight,
645 pub use_index: bool,
646}
647
648/// Scans the mempool to find transactions spending any of the given outputs
649#[derive(Debug, Serialize)]
650pub struct GettxspendingprevoutParams {
651 pub outputs: Vec<serde_json::Value>,
652}
653
654/// List all commands, or get help for a specified command.
655#[derive(Debug, Serialize)]
656pub struct HelpParams {
657 pub command: String,
658}
659
660/// Import descriptors. This will trigger a rescan of the blockchain based on the earliest timestamp of all descriptors being imported. Requires a new wallet backup.
661/// When importing descriptors with multipath key expressions, if the multipath specifier contains exactly two elements, the descriptor produced from the second element will be imported as an internal descriptor.
662///
663/// Note: This call can take over an hour to complete if using an early timestamp; during that time, other rpc calls
664/// may report that the imported keys, addresses or scripts exist but related transactions are still missing.
665/// The rescan is significantly faster if block filters are available (using startup option "-blockfilterindex=1").
666#[derive(Debug, Serialize)]
667pub struct ImportdescriptorsParams {
668 pub requests: Vec<serde_json::Value>,
669}
670
671/// Import a mempool.dat file and attempt to add its contents to the mempool.
672/// Warning: Importing untrusted files is dangerous, especially if metadata from the file is taken over.
673#[derive(Debug, Serialize)]
674pub struct ImportmempoolParams {
675 pub filepath: String,
676 pub options: serde_json::Value,
677}
678
679/// Imports funds without rescan. Corresponding address or script must previously be included in wallet. Aimed towards pruned wallets. The end-user is responsible to import additional transactions that subsequently spend the imported outputs or rescan after the point in the blockchain the transaction is included.
680#[derive(Debug, Serialize)]
681pub struct ImportprunedfundsParams {
682 pub rawtransaction: String,
683 pub txoutproof: String,
684}
685
686/// Permanently marks a block as invalid, as if it violated a consensus rule.
687#[derive(Debug, Serialize)]
688pub struct InvalidateblockParams {
689 pub blockhash: bitcoin::BlockHash,
690}
691
692/// Joins multiple distinct PSBTs with different inputs and outputs into one PSBT with inputs and outputs from all of the PSBTs
693/// No input in any of the PSBTs can be in more than one of the PSBTs.
694#[derive(Debug, Serialize)]
695pub struct JoinpsbtsParams {
696 pub txs: Vec<serde_json::Value>,
697}
698
699/// Refills each descriptor keypool in the wallet up to the specified number of new keys.
700/// By default, descriptor wallets have 4 active ranged descriptors ("legacy", "p2sh-segwit", "bech32", "bech32m"), each with 1000 entries.
701///
702/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
703#[derive(Debug, Serialize)]
704pub struct KeypoolrefillParams {
705 pub newsize: u64,
706}
707
708/// List all descriptors present in a wallet.
709#[derive(Debug, Serialize)]
710pub struct ListdescriptorsParams {
711 pub private: bool,
712}
713
714/// Returns the list of all labels, or labels that are assigned to addresses with a specific purpose.
715#[derive(Debug, Serialize)]
716pub struct ListlabelsParams {
717 pub purpose: String,
718}
719
720/// List balances by receiving address.
721#[derive(Debug, Serialize)]
722pub struct ListreceivedbyaddressParams {
723 pub minconf: u32,
724 pub include_empty: bool,
725 pub include_watchonly: bool,
726 pub address_filter: String,
727 pub include_immature_coinbase: bool,
728}
729
730/// List received transactions by label.
731#[derive(Debug, Serialize)]
732pub struct ListreceivedbylabelParams {
733 pub minconf: u32,
734 pub include_empty: bool,
735 pub include_watchonly: bool,
736 pub include_immature_coinbase: bool,
737}
738
739/// Get all transactions in blocks since block [blockhash], or all transactions if omitted.
740/// If "blockhash" is no longer a part of the main chain, transactions from the fork point onward are included.
741/// Additionally, if include_removed is set, transactions affecting the wallet which were removed are returned in the "removed" array.
742#[derive(Debug, Serialize)]
743pub struct ListsinceblockParams {
744 pub blockhash: bitcoin::BlockHash,
745 pub target_confirmations: u64,
746 pub include_watchonly: bool,
747 pub include_removed: bool,
748 pub include_change: bool,
749 pub label: String,
750}
751
752/// If a label name is provided, this will return only incoming transactions paying to addresses with the specified label.
753///
754/// Returns up to "count" most recent transactions skipping the first "from" transactions.
755#[derive(Debug, Serialize)]
756pub struct ListtransactionsParams {
757 pub label: String,
758 pub count: u64,
759 pub skip: u64,
760 pub include_watchonly: bool,
761}
762
763/// Returns array of unspent transaction outputs
764/// with between minconf and maxconf (inclusive) confirmations.
765/// Optionally filter to only include txouts paid to specified addresses.
766#[derive(Debug, Serialize)]
767pub struct ListunspentParams {
768 pub minconf: u32,
769 pub maxconf: u32,
770 pub addresses: Vec<String>,
771 pub include_unsafe: bool,
772 pub query_options: serde_json::Value,
773}
774
775/// Load the serialized UTXO set from a file.
776/// Once this snapshot is loaded, its contents will be deserialized into a second chainstate data structure, which is then used to sync to the network"s tip. Meanwhile, the original chainstate will complete the initial block download process in the background, eventually validating up to the block that the snapshot is based upon.
777///
778/// The result is a usable bitcoind instance that is current with the network tip in a matter of minutes rather than hours. UTXO snapshot are typically obtained from third-party sources (HTTP, torrent, etc.) which is reasonable since their contents are always checked by hash.
779///
780/// You can find more information on this process in the ``assumeutxo`` design document (<https://github.com/bitcoin/bitcoin/blob/master/doc/design/assumeutxo.md>).
781#[derive(Debug, Serialize)]
782pub struct LoadtxoutsetParams {
783 pub path: String,
784}
785
786/// Loads a wallet from a wallet file or directory.
787/// Note that all wallet command-line options used when starting bitcoind will be
788/// applied to the new wallet.
789#[derive(Debug, Serialize)]
790pub struct LoadwalletParams {
791 pub filename: String,
792 pub load_on_startup: bool,
793}
794
795/// Updates list of temporarily unspendable outputs.
796/// Temporarily lock (unlock=false) or unlock (unlock=true) specified transaction outputs.
797/// If no transaction outputs are specified when unlocking then all current locked transaction outputs are unlocked.
798/// A locked transaction output will not be chosen by automatic coin selection, when spending bitcoins.
799/// Manually selected coins are automatically unlocked.
800/// Locks are stored in memory only, unless persistent=true, in which case they will be written to the
801/// wallet database and loaded on node start. Unwritten (persistent=false) locks are always cleared
802/// (by virtue of process exit) when a node stops or fails. Unlocking will clear both persistent and not.
803/// Also see the listunspent call
804#[derive(Debug, Serialize)]
805pub struct LockunspentParams {
806 pub unlock: bool,
807 pub transactions: Vec<serde_json::Value>,
808 pub persistent: bool,
809}
810
811/// Gets and sets the logging configuration.
812/// When called without an argument, returns the list of categories with status that are currently being debug logged or not.
813/// When called with arguments, adds or removes categories from debug logging and return the lists above.
814/// The arguments are evaluated in order "include", "exclude".
815/// If an item is both included and excluded, it will thus end up being excluded.
816/// The valid logging categories are: addrman, bench, blockstorage, cmpctblock, coindb, estimatefee, http, i2p, ipc, leveldb, libevent, mempool, mempoolrej, net, proxy, prune, qt, rand, reindex, rpc, scan, selectcoins, tor, txpackages, txreconciliation, validation, walletdb, zmq
817/// In addition, the following are available as category names with special meanings:
818/// - "all", "1" : represent all logging categories.
819#[derive(Debug, Serialize)]
820pub struct LoggingParams {
821 pub include: Vec<serde_json::Value>,
822 pub exclude: Vec<serde_json::Value>,
823}
824
825/// Migrate the wallet to a descriptor wallet.
826/// A new wallet backup will need to be made.
827///
828/// The migration process will create a backup of the wallet before migrating. This backup
829/// file will be named <wallet name>-<timestamp>.legacy.bak and can be found in the directory
830/// for this wallet. In the event of an incorrect migration, the backup can be restored using restorewallet.
831/// Encrypted wallets must have the passphrase provided as an argument to this call.
832///
833/// This RPC may take a long time to complete. Increasing the RPC client timeout is recommended.
834#[derive(Debug, Serialize)]
835pub struct MigratewalletParams {
836 pub wallet_name: String,
837 pub passphrase: String,
838}
839
840/// Bump the scheduler into the future (-regtest only)
841#[derive(Debug, Serialize)]
842pub struct MockschedulerParams {
843 pub delta_time: u64,
844}
845
846/// Treats a block as if it were received before others with the same work.
847///
848/// A later preciousblock call can override the effect of an earlier one.
849///
850/// The effects of preciousblock are not retained across restarts.
851#[derive(Debug, Serialize)]
852pub struct PreciousblockParams {
853 pub blockhash: bitcoin::BlockHash,
854}
855
856/// Accepts the transaction into mined blocks at a higher (or lower) priority
857#[derive(Debug, Serialize)]
858pub struct PrioritisetransactionParams {
859 pub txid: bitcoin::Txid,
860 pub dummy: Option<String>,
861 pub fee_delta: f64,
862}
863
864/// Attempts to delete block and undo data up to a specified height or timestamp, if eligible for pruning.
865/// Requires ``-prune`` to be enabled at startup. While pruned data may be re-fetched in some cases (e.g., via ``getblockfrompeer``), local deletion is irreversible.
866#[derive(Debug, Serialize)]
867pub struct PruneblockchainParams {
868 pub height: u64,
869}
870
871/// Bumps the fee of a transaction T, replacing it with a new transaction B.
872/// Returns a PSBT instead of creating and signing a new transaction.
873/// A transaction with the given txid must be in the wallet.
874/// The command will pay the additional fee by reducing change outputs or adding inputs when necessary.
875/// It may add a new change output if one does not already exist.
876/// All inputs in the original transaction will be included in the replacement transaction.
877/// The command will fail if the wallet or mempool contains a transaction that spends one of T"s outputs.
878/// By default, the new fee will be calculated automatically using the estimatesmartfee RPC.
879/// The user can specify a confirmation target for estimatesmartfee.
880/// Alternatively, the user can specify a fee rate in sat/vB for the new transaction.
881/// At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee
882/// returned by getnetworkinfo) to enter the node"s mempool.
883/// * WARNING: before version 0.21, fee_rate was in BTC/kvB. As of 0.21, fee_rate is in sat/vB. *
884#[derive(Debug, Serialize)]
885pub struct PsbtbumpfeeParams {
886 pub txid: bitcoin::Txid,
887 pub options: serde_json::Value,
888}
889
890/// Removes invalidity status of a block, its ancestors and its descendants, reconsider them for activation.
891/// This can be used to undo the effects of invalidateblock.
892#[derive(Debug, Serialize)]
893pub struct ReconsiderblockParams {
894 pub blockhash: bitcoin::BlockHash,
895}
896
897/// Deletes the specified transaction from the wallet. Meant for use with pruned wallets and as a companion to importprunedfunds. This will affect wallet balances.
898#[derive(Debug, Serialize)]
899pub struct RemoveprunedfundsParams {
900 pub txid: bitcoin::Txid,
901}
902
903/// Rescan the local blockchain for wallet related transactions.
904/// Note: Use "getwalletinfo" to query the scanning progress.
905/// The rescan is significantly faster if block filters are available
906/// (using startup option "-blockfilterindex=1").
907#[derive(Debug, Serialize)]
908pub struct RescanblockchainParams {
909 pub start_height: u64,
910 pub stop_height: u64,
911}
912
913/// Restores and loads a wallet from backup.
914///
915/// The rescan is significantly faster if block filters are available
916/// (using startup option "-blockfilterindex=1").
917#[derive(Debug, Serialize)]
918pub struct RestorewalletParams {
919 pub wallet_name: String,
920 pub backup_file: String,
921 pub load_on_startup: bool,
922}
923
924/// Return relevant blockhashes for given descriptors (requires blockfilterindex).
925/// This call may take several minutes. Make sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)
926#[derive(Debug, Serialize)]
927pub struct ScanblocksParams {
928 pub action: String,
929 pub scanobjects: Vec<serde_json::Value>,
930 pub start_height: u64,
931 pub stop_height: u64,
932 pub filtertype: String,
933 pub options: serde_json::Value,
934}
935
936/// Scans the unspent transaction output set for entries that match certain output descriptors.
937/// Examples of output descriptors are:
938/// addr(<address>) Outputs whose output script corresponds to the specified address (does not include P2PK)
939/// raw(<hex script>) Outputs whose output script equals the specified hex-encoded bytes
940/// combo(<pubkey>) P2PK, P2PKH, P2WPKH, and P2SH-P2WPKH outputs for the given pubkey
941/// pkh(<pubkey>) P2PKH outputs for the given pubkey
942/// sh(multi(<n>,<pubkey>,<pubkey>,...)) P2SH-multisig outputs for the given threshold and pubkeys
943/// tr(<pubkey>) P2TR
944/// tr(<pubkey>,{pk(<pubkey>)}) P2TR with single fallback pubkey in tapscript
945/// rawtr(<pubkey>) P2TR with the specified key as output key rather than inner
946/// wsh(and_v(v:pk(<pubkey>),after(2))) P2WSH miniscript with mandatory pubkey and a timelock
947///
948/// In the above, <pubkey> either refers to a fixed public key in hexadecimal notation, or to an xpub/xprv optionally followed by one
949/// or more path elements separated by "/", and optionally ending in "/*" (unhardened), or "/*"" or "/*h" (hardened) to specify all
950/// unhardened or hardened child keys.
951/// In the latter case, a range needs to be specified by below if different from 1000.
952/// For more information on output descriptors, see the documentation in the doc/descriptors.md file.
953#[derive(Debug, Serialize)]
954pub struct ScantxoutsetParams {
955 pub action: String,
956 pub scanobjects: Vec<serde_json::Value>,
957}
958
959/// EXPERIMENTAL warning: this call may be changed in future releases.
960///
961/// Send a transaction.
962#[derive(Debug, Serialize)]
963pub struct SendParams {
964 pub outputs: Vec<serde_json::Value>,
965 pub conf_target: u64,
966 pub estimate_mode: String,
967 pub fee_rate: f64,
968 pub options: serde_json::Value,
969 pub version: u32,
970}
971
972/// EXPERIMENTAL warning: this call may be changed in future releases.
973///
974/// Spend the value of all (or specific) confirmed UTXOs and unconfirmed change in the wallet to one or more recipients.
975/// Unconfirmed inbound UTXOs and locked UTXOs will not be spent. Sendall will respect the avoid_reuse wallet flag.
976/// If your wallet contains many small inputs, either because it received tiny payments or as a result of accumulating change, consider using ``send_max`` to exclude inputs that are worth less than the fees needed to spend them.
977#[derive(Debug, Serialize)]
978pub struct SendallParams {
979 pub recipients: Vec<serde_json::Value>,
980 pub conf_target: u64,
981 pub estimate_mode: String,
982 pub fee_rate: f64,
983 pub options: serde_json::Value,
984}
985
986/// Send multiple times. Amounts are double-precision floating point numbers.
987/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
988#[derive(Debug, Serialize)]
989pub struct SendmanyParams {
990 pub dummy: Option<String>,
991 pub amounts: serde_json::Value,
992 pub minconf: u32,
993 pub comment: String,
994 pub subtractfeefrom: Vec<serde_json::Value>,
995 pub replaceable: bool,
996 pub conf_target: u64,
997 pub estimate_mode: String,
998 pub fee_rate: f64,
999 pub verbose: bool,
1000}
1001
1002/// Send a p2p message to a peer specified by id.
1003/// The message type and body must be provided, the message header will be generated.
1004/// This RPC is for testing only.
1005#[derive(Debug, Serialize)]
1006pub struct SendmsgtopeerParams {
1007 pub peer_id: u64,
1008 pub msg_type: String,
1009 pub msg: String,
1010}
1011
1012/// Submit a raw transaction (serialized, hex-encoded) to local node and network.
1013///
1014/// The transaction will be sent unconditionally to all peers, so using sendrawtransaction
1015/// for manual rebroadcast may degrade privacy by leaking the transaction"s origin, as
1016/// nodes will normally not rebroadcast non-wallet transactions already in their mempool.
1017///
1018/// A specific exception, RPC_TRANSACTION_ALREADY_IN_UTXO_SET, may throw if the transaction cannot be added to the mempool.
1019///
1020/// Related RPCs: createrawtransaction, signrawtransactionwithkey
1021#[derive(Debug, Serialize)]
1022pub struct SendrawtransactionParams {
1023 pub hexstring: String,
1024 pub maxfeerate: f64,
1025 pub maxburnamount: f64,
1026}
1027
1028/// Send an amount to a given address.
1029/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
1030#[derive(Debug, Serialize)]
1031pub struct SendtoaddressParams {
1032 pub address: String,
1033 pub amount: bitcoin::Amount,
1034 pub comment: String,
1035 pub comment_to: String,
1036 pub subtractfeefromamount: bool,
1037 pub replaceable: bool,
1038 pub conf_target: u64,
1039 pub estimate_mode: String,
1040 pub avoid_reuse: bool,
1041 pub fee_rate: f64,
1042 pub verbose: bool,
1043}
1044
1045/// Attempts to add or remove an IP/Subnet from the banned list.
1046#[derive(Debug, Serialize)]
1047pub struct SetbanParams {
1048 pub subnet: String,
1049 pub command: String,
1050 pub bantime: u64,
1051 pub absolute: bool,
1052}
1053
1054/// Sets the label associated with the given address.
1055#[derive(Debug, Serialize)]
1056pub struct SetlabelParams {
1057 pub address: String,
1058 pub label: String,
1059}
1060
1061/// Set the local time to given timestamp (-regtest only)
1062#[derive(Debug, Serialize)]
1063pub struct SetmocktimeParams {
1064 pub timestamp: u64,
1065}
1066
1067/// Disable/enable all p2p network activity.
1068#[derive(Debug, Serialize)]
1069pub struct SetnetworkactiveParams {
1070 pub state: bool,
1071}
1072
1073/// (DEPRECATED) Set the transaction fee rate in BTC/kvB for this wallet. Overrides the global -paytxfee command line parameter.
1074/// Can be deactivated by passing 0 as the fee. In that case automatic fee selection will be used by default.
1075#[derive(Debug, Serialize)]
1076pub struct SettxfeeParams {
1077 pub amount: bitcoin::Amount,
1078}
1079
1080/// Change the state of the given wallet flag for a wallet.
1081#[derive(Debug, Serialize)]
1082pub struct SetwalletflagParams {
1083 pub flag: String,
1084 pub value: bool,
1085}
1086
1087/// Sign a message with the private key of an address
1088/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
1089#[derive(Debug, Serialize)]
1090pub struct SignmessageParams {
1091 pub address: String,
1092 pub message: String,
1093}
1094
1095/// Sign a message with the private key of an address
1096#[derive(Debug, Serialize)]
1097pub struct SignmessagewithprivkeyParams {
1098 pub privkey: String,
1099 pub message: String,
1100}
1101
1102/// Sign inputs for raw transaction (serialized, hex-encoded).
1103/// The second argument is an array of base58-encoded private
1104/// keys that will be the only keys used to sign the transaction.
1105/// The third optional argument (may be null) is an array of previous transaction outputs that
1106/// this transaction depends on but may not yet be in the block chain.
1107#[derive(Debug, Serialize)]
1108pub struct SignrawtransactionwithkeyParams {
1109 pub hexstring: String,
1110 pub privkeys: Vec<String>,
1111 pub prevtxs: Vec<serde_json::Value>,
1112 pub sighashtype: String,
1113}
1114
1115/// Sign inputs for raw transaction (serialized, hex-encoded).
1116/// The second optional argument (may be null) is an array of previous transaction outputs that
1117/// this transaction depends on but may not yet be in the block chain.
1118/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
1119#[derive(Debug, Serialize)]
1120pub struct SignrawtransactionwithwalletParams {
1121 pub hexstring: String,
1122 pub prevtxs: Vec<serde_json::Value>,
1123 pub sighashtype: String,
1124}
1125
1126/// Calculate the balance change resulting in the signing and broadcasting of the given transaction(s).
1127#[derive(Debug, Serialize)]
1128pub struct SimulaterawtransactionParams {
1129 pub rawtxs: Vec<serde_json::Value>,
1130 pub options: serde_json::Value,
1131}
1132
1133/// Request a graceful shutdown of Bitcoin Core.
1134#[derive(Debug, Serialize)]
1135pub struct StopParams {
1136 pub wait: u64,
1137}
1138
1139/// Attempts to submit new block to network.
1140/// See https://en.bitcoin.it/wiki/BIP_0022 for full specification.
1141#[derive(Debug, Serialize)]
1142pub struct SubmitblockParams {
1143 pub hexdata: String,
1144 pub dummy: Option<String>,
1145}
1146
1147/// Decode the given hexdata as a header and submit it as a candidate chain tip if valid.
1148/// Throws when the header is invalid.
1149#[derive(Debug, Serialize)]
1150pub struct SubmitheaderParams {
1151 pub hexdata: String,
1152}
1153
1154/// Submit a package of raw transactions (serialized, hex-encoded) to local node.
1155/// The package will be validated according to consensus and mempool policy rules. If any transaction passes, it will be accepted to mempool.
1156/// This RPC is experimental and the interface may be unstable. Refer to doc/policy/packages.md for documentation on package policies.
1157/// Warning: successful submission does not mean the transactions will propagate throughout the network.
1158#[derive(Debug, Serialize)]
1159pub struct SubmitpackageParams {
1160 pub package: Vec<serde_json::Value>,
1161 pub maxfeerate: f64,
1162 pub maxburnamount: f64,
1163}
1164
1165/// Returns result of mempool acceptance tests indicating if raw transaction(s) (serialized, hex-encoded) would be accepted by mempool.
1166///
1167/// If multiple transactions are passed in, parents must come before children and package policies apply: the transactions cannot conflict with any mempool transactions or each other.
1168///
1169/// If one transaction fails, other transactions may not be fully validated (the "allowed" key will be blank).
1170///
1171/// The maximum number of transactions allowed is 25.
1172///
1173/// This checks if transactions violate the consensus or policy rules.
1174///
1175/// See sendrawtransaction call.
1176#[derive(Debug, Serialize)]
1177pub struct TestmempoolacceptParams {
1178 pub rawtxs: Vec<serde_json::Value>,
1179 pub maxfeerate: f64,
1180}
1181
1182/// Unloads the wallet referenced by the request endpoint or the wallet_name argument.
1183/// If both are specified, they must be identical.
1184#[derive(Debug, Serialize)]
1185pub struct UnloadwalletParams {
1186 pub wallet_name: String,
1187 pub load_on_startup: bool,
1188}
1189
1190/// Updates all segwit inputs and outputs in a PSBT with data from output descriptors, the UTXO set, txindex, or the mempool.
1191#[derive(Debug, Serialize)]
1192pub struct UtxoupdatepsbtParams {
1193 pub psbt: String,
1194 pub descriptors: Vec<serde_json::Value>,
1195}
1196
1197/// Return information about the given bitcoin address.
1198#[derive(Debug, Serialize)]
1199pub struct ValidateaddressParams {
1200 pub address: String,
1201}
1202
1203/// Verifies blockchain database.
1204#[derive(Debug, Serialize)]
1205pub struct VerifychainParams {
1206 pub checklevel: u32,
1207 pub nblocks: u64,
1208}
1209
1210/// Verify a signed message.
1211#[derive(Debug, Serialize)]
1212pub struct VerifymessageParams {
1213 pub address: String,
1214 pub signature: String,
1215 pub message: String,
1216}
1217
1218/// Verifies that a proof points to a transaction in a block, returning the transaction it commits to
1219/// and throwing an RPC error if the block is not in our best chain
1220#[derive(Debug, Serialize)]
1221pub struct VerifytxoutproofParams {
1222 pub proof: String,
1223}
1224
1225/// Waits for a specific new block and returns useful info about it.
1226///
1227/// Returns the current block on timeout or exit.
1228///
1229/// Make sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)
1230#[derive(Debug, Serialize)]
1231pub struct WaitforblockParams {
1232 pub blockhash: bitcoin::BlockHash,
1233 pub timeout: u64,
1234}
1235
1236/// Waits for (at least) block height and returns the height and hash
1237/// of the current tip.
1238///
1239/// Returns the current block on timeout or exit.
1240///
1241/// Make sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)
1242#[derive(Debug, Serialize)]
1243pub struct WaitforblockheightParams {
1244 pub height: u64,
1245 pub timeout: u64,
1246}
1247
1248/// Waits for any new block and returns useful info about it.
1249///
1250/// Returns the current block on timeout or exit.
1251///
1252/// Make sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)
1253#[derive(Debug, Serialize)]
1254pub struct WaitfornewblockParams {
1255 pub timeout: u64,
1256 pub current_tip: String,
1257}
1258
1259/// Creates and funds a transaction in the Partially Signed Transaction format.
1260/// Implements the Creator and Updater roles.
1261/// All existing inputs must either have their previous output transaction be in the wallet
1262/// or be in the UTXO set. Solving data must be provided for non-wallet inputs.
1263#[derive(Debug, Serialize)]
1264pub struct WalletcreatefundedpsbtParams {
1265 pub inputs: Vec<serde_json::Value>,
1266 pub outputs: Vec<serde_json::Value>,
1267 pub locktime: u32,
1268 pub options: serde_json::Value,
1269 pub bip32derivs: bool,
1270 pub version: u32,
1271}
1272
1273/// Display address on an external signer for verification.
1274#[derive(Debug, Serialize)]
1275pub struct WalletdisplayaddressParams {
1276 pub address: String,
1277}
1278
1279/// Stores the wallet decryption key in memory for "timeout" seconds.
1280/// This is needed prior to performing transactions related to private keys such as sending bitcoins
1281///
1282/// Note:
1283/// Issuing the walletpassphrase command while the wallet is already unlocked will set a new unlock
1284/// time that overrides the old one.
1285#[derive(Debug, Serialize)]
1286pub struct WalletpassphraseParams {
1287 pub passphrase: String,
1288 pub timeout: u64,
1289}
1290
1291/// Changes the wallet passphrase from "oldpassphrase" to "newpassphrase".
1292#[derive(Debug, Serialize)]
1293pub struct WalletpassphrasechangeParams {
1294 pub oldpassphrase: String,
1295 pub newpassphrase: String,
1296}
1297
1298/// Update a PSBT with input information from our wallet and then sign inputs
1299/// that we can sign for.
1300/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
1301#[derive(Debug, Serialize)]
1302pub struct WalletprocesspsbtParams {
1303 pub psbt: String,
1304 pub sign: bool,
1305 pub sighashtype: String,
1306 pub bip32derivs: bool,
1307 pub finalize: bool,
1308}