Nip01Event.fromJson constructor

Nip01Event.fromJson(
  1. Map<String, dynamic> data
)

Implementation

factory Nip01Event.fromJson(Map<String, dynamic> data) {
  final id = data['id'] as String;
  final pubKey = data['pubkey'] as String;
  final createdAt = data['created_at'] as int;
  final kind = data['kind'] as int;
  final tags = data['tags'];
  final content = data['content'] as String;
  final sig = data['sig'] as String;

  return Nip01Event._(id, pubKey, createdAt, kind, tags, content, sig);
}