originSign method Null safety

TransactionBuilder originSign(
  1. dynamic privateKey
)

Implementation

TransactionBuilder originSign(privateKey) {
  if (!(privateKey is Uint8List) && !(privateKey is String)) {
    throw "'privateKey' must be a string or Uint8List";
  }

  if (privateKey is String) {
    if (isHex(privateKey)) {
      privateKey = hexToUint8List(privateKey);
    } else {
      throw "'privateKey' must be an hexadecimal string";
    }
  }

  originSignature = crypto.sign(originSignaturePayload(), privateKey);
  return this;
}