|
|
@ -15,7 +15,8 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServer<AbstractWebThr |
|
|
|
{ |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("accounts", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, NULL), &AbstractWebThreeStubServer::accountsI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("balanceAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::balanceAtI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("block", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_INTEGER,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::blockI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("blockByHash", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::blockByHashI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("blockByNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::blockByNumberI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("call", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::callI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("check", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_BOOLEAN, "id",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::checkI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("codeAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::codeAtI); |
|
|
@ -35,8 +36,10 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServer<AbstractWebThr |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("setMining", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::setMiningI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("stateAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::stateAtI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("transact", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::transactI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("transaction", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_INTEGER,"param2",jsonrpc::JSON_STRING,"param3",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::transactionI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("uncle", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_INTEGER,"param2",jsonrpc::JSON_STRING,"param3",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::uncleI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("transactionByHash", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::transactionByHashI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("transactionByNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_INTEGER,"param2",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::transactionByNumberI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("uncleByHash", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::uncleByHashI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("uncleByNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_INTEGER,"param2",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::uncleByNumberI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("watch", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_INTEGER, "params",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::watchI); |
|
|
|
|
|
|
|
} |
|
|
@ -51,9 +54,14 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServer<AbstractWebThr |
|
|
|
response = this->balanceAt(request[0u].asString()); |
|
|
|
} |
|
|
|
|
|
|
|
inline virtual void blockI(const Json::Value& request, Json::Value& response) |
|
|
|
inline virtual void blockByHashI(const Json::Value& request, Json::Value& response) |
|
|
|
{ |
|
|
|
response = this->block(request[0u].asInt(), request[1u].asString()); |
|
|
|
response = this->blockByHash(request[0u].asString()); |
|
|
|
} |
|
|
|
|
|
|
|
inline virtual void blockByNumberI(const Json::Value& request, Json::Value& response) |
|
|
|
{ |
|
|
|
response = this->blockByNumber(request[0u].asInt()); |
|
|
|
} |
|
|
|
|
|
|
|
inline virtual void callI(const Json::Value& request, Json::Value& response) |
|
|
@ -151,14 +159,24 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServer<AbstractWebThr |
|
|
|
response = this->transact(request[0u]); |
|
|
|
} |
|
|
|
|
|
|
|
inline virtual void transactionI(const Json::Value& request, Json::Value& response) |
|
|
|
inline virtual void transactionByHashI(const Json::Value& request, Json::Value& response) |
|
|
|
{ |
|
|
|
response = this->transactionByHash(request[0u].asString(), request[1u].asInt()); |
|
|
|
} |
|
|
|
|
|
|
|
inline virtual void transactionByNumberI(const Json::Value& request, Json::Value& response) |
|
|
|
{ |
|
|
|
response = this->transactionByNumber(request[0u].asInt(), request[1u].asInt()); |
|
|
|
} |
|
|
|
|
|
|
|
inline virtual void uncleByHashI(const Json::Value& request, Json::Value& response) |
|
|
|
{ |
|
|
|
response = this->transaction(request[0u].asInt(), request[1u].asString(), request[2u].asInt()); |
|
|
|
response = this->uncleByHash(request[0u].asString(), request[1u].asInt()); |
|
|
|
} |
|
|
|
|
|
|
|
inline virtual void uncleI(const Json::Value& request, Json::Value& response) |
|
|
|
inline virtual void uncleByNumberI(const Json::Value& request, Json::Value& response) |
|
|
|
{ |
|
|
|
response = this->uncle(request[0u].asInt(), request[1u].asString(), request[2u].asInt()); |
|
|
|
response = this->uncleByNumber(request[0u].asInt(), request[1u].asInt()); |
|
|
|
} |
|
|
|
|
|
|
|
inline virtual void watchI(const Json::Value& request, Json::Value& response) |
|
|
@ -169,7 +187,8 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServer<AbstractWebThr |
|
|
|
|
|
|
|
virtual Json::Value accounts() = 0; |
|
|
|
virtual std::string balanceAt(const std::string& param1) = 0; |
|
|
|
virtual Json::Value block(const int& param1, const std::string& param2) = 0; |
|
|
|
virtual Json::Value blockByHash(const std::string& param1) = 0; |
|
|
|
virtual Json::Value blockByNumber(const int& param1) = 0; |
|
|
|
virtual std::string call(const Json::Value& param1) = 0; |
|
|
|
virtual bool check(const int& id) = 0; |
|
|
|
virtual std::string codeAt(const std::string& param1) = 0; |
|
|
@ -189,8 +208,10 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServer<AbstractWebThr |
|
|
|
virtual bool setMining(const bool& param1) = 0; |
|
|
|
virtual std::string stateAt(const std::string& param1, const std::string& param2) = 0; |
|
|
|
virtual Json::Value transact(const Json::Value& param1) = 0; |
|
|
|
virtual Json::Value transaction(const int& param1, const std::string& param2, const int& param3) = 0; |
|
|
|
virtual Json::Value uncle(const int& param1, const std::string& param2, const int& param3) = 0; |
|
|
|
virtual Json::Value transactionByHash(const std::string& param1, const int& param2) = 0; |
|
|
|
virtual Json::Value transactionByNumber(const int& param1, const int& param2) = 0; |
|
|
|
virtual Json::Value uncleByHash(const std::string& param1, const int& param2) = 0; |
|
|
|
virtual Json::Value uncleByNumber(const int& param1, const int& param2) = 0; |
|
|
|
virtual int watch(const std::string& params) = 0; |
|
|
|
|
|
|
|
}; |
|
|
|