Method WaitForFillAsync
- Namespace
- WhalesSecret.TradeScriptLib.API.TradingV1.Orders
- Assembly
- WhalesSecret.TradeScriptLib.dll
WaitForFillAsync(CancellationToken)
Waits for a complete fill of the order.
Task<IReadOnlyList<FillData>> WaitForFillAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenCancellation token that allows the caller to cancel the operation.
Returns
- Task<IReadOnlyList<FillData>>
Collection of unconsumed fill data objects.
Remarks
If one calls the method for the second time, then the result will be an empty collection because there can be no new unconsumed fills.
Exceptions
- InvalidStateException
Thrown if the order was cancelled.
- 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.