blob: 319f7394d9ec592be3b0540d118ee1e686dc4310 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#pragma once
#include <memory>
#include <string>
#include "data/data.hpp"
namespace nostr
{
namespace signer
{
/**
* @brief An interface for Nostr event signing that implements NIP-46.
*/
class ISigner
{
public:
virtual ~ISigner() = default;
/**
* @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;
};
class INostrConnectSigner : public ISigner
{
public:
virtual ~INostrConnectSigner() = default;
virtual void receiveConnection(std::string connectionToken) = 0;
virtual void initiateConnection(
std::string relay,
std::string name,
std::string url,
std::string description) = 0;
};
} // namespace signer
} // namespace nostr
|