Method CreateTickerSubscriptionsAsync
- Namespace
- WhalesSecret.TradeScriptLib.API.TradingV1
- Assembly
- WhalesSecret.TradeScriptLib.dll
CreateTickerSubscriptionsAsync(IReadOnlyList<SymbolPair>)
Sends a subscription request to receive ticker updates from the exchange.
Task<ITickerSubscriptionSet> CreateTickerSubscriptionsAsync(IReadOnlyList<SymbolPair> symbolPairs)
Parameters
symbolPairs
IReadOnlyList<SymbolPair>Symbol pairs to subscribe.
Returns
- Task<ITickerSubscriptionSet>
Ticker subscription set wrapping a collection of ITickerSubscriptions with convenience methods.
Remarks
Method can be called in parallel fashion but the symbol pairs of the parallel calls are subscribed one set at the time given internal locking mechanism.
Exceptions
- AlreadyExistsException
Thrown if at least one of the given symbol pairs is already subscribed or its subscription is in progress.
- NotConnectedException
Thrown if the request could not be sent to the exchange.
- NotAvailableException
Thrown if the symbol pair is not supported on the exchange or if the used connection has not been created with MarketData support.
- ExchangeResponseTimeoutException
Thrown if the exchange does not respond in timely manner.
- InvalidExchangeResponseException
Thrown if the exchange responded with invalid response.
- ExchangeIsUnderMaintenanceException
Thrown if the exchange is in the maintenance mode and does not accept new requests.
- ApiRequestLimitReachedException
Thrown if the exchange rejected to create a new data subscription due to an API rate limit.
- InvalidRequestDataException
Thrown if the exchange rejected to accept a new data subscription because some value in the subscription request is malformed or otherwise invalid.
- 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.
- OperationFailedException
Thrown if the request failed for an unknown reason with an unknown outcome.
- MalfunctionException
Thrown if an internal unexpected error occurred.
- InvalidArgumentException
Thrown if
symbolPairs
isnull
, an empty collection, or contains a single symbol pair multiple times.