originSign method
Sign the transaction with an origin private key @param {String | Uint8List} originPv Origin Private Key (hexadecimal or binary buffer)
Implementation
Transaction originSign(privateKey) {
if (!(privateKey is Uint8List) && !(privateKey is String)) {
throw "'privateKey' must be a string or Uint8List";
}
if (privateKey is String) {
if (!isHex(privateKey)) {
throw "'privateKey' must be an hexadecimal string";
}
} else {
privateKey = uint8ListToHex(privateKey);
}
this.originSignature =
uint8ListToHex(crypto.sign(this.originSignaturePayload(), privateKey));
return this;
}