serialized property

Uint8List get serialized
override

Used for Signing the transaction

Implementation

Uint8List get serialized {
  if (hasSignature == false) {
    throw Exception("Transaction is not signed, cannot serialize");
  }

  final _nonce = nonce.bigIntToBytes.toHex;
  final _gasPrice = gasPrice.bigIntToBytes.toHex;
  final _gasLimit = gasLimit.bigIntToBytes.toHex;
  final _to = to.replaceAll("0x", "");
  final _value = value.bigIntToBytes.toHex;
  final _data = data.toHex;
  final _v = v.toBI.bigIntToBytes.toHex;
  final _r = r.bigIntToBytes.toHex;
  final _s = s.bigIntToBytes.toHex;

  List<String> buffer = [
    _nonce,
    _gasPrice,
    _gasLimit,
    _to,
    _value,
    _data,
    _v,
    _r,
    _s,
  ];

  return rlpEncode(buffer).hexToBytes;
}