serialized property
override
Used for Signing the transaction
Implementation
@override
Uint8List get serialized {
if (hasSignature == false) {
throw Exception("Transaction is not signed, cannot serialize");
}
return Uint8List.fromList(
[
0x02,
...encodeRLP(
RLPList(
[
RLPInt(chainId),
RLPBigInt(nonce),
RLPBigInt(maxPriorityFeePerGas),
RLPBigInt(maxFeePerGas),
RLPBigInt(gasLimit),
RLPString(to),
RLPBigInt(value),
RLPBytes(data),
RLPList(
accessList.map((item) {
return RLPList(
[
RLPString(item.address),
RLPList(
item.storageKeys
.map((key) => RLPString(key, isHex: true))
.toList(),
),
],
);
}).toList(),
),
RLPInt(signatureYParity),
RLPBytes(signatureR),
RLPBytes(signatureS),
],
),
),
],
);
}