public async Task <Order> GetOrderStatusAsync(long orderId, CancellationToken cancellationToken = default)
        {
            var orderStatusPost = new BitfinexOrderStatusPost
            {
                Request = OrderStatusRequestUrl,
                Nonce   = UnixTimeConverter.UnixTimeStampUtc().ToString(),
                OrderId = orderId
            };

            var response = await GetRestResponse <Order>(orderStatusPost, cancellationToken);

            return(response);
        }
        public BitfinexOrderStatusResponse GetOrderStatus(int orderId)
        {
            var orderStatusPost = new BitfinexOrderStatusPost();

            orderStatusPost.Request = OrderStatusRequestUrl;
            orderStatusPost.Nonce   = Common.UnixTimeStampUtc().ToString();
            orderStatusPost.OrderId = orderId;

            var client   = GetRestClient(OrderStatusRequestUrl);
            var response = GetRestResponse(client, orderStatusPost);
            var orderStatusResponseObj = JsonConvert.DeserializeObject <BitfinexOrderStatusResponse>(response.Content);

            Log.Trace(string.Format("BitfinexApi.GetOrderStatus(): OrderId: {0} Status: {1}", orderId, orderStatusResponseObj.ToString()));

            return(orderStatusResponseObj);
        }
Esempio n. 3
0
        public BitfinexOrderStatusResponse GetOrderStatus(int orderId)
        {
            var orderStatusPost = new BitfinexOrderStatusPost
            {
                Request = OrderStatusRequestUrl,
                Nonce   = Common.UnixTimeStampUtc().ToString(CultureInfo.InvariantCulture),
                OrderId = orderId
            };

            var response = GetRestResponse(orderStatusPost);
            var orderStatusResponseObj = JsonConvert.DeserializeObject <BitfinexOrderStatusResponse>(response);

            Log.Info("OrderId: {0} Status: {1}", orderId, orderStatusResponseObj);

            return(orderStatusResponseObj);
        }
        public virtual BitfinexOrderStatusResponse CancelOrder(int orderId)
        {
            var cancelPost = new BitfinexOrderStatusPost();

            cancelPost.Request = OrderCancelRequestUrl;

            cancelPost.Nonce   = Common.UnixTimeStampUtc().ToString();
            cancelPost.OrderId = orderId;

            var client   = GetRestClient(cancelPost.Request);
            var response = GetRestResponse(client, cancelPost);
            var orderCancelResponseObj = JsonConvert.DeserializeObject <BitfinexOrderStatusResponse>(response.Content);

            Log.Trace(string.Format("BitfinexApi.CancelOrder():  OrderId: {0}, Response From Exchange: {1}", orderId, orderCancelResponseObj.ToString()));

            return(orderCancelResponseObj);
        }