Skip to content

Commit

Permalink
Added receiveWindow parameters new endpoints fixing signature errors
Browse files Browse the repository at this point in the history
  • Loading branch information
JKorf committed Jul 27, 2024
1 parent ad49a81 commit f07ee5c
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Binance.Net.UnitTests/BinanceRestIntegrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public async Task TestUsdFuturesAccount()
await RunAndCheckResult(client => client.UsdFuturesApi.Account.GetIncomeHistoryAsync(default, default, default, default, default, default, default), true);
await RunAndCheckResult(client => client.UsdFuturesApi.Account.GetBracketsAsync(default, default, default), true);
await RunAndCheckResult(client => client.UsdFuturesApi.Account.GetPositionAdlQuantileEstimationAsync(default, default, default), true);
await RunAndCheckResult(client => client.UsdFuturesApi.Account.GetAccountInfoAsync(default), true);
await RunAndCheckResult(client => client.UsdFuturesApi.Account.GetAccountInfoAsync(default, default), true);
await RunAndCheckResult(client => client.UsdFuturesApi.Account.GetBalancesAsync(default, default), true);
await RunAndCheckResult(client => client.UsdFuturesApi.Account.GetMultiAssetsModeAsync(default, default), true);
await RunAndCheckResult(client => client.UsdFuturesApi.Account.GetPositionInformationAsync(default, default, default), true);
Expand Down Expand Up @@ -227,7 +227,7 @@ public async Task TestUsdFuturesTrading()
await RunAndCheckResult(client => client.UsdFuturesApi.Trading.GetUserTradesAsync("ETHUSDT", default, default, default, default, default, default, default), true);
await RunAndCheckResult(client => client.UsdFuturesApi.Trading.GetOpenAlgoOrdersAsync(default, default), true);
await RunAndCheckResult(client => client.UsdFuturesApi.Trading.GetClosedAlgoOrdersAsync(default, default, default, default, default, default, default, default), true);
await RunAndCheckResult(client => client.UsdFuturesApi.Trading.GetPositionsAsync(default, default), true);
await RunAndCheckResult(client => client.UsdFuturesApi.Trading.GetPositionsAsync(default, default, default), true);
}

[Test]
Expand Down
20 changes: 12 additions & 8 deletions Binance.Net/Binance.Net.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1905,7 +1905,7 @@
<member name="M:Binance.Net.Clients.UsdFuturesApi.BinanceRestClientUsdFuturesApiAccount.StopUserStreamAsync(System.String,System.Threading.CancellationToken)">
<inheritdoc />
</member>
<member name="M:Binance.Net.Clients.UsdFuturesApi.BinanceRestClientUsdFuturesApiAccount.GetAccountInfoAsync(System.Threading.CancellationToken)">
<member name="M:Binance.Net.Clients.UsdFuturesApi.BinanceRestClientUsdFuturesApiAccount.GetAccountInfoAsync(System.Nullable{System.Int64},System.Threading.CancellationToken)">
<inheritdoc />
</member>
<member name="M:Binance.Net.Clients.UsdFuturesApi.BinanceRestClientUsdFuturesApiAccount.GetBalancesAsync(System.Nullable{System.Int64},System.Threading.CancellationToken)">
Expand Down Expand Up @@ -1953,10 +1953,10 @@
<member name="M:Binance.Net.Clients.UsdFuturesApi.BinanceRestClientUsdFuturesApiAccount.SetBnbBurnStatusAsync(System.Boolean,System.Nullable{System.Int64},System.Threading.CancellationToken)">
<inheritdoc />
</member>
<member name="M:Binance.Net.Clients.UsdFuturesApi.BinanceRestClientUsdFuturesApiAccount.GetSymbolConfigurationAsync(System.String,System.Threading.CancellationToken)">
<member name="M:Binance.Net.Clients.UsdFuturesApi.BinanceRestClientUsdFuturesApiAccount.GetSymbolConfigurationAsync(System.String,System.Nullable{System.Int64},System.Threading.CancellationToken)">
<inheritdoc />
</member>
<member name="M:Binance.Net.Clients.UsdFuturesApi.BinanceRestClientUsdFuturesApiAccount.GetAccountConfigurationAsync(System.Threading.CancellationToken)">
<member name="M:Binance.Net.Clients.UsdFuturesApi.BinanceRestClientUsdFuturesApiAccount.GetAccountConfigurationAsync(System.Nullable{System.Int64},System.Threading.CancellationToken)">
<inheritdoc />
</member>
<member name="T:Binance.Net.Clients.UsdFuturesApi.BinanceRestClientUsdFuturesApiExchangeData">
Expand Down Expand Up @@ -2121,7 +2121,7 @@
<member name="M:Binance.Net.Clients.UsdFuturesApi.BinanceRestClientUsdFuturesApiTrading.GetAlgoSubOrdersAsync(System.Int64,System.Nullable{System.Int32},System.Nullable{System.Int32},System.Nullable{System.Int64},System.Threading.CancellationToken)">
<inheritdoc />
</member>
<member name="M:Binance.Net.Clients.UsdFuturesApi.BinanceRestClientUsdFuturesApiTrading.GetPositionsAsync(System.String,System.Threading.CancellationToken)">
<member name="M:Binance.Net.Clients.UsdFuturesApi.BinanceRestClientUsdFuturesApiTrading.GetPositionsAsync(System.String,System.Nullable{System.Int64},System.Threading.CancellationToken)">
<inheritdoc />
</member>
<member name="T:Binance.Net.Clients.UsdFuturesApi.BinanceSocketClientUsdFuturesApi">
Expand Down Expand Up @@ -10814,11 +10814,12 @@
<param name="ct">Cancellation token</param>
<returns></returns>
</member>
<member name="M:Binance.Net.Interfaces.Clients.UsdFuturesApi.IBinanceRestClientUsdFuturesApiAccount.GetAccountInfoAsync(System.Threading.CancellationToken)">
<member name="M:Binance.Net.Interfaces.Clients.UsdFuturesApi.IBinanceRestClientUsdFuturesApiAccount.GetAccountInfoAsync(System.Nullable{System.Int64},System.Threading.CancellationToken)">
<summary>
Get account information, including position and balances
<para><a href="https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V3" /></para>
</summary>
<param name="receiveWindow">The receive window for which this request is active. When the request takes longer than this to complete the server will reject the request</param>
<param name="ct">Cancellation token</param>
</member>
<member name="M:Binance.Net.Interfaces.Clients.UsdFuturesApi.IBinanceRestClientUsdFuturesApiAccount.GetBalancesAsync(System.Nullable{System.Int64},System.Threading.CancellationToken)">
Expand Down Expand Up @@ -10985,19 +10986,21 @@
<param name="ct">Cancellation token</param>
<returns></returns>
</member>
<member name="M:Binance.Net.Interfaces.Clients.UsdFuturesApi.IBinanceRestClientUsdFuturesApiAccount.GetSymbolConfigurationAsync(System.String,System.Threading.CancellationToken)">
<member name="M:Binance.Net.Interfaces.Clients.UsdFuturesApi.IBinanceRestClientUsdFuturesApiAccount.GetSymbolConfigurationAsync(System.String,System.Nullable{System.Int64},System.Threading.CancellationToken)">
<summary>
Get user symbol configuration
<para><a href="https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config" /></para>
</summary>
<param name="symbol">Filter by symbol</param>
<param name="receiveWindow">The receive window for which this request is active. When the request takes longer than this to complete the server will reject the request</param>
<param name="ct">Cancellation token</param>
</member>
<member name="M:Binance.Net.Interfaces.Clients.UsdFuturesApi.IBinanceRestClientUsdFuturesApiAccount.GetAccountConfigurationAsync(System.Threading.CancellationToken)">
<member name="M:Binance.Net.Interfaces.Clients.UsdFuturesApi.IBinanceRestClientUsdFuturesApiAccount.GetAccountConfigurationAsync(System.Nullable{System.Int64},System.Threading.CancellationToken)">
<summary>
Get user account configuration
<para><a href="https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Config" /></para>
</summary>
<param name="receiveWindow">The receive window for which this request is active. When the request takes longer than this to complete the server will reject the request</param>
<param name="ct">Cancellation token</param>
</member>
<member name="T:Binance.Net.Interfaces.Clients.UsdFuturesApi.IBinanceRestClientUsdFuturesApiExchangeData">
Expand Down Expand Up @@ -11614,12 +11617,13 @@
<param name="ct">Cancellation token</param>
<returns></returns>
</member>
<member name="M:Binance.Net.Interfaces.Clients.UsdFuturesApi.IBinanceRestClientUsdFuturesApiTrading.GetPositionsAsync(System.String,System.Threading.CancellationToken)">
<member name="M:Binance.Net.Interfaces.Clients.UsdFuturesApi.IBinanceRestClientUsdFuturesApiTrading.GetPositionsAsync(System.String,System.Nullable{System.Int64},System.Threading.CancellationToken)">
<summary>
Get position information
<para><a href="https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V3" /></para>
</summary>
<param name="symbol">Filter by symbol</param>
<param name="receiveWindow">The receive window for which this request is active. When the request takes longer than this to complete the server will reject the request</param>
<param name="ct">Cancellation token</param>
</member>
<member name="T:Binance.Net.Interfaces.Clients.UsdFuturesApi.IBinanceSocketClientUsdFuturesApi">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,10 @@ public async Task<WebCallResult> StopUserStreamAsync(string listenKey, Cancellat
#region Get Account Info

/// <inheritdoc />
public async Task<WebCallResult<BinanceFuturesAccountInfoV3>> GetAccountInfoAsync(CancellationToken ct = default)
public async Task<WebCallResult<BinanceFuturesAccountInfoV3>> GetAccountInfoAsync(long? receiveWindow = null, CancellationToken ct = default)
{
var parameters = new ParameterCollection();
parameters.AddOptionalParameter("recvWindow", receiveWindow?.ToString(CultureInfo.InvariantCulture) ?? _baseClient.ClientOptions.ReceiveWindow.TotalMilliseconds.ToString(CultureInfo.InvariantCulture));
var request = _definitions.GetOrCreate(HttpMethod.Get, "/fapi/v3/account", BinanceExchange.RateLimiter.FuturesRest, 5, true);
var result = await _baseClient.SendAsync<BinanceFuturesAccountInfoV3>(request, parameters, ct).ConfigureAwait(false);
return result;
Expand Down Expand Up @@ -471,10 +472,11 @@ public async Task<WebCallResult> SetBnbBurnStatusAsync(bool feeBurn, long? recei
#region Get Symbol Configuration

/// <inheritdoc />
public async Task<WebCallResult<IEnumerable<BinanceSymbolConfiguration>>> GetSymbolConfigurationAsync(string? symbol = null, CancellationToken ct = default)
public async Task<WebCallResult<IEnumerable<BinanceSymbolConfiguration>>> GetSymbolConfigurationAsync(string? symbol = null, long? receiveWindow = null, CancellationToken ct = default)
{
var parameters = new ParameterCollection();
parameters.AddOptional("symbol", symbol);
parameters.AddOptionalParameter("recvWindow", receiveWindow?.ToString(CultureInfo.InvariantCulture) ?? _baseClient.ClientOptions.ReceiveWindow.TotalMilliseconds.ToString(CultureInfo.InvariantCulture));
var request = _definitions.GetOrCreate(HttpMethod.Get, "/fapi/v1/symbolConfig", BinanceExchange.RateLimiter.FuturesRest, 5, true);
var result = await _baseClient.SendAsync<IEnumerable<BinanceSymbolConfiguration>>(request, parameters, ct).ConfigureAwait(false);
return result;
Expand All @@ -485,9 +487,10 @@ public async Task<WebCallResult<IEnumerable<BinanceSymbolConfiguration>>> GetSym
#region Get Account Configuration

/// <inheritdoc />
public async Task<WebCallResult<BinanceFuturesAccountConfiguration>> GetAccountConfigurationAsync(CancellationToken ct = default)
public async Task<WebCallResult<BinanceFuturesAccountConfiguration>> GetAccountConfigurationAsync(long? receiveWindow = null, CancellationToken ct = default)
{
var parameters = new ParameterCollection();
parameters.AddOptionalParameter("recvWindow", receiveWindow?.ToString(CultureInfo.InvariantCulture) ?? _baseClient.ClientOptions.ReceiveWindow.TotalMilliseconds.ToString(CultureInfo.InvariantCulture));
var request = _definitions.GetOrCreate(HttpMethod.Get, "/fapi/v1/accountConfig", BinanceExchange.RateLimiter.FuturesRest, 5, true);
var result = await _baseClient.SendAsync<BinanceFuturesAccountConfiguration>(request, parameters, ct).ConfigureAwait(false);
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -656,10 +656,11 @@ public async Task<WebCallResult<BinanceAlgoSubOrderList>> GetAlgoSubOrdersAsync(
#region Get Positions

/// <inheritdoc />
public async Task<WebCallResult<IEnumerable<BinancePositionV3>>> GetPositionsAsync(string? symbol = null, CancellationToken ct = default)
public async Task<WebCallResult<IEnumerable<BinancePositionV3>>> GetPositionsAsync(string? symbol = null, long? receiveWindow = null, CancellationToken ct = default)
{
var parameters = new ParameterCollection();
parameters.AddOptional("symbol", symbol);
parameters.AddOptionalParameter("recvWindow", receiveWindow?.ToString(CultureInfo.InvariantCulture) ?? _baseClient.ClientOptions.ReceiveWindow.TotalMilliseconds.ToString(CultureInfo.InvariantCulture));
var request = _definitions.GetOrCreate(HttpMethod.Get, "/fapi/v3/positionRisk", BinanceExchange.RateLimiter.FuturesRest, 5, true);
var result = await _baseClient.SendAsync<IEnumerable<BinancePositionV3>>(request, parameters, ct).ConfigureAwait(false);
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,9 @@ Task<WebCallResult<IEnumerable<BinanceFuturesQuantileEstimation>>> GetPositionAd
/// Get account information, including position and balances
/// <para><a href="https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V3" /></para>
/// </summary>
/// <param name="receiveWindow">The receive window for which this request is active. When the request takes longer than this to complete the server will reject the request</param>
/// <param name="ct">Cancellation token</param>
Task<WebCallResult<BinanceFuturesAccountInfoV3>> GetAccountInfoAsync(CancellationToken ct = default);
Task<WebCallResult<BinanceFuturesAccountInfoV3>> GetAccountInfoAsync(long? receiveWindow = null, CancellationToken ct = default);

/// <summary>.
/// Gets account balances
Expand Down Expand Up @@ -299,15 +300,17 @@ Task<WebCallResult<IEnumerable<BinanceFuturesQuantileEstimation>>> GetPositionAd
/// <para><a href="https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config" /></para>
/// </summary>
/// <param name="symbol">Filter by symbol</param>
/// <param name="receiveWindow">The receive window for which this request is active. When the request takes longer than this to complete the server will reject the request</param>
/// <param name="ct">Cancellation token</param>
Task<WebCallResult<IEnumerable<BinanceSymbolConfiguration>>> GetSymbolConfigurationAsync(string? symbol = null, CancellationToken ct = default);
Task<WebCallResult<IEnumerable<BinanceSymbolConfiguration>>> GetSymbolConfigurationAsync(string? symbol = null, long? receiveWindow = null, CancellationToken ct = default);

/// <summary>
/// Get user account configuration
/// <para><a href="https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Config" /></para>
/// </summary>
/// <param name="receiveWindow">The receive window for which this request is active. When the request takes longer than this to complete the server will reject the request</param>
/// <param name="ct">Cancellation token</param>
Task<WebCallResult<BinanceFuturesAccountConfiguration>> GetAccountConfigurationAsync(CancellationToken ct = default);
Task<WebCallResult<BinanceFuturesAccountConfiguration>> GetAccountConfigurationAsync(long? receiveWindow = null, CancellationToken ct = default);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,9 @@ Task<WebCallResult<BinanceAlgoOrderResult>> PlaceTimeWeightedAveragePriceOrderAs
/// <para><a href="https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V3" /></para>
/// </summary>
/// <param name="symbol">Filter by symbol</param>
/// <param name="receiveWindow">The receive window for which this request is active. When the request takes longer than this to complete the server will reject the request</param>
/// <param name="ct">Cancellation token</param>
Task<WebCallResult<IEnumerable<BinancePositionV3>>> GetPositionsAsync(string? symbol = null, CancellationToken ct = default);
Task<WebCallResult<IEnumerable<BinancePositionV3>>> GetPositionsAsync(string? symbol = null, long? receiveWindow = null, CancellationToken ct = default);

}
}

0 comments on commit f07ee5c

Please sign in to comment.