Beautify GUI, Add config
MODIFY
HiddenWallet/HiddenWallet.API/Config.cs
HiddenWallet/HiddenWallet.API/Config.cs
@@ -9,11 +9,14 @@ namespace HiddenWallet.API
public static class Config
{
// Initialized with default attributes
- public static string WalletFilePath = @"Wallets\Wallet.json";
+ public static string WalletFilePath = Path.Combine("Wallets", "Wallet.json");
public static Network Network = Network.Main;
public static bool CanSpendUnconfirmed = false;
+ public static Uri TumbleBitServerTestNet = new Uri("http://t4cqwqlvswcyyagg.onion/api/v1/tumblers/310586435471416ca16058c1fb9ed3c868f239b9");
+ public static Uri TumbleBitServerMainNet = null;
+
static Config()
{
if (!File.Exists(ConfigFileSerializer.ConfigFilePath))
@@ -29,7 +32,9 @@ namespace HiddenWallet.API
ConfigFileSerializer.Serialize(
WalletFilePath,
Network.ToString(),
- CanSpendUnconfirmed.ToString());
+ CanSpendUnconfirmed.ToString(),
+ TumbleBitServerTestNet == null ? "" : TumbleBitServerTestNet.AbsoluteUri,
+ TumbleBitServerMainNet == null ? "" : TumbleBitServerMainNet.AbsoluteUri);
Load();
}
@@ -71,6 +76,17 @@ namespace HiddenWallet.API
else
throw new NotSupportedException($"Wrong CanSpendUnconfirmed value in {ConfigFileSerializer.ConfigFilePath}");
+ if (rawContent.TumbleBitServerTestNet == null || rawContent.TumbleBitServerTestNet == "")
+ {
+ TumbleBitServerTestNet = null;
+ }
+ else TumbleBitServerTestNet = new Uri(rawContent.TumbleBitServerTestNet);
+
+ if (rawContent.TumbleBitServerMainNet == null || rawContent.TumbleBitServerMainNet == "")
+ {
+ TumbleBitServerTestNet = null;
+ }
+ else TumbleBitServerMainNet = new Uri(rawContent.TumbleBitServerMainNet);
}
public class ConfigFileSerializer
@@ -83,28 +99,39 @@ namespace HiddenWallet.API
public string Network { get; set; }
public string CanSpendUnconfirmed { get; set; }
+ public string TumbleBitServerTestNet { get; set; }
+ public string TumbleBitServerMainNet { get; set; }
+
[JsonConstructor]
private ConfigFileSerializer(
string walletFilePath,
string network,
- string canSpendUnconfirmed)
+ string canSpendUnconfirmed,
+ string tumbleBitServerTestNet,
+ string tumbleBitServerMainNet)
{
WalletFilePath = walletFilePath;
Network = network;
CanSpendUnconfirmed = canSpendUnconfirmed;
+ TumbleBitServerTestNet = tumbleBitServerTestNet;
+ TumbleBitServerMainNet = tumbleBitServerMainNet;
}
internal static void Serialize(
string walletFilePath,
string network,
- string canSpendUnconfirmed)
+ string canSpendUnconfirmed,
+ string tumbleBitServerTestNet,
+ string tumbleBitServerMainNet)
{
var content =
JsonConvert.SerializeObject(
new ConfigFileSerializer(
walletFilePath,
network,
- canSpendUnconfirmed), Formatting.Indented);
+ canSpendUnconfirmed,
+ tumbleBitServerTestNet,
+ tumbleBitServerMainNet), Formatting.Indented);
File.WriteAllText(ConfigFilePath, content);
}
@@ -120,7 +147,9 @@ namespace HiddenWallet.API
return new ConfigFileSerializer(
configFileSerializer.WalletFilePath,
configFileSerializer.Network,
- configFileSerializer.CanSpendUnconfirmed);
+ configFileSerializer.CanSpendUnconfirmed,
+ configFileSerializer.TumbleBitServerTestNet,
+ configFileSerializer.TumbleBitServerMainNet);
}
}
}

MODIFY
HiddenWallet/HiddenWallet.API/HiddenWallet.API.csproj
HiddenWallet/HiddenWallet.API/HiddenWallet.API.csproj
<RuntimeIdentifiers>win7-x64;win8-x64;win81-x64;win10-x64;osx.10.10-x64;osx.10.11-x64;osx.10.12-x64;ubuntu.14.04-x64;ubuntu.14.10-x64;ubuntu.15.04-x64;ubuntu.15.10-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;debian.8-x64;linuxmint.17-x64;linuxmint.17.1-x64;linuxmint.17.2-x64;linuxmint.17.3-x64;linuxmint.18-x64;win7-x86;win8-x86;win81-x86;win10-x86</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup>
- <PackageReference Include="HBitcoin" Version="0.1.8.2" />
+ <PackageReference Include="HBitcoin" Version="0.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.3" />
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.2" />

MODIFY
HiddenWallet/HiddenWallet.API/Wrappers/WalletWrapper.cs
HiddenWallet/HiddenWallet.API/Wrappers/WalletWrapper.cs
@@ -87,7 +87,8 @@ namespace HiddenWallet.API.Wrappers
// it's not running yet, let's run it
_password = password;
- _walletJob = new WalletJob(Tor.SocksPortHandler, Tor.ControlPortClient, safe, trackDefaultSafe: false, accountsToTrack: new SafeAccount[] { AliceAccount, BobAccount });
+ Uri tumblerUri = Config.Network == Network.Main ? Config.TumbleBitServerMainNet : Config.TumbleBitServerTestNet;
+ _walletJob = new WalletJob(Tor.SocksPortHandler, Tor.ControlPortClient, safe, tumbleBitServerUri: tumblerUri, trackDefaultSafe: false, accountsToTrack: new SafeAccount[] { AliceAccount, BobAccount });
_walletJob.StateChanged += _walletJob_StateChanged;
_walletJob.Tracker.TrackedTransactions.CollectionChanged += TrackedTransactions_CollectionChanged;

MODIFY
HiddenWallet/HiddenWallet.GUI/app/html/wallet-content.html
HiddenWallet/HiddenWallet.GUI/app/html/wallet-content.html
</div>
<div id="mixer-content">
- <h4><span class="label label-info">Queue coins for mixing with TumbleBit</span></h4>
+ <span class="label label-info" style="font-size: 14px;">Queue coins for mixing with TumbleBit</span>
<hr />
- <h4>
- <span class="label label-info">Tumbler Address:</span>
- </h4>
- <h5>
- <span id="tumbler-address"></span>
- </h5>
- <h4>
- <span class="label label-info">Status:</span>
- <span class="label" id="tumbler-status"></span>
- </h4>
- <h4>
- <span class="label label-info">Denomination:</span>
- <span class="label" id="tumbler-denomination"></span>
- <span class="label label-info">BTC</span>
- </h4>
- <h4>
- <span class="label label-info">Tumbler Fee:</span>
- <span class="label" id="tumbler-fee"></span>
- <span class="label label-info">%</span>
- </h4>
+
+ <label>Tumbler</label>
+ <input id="tumbler-address" type="text" class="form-control" readonly/>
+ <br />
+ <label>Status:</label>
+ <span class="label" style="font-size: 13px; margin-left:4em;" id="tumbler-status"></span>
+ <br />
+ <label>Denomination:</label>
+ <span class="label" style="font-size: 13px;" id="tumbler-denomination"></span>
+ <label>BTC</label>
+ <br />
+ <label>Tumbler Fee:</label>
+ <span class="label" style="font-size: 13px; margin-left:0.9em;" id="tumbler-fee"></span>
+ <label>%</label>
<hr />
- <h4>
- <span class="label label-info">From:</span>
+
+ <label>From:</label>
<span class="dropdown">
- <span id="choose-wallet-dropdown-active" onclick="chooseWalletDropdown()" class="label label-danger dropbtn"><span class="mdi mdi-arrow-down-drop-circle"></span> Select Wallet!</span>
+ <span id="choose-wallet-dropdown-active" onclick="chooseWalletDropdown()" style="font-size: 15px; margin-left:2.2em;" class="label label-danger dropbtn"><span class="mdi mdi-arrow-down-drop-circle"></span> Select Wallet!</span>
<div id="choose-wallet-dropdown" class="dropdown-content">
<a id="wallet-dropdown-alice" onclick="chooseWalletDropdown('alice')" href="#">Alice</a>
<a id="wallet-dropdown-bob" onclick="chooseWalletDropdown('bob')" href="#">Bob</a>
</div>
</span>
- <span class="label label-info">To:</span>
- <span class="label label-danger" id="tumbling-to-wallet">?</span>
- </h4>
- <h4>
- <span class="label label-info">Amount:</span>
- <input id="amount-input" onkeypress="document.getElementById('amount-input').stepUp(1); return false;" type="number" size="7" step="0.5" min="0.5" max="5"/>
- <span class="label label-info">BTC</span>
- </h4>
+ <label>To:</label>
+ <span class="label label-danger" id="tumbling-to-wallet" style="font-size: 15px;">?</span>
+ <br />
+ <form class="form-inline">
+ <label>Amount:</label>
+ <input style="margin-left:1em;" id="amount-input" class="form-control form-inline" onkeypress="document.getElementById('amount-input').stepUp(1); return false;" type="number" size="11" step="0.5" min="0.5" max="5" />
+ <label>BTC</label>
+ </form>
<hr />
- <h4>
- <span class="label label-info">Estimated Tumbling Time:</span>
- <span class="label" id="tumbling-time"></span>
- <span class="label label-info">h</span>
- </h4>
- <h4>
- <span class="label label-info">Estimated Network Fees:</span>
- <span class="label" id="tumbling-network-fees"></span>
- <span class="label label-info">%</span>
- </h4>
+
+ <label>Estimated Tumbling Time:</label>
+ <span style="font-size: 13px;" class="label" id="tumbling-time"></span>
+ <label>h</label>
+ <br />
+ <label>Estimated Network Fees:</label>
+ <span style="font-size: 13px; margin-left:0.6em;" class="label" id="tumbling-network-fees"></span>
+ <label>%</label>
<br />
+ <br />
+
<button id="broadcast-button" class="btn btn-lg btn-success btn-block" onclick="">
<span class="mdi mdi-tor"></span> Start Mixing
</button>

MODIFY
HiddenWallet/HiddenWallet.GUI/app/js/wallet-phase.js
HiddenWallet/HiddenWallet.GUI/app/js/wallet-phase.js
@@ -91,7 +91,7 @@ function chooseWalletDropdown(aliceBob = "") {
function mixerShow() {
document.getElementById("content").innerHTML = document.getElementById("wallet-content-frame").contentWindow.document.getElementById("mixer-content").outerHTML;
- document.getElementById("tumbler-address").innerText = "http://testnet.ntumblebit.metaco.com/api/v1/tumblers/7c762c3dc672d440a9a0ed3082a2fc5fbfcc51db";
+ document.getElementById("tumbler-address").value = "http://testnet.ntumblebit.metaco.com/api/v1/tumblers/7c762c3dc672d440a9a0ed3082a2fc5fbfcc51db";
document.getElementById("tumbler-status").innerText = "Online";
document.getElementById("tumbler-status").classList.add("label-success");
document.getElementById("tumbler-denomination").innerText = "0.7";

Beautify GUI, Add config