legacyEip712Encode method

  1. @override
EncoderResult legacyEip712Encode(
  1. AbiParameter params,
  2. List input,
  3. bool keepSize
)
override

Legacy EIP-712 encoding for arrays of arbitrary types. Optionally keeps the size unchanged based on the keepSize parameter.

Implementation

@override
EncoderResult legacyEip712Encode(
    AbiParameter params, List<dynamic> input, bool keepSize) {
  final param = _ABIUtils.toArrayType(params);
  final encodedParams =
      input.map((e) => param.item1.legacyEip712Encode(e, true)).toList();
  final resultBytes = encodedParams.map((e) => e.encoded);
  return EncoderResult(
      isDynamic: false, encoded: [for (final i in resultBytes) ...i]);
}