createRumor method

Future<Nip01Event> createRumor({
  1. String? customPubkey,
  2. required String content,
  3. required int kind,
  4. required List<List<String>> tags,
})

Creates a rumor (unsigned event)

Implementation

Future<Nip01Event> createRumor({
  String? customPubkey,
  required String content,
  required int kind,
  required List<List<String>> tags,
}) async {
  final myPubkey = accounts.getPublicKey();

  final usedPubkey = customPubkey ?? myPubkey;

  if (usedPubkey == null) {
    throw Exception("cannot create crumor: no pubkey provided");
  }

  final Nip01Event rumor = Nip01Event(
    pubKey: usedPubkey,
    kind: kind,
    tags: tags,
    content: content,
  );

  return rumor;
}