addUCOTransfer method
Add a UCO transfer to the transaction @param {String | Uint8List} to Address of the recipient (hexadecimal or binary buffer) @param {double} amount Amount of UCO to transfer
Implementation
Transaction addUCOTransfer(to, double amount) {
if (!(to is Uint8List) && !(to is String)) {
throw "'to' must be a string or Uint8List";
}
if (to is String) {
if (!isHex(to)) {
throw "'to' must be an hexadecimal string";
}
} else {
to = uint8ListToHex(to);
}
final UCOTransfer ucoTransfer = UCOTransfer(to: to, amount: amount);
this.data!.ledger!.uco!.transfers!.add(ucoTransfer);
return this;
}