Add fake response to balances
MODIFY
HiddenWallet/HiddenWallet.API/Controllers/WalletController.cs
HiddenWallet/HiddenWallet.API/Controllers/WalletController.cs
@@ -135,5 +135,32 @@ namespace HiddenWallet.API.Controllers
return new ObjectResult(new FailureResponse { Message = ex.Message, Details = ex.ToString() });
}
}
+
+ [Route("balances")]
+ [HttpGet]
+ public IActionResult Balances([FromBody]AccountModel request)
+ {
+ try
+ {
+ if (!Global.WalletWrapper.IsDecrypted)
+ {
+ return new ObjectResult(new FailureResponse { Message = "Wallet isn't decrypted" });
+ }
+ var trimmed = request.Account;
+ if (String.Equals(trimmed, "alice", StringComparison.OrdinalIgnoreCase))
+ {
+ return new ObjectResult(new BalancesResponse { Available = 32.1m, Incoming = 0.23534219m });
+ }
+ else if (String.Equals(trimmed, "bob", StringComparison.OrdinalIgnoreCase))
+ {
+ return new ObjectResult(new BalancesResponse { Available = 0.34342m, Incoming = 5m });
+ }
+ else return new ObjectResult(new FailureResponse { Message = "Wrong account" });
+ }
+ catch (Exception ex)
+ {
+ return new ObjectResult(new FailureResponse { Message = ex.Message, Details = ex.ToString() });
+ }
+ }
}
}

MODIFY
HiddenWallet/HiddenWallet.API/Wrappers/WalletWrapper.cs
HiddenWallet/HiddenWallet.API/Wrappers/WalletWrapper.cs
@@ -27,6 +27,7 @@ namespace HiddenWallet.API.Wrappers
private Task _walletJobTask = Task.CompletedTask;
public bool WalletExists => File.Exists(Config.WalletFilePath);
+ public bool IsDecrypted => !_walletJobTask.IsCompleted && _password != null;
public WalletWrapper()
{

MODIFY
HiddenWallet/HiddenWallet.GUI/app/js/wallet-phase.js
HiddenWallet/HiddenWallet.GUI/app/js/wallet-phase.js
@@ -34,7 +34,7 @@ function walletShow(menuItem) {
document.getElementById("menu").innerHTML = document.getElementById("wallet-menu-frame").contentWindow.document.getElementById("receive-active").innerHTML;
}
else if (menuItem === 'send') {
- writeHint('Consider feeding nopara73 with some pizza: 186n7me3QKajQZJnUsVsezVhVrSwyFCCZ');
+ writeHint('Would you consider feeding the developer with some pizza? 186n7me3QKajQZJnUsVsezVhVrSwyFCCZ');
document.getElementById("menu").innerHTML = document.getElementById("wallet-menu-frame").contentWindow.document.getElementById("send-active").innerHTML;
}
else if (menuItem === 'history') {

Add fake response to balances