setSecret method

Transaction setSecret(
  1. dynamic secret
)

Add a secret to the transaction @param {String | Uint8List} secret Secret encrypted (hexadecimal or binary buffer)

Implementation

Transaction setSecret(secret) {
  if (!(secret is Uint8List) && !(secret is String)) {
    throw "'secret' must be a string or Uint8List";
  }

  if (secret is Uint8List) {
    secret = uint8ListToHex(secret);
  }

  this.data!.keys!.secret = secret;
  return this;
}