Example #1
0
        public async Task <Order> GetOrder(string orderId, string market)
        {
            if (_dryRun)
            {
                return(new Order());
            }

            var result = await _api.GetOrder(new Guid(orderId));

            if (!result.Success)
            {
                throw new Exception($"Bittrex API failure {result.Message}");
            }

            return(new Order
            {
                ExecutedQuantity = result.Result.Quantity - result.Result.QuantityRemaining,
                OrderId = result.Result.OrderUuid.ToString(),
                OriginalQuantity = result.Result.Quantity,
                Price = result.Result.Price,
                Status = (OrderStatus)(-1), // Not supported yet.
                Side = result.Result.OrderType.ToOrderSide(),
                StopPrice = result.Result.Limit,
                Symbol = result.Result.Exchange,
                Time = result.Result.TimeStamp,
                TimeInForce = result.Result.ImmediateOrCancel ? Enums.TimeInForce.ImmediateOrCancel : Enums.TimeInForce.GoodTilCanceled,
                Type = result.Result.OrderType.ToOrderType()
            });
        }
Example #2
0
        public async Task <HistoricAccountOrder> GetOrder(string orderId)
        {
            if (_dryRun)
            {
                return(new HistoricAccountOrder());
            }

            var result = await _api.GetOrder(new Guid(orderId));

            if (!result.Success)
            {
                throw new Exception($"Bittrex API failure {result.Message}");
            }

            return(result.Result);
        }