18 #include <boost/algorithm/string/case_conv.hpp>
32 {
"getaddednodeinfo", 0},
38 {
"getnetworkhashps", 0},
39 {
"getnetworkhashps", 1},
41 {
"rescanwallettransactions", 0},
42 {
"sendtostealthaddress", 1},
43 {
"sendtostealthaddress", 2},
44 {
"sendalltostealthaddress", 1},
46 {
"getreceivedbyaddress", 1},
47 {
"getreceivedbyaccount", 1},
48 {
"listreceivedbyaddress", 0},
49 {
"listreceivedbyaddress", 1},
50 {
"listreceivedbyaddress", 2},
51 {
"listreceivedbyaccount", 0},
52 {
"listreceivedbyaccount", 1},
53 {
"listreceivedbyaccount", 2},
58 {
"waitforblockheight", 0 },
59 {
"waitforblockheight", 1 },
60 {
"waitforblock", 1 },
61 {
"waitforblock", 2 },
62 {
"waitfornewblock", 0 },
63 {
"waitfornewblock", 1 },
64 {
"setmaxreorgdepth", 0},
66 {
"setdecoyconfirmation", 0},
67 {
"getrawtransactionbyblockheight", 0},
72 {
"listtransactions", 1},
73 {
"listtransactions", 2},
74 {
"listtransactions", 3},
75 {
"listtransactionsbypaymentid", 0},
76 {
"listtransactionsbypaymentid", 1},
77 {
"listtransactionsbypaymentid", 2},
78 {
"listtransactionsbypaymentid", 3},
83 {
"getblocktemplate", 0},
84 {
"getpoablocktemplate", 0},
85 {
"setminingnbits", 0},
86 {
"setminingnbits", 1},
87 {
"generateintegratedaddress", 0},
88 {
"generateintegratedaddress", 1},
89 {
"listsinceblock", 1},
90 {
"listsinceblock", 2},
93 {
"addmultisigaddress", 0},
94 {
"addmultisigaddress", 1},
95 {
"createmultisig", 0},
96 {
"createmultisig", 1},
103 {
"getblockheader", 1},
104 {
"getblockindexstats", 0},
105 {
"getblockindexstats", 1},
106 {
"getblockindexstats", 2},
107 {
"gettransaction", 1},
108 {
"getrawtransaction", 1},
109 {
"createrawtransaction", 0},
110 {
"createrawtransaction", 1},
111 {
"createrawtransaction", 2},
112 {
"signrawtransaction", 1},
113 {
"signrawtransaction", 2},
114 {
"sendrawtransaction", 1},
117 {
"getunspentcount", 0},
118 {
"getunspentcount", 1},
119 {
"getunspentcount", 2},
122 {
"importprivkey", 2},
123 {
"importaddress", 2},
126 {
"keypoolrefill", 0},
127 {
"getrawmempool", 0},
130 {
"estimatepriority", 0},
131 {
"prioritisetransaction", 1},
132 {
"prioritisetransaction", 2},
135 {
"preparebudget", 2},
136 {
"preparebudget", 3},
137 {
"preparebudget", 5},
146 {
"reservebalance", 0},
147 {
"reservebalance", 1},
148 {
"setstakesplitthreshold", 0},
149 {
"autocombinedust", 0},
150 {
"autocombinedust", 1}
156 std::set<std::pair<std::string, int> >
members;
161 bool convert(
const std::string& method,
int idx)
163 return (
members.count(std::make_pair(method, idx)) > 0);
169 const unsigned int n_elem =
170 (
sizeof(vRPCConvertParams) /
sizeof(vRPCConvertParams[0]));
172 for (
unsigned int i = 0; i < n_elem; i++) {
173 members.insert(std::make_pair(vRPCConvertParams[i].methodName,
174 vRPCConvertParams[i].paramIdx));
186 if (!jVal.
read(std::string(
"[")+strVal+std::string(
"]")) ||
188 throw std::runtime_error(std::string(
"Error parsing JSON:")+strVal);
197 for (
unsigned int idx = 0; idx < strParams.size(); idx++) {
198 const std::string& strVal = strParams[idx];
200 if (!rpcCvtTable.
convert(strMethod, idx)) {