addRecipient method Null safety
- dynamic to
Add recipient to the transaction @param {String | Uint8List} to Recipient address (hexadecimal or binary buffer)
Implementation
TransactionBuilder addRecipient(to) {
if (!(to is Uint8List) && !(to is String)) {
throw "'to' must be a string or Uint8List";
}
if (to is String) {
if (isHex(to)) {
to = hexToUint8List(to);
} else {
throw "'to' must be an hexadecimal string";
}
}
data!.recipients!.add(to);
return this;
}