NostrCountResponse.deserialized constructor

NostrCountResponse.deserialized(
  1. String data
)

Implementation

factory NostrCountResponse.deserialized(String data) {
  final decodedData = jsonDecode(data);
  assert(decodedData is List);

  final countMap = decodedData[2];
  assert(countMap is Map);

  return NostrCountResponse(
    subscriptionId: decodedData[1] as String,
    count: int.parse(countMap['count'] as String),
  );
}