Example #1
0
        public async Task <SubmitPersonalOrderResponse> SubmitPersonalOrderAsync(PersonalOrderParams orderParams)
        {
            var request  = new SubmitPersonalOrderRequest(orderParams);
            var response = await this.GetResponse(request);

            return(new SubmitPersonalOrderResponse(response));
        }
Example #2
0
 /// <summary>
 /// ability to create a preliminary order in memory prior to submission
 /// </summary>
 /// <param name=""></param>
 /// <param name=""></param>
 public PersonalOrder(PersonalOrderParams orderParams, OrderStatus status) : this()
 {
     if (orderParams.ClientOrderId == null)
     {
         throw new ArgumentNullException("orderParams.ClientOrderId");
     }
     this.ServerOrderId = orderParams.ClientOrderId.Value;
     this.Price         = orderParams.Price;
     this.Size          = orderParams.Size;
     this.ProductId     = orderParams.ProductId;
     this.Side          = orderParams.Side;
     this.Type          = orderParams.Type;
     this.TimeInForce   = orderParams.TimeInForce;
     this.PostOnly      = orderParams.PostOnly != null ? orderParams.PostOnly.Value : false;
     this.CreatedAt     = DateTime.UtcNow;
 }
Example #3
0
        public SubmitPersonalOrderRequest(PersonalOrderParams orderParams) : base("POST")
        {
            var urlFormat = String.Format("/orders");

            this.RequestUrl  = urlFormat;
            this.RequestBody = JsonConvert.SerializeObject(orderParams,
                                                           Newtonsoft.Json.Formatting.None,
                                                           new JsonSerializerSettings
            {
                NullValueHandling = NullValueHandling.Ignore,
                Converters        = new List <JsonConverter> {
                    new StringEnumConverter {
                        CamelCaseText = true
                    }
                },
                ContractResolver = new LowercaseContractResolver()
            });
        }