Events.fromJson constructor

Events.fromJson(
  1. Map<String, dynamic> value,
  2. ChainInfo chainInfo
)

Implementation

factory Events.fromJson(Map<String, dynamic> value, ChainInfo chainInfo) {
  final List<dynamic> events = chainInfo.scaleCodec.decode('EventCodec',
      ByteInput.fromBytes(hex.decode(value['changes'][0][1].substring(2))));

  return Events._(
    eventRecord: ToJson(events)
        .toJson()
        .map(
            (event) => EventRecord.fromJson(Map<String, dynamic>.from(event)))
        .toList(),
  );
}