buildParams function

Uint8List buildParams(
  1. List<String> types,
  2. List args
)

ABI encode params according to types

Implementation

Uint8List buildParams(List<String> types, List args) {
  if (types.length != args.length) {
    throw Exception('types and args length has to be the same');
  }

  List<int> out = [];

  for (var i = 0; i < types.length; i++) {
    out.addAll(encodeType(types[i], args[i]));
  }

  return Uint8List.fromList(out);
}