2014-10-13 09:22:28 +00:00
|
|
|
/**
|
|
|
|
* THIS FILE IS GENERATED BY jsonrpcstub, DO NOT CHANGE IT!!!!!
|
|
|
|
*/
|
|
|
|
|
2014-10-16 17:03:41 +00:00
|
|
|
#ifndef _WEBTHREESTUBCLIENT_H_
|
|
|
|
#define _WEBTHREESTUBCLIENT_H_
|
2014-10-13 09:22:28 +00:00
|
|
|
|
|
|
|
#include <jsonrpc/rpc.h>
|
|
|
|
|
2014-10-16 17:03:41 +00:00
|
|
|
class WebThreeStubClient
|
2014-10-13 09:22:28 +00:00
|
|
|
{
|
|
|
|
public:
|
2014-10-16 17:03:41 +00:00
|
|
|
WebThreeStubClient(jsonrpc::AbstractClientConnector* conn)
|
2014-10-13 09:22:28 +00:00
|
|
|
{
|
|
|
|
this->client = new jsonrpc::Client(conn);
|
|
|
|
}
|
2014-10-16 17:03:41 +00:00
|
|
|
~WebThreeStubClient()
|
2014-10-13 09:22:28 +00:00
|
|
|
{
|
|
|
|
delete this->client;
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
std::string db_get(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException)
|
2014-10-31 10:49:28 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
2014-11-06 13:57:13 +00:00
|
|
|
p.append(param1);
|
|
|
|
p.append(param2);
|
|
|
|
|
|
|
|
Json::Value result = this->client->CallMethod("db_get",p);
|
2014-10-31 10:49:28 +00:00
|
|
|
if (result.isString())
|
|
|
|
return result.asString();
|
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
std::string db_getString(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException)
|
2014-10-20 08:01:14 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
2014-11-06 13:57:13 +00:00
|
|
|
p.append(param1);
|
|
|
|
p.append(param2);
|
|
|
|
|
|
|
|
Json::Value result = this->client->CallMethod("db_getString",p);
|
|
|
|
if (result.isString())
|
|
|
|
return result.asString();
|
2014-10-20 08:01:14 +00:00
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
bool db_put(const std::string& param1, const std::string& param2, const std::string& param3) throw (jsonrpc::JsonRpcException)
|
2014-10-28 12:25:31 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
|
|
|
p.append(param1);
|
|
|
|
p.append(param2);
|
2014-11-06 13:57:13 +00:00
|
|
|
p.append(param3);
|
2014-10-28 12:25:31 +00:00
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("db_put",p);
|
|
|
|
if (result.isBool())
|
|
|
|
return result.asBool();
|
2014-10-28 12:25:31 +00:00
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
bool db_putString(const std::string& param1, const std::string& param2, const std::string& param3) throw (jsonrpc::JsonRpcException)
|
2014-10-13 09:22:28 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
2014-10-22 09:47:45 +00:00
|
|
|
p.append(param1);
|
2014-11-06 13:57:13 +00:00
|
|
|
p.append(param2);
|
|
|
|
p.append(param3);
|
2014-10-13 09:22:28 +00:00
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("db_putString",p);
|
|
|
|
if (result.isBool())
|
|
|
|
return result.asBool();
|
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Json::Value eth_accounts() throw (jsonrpc::JsonRpcException)
|
|
|
|
{
|
|
|
|
Json::Value p;
|
|
|
|
p = Json::nullValue;
|
|
|
|
Json::Value result = this->client->CallMethod("eth_accounts",p);
|
|
|
|
if (result.isArray())
|
|
|
|
return result;
|
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string eth_balanceAt(const std::string& param1) throw (jsonrpc::JsonRpcException)
|
|
|
|
{
|
|
|
|
Json::Value p;
|
|
|
|
p.append(param1);
|
|
|
|
|
|
|
|
Json::Value result = this->client->CallMethod("eth_balanceAt",p);
|
2014-10-13 09:22:28 +00:00
|
|
|
if (result.isString())
|
|
|
|
return result.asString();
|
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value eth_blockByHash(const std::string& param1) throw (jsonrpc::JsonRpcException)
|
2014-10-22 13:47:22 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
|
|
|
p.append(param1);
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_blockByHash",p);
|
2014-10-22 13:47:22 +00:00
|
|
|
if (result.isObject())
|
|
|
|
return result;
|
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value eth_blockByNumber(const int& param1) throw (jsonrpc::JsonRpcException)
|
2014-10-13 09:22:28 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
2014-10-22 09:47:45 +00:00
|
|
|
p.append(param1);
|
2014-10-13 09:22:28 +00:00
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_blockByNumber",p);
|
2014-10-14 11:13:30 +00:00
|
|
|
if (result.isObject())
|
2014-10-13 09:22:28 +00:00
|
|
|
return result;
|
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
std::string eth_call(const Json::Value& param1) throw (jsonrpc::JsonRpcException)
|
2014-10-13 09:22:28 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
2014-10-22 09:47:45 +00:00
|
|
|
p.append(param1);
|
2014-10-13 09:22:28 +00:00
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_call",p);
|
2014-10-13 09:22:28 +00:00
|
|
|
if (result.isString())
|
|
|
|
return result.asString();
|
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
bool eth_changed(const int& param1) throw (jsonrpc::JsonRpcException)
|
2014-10-16 11:06:24 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
2014-10-23 10:04:26 +00:00
|
|
|
p.append(param1);
|
2014-10-16 11:06:24 +00:00
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_changed",p);
|
2014-10-16 11:06:24 +00:00
|
|
|
if (result.isBool())
|
|
|
|
return result.asBool();
|
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
std::string eth_codeAt(const std::string& param1) throw (jsonrpc::JsonRpcException)
|
2014-10-13 09:22:28 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
2014-10-22 09:47:45 +00:00
|
|
|
p.append(param1);
|
2014-10-13 09:22:28 +00:00
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_codeAt",p);
|
2014-10-13 09:22:28 +00:00
|
|
|
if (result.isString())
|
|
|
|
return result.asString();
|
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
std::string eth_coinbase() throw (jsonrpc::JsonRpcException)
|
2014-10-13 09:22:28 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
|
|
|
p = Json::nullValue;
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_coinbase",p);
|
2014-10-13 09:22:28 +00:00
|
|
|
if (result.isString())
|
|
|
|
return result.asString();
|
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
std::string eth_compile(const std::string& param1) throw (jsonrpc::JsonRpcException)
|
2014-10-13 09:22:28 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
2014-10-22 09:47:45 +00:00
|
|
|
p.append(param1);
|
2014-10-13 09:22:28 +00:00
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_compile",p);
|
2014-10-22 09:47:45 +00:00
|
|
|
if (result.isString())
|
|
|
|
return result.asString();
|
2014-10-13 09:22:28 +00:00
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
double eth_countAt(const std::string& param1) throw (jsonrpc::JsonRpcException)
|
2014-10-13 09:22:28 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
2014-10-22 09:47:45 +00:00
|
|
|
p.append(param1);
|
2014-10-13 09:22:28 +00:00
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_countAt",p);
|
2014-10-22 09:47:45 +00:00
|
|
|
if (result.isDouble())
|
|
|
|
return result.asDouble();
|
2014-10-13 09:22:28 +00:00
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
int eth_defaultBlock() throw (jsonrpc::JsonRpcException)
|
2014-10-13 09:22:28 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
2014-10-22 09:47:45 +00:00
|
|
|
p = Json::nullValue;
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_defaultBlock",p);
|
2014-10-22 09:47:45 +00:00
|
|
|
if (result.isInt())
|
|
|
|
return result.asInt();
|
2014-10-13 09:22:28 +00:00
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
std::string eth_gasPrice() throw (jsonrpc::JsonRpcException)
|
2014-10-13 09:22:28 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
|
|
|
p = Json::nullValue;
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_gasPrice",p);
|
2014-10-13 09:22:28 +00:00
|
|
|
if (result.isString())
|
|
|
|
return result.asString();
|
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value eth_getMessages(const int& param1) throw (jsonrpc::JsonRpcException)
|
2014-10-28 10:39:55 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
|
|
|
p.append(param1);
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_getMessages",p);
|
2014-10-23 10:04:26 +00:00
|
|
|
if (result.isArray())
|
|
|
|
return result;
|
2014-10-16 11:06:24 +00:00
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
bool eth_listening() throw (jsonrpc::JsonRpcException)
|
2014-10-14 15:24:51 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
|
|
|
p = Json::nullValue;
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_listening",p);
|
2014-10-14 15:24:51 +00:00
|
|
|
if (result.isBool())
|
|
|
|
return result.asBool();
|
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 14:51:08 +00:00
|
|
|
std::string eth_lll(const std::string& param1) throw (jsonrpc::JsonRpcException)
|
|
|
|
{
|
|
|
|
Json::Value p;
|
|
|
|
p.append(param1);
|
|
|
|
|
|
|
|
Json::Value result = this->client->CallMethod("eth_lll",p);
|
|
|
|
if (result.isString())
|
|
|
|
return result.asString();
|
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
bool eth_mining() throw (jsonrpc::JsonRpcException)
|
2014-10-13 09:22:28 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
2014-10-23 10:04:26 +00:00
|
|
|
p = Json::nullValue;
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_mining",p);
|
2014-10-23 10:04:26 +00:00
|
|
|
if (result.isBool())
|
|
|
|
return result.asBool();
|
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
2014-10-13 09:22:28 +00:00
|
|
|
|
2014-10-23 10:04:26 +00:00
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
int eth_newFilter(const Json::Value& param1) throw (jsonrpc::JsonRpcException)
|
2014-10-23 10:04:26 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
|
|
|
p.append(param1);
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_newFilter",p);
|
2014-10-23 10:04:26 +00:00
|
|
|
if (result.isInt())
|
|
|
|
return result.asInt();
|
2014-10-13 09:22:28 +00:00
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
2014-10-14 15:24:51 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
int eth_newFilterString(const std::string& param1) throw (jsonrpc::JsonRpcException)
|
2014-10-14 15:24:51 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
2014-10-23 10:04:26 +00:00
|
|
|
p.append(param1);
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_newFilterString",p);
|
2014-10-23 10:04:26 +00:00
|
|
|
if (result.isInt())
|
|
|
|
return result.asInt();
|
2014-10-14 15:24:51 +00:00
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
2014-10-13 09:22:28 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
int eth_number() throw (jsonrpc::JsonRpcException)
|
2014-10-28 12:25:31 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
|
|
|
p = Json::nullValue;
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_number",p);
|
|
|
|
if (result.isInt())
|
|
|
|
return result.asInt();
|
2014-10-28 12:25:31 +00:00
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
int eth_peerCount() throw (jsonrpc::JsonRpcException)
|
2014-10-13 09:22:28 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
|
|
|
p = Json::nullValue;
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_peerCount",p);
|
2014-10-13 09:22:28 +00:00
|
|
|
if (result.isInt())
|
|
|
|
return result.asInt();
|
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
2014-10-16 15:21:26 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
bool eth_setCoinbase(const std::string& param1) throw (jsonrpc::JsonRpcException)
|
2014-10-13 09:22:28 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
2014-11-06 13:57:13 +00:00
|
|
|
p.append(param1);
|
|
|
|
|
|
|
|
Json::Value result = this->client->CallMethod("eth_setCoinbase",p);
|
|
|
|
if (result.isBool())
|
|
|
|
return result.asBool();
|
2014-10-13 09:22:28 +00:00
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
bool eth_setDefaultBlock(const int& param1) throw (jsonrpc::JsonRpcException)
|
2014-10-28 12:25:31 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
|
|
|
p.append(param1);
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_setDefaultBlock",p);
|
2014-10-28 12:25:31 +00:00
|
|
|
if (result.isBool())
|
|
|
|
return result.asBool();
|
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
bool eth_setListening(const bool& param1) throw (jsonrpc::JsonRpcException)
|
2014-10-28 10:39:55 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
|
|
|
p.append(param1);
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_setListening",p);
|
2014-10-28 10:39:55 +00:00
|
|
|
if (result.isBool())
|
|
|
|
return result.asBool();
|
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
bool eth_setMining(const bool& param1) throw (jsonrpc::JsonRpcException)
|
2014-10-28 10:39:55 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
|
|
|
p.append(param1);
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_setMining",p);
|
2014-10-28 10:39:55 +00:00
|
|
|
if (result.isBool())
|
|
|
|
return result.asBool();
|
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
std::string eth_stateAt(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException)
|
2014-10-13 09:22:28 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
2014-10-22 09:47:45 +00:00
|
|
|
p.append(param1);
|
2014-11-06 13:57:13 +00:00
|
|
|
p.append(param2);
|
2014-10-14 19:53:11 +00:00
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_stateAt",p);
|
|
|
|
if (result.isString())
|
|
|
|
return result.asString();
|
2014-10-14 19:53:11 +00:00
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
std::string eth_transact(const Json::Value& param1) throw (jsonrpc::JsonRpcException)
|
2014-10-27 16:06:14 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
|
|
|
p.append(param1);
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_transact",p);
|
|
|
|
if (result.isString())
|
|
|
|
return result.asString();
|
2014-10-27 16:06:14 +00:00
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value eth_transactionByHash(const std::string& param1, const int& param2) throw (jsonrpc::JsonRpcException)
|
2014-10-13 09:22:28 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
2014-10-22 09:47:45 +00:00
|
|
|
p.append(param1);
|
2014-11-06 13:57:13 +00:00
|
|
|
p.append(param2);
|
2014-10-13 09:22:28 +00:00
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_transactionByHash",p);
|
|
|
|
if (result.isObject())
|
|
|
|
return result;
|
2014-10-13 09:22:28 +00:00
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value eth_transactionByNumber(const int& param1, const int& param2) throw (jsonrpc::JsonRpcException)
|
2014-10-13 09:22:28 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
2014-10-22 09:47:45 +00:00
|
|
|
p.append(param1);
|
2014-11-06 13:57:13 +00:00
|
|
|
p.append(param2);
|
2014-10-13 09:22:28 +00:00
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_transactionByNumber",p);
|
|
|
|
if (result.isObject())
|
|
|
|
return result;
|
2014-10-13 09:22:28 +00:00
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value eth_uncleByHash(const std::string& param1, const int& param2) throw (jsonrpc::JsonRpcException)
|
2014-10-29 10:42:15 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
|
|
|
p.append(param1);
|
2014-11-06 13:57:13 +00:00
|
|
|
p.append(param2);
|
2014-10-29 10:42:15 +00:00
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_uncleByHash",p);
|
|
|
|
if (result.isObject())
|
2014-10-29 10:42:15 +00:00
|
|
|
return result;
|
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value eth_uncleByNumber(const int& param1, const int& param2) throw (jsonrpc::JsonRpcException)
|
2014-10-29 10:42:15 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
|
|
|
p.append(param1);
|
2014-11-06 13:57:13 +00:00
|
|
|
p.append(param2);
|
2014-10-29 10:42:15 +00:00
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_uncleByNumber",p);
|
|
|
|
if (result.isObject())
|
|
|
|
return result;
|
2014-10-29 10:42:15 +00:00
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
bool eth_uninstallFilter(const int& param1) throw (jsonrpc::JsonRpcException)
|
2014-10-29 10:42:15 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
|
|
|
p.append(param1);
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("eth_uninstallFilter",p);
|
2014-10-29 10:42:15 +00:00
|
|
|
if (result.isBool())
|
|
|
|
return result.asBool();
|
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
std::string shh_addToGroup(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException)
|
2014-10-13 09:22:28 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
2014-10-22 09:47:45 +00:00
|
|
|
p.append(param1);
|
|
|
|
p.append(param2);
|
2014-10-13 09:22:28 +00:00
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("shh_addToGroup",p);
|
2014-10-13 09:22:28 +00:00
|
|
|
if (result.isString())
|
|
|
|
return result.asString();
|
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value shh_changed(const int& param1) throw (jsonrpc::JsonRpcException)
|
2014-10-13 09:22:28 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
2014-10-22 09:47:45 +00:00
|
|
|
p.append(param1);
|
2014-10-13 09:22:28 +00:00
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("shh_changed",p);
|
|
|
|
if (result.isArray())
|
|
|
|
return result;
|
2014-10-13 09:22:28 +00:00
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
bool shh_haveIdentity(const std::string& param1) throw (jsonrpc::JsonRpcException)
|
2014-10-22 13:47:22 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
|
|
|
p.append(param1);
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("shh_haveIdentity",p);
|
|
|
|
if (result.isBool())
|
|
|
|
return result.asBool();
|
2014-10-22 13:47:22 +00:00
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
int shh_newFilter(const Json::Value& param1) throw (jsonrpc::JsonRpcException)
|
2014-10-22 13:47:22 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
|
|
|
p.append(param1);
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("shh_newFilter",p);
|
|
|
|
if (result.isInt())
|
|
|
|
return result.asInt();
|
2014-10-22 13:47:22 +00:00
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
std::string shh_newGroup(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException)
|
2014-10-13 09:22:28 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
2014-10-22 09:47:45 +00:00
|
|
|
p.append(param1);
|
|
|
|
p.append(param2);
|
2014-10-13 09:22:28 +00:00
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("shh_newGroup",p);
|
|
|
|
if (result.isString())
|
|
|
|
return result.asString();
|
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string shh_newIdentity() throw (jsonrpc::JsonRpcException)
|
|
|
|
{
|
|
|
|
Json::Value p;
|
|
|
|
p = Json::nullValue;
|
|
|
|
Json::Value result = this->client->CallMethod("shh_newIdentity",p);
|
|
|
|
if (result.isString())
|
|
|
|
return result.asString();
|
2014-10-13 09:22:28 +00:00
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
bool shh_post(const Json::Value& param1) throw (jsonrpc::JsonRpcException)
|
2014-10-13 09:22:28 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
2014-10-22 09:47:45 +00:00
|
|
|
p.append(param1);
|
2014-10-13 09:22:28 +00:00
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("shh_post",p);
|
|
|
|
if (result.isBool())
|
|
|
|
return result.asBool();
|
2014-10-13 09:22:28 +00:00
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
bool shh_uninstallFilter(const int& param1) throw (jsonrpc::JsonRpcException)
|
2014-10-13 09:22:28 +00:00
|
|
|
{
|
|
|
|
Json::Value p;
|
2014-10-23 10:04:26 +00:00
|
|
|
p.append(param1);
|
2014-10-13 09:22:28 +00:00
|
|
|
|
2014-11-06 13:57:13 +00:00
|
|
|
Json::Value result = this->client->CallMethod("shh_uninstallFilter",p);
|
2014-10-23 10:04:26 +00:00
|
|
|
if (result.isBool())
|
|
|
|
return result.asBool();
|
2014-10-13 09:22:28 +00:00
|
|
|
else
|
|
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
jsonrpc::Client* client;
|
|
|
|
};
|
2014-10-16 17:03:41 +00:00
|
|
|
#endif //_WEBTHREESTUBCLIENT_H_
|