1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-10-15 07:31:50 +00:00
Files
CryptoExchange.Net/CryptoExchange.Net/SharedApis/V2/PositionMode/SetPositionMode/SetPositionModeOptions.cs
T
Jkorf 876c2d27f7 wip
2026-09-10 13:26:33 +02:00

26 lines
1.2 KiB
C#

namespace CryptoExchange.Net.SharedApis
{
/// <summary>
/// Options for setting position mode
/// </summary>
public class SetPositionModeOptions : CapabilityOptions<SetPositionModeRequest, ISetPositionMode>
{
/// <inheritdoc />
public override string Description => "Set the futures position mode";
private static readonly RequestParameterDescription[] _defaultParameterRules = new[]
{
RequestParameterRule<SetPositionModeRequest>.Optional(x => x.TradingMode, "The trading mode to set the position mode for", TradingMode.PerpetualLinear),
RequestParameterRule<SetPositionModeRequest>.Optional(x => x.Symbol, "The symbol to set the position mode for", new SharedSymbol(TradingMode.PerpetualLinear, "ETH", "USDT")),
RequestParameterRule<SetPositionModeRequest>.Required(x => x.PositionMode, "The position mode to set", SharedPositionMode.OneWay),
};
/// <summary>
/// ctor
/// </summary>
public SetPositionModeOptions(string exchange) : base(exchange, true, nameof(ISetPositionMode.SetPositionModeAsync), _defaultParameterRules)
{
}
}
}