From 7f0440e7104a241aff4cc3092f4dc6c4be2c1a8b Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Tue, 28 Oct 2014 13:25:31 +0100 Subject: [PATCH] whisper in web3jsonrpc --- webthreestubclient.h | 66 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/webthreestubclient.h b/webthreestubclient.h index c25ea0d97..1d4592e93 100644 --- a/webthreestubclient.h +++ b/webthreestubclient.h @@ -31,6 +31,20 @@ class WebThreeStubClient } + std::string addToGroup(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException) + { + Json::Value p; + p.append(param1); +p.append(param2); + + Json::Value result = this->client->CallMethod("addToGroup",p); + if (result.isString()) + return result.asString(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); + + } + std::string balanceAt(const std::string& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; @@ -212,6 +226,19 @@ p.append(param2); } + bool haveIdentity(const std::string& param1) throw (jsonrpc::JsonRpcException) + { + Json::Value p; + p.append(param1); + + Json::Value result = this->client->CallMethod("haveIdentity",p); + if (result.isBool()) + return result.asBool(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); + + } + bool listening() throw (jsonrpc::JsonRpcException) { Json::Value p; @@ -262,6 +289,32 @@ p.append(param2); } + std::string newGroup(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException) + { + Json::Value p; + p.append(param1); +p.append(param2); + + Json::Value result = this->client->CallMethod("newGroup",p); + if (result.isString()) + return result.asString(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); + + } + + std::string newIdentity() throw (jsonrpc::JsonRpcException) + { + Json::Value p; + p = Json::nullValue; + Json::Value result = this->client->CallMethod("newIdentity",p); + if (result.isString()) + return result.asString(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); + + } + int number() throw (jsonrpc::JsonRpcException) { Json::Value p; @@ -286,6 +339,19 @@ p.append(param2); } + bool post(const Json::Value& param1) throw (jsonrpc::JsonRpcException) + { + Json::Value p; + p.append(param1); + + Json::Value result = this->client->CallMethod("post",p); + if (result.isBool()) + return result.asBool(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); + + } + bool put(const std::string& param1, const std::string& param2, const std::string& param3) throw (jsonrpc::JsonRpcException) { Json::Value p;