decodeEvent function
Decode input data and return DecodedEvent or throws error
Implementation
Future<DecodedEvent?> decodeEvent({
required String messageBody,
required String contractAbi,
MethodName? event,
}) async {
final res = await createLib().decodeEvent(
messageBody: messageBody,
contractAbi: contractAbi,
event: event == null ? null : jsonEncode(event),
);
final decoded = jsonDecode(res);
if (decoded == null) return null;
return DecodedEvent.fromJson(decoded);
}