Implement GUI for safe functions (DevZH.UI is still extremely buggy, needs to be replaced)
MODIFY
HiddenWallet/HiddenWallet.API/Controllers/WalletController.cs
HiddenWallet/HiddenWallet.API/Controllers/WalletController.cs
@@ -30,9 +30,9 @@ namespace HiddenWallet.API.Controllers
try
{
- var mnemonic = WalletWrapper.Create(request.Password);
+ WalletCreateResponse response = WalletWrapper.Create(request.Password);
- return new ObjectResult(new MnemonicResponse { Mnemonic = mnemonic });
+ return new ObjectResult(response);
}
catch(Exception ex)
{
@@ -82,5 +82,22 @@ namespace HiddenWallet.API.Controllers
}
}
+ [Route("wallet-exists")]
+ [HttpGet]
+ public IActionResult WalletExists()
+ {
+ try
+ {
+ if (WalletWrapper.WalletExists)
+ {
+ return new ObjectResult(new YesNoResponse { Value = true });
+ }
+ return new ObjectResult(new YesNoResponse { Value = false });
+ }
+ catch (Exception ex)
+ {
+ return new ObjectResult(new FailureResponse { Message = ex.Message, Details = ex.ToString() });
+ }
+ }
}
}

MODIFY
HiddenWallet/HiddenWallet.API/HiddenWallet.API.csproj
HiddenWallet/HiddenWallet.API/HiddenWallet.API.csproj
</PropertyGroup>
<ItemGroup>
+ <Folder Include="Wallets\" />
+ <Folder Include="Wallets\" />
<Folder Include="wwwroot\" />
</ItemGroup>
<ItemGroup>

RENAME
HiddenWallet/HiddenWallet.API/Models/MnemonicResponse.cs
HiddenWallet/HiddenWallet.API/Models/WalletCreateResponse.cs
@@ -5,9 +5,10 @@ using System.Threading.Tasks;
namespace HiddenWallet.API.Models
{
- public class MnemonicResponse : BaseResponse
+ public class WalletCreateResponse : BaseResponse
{
- public MnemonicResponse() => Success = true;
+ public WalletCreateResponse() => Success = true;
public string Mnemonic { get; set; }
+ public string CreationTime { get; set; }
}
}

MODIFY
HiddenWallet/HiddenWallet.API/Program.cs
HiddenWallet/HiddenWallet.API/Program.cs
@@ -5,6 +5,7 @@ using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
+using System.Net.Http;
namespace HiddenWallet.API
{

Implement GUI for safe functions (DevZH.UI is still extremely buggy, needs to be replaced)