decodeInput function

Future<DecodedInput?> decodeInput({
  1. required String messageBody,
  2. required String contractAbi,
  3. dynamic method,
  4. required bool internal,
})

Decode input data and return DecodedInput or throws error

Implementation

Future<DecodedInput?> decodeInput({
  required String messageBody,
  required String contractAbi,
  MethodName? method,
  required bool internal,
}) async {
  final res = await createLib().decodeInput(
    messageBody: messageBody,
    contractAbi: contractAbi,
    method: method == null ? null : jsonEncode(method),
    internal: internal,
  );
  final decoded = jsonDecode(res);
  if (decoded == null) return null;
  return DecodedInput.fromJson(decoded);
}