decode<T> static method

List<T> decode<T>(
  1. List<String> types,
  2. Uint8List value
)

Decodes a list of types and values.

  • types: A list of string types.
  • value: A Uint8List containing the ABI-encoded data.

Returns a list of decoded values.

Implementation

static List<T> decode<T>(List<String> types, Uint8List value) {
  List<AbiType> abiTypes = [];
  for (String type in types) {
    var abiType = parseAbiType(type);
    abiTypes.add(abiType);
  }
  final parsedData = TupleType(abiTypes).decode(value.buffer, 0);
  return parsedData.data as List<T>;
}