Exemple #1
0
        public AlterDiceSymbolOrderBook(string symbol, AlterDiceOrderBookOptions options) : base(symbol, options)
        {
            _symbolId     = options.SymbolId;
            _apiClient    = new AlterDiceClient();
            _shouldUseApi = options.SymbolId == 0;

            _timer          = new System.Timers.Timer(options.Timeout ?? 10000);
            _timer.Elapsed += T_Elapsed;

            _socket = new AlterDiceSocketClient("AlterDiceSocketBook", new SocketClientOptions("https://socket.alterdice.com")
            {
                LogLevel   = LogLevel.Debug,
                LogWriters = new List <ILogger> {
                    new DebugLogger()
                }
            },
                                                new AlterDiceAuthenticationProvider(new CryptoExchange.Net.Authentication.ApiCredentials("42", "42")));
        }
        public AlterDiceSymbolOrderBook(string symbol, AlterDiceOrderBookOptions options) : base(symbol, options)
        {
            _symbolId  = options.SymbolId;
            _apiClient = new AlterDiceClient();
            if (options.SymbolId == 0 && options.Timeout.HasValue)
            {
                _shouldUseApi   = true;
                _timer          = new System.Timers.Timer(options.Timeout.Value);
                _timer.Elapsed += T_Elapsed;
            }

            _socket = new AlterDiceSocketClient("AlterDiceSocketBook", new SocketClientOptions("https://socket.alterdice.com")
            {
                LogVerbosity = CryptoExchange.Net.Logging.LogVerbosity.Debug,
                LogWriters   = new System.Collections.Generic.List <System.IO.TextWriter>()
                {
                    new DebugTextWriter()
                },
            },
                                                new AlterDiceAuthenticationProvider(new CryptoExchange.Net.Authentication.ApiCredentials("42", "42")));
            //_socket.OnOrderBookUpdate += _socket_OnOrderBookUpdate1;
        }
 public AlterDiceSymbolOrderBook(string symbol, AlterDiceClient client, AlterDiceOrderBookOptions opts) : this(symbol, opts)
 {
     _apiClient = client;
 }