aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/client.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-11-22 14:56:29 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2017-01-10 12:04:54 +0100
commit481f289765fab47ff2e0bd7dfb968f2bd92fd608 (patch)
treed7ad238c4842bc4fa6c9a05ae8aef395029d1835 /src/rpc/client.h
parent9adb4e1a59d54788e204895aaff5d6cbefd1b97a (diff)
rpc: Named argument support for bitcoin-cli
Usage e.g.: $ src/bitcoin-cli -testnet -named echo arg0="dfdf" [ "dfdf" ] Argument conversion also works, for arguments thus flagged in the table in `src/rpc/client.cpp`. $ src/bitcoin-cli -testnet -named echojson arg0="[1,2,3]" [ [ 1, 2, 3 ] ] Unknown parameter (detected server-side): $ src/bitcoin-cli -testnet -named getinfo arg0="dfdf" error code: -8 error message: Unknown named parameter arg0
Diffstat (limited to 'src/rpc/client.h')
-rw-r--r--src/rpc/client.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rpc/client.h b/src/rpc/client.h
index cb7c12b129..e7cf035d8f 100644
--- a/src/rpc/client.h
+++ b/src/rpc/client.h
@@ -8,7 +8,12 @@
#include <univalue.h>
+/** Convert positional arguments to command-specific RPC representation */
UniValue RPCConvertValues(const std::string& strMethod, const std::vector<std::string>& strParams);
+
+/** Convert named arguments to command-specific RPC representation */
+UniValue RPCConvertNamedValues(const std::string& strMethod, const std::vector<std::string>& strParams);
+
/** Non-RFC4627 JSON parser, accepts internal values (such as numbers, true, false, null)
* as well as objects and arrays.
*/