Convert strings to command-specific RPC representation */
| 136 | |
| 137 | /** Convert strings to command-specific RPC representation */ |
| 138 | UniValue RPCConvertValues(const std::string &strMethod, const std::vector<std::string> &strParams) |
| 139 | { |
| 140 | UniValue params(UniValue::VARR); |
| 141 | |
| 142 | for (unsigned int idx = 0; idx < strParams.size(); idx++) { |
| 143 | const std::string& strVal = strParams[idx]; |
| 144 | |
| 145 | if (!rpcCvtTable.convert(strMethod, idx)) { |
| 146 | // insert string value directly |
| 147 | params.push_back(strVal); |
| 148 | } else { |
| 149 | // parse string as JSON, insert bool/number/object/etc. value |
| 150 | params.push_back(ParseNonRFCJSONValue(strVal)); |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | return params; |
| 155 | } |
| 156 |