private void btnCheckSingleNameExists_Click(object sender, EventArgs e) { BitcoinLib.Responses.GetShowNameResponse r = xayaCoinService.ShowName(txtCheckSingleNameExists.Text); if (r == null) { chkCheckSingleNameExists.Checked = false; chkCheckSingleNameExists.Text = "Does not exist"; chkNameIsMine.Checked = false; chkNameIsMine.Text = "This name is available to buy."; } else { chkCheckSingleNameExists.Checked = true; chkCheckSingleNameExists.Text = "Exists"; if (r.ismine) { chkNameIsMine.Checked = true; chkNameIsMine.Text = "This name belongs to me in the " + tscbWallets.Text + " wallet."; } else { chkNameIsMine.Checked = false; chkNameIsMine.Text = "This name is not in the " + tscbWallets.Text + " wallet."; } } }
private void btnCreateNamesFromList_Click(object sender, EventArgs e) { StringBuilder sb = new StringBuilder(); foreach (string line in txtNameListToCreate.Lines) { BitcoinLib.Responses.GetShowNameResponse r = xayaCoinService.ShowName(line); if (r == null) { if (line.Length < 3) { // All names must have a namespace and should be at least 1 character in length, // so the minimum number of characters is 3. continue; } // Create the name because it doesn't exist. string result = xayaCoinService.RegisterName(line, "{}", new object()); if (result == "Failed.") { sb.AppendLine("\"" + line + "\" failed to register. " + result); } else { if (result != string.Empty && result != null) { sb.AppendLine("\"" + line + "\" registered successfully. " + result); } else { sb.AppendLine("\"" + line + "\" Failed for one reason or another, e.g. too many transactions, wallet is locked, couldn't submit more, etc. " + result); } } } else { // The name exists, so output that it is already taken. sb.AppendLine("\"" + r.name + "\" already exists."); } } txtNameListResults.Text = sb.ToString(); }