Class: NostrAdapter ​
Defined in: packages/method/src/core/beacon/aggregation/communication/adapter/nostr.ts:52
Implements ​
Constructors ​
Constructor ​
new NostrAdapter(
config):NostrAdapter
Defined in: packages/method/src/core/beacon/aggregation/communication/adapter/nostr.ts:83
Constructs a new NostrAdapter instance with the given configuration.
Parameters ​
config ​
NostrAdapterConfig = ...
The configuration for the NostrAdapter. If no configuration is provided, a new key pair is generated and default relays are used.
Returns ​
NostrAdapter
Properties ​
config ​
config:
NostrAdapterConfig
Defined in: packages/method/src/core/beacon/aggregation/communication/adapter/nostr.ts:63
The configuration for the NostrAdapter.
name ​
name:
string='nostr'
Defined in: packages/method/src/core/beacon/aggregation/communication/adapter/nostr.ts:57
The name of the NostrAdapter service.
Implementation of ​
pool? ​
optionalpool:SimplePool
Defined in: packages/method/src/core/beacon/aggregation/communication/adapter/nostr.ts:75
The SimplePool instance for managing Nostr subscriptions.
Methods ​
generateIdentity() ​
generateIdentity(
keys?):ServiceAdapterConfig
Defined in: packages/method/src/core/beacon/aggregation/communication/adapter/nostr.ts:274
Generates a Nostr identity using the Secp256k1SecretKey and Identifier classes.
Parameters ​
keys? ​
Optional keys to use for identity generation.
Returns ​
The generated Nostr identity configuration.
Implementation of ​
CommunicationService.generateIdentity
registerMessageHandler() ​
registerMessageHandler(
messageType,handler):void
Defined in: packages/method/src/core/beacon/aggregation/communication/adapter/nostr.ts:173
Registers a message handler for a specific message type.
Parameters ​
messageType ​
string
The type of message to handle.
handler ​
The handler function that processes the message.
Returns ​
void
Implementation of ​
CommunicationService.registerMessageHandler
sendMessage() ​
sendMessage(
message,from,to?):Promise<void|Promise<string>[]>
Defined in: packages/method/src/core/beacon/aggregation/communication/adapter/nostr.ts:186
Sends a message to a recipient using the Nostr protocol. This method is a placeholder and should be implemented with actual Nostr message sending logic.
Parameters ​
message ​
any
The message to send, typically containing the content and metadata.
from ​
string
The identifier of the sender.
to? ​
string
The identifier of the recipient.
Returns ​
Promise<void | Promise<string>[]>
A promise that resolves when the message is sent.
Implementation of ​
CommunicationService.sendMessage
setKeys() ​
setKeys(
keys):void
Defined in: packages/method/src/core/beacon/aggregation/communication/adapter/nostr.ts:98
Sets the keys for the NostrAdapter.
Parameters ​
keys ​
The key pair to set.
Returns ​
void
Implementation of ​
start() ​
start():
NostrAdapter
Defined in: packages/method/src/core/beacon/aggregation/communication/adapter/nostr.ts:107
Starts the Nostr communication service by subscribing to relays.
Returns ​
NostrAdapter
Returns the NostrAdapter instance for method chaining.