SoftwareApp.fromEvent constructor

SoftwareApp.fromEvent(
  1. Nip01Event event
)

Implementation

factory SoftwareApp.fromEvent(Nip01Event event) {
  if (event.kind != softwareApplicationKind) {
    throw SoftwareParseException('expected kind $softwareApplicationKind');
  }
  return SoftwareApp(
    ref: SoftwareAppRef(
      publisher: event.pubKey,
      identifier: _requiredTag(event, 'd'),
    ),
    name: _requiredTag(event, 'name'),
    description: event.content,
    summary: _optionalTag(event, 'summary'),
    iconUrl: _optionalTag(event, 'icon'),
    imageUrls: _tags(event, 'image'),
    platforms: _tags(event, 'f'),
    event: event,
  );
}