EventsRecordCodec class

Codec for encoding and decoding Substrate event records

This is the main codec that orchestrates the encoding/decoding of complete event records which include phase information, the event itself, and topics. It delegates to specialized codecs for each component.

Example:

final registry = MetadataTypeRegistry(prefixed);
final eventsRecordCodec = EventsRecordCodec(registry);

// Decode events from a block
final events = eventsRecordCodec.decode(eventBytes);
for (final event in events) {
  print('${event.event.palletName}.${event.event.eventName}: ${event.event.data}');
}
Mixed-in types

Constructors

EventsRecordCodec(MetadataTypeRegistry registry)

Properties

hashCode int
The hash code for this object.
no setterinherited
registry MetadataTypeRegistry
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

decode(Input input) List<EventRecord>
Decode event records from storage (System.Events)
override
encode(List<EventRecord> value) Uint8List
Convert self to an owned vector.
inherited
encodeTo(List<EventRecord> value, Output output) → void
Encode a list of event records
override
getAllEvents() Map<String, List<EventInfo>>
Get all events across all pallets
getEventInfo(String palletName, String eventName) EventInfo?
Get event metadata information
getPalletEvents(String palletName) List<EventInfo>
Get all events for a pallet
isSizeZero() bool
Is Size Zero
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sizeHint(List<EventRecord> value) int
Calculate size hint for a list of event records
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited