Exemple #1
0
        public void WalletCreateCommand(string fileName)
        {
            _walletManager.CreateWallet(fileName);
            var secureString = _consoleReader.ReadPassword();

            _walletManager.CreateAccount(secureString);
        }
        public async Task <IActionResult> Post(WalletModel model)
        {
            var response = new APIResponse();

            var(entity, message) = await _walletManager.CreateWallet(model);

            if (entity != null)
            {
                response.Result     = entity;
                response.ApiMessage = message;
                response.StatusCode = "00";
                return(Ok(response));
            }
            response.ApiMessage = message;
            response.Result     = entity;

            return(BadRequest(response));
        }
Exemple #3
0
 public bool CreateWallet(CreateWalletDetails createWalletDetails)
 {
     try
     {
         _walletManager.CreateWallet(createWalletDetails.Password, createWalletDetails.Name, createWalletDetails.Password);
         _walletSyncManager.SyncFromDate(_dateTimeProvider.GetUtcNow());
         _logger.LogInformation($"Created wallet {createWalletDetails.Name}.");
         return(true);
     }
     catch (WalletException)
     {
         _logger.LogDebug($"Wallet {createWalletDetails.Name} already exists.");
         return(false);
     }
     catch (NotSupportedException e)
     {
         _logger.LogError(e.Message);
         return(false);
     }
 }
        public void WalletCreateCommand(FileInfo file)
        {
            var secureString = _consoleHandler.ReadPassword();

            _consoleHandler.ApplyStyle(ConsoleOutputStyle.Prompt);
            var confirmationString = _consoleHandler.ReadPassword("\nConfirm your password:"******"\nAddress: " + walletAccount.Address, ConsoleOutputStyle.Information);
                _consoleHandler.WriteLine("Public Key: " + _walletManager.GetPublicKeyFromNep2(walletAccount.Key, secureString), ConsoleOutputStyle.Information);
            }
            else
            {
                _consoleHandler.WriteLine("\nPasswords don't match.", ConsoleOutputStyle.Information);
            }
        }