You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
587 lines
19 KiB
587 lines
19 KiB
/**
|
|
* THIS FILE IS GENERATED BY jsonrpcstub, DO NOT CHANGE IT!!!!!
|
|
*/
|
|
|
|
#ifndef _WEBTHREESTUBCLIENT_H_
|
|
#define _WEBTHREESTUBCLIENT_H_
|
|
|
|
#include <jsonrpc/rpc.h>
|
|
|
|
class WebThreeStubClient
|
|
{
|
|
public:
|
|
WebThreeStubClient(jsonrpc::AbstractClientConnector* conn)
|
|
{
|
|
this->client = new jsonrpc::Client(conn);
|
|
}
|
|
~WebThreeStubClient()
|
|
{
|
|
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());
|
|
|
|
}
|
|
|
|
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;
|
|
p.append(param1);
|
|
|
|
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)
|
|
{
|
|
Json::Value p;
|
|
p.append(param1);
|
|
|
|
Json::Value result = this->client->CallMethod("blockByNumber",p);
|
|
if (result.isObject())
|
|
return result;
|
|
else
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
}
|
|
|
|
std::string call(const Json::Value& param1) throw (jsonrpc::JsonRpcException)
|
|
{
|
|
Json::Value p;
|
|
p.append(param1);
|
|
|
|
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());
|
|
|
|
}
|
|
|
|
bool changed(const int& param1) throw (jsonrpc::JsonRpcException)
|
|
{
|
|
Json::Value p;
|
|
p.append(param1);
|
|
|
|
Json::Value result = this->client->CallMethod("changed",p);
|
|
if (result.isBool())
|
|
return result.asBool();
|
|
else
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
}
|
|
|
|
std::string codeAt(const std::string& param1) throw (jsonrpc::JsonRpcException)
|
|
{
|
|
Json::Value p;
|
|
p.append(param1);
|
|
|
|
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());
|
|
|
|
}
|
|
|
|
std::string compile(const std::string& param1) throw (jsonrpc::JsonRpcException)
|
|
{
|
|
Json::Value p;
|
|
p.append(param1);
|
|
|
|
Json::Value result = this->client->CallMethod("compile",p);
|
|
if (result.isString())
|
|
return result.asString();
|
|
else
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
}
|
|
|
|
double countAt(const std::string& param1) throw (jsonrpc::JsonRpcException)
|
|
{
|
|
Json::Value p;
|
|
p.append(param1);
|
|
|
|
Json::Value result = this->client->CallMethod("countAt",p);
|
|
if (result.isDouble())
|
|
return result.asDouble();
|
|
else
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
}
|
|
|
|
int defaultBlock() throw (jsonrpc::JsonRpcException)
|
|
{
|
|
Json::Value p;
|
|
p = Json::nullValue;
|
|
Json::Value result = this->client->CallMethod("defaultBlock",p);
|
|
if (result.isInt())
|
|
return result.asInt();
|
|
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());
|
|
|
|
}
|
|
|
|
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());
|
|
|
|
}
|
|
|
|
Json::Value getMessages(const int& param1) throw (jsonrpc::JsonRpcException)
|
|
{
|
|
Json::Value p;
|
|
p.append(param1);
|
|
|
|
Json::Value result = this->client->CallMethod("getMessages",p);
|
|
if (result.isArray())
|
|
return result;
|
|
else
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
}
|
|
|
|
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());
|
|
|
|
}
|
|
|
|
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;
|
|
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());
|
|
|
|
}
|
|
|
|
bool mining() throw (jsonrpc::JsonRpcException)
|
|
{
|
|
Json::Value p;
|
|
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());
|
|
|
|
}
|
|
|
|
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();
|
|
else
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
}
|
|
|
|
int newFilterString(const std::string& param1) throw (jsonrpc::JsonRpcException)
|
|
{
|
|
Json::Value p;
|
|
p.append(param1);
|
|
|
|
Json::Value result = this->client->CallMethod("newFilterString",p);
|
|
if (result.isInt())
|
|
return result.asInt();
|
|
else
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
}
|
|
|
|
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;
|
|
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());
|
|
|
|
}
|
|
|
|
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());
|
|
|
|
}
|
|
|
|
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;
|
|
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());
|
|
|
|
}
|
|
|
|
bool setCoinbase(const std::string& param1) throw (jsonrpc::JsonRpcException)
|
|
{
|
|
Json::Value p;
|
|
p.append(param1);
|
|
|
|
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());
|
|
|
|
}
|
|
|
|
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());
|
|
|
|
}
|
|
|
|
bool setListening(const bool& param1) throw (jsonrpc::JsonRpcException)
|
|
{
|
|
Json::Value p;
|
|
p.append(param1);
|
|
|
|
Json::Value result = this->client->CallMethod("setListening",p);
|
|
if (result.isBool())
|
|
return result.asBool();
|
|
else
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
}
|
|
|
|
bool setMining(const bool& param1) throw (jsonrpc::JsonRpcException)
|
|
{
|
|
Json::Value p;
|
|
p.append(param1);
|
|
|
|
Json::Value result = this->client->CallMethod("setMining",p);
|
|
if (result.isBool())
|
|
return result.asBool();
|
|
else
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
}
|
|
|
|
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());
|
|
|
|
}
|
|
|
|
std::string stateAt(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("stateAt",p);
|
|
if (result.isString())
|
|
return result.asString();
|
|
else
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
}
|
|
|
|
std::string transact(const Json::Value& param1) throw (jsonrpc::JsonRpcException)
|
|
{
|
|
Json::Value p;
|
|
p.append(param1);
|
|
|
|
Json::Value result = this->client->CallMethod("transact",p);
|
|
if (result.isString())
|
|
return result.asString();
|
|
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)
|
|
{
|
|
Json::Value p;
|
|
p.append(param1);
|
|
p.append(param2);
|
|
|
|
Json::Value result = this->client->CallMethod("uncleByHash",p);
|
|
if (result.isObject())
|
|
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)
|
|
{
|
|
Json::Value p;
|
|
p.append(param1);
|
|
p.append(param2);
|
|
|
|
Json::Value result = this->client->CallMethod("uncleByNumber",p);
|
|
if (result.isObject())
|
|
return result;
|
|
else
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
}
|
|
|
|
bool uninstallFilter(const int& param1) throw (jsonrpc::JsonRpcException)
|
|
{
|
|
Json::Value p;
|
|
p.append(param1);
|
|
|
|
Json::Value result = this->client->CallMethod("uninstallFilter",p);
|
|
if (result.isBool())
|
|
return result.asBool();
|
|
else
|
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
|
|
}
|
|
|
|
private:
|
|
jsonrpc::Client* client;
|
|
};
|
|
#endif //_WEBTHREESTUBCLIENT_H_
|
|
|