1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-10-14 07:01:46 +00:00
This commit is contained in:
Jkorf
2026-08-31 11:23:53 +02:00
parent 32e74e9bc4
commit 5f101e3b88
4 changed files with 12 additions and 9 deletions
@@ -28,13 +28,13 @@ namespace CryptoExchange.Net.SharedApis
/// Use <see cref="CapabilityOptions.RequiredExchangeParameters"/> and <see cref="CapabilityOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br /> /// Use <see cref="CapabilityOptions.RequiredExchangeParameters"/> and <see cref="CapabilityOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary> /// </summary>
GetAssetsOptions GetAssetsOptions { get; } GetAllAssetsOptions GetAllAssetsOptions { get; }
/// <summary> /// <summary>
/// Get info on all assets the exchange supports, see <see cref="GetAssetsOptions"/> for request options and exchange specific required/optional parameters. <br /> /// Get info on all assets the exchange supports, see <see cref="GetAllAssetsOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary> /// </summary>
/// <param name="request">Request info</param> /// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param> /// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedAsset[]>> GetAssetsAsync(GetAssetsRequest request, CancellationToken ct = default); Task<HttpResult<SharedAsset[]>> GetAllAssetsAsync(GetAssetsRequest request, CancellationToken ct = default);
} }
} }
@@ -17,13 +17,13 @@ namespace CryptoExchange.Net.SharedApis
/// Use <see cref="CapabilityOptions.RequiredRequestParameters"/>, <see cref="CapabilityOptions.RequiredExchangeParameters"/> and <see cref="CapabilityOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br /> /// Use <see cref="CapabilityOptions.RequiredRequestParameters"/>, <see cref="CapabilityOptions.RequiredExchangeParameters"/> and <see cref="CapabilityOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary> /// </summary>
GetAssetsOptions GetAssetsOptions { get; } GetAllAssetsOptions GetAllAssetsOptions { get; }
/// <summary> /// <summary>
/// Get info on all assets the exchange supports, see <see cref="GetAssetsOptions"/> for request options and exchange specific required/optional parameters. <br /> /// Get info on all assets the exchange supports, see <see cref="GetAllAssetsOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary> /// </summary>
/// <param name="request">Request info</param> /// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param> /// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedAsset[]>> GetAssetsAsync(GetAssetsRequest request, CancellationToken ct = default); Task<HttpResult<SharedAsset[]>> GetAllAssetsAsync(GetAssetsRequest request, CancellationToken ct = default);
} }
} }
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
/// <summary> /// <summary>
/// Options for requesting assets info /// Options for requesting assets info
/// </summary> /// </summary>
public class GetAssetsOptions : CapabilityOptions<GetAssetsRequest, IGetAllAssetsEndpoint> public class GetAllAssetsOptions : CapabilityOptions<GetAssetsRequest, IGetAllAssetsEndpoint>
{ {
/// <inheritdoc /> /// <inheritdoc />
public override string Description => "Retrieve basic info for all assets and the networks they support for withdrawals/deposits"; public override string Description => "Retrieve basic info for all assets and the networks they support for withdrawals/deposits";
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
/// <summary> /// <summary>
/// ctor /// ctor
/// </summary> /// </summary>
public GetAssetsOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetAllAssetsEndpoint.GetAssetsAsync)) public GetAllAssetsOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetAllAssetsEndpoint.GetAllAssetsAsync))
{ {
} }
} }
@@ -43,7 +43,7 @@ namespace CryptoExchange.Net.Trackers.UserData
IGetClosedSpotOrdersEndpoint closedOrderRestClient, IGetClosedSpotOrdersEndpoint closedOrderRestClient,
ISubscribeSpotOrdersOperation? subscribeSpotOrdersOperation, ISubscribeSpotOrdersOperation? subscribeSpotOrdersOperation,
IGetSpotUserTradeHistoryEndpoint getSpotUserTradeHistoryRestClient, IGetSpotUserTradeHistoryEndpoint? getSpotUserTradeHistoryRestClient,
ISubscribeUserTradesOperation? userTradeSocketClient, ISubscribeUserTradesOperation? userTradeSocketClient,
string? userIdentifier, string? userIdentifier,
@@ -66,6 +66,9 @@ namespace CryptoExchange.Net.Trackers.UserData
if (config.TrackTrades) if (config.TrackTrades)
{ {
if (getSpotUserTradeHistoryRestClient == null)
throw new ArgumentException("Trade tracking is enabled, but no user trade API client is available");
var tradeTracker = new SpotUserTradeTracker(logger, SymbolTracker, getSpotUserTradeHistoryRestClient, userTradeSocketClient, config.UserTradesConfig, config.TrackedSymbols, config.OnlyTrackProvidedSymbols, exchangeParameters); var tradeTracker = new SpotUserTradeTracker(logger, SymbolTracker, getSpotUserTradeHistoryRestClient, userTradeSocketClient, config.UserTradesConfig, config.TrackedSymbols, config.OnlyTrackProvidedSymbols, exchangeParameters);
Trades = tradeTracker; Trades = tradeTracker;
trackers.Add(tradeTracker); trackers.Add(tradeTracker);