public void RemoveWallet(Guid id, Action <ResponseBase> callback)
 {
     Task.Factory.StartNew(() => {
         Guid messageId = Guid.NewGuid();
         try {
             RemoveWalletRequest request = new RemoveWalletRequest {
                 MessageId = messageId,
                 LoginName = LoginName,
                 Timestamp = DateTime.Now,
                 WalletId  = id
             };
             request.SignIt(Password);
             using (var service = CreateService()) {
                 ResponseBase response = service.RemoveWallet(request);
                 callback?.Invoke(response);
             }
         }
         catch (CommunicationException e) {
             Global.DebugLine(e.Message, ConsoleColor.Red);
             callback?.Invoke(ResponseBase.ClientError(messageId, e.Message));
         }
         catch (Exception e) {
             Global.Logger.Error(e.Message, e);
             callback?.Invoke(ResponseBase.ClientError(messageId, e.Message));
         }
     });
 }
 public void SetCoinKernelProfileProperty(Guid workId, Guid coinKernelId, string propertyName, object value, Action <ResponseBase> callback)
 {
     Task.Factory.StartNew(() => {
         Guid messageId = Guid.NewGuid();
         try {
             SetCoinKernelProfilePropertyRequest request = new SetCoinKernelProfilePropertyRequest {
                 MessageId    = messageId,
                 LoginName    = LoginName,
                 CoinKernelId = coinKernelId,
                 PropertyName = propertyName,
                 Value        = value,
                 Timestamp    = DateTime.Now,
                 WorkId       = workId
             };
             request.SignIt(Password);
             using (var service = CreateService()) {
                 ResponseBase response = service.SetCoinKernelProfileProperty(request);
                 callback?.Invoke(response);
             }
         }
         catch (CommunicationException e) {
             Global.DebugLine(e.Message, ConsoleColor.Red);
             callback?.Invoke(ResponseBase.ClientError(messageId, e.Message));
         }
         catch (Exception e) {
             Global.Logger.Error(e.Message, e);
             callback?.Invoke(ResponseBase.ClientError(messageId, e.Message));
         }
     });
 }
 public void AddOrUpdateWallet(WalletData entity, Action <ResponseBase> callback)
 {
     Task.Factory.StartNew(() => {
         Guid messageId = Guid.NewGuid();
         try {
             entity.ModifiedOn = DateTime.Now;
             AddOrUpdateWalletRequest request = new AddOrUpdateWalletRequest {
                 LoginName = LoginName,
                 MessageId = messageId,
                 Timestamp = DateTime.Now,
                 Data      = entity
             };
             request.SignIt(Password);
             using (var service = CreateService()) {
                 ResponseBase response = service.AddOrUpdateWallet(request);
                 callback?.Invoke(response);
             }
         }
         catch (CommunicationException e) {
             Global.DebugLine(e.Message, ConsoleColor.Red);
             callback?.Invoke(ResponseBase.ClientError(messageId, e.Message));
         }
         catch (Exception e) {
             Global.Logger.Error(e.Message, e);
             callback?.Invoke(ResponseBase.ClientError(messageId, e.Message));
         }
     });
 }
            public void Login(string loginName, string password, Action <ResponseBase> callback)
            {
                Guid messageId = Guid.NewGuid();

                Task.Factory.StartNew(() => {
                    try {
                        using (var service = CreateService()) {
                            LoginControlCenterRequest request = new LoginControlCenterRequest {
                                MessageId = messageId,
                                LoginName = loginName,
                                Timestamp = DateTime.Now
                            };
                            request.SignIt(password);
                            ResponseBase response = service.LoginControlCenter(request);
                            callback?.Invoke(response);
                        }
                    }
                    catch (CommunicationException e) {
                        Global.DebugLine(e.Message, ConsoleColor.Red);
                        callback?.Invoke(ResponseBase.ClientError(messageId, e.Message));
                    }
                    catch (Exception e) {
                        Global.Logger.Error(e.Message, e);
                        callback?.Invoke(ResponseBase.ClientError(messageId, e.Message));
                    }
                });
            }