Exemplo n.º 1
0
 public VoSMarketOrder(VoSOrderId orderId,
                       OrderType orderType, decimal price, decimal totalQuantity,
                       decimal filled, DateTime createdAt, DateTime updatedAt)
     : base(orderType, price, totalQuantity - filled)
 {
     this.OrderId       = orderId;
     this.TotalQuantity = totalQuantity;
     this.Filled        = filled;
     this.CreatedAt     = createdAt;
     this.UpdatedAt     = updatedAt;
 }
 public VoSMarketOrder(VoSOrderId orderId,
     OrderType orderType, decimal price, decimal totalQuantity,
     decimal filled, DateTime createdAt, DateTime updatedAt)
     : base(orderType, price, totalQuantity - filled)
 {
     this.OrderId = orderId;
     this.TotalQuantity = totalQuantity;
     this.Filled = filled;
     this.CreatedAt = createdAt;
     this.UpdatedAt = updatedAt;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Make a call to a private API method.
        /// </summary>
        /// <param name="method">The method to call on the VoS API</param>
        /// <param name="quoteCurrencyCode">A quote currency code to append to the URL</param>
        /// <returns>Parsed JSON returned from VoS</returns>
        private async Task <T> CallPrivate <T>(Method method, VoSOrderId orderId)
            where T : JToken
        {
            FormUrlEncodedContent request = new FormUrlEncodedContent(new[]
            {
                new KeyValuePair <string, string>(PARAMETER_NONCE, this.GetNextNonce()),
                orderId.KeyValuePair
            });

            return(await CallPrivate <T>(method, request));
        }
Exemplo n.º 4
0
        public static VoSMarketOrder Parse(JObject orderJson)
        {
            VoSOrderId orderId   = new VoSOrderId(orderJson.Value <int>("id"));
            OrderType  orderType = orderJson.Value <bool>("bid")
                ? OrderType.Buy
                : OrderType.Sell;

            return(new VoSMarketOrder(orderId, orderType,
                                      (orderJson.Value <long>("rate") * VoSExchange.PRICE_UNIT), orderJson.Value <decimal>("amount"),
                                      orderJson.Value <decimal>("filled"), orderJson.Value <DateTime>("created_at"),
                                      orderJson.Value <DateTime>("updated_at")));
        }
        public static VoSMarketOrder Parse(JObject orderJson)
        {
            VoSOrderId orderId = new VoSOrderId(orderJson.Value<int>("id"));
            OrderType orderType = orderJson.Value<bool>("bid")
                ? OrderType.Buy
                : OrderType.Sell;

            return new VoSMarketOrder(orderId, orderType,
                (orderJson.Value<long>("rate") * VoSExchange.PRICE_UNIT), orderJson.Value<decimal>("amount"),
                orderJson.Value<decimal>("filled"), orderJson.Value<DateTime>("created_at"),
                orderJson.Value<DateTime>("updated_at"));
        }