Ejemplo n.º 1
0
 public SubmitPersonalOrderResponse(ExchangeResponse response, SubmitPersonalOrderRequest request) : base(response)
 {
     if (response.ErrorMessage != null)
     {
         Message = response.ErrorMessage;
     }
     else
     {
         var json = response.ContentBody;
         try
         {
             var jToken = JToken.Parse(json);
             //{"message":"Insufficient funds"}
             var msgToken = jToken["message"];
             if (msgToken != null)
             {
                 Message = "SubmitPersonalOrderResponse: " + msgToken.Value <string>() + ", request: " + request.RequestUrl;
             }
             else
             {
                 SubmittedOrder = new PersonalOrder(jToken);
             }
         }
         catch (Newtonsoft.Json.JsonReaderException e)
         {
             Message = "Error w/ SubmitPersonalOrderResponse() " + e.Message + ": " + json;
         }
     }
 }
        public SubmitPersonalOrderResponse(ExchangeResponse response) : base(response)
        {
            var json   = response.ContentBody;
            var jToken = JToken.Parse(json);

            //{"message":"Insufficient funds"}
            var msgToken = jToken["message"];

            if (msgToken != null)
            {
                Message = "SubmitPersonalOrderResponse: " + msgToken.Value <string>();
            }
            else
            {
                SubmittedOrder = new PersonalOrder(jToken);
            }
        }
Ejemplo n.º 3
0
        public GetPersonalOrderResponse(ExchangeResponse response) : base(response)
        {
            this.ContentBody = response.ContentBody;
            var jToken = JToken.Parse(ContentBody);

            //{"message":"NotFound"}
            var msgToken = jToken["message"];

            if (msgToken != null)
            {
                Message = "GetPersonalOrderResponse: " + msgToken.Value <string>();
            }
            else
            {
                FoundOrder = new PersonalOrder(jToken);
            }
        }
Ejemplo n.º 4
0
 public PersonalOrder(PersonalOrder anotherPersonalOrder) : this()
 {
     this.ServerOrderId = anotherPersonalOrder.ServerOrderId;
     this.Price         = anotherPersonalOrder.Price;
     this.Size          = anotherPersonalOrder.Size;
     this.ProductId     = anotherPersonalOrder.ProductId;
     this.Side          = anotherPersonalOrder.Side;
     this.Type          = anotherPersonalOrder.Type;
     this.TimeInForce   = anotherPersonalOrder.TimeInForce;
     this.PostOnly      = anotherPersonalOrder.PostOnly;
     this.CreatedAt     = anotherPersonalOrder.CreatedAt;
     this.FilledFees    = anotherPersonalOrder.FilledFees;
     this.FilledSize    = anotherPersonalOrder.FilledSize;
     this.ExecutedValue = anotherPersonalOrder.ExecutedValue;
     this.Status        = anotherPersonalOrder.Status;
     this.Settled       = anotherPersonalOrder.Settled;
 }