mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-10-15 23:50:54 +00:00
33 lines
1.2 KiB
C#
33 lines
1.2 KiB
C#
using CryptoExchange.Net.Objects;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace CryptoExchange.Net.SharedApis
|
|
{
|
|
/// <summary>
|
|
/// Options for canceling a spot order
|
|
/// </summary>
|
|
public class CancelSpotOrderByClientOrderIdOptions : CapabilityOptions<CancelOrderRequest, ICancelSpotOrderByClientOrderIdRest>
|
|
{
|
|
/// <inheritdoc />
|
|
public override string Description => "Cancel a spot order by its client order id";
|
|
|
|
/// <summary>
|
|
/// ctor
|
|
/// </summary>
|
|
public CancelSpotOrderByClientOrderIdOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelSpotOrderByClientOrderIdRest.CancelSpotOrderByClientOrderIdAsync))
|
|
{
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public override Error? ValidateRequest(CancelOrderRequest request, ICancelSpotOrderByClientOrderIdRest client)
|
|
{
|
|
if (request.Symbol!.TradingMode != TradingMode.Spot)
|
|
return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot");
|
|
|
|
return base.ValidateRequest(request, client);
|
|
}
|
|
}
|
|
}
|