Fabcoin Core  0.16.2
P2P Digital Currency
PersonalFace.h
Go to the documentation of this file.
1 
5 #ifndef JSONRPC_CPP_STUB_DEV_RPC_PERSONALFACE_H_
6 #define JSONRPC_CPP_STUB_DEV_RPC_PERSONALFACE_H_
7 
8 #include "ModularServer.h"
9 
10 namespace dev {
11  namespace rpc {
12  class PersonalFace : public ServerInterface<PersonalFace>
13  {
14  public:
16  {
17  this->bindAndAddMethod(jsonrpc::Procedure("personal_newAccount", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &dev::rpc::PersonalFace::personal_newAccountI);
18  this->bindAndAddMethod(jsonrpc::Procedure("personal_unlockAccount", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING,"param3",jsonrpc::JSON_INTEGER, NULL), &dev::rpc::PersonalFace::personal_unlockAccountI);
19  this->bindAndAddMethod(jsonrpc::Procedure("personal_signAndSendTransaction", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_OBJECT,"param2",jsonrpc::JSON_STRING, NULL), &dev::rpc::PersonalFace::personal_signAndSendTransactionI);
20  this->bindAndAddMethod(jsonrpc::Procedure("personal_sendTransaction", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_OBJECT,"param2",jsonrpc::JSON_STRING, NULL), &dev::rpc::PersonalFace::personal_sendTransactionI);
21  this->bindAndAddMethod(jsonrpc::Procedure("personal_listAccounts", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, NULL), &dev::rpc::PersonalFace::personal_listAccountsI);
22  }
23 
24  inline virtual void personal_newAccountI(const Json::Value &request, Json::Value &response)
25  {
26  response = this->personal_newAccount(request[0u].asString());
27  }
28  inline virtual void personal_unlockAccountI(const Json::Value &request, Json::Value &response)
29  {
30  response = this->personal_unlockAccount(request[0u].asString(), request[1u].asString(), request[2u].asInt());
31  }
32  inline virtual void personal_signAndSendTransactionI(const Json::Value &request, Json::Value &response)
33  {
34  response = this->personal_signAndSendTransaction(request[0u], request[1u].asString());
35  }
36  inline virtual void personal_sendTransactionI(const Json::Value &request, Json::Value &response)
37  {
38  response = this->personal_sendTransaction(request[0u], request[1u].asString());
39  }
40  inline virtual void personal_listAccountsI(const Json::Value &request, Json::Value &response)
41  {
42  (void)request;
43  response = this->personal_listAccounts();
44  }
45  virtual std::string personal_newAccount(const std::string& param1) = 0;
46  virtual bool personal_unlockAccount(const std::string& param1, const std::string& param2, int param3) = 0;
47  virtual std::string personal_signAndSendTransaction(const Json::Value& param1, const std::string& param2) = 0;
48  virtual std::string personal_sendTransaction(const Json::Value& param1, const std::string& param2) = 0;
49  virtual Json::Value personal_listAccounts() = 0;
50  };
51 
52  }
53 }
54 #endif //JSONRPC_CPP_STUB_DEV_RPC_PERSONALFACE_H_
virtual std::string personal_newAccount(const std::string &param1)=0
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
Definition: Arith256.cpp:15
virtual void personal_newAccountI(const Json::Value &request, Json::Value &response)
Definition: PersonalFace.h:24
virtual void personal_unlockAccountI(const Json::Value &request, Json::Value &response)
Definition: PersonalFace.h:28
void bindAndAddMethod(jsonrpc::Procedure const &_proc, MethodPointer _pointer)
Definition: ModularServer.h:59
Config::Value_type Value
virtual void personal_sendTransactionI(const Json::Value &request, Json::Value &response)
Definition: PersonalFace.h:36
virtual bool personal_unlockAccount(const std::string &param1, const std::string &param2, int param3)=0
virtual std::string personal_sendTransaction(const Json::Value &param1, const std::string &param2)=0
virtual void personal_signAndSendTransactionI(const Json::Value &request, Json::Value &response)
Definition: PersonalFace.h:32
virtual std::string personal_signAndSendTransaction(const Json::Value &param1, const std::string &param2)=0
virtual void personal_listAccountsI(const Json::Value &request, Json::Value &response)
Definition: PersonalFace.h:40
std::string asString(bytes const &_b)
Converts byte array to a string containing the same (binary) data.
Definition: CommonData.h:79
virtual Json::Value personal_listAccounts()=0