mirror of
https://github.com/Nathanwoodburn/FireWallet.git
synced 2025-12-06 16:43:01 +11:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
d4620af384
|
|||
|
15cb4efaf1
|
|||
|
18607358bf
|
|||
|
6db6d02e9e
|
|||
|
3eda3d7419
|
|||
|
3f6c2bdded
|
|||
|
2bfca908a9
|
|||
|
531d41a413
|
|||
|
960af0b169
|
@@ -539,13 +539,7 @@ namespace FireWallet
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
StreamWriter sw = new StreamWriter(dir + "hsd-ledger/bin/names.txt");
|
string domainslist = string.Join(",", batches.Select(batch => "\\\"" + batch.domain + "\\\""));
|
||||||
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();
|
|
||||||
|
|
||||||
NotifyForm notify = new NotifyForm("Please confirm the transaction on your Ledger device", false);
|
NotifyForm notify = new NotifyForm("Please confirm the transaction on your Ledger device", false);
|
||||||
notify.Show();
|
notify.Show();
|
||||||
@@ -558,7 +552,9 @@ namespace FireWallet
|
|||||||
proc.StartInfo.RedirectStandardError = true;
|
proc.StartInfo.RedirectStandardError = true;
|
||||||
proc.StartInfo.FileName = "node.exe";
|
proc.StartInfo.FileName = "node.exe";
|
||||||
proc.StartInfo.WorkingDirectory = dir + "hsd-ledger/bin/";
|
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();
|
var outputBuilder = new StringBuilder();
|
||||||
|
|
||||||
// Event handler for capturing output data
|
// Event handler for capturing output data
|
||||||
@@ -590,6 +586,8 @@ namespace FireWallet
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
AddLog(args);
|
||||||
|
AddLog(proc.StandardError.ReadToEnd());
|
||||||
NotifyForm notifyError = new NotifyForm("Error Transaction Failed\nCheck logs for more details");
|
NotifyForm notifyError = new NotifyForm("Error Transaction Failed\nCheck logs for more details");
|
||||||
notifyError.ShowDialog();
|
notifyError.ShowDialog();
|
||||||
notifyError.Dispose();
|
notifyError.Dispose();
|
||||||
|
|||||||
@@ -264,8 +264,6 @@ namespace FireWallet
|
|||||||
buttonActionAlt.Hide();
|
buttonActionAlt.Hide();
|
||||||
buttonActionMain.Hide();
|
buttonActionMain.Hide();
|
||||||
groupBoxAction.Text = "Reserved";
|
groupBoxAction.Text = "Reserved";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<PackageIcon>HSDBatcher.png</PackageIcon>
|
<PackageIcon>HSDBatcher.png</PackageIcon>
|
||||||
<RepositoryUrl>https://github.com/Nathanwoodburn/FireWallet</RepositoryUrl>
|
<RepositoryUrl>https://github.com/Nathanwoodburn/FireWallet</RepositoryUrl>
|
||||||
<RepositoryType>git</RepositoryType>
|
<RepositoryType>git</RepositoryType>
|
||||||
<Version>2.6</Version>
|
<Version>2.7</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
30
FireWallet/MainForm.Designer.cs
generated
30
FireWallet/MainForm.Designer.cs
generated
@@ -59,7 +59,6 @@ namespace FireWallet
|
|||||||
buttonNavSend = new Button();
|
buttonNavSend = new Button();
|
||||||
buttonNavPortfolio = new Button();
|
buttonNavPortfolio = new Button();
|
||||||
panelPortfolio = new Panel();
|
panelPortfolio = new Panel();
|
||||||
buttonRenewAll = new Button();
|
|
||||||
buttonRevealAll = new Button();
|
buttonRevealAll = new Button();
|
||||||
groupBoxTransactions = new GroupBox();
|
groupBoxTransactions = new GroupBox();
|
||||||
groupBoxinfo = new GroupBox();
|
groupBoxinfo = new GroupBox();
|
||||||
@@ -70,6 +69,7 @@ namespace FireWallet
|
|||||||
labelBalanceTotal = new Label();
|
labelBalanceTotal = new Label();
|
||||||
labelLocked = new Label();
|
labelLocked = new Label();
|
||||||
labelBalance = new Label();
|
labelBalance = new Label();
|
||||||
|
buttonRenewAll = new Button();
|
||||||
panelSend = new Panel();
|
panelSend = new Panel();
|
||||||
checkBoxSendSubFee = new CheckBox();
|
checkBoxSendSubFee = new CheckBox();
|
||||||
buttonSendMax = new Button();
|
buttonSendMax = new Button();
|
||||||
@@ -400,18 +400,6 @@ namespace FireWallet
|
|||||||
panelPortfolio.TabIndex = 7;
|
panelPortfolio.TabIndex = 7;
|
||||||
panelPortfolio.Visible = false;
|
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
|
||||||
//
|
//
|
||||||
buttonRevealAll.FlatStyle = FlatStyle.Flat;
|
buttonRevealAll.FlatStyle = FlatStyle.Flat;
|
||||||
@@ -518,6 +506,18 @@ namespace FireWallet
|
|||||||
labelBalance.TabIndex = 0;
|
labelBalance.TabIndex = 0;
|
||||||
labelBalance.Text = "labelBalance";
|
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
|
||||||
//
|
//
|
||||||
panelSend.Controls.Add(checkBoxSendSubFee);
|
panelSend.Controls.Add(checkBoxSendSubFee);
|
||||||
@@ -792,7 +792,7 @@ namespace FireWallet
|
|||||||
panelSettings.Controls.Add(buttonSettingsSave);
|
panelSettings.Controls.Add(buttonSettingsSave);
|
||||||
panelSettings.Controls.Add(groupBoxSettingsExplorer);
|
panelSettings.Controls.Add(groupBoxSettingsExplorer);
|
||||||
panelSettings.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point);
|
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.Name = "panelSettings";
|
||||||
panelSettings.Size = new Size(930, 550);
|
panelSettings.Size = new Size(930, 550);
|
||||||
panelSettings.TabIndex = 19;
|
panelSettings.TabIndex = 19;
|
||||||
@@ -1007,6 +1007,7 @@ namespace FireWallet
|
|||||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
ClientSize = new Size(1152, 575);
|
ClientSize = new Size(1152, 575);
|
||||||
|
Controls.Add(panelSettings);
|
||||||
Controls.Add(panelaccount);
|
Controls.Add(panelaccount);
|
||||||
Controls.Add(panelPortfolio);
|
Controls.Add(panelPortfolio);
|
||||||
Controls.Add(panelRecieve);
|
Controls.Add(panelRecieve);
|
||||||
@@ -1014,7 +1015,6 @@ namespace FireWallet
|
|||||||
Controls.Add(panelSend);
|
Controls.Add(panelSend);
|
||||||
Controls.Add(panelNav);
|
Controls.Add(panelNav);
|
||||||
Controls.Add(statusStripmain);
|
Controls.Add(statusStripmain);
|
||||||
Controls.Add(panelSettings);
|
|
||||||
Icon = (Icon)resources.GetObject("$this.Icon");
|
Icon = (Icon)resources.GetObject("$this.Icon");
|
||||||
Name = "MainForm";
|
Name = "MainForm";
|
||||||
Opacity = 0D;
|
Opacity = 0D;
|
||||||
|
|||||||
@@ -221,7 +221,8 @@ namespace FireWallet
|
|||||||
if (hideScreen)
|
if (hideScreen)
|
||||||
{
|
{
|
||||||
hsdProcess.StartInfo.RedirectStandardError = true;
|
hsdProcess.StartInfo.RedirectStandardError = true;
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
hsdProcess.StartInfo.RedirectStandardError = false;
|
hsdProcess.StartInfo.RedirectStandardError = false;
|
||||||
}
|
}
|
||||||
@@ -601,11 +602,15 @@ namespace FireWallet
|
|||||||
watchOnly = true;
|
watchOnly = true;
|
||||||
toolStripStatusLabelLedger.Text = "Cold Wallet";
|
toolStripStatusLabelLedger.Text = "Cold Wallet";
|
||||||
toolStripStatusLabelLedger.Visible = true;
|
toolStripStatusLabelLedger.Visible = true;
|
||||||
|
buttonRevealAll.Visible = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
watchOnly = false;
|
watchOnly = false;
|
||||||
toolStripStatusLabelLedger.Visible = false;
|
toolStripStatusLabelLedger.Visible = false;
|
||||||
|
buttonRevealAll.Visible = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -866,7 +871,7 @@ namespace FireWallet
|
|||||||
|
|
||||||
|
|
||||||
// Check how many TX there are
|
// Check how many TX there are
|
||||||
APIresponse = await APIGet("wallet/"+ account,true);
|
APIresponse = await APIGet("wallet/" + account, true);
|
||||||
JObject wallet = JObject.Parse(APIresponse);
|
JObject wallet = JObject.Parse(APIresponse);
|
||||||
if (!wallet.ContainsKey("balance"))
|
if (!wallet.ContainsKey("balance"))
|
||||||
{
|
{
|
||||||
@@ -883,7 +888,13 @@ namespace FireWallet
|
|||||||
int toSkip = TotalTX - toGet;
|
int toSkip = TotalTX - toGet;
|
||||||
|
|
||||||
// GET TXs
|
// 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")
|
if (APIresponse == "Error")
|
||||||
{
|
{
|
||||||
@@ -901,6 +912,10 @@ namespace FireWallet
|
|||||||
}
|
}
|
||||||
|
|
||||||
JArray txs = JArray.Parse(TXGET["result"].ToString());
|
JArray txs = JArray.Parse(TXGET["result"].ToString());
|
||||||
|
if (toGet > txs.Count)
|
||||||
|
{
|
||||||
|
toGet = txs.Count;
|
||||||
|
}
|
||||||
Control[] tmpControls = new Control[toGet];
|
Control[] tmpControls = new Control[toGet];
|
||||||
for (int i = 0; i < toGet; i++)
|
for (int i = 0; i < toGet; i++)
|
||||||
{
|
{
|
||||||
@@ -958,7 +973,7 @@ namespace FireWallet
|
|||||||
int inputCount = inputs.Count;
|
int inputCount = inputs.Count;
|
||||||
int outputCount = outputs.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 = "";
|
string cost = "";
|
||||||
if (costHNS < 0)
|
if (costHNS < 0)
|
||||||
{
|
{
|
||||||
@@ -1172,6 +1187,7 @@ namespace FireWallet
|
|||||||
}
|
}
|
||||||
|
|
||||||
panelSettings.Show();
|
panelSettings.Show();
|
||||||
|
panelSettings.Dock = DockStyle.Fill;
|
||||||
buttonSettingsSave.Top = panelSettings.Height - buttonSettingsSave.Height - 10;
|
buttonSettingsSave.Top = panelSettings.Height - buttonSettingsSave.Height - 10;
|
||||||
labelSettingsSaved.Top = buttonSettingsSave.Top + 10;
|
labelSettingsSaved.Top = buttonSettingsSave.Top + 10;
|
||||||
textBoxExTX.Text = userSettings["explorer-tx"];
|
textBoxExTX.Text = userSettings["explorer-tx"];
|
||||||
@@ -1677,7 +1693,8 @@ namespace FireWallet
|
|||||||
|
|
||||||
domainTMP.Controls.Add(domainName);
|
domainTMP.Controls.Add(domainName);
|
||||||
|
|
||||||
if (!name.ContainsKey("stats")) {
|
if (!name.ContainsKey("stats"))
|
||||||
|
{
|
||||||
AddLog("Domain " + Domains[i] + " does not have stats");
|
AddLog("Domain " + Domains[i] + " does not have stats");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1716,8 +1733,8 @@ namespace FireWallet
|
|||||||
|
|
||||||
foreach (Control c in domainTMP.Controls)
|
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 domainForm = new DomainForm(this, name["name"].ToString(), userSettings["explorer-tx"], userSettings["explorer-domain"]);
|
||||||
domainForm.Show();
|
domainForm.Show();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -224,15 +224,15 @@
|
|||||||
{
|
{
|
||||||
"Name" = "8:Microsoft Visual Studio"
|
"Name" = "8:Microsoft Visual Studio"
|
||||||
"ProductName" = "8:FireWallet"
|
"ProductName" = "8:FireWallet"
|
||||||
"ProductCode" = "8:{CA9B8BF8-C03C-4C1F-BF5E-768B5897DB34}"
|
"ProductCode" = "8:{D85E3D97-B8F8-4212-9488-A48CF16CCF68}"
|
||||||
"PackageCode" = "8:{A830408F-C770-4E8D-BEE3-22D4736728B5}"
|
"PackageCode" = "8:{D2DCB865-F096-4420-AE54-579B6159A7CF}"
|
||||||
"UpgradeCode" = "8:{0C86F725-6B01-4173-AA05-3F0EDF481362}"
|
"UpgradeCode" = "8:{0C86F725-6B01-4173-AA05-3F0EDF481362}"
|
||||||
"AspNetVersion" = "8:"
|
"AspNetVersion" = "8:"
|
||||||
"RestartWWWService" = "11:FALSE"
|
"RestartWWWService" = "11:FALSE"
|
||||||
"RemovePreviousVersions" = "11:TRUE"
|
"RemovePreviousVersions" = "11:TRUE"
|
||||||
"DetectNewerInstalledVersion" = "11:TRUE"
|
"DetectNewerInstalledVersion" = "11:TRUE"
|
||||||
"InstallAllUsers" = "11:FALSE"
|
"InstallAllUsers" = "11:FALSE"
|
||||||
"ProductVersion" = "8:2.6"
|
"ProductVersion" = "8:2.7"
|
||||||
"Manufacturer" = "8:Nathan.Woodburn/"
|
"Manufacturer" = "8:Nathan.Woodburn/"
|
||||||
"ARPHELPTELEPHONE" = "8:"
|
"ARPHELPTELEPHONE" = "8:"
|
||||||
"ARPHELPLINK" = "8:https://l.woodburn.au/discord"
|
"ARPHELPLINK" = "8:https://l.woodburn.au/discord"
|
||||||
|
|||||||
15
hsd-ledger
15
hsd-ledger
@@ -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 network = Network.get(config.str('network')); // Get the network
|
||||||
const id = config.str('wallet-id'); // Get the wallet id
|
const id = config.str('wallet-id'); // Get the wallet id
|
||||||
const acct = config.str('account-name'); // Get the account name
|
const acct = config.str('account-name'); // Get the account name
|
||||||
const batch = args[0]; // Get the batch file location
|
// Log the arguments to the console (for debugging)
|
||||||
const nameslocation = args[1]; // Get the names file location
|
|
||||||
|
|
||||||
|
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
|
await wclient.execute('selectwallet', [id]); // Select the wallet
|
||||||
|
|
||||||
|
|
||||||
const fs = require('fs'); // Import fs (used to read files)
|
|
||||||
try {
|
try {
|
||||||
const data = fs.readFileSync(batch, 'utf8'); // Read the batch file
|
const mtx = MTX.fromJSON(batch.result); // Create a new MTX from the JSON
|
||||||
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 hashes = {}; // Create an empty object to store the hashes
|
const hashes = {}; // Create an empty object to store the hashes
|
||||||
for (const name of names) { // Loop through the names
|
for (const name of names) { // Loop through the names
|
||||||
const hash = hashName(name); // Hash the name
|
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 createaccount <account-name> <account-index>');
|
||||||
console.log(' $ hsd-ledger createaddress');
|
console.log(' $ hsd-ledger createaddress');
|
||||||
console.log(' $ hsd-ledger sendtoaddress <address> <amount>');
|
console.log(' $ hsd-ledger sendtoaddress <address> <amount>');
|
||||||
|
console.log(' $ hsd-ledger sendraw <batch> <names>');
|
||||||
console.log(' $ hsd-ledger getwallets');
|
console.log(' $ hsd-ledger getwallets');
|
||||||
console.log(' $ hsd-ledger getaccounts');
|
console.log(' $ hsd-ledger getaccounts');
|
||||||
console.log(' $ hsd-ledger getaccount <account-name>');
|
console.log(' $ hsd-ledger getaccount <account-name>');
|
||||||
|
|||||||
Reference in New Issue
Block a user