Esempio n. 1
0
 private void OnFundChanged(FundChanged evt)
 {
     try
     {
         var request = new CreateOrUpdateFundAccountRequest
         {
             AccountKey = evt.GetAccountKey(),
             ExtraFund  = Utilities.ToInt64Value(evt.FundAmount)
         };
         _rpcClient.CreateOrUpdateFundAccount(request);
         _log.Info($"Fund changes successfully for account {evt.AccountId}");
     }
     catch (RpcException ex)
     {
         _log.Error($"Failed to change fund value for account {evt.AccountId}", ex);
     }
 }
Esempio n. 2
0
        private bool HandleFundAccountNotFound(int accountID, Action postAction)
        {
            Account fundAccount = GetAccount(accountID);

            try
            {
                var request = new CreateOrUpdateFundAccountRequest
                {
                    AccountKey = fundAccount.GetAccountKey(),
                    ExtraFund  = Utilities.ToInt64Value(fundAccount.FundAmount)
                };
                _rpcClient.CreateOrUpdateFundAccount(request);
                _log.Info($"Fund account {accountID} created successfully");
                postAction();
                return(true);
            }
            catch (RpcException ex)
            {
                _log.Error($"Failed to create fund account {accountID}", ex);
                return(false);
            }
        }