originSign method
Sign the transaction with an origin private key @param {String | Uint8List} originPv Origin Private Key (hexadecimal or binary buffer)
Implementation
Transaction originSign(dynamic 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);
}
originSignature =
uint8ListToHex(crypto.sign(originSignaturePayload(), privateKey));
return this;
}