FarmClient.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /**
  2. * This file is generated by jsonrpcstub, DO NOT CHANGE IT MANUALLY!
  3. */
  4. #ifndef JSONRPC_CPP_STUB_FARMCLIENT_H_
  5. #define JSONRPC_CPP_STUB_FARMCLIENT_H_
  6. #include <jsonrpccpp/client.h>
  7. class FarmClient : public jsonrpc::Client
  8. {
  9. public:
  10. FarmClient(jsonrpc::IClientConnector &conn, jsonrpc::clientVersion_t type = jsonrpc::JSONRPC_CLIENT_V2) : jsonrpc::Client(conn, type) {}
  11. Json::Value eth_getWork()
  12. {
  13. Json::Value p;
  14. p = Json::nullValue;
  15. Json::Value result = this->CallMethod("eth_getWork",p);
  16. if (result.isArray())
  17. return result;
  18. else
  19. throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
  20. }
  21. bool eth_submitWork(const std::string& param1, const std::string& param2, const std::string& param3)
  22. {
  23. Json::Value p;
  24. p.append(param1);
  25. p.append(param2);
  26. p.append(param3);
  27. Json::Value result = this->CallMethod("eth_submitWork",p);
  28. if (result.isBool())
  29. return result.asBool();
  30. else
  31. throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
  32. }
  33. bool eth_submitHashrate(const std::string& param1, const std::string& param2)
  34. {
  35. Json::Value p;
  36. p.append(param1);
  37. p.append(param2);
  38. Json::Value result = this->CallMethod("eth_submitHashrate",p);
  39. if (result.isBool())
  40. return result.asBool();
  41. else
  42. throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
  43. }
  44. Json::Value eth_awaitNewWork()
  45. {
  46. Json::Value p;
  47. p = Json::nullValue;
  48. Json::Value result = this->CallMethod("eth_awaitNewWork",p);
  49. if (result.isArray())
  50. return result;
  51. else
  52. throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
  53. }
  54. bool eth_progress()
  55. {
  56. Json::Value p;
  57. p = Json::nullValue;
  58. Json::Value result = this->CallMethod("eth_progress",p);
  59. if (result.isBool())
  60. return result.asBool();
  61. else
  62. throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
  63. }
  64. };
  65. #endif //JSONRPC_CPP_STUB_FARMCLIENT_H_