| 219 | } |
| 220 | |
| 221 | UniValue RPCConvertValues(const std::string &strMethod, const std::vector<std::string> &strParams) |
| 222 | { |
| 223 | UniValue params(UniValue::VARR); |
| 224 | |
| 225 | for (unsigned int idx = 0; idx < strParams.size(); idx++) { |
| 226 | const std::string& strVal = strParams[idx]; |
| 227 | |
| 228 | // insert string value directly |
| 229 | if (!rpcCvtTable.convert(strMethod, idx)) { |
| 230 | params.push_back(strVal); |
| 231 | } else if (strMethod.substr(0, 10) == "getaddress") { |
| 232 | UniValue p; |
| 233 | try { |
| 234 | p = ParseNonRFCJSONValue(strVal); |
| 235 | } catch (...) { |
| 236 | // allow getaddressbalance "LYmrT81UoxqfskSNt28ZKZ3XXskSFENEtg" for convenience |
| 237 | p = strVal; |
| 238 | } |
| 239 | params.push_back(p); |
| 240 | } else { |
| 241 | // parse string as JSON, insert bool/number/object/etc. value |
| 242 | params.push_back(ParseNonRFCJSONValue(strVal)); |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | return params; |
| 247 | } |
| 248 | |
| 249 | UniValue RPCConvertNamedValues(const std::string &strMethod, const std::vector<std::string> &strParams) |
| 250 | { |