SentNostrEvent.fromPartialData constructor
SentNostrEvent.fromPartialData({})
Implementation
factory SentNostrEvent.fromPartialData({
required int kind,
required String content,
required NostrKeyPairs keyPairs,
List<List<String>>? tags,
DateTime? createdAt,
String? ots,
}) {
final pubkey = keyPairs.public;
final tagsToUse = tags ?? [];
final createdAtToUse = createdAt ?? DateTime.now();
final id = NostrEvent.getEventId(
kind: kind,
content: content,
createdAt: createdAtToUse,
tags: tagsToUse,
pubkey: pubkey,
);
final sig = keyPairs.sign(id);
return SentNostrEvent(
id: id,
kind: kind,
content: content,
sig: sig,
pubkey: pubkey,
createdAt: createdAtToUse,
tags: tagsToUse,
ots: ots,
);
}