Table of Contents

Method GetOrdersAsync

Namespace
WhalesSecret.TradeScriptLib.API.TradingV1
Assembly
WhalesSecret.TradeScriptLib.dll

GetOrdersAsync(DateOnly, CancellationToken)

Gets historical orders for a single date.

Task<IReadOnlyList<IOrder>> GetOrdersAsync(DateOnly utcDate, CancellationToken cancellationToken = default)

Parameters

utcDate DateOnly

UTC date for which to fetch orders.

cancellationToken CancellationToken

Cancellation token that allows the caller to cancel the operation.

Returns

Task<IReadOnlyList<IOrder>>

Order list, or an empty list if there were no orders on the given date.

Remarks

This method queries a Whale's Secret Core database storage as a cache source first, and if full trade data is not available in the database, then an exchange API request is sent to the exchange.

Exceptions

InvalidArgumentException

Thrown if options is null, or if utcDate is a future date.

OperationCanceledException

Thrown if the operation was cancelled, including cancellation during the shutdown.

NotConnectedTimeoutException

Thrown if the connection strategy associated with this instance is BlockUntilReconnectedOrTimeout with non-infinite timeout value and this timeout expired while the connection to the exchange is interrupted. That is, this exception does not limit the request itself, it rather limits the period of time that allows the client to recover from the interruption of the connection to the exchange.

NotConnectedException

Thrown if the connection strategy is FailInstantlyIfNotConnected and the connection to the exchange is interrupted.

OperationFailedException

Thrown if the request failed for an unknown reason with an unknown outcome.

NotAvailableException

Thrown if the connection does not support trading.

GetOrdersAsync(DateOnly, OrderFilterOptions, CancellationToken)

Gets historical orders satisfying given filter options for a single date.

Task<IReadOnlyList<IOrder>> GetOrdersAsync(DateOnly utcDate, OrderFilterOptions options, CancellationToken cancellationToken = default)

Parameters

utcDate DateOnly

UTC date for which to fetch orders.

options OrderFilterOptions

Options specifying which orders should be returned.

cancellationToken CancellationToken

Cancellation token that allows the caller to cancel the operation.

Returns

Task<IReadOnlyList<IOrder>>

Orders that satisfy the filter options, or an empty list if no orders satisfies the conditions.

Remarks

This method queries a Whale's Secret Core database storage as a cache source first, and if full trade data is not available in the database, then an exchange API request is sent to the exchange.

Exceptions

InvalidArgumentException

Thrown if options is null, or if utcDate is a future date.

OperationCanceledException

Thrown if the operation was cancelled, including cancellation during the shutdown.

NotConnectedTimeoutException

Thrown if the connection strategy associated with this instance is BlockUntilReconnectedOrTimeout with non-infinite timeout value and this timeout expired while the connection to the exchange is interrupted. That is, this exception does not limit the request itself, it rather limits the period of time that allows the client to recover from the interruption of the connection to the exchange.

NotConnectedException

Thrown if the connection strategy is FailInstantlyIfNotConnected and the connection to the exchange is interrupted.

OperationFailedException

Thrown if the request failed for an unknown reason with an unknown outcome.

NotAvailableException

Thrown if the connection does not support trading.