Personal.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include "PersonalFace.h"
  3. namespace dev
  4. {
  5. namespace eth
  6. {
  7. class KeyManager;
  8. class AccountHolder;
  9. class Interface;
  10. }
  11. namespace rpc
  12. {
  13. class Personal: public dev::rpc::PersonalFace
  14. {
  15. public:
  16. Personal(dev::eth::KeyManager& _keyManager, dev::eth::AccountHolder& _accountHolder, eth::Interface& _eth);
  17. virtual RPCModules implementedModules() const override
  18. {
  19. return RPCModules{RPCModule{"personal", "1.0"}};
  20. }
  21. virtual std::string personal_newAccount(std::string const& _password) override;
  22. virtual bool personal_unlockAccount(std::string const& _address, std::string const& _password, int _duration) override;
  23. virtual std::string personal_signAndSendTransaction(Json::Value const& _transaction, std::string const& _password) override;
  24. virtual std::string personal_sendTransaction(Json::Value const& _transaction, std::string const& _password) override;
  25. virtual Json::Value personal_listAccounts() override;
  26. private:
  27. dev::eth::KeyManager& m_keyManager;
  28. dev::eth::AccountHolder& m_accountHolder;
  29. dev::eth::Interface& m_eth;
  30. };
  31. }
  32. }