public TradeType GdaxOrderSideToTradeType(GdaxOrderSide orderSide) { switch (orderSide) { case GdaxOrderSide.Buy: return(TradeType.Buy); case GdaxOrderSide.Sell: return(TradeType.Sell); default: throw new ArgumentOutOfRangeException(nameof(orderSide), orderSide, null); } }
public async Task <GdaxOrderResponse> AddOrder(string symbol, decimal amount, decimal price, GdaxOrderSide side, GdaxOrderType type, CancellationToken cancellationToken = default, EventHandler <SentHttpRequest> sentHttpRequestHandler = default, EventHandler <ReceivedHttpResponse> receivedHttpRequestHandler = default) { var response = await _restClient.ExecuteRestMethod <GdaxOrderResponse>( HttpMethod.Post, _newOrderRequestUrl, new GdaxNewOrderPost { ProductId = symbol, Size = amount, Price = price, Side = side, Type = type, }, cancellationToken, sentHttpRequestHandler, receivedHttpRequestHandler); return(response); }