Exemplo n.º 1
0
 /// <summary>
 /// 
 /// </summary>
 /// 
 /// <param name="sender"></param>
 /// <param name="args"></param>
 /// 
 public void AfterRequest(object sender, ExchangeEvent<ExchangeRuntime> args)
 {
     if (logger.IsDebugEnabled)
     {
         logger.Debug("captured: After Request.");
     }
 }
Exemplo n.º 2
0
    void onBuyGoldClick(BaseController selectedBtn)
    {
        var exchangeRqst = windowController.getMarketExchange()[int.Parse(selectedBtn.name)];

        if (MAIN.getMain.rubins.getValue() >= exchangeRqst.From.Count)
        {
            ExchangeEvent.OnExchange(exchangeRqst.From, exchangeRqst.To, 1);
        }
        else
        {
            HUD.playAnimNeedMoreRubins();
        }
    }
Exemplo n.º 3
0
        /// <summary>
        /// 
        /// </summary>
        /// 
        /// <param name="sender"></param>
        /// <param name="args"></param>
        /// 
        public void AfterAllocation(object sender, ExchangeEvent<ExchangeRuntime> args)
        {
            try
            {
                //MessageSenderGateway gateway = GetObject("MessageSenderGateway") as MessageSenderGateway;
                //gateway.Send(args.AllocationAuditTrail);
            }
            catch (Exception exception)
            {
                // we capture exception because we dont want to interupt pipeline.
                if (logger.IsWarnEnabled)
                {
                    logger.Warn("Failed to send audit trail.", exception);
                }
            }

            if (logger.IsDebugEnabled)
            {
                logger.Debug("captured: After Allocation.");
            }
        }
Exemplo n.º 4
0
        private ExchangeEvent Map(IExchangeEventEntity entity)
        {
            var exchangeEvent = new ExchangeEvent();

            switch (entity.Type)
            {
            case ExchangeEventType.EthPurchase:
                exchangeEvent.EthAmount   = -entity.EthAmount;
                exchangeEvent.TokenAmount = entity.TokenAmount;
                break;

            case ExchangeEventType.TokenPurchase:
                exchangeEvent.EthAmount   = entity.EthAmount;
                exchangeEvent.TokenAmount = -entity.TokenAmount;
                break;

            case ExchangeEventType.AddLiquidity:
                exchangeEvent.EthAmount   = entity.EthAmount;
                exchangeEvent.TokenAmount = entity.TokenAmount;
                break;

            case ExchangeEventType.RemoveLiquidity:
                exchangeEvent.EthAmount   = -entity.EthAmount;
                exchangeEvent.TokenAmount = -entity.TokenAmount;
                break;

            default:
                throw new ArgumentException("Unknown event type", nameof(entity.Type));
            }

            exchangeEvent.Block     = entity.BlockNumber;
            exchangeEvent.Event     = entity.Type;
            exchangeEvent.Timestamp = entity.Timestamp.ToUnixTimestamp();
            exchangeEvent.Tx        = entity.TxHash;
            exchangeEvent.User      = entity.CallerAddress;
            exchangeEvent.Fee       = entity.EthFee;

            return(exchangeEvent);
        }
Exemplo n.º 5
0
 /// <summary>
 /// 
 /// </summary>
 /// 
 /// <param name="sender"></param>
 /// <param name="args"></param>
 /// 
 public void BeforeAllocation(object sender, ExchangeEvent<ExchangeRuntime> args)
 {
     if (logger.IsDebugEnabled)
     {
         logger.Debug("captured: Before Allocation.");
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// 
 /// </summary>
 /// 
 /// <param name="sender"></param>
 /// <param name="args"></param>
 /// 
 public void StrategyError(object sender, ExchangeEvent<Exception> args)
 {
     if (logger.IsDebugEnabled)
     {
         logger.Debug("captured: Strategy Error.");
     }
 }