コード例 #1
0
        public void Connect()
        {
            if (UpdateExchangeState != null)
            {
                // Register callback for uE (exchange state delta) events
                _hubProxy.On("uE", exchangeStateDelta => UpdateExchangeState?.Invoke(BittrexSocketCommand.IncrementalUpdate, null, exchangeStateDelta));
            }

            if (UpdateOrderState != null)
            {
                // Register callback for uO (order status change) events
                _hubProxy.On("uO", orderStateDelta => UpdateOrderState?.Invoke(BittrexSocketCommand.IncrementalUpdate, null, orderStateDelta));
            }

            if (UpdateBalanceState != null)
            {
                // Register callback for uB (balance status change) events
                _hubProxy.On("uB", balanceStateDelta => UpdateBalanceState?.Invoke(BittrexSocketCommand.IncrementalUpdate, null, balanceStateDelta));
            }

            if (UpdateSummaryState != null)
            {
                // Register callback for uB (balance status change) events
                _hubProxy.On("uS", summaryDelta => UpdateSummaryState?.Invoke(BittrexSocketCommand.IncrementalUpdate, null, summaryDelta));
            }
            _hubConnection.Start().Wait();
        }
コード例 #2
0
        public void Connect()
        {
            if (UpdateExchangeState != null)
            {
                // Register callback for uE (exchange state delta) events
                OnExchangeStateDelta = _hubProxy.On("uE", exchangeStateDelta => {
                    LastActiveTime = DateTime.Now;
                    UpdateExchangeState?.Invoke(SignalSocketCommand.IncrementalUpdate, null, exchangeStateDelta);
                });
            }

            if (UpdateOrderState != null)
            {
                // Register callback for uO (order status change) events
                OnOrderStateDelta = _hubProxy.On("uO", orderStateDelta => {
                    LastActiveTime = DateTime.Now;
                    UpdateOrderState?.Invoke(SignalSocketCommand.IncrementalUpdate, null, orderStateDelta);
                });
            }

            if (UpdateBalanceState != null)
            {
                // Register callback for uB (balance status change) events
                OnBalanceStateDelta = _hubProxy.On("uB", balanceStateDelta => {
                    LastActiveTime = DateTime.Now;
                    UpdateBalanceState?.Invoke(SignalSocketCommand.IncrementalUpdate, null, balanceStateDelta);
                });
            }

            if (UpdateSummaryState != null)
            {
                // Register callback for uB (balance status change) events
                OnSummaryDelta = _hubProxy.On("uS", summaryDelta => {
                    LastActiveTime = DateTime.Now;
                    UpdateSummaryState?.Invoke(SignalSocketCommand.IncrementalUpdate, null, summaryDelta);
                });
            }
            _hubConnection.Start().Wait();
        }