26 {
"setmocktime", 0,
"timestamp"},
27 {
"mockscheduler", 0,
"delta_time"},
28 {
"utxoupdatepsbt", 1,
"descriptors"},
29 {
"generatetoaddress", 0,
"nblocks"},
30 {
"generatetoaddress", 2,
"maxtries"},
31 {
"generatetodescriptor", 0,
"num_blocks"},
32 {
"generatetodescriptor", 2,
"maxtries"},
33 {
"generateblock", 1,
"transactions"},
34 {
"getnetworkhashps", 0,
"nblocks"},
35 {
"getnetworkhashps", 1,
"height"},
36 {
"sendtoaddress", 1,
"amount"},
37 {
"sendtoaddress", 4,
"subtractfeefromamount"},
38 {
"sendtoaddress", 5,
"avoid_reuse"},
39 {
"settxfee", 0,
"amount"},
40 {
"sethdseed", 0,
"newkeypool"},
41 {
"getreceivedbyaddress", 1,
"minconf"},
42 {
"getreceivedbylabel", 1,
"minconf"},
43 {
"listreceivedbyaddress", 0,
"minconf"},
44 {
"listreceivedbyaddress", 1,
"include_empty"},
45 {
"listreceivedbyaddress", 2,
"include_watchonly"},
46 {
"listreceivedbylabel", 0,
"minconf"},
47 {
"listreceivedbylabel", 1,
"include_empty"},
48 {
"listreceivedbylabel", 2,
"include_watchonly"},
49 {
"getbalance", 1,
"minconf"},
50 {
"getbalance", 2,
"include_watchonly"},
51 {
"getbalance", 3,
"avoid_reuse"},
52 {
"getblockfrompeer", 1,
"peer_id"},
53 {
"getblockhash", 0,
"height"},
54 {
"waitforblockheight", 0,
"height"},
55 {
"waitforblockheight", 1,
"timeout"},
56 {
"waitforblock", 1,
"timeout"},
57 {
"waitfornewblock", 0,
"timeout"},
58 {
"listtransactions", 1,
"count"},
59 {
"listtransactions", 2,
"skip"},
60 {
"listtransactions", 3,
"include_watchonly"},
61 {
"walletpassphrase", 1,
"timeout"},
62 {
"getblocktemplate", 0,
"template_request"},
63 {
"listsinceblock", 1,
"target_confirmations"},
64 {
"listsinceblock", 2,
"include_watchonly"},
65 {
"listsinceblock", 3,
"include_removed"},
66 {
"sendmany", 1,
"amounts"},
67 {
"sendmany", 2,
"minconf"},
68 {
"sendmany", 4,
"subtractfeefrom"},
69 {
"deriveaddresses", 1,
"range"},
70 {
"scantxoutset", 1,
"scanobjects"},
71 {
"addmultisigaddress", 0,
"nrequired"},
72 {
"addmultisigaddress", 1,
"keys"},
73 {
"createmultisig", 0,
"nrequired"},
74 {
"createmultisig", 1,
"keys"},
75 {
"listunspent", 0,
"minconf"},
76 {
"listunspent", 1,
"maxconf"},
77 {
"listunspent", 2,
"addresses"},
78 {
"listunspent", 3,
"include_unsafe"},
79 {
"listunspent", 4,
"query_options"},
80 {
"getblock", 1,
"verbosity"},
81 {
"getblock", 1,
"verbose"},
82 {
"getblockheader", 1,
"verbose"},
83 {
"getchaintxstats", 0,
"nblocks"},
84 {
"gettransaction", 1,
"include_watchonly"},
85 {
"gettransaction", 2,
"verbose"},
86 {
"getrawtransaction", 1,
"verbose"},
87 {
"createrawtransaction", 0,
"inputs"},
88 {
"createrawtransaction", 1,
"outputs"},
89 {
"createrawtransaction", 2,
"locktime"},
90 {
"signrawtransactionwithkey", 1,
"privkeys"},
91 {
"signrawtransactionwithkey", 2,
"prevtxs"},
92 {
"signrawtransactionwithwallet", 1,
"prevtxs"},
93 {
"sendrawtransaction", 1,
"maxfeerate"},
94 {
"testmempoolaccept", 0,
"rawtxs"},
95 {
"testmempoolaccept", 1,
"maxfeerate"},
96 {
"combinerawtransaction", 0,
"txs"},
97 {
"fundrawtransaction", 1,
"options"},
98 {
"walletcreatefundedpsbt", 0,
"inputs"},
99 {
"walletcreatefundedpsbt", 1,
"outputs"},
100 {
"walletcreatefundedpsbt", 2,
"locktime"},
101 {
"walletcreatefundedpsbt", 3,
"options"},
102 {
"walletcreatefundedpsbt", 4,
"bip32derivs"},
103 {
"walletprocesspsbt", 1,
"sign"},
104 {
"walletprocesspsbt", 3,
"bip32derivs"},
105 {
"createpsbt", 0,
"inputs"},
106 {
"createpsbt", 1,
"outputs"},
107 {
"createpsbt", 2,
"locktime"},
108 {
"combinepsbt", 0,
"txs"},
109 {
"joinpsbts", 0,
"txs"},
110 {
"finalizepsbt", 1,
"extract"},
111 {
"converttopsbt", 1,
"permitsigdata"},
112 {
"gettxout", 1,
"n"},
113 {
"gettxout", 2,
"include_mempool"},
114 {
"gettxoutproof", 0,
"txids"},
115 {
"gettxoutsetinfo", 1,
"hash_or_height"},
116 {
"gettxoutsetinfo", 2,
"use_index"},
117 {
"lockunspent", 0,
"unlock"},
118 {
"lockunspent", 1,
"transactions"},
119 {
"send", 0,
"outputs"},
120 {
"send", 1,
"options"},
121 {
"importprivkey", 2,
"rescan"},
122 {
"importaddress", 2,
"rescan"},
123 {
"importaddress", 3,
"p2sh"},
124 {
"importpubkey", 2,
"rescan"},
125 {
"importmulti", 0,
"requests"},
126 {
"importmulti", 1,
"options"},
127 {
"importdescriptors", 0,
"requests"},
128 {
"verifychain", 0,
"checklevel"},
129 {
"verifychain", 1,
"nblocks"},
130 {
"getblockstats", 0,
"hash_or_height"},
131 {
"getblockstats", 1,
"stats"},
132 {
"pruneblockchain", 0,
"height"},
133 {
"keypoolrefill", 0,
"newsize"},
134 {
"getrawmempool", 0,
"verbose"},
135 {
"getrawmempool", 1,
"mempool_sequence"},
136 {
"prioritisetransaction", 1,
"dummy"},
137 {
"prioritisetransaction", 2,
"fee_delta"},
138 {
"setban", 2,
"bantime"},
139 {
"setban", 3,
"absolute"},
140 {
"setnetworkactive", 0,
"state"},
141 {
"setwalletflag", 1,
"value"},
142 {
"getmempoolancestors", 1,
"verbose"},
143 {
"getmempooldescendants", 1,
"verbose"},
144 {
"disconnectnode", 1,
"nodeid"},
145 {
"logging", 0,
"include"},
146 {
"logging", 1,
"exclude"},
147 {
"upgradewallet", 0,
"version"},
149 {
"echojson", 0,
"arg0"},
150 {
"echojson", 1,
"arg1"},
151 {
"echojson", 2,
"arg2"},
152 {
"echojson", 3,
"arg3"},
153 {
"echojson", 4,
"arg4"},
154 {
"echojson", 5,
"arg5"},
155 {
"echojson", 6,
"arg6"},
156 {
"echojson", 7,
"arg7"},
157 {
"echojson", 8,
"arg8"},
158 {
"echojson", 9,
"arg9"},
159 {
"rescanblockchain", 0,
"start_height"},
160 {
"rescanblockchain", 1,
"stop_height"},
161 {
"createwallet", 1,
"disable_private_keys"},
162 {
"createwallet", 2,
"blank"},
163 {
"createwallet", 4,
"avoid_reuse"},
164 {
"createwallet", 5,
"descriptors"},
165 {
"createwallet", 6,
"load_on_startup"},
166 {
"restorewallet", 2,
"load_on_startup"},
167 {
"loadwallet", 1,
"load_on_startup"},
168 {
"unloadwallet", 1,
"load_on_startup"},
169 {
"getnodeaddresses", 0,
"count"},
170 {
"addpeeraddress", 1,
"port"},
171 {
"addpeeraddress", 2,
"tried"},
173 {
"createwallettransaction", 1,
"amount"},
175 {
"addavalanchenode", 0,
"nodeid"},
176 {
"buildavalancheproof", 0,
"sequence"},
177 {
"buildavalancheproof", 1,
"expiration"},
178 {
"buildavalancheproof", 3,
"stakes"},
179 {
"getremoteproofs", 0,
"nodeid"},
180 {
"getstakingreward", 1,
"recompute"},
181 {
"setstakingreward", 2,
"append"},
186 std::set<std::pair<std::string, int>>
members;
192 bool convert(
const std::string &method,
int idx) {
193 return (
members.count(std::make_pair(method, idx)) > 0);
195 bool convert(
const std::string &method,
const std::string &
name) {
202 members.emplace(cp.methodName, cp.paramIdx);
215 if (!jVal.
read(std::string(
"[") + strVal + std::string(
"]")) ||
217 throw std::runtime_error(std::string(
"Error parsing JSON: ") + strVal);
223 const std::vector<std::string> &strParams) {
226 for (
unsigned int idx = 0; idx < strParams.size(); idx++) {
227 const std::string &strVal = strParams[idx];
242 const std::vector<std::string> &strParams) {
245 for (
const std::string &s : strParams) {
246 size_t pos = s.find(
'=');
247 if (pos == std::string::npos) {
248 throw(std::runtime_error(
"No '=' in named argument '" + s +
249 "', this needs to be present for every "
250 "argument (even if it is empty)"));
253 std::string
name = s.substr(0, pos);
254 std::string value = s.substr(pos + 1);
std::string methodName
method whose params want conversion
int paramIdx
0-based idx of param to convert
std::string paramName
parameter name
bool convert(const std::string &method, int idx)
bool convert(const std::string &method, const std::string &name)
std::set< std::pair< std::string, std::string > > membersByName
std::set< std::pair< std::string, int > > members
bool push_back(const UniValue &val)
bool pushKV(const std::string &key, const UniValue &val)
bool read(const char *raw, size_t len)
UniValue ParseNonRFCJSONValue(const std::string &strVal)
Non-RFC4627 JSON parser, accepts internal values (such as numbers, true, false, null) as well as obje...
UniValue RPCConvertValues(const std::string &strMethod, const std::vector< std::string > &strParams)
Convert positional arguments to command-specific RPC representation.
UniValue RPCConvertNamedValues(const std::string &strMethod, const std::vector< std::string > &strParams)
Convert named arguments to command-specific RPC representation.
static CRPCConvertTable rpcCvtTable
static const CRPCConvertParam vRPCConvertParams[]
Specify a (method, idx, name) here if the argument is a non-string RPC argument and needs to be conve...