Ejemplo n.º 1
0
        private async Task WaitForOrder(ExchangeOrderResult order, IExchangeAPI api)
        {
            while (order.Result == ExchangeAPIOrderResult.Pending)
            {
                Console.Clear();
                Console.WriteLine(order);

                await Task.Delay(IntervalMs)
                .ConfigureAwait(false);

                order = await api.GetOrderDetailsAsync(order.OrderId, order.MarketSymbol);
            }

            Console.Clear();
            Console.WriteLine(order);
            Console.WriteLine($"Your order changed the status to \"{order.Result}\"");
        }
        public static void RunGetOrderDetails(Dictionary <string, string> dict)
        {
            RequireArgs(dict, "exchangeName", "orderId");

            string       exchangeName = dict["exchangeName"];
            IExchangeAPI api          = ExchangeAPI.GetExchangeAPI(exchangeName);
            string       orderId      = dict["orderId"];

            Authenticate(api);

            string marketSymbol = null;

            if (dict.ContainsKey("marketSymbol"))
            {
                marketSymbol = dict["marketSymbol"];
            }

            var orderDetails = api.GetOrderDetailsAsync(orderId, marketSymbol).Sync();

            Console.WriteLine(orderDetails);

            Console.Write("Press enter to exit..");
            Console.ReadLine();
        }