decodeTransaction function
Future<DecodedTransaction?>
decodeTransaction({
- required Transaction transaction,
- required String contractAbi,
- dynamic method,
Decode transaction and return DecodedTransaction or throws error
Implementation
Future<DecodedTransaction?> decodeTransaction({
required Transaction transaction,
required String contractAbi,
MethodName? method,
}) async {
final res = await createLib().decodeTransaction(
transaction: jsonEncode(transaction),
contractAbi: contractAbi,
method: method == null ? null : jsonEncode(method),
);
final decoded = jsonDecode(res);
if (decoded == null) return null;
return DecodedTransaction.fromJson(decoded);
}