using CryptoExchange.Net.Objects;
using System;
using System.Collections.Generic;
using System.Linq;
namespace CryptoExchange.Net.SharedApis
{
///
/// Options for placing a new spot trigger order
///
public class PlaceSpotTriggerOrderOptions : EndpointOptions
{
///
/// When true the API holds the funds until the order is triggered or canceled. When true the funds will only be required when the order is triggered and will fail if the funds are not available at that time.
///
public bool HoldsFunds { get; set; }
///
/// ctor
///
public PlaceSpotTriggerOrderOptions(bool holdsFunds) : base(true)
{
HoldsFunds = holdsFunds;
}
///
/// Validate a request
///
public Error? ValidateRequest(
string exchange,
PlaceSpotTriggerOrderRequest request,
TradingMode? tradingMode,
TradingMode[] supportedApiTypes,
SharedQuantitySupport quantitySupport)
{
var quantityError = quantitySupport.Validate(request.OrderSide, request.OrderPrice == null ? SharedOrderType.Market : SharedOrderType.Limit, request.Quantity);
if (quantityError != null)
return quantityError;
return base.ValidateRequest(exchange, request, tradingMode, supportedApiTypes);
}
}
}