Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding source address filter to deposit request history endpoint #1409

Merged
merged 3 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Binance.Net.UnitTests/BinanceRestIntegrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public async Task TestSpotAccount()
await RunAndCheckResult(client => client.SpotApi.Account.GetFiatDepositWithdrawHistoryAsync(Enums.TransactionType.Withdrawal, default, default, default, default, default, default), true);
await RunAndCheckResult(client => client.SpotApi.Account.GetWithdrawalHistoryAsync(default, default, default, default, default, default, default, default, default), true);
await RunAndCheckResult(client => client.SpotApi.Account.GetWithdrawalAddressesAsync(default, default), true);
await RunAndCheckResult(client => client.SpotApi.Account.GetDepositHistoryAsync(default, default, default, default, default, default, default, default), true);
await RunAndCheckResult(client => client.SpotApi.Account.GetDepositHistoryAsync(default, default, default, default, default, default, default, default, default), true);
await RunAndCheckResult(client => client.SpotApi.Account.GetDailySpotAccountSnapshotAsync(default, default, default, default, default), true);
await RunAndCheckResult(client => client.SpotApi.Account.GetDailyFutureAccountSnapshotAsync(default, default, default, default, default), true);
await RunAndCheckResult(client => client.SpotApi.Account.GetAccountStatusAsync(default, default), true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public async Task<WebCallResult<IEnumerable<BinanceWithdrawalAddress>>> GetWithd

#region Deposit history
/// <inheritdoc />
public async Task<WebCallResult<IEnumerable<BinanceDeposit>>> GetDepositHistoryAsync(string? asset = null, DepositStatus? status = null, DateTime? startTime = null, DateTime? endTime = null, int? offset = null, int? limit = null, int? receiveWindow = null, CancellationToken ct = default)
public async Task<WebCallResult<IEnumerable<BinanceDeposit>>> GetDepositHistoryAsync(string? asset = null, DepositStatus? status = null, DateTime? startTime = null, DateTime? endTime = null, int? offset = null, int? limit = null, int? receiveWindow = null, bool includeSource = false, CancellationToken ct = default)
{
var parameters = new ParameterCollection();
parameters.AddOptionalParameter("coin", asset);
Expand All @@ -153,6 +153,7 @@ public async Task<WebCallResult<IEnumerable<BinanceDeposit>>> GetDepositHistoryA
parameters.AddOptionalParameter("startTime", DateTimeConverter.ConvertToMilliseconds(startTime));
parameters.AddOptionalParameter("endTime", DateTimeConverter.ConvertToMilliseconds(endTime));
parameters.AddOptionalParameter("recvWindow", receiveWindow?.ToString(CultureInfo.InvariantCulture) ?? _baseClient.ClientOptions.ReceiveWindow.TotalMilliseconds.ToString(CultureInfo.InvariantCulture));
parameters.AddOptionalParameter("includeSource", includeSource.ToString());

var request = _definitions.GetOrCreate(HttpMethod.Get, "sapi/v1/capital/deposit/hisrec", BinanceExchange.RateLimiter.SpotRestIp, 1, true);
return await _baseClient.SendAsync<IEnumerable<BinanceDeposit>>(request, parameters, ct).ConfigureAwait(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,10 @@ Task<WebCallResult<IEnumerable<BinanceFuturesAccountSnapshot>>> GetDailyFutureAc
/// <param name="startTime">Filter start time from</param>
/// <param name="endTime">Filter end time till</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="includeSource">Include source address to response</param>
/// <param name="ct">Cancellation token</param>
/// <returns>List of deposits</returns>
Task<WebCallResult<IEnumerable<BinanceDeposit>>> GetDepositHistoryAsync(string? asset = null, DepositStatus? status = null, DateTime? startTime = null, DateTime? endTime = null, int? offset = null, int? limit = null, int? receiveWindow = null, CancellationToken ct = default);
Task<WebCallResult<IEnumerable<BinanceDeposit>>> GetDepositHistoryAsync(string? asset = null, DepositStatus? status = null, DateTime? startTime = null, DateTime? endTime = null, int? offset = null, int? limit = null, int? receiveWindow = null, bool includeSource = false, CancellationToken ct = default);

/// <summary>
/// Gets the deposit address for an asset
Expand Down
6 changes: 6 additions & 0 deletions Binance.Net/Objects/Models/Spot/BinanceDepositList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,11 @@ public record BinanceDeposit
[JsonPropertyName("walletType")]
[JsonConverter(typeof(EnumConverter))]
public WalletType WalletType { get; set; }

/// <summary>
/// Transaction source address. Note: Please note that the source address returned may not be accurate due to network-specific characteristics. If multiple source addresses found, only the first address will be returned
/// </summary>
[JsonPropertyName("sourceAddress")]
public string? SourceAddress { get; set; }
}
}
Loading