Skip to content

Commit

Permalink
Fixed GetSubscriptionTransactionHistoryAsync response and page parame…
Browse files Browse the repository at this point in the history
…ters
  • Loading branch information
JKorf committed Oct 18, 2024
1 parent 0305f46 commit 329638b
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
GET
/sapi/v1/lending/auto-invest/history/list
true
{
"total": 1,
"list":
[
{
"id":1111,
Expand All @@ -22,4 +25,6 @@ true
"executionType":"RECURRING",
"subscriptionCycle": "WEEKLY"
}
]
]

}
15 changes: 15 additions & 0 deletions Binance.Net/Binance.Net.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15409,6 +15409,21 @@
Asset value in USD
</summary>
</member>
<member name="T:Binance.Net.Objects.Models.Spot.AutoInvest.BinanceAutoInvestPlanTransactions">
<summary>
Transactions
</summary>
</member>
<member name="P:Binance.Net.Objects.Models.Spot.AutoInvest.BinanceAutoInvestPlanTransactions.Total">
<summary>
Total
</summary>
</member>
<member name="P:Binance.Net.Objects.Models.Spot.AutoInvest.BinanceAutoInvestPlanTransactions.List">
<summary>
Results
</summary>
</member>
<member name="T:Binance.Net.Objects.Models.Spot.AutoInvest.BinanceAutoInvestPlanTransaction">
<summary>
Plan transaction info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Binance.Net.Enums;
using Binance.Net.Interfaces.Clients.GeneralApi;
using Binance.Net.Objects.Models;
using Binance.Net.Objects.Models.Spot;
using Binance.Net.Objects.Models.Spot.AutoInvest;
using Binance.Net.Objects.Models.Spot.Loans;

Expand Down Expand Up @@ -192,18 +193,18 @@ public async Task<WebCallResult<BinanceAutoInvestRedemptionResult>> RedeemIndexL
#region Get Subscription Transaction History

/// <inheritdoc />
public async Task<WebCallResult<IEnumerable<BinanceAutoInvestPlanTransaction>>> GetSubscriptionTransactionHistoryAsync(long? planId = null, DateTime? startTime = null, DateTime? endTime = null, string? targetAsset = null, AutoInvestPlanType? planType = null, int? page = null, int? pageSize = null, CancellationToken ct = default)
public async Task<WebCallResult<BinanceAutoInvestPlanTransactions>> GetSubscriptionTransactionHistoryAsync(long? planId = null, DateTime? startTime = null, DateTime? endTime = null, string? targetAsset = null, AutoInvestPlanType? planType = null, int? page = null, int? pageSize = null, CancellationToken ct = default)
{
var parameters = new ParameterCollection();
parameters.AddOptional("planId", planId);
parameters.AddOptionalMillisecondsString("startTime", startTime);
parameters.AddOptionalMillisecondsString("endTime", endTime);
parameters.AddOptional("targetAsset", targetAsset);
parameters.AddOptionalEnum("planType", planType);
parameters.AddOptional("page", page);
parameters.AddOptional("pageSize", pageSize);
parameters.AddOptional("current", page);
parameters.AddOptional("size", pageSize);
var request = _definitions.GetOrCreate(HttpMethod.Get, "/sapi/v1/lending/auto-invest/history/list", BinanceExchange.RateLimiter.SpotRestIp, 1, true);
var result = await _baseClient.SendAsync<IEnumerable<BinanceAutoInvestPlanTransaction>>(request, parameters, ct).ConfigureAwait(false);
var result = await _baseClient.SendAsync<BinanceAutoInvestPlanTransactions>(request, parameters, ct).ConfigureAwait(false);
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public interface IBinanceRestClientGeneralApiAutoInvest
/// <param name="page">Current page</param>
/// <param name="pageSize">Page size</param>
/// <param name="ct">Cancellation token</param>
Task<WebCallResult<IEnumerable<BinanceAutoInvestPlanTransaction>>> GetSubscriptionTransactionHistoryAsync(long? planId = null, DateTime? startTime = null, DateTime? endTime = null, string? targetAsset = null, AutoInvestPlanType? planType = null, int? page = null, int? pageSize = null, CancellationToken ct = default);
Task<WebCallResult<BinanceAutoInvestPlanTransactions>> GetSubscriptionTransactionHistoryAsync(long? planId = null, DateTime? startTime = null, DateTime? endTime = null, string? targetAsset = null, AutoInvestPlanType? planType = null, int? page = null, int? pageSize = null, CancellationToken ct = default);

/// <summary>
/// Get one time transaction status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@

namespace Binance.Net.Objects.Models.Spot.AutoInvest
{
/// <summary>
/// Transactions
/// </summary>
public record BinanceAutoInvestPlanTransactions
{
/// <summary>
/// Total
/// </summary>
[JsonPropertyName("total")]
public int Total { get; set; }
/// <summary>
/// Results
/// </summary>
[JsonPropertyName("list")]
public IEnumerable<BinanceAutoInvestPlanTransaction> List { get; set; } = Array.Empty<BinanceAutoInvestPlanTransaction>();
}

/// <summary>
/// Plan transaction info
/// </summary>
Expand Down

0 comments on commit 329638b

Please sign in to comment.