Method GetNewerExchangeAccountInformationAsync
- Namespace
- WhalesSecret.TradeScriptLib.API.TradingV1
- Assembly
- WhalesSecret.TradeScriptLib.dll
GetNewerExchangeAccountInformationAsync(string?, CancellationToken)
Gets an exchange account information for the given sub-account on this subscription that is newer than the last consumed exchange account information returned by this method. If no such information is available, the method waits until a new update comes.
Task<ExchangeAccountInformation> GetNewerExchangeAccountInformationAsync(string? subAccount = null, CancellationToken cancellationToken = default)
Parameters
subAccount
stringName of a sub-account, or
null
for the primary trading account of the exchange or in case the exchange does not support sub-accounts.cancellationToken
CancellationTokenCancellation token that allows the caller to cancel the operation.
Returns
- Task<ExchangeAccountInformation>
Latest exchange account information that has timestamp greater than the last consumed exchange account information.
Exceptions
- 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.
- NotFoundException
Thrown if the method is called after the ticker subscription was disposed.