diff options
author | buttercat1791 <mjjurkoic@gmail.com> | 2024-05-14 09:43:25 -0500 |
---|---|---|
committer | buttercat1791 <mjjurkoic@gmail.com> | 2024-05-14 09:43:25 -0500 |
commit | 5ed5b4a3baec273a9552bbb466d727267eeb8f06 (patch) | |
tree | db6a234d55ec5c32b712212c99219d50c18badb5 /include/signer | |
parent | 4e558f0c63b0f57196d00c8d1c69139633bfce92 (diff) |
Add noscrypt and reorganize namespaces
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 |