import java.io.File;
import java.io.IOException;
+import java.util.Base64;
public class UpdateProfileCommand implements JsonRpcLocalCommand {
subparser.addArgument("--family-name").help("New profile family name (optional)");
subparser.addArgument("--about").help("New profile about text");
subparser.addArgument("--about-emoji").help("New profile about emoji");
+ subparser.addArgument("--mobile-coin-address").help("New MobileCoin address (Base64 encoded public address)");
final var avatarOptions = subparser.addMutuallyExclusiveGroup();
avatarOptions.addArgument("--avatar").help("Path to new profile avatar");
var familyName = ns.getString("family-name");
var about = ns.getString("about");
var aboutEmoji = ns.getString("about-emoji");
+ var mobileCoinAddressString = ns.getString("mobile-coin-address");
+ var mobileCoinAddress = mobileCoinAddressString == null
+ ? null
+ : Base64.getDecoder().decode(mobileCoinAddressString);
+
var avatarPath = ns.getString("avatar");
boolean removeAvatar = Boolean.TRUE.equals(ns.getBoolean("remove-avatar"));
-
File avatarFile = removeAvatar || avatarPath == null ? null : new File(avatarPath);
try {
.withFamilyName(familyName)
.withAbout(about)
.withAboutEmoji(aboutEmoji)
+ .withMobileCoinAddress(mobileCoinAddress)
.withAvatar(avatarFile)
.withDeleteAvatar(removeAvatar)
.build());