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