decodeOutput function

Future<DecodedOutput?> decodeOutput({
  1. required String messageBody,
  2. required String contractAbi,
  3. dynamic method,
})

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);
}