diff options
Diffstat (limited to 'include/signer')
-rw-r--r-- | include/signer/signer.hpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/include/signer/signer.hpp b/include/signer/signer.hpp new file mode 100644 index 0000000..e68df93 --- /dev/null +++ b/include/signer/signer.hpp @@ -0,0 +1,31 @@ +#pragma once + +#include "data/data.hpp" + +namespace nostr +{ +namespace signer +{ +/** + * @brief An interface for Nostr event signing that implements NIP-46. + */ +class ISigner +{ +public: + virtual void receiveConnection(std::string connectionToken) = 0; + + virtual void initiateConnection( + std::string relay, + std::string name, + std::string url, + std::string description) = 0; + + /** + * @brief Signs the given Nostr event. + * @param event The event to sign. + * @remark The event's `sig` field will be updated in-place with the signature. + */ + virtual void sign(std::shared_ptr<nostr::data::Event> event) = 0; +}; +} // namespace signer +} // namespace nostr |