9 Commits
v2.6 ... v2.7

7 changed files with 61 additions and 53 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

@@ -264,8 +264,6 @@ namespace FireWallet
buttonActionAlt.Hide();
buttonActionMain.Hide();
groupBoxAction.Text = "Reserved";
}
}
catch (Exception ex)

View File

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

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

@@ -221,7 +221,8 @@ namespace FireWallet
if (hideScreen)
{
hsdProcess.StartInfo.RedirectStandardError = true;
} else
}
else
{
hsdProcess.StartInfo.RedirectStandardError = false;
}
@@ -240,7 +241,7 @@ namespace FireWallet
hsdProcess.Start();
// Wait for HSD to start
await Task.Delay(2000);
// Check if HSD is running
if (hsdProcess.HasExited)
{
@@ -601,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;
}
@@ -866,7 +871,7 @@ namespace FireWallet
// Check how many TX there are
APIresponse = await APIGet("wallet/"+ account,true);
APIresponse = await APIGet("wallet/" + account, true);
JObject wallet = JObject.Parse(APIresponse);
if (!wallet.ContainsKey("balance"))
{
@@ -883,7 +888,13 @@ namespace FireWallet
int toSkip = TotalTX - toGet;
// GET TXs
APIresponse = await APIPost("", true, "{\"method\": \"listtransactions\",\"params\": [\"default\"," +toGet+","+ toSkip+ "]}");
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")
{
@@ -891,7 +902,7 @@ namespace FireWallet
return;
}
JObject TXGET = JObject.Parse(APIresponse);
// Check for error
if (TXGET["error"].ToString() != "")
{
@@ -901,6 +912,10 @@ namespace FireWallet
}
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++)
{
@@ -950,7 +965,7 @@ namespace FireWallet
AutoSize = true,
Location = new Point(10, 25)
};
tmpPanel.Controls.Add(labelHash);
JArray inputs = JArray.Parse(tx["inputs"].ToString());
@@ -958,7 +973,7 @@ namespace FireWallet
int inputCount = inputs.Count;
int outputCount = outputs.Count;
int costHNS = int.Parse(txs[toGet - i - 1]["amount"].ToString());
decimal costHNS = decimal.Parse(txs[toGet - i - 1]["amount"].ToString());
string cost = "";
if (costHNS < 0)
{
@@ -968,10 +983,10 @@ namespace FireWallet
{
cost = "Received: " + costHNS.ToString() + " HNS";
}
Label labelInputOutput = new Label()
{
@@ -1172,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"];
@@ -1677,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;
}
@@ -1716,8 +1733,8 @@ namespace FireWallet
foreach (Control c in domainTMP.Controls)
{
c.Click += new EventHandler((sender, e) =>
{
c.Click += new EventHandler((sender, e) =>
{
DomainForm domainForm = new DomainForm(this, name["name"].ToString(), userSettings["explorer-tx"], userSettings["explorer-domain"]);
domainForm.Show();
});

View File

@@ -224,15 +224,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:FireWallet"
"ProductCode" = "8:{CA9B8BF8-C03C-4C1F-BF5E-768B5897DB34}"
"PackageCode" = "8:{A830408F-C770-4E8D-BEE3-22D4736728B5}"
"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.6"
"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>');