示例#1
0
 public BittrexBagAndDustHandler(IMicroBus bus, BittrexService bittrexService, DatabaseService databaseService, BagConfig bagConfig, BittrexConfig bittrexConfig, DustConfig dustConfig, LowBtcConfig lowBtcConfig)
 {
     _bus             = bus;
     _bittrexService  = bittrexService;
     _databaseService = databaseService;
     _bagConfig       = bagConfig;
     _bittrexConfig   = bittrexConfig;
     _dustConfig      = dustConfig;
     _lowBtcConfig    = lowBtcConfig;
 }
示例#2
0
 public HomeController(ApplicationDbContext context, IConfiguration configuration,
                       ILogger <HomeController> logger, BittrexService bittrexService, UserManager <User> userManager)
 {
     _context        = context;
     _configuration  = configuration;
     _myApiKey       = configuration.GetValue <string>("myApiKey");
     _logger         = logger;
     _bittrexService = bittrexService;
     _userManager    = userManager;
 }
示例#3
0
 public BittrexDepositWithdrawalHandler(
     BittrexService bittrexService,
     BittrexConfig config,
     GeneralConfig generalConfig,
     IMicroBus bus)
 {
     _bittrexService = bittrexService;
     _config         = config;
     _generalConfig  = generalConfig;
     _bus            = bus;
 }
示例#4
0
 public BittrexBagAndDustHandler(
     IMicroBus bus,
     GeneralConfig generalConfig,
     BittrexConfig config,
     BittrexService bittrexService,
     DatabaseService databaseService)
 {
     _bus             = bus;
     _generalConfig   = generalConfig;
     _config          = config;
     _bittrexService  = bittrexService;
     _databaseService = databaseService;
 }
示例#5
0
 public BittrexDepositWithdrawalHandler(
     BittrexService bittrexService,
     BittrexConfig config,
     DatabaseService databaseService,
     PriceService priceService,
     IMicroBus bus)
 {
     _bittrexService  = bittrexService;
     _config          = config;
     _databaseService = databaseService;
     _priceService    = priceService;
     _bus             = bus;
 }
示例#6
0
 public async void BittrexWorker()
 {
     logger.Info("Bittrex Start...");
     try
     {
         BittrexService service = new BittrexService(ContainerManager.Container.Resolve <IRepository <Bittrex> >());
         await service.Worker();
     }
     catch (Exception e)
     {
         logger.Error(e.Message + "\n" + e.InnerException?.Message);
     }
     logger.Info("Bittrex End...");
 }
示例#7
0
        public void Shoul_Save_DataBase_Data_From_Api()
        {
            var _container = new WindsorContainer();

            _container = new WindsorContainer();
            _container.AddFacility <TypedFactoryFacility>();
            _container.Register(Component.For(typeof(DbContext)).ImplementedBy(typeof(DbEntities)));
            _container.Register(Component.For <IDbContextFactory>().AsFactory());
            _container.Register(Component.For(typeof(IRepository <>)).ImplementedBy(typeof(BaseRepository <>)));

            var service = new BittrexService(_container.Kernel.Resolve <IRepository <Bittrex> >());

            service.Worker();
        }
示例#8
0
        static void Main(string[] args)
        {
            bool test    = true;
            var  builder = new ConfigurationBuilder()
                           .SetBasePath(Directory.GetCurrentDirectory())
                           .AddJsonFile("appsettings.json");

            IConfiguration config = new ConfigurationBuilder()
                                    .AddJsonFile("appsettings.json", true, true)
                                    .Build();

            if (test)
            {
                DirectoryInfo directory = new DirectoryInfo(@"D:\git\TestFiles\7-26");
                FileInfo[]    files     = directory.GetFiles("*.txt"); //Getting Text files
                foreach (var market in files)
                {
                    BittrexServiceTest _bittrexService = new BittrexServiceTest(market.FullName);
                    //Todo trading Magic
                    TradingLogicManager tradingManager = new TradingLogicManager(market.FullName, _bittrexService, "PlanningToBuy");
                    while (_bittrexService.exit == false)
                    {
                        tradingManager.CheckOptions();
                    }
                }
                Console.WriteLine("Done :)");
                Console.ReadLine();
            }
            else
            {
                AKVService          _aKVService     = new AKVService();
                string              _key            = _aKVService.GetKeyVaultSecret(config["key"]);
                string              _secret         = _aKVService.GetKeyVaultSecret(config["secret"]);
                var                 marketName      = "USD-BTC";
                BittrexService      _bittrexService = new BittrexService(_key, _secret);
                TradingLogicManager tradingManager  = new TradingLogicManager(marketName, _bittrexService, "PlanningToBuy");
            }
        }
示例#9
0
 public BittrexNewOrderCheckHandler(BittrexService bittrexService, IMicroBus bus, BittrexConfig config)
 {
     _bittrexService = bittrexService;
     _bus            = bus;
     _config         = config;
 }
示例#10
0
 public PriceService(BittrexService bittrexService, PoloniexService poloniexService)
 {
     _bittrexService  = bittrexService;
     _poloniexService = poloniexService;
 }
 public BittrexBalanceCheckHandler(BittrexService bittrexService, BittrexConfig config)
 {
     _bittrexService = bittrexService;
     _config         = config;
 }
示例#12
0
 public ManagePositionsController(ApplicationDbContext context, UserManager <User> userManager,
                                  IConfiguration configuration, ILogger <ManagePositionsController> logger, BittrexService bittrexService)
 {
     _context        = context;
     _userManager    = userManager;
     _myApiKey       = configuration.GetValue <string>("myApiKey");
     _logger         = logger;
     _bittrexService = bittrexService;
 }
示例#13
0
 public BittrexNewOrderCheckHandler(BittrexService bittrexService, IMicroBus bus)
 {
     _bittrexService = bittrexService;
     _bus            = bus;
 }