aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoinrpc.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2012-04-09 21:07:25 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2012-05-05 10:37:06 +0200
commit460c51fdad07c89b64b60d680bad7ba89c9d5ee2 (patch)
treed260c85b84dbe759ff035acb68cd023bc0c41ff6 /src/bitcoinrpc.h
parentca97bde8ff53f2604d601061af1f0ff6e2a37487 (diff)
Add UI RPC console / debug window
Diffstat (limited to 'src/bitcoinrpc.h')
-rw-r--r--src/bitcoinrpc.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/bitcoinrpc.h b/src/bitcoinrpc.h
index 6b7293ed19..dd18a504f3 100644
--- a/src/bitcoinrpc.h
+++ b/src/bitcoinrpc.h
@@ -16,6 +16,9 @@
void ThreadRPCServer(void* parg);
int CommandLineRPC(int argc, char *argv[]);
+/** Convert parameter values for RPC call from strings to command-specific JSON objects. */
+json_spirit::Array RPCConvertValues(const std::string &strMethod, const std::vector<std::string> &strParams);
+
typedef json_spirit::Value(*rpcfn_type)(const json_spirit::Array& params, bool fHelp);
class CRPCCommand
@@ -26,6 +29,9 @@ public:
bool okSafeMode;
};
+/**
+ * Bitcoin RPC command dispatcher.
+ */
class CRPCTable
{
private:
@@ -34,6 +40,15 @@ public:
CRPCTable();
const CRPCCommand* operator[](std::string name) const;
std::string help(std::string name) const;
+
+ /**
+ * Execute a method.
+ * @param method Method to execute
+ * @param params Array of arguments (JSON objects)
+ * @returns Result of the call.
+ * @throws an exception (json_spirit::Value) when an error happens.
+ */
+ json_spirit::Value execute(const std::string &method, const json_spirit::Array &params) const;
};
extern const CRPCTable tableRPC;