serializedUnsigned property

Uint8List get serializedUnsigned

Implementation

Uint8List get serializedUnsigned {
  final _nonce = nonce.bigIntToBytes.toHex;
  final _gasPrice = gasPrice.bigIntToBytes.toHex;
  final _gasLimit = gasLimit.bigIntToBytes.toHex;
  final _to = to.replaceFirst("0x", "");
  final _value = value.bigIntToBytes.toHex;
  final _data = data.toHex;
  final _accessList = accessList.map((item) {
    return [
      item.address.replaceFirst("0x", ""),
      item.storageKeys,
    ];
  }).toList();

  List<dynamic> buffer = [
    chainId.toBI.bigIntToBytes.toHex,
    _nonce,
    _gasPrice,
    _gasLimit,
    _to,
    _value,
    _data,
    _accessList,
  ];

  return Uint8List.fromList(
    [0x01, ...rlpEncode(buffer).hexToBytes],
  );
}