Bitcoin Core 32.99.0
P2P Digital Currency
client.cpp
Go to the documentation of this file.
1// Copyright (c) 2010 Satoshi Nakamoto
2// Copyright (c) 2009-present The Bitcoin Core developers
3// Distributed under the MIT software license, see the accompanying
4// file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
6#include <rpc/client.h>
7
8#include <tinyformat.h>
9
10#include <algorithm>
11#include <cstddef>
12#include <ranges>
13#include <stdexcept>
14#include <string>
15#include <string_view>
16#include <utility>
17
21
23{
24public:
25 std::string methodName;
27 std::string paramName;
29};
30
31// clang-format off
61{
62 { "setmocktime", 0, "timestamp" },
63 { "mockscheduler", 0, "delta_time" },
64 { "utxoupdatepsbt", 0, "psbt", ParamFormat::STRING },
65 { "utxoupdatepsbt", 1, "descriptors" },
66 { "generatetoaddress", 0, "nblocks" },
67 { "generatetoaddress", 2, "maxtries" },
68 { "generatetodescriptor", 0, "num_blocks" },
69 { "generatetodescriptor", 2, "maxtries" },
70 { "generateblock", 1, "transactions" },
71 { "generateblock", 2, "submit" },
72 { "getnetworkhashps", 0, "nblocks" },
73 { "getnetworkhashps", 1, "height" },
74 { "sendtoaddress", 0, "address", ParamFormat::STRING },
75 { "sendtoaddress", 1, "amount" },
76 { "sendtoaddress", 2, "comment", ParamFormat::STRING },
77 { "sendtoaddress", 3, "comment_to", ParamFormat::STRING },
78 { "sendtoaddress", 4, "subtractfeefromamount" },
79 { "sendtoaddress", 5 , "replaceable" },
80 { "sendtoaddress", 6 , "conf_target" },
81 { "sendtoaddress", 7, "estimate_mode", ParamFormat::STRING },
82 { "sendtoaddress", 8, "avoid_reuse" },
83 { "sendtoaddress", 9, "fee_rate"},
84 { "sendtoaddress", 10, "verbose"},
85 { "getreceivedbyaddress", 1, "minconf" },
86 { "getreceivedbyaddress", 2, "include_immature_coinbase" },
87 { "getreceivedbylabel", 0, "label", ParamFormat::STRING },
88 { "getreceivedbylabel", 1, "minconf" },
89 { "getreceivedbylabel", 2, "include_immature_coinbase" },
90 { "listreceivedbyaddress", 0, "minconf" },
91 { "listreceivedbyaddress", 1, "include_empty" },
92 { "listreceivedbyaddress", 2, "include_watchonly" },
93 { "listreceivedbyaddress", 4, "include_immature_coinbase" },
94 { "listreceivedbylabel", 0, "minconf" },
95 { "listreceivedbylabel", 1, "include_empty" },
96 { "listreceivedbylabel", 2, "include_watchonly" },
97 { "listreceivedbylabel", 3, "include_immature_coinbase" },
98 { "getbalance", 1, "minconf" },
99 { "getbalance", 2, "include_watchonly" },
100 { "getbalance", 3, "avoid_reuse" },
101 { "getblockfrompeer", 1, "peer_id" },
102 { "getblockhash", 0, "height" },
103 { "waitforblockheight", 0, "height" },
104 { "waitforblockheight", 1, "timeout" },
105 { "waitforblock", 1, "timeout" },
106 { "waitfornewblock", 0, "timeout" },
107 { "listtransactions", 0, "label", ParamFormat::STRING },
108 { "listtransactions", 1, "count" },
109 { "listtransactions", 2, "skip" },
110 { "listtransactions", 3, "include_watchonly" },
111 { "walletpassphrase", 0, "passphrase", ParamFormat::STRING },
112 { "walletpassphrase", 1, "timeout" },
113 { "getblocktemplate", 0, "template_request" },
114 { "listsinceblock", 0, "blockhash", ParamFormat::STRING },
115 { "listsinceblock", 1, "target_confirmations" },
116 { "listsinceblock", 2, "include_watchonly" },
117 { "listsinceblock", 3, "include_removed" },
118 { "listsinceblock", 4, "include_change" },
119 { "listsinceblock", 5, "label", ParamFormat::STRING },
120 { "sendmany", 0, "dummy", ParamFormat::STRING },
121 { "sendmany", 1, "amounts" },
122 { "sendmany", 2, "minconf" },
123 { "sendmany", 3, "comment", ParamFormat::STRING },
124 { "sendmany", 4, "subtractfeefrom" },
125 { "sendmany", 5 , "replaceable" },
126 { "sendmany", 6 , "conf_target" },
127 { "sendmany", 7, "estimate_mode", ParamFormat::STRING },
128 { "sendmany", 8, "fee_rate"},
129 { "sendmany", 9, "verbose" },
130 { "deriveaddresses", 1, "range" },
131 { "scanblocks", 1, "scanobjects" },
132 { "scanblocks", 2, "start_height" },
133 { "scanblocks", 3, "stop_height" },
134 { "scanblocks", 5, "options" },
135 { "scanblocks", 5, "filter_false_positives" },
136 { "getdescriptoractivity", 0, "blockhashes" },
137 { "getdescriptoractivity", 1, "scanobjects" },
138 { "getdescriptoractivity", 2, "include_mempool" },
139 { "scantxoutset", 1, "scanobjects" },
140 { "createmultisig", 0, "nrequired" },
141 { "createmultisig", 1, "keys" },
142 { "listunspent", 0, "minconf" },
143 { "listunspent", 1, "maxconf" },
144 { "listunspent", 2, "addresses" },
145 { "listunspent", 3, "include_unsafe" },
146 { "listunspent", 4, "query_options" },
147 { "listunspent", 4, "minimumAmount" },
148 { "listunspent", 4, "maximumAmount" },
149 { "listunspent", 4, "maximumCount" },
150 { "listunspent", 4, "minimumSumAmount" },
151 { "listunspent", 4, "include_immature_coinbase" },
152 { "getblock", 1, "verbosity" },
153 { "getblock", 1, "verbose" },
154 { "getblockheader", 1, "verbose" },
155 { "getchaintxstats", 0, "nblocks" },
156 { "gettransaction", 1, "include_watchonly" },
157 { "gettransaction", 2, "verbose" },
158 { "getrawtransaction", 1, "verbosity" },
159 { "getrawtransaction", 1, "verbose" },
160 { "createrawtransaction", 0, "inputs" },
161 { "createrawtransaction", 1, "outputs" },
162 { "createrawtransaction", 2, "locktime" },
163 { "createrawtransaction", 3, "replaceable" },
164 { "createrawtransaction", 4, "version" },
165 { "decoderawtransaction", 1, "iswitness" },
166 { "signrawtransactionwithkey", 1, "privkeys" },
167 { "signrawtransactionwithkey", 2, "prevtxs" },
168 { "signrawtransactionwithwallet", 1, "prevtxs" },
169 { "sendrawtransaction", 1, "maxfeerate" },
170 { "sendrawtransaction", 2, "maxburnamount" },
171 { "testmempoolaccept", 0, "rawtxs" },
172 { "testmempoolaccept", 1, "maxfeerate" },
173 { "submitpackage", 0, "package" },
174 { "submitpackage", 1, "maxfeerate" },
175 { "submitpackage", 2, "maxburnamount" },
176 { "combinerawtransaction", 0, "txs" },
177 { "fundrawtransaction", 1, "options" },
178 { "fundrawtransaction", 1, "add_inputs"},
179 { "fundrawtransaction", 1, "include_unsafe"},
180 { "fundrawtransaction", 1, "minconf"},
181 { "fundrawtransaction", 1, "maxconf"},
182 { "fundrawtransaction", 1, "changePosition"},
183 { "fundrawtransaction", 1, "includeWatching"},
184 { "fundrawtransaction", 1, "lockUnspents"},
185 { "fundrawtransaction", 1, "fee_rate"},
186 { "fundrawtransaction", 1, "feeRate"},
187 { "fundrawtransaction", 1, "subtractFeeFromOutputs"},
188 { "fundrawtransaction", 1, "input_weights"},
189 { "fundrawtransaction", 1, "conf_target"},
190 { "fundrawtransaction", 1, "replaceable"},
191 { "fundrawtransaction", 1, "solving_data"},
192 { "fundrawtransaction", 1, "max_tx_weight"},
193 { "fundrawtransaction", 2, "iswitness" },
194 { "walletcreatefundedpsbt", 0, "inputs" },
195 { "walletcreatefundedpsbt", 1, "outputs" },
196 { "walletcreatefundedpsbt", 2, "locktime" },
197 { "walletcreatefundedpsbt", 3, "options" },
198 { "walletcreatefundedpsbt", 3, "add_inputs"},
199 { "walletcreatefundedpsbt", 3, "include_unsafe"},
200 { "walletcreatefundedpsbt", 3, "minconf"},
201 { "walletcreatefundedpsbt", 3, "maxconf"},
202 { "walletcreatefundedpsbt", 3, "changePosition"},
203 { "walletcreatefundedpsbt", 3, "includeWatching"},
204 { "walletcreatefundedpsbt", 3, "lockUnspents"},
205 { "walletcreatefundedpsbt", 3, "fee_rate"},
206 { "walletcreatefundedpsbt", 3, "feeRate"},
207 { "walletcreatefundedpsbt", 3, "subtractFeeFromOutputs"},
208 { "walletcreatefundedpsbt", 3, "conf_target"},
209 { "walletcreatefundedpsbt", 3, "replaceable"},
210 { "walletcreatefundedpsbt", 3, "solving_data"},
211 { "walletcreatefundedpsbt", 3, "max_tx_weight"},
212 { "walletcreatefundedpsbt", 4, "bip32derivs" },
213 { "walletcreatefundedpsbt", 5, "version" },
214 { "walletcreatefundedpsbt", 6, "psbt_version" },
215 { "walletprocesspsbt", 0, "psbt", ParamFormat::STRING },
216 { "walletprocesspsbt", 1, "sign" },
217 { "walletprocesspsbt", 2, "sighashtype", ParamFormat::STRING },
218 { "walletprocesspsbt", 3, "bip32derivs" },
219 { "walletprocesspsbt", 4, "finalize" },
220 { "descriptorprocesspsbt", 0, "psbt", ParamFormat::STRING },
221 { "descriptorprocesspsbt", 1, "descriptors"},
222 { "descriptorprocesspsbt", 2, "sighashtype", ParamFormat::STRING },
223 { "descriptorprocesspsbt", 3, "bip32derivs" },
224 { "descriptorprocesspsbt", 4, "finalize" },
225 { "createpsbt", 0, "inputs" },
226 { "createpsbt", 1, "outputs" },
227 { "createpsbt", 2, "locktime" },
228 { "createpsbt", 3, "replaceable" },
229 { "createpsbt", 4, "version" },
230 { "createpsbt", 5, "psbt_version" },
231 { "combinepsbt", 0, "txs"},
232 { "joinpsbts", 0, "txs"},
233 { "finalizepsbt", 0, "psbt", ParamFormat::STRING },
234 { "finalizepsbt", 1, "extract"},
235 { "converttopsbt", 1, "permitsigdata"},
236 { "converttopsbt", 2, "iswitness"},
237 { "converttopsbt", 3, "psbt_version"},
238 { "gettxout", 1, "n" },
239 { "gettxout", 2, "include_mempool" },
240 { "gettxoutproof", 0, "txids" },
241 { "gettxoutsetinfo", 1, "hash_or_height", ParamFormat::JSON_OR_STRING },
242 { "gettxoutsetinfo", 2, "use_index"},
243 { "dumptxoutset", 0, "path", ParamFormat::STRING },
244 { "dumptxoutset", 1, "type", ParamFormat::STRING },
245 { "dumptxoutset", 2, "options" },
246 { "dumptxoutset", 2, "rollback", ParamFormat::JSON_OR_STRING },
247 { "dumptxoutset", 2, "in_memory" },
248 { "lockunspent", 0, "unlock" },
249 { "lockunspent", 1, "transactions" },
250 { "lockunspent", 2, "persistent" },
251 { "send", 0, "outputs" },
252 { "send", 1, "conf_target" },
253 { "send", 3, "fee_rate"},
254 { "send", 4, "options" },
255 { "send", 4, "add_inputs"},
256 { "send", 4, "include_unsafe"},
257 { "send", 4, "minconf"},
258 { "send", 4, "maxconf"},
259 { "send", 4, "add_to_wallet"},
260 { "send", 4, "change_position"},
261 { "send", 4, "fee_rate"},
262 { "send", 4, "include_watching"},
263 { "send", 4, "inputs"},
264 { "send", 4, "locktime"},
265 { "send", 4, "lock_unspents"},
266 { "send", 4, "psbt"},
267 { "send", 4, "subtract_fee_from_outputs"},
268 { "send", 4, "conf_target"},
269 { "send", 4, "replaceable"},
270 { "send", 4, "solving_data"},
271 { "send", 4, "max_tx_weight"},
272 { "send", 5, "version"},
273 { "sendall", 0, "recipients" },
274 { "sendall", 1, "conf_target" },
275 { "sendall", 3, "fee_rate"},
276 { "sendall", 4, "options" },
277 { "sendall", 4, "add_to_wallet"},
278 { "sendall", 4, "fee_rate"},
279 { "sendall", 4, "include_watching"},
280 { "sendall", 4, "inputs"},
281 { "sendall", 4, "locktime"},
282 { "sendall", 4, "lock_unspents"},
283 { "sendall", 4, "psbt"},
284 { "sendall", 4, "send_max"},
285 { "sendall", 4, "minconf"},
286 { "sendall", 4, "maxconf"},
287 { "sendall", 4, "conf_target"},
288 { "sendall", 4, "replaceable"},
289 { "sendall", 4, "solving_data"},
290 { "sendall", 4, "version"},
291 { "simulaterawtransaction", 0, "rawtxs" },
292 { "simulaterawtransaction", 1, "options" },
293 { "simulaterawtransaction", 1, "include_watchonly"},
294 { "importmempool", 0, "filepath", ParamFormat::STRING },
295 { "importmempool", 1, "options" },
296 { "importmempool", 1, "apply_fee_delta_priority" },
297 { "importmempool", 1, "use_current_time" },
298 { "importmempool", 1, "apply_unbroadcast_set" },
299 { "importdescriptors", 0, "requests" },
300 { "listdescriptors", 0, "private" },
301 { "verifychain", 0, "checklevel" },
302 { "verifychain", 1, "nblocks" },
303 { "getblockstats", 0, "hash_or_height", ParamFormat::JSON_OR_STRING },
304 { "getblockstats", 1, "stats" },
305 { "pruneblockchain", 0, "height" },
306 { "keypoolrefill", 0, "newsize" },
307 { "getrawmempool", 0, "verbose" },
308 { "getrawmempool", 1, "mempool_sequence" },
309 { "getorphantxs", 0, "verbosity" },
310 { "estimatesmartfee", 0, "conf_target" },
311 { "estimatesmartfee", 2, "options" },
312 { "estimaterawfee", 0, "conf_target" },
313 { "estimaterawfee", 1, "threshold" },
314 { "prioritisetransaction", 1, "dummy" },
315 { "prioritisetransaction", 2, "fee_delta" },
316 { "setban", 2, "bantime" },
317 { "setban", 3, "absolute" },
318 { "setnetworkactive", 0, "state" },
319 { "setwalletflag", 1, "value" },
320 { "getmempoolancestors", 1, "verbose" },
321 { "getmempooldescendants", 1, "verbose" },
322 { "gettxspendingprevout", 0, "outputs" },
323 { "gettxspendingprevout", 1, "options" },
324 { "gettxspendingprevout", 1, "mempool_only" },
325 { "gettxspendingprevout", 1, "return_spending_tx" },
326 { "bumpfee", 1, "options" },
327 { "bumpfee", 1, "conf_target"},
328 { "bumpfee", 1, "fee_rate"},
329 { "bumpfee", 1, "replaceable"},
330 { "bumpfee", 1, "outputs"},
331 { "bumpfee", 1, "original_change_index"},
332 { "psbtbumpfee", 1, "options" },
333 { "psbtbumpfee", 1, "conf_target"},
334 { "psbtbumpfee", 1, "fee_rate"},
335 { "psbtbumpfee", 1, "replaceable"},
336 { "psbtbumpfee", 1, "outputs"},
337 { "psbtbumpfee", 1, "original_change_index"},
338 { "psbtbumpfee", 1, "psbt_version"},
339 { "logging", 0, "include" },
340 { "logging", 1, "exclude" },
341 { "disconnectnode", 1, "nodeid" },
342 { "getopenrpcinfo", 0, "show_hidden" },
343 { "gethdkeys", 0, "active_only" },
344 { "gethdkeys", 0, "options" },
345 { "gethdkeys", 0, "private" },
346 { "derivehdkey", 1, "options" },
347 { "derivehdkey", 1, "private" },
348 { "createwalletdescriptor", 1, "options" },
349 { "createwalletdescriptor", 1, "internal" },
350 // Echo with conversion (For testing only)
351 { "echojson", 0, "arg0" },
352 { "echojson", 1, "arg1" },
353 { "echojson", 2, "arg2" },
354 { "echojson", 3, "arg3" },
355 { "echojson", 4, "arg4" },
356 { "echojson", 5, "arg5" },
357 { "echojson", 6, "arg6" },
358 { "echojson", 7, "arg7" },
359 { "echojson", 8, "arg8" },
360 { "echojson", 9, "arg9" },
361 { "rescanblockchain", 0, "start_height"},
362 { "rescanblockchain", 1, "stop_height"},
363 { "createwallet", 0, "wallet_name", ParamFormat::STRING },
364 { "createwallet", 1, "disable_private_keys"},
365 { "createwallet", 2, "blank"},
366 { "createwallet", 3, "passphrase", ParamFormat::STRING },
367 { "createwallet", 4, "avoid_reuse"},
368 { "createwallet", 5, "descriptors"},
369 { "createwallet", 6, "load_on_startup"},
370 { "createwallet", 7, "external_signer"},
371 { "restorewallet", 0, "wallet_name", ParamFormat::STRING },
372 { "restorewallet", 1, "backup_file", ParamFormat::STRING },
373 { "restorewallet", 2, "load_on_startup"},
374 { "loadwallet", 0, "filename", ParamFormat::STRING },
375 { "loadwallet", 1, "load_on_startup"},
376 { "unloadwallet", 0, "wallet_name", ParamFormat::STRING },
377 { "unloadwallet", 1, "load_on_startup"},
378 { "getnodeaddresses", 0, "count"},
379 { "addpeeraddress", 1, "port"},
380 { "addpeeraddress", 2, "tried"},
381 { "sendmsgtopeer", 0, "peer_id" },
382 { "stop", 0, "wait" },
383 { "addnode", 2, "v2transport" },
384 { "addconnection", 2, "v2transport" },
385 { "decodepsbt", 0, "psbt", ParamFormat::STRING },
386 { "analyzepsbt", 0, "psbt", ParamFormat::STRING},
387 { "verifymessage", 1, "signature", ParamFormat::STRING },
388 { "verifymessage", 2, "message", ParamFormat::STRING },
389 { "getnewaddress", 0, "label", ParamFormat::STRING },
390 { "getnewaddress", 1, "address_type", ParamFormat::STRING },
391 { "backupwallet", 0, "destination", ParamFormat::STRING },
392 { "echoipc", 0, "arg", ParamFormat::STRING },
393 { "encryptwallet", 0, "passphrase", ParamFormat::STRING },
394 { "getaddressesbylabel", 0, "label", ParamFormat::STRING },
395 { "loadtxoutset", 0, "path", ParamFormat::STRING },
396 { "migratewallet", 0, "wallet_name", ParamFormat::STRING },
397 { "migratewallet", 1, "passphrase", ParamFormat::STRING },
398 { "migratewallet", 2, "load_wallet"},
399 { "setlabel", 1, "label", ParamFormat::STRING },
400 { "signmessage", 1, "message", ParamFormat::STRING },
401 { "signmessagewithprivkey", 1, "message", ParamFormat::STRING },
402 { "walletpassphrasechange", 0, "oldpassphrase", ParamFormat::STRING },
403 { "walletpassphrasechange", 1, "newpassphrase", ParamFormat::STRING },
404};
405// clang-format on
406
408static UniValue Parse(std::string_view raw, ParamFormat format = ParamFormat::JSON)
409{
410 UniValue parsed;
411 if (!parsed.read(raw)) {
412 if (format != ParamFormat::JSON_OR_STRING) throw std::runtime_error(tfm::format("Error parsing JSON: %s", raw));
413 return UniValue(std::string(raw));
414 }
415 return parsed;
416}
417
418namespace rpc_convert
419{
420const CRPCConvertParam* FromPosition(std::string_view method, size_t pos)
421{
422 auto it = std::ranges::find_if(vRPCConvertParams, [&](const auto& p) {
423 return p.methodName == method && p.paramIdx == static_cast<int>(pos);
424 });
425
426 return it == std::end(vRPCConvertParams) ? nullptr : &*it;
427}
428
429const CRPCConvertParam* FromName(std::string_view method, std::string_view name)
430{
431 auto it = std::ranges::find_if(vRPCConvertParams, [&](const auto& p) {
432 return p.methodName == method && p.paramName == name;
433 });
434
435 return it == std::end(vRPCConvertParams) ? nullptr : &*it;
436}
437} // namespace rpc_convert
438
439static UniValue ParseParam(const CRPCConvertParam* param, std::string_view raw)
440{
441 // Only parse parameters which have the JSON or JSON_OR_STRING format; otherwise, treat them as strings.
442 return (param && (param->format == ParamFormat::JSON || param->format == ParamFormat::JSON_OR_STRING)) ? Parse(raw, param->format) : UniValue(std::string(raw));
443}
444
448UniValue RPCConvertValues(const std::string &strMethod, const std::vector<std::string> &strParams)
449{
450 UniValue params(UniValue::VARR);
451
452 for (std::string_view s : strParams) {
453 params.push_back(ParseParam(rpc_convert::FromPosition(strMethod, params.size()), s));
454 }
455
456 return params;
457}
458
488UniValue RPCConvertNamedValues(const std::string &strMethod, const std::vector<std::string> &strParams)
489{
490 UniValue params(UniValue::VOBJ);
491 UniValue positional_args{UniValue::VARR};
492
493 for (std::string_view s: strParams) {
494 size_t pos = s.find('=');
495 if (pos == std::string_view::npos) {
496 positional_args.push_back(ParseParam(rpc_convert::FromPosition(strMethod, positional_args.size()), s));
497 continue;
498 }
499
500 std::string name{s.substr(0, pos)};
501 std::string_view value{s.substr(pos+1)};
502
503 const CRPCConvertParam* named_param{rpc_convert::FromName(strMethod, name)};
504 if (!named_param) {
505 const CRPCConvertParam* positional_param = rpc_convert::FromPosition(strMethod, positional_args.size());
506 UniValue parsed_value;
507 if (positional_param && positional_param->format == ParamFormat::JSON && parsed_value.read(s)) {
508 positional_args.push_back(std::move(parsed_value));
509 continue;
510 } else if (positional_param && positional_param->format == ParamFormat::STRING) {
511 positional_args.push_back(s);
512 continue;
513 }
514 }
515
516 // Intentionally overwrite earlier named values with later ones as a
517 // convenience for scripts and command line users that want to merge
518 // options.
519 params.pushKV(name, ParseParam(named_param, value));
520 }
521
522 if (!positional_args.empty()) {
523 // Use pushKVEnd instead of pushKV to avoid overwriting an explicit
524 // "args" value with an implicit one. Let the RPC server handle the
525 // request as given.
526 params.pushKVEnd("args", std::move(positional_args));
527 }
528
529 return params;
530}
std::string methodName
method whose params want conversion
Definition: client.cpp:25
int paramIdx
0-based idx of param to convert
Definition: client.cpp:26
std::string paramName
parameter name
Definition: client.cpp:27
ParamFormat format
parameter format
Definition: client.cpp:28
void push_back(UniValue val)
Definition: univalue.cpp:103
@ VOBJ
Definition: univalue.h:24
@ VARR
Definition: univalue.h:24
size_t size() const
Definition: univalue.h:71
void pushKVEnd(std::string key, UniValue val)
Definition: univalue.cpp:117
bool read(std::string_view json)
Parse JSON; set value to null on failure.
void pushKV(std::string key, UniValue val)
Definition: univalue.cpp:125
UniValue RPCConvertValues(const std::string &strMethod, const std::vector< std::string > &strParams)
Convert command lines arguments to params object when -named is disabled.
Definition: client.cpp:448
static UniValue ParseParam(const CRPCConvertParam *param, std::string_view raw)
Definition: client.cpp:439
static UniValue Parse(std::string_view raw, ParamFormat format=ParamFormat::JSON)
Parse string to UniValue or throw runtime_error if string contains invalid JSON.
Definition: client.cpp:408
UniValue RPCConvertNamedValues(const std::string &strMethod, const std::vector< std::string > &strParams)
Convert command line arguments to params object when -named is enabled.
Definition: client.cpp:488
ParamFormat
Specify whether parameter should be parsed by bitcoin-cli as a JSON value, or passed unchanged as a s...
Definition: client.cpp:20
@ JSON_OR_STRING
Definition: client.cpp:20
@ JSON
Definition: client.cpp:20
@ STRING
Definition: client.cpp:20
static const CRPCConvertParam vRPCConvertParams[]
Specify a (method, idx, name, format) here if the argument is a non-string RPC argument and needs to ...
Definition: client.cpp:60
const CRPCConvertParam * FromPosition(std::string_view method, size_t pos)
Definition: client.cpp:420
const CRPCConvertParam * FromName(std::string_view method, std::string_view name)
Definition: client.cpp:429
void format(std::ostream &out, FormatStringCheck< sizeof...(Args)> fmt, const Args &... args)
Format list of arguments to the stream according to given format string.
Definition: tinyformat.h:1079
const char * name
Definition: rest.cpp:71