24 Commits
v2.4 ... v2.7

Author SHA1 Message Date
d4620af384 batch: Removed old file writing for ledger 2023-06-14 17:08:10 +10:00
15cb4efaf1 package: Increased version 2023-06-14 17:04:14 +10:00
18607358bf TX: Fixed watchonly errors 2023-06-14 17:04:00 +10:00
6db6d02e9e TXs: Fixed decimal errors 2023-06-14 16:57:07 +10:00
3eda3d7419 hsd-ledger added sendraw to usage 2023-06-14 16:30:49 +10:00
3f6c2bdded hsd-ledger: Removed using files to store batch info 2023-06-14 16:30:05 +10:00
2bfca908a9 batch: Changed sendRaw in hsd-ledger 2023-06-14 16:29:22 +10:00
531d41a413 main: Fixed showing TXs for Ledger 2023-06-14 16:29:00 +10:00
960af0b169 main: fixed settings location 2023-06-14 15:49:56 +10:00
14a685690c package: Increased version 2023-06-14 15:29:22 +10:00
816e16a9aa main: On load bring to front 2023-06-14 15:28:59 +10:00
036819169d tx: Get TX on load to lower memory use 2023-06-14 15:20:08 +10:00
1675ac48f3 main: Only get the number of TXs needed
This should speed up the loading on larger wallets
2023-06-14 15:19:16 +10:00
f44aac35f0 domain: Removed OPEN button from reserved domains 2023-06-14 14:09:20 +10:00
bf2e41058d main: Fixed click on text in domains and tx history doesn't open window 2023-06-14 14:07:03 +10:00
2109879f93 Merge remote-tracking branch 'origin/master' 2023-06-13 23:58:32 +10:00
112b719d78 main: Fixed npm installed checks and fixed HSD install 2023-06-13 23:58:24 +10:00
2395c4ca29 main: Fixed npm installed checks 2023-06-13 23:57:10 +10:00
752d20f369 main: Updated version 2023-06-13 23:26:16 +10:00
dc53d7eb0f assets: removed tmp logo 2023-06-13 23:26:06 +10:00
3783cfe759 main: Added error checks in case HSD doesn't start 2023-06-13 23:04:16 +10:00
71395f253b main: Added agent to internal HSD node 2023-06-13 22:51:48 +10:00
b34c6507b8 domains: Fixed opening domain error 2023-06-13 22:51:23 +10:00
b93c981fcd main: Added better errors for git, node or npm not installed 2023-06-13 11:30:54 +10:00
9 changed files with 309 additions and 152 deletions

View File

@@ -538,14 +538,8 @@ namespace FireWallet
notifyForm.Dispose();
return;
}
StreamWriter sw = new StreamWriter(dir + "hsd-ledger/bin/names.txt");
string domainslist = string.Join(",", batches.Select(batch => batch.domain));
sw.Write(domainslist);
sw.Dispose();
StreamWriter sw2 = new StreamWriter(dir + "hsd-ledger/bin/batch.json");
sw2.Write(response);
sw2.Dispose();
string domainslist = string.Join(",", batches.Select(batch => "\\\"" + batch.domain + "\\\""));
NotifyForm notify = new NotifyForm("Please confirm the transaction on your Ledger device", false);
notify.Show();
@@ -558,7 +552,9 @@ namespace FireWallet
proc.StartInfo.RedirectStandardError = true;
proc.StartInfo.FileName = "node.exe";
proc.StartInfo.WorkingDirectory = dir + "hsd-ledger/bin/";
proc.StartInfo.Arguments = dir + "hsd-ledger/bin/hsd-ledger sendraw batch.json names.txt --api-key " + mainForm.nodeSettings["Key"] + " -w " + mainForm.account;
string args = "hsd-ledger/bin/hsd-ledger sendraw \"\"" + response.Replace("\"","\\\"") + "\"\" [" + domainslist + "] --api-key " + mainForm.nodeSettings["Key"] + " -w " + mainForm.account;
proc.StartInfo.Arguments = dir + args;
var outputBuilder = new StringBuilder();
// Event handler for capturing output data
@@ -590,6 +586,8 @@ namespace FireWallet
}
else
{
AddLog(args);
AddLog(proc.StandardError.ReadToEnd());
NotifyForm notifyError = new NotifyForm("Error Transaction Failed\nCheck logs for more details");
notifyError.ShowDialog();
notifyError.Dispose();

View File

@@ -32,36 +32,7 @@ namespace FireWallet
this.explorerTX = explorerTX;
this.explorerName = explorerName;
this.mainForm = mainForm;
}
#region Theming
private void UpdateTheme()
{
// Check if file exists
if (!Directory.Exists(dir))
{
CreateConfig(dir);
}
if (!File.Exists(dir + "theme.txt"))
{
CreateConfig(dir);
}
// Read file
StreamReader sr = new StreamReader(dir + "theme.txt");
theme = new Dictionary<string, string>();
while (!sr.EndOfStream)
{
string line = sr.ReadLine();
string[] split = line.Split(':');
theme.Add(split[0].Trim(), split[1].Trim());
}
sr.Dispose();
if (!theme.ContainsKey("background") || !theme.ContainsKey("background-alt") || !theme.ContainsKey("foreground") || !theme.ContainsKey("foreground-alt"))
{
return;
}
this.theme = mainForm.theme;
// Apply theme
this.BackColor = ColorTranslator.FromHtml(theme["background"]);
@@ -73,35 +44,12 @@ namespace FireWallet
// Need to specify this for each groupbox to override the black text
foreach (Control c in Controls)
{
ThemeControl(c);
mainForm.ThemeControl(c);
}
// Transparancy
applyTransparency(theme);
applyTransparency(mainForm.theme);
}
private void ThemeControl(Control c)
{
if (c.GetType() == typeof(GroupBox) || c.GetType() == typeof(Panel))
{
c.ForeColor = ColorTranslator.FromHtml(theme["foreground"]);
foreach (Control sub in c.Controls)
{
ThemeControl(sub);
}
}
if (c.GetType() == typeof(TextBox) || c.GetType() == typeof(Button)
|| c.GetType() == typeof(ComboBox) || c.GetType() == typeof(StatusStrip))
{
c.ForeColor = ColorTranslator.FromHtml(theme["foreground-alt"]);
c.BackColor = ColorTranslator.FromHtml(theme["background-alt"]);
}
}
#region Theme
private void applyTransparency(Dictionary<string, string> theme)
{
if (theme.ContainsKey("transparent-mode"))
@@ -148,26 +96,6 @@ namespace FireWallet
}
}
}
private void CreateConfig(string dir)
{
if (!Directory.Exists(dir))
{
Directory.CreateDirectory(dir);
}
StreamWriter sw = new StreamWriter(dir + "theme.txt");
sw.WriteLine("background: #000000");
sw.WriteLine("foreground: #8e05c2");
sw.WriteLine("background-alt: #3e065f");
sw.WriteLine("foreground-alt: #ffffff");
sw.WriteLine("transparent-mode: off");
sw.WriteLine("transparency-key: main");
sw.WriteLine("transparency-percent: 90");
sw.Dispose();
}
// Required for mica effect
internal enum AccentState
{
@@ -209,7 +137,6 @@ namespace FireWallet
private void DomainForm_Load(object sender, EventArgs e)
{
UpdateTheme();
own = false;
StreamReader sr = new StreamReader(dir + "node.txt");
nodeSettings = new Dictionary<string, string>();
@@ -330,6 +257,14 @@ namespace FireWallet
{
labelStatusMain.Text = "Error";
}
if (labelStatusReserved.Text == "True")
{
buttonActionAlt.Hide();
buttonActionMain.Hide();
groupBoxAction.Text = "Reserved";
}
}
catch (Exception ex)
{
@@ -804,9 +739,6 @@ namespace FireWallet
}
else if (state == "AVAILABLE")
{
decimal bid = Convert.ToDecimal(textBoxBid.Text);
decimal blind = Convert.ToDecimal(textBoxBlind.Text);
decimal lockup = bid + blind;
string content = "{\"method\": \"sendopen\", \"params\": [\"" + domain + "\"]}";
string response = await APIPost("", true, content);

View File

@@ -12,7 +12,7 @@
<PackageIcon>HSDBatcher.png</PackageIcon>
<RepositoryUrl>https://github.com/Nathanwoodburn/FireWallet</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Version>2.4</Version>
<Version>2.7</Version>
</PropertyGroup>
<ItemGroup>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

View File

@@ -59,7 +59,6 @@ namespace FireWallet
buttonNavSend = new Button();
buttonNavPortfolio = new Button();
panelPortfolio = new Panel();
buttonRenewAll = new Button();
buttonRevealAll = new Button();
groupBoxTransactions = new GroupBox();
groupBoxinfo = new GroupBox();
@@ -70,6 +69,7 @@ namespace FireWallet
labelBalanceTotal = new Label();
labelLocked = new Label();
labelBalance = new Label();
buttonRenewAll = new Button();
panelSend = new Panel();
checkBoxSendSubFee = new CheckBox();
buttonSendMax = new Button();
@@ -400,18 +400,6 @@ namespace FireWallet
panelPortfolio.TabIndex = 7;
panelPortfolio.Visible = false;
//
// buttonRenewAll
//
buttonRenewAll.FlatStyle = FlatStyle.Flat;
buttonRenewAll.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point);
buttonRenewAll.Location = new Point(813, 9);
buttonRenewAll.Name = "buttonRenewAll";
buttonRenewAll.Size = new Size(89, 32);
buttonRenewAll.TabIndex = 10;
buttonRenewAll.Text = "Renew All";
buttonRenewAll.UseVisualStyleBackColor = true;
buttonRenewAll.Click += buttonRenewAll_Click;
//
// buttonRevealAll
//
buttonRevealAll.FlatStyle = FlatStyle.Flat;
@@ -518,6 +506,18 @@ namespace FireWallet
labelBalance.TabIndex = 0;
labelBalance.Text = "labelBalance";
//
// buttonRenewAll
//
buttonRenewAll.FlatStyle = FlatStyle.Flat;
buttonRenewAll.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point);
buttonRenewAll.Location = new Point(813, 9);
buttonRenewAll.Name = "buttonRenewAll";
buttonRenewAll.Size = new Size(89, 32);
buttonRenewAll.TabIndex = 10;
buttonRenewAll.Text = "Renew All";
buttonRenewAll.UseVisualStyleBackColor = true;
buttonRenewAll.Click += buttonRenewAll_Click;
//
// panelSend
//
panelSend.Controls.Add(checkBoxSendSubFee);
@@ -792,7 +792,7 @@ namespace FireWallet
panelSettings.Controls.Add(buttonSettingsSave);
panelSettings.Controls.Add(groupBoxSettingsExplorer);
panelSettings.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point);
panelSettings.Location = new Point(1065, 211);
panelSettings.Location = new Point(1065, 51);
panelSettings.Name = "panelSettings";
panelSettings.Size = new Size(930, 550);
panelSettings.TabIndex = 19;
@@ -1007,6 +1007,7 @@ namespace FireWallet
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(1152, 575);
Controls.Add(panelSettings);
Controls.Add(panelaccount);
Controls.Add(panelPortfolio);
Controls.Add(panelRecieve);
@@ -1014,7 +1015,6 @@ namespace FireWallet
Controls.Add(panelSend);
Controls.Add(panelNav);
Controls.Add(statusStripmain);
Controls.Add(panelSettings);
Icon = (Icon)resources.GetObject("$this.Icon");
Name = "MainForm";
Opacity = 0D;

View File

@@ -50,6 +50,9 @@ namespace FireWallet
UpdateTheme();
if (await LoadNode() != true) this.Close();
if (this.Disposing || this.IsDisposed) return;
if (userSettings.ContainsKey("hide-splash"))
{
if (userSettings["hide-splash"] == "false")
@@ -89,6 +92,11 @@ namespace FireWallet
AddLog("Loaded");
Opacity = 1;
batchMode = false;
// Pull form to front
this.WindowState = FormWindowState.Minimized;
this.Show();
this.WindowState = FormWindowState.Normal;
textBoxaccountpassword.Focus();
}
private void MainForm_Closing(object sender, FormClosingEventArgs e)
@@ -189,6 +197,13 @@ namespace FireWallet
Notifyinstall.CloseNotification();
Notifyinstall.Dispose();
}
if (!Directory.Exists(dir + "hsd\\node_modules"))
{
AddLog("HSD install failed");
this.Close();
return false;
}
hsdProcess = new Process();
bool hideScreen = true;
@@ -203,12 +218,20 @@ namespace FireWallet
{
hsdProcess.StartInfo.CreateNoWindow = hideScreen;
if (hideScreen)
{
hsdProcess.StartInfo.RedirectStandardError = true;
}
else
{
hsdProcess.StartInfo.RedirectStandardError = false;
}
hsdProcess.StartInfo.RedirectStandardInput = true;
hsdProcess.StartInfo.RedirectStandardOutput = false;
hsdProcess.StartInfo.UseShellExecute = false;
hsdProcess.StartInfo.RedirectStandardError = false;
hsdProcess.StartInfo.FileName = "node.exe";
hsdProcess.StartInfo.Arguments = dir + "hsd/bin/hsd --index-tx --index-address --api-key " + nodeSettings["Key"];
hsdProcess.StartInfo.Arguments = dir + "hsd/bin/hsd --agent=FireWallet --index-tx --index-address --api-key " + nodeSettings["Key"];
string bobPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Bob\\hsd_data";
if (Directory.Exists(bobPath))
@@ -218,6 +241,24 @@ namespace FireWallet
hsdProcess.Start();
// Wait for HSD to start
await Task.Delay(2000);
// Check if HSD is running
if (hsdProcess.HasExited)
{
AddLog("HSD Failed to start");
AddLog(hsdProcess.StandardError.ReadToEnd());
NotifyForm Notifyinstall = new NotifyForm("HSD Failed to start\nPlease check the logs");
Notifyinstall.ShowDialog();
Notifyinstall.Dispose();
// Wait for the notification to show
await Task.Delay(1000);
this.Close();
await Task.Delay(1000);
return false;
}
}
catch (Exception ex)
{
@@ -225,9 +266,7 @@ namespace FireWallet
AddLog(ex.Message);
this.Close();
await Task.Delay(1000);
AddLog("Close Failed");
}
}
}
timerNodeStatus.Start();
@@ -268,6 +307,7 @@ namespace FireWallet
#region Logging
public void AddLog(string message)
{
if (message.Contains("Get Error: No connection could be made because the target machine actively refused it")) return;
StreamWriter sw = new StreamWriter(dir + "log.txt", true);
sw.WriteLine(DateTime.Now.ToString() + ": " + message);
sw.Dispose();
@@ -562,11 +602,15 @@ namespace FireWallet
watchOnly = true;
toolStripStatusLabelLedger.Text = "Cold Wallet";
toolStripStatusLabelLedger.Visible = true;
buttonRevealAll.Visible = false;
}
else
{
watchOnly = false;
toolStripStatusLabelLedger.Visible = false;
buttonRevealAll.Visible = true;
}
@@ -708,10 +752,9 @@ namespace FireWallet
/// <returns></returns>
public async Task<string> APIPost(string path, bool wallet, string content)
{
if (content == "{\"passphrase\": \"\" ,\"timeout\": 60}")
if (content == "{\"passphrase\": \"\",\"timeout\": 60}")
{
// For some reason, the API doesn't like an empty password, so we'll just use a default one
content = "{\"passphrase\": \"password\" ,\"timeout\": 60}";
return "";
}
string key = nodeSettings["Key"];
string ip = nodeSettings["IP"];
@@ -737,6 +780,8 @@ namespace FireWallet
catch (Exception ex)
{
AddLog("Post Error: " + ex.Message);
AddLog(await resp.Content.ReadAsStringAsync());
AddLog("Content: " + content);
return "Error";
}
@@ -805,6 +850,7 @@ namespace FireWallet
decimal progress = Convert.ToDecimal(chain["progress"].ToString());
labelSyncPercent.Text = "Sync: " + decimal.Round(progress * 100, 2) + "%";
// Exit if set to 0 TXs
if (userSettings.ContainsKey("portfolio-tx"))
{
@@ -824,28 +870,67 @@ namespace FireWallet
labelPendingCount.Text = "Unconfirmed TX: " + pendingTxs.Count.ToString();
// Get TX's
APIresponse = await APIGet("wallet/" + account + "/tx/history", true);
// Check how many TX there are
APIresponse = await APIGet("wallet/" + account, true);
JObject wallet = JObject.Parse(APIresponse);
if (!wallet.ContainsKey("balance"))
{
AddLog("GetInfo Error");
AddLog(APIresponse);
return;
}
JObject balance = JObject.Parse(wallet["balance"].ToString());
int TotalTX = Convert.ToInt32(balance["tx"].ToString());
int toGet = 10;
if (userSettings.ContainsKey("portfolio-tx")) toGet = Convert.ToInt32(userSettings["portfolio-tx"]);
if (toGet > TotalTX) toGet = TotalTX;
int toSkip = TotalTX - toGet;
// GET TXs
if (watchOnly)
{
APIresponse = await APIPost("", true, "{\"method\": \"listtransactions\",\"params\": [\"default\"," + toGet + "," + toSkip + ", true]}");
} else
{
APIresponse = await APIPost("", true, "{\"method\": \"listtransactions\",\"params\": [\"default\"," + toGet + "," + toSkip + "]}");
}
if (APIresponse == "Error")
{
AddLog("GetInfo Error");
return;
}
JArray txs = JArray.Parse(APIresponse);
int txCount = txs.Count;
if (txCount > groupBoxTransactions.Height / 55) txCount = (int)Math.Floor(groupBoxTransactions.Height / 55.0);
if (userSettings.ContainsKey("portfolio-tx")) txCount = Convert.ToInt32(userSettings["portfolio-tx"]);
if (txCount > txs.Count) txCount = txs.Count;
Control[] tmpControls = new Control[txCount];
for (int i = 0; i < txCount; i++)
JObject TXGET = JObject.Parse(APIresponse);
// Check for error
if (TXGET["error"].ToString() != "")
{
AddLog("GetInfo Error");
AddLog(APIresponse);
return;
}
JArray txs = JArray.Parse(TXGET["result"].ToString());
if (toGet > txs.Count)
{
toGet = txs.Count;
}
Control[] tmpControls = new Control[toGet];
for (int i = 0; i < toGet; i++)
{
// Get last tx
JObject tx = JObject.Parse(txs[txs.Count - 1 - i].ToString());
JObject tx = JObject.Parse(await APIGet("wallet/" + account + "/tx/" + txs[toGet - i - 1]["txid"].ToString(), true));
string hash = tx["hash"].ToString();
string date = tx["mdate"].ToString();
date = DateTime.Parse(date).ToShortDateString();
Panel tmpPanel = new Panel();
tmpPanel.Width = groupBoxTransactions.Width - SystemInformation.VerticalScrollBarWidth - 20;
tmpPanel.Height = 50;
@@ -880,27 +965,52 @@ namespace FireWallet
AutoSize = true,
Location = new Point(10, 25)
};
tmpPanel.Controls.Add(labelHash);
// Count inputs and outputs
JArray inputs = JArray.Parse(tx["inputs"].ToString());
JArray outputs = JArray.Parse(tx["outputs"].ToString());
int inputCount = inputs.Count;
int outputCount = outputs.Count;
decimal costHNS = decimal.Parse(txs[toGet - i - 1]["amount"].ToString());
string cost = "";
if (costHNS < 0)
{
cost = "Spent: " + (costHNS * -1).ToString() + " HNS";
}
else if (costHNS > 0)
{
cost = "Received: " + costHNS.ToString() + " HNS";
}
Label labelInputOutput = new Label()
{
Text = "Inputs: " + inputCount + " Outputs: " + outputCount,
Text = "Inputs: " + inputCount + " Outputs: " + outputCount + "\n" + cost,
AutoSize = true,
Location = new Point(300, 20)
Location = new Point(300, 5)
};
tmpPanel.Controls.Add(labelInputOutput);
tmpPanel.Click += (sender, e) =>
{
TXForm txForm = new TXForm(this, tx);
TXForm txForm = new TXForm(this, hash);
txForm.Show();
};
foreach (Control c in tmpPanel.Controls)
{
c.Click += (sender, e) =>
{
TXForm txForm = new TXForm(this, hash);
txForm.Show();
};
}
tmpControls[i] = tmpPanel;
@@ -1077,6 +1187,7 @@ namespace FireWallet
}
panelSettings.Show();
panelSettings.Dock = DockStyle.Fill;
buttonSettingsSave.Top = panelSettings.Height - buttonSettingsSave.Height - 10;
labelSettingsSaved.Top = buttonSettingsSave.Top + 10;
textBoxExTX.Text = userSettings["explorer-tx"];
@@ -1315,9 +1426,87 @@ namespace FireWallet
}
}
// Check if git is installed
Process testInstalled = new Process();
testInstalled.StartInfo.FileName = "git";
testInstalled.StartInfo.Arguments = "-v";
testInstalled.StartInfo.RedirectStandardOutput = true;
testInstalled.StartInfo.UseShellExecute = false;
testInstalled.StartInfo.CreateNoWindow = true;
testInstalled.Start();
string outputInstalled = testInstalled.StandardOutput.ReadToEnd();
testInstalled.WaitForExit();
if (!outputInstalled.Contains("git version"))
{
AddLog("Git is not installed");
NotifyForm notifyForm = new NotifyForm("Git is not installed\nPlease install it to install HSD dependencies");
notifyForm.ShowDialog();
notifyForm.Dispose();
this.Close();
Thread.Sleep(1000);
return;
}
// Check if node installed
testInstalled = new Process();
testInstalled.StartInfo.FileName = "node";
testInstalled.StartInfo.Arguments = "-v";
testInstalled.StartInfo.RedirectStandardOutput = true;
testInstalled.StartInfo.UseShellExecute = false;
testInstalled.StartInfo.CreateNoWindow = true;
testInstalled.Start();
outputInstalled = testInstalled.StandardOutput.ReadToEnd();
testInstalled.WaitForExit();
if (!outputInstalled.Contains("v"))
{
AddLog("Node is not installed");
NotifyForm notifyForm = new NotifyForm("Node is not installed\nPlease install it to install HSD dependencies");
notifyForm.ShowDialog();
notifyForm.Dispose();
this.Close();
Thread.Sleep(1000);
return;
}
// Check if npm installed
testInstalled = new Process();
testInstalled.StartInfo.FileName = "cmd.exe";
testInstalled.StartInfo.Arguments = "npm -v";
testInstalled.StartInfo.RedirectStandardOutput = true;
testInstalled.StartInfo.UseShellExecute = false;
testInstalled.StartInfo.CreateNoWindow = false;
testInstalled.Start();
// Wait 3 seconds and then kill
Thread.Sleep(3000);
testInstalled.Kill();
outputInstalled = testInstalled.StandardOutput.ReadToEnd();
testInstalled.WaitForExit();
if (Regex.IsMatch(outputInstalled, @"^\d+\.\d+\.\d+$"))
{
AddLog("NPM is not installed");
AddLog(outputInstalled);
NotifyForm notifyForm = new NotifyForm("NPM is not installed\nPlease install it to install HSD dependencies");
notifyForm.ShowDialog();
notifyForm.Dispose();
this.Close();
Thread.Sleep(1000);
return;
}
AddLog("Prerequisites installed");
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "git";
startInfo.Arguments = $"clone {repositoryUrl} {destinationPath}";
if (repositoryUrl == "https://github.com/handshake-org/hsd.git")
{
startInfo.Arguments = $"clone --depth 1 --branch latest {repositoryUrl} {destinationPath}";
}
startInfo.RedirectStandardOutput = true;
startInfo.UseShellExecute = false;
startInfo.CreateNoWindow = hideScreen;
@@ -1362,6 +1551,32 @@ namespace FireWallet
{
AddLog("Git/NPM Install FAILED");
AddLog(ex.Message);
if (ex.Message.Contains("to start process 'git'"))
{
NotifyForm notifyForm = new NotifyForm("Git needs to be installed\nCheck logs for more details");
notifyForm.ShowDialog();
notifyForm.Dispose();
}
else if (ex.Message.Contains("to start process 'node'"))
{
NotifyForm notifyForm = new NotifyForm("Node needs to be installed\nCheck logs for more details");
notifyForm.ShowDialog();
notifyForm.Dispose();
}
else if (ex.Message.Contains("to start process 'npm'"))
{
NotifyForm notifyForm = new NotifyForm("NPM needs to be installed\nCheck logs for more details");
notifyForm.ShowDialog();
notifyForm.Dispose();
}
else
{
NotifyForm notifyForm = new NotifyForm("Git/NPM Install FAILED\nCheck logs for more details");
notifyForm.ShowDialog();
notifyForm.Dispose();
}
this.Close();
}
}
public bool CheckNodeInstalled()
@@ -1469,13 +1684,6 @@ namespace FireWallet
domainTMP.Left = 10;
domainTMP.BorderStyle = BorderStyle.FixedSingle;
// On Click open domain
domainTMP.Click += new EventHandler((sender, e) =>
{
DomainForm domainForm = new DomainForm(this, name["name"].ToString(), userSettings["explorer-tx"], userSettings["explorer-domain"]);
domainForm.Show();
});
Label domainName = new Label();
domainName.Text = Domains[i];
domainName.Top = 5;
@@ -1485,7 +1693,8 @@ namespace FireWallet
domainTMP.Controls.Add(domainName);
if (!name.ContainsKey("stats")) {
if (!name.ContainsKey("stats"))
{
AddLog("Domain " + Domains[i] + " does not have stats");
continue;
}
@@ -1514,8 +1723,23 @@ namespace FireWallet
}
// On Click open domain
domainTMP.Click += new EventHandler((sender, e) =>
{
DomainForm domainForm = new DomainForm(this, name["name"].ToString(), userSettings["explorer-tx"], userSettings["explorer-domain"]);
domainForm.Show();
});
foreach (Control c in domainTMP.Controls)
{
c.Click += new EventHandler((sender, e) =>
{
DomainForm domainForm = new DomainForm(this, name["name"].ToString(), userSettings["explorer-tx"], userSettings["explorer-domain"]);
domainForm.Show();
});
}
panelDomainList.Controls.Add(domainTMP);
i++;
}

View File

@@ -17,7 +17,8 @@ namespace FireWallet
{
MainForm mainForm;
JObject tx;
public TXForm(MainForm mainForm, JObject tx)
string txid;
public TXForm(MainForm mainForm, string txid)
{
InitializeComponent();
// Theme
@@ -29,16 +30,20 @@ namespace FireWallet
}
this.mainForm = mainForm;
this.tx = tx;
this.Text = "TX: " + tx["hash"].ToString();
this.txid = txid;
}
private async void TXForm_Load(object sender, EventArgs e)
{
tx = JObject.Parse(await mainForm.APIGet("wallet/"+mainForm.account+"/tx/" + txid,true));
this.Text = "TX: " + tx["hash"].ToString();
labelHash.Text = "Hash: " + tx["hash"].ToString();
mainForm.AddLog("Viewing TX: " + tx["hash"].ToString());
// Disable scrolling on the panels until they are populated
panelInputs.Visible = false;
panelOutputs.Visible = false;
// For each input
JArray inputs = (JArray)tx["inputs"];
@@ -131,6 +136,9 @@ namespace FireWallet
panelOutputs.Controls.Add(PanelOutput);
}
panelInputs.Visible = true;
panelOutputs.Visible = true;
}
private void Explorer_Click(object sender, EventArgs e)

View File

@@ -224,15 +224,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:FireWallet"
"ProductCode" = "8:{24264791-86B1-49B5-88C9-5042C3FA1BF2}"
"PackageCode" = "8:{8CC25786-EE60-4F7F-970E-D122B84DF8B5}"
"ProductCode" = "8:{D85E3D97-B8F8-4212-9488-A48CF16CCF68}"
"PackageCode" = "8:{D2DCB865-F096-4420-AE54-579B6159A7CF}"
"UpgradeCode" = "8:{0C86F725-6B01-4173-AA05-3F0EDF481362}"
"AspNetVersion" = "8:"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:2.4"
"ProductVersion" = "8:2.7"
"Manufacturer" = "8:Nathan.Woodburn/"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:https://l.woodburn.au/discord"

View File

@@ -136,20 +136,14 @@ async function sendRaw(wclient, nclient, config, ledger, args) { // Create a fun
const network = Network.get(config.str('network')); // Get the network
const id = config.str('wallet-id'); // Get the wallet id
const acct = config.str('account-name'); // Get the account name
const batch = args[0]; // Get the batch file location
const nameslocation = args[1]; // Get the names file location
// Log the arguments to the console (for debugging)
const batch = JSON.parse(args[0]); // Get the batch
const names = JSON.parse(args[1]); // Get the names
await wclient.execute('selectwallet', [id]); // Select the wallet
const fs = require('fs'); // Import fs (used to read files)
try {
const data = fs.readFileSync(batch, 'utf8'); // Read the batch file
const json = JSON.parse(data); // Parse the batch file as JSON
const mtx = MTX.fromJSON(json.result); // Create a new MTX from the JSON
const namefile = fs.readFileSync(nameslocation, 'utf8'); // Read the names file
const names = namefile.split(','); // Split the names file into an array
const mtx = MTX.fromJSON(batch.result); // Create a new MTX from the JSON
const hashes = {}; // Create an empty object to store the hashes
for (const name of names) { // Loop through the names
const hash = hashName(name); // Hash the name
@@ -428,6 +422,7 @@ function usage(err) {
console.log(' $ hsd-ledger createaccount <account-name> <account-index>');
console.log(' $ hsd-ledger createaddress');
console.log(' $ hsd-ledger sendtoaddress <address> <amount>');
console.log(' $ hsd-ledger sendraw <batch> <names>');
console.log(' $ hsd-ledger getwallets');
console.log(' $ hsd-ledger getaccounts');
console.log(' $ hsd-ledger getaccount <account-name>');