solidity/webthreestubclient.h

588 lines
19 KiB
C
Raw Normal View History

2014-10-13 09:22:28 +00:00
/**
* THIS FILE IS GENERATED BY jsonrpcstub, DO NOT CHANGE IT!!!!!
*/
#ifndef _WEBTHREESTUBCLIENT_H_
#define _WEBTHREESTUBCLIENT_H_
2014-10-13 09:22:28 +00:00
#include <jsonrpc/rpc.h>
class WebThreeStubClient
2014-10-13 09:22:28 +00:00
{
public:
WebThreeStubClient(jsonrpc::AbstractClientConnector* conn)
2014-10-13 09:22:28 +00:00
{
this->client = new jsonrpc::Client(conn);
}
~WebThreeStubClient()
2014-10-13 09:22:28 +00:00
{
delete this->client;
}
std::string account() throw (jsonrpc::JsonRpcException)
{
Json::Value p;
p = Json::nullValue;
Json::Value result = this->client->CallMethod("account",p);
if (result.isString())
return result.asString();
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
Json::Value accounts() throw (jsonrpc::JsonRpcException)
{
Json::Value p;
p = Json::nullValue;
Json::Value result = this->client->CallMethod("accounts",p);
if (result.isArray())
return result;
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
2014-10-28 12:25:31 +00:00
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());
}
2014-10-22 09:47:45 +00:00
std::string balanceAt(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
Json::Value result = this->client->CallMethod("balanceAt",p);
if (result.isString())
return result.asString();
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
Json::Value blockByHash(const std::string& param1) throw (jsonrpc::JsonRpcException)
{
Json::Value p;
p.append(param1);
Json::Value result = this->client->CallMethod("blockByHash",p);
if (result.isObject())
return result;
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
Json::Value 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
Json::Value result = this->client->CallMethod("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-10-22 09:47:45 +00:00
std::string 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
Json::Value result = this->client->CallMethod("call",p);
if (result.isString())
return result.asString();
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
2014-10-23 10:04:26 +00:00
bool 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-10-23 10:04:26 +00:00
Json::Value result = this->client->CallMethod("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-10-22 09:47:45 +00:00
std::string 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
Json::Value result = this->client->CallMethod("codeAt",p);
if (result.isString())
return result.asString();
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
std::string coinbase() throw (jsonrpc::JsonRpcException)
{
Json::Value p;
p = Json::nullValue;
Json::Value result = this->client->CallMethod("coinbase",p);
if (result.isString())
return result.asString();
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
2014-10-22 09:47:45 +00:00
std::string 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-10-22 09:47:45 +00:00
Json::Value result = this->client->CallMethod("compile",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-10-22 09:47:45 +00:00
double 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-10-22 09:47:45 +00:00
Json::Value result = this->client->CallMethod("countAt",p);
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-10-22 09:47:45 +00:00
int 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;
Json::Value result = this->client->CallMethod("defaultBlock",p);
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());
}
std::string gasPrice() throw (jsonrpc::JsonRpcException)
{
Json::Value p;
p = Json::nullValue;
Json::Value result = this->client->CallMethod("gasPrice",p);
if (result.isString())
return result.asString();
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
2014-10-28 10:39:55 +00:00
std::string get(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("get",p);
if (result.isString())
return result.asString();
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
2014-10-23 10:04:26 +00:00
Json::Value getMessages(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-10-23 10:04:26 +00:00
Json::Value result = this->client->CallMethod("getMessages",p);
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-10-28 10:39:55 +00:00
std::string getString(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("getString",p);
if (result.isString())
return result.asString();
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
2014-10-28 12:25:31 +00:00
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());
}
2014-10-14 15:24:51 +00:00
bool listening() throw (jsonrpc::JsonRpcException)
{
Json::Value p;
p = Json::nullValue;
Json::Value result = this->client->CallMethod("listening",p);
if (result.isBool())
return result.asBool();
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
2014-10-23 10:04:26 +00:00
bool 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;
Json::Value result = this->client->CallMethod("mining",p);
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
}
int newFilter(const Json::Value& param1) throw (jsonrpc::JsonRpcException)
{
Json::Value p;
p.append(param1);
Json::Value result = this->client->CallMethod("newFilter",p);
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-10-23 10:04:26 +00:00
int 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);
Json::Value result = this->client->CallMethod("newFilterString",p);
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-10-28 12:25:31 +00:00
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());
}
2014-10-13 09:22:28 +00:00
int number() throw (jsonrpc::JsonRpcException)
{
Json::Value p;
p = Json::nullValue;
Json::Value result = this->client->CallMethod("number",p);
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-10-13 09:22:28 +00:00
int peerCount() throw (jsonrpc::JsonRpcException)
{
Json::Value p;
p = Json::nullValue;
Json::Value result = this->client->CallMethod("peerCount",p);
if (result.isInt())
return result.asInt();
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
2014-10-28 12:25:31 +00:00
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());
}
2014-10-28 10:39:55 +00:00
bool put(const std::string& param1, const std::string& param2, const std::string& param3) throw (jsonrpc::JsonRpcException)
{
Json::Value p;
p.append(param1);
p.append(param2);
p.append(param3);
Json::Value result = this->client->CallMethod("put",p);
if (result.isBool())
return result.asBool();
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
bool putString(const std::string& param1, const std::string& param2, const std::string& param3) throw (jsonrpc::JsonRpcException)
{
Json::Value p;
p.append(param1);
p.append(param2);
p.append(param3);
Json::Value result = this->client->CallMethod("putString",p);
if (result.isBool())
return result.asBool();
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
2014-10-22 09:47:45 +00:00
bool setCoinbase(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-14 19:53:11 +00:00
Json::Value result = this->client->CallMethod("setCoinbase",p);
if (result.isBool())
return result.asBool();
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
2014-10-27 16:06:14 +00:00
bool setDefaultBlock(const int& param1) throw (jsonrpc::JsonRpcException)
{
Json::Value p;
p.append(param1);
Json::Value result = this->client->CallMethod("setDefaultBlock",p);
if (result.isBool())
return result.asBool();
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
2014-10-22 09:47:45 +00:00
bool setListening(const bool& 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
Json::Value result = this->client->CallMethod("setListening",p);
2014-10-14 19:53:11 +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());
}
2014-10-22 09:47:45 +00:00
bool setMining(const bool& 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
Json::Value result = this->client->CallMethod("setMining",p);
2014-10-14 19:53:11 +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());
}
2014-10-29 10:42:15 +00:00
Json::Value shhChanged(const int& param1) throw (jsonrpc::JsonRpcException)
{
Json::Value p;
p.append(param1);
Json::Value result = this->client->CallMethod("shhChanged",p);
if (result.isArray())
return result;
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
int shhNewFilter(const Json::Value& param1) throw (jsonrpc::JsonRpcException)
{
Json::Value p;
p.append(param1);
Json::Value result = this->client->CallMethod("shhNewFilter",p);
if (result.isInt())
return result.asInt();
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
bool shhUninstallFilter(const int& param1) throw (jsonrpc::JsonRpcException)
{
Json::Value p;
p.append(param1);
Json::Value result = this->client->CallMethod("shhUninstallFilter",p);
if (result.isBool())
return result.asBool();
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
2014-10-22 09:47:45 +00:00
std::string 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);
p.append(param2);
2014-10-13 09:22:28 +00:00
Json::Value result = this->client->CallMethod("stateAt",p);
if (result.isString())
return result.asString();
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
2014-10-27 09:31:49 +00:00
std::string transact(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
Json::Value result = this->client->CallMethod("transact",p);
2014-10-27 09:31:49 +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());
}
Json::Value transactionByHash(const std::string& param1, const int& param2) throw (jsonrpc::JsonRpcException)
{
Json::Value p;
p.append(param1);
p.append(param2);
Json::Value result = this->client->CallMethod("transactionByHash",p);
if (result.isObject())
return result;
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
Json::Value transactionByNumber(const int& param1, const int& param2) throw (jsonrpc::JsonRpcException)
{
Json::Value p;
p.append(param1);
p.append(param2);
Json::Value result = this->client->CallMethod("transactionByNumber",p);
if (result.isObject())
return result;
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
Json::Value uncleByHash(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);
p.append(param2);
2014-10-13 09:22:28 +00:00
Json::Value result = this->client->CallMethod("uncleByHash",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());
}
Json::Value uncleByNumber(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);
p.append(param2);
2014-10-13 09:22:28 +00:00
Json::Value result = this->client->CallMethod("uncleByNumber",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-10-23 10:04:26 +00:00
bool 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-10-23 10:04:26 +00:00
Json::Value result = this->client->CallMethod("uninstallFilter",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());
}
private:
jsonrpc::Client* client;
};
#endif //_WEBTHREESTUBCLIENT_H_