encodeToBytes method
Encode this operation into raw bytes
Implementation
Uint8List encodeToBytes() {
Uint8List signer = AccountNumberCoder().encodeToBytes(this.accountSigner);
Uint8List target = AccountNumberCoder().encodeToBytes(this.targetSigner);
Uint8List opType = OpTypeCoder(2).encodeToBytes(this.opType());
Uint8List nOperation = Int32.encodeToBytes(this.nOperation!);
Uint8List fee = CurrencyCoder().encodeToBytes(this.fee!);
Uint8List payloadLength = PDUtil.encodeLength(this.payload!.length);
Uint8List? payload = this.payload;
Uint8List r = PDUtil.encodeBigInt(signature!.r);
Uint8List rLength = PDUtil.encodeLength(r.length);
Uint8List s = PDUtil.encodeBigInt(signature!.s);
Uint8List sLength = PDUtil.encodeLength(s.length);
return PDUtil.concat([
signer,
target,
opType,
nOperation,
fee,
payloadLength,
payload,
rLength,
r,
sLength,
s
]);
}