mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-08-21 05:13:21 +00:00
Fixed various info-warnings and spelling issues
This commit is contained in:
@@ -10,9 +10,9 @@ namespace CryptoExchange.Net
|
||||
public static class LibraryHelpers
|
||||
{
|
||||
/// <summary>
|
||||
/// Client order id seperator
|
||||
/// Client order id separator
|
||||
/// </summary>
|
||||
public const string ClientOrderIdSeperator = "JK";
|
||||
public const string ClientOrderIdSeparator = "JK";
|
||||
|
||||
/// <summary>
|
||||
/// Apply broker id to a client order id
|
||||
@@ -20,25 +20,25 @@ namespace CryptoExchange.Net
|
||||
/// <param name="clientOrderId"></param>
|
||||
/// <param name="brokerId"></param>
|
||||
/// <param name="maxLength"></param>
|
||||
/// <param name="allowValueAdjustement"></param>
|
||||
/// <param name="allowValueAdjustment"></param>
|
||||
/// <returns></returns>
|
||||
public static string ApplyBrokerId(string? clientOrderId, string brokerId, int maxLength, bool allowValueAdjustement)
|
||||
public static string ApplyBrokerId(string? clientOrderId, string brokerId, int maxLength, bool allowValueAdjustment)
|
||||
{
|
||||
var reservedLength = brokerId.Length + ClientOrderIdSeperator.Length;
|
||||
var reservedLength = brokerId.Length + ClientOrderIdSeparator.Length;
|
||||
|
||||
if ((clientOrderId?.Length + reservedLength) > maxLength)
|
||||
return clientOrderId!;
|
||||
|
||||
if (!string.IsNullOrEmpty(clientOrderId))
|
||||
{
|
||||
if (allowValueAdjustement)
|
||||
clientOrderId = brokerId + ClientOrderIdSeperator + clientOrderId;
|
||||
if (allowValueAdjustment)
|
||||
clientOrderId = brokerId + ClientOrderIdSeparator + clientOrderId;
|
||||
|
||||
return clientOrderId!;
|
||||
}
|
||||
else
|
||||
{
|
||||
clientOrderId = ExchangeHelpers.AppendRandomString(brokerId + ClientOrderIdSeperator, maxLength);
|
||||
clientOrderId = ExchangeHelpers.AppendRandomString(brokerId + ClientOrderIdSeparator, maxLength);
|
||||
}
|
||||
|
||||
return clientOrderId;
|
||||
|
||||
Reference in New Issue
Block a user