public async override Task Execute() { try { using (var identifier = Prompt.GetPasswordAsSecureString("Identifier:", ConsoleColor.Yellow)) using (var password = Prompt.GetPasswordAsSecureString("Password:"******"\nWallet Key set added!\n"); console.ForegroundColor = ConsoleColor.White; return; } console.ForegroundColor = ConsoleColor.Red; console.WriteLine("Something went wrong!"); console.ForegroundColor = ConsoleColor.White; } } catch (Exception ex) { throw ex; } }
public async Task <IActionResult> CreateWalletAddress([FromBody] CredentialsDto credentials) { var pksk = walletService.CreatePkSk(); var added = await walletService.AddKey(credentials.Identifier.ToSecureString(), credentials.Password.ToSecureString(), pksk); if (added) { return(new CreatedResult("httpWallet", new { success = added })); } return(new BadRequestResult()); }