protected virtual Task Authorize(CancellationToken token)
        {
            var credenitals = new BitMexServiceClientCredentials(_configuration.ApiKey, _configuration.ApiSecret);

            var request = new AuthRequest
            {
                Operation = "authKey",
                Arguments = credenitals.BuildAuthArguments("GET/realtime")
            };

            return(Messenger.SendRequestAsync(request, token));
        }
예제 #2
0
        public BitMexExchange(BitMexExchangeConfiguration configuration,
                              TranslatedSignalsRepository translatedSignalsRepository,
                              BitMexOrderBooksHarvester orderBooksHarvester,
                              BitMexOrderHarvester orderHarvester,
                              BitMexPriceHarvester priceHarvester,
                              BitMexExecutionHarvester executionHarvester,
                              ILog log)
            : base(Name, configuration, translatedSignalsRepository, log)
        {
            _orderBooksHarvester = orderBooksHarvester;
            _orderHarvester      = orderHarvester;
            _priceHarvester      = priceHarvester;
            _executionHarvester  = executionHarvester;


            var credenitals = new BitMexServiceClientCredentials(configuration.ApiKey, configuration.ApiSecret);

            _exchangeApi = new BitMEXAPI(credenitals)
            {
                BaseUri = new Uri(configuration.EndpointUrl)
            };

            orderBooksHarvester.MaxOrderBookRate = configuration.MaxOrderBookRate;
        }