ethos_bitcoind/bitcoin_core_client/params.rs
1//! Parameter structs for RPC method calls
2use serde::Serialize;
3
4/// Mark in-wallet transaction <txid> as abandoned
5/// This will mark this transaction and all its in-wallet descendants as abandoned which will allow
6/// for their inputs to be respent. It can be used to replace "stuck" or evicted transactions.
7/// It only works on transactions which are not included in a block and are not currently in the mempool.
8/// It has no effect on transactions which are already abandoned.
9#[derive(Debug, Serialize)]
10pub struct AbandontransactionParams {
11 /// The transaction id
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 /// The IP address and port to attempt connecting to.
19 pub address: bitcoin::Address,
20 /// Type of connection to open ("outbound-full-relay", "block-relay-only", "addr-fetch" or "feeler").
21 pub connection_type: String,
22 /// Attempt to connect using BIP324 v2 transport protocol
23 pub v2transport: bool,
24}
25
26/// Attempts to add or remove a node from the addnode list.
27/// Or try a connection to a node once.
28/// Nodes added using addnode (or -connect) are protected from DoS disconnection and are not required to be
29/// full nodes/support SegWit as other outbound peers are (though such peers will not be synced from).
30/// Addnode connections are limited to 8 at a time and are counted separately from the -maxconnections limit.
31#[derive(Debug, Serialize)]
32pub struct AddnodeParams {
33 /// The IP address/hostname optionally followed by :port of the peer to connect to
34 pub node: String,
35 /// 'add' to add a node to the list, 'remove' to remove a node from the list, 'onetry' to try a connection to the node once
36 pub command: String,
37 /// Attempt to connect using BIP324 v2 transport protocol (ignored for 'remove' command)
38 pub v2transport: Option<bool>,
39}
40
41/// Add the address of a potential peer to an address manager table. This RPC is for testing only.
42#[derive(Debug, Serialize)]
43pub struct AddpeeraddressParams {
44 /// The IP address of the peer
45 pub address: bitcoin::Address,
46 /// The port of the peer
47 pub port: i64,
48 /// If true, attempt to add the peer to the tried addresses table
49 pub tried: Option<bool>,
50}
51
52/// Analyzes and provides information about the current status of a PSBT and its inputs
53#[derive(Debug, Serialize)]
54pub struct AnalyzepsbtParams {
55 /// A base64 string of a PSBT
56 pub psbt: String,
57}
58
59/// Safely copies the current wallet file to the specified destination, which can either be a directory or a path with a filename.
60#[derive(Debug, Serialize)]
61pub struct BackupwalletParams {
62 /// The destination directory or file
63 pub destination: String,
64}
65
66/// Bumps the fee of a transaction T, replacing it with a new transaction B.
67/// A transaction with the given txid must be in the wallet.
68/// The command will pay the additional fee by reducing change outputs or adding inputs when necessary.
69/// It may add a new change output if one does not already exist.
70/// All inputs in the original transaction will be included in the replacement transaction.
71/// The command will fail if the wallet or mempool contains a transaction that spends one of T's outputs.
72/// By default, the new fee will be calculated automatically using the estimatesmartfee RPC.
73/// The user can specify a confirmation target for estimatesmartfee.
74/// Alternatively, the user can specify a fee rate in sat/vB for the new transaction.
75/// At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee
76/// returned by getnetworkinfo) to enter the node's mempool.
77/// * WARNING: before version 0.21, fee_rate was in BTC/kvB. As of 0.21, fee_rate is in sat/vB. *
78#[derive(Debug, Serialize)]
79pub struct BumpfeeParams {
80 /// The txid to be bumped
81 pub txid: bitcoin::Txid,
82 pub options: Option<serde_json::Value>,
83}
84
85/// Combine multiple partially signed Bitcoin transactions into one transaction.
86/// Implements the Combiner role.
87#[derive(Debug, Serialize)]
88pub struct CombinepsbtParams {
89 /// The base64 strings of partially signed transactions
90 pub txs: Vec<serde_json::Value>,
91}
92
93/// Combine multiple partially signed transactions into one transaction.
94/// The combined transaction may be another partially signed transaction or a
95/// fully signed transaction.
96#[derive(Debug, Serialize)]
97pub struct CombinerawtransactionParams {
98 /// The hex strings of partially signed transactions
99 pub txs: Vec<serde_json::Value>,
100}
101
102/// Converts a network serialized transaction to a PSBT. This should be used only with createrawtransaction and fundrawtransaction
103/// createpsbt and walletcreatefundedpsbt should be used for new applications.
104#[derive(Debug, Serialize)]
105pub struct ConverttopsbtParams {
106 /// The hex string of a raw transaction
107 pub hexstring: String,
108 /// If true, any signatures in the input will be discarded and conversion
109 /// will continue. If false, RPC will fail if any signatures are present.
110 pub permitsigdata: Option<bool>,
111 /// Whether the transaction hex is a serialized witness transaction.
112 /// If iswitness is not present, heuristic tests will be used in decoding.
113 /// If true, only witness deserialization will be tried.
114 /// If false, only non-witness deserialization will be tried.
115 /// This boolean should reflect whether the transaction has inputs
116 /// (e.g. fully valid, or on-chain transactions), if known by the caller.
117 pub iswitness: Option<bool>,
118}
119
120/// Creates a multi-signature address with n signatures of m keys required.
121/// It returns a json object with the address and redeemScript.
122#[derive(Debug, Serialize)]
123pub struct CreatemultisigParams {
124 /// The number of required signatures out of the m keys.
125 pub nrequired: i64,
126 /// The hex-encoded public keys.
127 pub keys: Vec<serde_json::Value>,
128 /// The address type to use. Options are "legacy", "p2sh-segwit", and "bech32".
129 pub address_type: Option<String>,
130}
131
132/// Creates a transaction in the Partially Signed Transaction format.
133/// Implements the Creator role.
134/// Note that the transaction's inputs are not signed, and
135/// it is not stored in the wallet or transmitted to the network.
136#[derive(Debug, Serialize)]
137pub struct CreatepsbtParams {
138 /// The inputs
139 pub inputs: Vec<serde_json::Value>,
140 /// The outputs specified as key-value pairs.
141 /// Each key may only appear once, i.e. there can only be one 'data' output, and no address may be duplicated.
142 /// At least one output of either type must be specified.
143 /// For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also
144 /// accepted as second parameter.
145 pub outputs: Vec<serde_json::Value>,
146 /// Raw locktime. Non-0 value also locktime-activates inputs
147 pub locktime: Option<i64>,
148 /// Marks this transaction as BIP125-replaceable.
149 /// Allows this transaction to be replaced by a transaction with higher fees. If provided, it is an error if explicit sequence numbers are incompatible.
150 pub replaceable: Option<bool>,
151 /// Transaction version
152 pub version: Option<i64>,
153}
154
155/// Create a transaction spending the given inputs and creating new outputs.
156/// Outputs can be addresses or data.
157/// Returns hex-encoded raw transaction.
158/// Note that the transaction's inputs are not signed, and
159/// it is not stored in the wallet or transmitted to the network.
160#[derive(Debug, Serialize)]
161pub struct CreaterawtransactionParams {
162 /// The inputs
163 pub inputs: Vec<serde_json::Value>,
164 /// The outputs specified as key-value pairs.
165 /// Each key may only appear once, i.e. there can only be one 'data' output, and no address may be duplicated.
166 /// At least one output of either type must be specified.
167 /// For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also
168 /// accepted as second parameter.
169 pub outputs: Vec<serde_json::Value>,
170 /// Raw locktime. Non-0 value also locktime-activates inputs
171 pub locktime: Option<i64>,
172 /// Marks this transaction as BIP125-replaceable.
173 /// Allows this transaction to be replaced by a transaction with higher fees. If provided, it is an error if explicit sequence numbers are incompatible.
174 pub replaceable: Option<bool>,
175 /// Transaction version
176 pub version: Option<i64>,
177}
178
179/// Creates and loads a new wallet.
180#[derive(Debug, Serialize)]
181pub struct CreatewalletParams {
182 /// The name for the new wallet. If this is a path, the wallet will be created at the path location.
183 pub wallet_name: String,
184 /// Disable the possibility of private keys (only watchonlys are possible in this mode).
185 pub disable_private_keys: Option<bool>,
186 /// Create a blank wallet. A blank wallet has no keys.
187 pub blank: Option<bool>,
188 /// Encrypt the wallet with this passphrase.
189 pub passphrase: Option<String>,
190 /// Keep track of coin reuse, and treat dirty and clean coins differently with privacy considerations in mind.
191 pub avoid_reuse: Option<bool>,
192 /// If set, must be "true"
193 pub descriptors: Option<bool>,
194 /// Save wallet name to persistent settings and load on startup. True to add wallet to startup list, false to remove, null to leave unchanged.
195 pub load_on_startup: Option<bool>,
196 /// Use an external signer such as a hardware wallet. Requires -signer to be configured. Wallet creation will fail if keys cannot be fetched. Requires disable_private_keys and descriptors set to true.
197 pub external_signer: Option<bool>,
198}
199
200/// 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.
201/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
202#[derive(Debug, Serialize)]
203pub struct CreatewalletdescriptorParams {
204 /// The address type the descriptor will produce. Options are "legacy", "p2sh-segwit", "bech32", "bech32m".
205 pub r#type: String,
206 pub options: Option<serde_json::Value>,
207}
208
209/// Return a JSON object representing the serialized, base64-encoded partially signed Bitcoin transaction.
210#[derive(Debug, Serialize)]
211pub struct DecodepsbtParams {
212 /// The PSBT base64 string
213 pub psbt: String,
214}
215
216/// Return a JSON object representing the serialized, hex-encoded transaction.
217#[derive(Debug, Serialize)]
218pub struct DecoderawtransactionParams {
219 /// The transaction hex string
220 pub hexstring: String,
221 /// Whether the transaction hex is a serialized witness transaction.
222 /// If iswitness is not present, heuristic tests will be used in decoding.
223 /// If true, only witness deserialization will be tried.
224 /// If false, only non-witness deserialization will be tried.
225 /// This boolean should reflect whether the transaction has inputs
226 /// (e.g. fully valid, or on-chain transactions), if known by the caller.
227 pub iswitness: Option<bool>,
228}
229
230/// Decode a hex-encoded script.
231#[derive(Debug, Serialize)]
232pub struct DecodescriptParams {
233 /// the hex-encoded script
234 pub hexstring: String,
235}
236
237/// Derives one or more addresses corresponding to an output descriptor.
238/// Examples of output descriptors are:
239/// pkh(<pubkey>) P2PKH outputs for the given pubkey
240/// wpkh(<pubkey>) Native segwit P2PKH outputs for the given pubkey
241/// sh(multi(<n>,<pubkey>,<pubkey>,...)) P2SH-multisig outputs for the given threshold and pubkeys
242/// raw(<hex script>) Outputs whose output script equals the specified hex-encoded bytes
243/// tr(<pubkey>,multi_a(<n>,<pubkey>,<pubkey>,...)) P2TR-multisig outputs for the given threshold and pubkeys
244/// In the above, <pubkey> either refers to a fixed public key in hexadecimal notation, or to an xpub/xprv optionally followed by one
245/// or more path elements separated by "/", where "h" represents a hardened child key.
246/// For more information on output descriptors, see the documentation in the doc/descriptors.md file.
247#[derive(Debug, Serialize)]
248pub struct DeriveaddressesParams {
249 /// The descriptor.
250 pub descriptor: String,
251 /// If a ranged descriptor is used, this specifies the end or the range (in \[begin,end\] notation) to derive.
252 pub range: Option<serde_json::Value>,
253}
254
255/// Update all segwit inputs in a PSBT with information from output descriptors, the UTXO set or the mempool.
256/// Then, sign the inputs we are able to with information from the output descriptors.
257#[derive(Debug, Serialize)]
258pub struct DescriptorprocesspsbtParams {
259 /// The transaction base64 string
260 pub psbt: String,
261 /// An array of either strings or objects
262 pub descriptors: Vec<serde_json::Value>,
263 /// The signature hash type to sign with if not specified by the PSBT. Must be one of
264 /// "DEFAULT"
265 /// "ALL"
266 /// "NONE"
267 /// "SINGLE"
268 /// "ALL|ANYONECANPAY"
269 /// "NONE|ANYONECANPAY"
270 /// "SINGLE|ANYONECANPAY"
271 pub sighashtype: Option<String>,
272 /// Include BIP 32 derivation paths for public keys if we know them
273 pub bip32derivs: Option<bool>,
274 /// Also finalize inputs if possible
275 pub finalize: Option<bool>,
276}
277
278/// Immediately disconnects from the specified peer node.
279/// Strictly one out of 'address' and 'nodeid' can be provided to identify the node.
280/// To disconnect by nodeid, either set 'address' to the empty string, or call using the named 'nodeid' argument only.
281#[derive(Debug, Serialize)]
282pub struct DisconnectnodeParams {
283 /// The IP address/port of the node
284 pub address: Option<bitcoin::Address>,
285 /// The node ID (see getpeerinfo for node IDs)
286 pub nodeid: Option<i64>,
287}
288
289/// 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.
290/// 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.
291/// This call may take several minutes. Make sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)
292#[derive(Debug, Serialize)]
293pub struct DumptxoutsetParams {
294 /// Path to the output file. If relative, will be prefixed by datadir.
295 pub path: String,
296 /// The type of snapshot to create. Can be "latest" to create a snapshot of the current UTXO set or "rollback" to temporarily roll back the state of the node to a historical block before creating the snapshot of a historical UTXO set. This parameter can be omitted if a separate "rollback" named parameter is specified indicating the height or hash of a specific historical block. If "rollback" is specified and separate "rollback" named parameter is not specified, this will roll back to the latest valid snapshot block that can currently be loaded with loadtxoutset.
297 pub r#type: Option<String>,
298 pub options: Option<serde_json::Value>,
299}
300
301/// Simply echo back the input arguments. This command is for testing.
302/// It will return an internal bug report when arg9='trigger_internal_bug' is passed.
303/// 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.
304#[derive(Debug, Serialize)]
305pub struct EchoParams {
306 pub arg0: Option<String>,
307 pub arg1: Option<String>,
308 pub arg2: Option<String>,
309 pub arg3: Option<String>,
310 pub arg4: Option<String>,
311 pub arg5: Option<String>,
312 pub arg6: Option<String>,
313 pub arg7: Option<String>,
314 pub arg8: Option<String>,
315 pub arg9: Option<String>,
316}
317
318/// Echo back the input argument, passing it through a spawned process in a multiprocess build.
319/// This command is for testing.
320#[derive(Debug, Serialize)]
321pub struct EchoipcParams {
322 /// The string to echo
323 pub arg: String,
324}
325
326/// Simply echo back the input arguments. This command is for testing.
327/// It will return an internal bug report when arg9='trigger_internal_bug' is passed.
328/// 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.
329#[derive(Debug, Serialize)]
330pub struct EchojsonParams {
331 pub arg0: Option<String>,
332 pub arg1: Option<String>,
333 pub arg2: Option<String>,
334 pub arg3: Option<String>,
335 pub arg4: Option<String>,
336 pub arg5: Option<String>,
337 pub arg6: Option<String>,
338 pub arg7: Option<String>,
339 pub arg8: Option<String>,
340 pub arg9: Option<String>,
341}
342
343/// Encrypts the wallet with 'passphrase'. This is for first time encryption.
344/// After this, any calls that interact with private keys such as sending or signing
345/// will require the passphrase to be set prior to making these calls.
346/// Use the walletpassphrase call for this, and then walletlock call.
347/// If the wallet is already encrypted, use the walletpassphrasechange call.
348/// ** IMPORTANT **
349/// For security reasons, the encryption process will generate a new HD seed, resulting
350/// in the creation of a fresh set of active descriptors. Therefore, it is crucial to
351/// securely back up the newly generated wallet file using the backupwallet RPC.
352#[derive(Debug, Serialize)]
353pub struct EncryptwalletParams {
354 /// The pass phrase to encrypt the wallet with. It must be at least 1 character, but should be long.
355 pub passphrase: String,
356}
357
358/// WARNING: This interface is unstable and may disappear or change!
359/// WARNING: This is an advanced API call that is tightly coupled to the specific
360/// implementation of fee estimation. The parameters it can be called with
361/// and the results it returns will change if the internal implementation changes.
362/// Estimates the approximate fee per kilobyte needed for a transaction to begin
363/// confirmation within conf_target blocks if possible. Uses virtual transaction size as
364/// defined in BIP 141 (witness data is discounted).
365#[derive(Debug, Serialize)]
366pub struct EstimaterawfeeParams {
367 /// Confirmation target in blocks (1 - 1008)
368 pub conf_target: i64,
369 /// The proportion of transactions in a given feerate range that must have been
370 /// confirmed within conf_target in order to consider those feerates as high enough and proceed to check
371 /// lower buckets.
372 pub threshold: Option<i64>,
373}
374
375/// Estimates the approximate fee per kilobyte needed for a transaction to begin
376/// confirmation within conf_target blocks if possible and return the number of blocks
377/// for which the estimate is valid. Uses virtual transaction size as defined
378/// in BIP 141 (witness data is discounted).
379#[derive(Debug, Serialize)]
380pub struct EstimatesmartfeeParams {
381 /// Confirmation target in blocks (1 - 1008)
382 pub conf_target: i64,
383 /// The fee estimate mode.
384 /// unset, economical, conservative
385 /// unset means no mode set (default mode will be used).
386 /// economical estimates use a shorter time horizon, making them more
387 /// responsive to short-term drops in the prevailing fee market. This mode
388 /// potentially returns a lower fee rate estimate.
389 /// conservative estimates use a longer time horizon, making them
390 /// less responsive to short-term drops in the prevailing fee market. This mode
391 /// potentially returns a higher fee rate estimate.
392 pub estimate_mode: Option<String>,
393}
394
395/// Finalize the inputs of a PSBT. If the transaction is fully signed, it will produce a
396/// network serialized transaction which can be broadcast with sendrawtransaction. Otherwise a PSBT will be
397/// created which has the final_scriptSig and final_scriptwitness fields filled for inputs that are complete.
398/// Implements the Finalizer and Extractor roles.
399#[derive(Debug, Serialize)]
400pub struct FinalizepsbtParams {
401 /// A base64 string of a PSBT
402 pub psbt: String,
403 /// If true and the transaction is complete,
404 /// extract and return the complete transaction in normal network serialization instead of the PSBT.
405 pub extract: Option<bool>,
406}
407
408/// If the transaction has no inputs, they will be automatically selected to meet its out value.
409/// It will add at most one change output to the outputs.
410/// No existing outputs will be modified unless "subtractFeeFromOutputs" is specified.
411/// Note that inputs which were signed may need to be resigned after completion since in/outputs have been added.
412/// The inputs added will not be signed, use signrawtransactionwithkey
413/// or signrawtransactionwithwallet for that.
414/// All existing inputs must either have their previous output transaction be in the wallet
415/// or be in the UTXO set. Solving data must be provided for non-wallet inputs.
416/// Note that all inputs selected must be of standard form and P2SH scripts must be
417/// in the wallet using importdescriptors (to calculate fees).
418/// You can see whether this is the case by checking the "solvable" field in the listunspent output.
419/// Note that if specifying an exact fee rate, the resulting transaction may have a higher fee rate
420/// if the transaction has unconfirmed inputs. This is because the wallet will attempt to make the
421/// entire package have the given fee rate, not the resulting transaction.
422#[derive(Debug, Serialize)]
423pub struct FundrawtransactionParams {
424 /// The hex string of the raw transaction
425 pub hexstring: String,
426 pub options: Option<serde_json::Value>,
427 /// Whether the transaction hex is a serialized witness transaction.
428 /// If iswitness is not present, heuristic tests will be used in decoding.
429 /// If true, only witness deserialization will be tried.
430 /// If false, only non-witness deserialization will be tried.
431 /// This boolean should reflect whether the transaction has inputs
432 /// (e.g. fully valid, or on-chain transactions), if known by the caller.
433 pub iswitness: Option<bool>,
434}
435
436/// Mine a set of ordered transactions to a specified address or descriptor and return the block hash.
437#[derive(Debug, Serialize)]
438pub struct GenerateblockParams {
439 /// The address or descriptor to send the newly generated bitcoin to.
440 pub output: String,
441 /// An array of hex strings which are either txids or raw transactions.
442 /// Txids must reference transactions currently in the mempool.
443 /// All transactions must be valid and in valid order, otherwise the block will be rejected.
444 pub transactions: Vec<serde_json::Value>,
445 /// Whether to submit the block before the RPC call returns or to return it as hex.
446 pub submit: Option<bool>,
447}
448
449/// Mine to a specified address and return the block hashes.
450#[derive(Debug, Serialize)]
451pub struct GeneratetoaddressParams {
452 /// How many blocks are generated.
453 pub nblocks: i64,
454 /// The address to send the newly generated bitcoin to.
455 pub address: bitcoin::Address,
456 /// How many iterations to try.
457 pub maxtries: Option<i64>,
458}
459
460/// Mine to a specified descriptor and return the block hashes.
461#[derive(Debug, Serialize)]
462pub struct GeneratetodescriptorParams {
463 /// How many blocks are generated.
464 pub num_blocks: i64,
465 /// The descriptor to send the newly generated bitcoin to.
466 pub descriptor: String,
467 /// How many iterations to try.
468 pub maxtries: Option<i64>,
469}
470
471/// Returns information about the given added node, or all added nodes
472/// (note that onetry addnodes are not listed here)
473#[derive(Debug, Serialize)]
474pub struct GetaddednodeinfoParams {
475 /// If provided, return information about this specific node, otherwise all nodes are returned.
476 pub node: Option<String>,
477}
478
479/// Returns the list of addresses assigned the specified label.
480#[derive(Debug, Serialize)]
481pub struct GetaddressesbylabelParams {
482 /// The label.
483 pub label: String,
484}
485
486/// Return information about the given bitcoin address.
487/// Some of the information will only be present if the address is in the active wallet.
488#[derive(Debug, Serialize)]
489pub struct GetaddressinfoParams {
490 /// The bitcoin address for which to get information.
491 pub address: bitcoin::Address,
492}
493
494/// Returns the total available balance.
495/// The available balance is what the wallet considers currently spendable, and is
496/// thus affected by options which limit spendability such as -spendzeroconfchange.
497#[derive(Debug, Serialize)]
498pub struct GetbalanceParams {
499 /// Remains for backward compatibility. Must be excluded or set to "*".
500 pub dummy: Option<String>,
501 /// Only include transactions confirmed at least this many times.
502 pub minconf: Option<i64>,
503 /// No longer used
504 pub include_watchonly: Option<bool>,
505 /// (only available if avoid_reuse wallet flag is set) Do not include balance in dirty outputs; addresses are considered dirty if they have previously been used in a transaction.
506 pub avoid_reuse: Option<bool>,
507}
508
509/// If verbosity is 0, returns a string that is serialized, hex-encoded data for block 'hash'.
510/// If verbosity is 1, returns an Object with information about block <hash>.
511/// If verbosity is 2, returns an Object with information about block <hash> and information about each transaction.
512/// 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).
513#[derive(Debug, Serialize)]
514pub struct GetblockParams {
515 /// The block hash
516 pub blockhash: bitcoin::BlockHash,
517 /// 0 for hex-encoded data, 1 for a JSON object, 2 for JSON object with transaction data, and 3 for JSON object with transaction data including prevout information for inputs
518 pub verbosity: Option<i64>,
519}
520
521/// Retrieve a BIP 157 content filter for a particular block.
522#[derive(Debug, Serialize)]
523pub struct GetblockfilterParams {
524 /// The hash of the block
525 pub blockhash: bitcoin::BlockHash,
526 /// The type name of the filter
527 pub filtertype: Option<String>,
528}
529
530/// Attempt to fetch block from a given peer.
531/// We must have the header for this block, e.g. using submitheader.
532/// 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.
533/// Subsequent calls for the same block may cause the response from the previous peer to be ignored.
534/// Peers generally ignore requests for a stale block that they never fully verified, or one that is more than a month old.
535/// When a peer does not respond with a block, we will disconnect.
536/// Note: The block could be re-pruned as soon as it is received.
537/// Returns an empty JSON object if the request was successfully scheduled.
538#[derive(Debug, Serialize)]
539pub struct GetblockfrompeerParams {
540 /// The block hash to try to fetch
541 pub blockhash: bitcoin::BlockHash,
542 /// The peer to fetch it from (see getpeerinfo for peer IDs)
543 pub peer_id: i64,
544}
545
546/// Returns hash of block in best-block-chain at height provided.
547#[derive(Debug, Serialize)]
548pub struct GetblockhashParams {
549 /// The height index
550 pub height: i64,
551}
552
553/// If verbose is false, returns a string that is serialized, hex-encoded data for blockheader 'hash'.
554/// If verbose is true, returns an Object with information about blockheader <hash>.
555#[derive(Debug, Serialize)]
556pub struct GetblockheaderParams {
557 /// The block hash
558 pub blockhash: bitcoin::BlockHash,
559 /// true for a json object, false for the hex-encoded data
560 pub verbose: Option<bool>,
561}
562
563/// Compute per block statistics for a given window. All amounts are in satoshis.
564/// It won't work for some heights with pruning.
565#[derive(Debug, Serialize)]
566pub struct GetblockstatsParams {
567 /// The block hash or height of the target block
568 pub hash_or_height: i64,
569 /// Values to plot (see result below)
570 pub stats: Option<Vec<serde_json::Value>>,
571}
572
573/// If the request parameters include a 'mode' key, that is used to explicitly select between the default 'template' request or a 'proposal'.
574/// It returns data needed to construct a block to work on.
575/// For full specification, see BIPs 22, 23, 9, and 145:
576/// <https://github.com/bitcoin/bips/blob/master/bip-0022.mediawiki>
577/// <https://github.com/bitcoin/bips/blob/master/bip-0023.mediawiki>
578/// <https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki#getblocktemplate_changes>
579/// <https://github.com/bitcoin/bips/blob/master/bip-0145.mediawiki>
580#[derive(Debug, Serialize)]
581pub struct GetblocktemplateParams {
582 /// Format of the template
583 pub template_request: serde_json::Value,
584}
585
586/// Compute statistics about the total number and rate of transactions in the chain.
587#[derive(Debug, Serialize)]
588pub struct GetchaintxstatsParams {
589 /// Size of the window in number of blocks
590 pub nblocks: Option<i64>,
591 /// The hash of the block that ends the window.
592 pub blockhash: Option<bitcoin::BlockHash>,
593}
594
595/// Returns an object containing various state info regarding deployments of consensus changes.
596#[derive(Debug, Serialize)]
597pub struct GetdeploymentinfoParams {
598 /// The block hash at which to query deployment state
599 pub blockhash: Option<bitcoin::BlockHash>,
600}
601
602/// 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()`.
603/// This call may take several minutes. If you encounter timeouts, try specifying no RPC timeout (bitcoin-cli -rpcclienttimeout=0)
604#[derive(Debug, Serialize)]
605pub struct GetdescriptoractivityParams {
606 /// The list of blockhashes to examine for activity. Order doesn't matter. Must be along main chain or an error is thrown.
607 pub blockhashes: Vec<serde_json::Value>,
608 /// The list of descriptors (scan objects) to examine for activity. Every scan object is either a string descriptor or an object:
609 pub scanobjects: Vec<serde_json::Value>,
610 /// Whether to include unconfirmed activity
611 pub include_mempool: Option<bool>,
612}
613
614/// Analyses a descriptor.
615#[derive(Debug, Serialize)]
616pub struct GetdescriptorinfoParams {
617 /// The descriptor.
618 pub descriptor: String,
619}
620
621/// List all BIP 32 HD keys in the wallet and which descriptors use them.
622#[derive(Debug, Serialize)]
623pub struct GethdkeysParams {
624 pub options: Option<serde_json::Value>,
625}
626
627/// Returns the status of one or all available indices currently running in the node.
628#[derive(Debug, Serialize)]
629pub struct GetindexinfoParams {
630 /// Filter results for an index with a specific name.
631 pub index_name: Option<String>,
632}
633
634/// Returns an object containing information about memory usage.
635#[derive(Debug, Serialize)]
636pub struct GetmemoryinfoParams {
637 /// determines what kind of information is returned.
638 /// - "stats" returns general statistics about memory usage in the daemon.
639 /// - "mallocinfo" returns an XML string describing low-level heap state (only available if compiled with glibc).
640 pub mode: Option<String>,
641}
642
643/// If txid is in the mempool, returns all in-mempool ancestors.
644#[derive(Debug, Serialize)]
645pub struct GetmempoolancestorsParams {
646 /// The transaction id (must be in mempool)
647 pub txid: bitcoin::Txid,
648 /// True for a json object, false for array of transaction ids
649 pub verbose: Option<bool>,
650}
651
652/// Returns mempool data for given cluster
653#[derive(Debug, Serialize)]
654pub struct GetmempoolclusterParams {
655 /// The txid of a transaction in the cluster
656 pub txid: bitcoin::Txid,
657}
658
659/// If txid is in the mempool, returns all in-mempool descendants.
660#[derive(Debug, Serialize)]
661pub struct GetmempooldescendantsParams {
662 /// The transaction id (must be in mempool)
663 pub txid: bitcoin::Txid,
664 /// True for a json object, false for array of transaction ids
665 pub verbose: Option<bool>,
666}
667
668/// Returns mempool data for given transaction
669#[derive(Debug, Serialize)]
670pub struct GetmempoolentryParams {
671 /// The transaction id (must be in mempool)
672 pub txid: bitcoin::Txid,
673}
674
675/// Returns the estimated network hashes per second based on the last n blocks.
676/// Pass in \[blocks\] to override # of blocks, -1 specifies since last difficulty change.
677/// Pass in \[height\] to estimate the network speed at the time when a certain block was found.
678#[derive(Debug, Serialize)]
679pub struct GetnetworkhashpsParams {
680 /// The number of previous blocks to calculate estimate from, or -1 for blocks since last difficulty change.
681 pub nblocks: Option<i64>,
682 /// To estimate at the time of the given height.
683 pub height: Option<i64>,
684}
685
686/// Returns a new Bitcoin address for receiving payments.
687/// If 'label' is specified, it is added to the address book
688/// so payments received with the address will be associated with 'label'.
689#[derive(Debug, Serialize)]
690pub struct GetnewaddressParams {
691 /// The label name for the address to be linked to. It can also be set to the empty string "" to represent the default label. The label does not need to exist, it will be created if there is no label by the given name.
692 pub label: Option<String>,
693 /// The address type to use. Options are "legacy", "p2sh-segwit", "bech32", "bech32m".
694 pub address_type: Option<String>,
695}
696
697/// Return known addresses, after filtering for quality and recency.
698/// These can potentially be used to find new peers in the network.
699/// The total number of addresses known to the node may be higher.
700#[derive(Debug, Serialize)]
701pub struct GetnodeaddressesParams {
702 /// The maximum number of addresses to return. Specify 0 to return all known addresses.
703 pub count: Option<i64>,
704 /// Return only addresses of the specified network. Can be one of: ipv4, ipv6, onion, i2p, cjdns.
705 pub network: Option<String>,
706}
707
708/// Shows transactions in the tx orphanage.
709/// EXPERIMENTAL warning: this call may be changed in future releases.
710#[derive(Debug, Serialize)]
711pub struct GetorphantxsParams {
712 /// 0 for an array of txids (may contain duplicates), 1 for an array of objects with tx details, and 2 for details from (1) and tx hex
713 pub verbosity: Option<i64>,
714}
715
716/// Returns a new Bitcoin address, for receiving change.
717/// This is for use with raw transactions, NOT normal use.
718#[derive(Debug, Serialize)]
719pub struct GetrawchangeaddressParams {
720 /// The address type to use. Options are "legacy", "p2sh-segwit", "bech32", "bech32m".
721 pub address_type: Option<String>,
722}
723
724/// Returns all transaction ids in memory pool as a json array of string transaction ids.
725/// Hint: use getmempoolentry to fetch a specific transaction from the mempool.
726#[derive(Debug, Serialize)]
727pub struct GetrawmempoolParams {
728 /// True for a json object, false for array of transaction ids
729 pub verbose: Option<bool>,
730 /// If verbose=false, returns a json object with transaction list and mempool sequence number attached.
731 pub mempool_sequence: Option<bool>,
732}
733
734/// By default, this call only returns a transaction if it is in the mempool. If -txindex is enabled
735/// and no blockhash argument is passed, it will return the transaction if it is in the mempool or any block.
736/// If a blockhash argument is passed, it will return the transaction if
737/// the specified block is available and the transaction is in that block.
738/// Hint: Use gettransaction for wallet transactions.
739/// If verbosity is 0 or omitted, returns the serialized transaction as a hex-encoded string.
740/// If verbosity is 1, returns a JSON Object with information about the transaction.
741/// If verbosity is 2, returns a JSON Object with information about the transaction, including fee and prevout information.
742#[derive(Debug, Serialize)]
743pub struct GetrawtransactionParams {
744 /// The transaction id
745 pub txid: bitcoin::Txid,
746 /// 0 for hex-encoded data, 1 for a JSON object, and 2 for JSON object with fee and prevout
747 pub verbosity: Option<i64>,
748 /// The block in which to look for the transaction
749 pub blockhash: Option<bitcoin::BlockHash>,
750}
751
752/// Returns the total amount received by the given address in transactions with at least minconf confirmations.
753#[derive(Debug, Serialize)]
754pub struct GetreceivedbyaddressParams {
755 /// The bitcoin address for transactions.
756 pub address: bitcoin::Address,
757 /// Only include transactions confirmed at least this many times.
758 pub minconf: Option<i64>,
759 /// Include immature coinbase transactions.
760 pub include_immature_coinbase: Option<bool>,
761}
762
763/// Returns the total amount received by addresses with <label> in transactions with at least \[minconf\] confirmations.
764#[derive(Debug, Serialize)]
765pub struct GetreceivedbylabelParams {
766 /// The selected label, may be the default label using "".
767 pub label: String,
768 /// Only include transactions confirmed at least this many times.
769 pub minconf: Option<i64>,
770 /// Include immature coinbase transactions.
771 pub include_immature_coinbase: Option<bool>,
772}
773
774/// Get detailed information about in-wallet transaction <txid>
775#[derive(Debug, Serialize)]
776pub struct GettransactionParams {
777 /// The transaction id
778 pub txid: bitcoin::Txid,
779 /// (DEPRECATED) No longer used
780 pub include_watchonly: Option<bool>,
781 /// Whether to include a `decoded` field containing the decoded transaction (equivalent to RPC decoderawtransaction)
782 pub verbose: Option<bool>,
783}
784
785/// Returns details about an unspent transaction output.
786#[derive(Debug, Serialize)]
787pub struct GettxoutParams {
788 /// The transaction id
789 pub txid: bitcoin::Txid,
790 /// vout number
791 pub n: i64,
792 /// Whether to include the mempool. Note that an unspent output that is spent in the mempool won't appear.
793 pub include_mempool: Option<bool>,
794}
795
796/// Returns a hex-encoded proof that "txid" was included in a block.
797/// NOTE: By default this function only works sometimes. This is when there is an
798/// unspent output in the utxo for this transaction. To make it always work,
799/// you need to maintain a transaction index, using the -txindex command line option or
800/// specify the block in which the transaction is included manually (by blockhash).
801#[derive(Debug, Serialize)]
802pub struct GettxoutproofParams {
803 /// The txids to filter
804 pub txids: Vec<serde_json::Value>,
805 /// If specified, looks for txid in the block with this hash
806 pub blockhash: Option<bitcoin::BlockHash>,
807}
808
809/// Returns statistics about the unspent transaction output set.
810/// Note this call may take some time if you are not using coinstatsindex.
811#[derive(Debug, Serialize)]
812pub struct GettxoutsetinfoParams {
813 /// Which UTXO set hash should be calculated. Options: 'hash_serialized_3' (the legacy algorithm), 'muhash', 'none'.
814 pub hash_type: Option<String>,
815 /// The block hash or height of the target height (only available with coinstatsindex).
816 pub hash_or_height: Option<i64>,
817 /// Use coinstatsindex, if available.
818 pub use_index: Option<bool>,
819}
820
821/// Scans the mempool to find transactions spending any of the given outputs
822#[derive(Debug, Serialize)]
823pub struct GettxspendingprevoutParams {
824 /// The transaction outputs that we want to check, and within each, the txid (string) vout (numeric).
825 pub outputs: Vec<serde_json::Value>,
826}
827
828/// List all commands, or get help for a specified command.
829#[derive(Debug, Serialize)]
830pub struct HelpParams {
831 /// The command to get help on
832 pub command: Option<String>,
833}
834
835/// 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.
836/// 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.
837/// Note: This call can take over an hour to complete if using an early timestamp; during that time, other rpc calls
838/// may report that the imported keys, addresses or scripts exist but related transactions are still missing.
839/// The rescan is significantly faster if block filters are available (using startup option "-blockfilterindex=1").
840#[derive(Debug, Serialize)]
841pub struct ImportdescriptorsParams {
842 /// Data to be imported
843 pub requests: Vec<serde_json::Value>,
844}
845
846/// Import a mempool.dat file and attempt to add its contents to the mempool.
847/// Warning: Importing untrusted files is dangerous, especially if metadata from the file is taken over.
848#[derive(Debug, Serialize)]
849pub struct ImportmempoolParams {
850 /// The mempool file
851 pub filepath: String,
852 pub options: Option<serde_json::Value>,
853}
854
855/// 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.
856#[derive(Debug, Serialize)]
857pub struct ImportprunedfundsParams {
858 /// A raw transaction in hex funding an already-existing address in wallet
859 pub rawtransaction: String,
860 /// The hex output from gettxoutproof that contains the transaction
861 pub txoutproof: String,
862}
863
864/// Permanently marks a block as invalid, as if it violated a consensus rule.
865#[derive(Debug, Serialize)]
866pub struct InvalidateblockParams {
867 /// the hash of the block to mark as invalid
868 pub blockhash: bitcoin::BlockHash,
869}
870
871/// Joins multiple distinct PSBTs with different inputs and outputs into one PSBT with inputs and outputs from all of the PSBTs
872/// No input in any of the PSBTs can be in more than one of the PSBTs.
873#[derive(Debug, Serialize)]
874pub struct JoinpsbtsParams {
875 /// The base64 strings of partially signed transactions
876 pub txs: Vec<serde_json::Value>,
877}
878
879/// Refills each descriptor keypool in the wallet up to the specified number of new keys.
880/// By default, descriptor wallets have 4 active ranged descriptors ("legacy", "p2sh-segwit", "bech32", "bech32m"), each with 1000 entries.
881/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
882#[derive(Debug, Serialize)]
883pub struct KeypoolrefillParams {
884 /// The new keypool size
885 pub newsize: Option<i64>,
886}
887
888/// List all descriptors present in a wallet.
889#[derive(Debug, Serialize)]
890pub struct ListdescriptorsParams {
891 /// Show private descriptors.
892 pub private: Option<bool>,
893}
894
895/// Returns the list of all labels, or labels that are assigned to addresses with a specific purpose.
896#[derive(Debug, Serialize)]
897pub struct ListlabelsParams {
898 /// Address purpose to list labels for ('send','receive'). An empty string is the same as not providing this argument.
899 pub purpose: Option<String>,
900}
901
902/// List balances by receiving address.
903#[derive(Debug, Serialize)]
904pub struct ListreceivedbyaddressParams {
905 /// The minimum number of confirmations before payments are included.
906 pub minconf: Option<i64>,
907 /// Whether to include addresses that haven't received any payments.
908 pub include_empty: Option<bool>,
909 /// (DEPRECATED) No longer used
910 pub include_watchonly: Option<bool>,
911 /// If present and non-empty, only return information on this address.
912 pub address_filter: Option<String>,
913 /// Include immature coinbase transactions.
914 pub include_immature_coinbase: Option<bool>,
915}
916
917/// List received transactions by label.
918#[derive(Debug, Serialize)]
919pub struct ListreceivedbylabelParams {
920 /// The minimum number of confirmations before payments are included.
921 pub minconf: Option<i64>,
922 /// Whether to include labels that haven't received any payments.
923 pub include_empty: Option<bool>,
924 /// (DEPRECATED) No longer used
925 pub include_watchonly: Option<bool>,
926 /// Include immature coinbase transactions.
927 pub include_immature_coinbase: Option<bool>,
928}
929
930/// Get all transactions in blocks since block \[blockhash\], or all transactions if omitted.
931/// If "blockhash" is no longer a part of the main chain, transactions from the fork point onward are included.
932/// Additionally, if include_removed is set, transactions affecting the wallet which were removed are returned in the "removed" array.
933#[derive(Debug, Serialize)]
934pub struct ListsinceblockParams {
935 /// If set, the block hash to list transactions since, otherwise list all transactions.
936 pub blockhash: Option<bitcoin::BlockHash>,
937 /// Return the nth block hash from the main chain. e.g. 1 would mean the best block hash. Note: this is not used as a filter, but only affects \[lastblock\] in the return value
938 pub target_confirmations: Option<i64>,
939 /// (DEPRECATED) No longer used
940 pub include_watchonly: Option<bool>,
941 /// Show transactions that were removed due to a reorg in the "removed" array
942 /// (not guaranteed to work on pruned nodes)
943 pub include_removed: Option<bool>,
944 /// Also add entries for change outputs.
945 pub include_change: Option<bool>,
946 /// Return only incoming transactions paying to addresses with the specified label.
947 pub label: Option<String>,
948}
949
950/// If a label name is provided, this will return only incoming transactions paying to addresses with the specified label.
951/// Returns up to 'count' most recent transactions ordered from oldest to newest while skipping the first number of
952/// transactions specified in the 'skip' argument. A transaction can have multiple entries in this RPC response.
953/// For instance, a wallet transaction that pays three addresses — one wallet-owned and two external — will produce
954/// four entries. The payment to the wallet-owned address appears both as a send entry and as a receive entry.
955/// As a result, the RPC response will contain one entry in the receive category and three entries in the send category.
956#[derive(Debug, Serialize)]
957pub struct ListtransactionsParams {
958 /// If set, should be a valid label name to return only incoming transactions
959 /// with the specified label, or "*" to disable filtering and return all transactions.
960 pub label: Option<String>,
961 /// The number of transactions to return
962 pub count: Option<i64>,
963 /// The number of transactions to skip
964 pub skip: Option<i64>,
965 /// (DEPRECATED) No longer used
966 pub include_watchonly: Option<bool>,
967}
968
969/// Returns array of unspent transaction outputs
970/// with between minconf and maxconf (inclusive) confirmations.
971/// Optionally filter to only include txouts paid to specified addresses.
972#[derive(Debug, Serialize)]
973pub struct ListunspentParams {
974 /// The minimum confirmations to filter
975 pub minconf: Option<i64>,
976 /// The maximum confirmations to filter
977 pub maxconf: Option<i64>,
978 /// The bitcoin addresses to filter
979 pub addresses: Option<Vec<serde_json::Value>>,
980 /// Include outputs that are not safe to spend
981 /// See description of "safe" attribute below.
982 pub include_unsafe: Option<bool>,
983 pub query_options: Option<serde_json::Value>,
984}
985
986/// Load the serialized UTXO set from a file.
987/// 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.
988/// 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.
989/// You can find more information on this process in the `assumeutxo` design document (<https://github.com/bitcoin/bitcoin/blob/master/doc/design/assumeutxo.md>).
990#[derive(Debug, Serialize)]
991pub struct LoadtxoutsetParams {
992 /// path to the snapshot file. If relative, will be prefixed by datadir.
993 pub path: String,
994}
995
996/// Loads a wallet from a wallet file or directory.
997/// Note that all wallet command-line options used when starting bitcoind will be
998/// applied to the new wallet.
999#[derive(Debug, Serialize)]
1000pub struct LoadwalletParams {
1001 /// The path to the directory of the wallet to be loaded, either absolute or relative to the "wallets" directory. The "wallets" directory is set by the -walletdir option and defaults to the "wallets" folder within the data directory.
1002 pub filename: String,
1003 /// Save wallet name to persistent settings and load on startup. True to add wallet to startup list, false to remove, null to leave unchanged.
1004 pub load_on_startup: Option<bool>,
1005}
1006
1007/// Updates list of temporarily unspendable outputs.
1008/// Temporarily lock (unlock=false) or unlock (unlock=true) specified transaction outputs.
1009/// If no transaction outputs are specified when unlocking then all current locked transaction outputs are unlocked.
1010/// A locked transaction output will not be chosen by automatic coin selection, when spending bitcoins.
1011/// Manually selected coins are automatically unlocked.
1012/// Locks are stored in memory only, unless persistent=true, in which case they will be written to the
1013/// wallet database and loaded on node start. Unwritten (persistent=false) locks are always cleared
1014/// (by virtue of process exit) when a node stops or fails. Unlocking will clear both persistent and not.
1015/// Also see the listunspent call
1016#[derive(Debug, Serialize)]
1017pub struct LockunspentParams {
1018 /// Whether to unlock (true) or lock (false) the specified transactions
1019 pub unlock: bool,
1020 /// The transaction outputs and within each, the txid (string) vout (numeric).
1021 pub transactions: Option<Vec<serde_json::Value>>,
1022 /// Whether to write/erase this lock in the wallet database, or keep the change in memory only. Ignored for unlocking.
1023 pub persistent: Option<bool>,
1024}
1025
1026/// Gets and sets the logging configuration.
1027/// When called without an argument, returns the list of categories with status that are currently being debug logged or not.
1028/// When called with arguments, adds or removes categories from debug logging and return the lists above.
1029/// The arguments are evaluated in order "include", "exclude".
1030/// If an item is both included and excluded, it will thus end up being excluded.
1031/// The valid logging categories are: addrman, bench, blockstorage, cmpctblock, coindb, estimatefee, http, i2p, ipc, kernel, leveldb, libevent, mempool, mempoolrej, net, privatebroadcast, proxy, prune, qt, rand, reindex, rpc, scan, selectcoins, tor, txpackages, txreconciliation, validation, walletdb, zmq
1032/// In addition, the following are available as category names with special meanings:
1033/// - "all", "1" : represent all logging categories.
1034#[derive(Debug, Serialize)]
1035pub struct LoggingParams {
1036 /// The categories to add to debug logging
1037 pub include: Option<Vec<serde_json::Value>>,
1038 /// The categories to remove from debug logging
1039 pub exclude: Option<Vec<serde_json::Value>>,
1040}
1041
1042/// Migrate the wallet to a descriptor wallet.
1043/// A new wallet backup will need to be made.
1044/// The migration process will create a backup of the wallet before migrating. This backup
1045/// file will be named <wallet name>-<timestamp>.legacy.bak and can be found in the directory
1046/// for this wallet. In the event of an incorrect migration, the backup can be restored using restorewallet.
1047/// Encrypted wallets must have the passphrase provided as an argument to this call.
1048/// This RPC may take a long time to complete. Increasing the RPC client timeout is recommended.
1049#[derive(Debug, Serialize)]
1050pub struct MigratewalletParams {
1051 /// The name of the wallet to migrate. If provided both here and in the RPC endpoint, the two must be identical.
1052 pub wallet_name: Option<String>,
1053 /// The wallet passphrase
1054 pub passphrase: Option<String>,
1055}
1056
1057/// Bump the scheduler into the future (-regtest only)
1058#[derive(Debug, Serialize)]
1059pub struct MockschedulerParams {
1060 /// Number of seconds to forward the scheduler into the future.
1061 pub delta_time: i64,
1062}
1063
1064/// Treats a block as if it were received before others with the same work.
1065/// A later preciousblock call can override the effect of an earlier one.
1066/// The effects of preciousblock are not retained across restarts.
1067#[derive(Debug, Serialize)]
1068pub struct PreciousblockParams {
1069 /// the hash of the block to mark as precious
1070 pub blockhash: bitcoin::BlockHash,
1071}
1072
1073/// Accepts the transaction into mined blocks at a higher (or lower) priority
1074#[derive(Debug, Serialize)]
1075pub struct PrioritisetransactionParams {
1076 /// The transaction id.
1077 pub txid: bitcoin::Txid,
1078 /// API-Compatibility for previous API. Must be zero or null.
1079 /// DEPRECATED. For forward compatibility use named arguments and omit this parameter.
1080 pub dummy: Option<i64>,
1081 /// The fee value (in satoshis) to add (or subtract, if negative).
1082 /// Note, that this value is not a fee rate. It is a value to modify absolute fee of the TX.
1083 /// The fee is not actually paid, only the algorithm for selecting transactions into a block
1084 /// considers the transaction as it would have paid a higher (or lower) fee.
1085 pub fee_delta: i64,
1086}
1087
1088/// Attempts to delete block and undo data up to a specified height or timestamp, if eligible for pruning.
1089/// 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.
1090#[derive(Debug, Serialize)]
1091pub struct PruneblockchainParams {
1092 /// The block height to prune up to. May be set to a discrete height, or to a UNIX epoch time
1093 /// to prune blocks whose block time is at least 2 hours older than the provided timestamp.
1094 pub height: i64,
1095}
1096
1097/// Bumps the fee of a transaction T, replacing it with a new transaction B.
1098/// Returns a PSBT instead of creating and signing a new transaction.
1099/// A transaction with the given txid must be in the wallet.
1100/// The command will pay the additional fee by reducing change outputs or adding inputs when necessary.
1101/// It may add a new change output if one does not already exist.
1102/// All inputs in the original transaction will be included in the replacement transaction.
1103/// The command will fail if the wallet or mempool contains a transaction that spends one of T's outputs.
1104/// By default, the new fee will be calculated automatically using the estimatesmartfee RPC.
1105/// The user can specify a confirmation target for estimatesmartfee.
1106/// Alternatively, the user can specify a fee rate in sat/vB for the new transaction.
1107/// At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee
1108/// returned by getnetworkinfo) to enter the node's mempool.
1109/// * WARNING: before version 0.21, fee_rate was in BTC/kvB. As of 0.21, fee_rate is in sat/vB. *
1110#[derive(Debug, Serialize)]
1111pub struct PsbtbumpfeeParams {
1112 /// The txid to be bumped
1113 pub txid: bitcoin::Txid,
1114 pub options: Option<serde_json::Value>,
1115}
1116
1117/// Removes invalidity status of a block, its ancestors and its descendants, reconsider them for activation.
1118/// This can be used to undo the effects of invalidateblock.
1119#[derive(Debug, Serialize)]
1120pub struct ReconsiderblockParams {
1121 /// the hash of the block to reconsider
1122 pub blockhash: bitcoin::BlockHash,
1123}
1124
1125/// Deletes the specified transaction from the wallet. Meant for use with pruned wallets and as a companion to importprunedfunds. This will affect wallet balances.
1126#[derive(Debug, Serialize)]
1127pub struct RemoveprunedfundsParams {
1128 /// The hex-encoded id of the transaction you are deleting
1129 pub txid: bitcoin::Txid,
1130}
1131
1132/// Rescan the local blockchain for wallet related transactions.
1133/// Note: Use "getwalletinfo" to query the scanning progress.
1134/// The rescan is significantly faster if block filters are available
1135/// (using startup option "-blockfilterindex=1").
1136#[derive(Debug, Serialize)]
1137pub struct RescanblockchainParams {
1138 /// block height where the rescan should start
1139 pub start_height: Option<i64>,
1140 /// the last block height that should be scanned. If none is provided it will rescan up to the tip at return time of this call.
1141 pub stop_height: Option<i64>,
1142}
1143
1144/// Restores and loads a wallet from backup.
1145/// The rescan is significantly faster if block filters are available
1146/// (using startup option "-blockfilterindex=1").
1147#[derive(Debug, Serialize)]
1148pub struct RestorewalletParams {
1149 /// The name that will be applied to the restored wallet
1150 pub wallet_name: String,
1151 /// The backup file that will be used to restore the wallet.
1152 pub backup_file: String,
1153 /// Save wallet name to persistent settings and load on startup. True to add wallet to startup list, false to remove, null to leave unchanged.
1154 pub load_on_startup: Option<bool>,
1155}
1156
1157/// Return relevant blockhashes for given descriptors (requires blockfilterindex).
1158/// This call may take several minutes. Make sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)
1159#[derive(Debug, Serialize)]
1160pub struct ScanblocksParams {
1161 /// The action to execute
1162 /// "start" for starting a scan
1163 /// "abort" for aborting the current scan (returns true when abort was successful)
1164 /// "status" for progress report (in %) of the current scan
1165 pub action: String,
1166 /// Array of scan objects. Required for "start" action
1167 /// Every scan object is either a string descriptor or an object:
1168 pub scanobjects: Option<Vec<serde_json::Value>>,
1169 /// Height to start to scan from
1170 pub start_height: Option<i64>,
1171 /// Height to stop to scan
1172 pub stop_height: Option<i64>,
1173 /// The type name of the filter
1174 pub filtertype: Option<String>,
1175 pub options: Option<serde_json::Value>,
1176}
1177
1178/// Scans the unspent transaction output set for entries that match certain output descriptors.
1179/// Examples of output descriptors are:
1180/// addr(<address>) Outputs whose output script corresponds to the specified address (does not include P2PK)
1181/// raw(<hex script>) Outputs whose output script equals the specified hex-encoded bytes
1182/// combo(<pubkey>) P2PK, P2PKH, P2WPKH, and P2SH-P2WPKH outputs for the given pubkey
1183/// pkh(<pubkey>) P2PKH outputs for the given pubkey
1184/// sh(multi(<n>,<pubkey>,<pubkey>,...)) P2SH-multisig outputs for the given threshold and pubkeys
1185/// tr(<pubkey>) P2TR
1186/// tr(<pubkey>,{pk(<pubkey>)}) P2TR with single fallback pubkey in tapscript
1187/// rawtr(<pubkey>) P2TR with the specified key as output key rather than inner
1188/// wsh(and_v(v:pk(<pubkey>),after(2))) P2WSH miniscript with mandatory pubkey and a timelock
1189/// In the above, <pubkey> either refers to a fixed public key in hexadecimal notation, or to an xpub/xprv optionally followed by one
1190/// or more path elements separated by "/", and optionally ending in "/*" (unhardened), or "/*'" or "/*h" (hardened) to specify all
1191/// unhardened or hardened child keys.
1192/// In the latter case, a range needs to be specified by below if different from 1000.
1193/// For more information on output descriptors, see the documentation in the doc/descriptors.md file.
1194#[derive(Debug, Serialize)]
1195pub struct ScantxoutsetParams {
1196 /// The action to execute
1197 /// "start" for starting a scan
1198 /// "abort" for aborting the current scan (returns true when abort was successful)
1199 /// "status" for progress report (in %) of the current scan
1200 pub action: String,
1201 /// Array of scan objects. Required for "start" action
1202 /// Every scan object is either a string descriptor or an object:
1203 pub scanobjects: Option<Vec<serde_json::Value>>,
1204}
1205
1206/// EXPERIMENTAL warning: this call may be changed in future releases.
1207/// Send a transaction.
1208#[derive(Debug, Serialize)]
1209pub struct SendParams {
1210 /// The outputs specified as key-value pairs.
1211 /// Each key may only appear once, i.e. there can only be one 'data' output, and no address may be duplicated.
1212 /// At least one output of either type must be specified.
1213 /// For convenience, a dictionary, which holds the key-value pairs directly, is also accepted.
1214 pub outputs: Vec<serde_json::Value>,
1215 /// Confirmation target in blocks
1216 pub conf_target: Option<i64>,
1217 /// The fee estimate mode, must be one of (case insensitive):
1218 /// unset, economical, conservative
1219 /// unset means no mode set (economical mode is used if the transaction is replaceable;
1220 /// otherwise, conservative mode is used).
1221 /// economical estimates use a shorter time horizon, making them more
1222 /// responsive to short-term drops in the prevailing fee market. This mode
1223 /// potentially returns a lower fee rate estimate.
1224 /// conservative estimates use a longer time horizon, making them
1225 /// less responsive to short-term drops in the prevailing fee market. This mode
1226 /// potentially returns a higher fee rate estimate.
1227 pub estimate_mode: Option<String>,
1228 /// Specify a fee rate in sat/vB.
1229 pub fee_rate: Option<serde_json::Value>,
1230 pub options: Option<serde_json::Value>,
1231 /// Transaction version
1232 pub version: Option<i64>,
1233}
1234
1235/// EXPERIMENTAL warning: this call may be changed in future releases.
1236/// Spend the value of all (or specific) confirmed UTXOs and unconfirmed change in the wallet to one or more recipients.
1237/// Unconfirmed inbound UTXOs and locked UTXOs will not be spent. Sendall will respect the avoid_reuse wallet flag.
1238/// 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.
1239#[derive(Debug, Serialize)]
1240pub struct SendallParams {
1241 /// The sendall destinations. Each address may only appear once.
1242 /// Optionally some recipients can be specified with an amount to perform payments, but at least one address must appear without a specified amount.
1243 pub recipients: Vec<serde_json::Value>,
1244 /// Confirmation target in blocks
1245 pub conf_target: Option<i64>,
1246 /// The fee estimate mode, must be one of (case insensitive):
1247 /// unset, economical, conservative
1248 /// unset means no mode set (economical mode is used if the transaction is replaceable;
1249 /// otherwise, conservative mode is used).
1250 /// economical estimates use a shorter time horizon, making them more
1251 /// responsive to short-term drops in the prevailing fee market. This mode
1252 /// potentially returns a lower fee rate estimate.
1253 /// conservative estimates use a longer time horizon, making them
1254 /// less responsive to short-term drops in the prevailing fee market. This mode
1255 /// potentially returns a higher fee rate estimate.
1256 pub estimate_mode: Option<String>,
1257 /// Specify a fee rate in sat/vB.
1258 pub fee_rate: Option<serde_json::Value>,
1259 pub options: Option<serde_json::Value>,
1260}
1261
1262/// Send multiple times. Amounts are double-precision floating point numbers.
1263/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
1264#[derive(Debug, Serialize)]
1265pub struct SendmanyParams {
1266 /// Must be set to "" for backwards compatibility.
1267 pub dummy: Option<String>,
1268 /// The addresses and amounts
1269 pub amounts: serde_json::Value,
1270 /// Ignored dummy value
1271 pub minconf: Option<i64>,
1272 /// A comment
1273 pub comment: Option<String>,
1274 /// The addresses.
1275 /// The fee will be equally deducted from the amount of each selected address.
1276 /// Those recipients will receive less bitcoins than you enter in their corresponding amount field.
1277 /// If no addresses are specified here, the sender pays the fee.
1278 pub subtractfeefrom: Option<Vec<serde_json::Value>>,
1279 /// Signal that this transaction can be replaced by a transaction (BIP 125)
1280 pub replaceable: Option<bool>,
1281 /// Confirmation target in blocks
1282 pub conf_target: Option<i64>,
1283 /// The fee estimate mode, must be one of (case insensitive):
1284 /// unset, economical, conservative
1285 /// unset means no mode set (economical mode is used if the transaction is replaceable;
1286 /// otherwise, conservative mode is used).
1287 /// economical estimates use a shorter time horizon, making them more
1288 /// responsive to short-term drops in the prevailing fee market. This mode
1289 /// potentially returns a lower fee rate estimate.
1290 /// conservative estimates use a longer time horizon, making them
1291 /// less responsive to short-term drops in the prevailing fee market. This mode
1292 /// potentially returns a higher fee rate estimate.
1293 pub estimate_mode: Option<String>,
1294 /// Specify a fee rate in sat/vB.
1295 pub fee_rate: Option<serde_json::Value>,
1296 /// If true, return extra information about the transaction.
1297 pub verbose: Option<bool>,
1298}
1299
1300/// Send a p2p message to a peer specified by id.
1301/// The message type and body must be provided, the message header will be generated.
1302/// This RPC is for testing only.
1303#[derive(Debug, Serialize)]
1304pub struct SendmsgtopeerParams {
1305 /// The peer to send the message to.
1306 pub peer_id: i64,
1307 /// The message type (maximum length 12)
1308 pub msg_type: String,
1309 /// The serialized message body to send, in hex, without a message header
1310 pub msg: String,
1311}
1312
1313/// Submit a raw transaction (serialized, hex-encoded) to the network.
1314/// If -privatebroadcast is disabled, then the transaction will be put into the
1315/// local mempool of the node and will be sent unconditionally to all currently
1316/// connected peers, so using sendrawtransaction for manual rebroadcast will degrade
1317/// privacy by leaking the transaction's origin, as nodes will normally not
1318/// rebroadcast non-wallet transactions already in their mempool.
1319/// If -privatebroadcast is enabled, then the transaction will be sent only via
1320/// dedicated, short-lived connections to Tor or I2P peers or IPv4/IPv6 peers
1321/// via the Tor network. This conceals the transaction's origin. The transaction
1322/// will only enter the local mempool when it is received back from the network.
1323/// A specific exception, RPC_TRANSACTION_ALREADY_IN_UTXO_SET, may throw if the transaction cannot be added to the mempool.
1324/// Related RPCs: createrawtransaction, signrawtransactionwithkey
1325#[derive(Debug, Serialize)]
1326pub struct SendrawtransactionParams {
1327 /// The hex string of the raw transaction
1328 pub hexstring: String,
1329 /// Reject transactions whose fee rate is higher than the specified value, expressed in BTC/kvB.
1330 /// Fee rates larger than 1BTC/kvB are rejected.
1331 /// Set to 0 to accept any fee rate.
1332 pub maxfeerate: Option<serde_json::Value>,
1333 /// Reject transactions with provably unspendable outputs (e.g. 'datacarrier' outputs that use the OP_RETURN opcode) greater than the specified value, expressed in BTC.
1334 /// If burning funds through unspendable outputs is desired, increase this value.
1335 /// This check is based on heuristics and does not guarantee spendability of outputs.
1336 pub maxburnamount: Option<serde_json::Value>,
1337}
1338
1339/// Send an amount to a given address.
1340/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
1341#[derive(Debug, Serialize)]
1342pub struct SendtoaddressParams {
1343 /// The bitcoin address to send to.
1344 pub address: bitcoin::Address,
1345 /// The amount in BTC to send. eg 0.1
1346 pub amount: serde_json::Value,
1347 /// A comment used to store what the transaction is for.
1348 /// This is not part of the transaction, just kept in your wallet.
1349 pub comment: Option<String>,
1350 /// A comment to store the name of the person or organization
1351 /// to which you're sending the transaction. This is not part of the
1352 /// transaction, just kept in your wallet.
1353 pub comment_to: Option<String>,
1354 /// The fee will be deducted from the amount being sent.
1355 /// The recipient will receive less bitcoins than you enter in the amount field.
1356 pub subtractfeefromamount: Option<bool>,
1357 /// Signal that this transaction can be replaced by a transaction (BIP 125)
1358 pub replaceable: Option<bool>,
1359 /// Confirmation target in blocks
1360 pub conf_target: Option<i64>,
1361 /// The fee estimate mode, must be one of (case insensitive):
1362 /// unset, economical, conservative
1363 /// unset means no mode set (economical mode is used if the transaction is replaceable;
1364 /// otherwise, conservative mode is used).
1365 /// economical estimates use a shorter time horizon, making them more
1366 /// responsive to short-term drops in the prevailing fee market. This mode
1367 /// potentially returns a lower fee rate estimate.
1368 /// conservative estimates use a longer time horizon, making them
1369 /// less responsive to short-term drops in the prevailing fee market. This mode
1370 /// potentially returns a higher fee rate estimate.
1371 pub estimate_mode: Option<String>,
1372 /// (only available if avoid_reuse wallet flag is set) Avoid spending from dirty addresses; addresses are considered
1373 /// dirty if they have previously been used in a transaction. If true, this also activates avoidpartialspends, grouping outputs by their addresses.
1374 pub avoid_reuse: Option<bool>,
1375 /// Specify a fee rate in sat/vB.
1376 pub fee_rate: Option<serde_json::Value>,
1377 /// If true, return extra information about the transaction.
1378 pub verbose: Option<bool>,
1379}
1380
1381/// Attempts to add or remove an IP/Subnet from the banned list.
1382#[derive(Debug, Serialize)]
1383pub struct SetbanParams {
1384 /// The IP/Subnet (see getpeerinfo for nodes IP) with an optional netmask (default is /32 = single IP)
1385 pub subnet: String,
1386 /// 'add' to add an IP/Subnet to the list, 'remove' to remove an IP/Subnet from the list
1387 pub command: String,
1388 /// time in seconds how long (or until when if \[absolute\] is set) the IP is banned (0 or empty means using the default time of 24h which can also be overwritten by the -bantime startup argument)
1389 pub bantime: Option<i64>,
1390 /// If set, the bantime must be an absolute timestamp expressed in UNIX epoch time
1391 pub absolute: Option<bool>,
1392}
1393
1394/// Sets the label associated with the given address.
1395#[derive(Debug, Serialize)]
1396pub struct SetlabelParams {
1397 /// The bitcoin address to be associated with a label.
1398 pub address: bitcoin::Address,
1399 /// The label to assign to the address.
1400 pub label: String,
1401}
1402
1403/// Set the local time to given timestamp (-regtest only)
1404#[derive(Debug, Serialize)]
1405pub struct SetmocktimeParams {
1406 /// UNIX epoch time
1407 /// Pass 0 to go back to using the system time.
1408 pub timestamp: i64,
1409}
1410
1411/// Disable/enable all p2p network activity.
1412#[derive(Debug, Serialize)]
1413pub struct SetnetworkactiveParams {
1414 /// true to enable networking, false to disable
1415 pub state: bool,
1416}
1417
1418/// (DEPRECATED) Set the transaction fee rate in BTC/kvB for this wallet. Overrides the global -paytxfee command line parameter.
1419/// Can be deactivated by passing 0 as the fee. In that case automatic fee selection will be used by default.
1420#[derive(Debug, Serialize)]
1421pub struct SettxfeeParams {
1422 /// The transaction fee rate in BTC/kvB
1423 pub amount: serde_json::Value,
1424}
1425
1426/// Change the state of the given wallet flag for a wallet.
1427#[derive(Debug, Serialize)]
1428pub struct SetwalletflagParams {
1429 /// The name of the flag to change. Current available flags: avoid_reuse
1430 pub flag: String,
1431 /// The new state.
1432 pub value: Option<bool>,
1433}
1434
1435/// Sign a message with the private key of an address
1436/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
1437#[derive(Debug, Serialize)]
1438pub struct SignmessageParams {
1439 /// The bitcoin address to use for the private key.
1440 pub address: bitcoin::Address,
1441 /// The message to create a signature of.
1442 pub message: String,
1443}
1444
1445/// Sign a message with the private key of an address
1446#[derive(Debug, Serialize)]
1447pub struct SignmessagewithprivkeyParams {
1448 /// The private key to sign the message with.
1449 pub privkey: String,
1450 /// The message to create a signature of.
1451 pub message: String,
1452}
1453
1454/// Sign inputs for raw transaction (serialized, hex-encoded).
1455/// The second argument is an array of base58-encoded private
1456/// keys that will be the only keys used to sign the transaction.
1457/// The third optional argument (may be null) is an array of previous transaction outputs that
1458/// this transaction depends on but may not yet be in the block chain.
1459#[derive(Debug, Serialize)]
1460pub struct SignrawtransactionwithkeyParams {
1461 /// The transaction hex string
1462 pub hexstring: String,
1463 /// The base58-encoded private keys for signing
1464 pub privkeys: Vec<serde_json::Value>,
1465 /// The previous dependent transaction outputs
1466 pub prevtxs: Option<Vec<serde_json::Value>>,
1467 /// The signature hash type. Must be one of:
1468 /// "DEFAULT"
1469 /// "ALL"
1470 /// "NONE"
1471 /// "SINGLE"
1472 /// "ALL|ANYONECANPAY"
1473 /// "NONE|ANYONECANPAY"
1474 /// "SINGLE|ANYONECANPAY"
1475 pub sighashtype: Option<String>,
1476}
1477
1478/// Sign inputs for raw transaction (serialized, hex-encoded).
1479/// The second optional argument (may be null) is an array of previous transaction outputs that
1480/// this transaction depends on but may not yet be in the block chain.
1481/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
1482#[derive(Debug, Serialize)]
1483pub struct SignrawtransactionwithwalletParams {
1484 /// The transaction hex string
1485 pub hexstring: String,
1486 /// The previous dependent transaction outputs
1487 pub prevtxs: Option<Vec<serde_json::Value>>,
1488 /// The signature hash type. Must be one of
1489 /// "DEFAULT"
1490 /// "ALL"
1491 /// "NONE"
1492 /// "SINGLE"
1493 /// "ALL|ANYONECANPAY"
1494 /// "NONE|ANYONECANPAY"
1495 /// "SINGLE|ANYONECANPAY"
1496 pub sighashtype: Option<String>,
1497}
1498
1499/// Calculate the balance change resulting in the signing and broadcasting of the given transaction(s).
1500#[derive(Debug, Serialize)]
1501pub struct SimulaterawtransactionParams {
1502 /// An array of hex strings of raw transactions.
1503 pub rawtxs: Option<Vec<serde_json::Value>>,
1504 pub options: Option<serde_json::Value>,
1505}
1506
1507/// Request a graceful shutdown of Bitcoin Core.
1508#[derive(Debug, Serialize)]
1509pub struct StopParams {
1510 /// how long to wait in ms
1511 pub wait: Option<i64>,
1512}
1513
1514/// Attempts to submit new block to network.
1515/// See <https://en.bitcoin.it/wiki/BIP_0022> for full specification.
1516#[derive(Debug, Serialize)]
1517pub struct SubmitblockParams {
1518 /// the hex-encoded block data to submit
1519 pub hexdata: String,
1520 /// dummy value, for compatibility with BIP22. This value is ignored.
1521 pub dummy: Option<String>,
1522}
1523
1524/// Decode the given hexdata as a header and submit it as a candidate chain tip if valid.
1525/// Throws when the header is invalid.
1526#[derive(Debug, Serialize)]
1527pub struct SubmitheaderParams {
1528 /// the hex-encoded block header data
1529 pub hexdata: String,
1530}
1531
1532/// Submit a package of raw transactions (serialized, hex-encoded) to local node.
1533/// The package will be validated according to consensus and mempool policy rules. If any transaction passes, it will be accepted to mempool.
1534/// This RPC is experimental and the interface may be unstable. Refer to doc/policy/packages.md for documentation on package policies.
1535/// Warning: successful submission does not mean the transactions will propagate throughout the network.
1536#[derive(Debug, Serialize)]
1537pub struct SubmitpackageParams {
1538 /// An array of raw transactions.
1539 /// The package must consist of a transaction with (some, all, or none of) its unconfirmed parents. A single transaction is permitted.
1540 /// None of the parents may depend on each other. Parents that are already in mempool do not need to be present in the package.
1541 /// The package must be topologically sorted, with the child being the last element in the array if there are multiple elements.
1542 pub package: Vec<serde_json::Value>,
1543 /// Reject transactions whose fee rate is higher than the specified value, expressed in BTC/kvB.
1544 /// Fee rates larger than 1BTC/kvB are rejected.
1545 /// Set to 0 to accept any fee rate.
1546 pub maxfeerate: Option<serde_json::Value>,
1547 /// Reject transactions with provably unspendable outputs (e.g. 'datacarrier' outputs that use the OP_RETURN opcode) greater than the specified value, expressed in BTC.
1548 /// If burning funds through unspendable outputs is desired, increase this value.
1549 /// This check is based on heuristics and does not guarantee spendability of outputs.
1550 pub maxburnamount: Option<serde_json::Value>,
1551}
1552
1553/// Returns result of mempool acceptance tests indicating if raw transaction(s) (serialized, hex-encoded) would be accepted by mempool.
1554/// 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.
1555/// If one transaction fails, other transactions may not be fully validated (the 'allowed' key will be blank).
1556/// The maximum number of transactions allowed is 25.
1557/// This checks if transactions violate the consensus or policy rules.
1558/// See sendrawtransaction call.
1559#[derive(Debug, Serialize)]
1560pub struct TestmempoolacceptParams {
1561 /// An array of hex strings of raw transactions.
1562 pub rawtxs: Vec<serde_json::Value>,
1563 /// Reject transactions whose fee rate is higher than the specified value, expressed in BTC/kvB.
1564 /// Fee rates larger than 1BTC/kvB are rejected.
1565 /// Set to 0 to accept any fee rate.
1566 pub maxfeerate: Option<serde_json::Value>,
1567}
1568
1569/// Unloads the wallet referenced by the request endpoint or the wallet_name argument.
1570/// If both are specified, they must be identical.
1571#[derive(Debug, Serialize)]
1572pub struct UnloadwalletParams {
1573 /// The name of the wallet to unload. If provided both here and in the RPC endpoint, the two must be identical.
1574 pub wallet_name: Option<String>,
1575 /// Save wallet name to persistent settings and load on startup. True to add wallet to startup list, false to remove, null to leave unchanged.
1576 pub load_on_startup: Option<bool>,
1577}
1578
1579/// Updates all segwit inputs and outputs in a PSBT with data from output descriptors, the UTXO set, txindex, or the mempool.
1580#[derive(Debug, Serialize)]
1581pub struct UtxoupdatepsbtParams {
1582 /// A base64 string of a PSBT
1583 pub psbt: String,
1584 /// An array of either strings or objects
1585 pub descriptors: Option<Vec<serde_json::Value>>,
1586}
1587
1588/// Return information about the given bitcoin address.
1589#[derive(Debug, Serialize)]
1590pub struct ValidateaddressParams {
1591 /// The bitcoin address to validate
1592 pub address: bitcoin::Address,
1593}
1594
1595/// Verifies blockchain database.
1596#[derive(Debug, Serialize)]
1597pub struct VerifychainParams {
1598 /// How thorough the block verification is:
1599 /// - level 0 reads the blocks from disk
1600 /// - level 1 verifies block validity
1601 /// - level 2 verifies undo data
1602 /// - level 3 checks disconnection of tip blocks
1603 /// - level 4 tries to reconnect the blocks
1604 /// - each level includes the checks of the previous levels
1605 pub checklevel: Option<i64>,
1606 /// The number of blocks to check.
1607 pub nblocks: Option<i64>,
1608}
1609
1610/// Verify a signed message.
1611#[derive(Debug, Serialize)]
1612pub struct VerifymessageParams {
1613 /// The bitcoin address to use for the signature.
1614 pub address: bitcoin::Address,
1615 /// The signature provided by the signer in base 64 encoding (see signmessage).
1616 pub signature: String,
1617 /// The message that was signed.
1618 pub message: String,
1619}
1620
1621/// Verifies that a proof points to a transaction in a block, returning the transaction it commits to
1622/// and throwing an RPC error if the block is not in our best chain
1623#[derive(Debug, Serialize)]
1624pub struct VerifytxoutproofParams {
1625 /// The hex-encoded proof generated by gettxoutproof
1626 pub proof: String,
1627}
1628
1629/// Waits for a specific new block and returns useful info about it.
1630/// Returns the current block on timeout or exit.
1631/// Make sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)
1632#[derive(Debug, Serialize)]
1633pub struct WaitforblockParams {
1634 /// Block hash to wait for.
1635 pub blockhash: bitcoin::BlockHash,
1636 /// Time in milliseconds to wait for a response. 0 indicates no timeout.
1637 pub timeout: Option<i64>,
1638}
1639
1640/// Waits for (at least) block height and returns the height and hash
1641/// of the current tip.
1642/// Returns the current block on timeout or exit.
1643/// Make sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)
1644#[derive(Debug, Serialize)]
1645pub struct WaitforblockheightParams {
1646 /// Block height to wait for.
1647 pub height: i64,
1648 /// Time in milliseconds to wait for a response. 0 indicates no timeout.
1649 pub timeout: Option<i64>,
1650}
1651
1652/// Waits for any new block and returns useful info about it.
1653/// Returns the current block on timeout or exit.
1654/// Make sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)
1655#[derive(Debug, Serialize)]
1656pub struct WaitfornewblockParams {
1657 /// Time in milliseconds to wait for a response. 0 indicates no timeout.
1658 pub timeout: Option<i64>,
1659 /// Method waits for the chain tip to differ from this.
1660 pub current_tip: Option<String>,
1661}
1662
1663/// Creates and funds a transaction in the Partially Signed Transaction format.
1664/// Implements the Creator and Updater roles.
1665/// All existing inputs must either have their previous output transaction be in the wallet
1666/// or be in the UTXO set. Solving data must be provided for non-wallet inputs.
1667#[derive(Debug, Serialize)]
1668pub struct WalletcreatefundedpsbtParams {
1669 /// Leave empty to add inputs automatically. See add_inputs option.
1670 pub inputs: Option<Vec<serde_json::Value>>,
1671 /// The outputs specified as key-value pairs.
1672 /// Each key may only appear once, i.e. there can only be one 'data' output, and no address may be duplicated.
1673 /// At least one output of either type must be specified.
1674 /// For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also
1675 /// accepted as second parameter.
1676 pub outputs: Vec<serde_json::Value>,
1677 /// Raw locktime. Non-0 value also locktime-activates inputs
1678 pub locktime: Option<i64>,
1679 pub options: Option<serde_json::Value>,
1680 /// Include BIP 32 derivation paths for public keys if we know them
1681 pub bip32derivs: Option<bool>,
1682 /// Transaction version
1683 pub version: Option<i64>,
1684}
1685
1686/// Display address on an external signer for verification.
1687#[derive(Debug, Serialize)]
1688pub struct WalletdisplayaddressParams {
1689 /// bitcoin address to display
1690 pub address: bitcoin::Address,
1691}
1692
1693/// Stores the wallet decryption key in memory for 'timeout' seconds.
1694/// This is needed prior to performing transactions related to private keys such as sending bitcoins
1695/// Note:
1696/// Issuing the walletpassphrase command while the wallet is already unlocked will set a new unlock
1697/// time that overrides the old one.
1698#[derive(Debug, Serialize)]
1699pub struct WalletpassphraseParams {
1700 /// The wallet passphrase
1701 pub passphrase: String,
1702 /// The time to keep the decryption key in seconds; capped at 100000000 (~3 years).
1703 pub timeout: i64,
1704}
1705
1706/// Changes the wallet passphrase from 'oldpassphrase' to 'newpassphrase'.
1707#[derive(Debug, Serialize)]
1708pub struct WalletpassphrasechangeParams {
1709 /// The current passphrase
1710 pub oldpassphrase: String,
1711 /// The new passphrase
1712 pub newpassphrase: String,
1713}
1714
1715/// Update a PSBT with input information from our wallet and then sign inputs
1716/// that we can sign for.
1717/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
1718#[derive(Debug, Serialize)]
1719pub struct WalletprocesspsbtParams {
1720 /// The transaction base64 string
1721 pub psbt: String,
1722 /// Also sign the transaction when updating (requires wallet to be unlocked)
1723 pub sign: Option<bool>,
1724 /// The signature hash type to sign with if not specified by the PSBT. Must be one of
1725 /// "DEFAULT"
1726 /// "ALL"
1727 /// "NONE"
1728 /// "SINGLE"
1729 /// "ALL|ANYONECANPAY"
1730 /// "NONE|ANYONECANPAY"
1731 /// "SINGLE|ANYONECANPAY"
1732 pub sighashtype: Option<String>,
1733 /// Include BIP 32 derivation paths for public keys if we know them
1734 pub bip32derivs: Option<bool>,
1735 /// Also finalize inputs if possible
1736 pub finalize: Option<bool>,
1737}