Example #1
0
        public CoinbaseProClient(
            IAuthenticator authenticator,
            IHttpClient httpClient,
            bool sandBox = false)
        {
            var clock = new Clock();
            var httpRequestMessageService = new HttpRequestMessageService(authenticator, clock, sandBox);
            var createWebSocketFeed       = (Func <IWebSocketFeed>)(() => new WebSocketFeed(sandBox));
            var queryBuilder = new QueryBuilder();

            AccountsService              = new AccountsService(httpClient, httpRequestMessageService);
            CoinbaseAccountsService      = new CoinbaseAccountsService(httpClient, httpRequestMessageService);
            OrdersService                = new OrdersService(httpClient, httpRequestMessageService, queryBuilder);
            PaymentsService              = new PaymentsService(httpClient, httpRequestMessageService);
            WithdrawalsService           = new WithdrawalsService(httpClient, httpRequestMessageService);
            DepositsService              = new DepositsService(httpClient, httpRequestMessageService);
            ProductsService              = new ProductsService(httpClient, httpRequestMessageService, queryBuilder);
            CurrenciesService            = new CurrenciesService(httpClient, httpRequestMessageService);
            FillsService                 = new FillsService(httpClient, httpRequestMessageService);
            FundingsService              = new FundingsService(httpClient, httpRequestMessageService, queryBuilder);
            ReportsService               = new ReportsService(httpClient, httpRequestMessageService);
            UserAccountService           = new UserAccountService(httpClient, httpRequestMessageService);
            StablecoinConversionsService = new StablecoinConversionsService(httpClient, httpRequestMessageService);
            FeesService     = new FeesService(httpClient, httpRequestMessageService);
            ProfilesService = new ProfilesService(httpClient, httpRequestMessageService);
            WebSocket       = new WebSocket.WebSocket(createWebSocketFeed, authenticator, clock);

            Log.Information("CoinbaseProClient constructed");
        }
Example #2
0
        public void RemoveMethodShouldRemoveDeposit()
        {
            var dbContext = GetDatabase();

            var bank = new Bank()
            {
                Id   = 1,
                Name = "ProCredit"
            };
            var banks = new BanksService(dbContext);

            dbContext.Banks.Add(bank);
            var items = new DepositsService(dbContext, banks);

            items.Add("БНП Париба С.А.", 2000, 20000, DepositType.AdvancePaymentInterestDeposit,
                      @"В зависимост от срока и сумата:
            За срок от 12 месеца - 0.50 % ", Currency.BGN, InterestPayment.NoMatter, DepositFor.Retirees,
                      InterestType.Fixed, IncreasingAmount.No, OverdraftOpportunity.No, CreditOpportunity.No,
                      InterestCapitalize.No, "36",
                      "12", "12,24,36", ValidForCustomer.No, MonthlyAccrual.No, "няма", "няма", bank.Id, (decimal)0.1,
                      (decimal)0.3, (decimal)0.6, (decimal)0.9,
                      (decimal)1.2, (decimal)1.8, (decimal)2.4, (decimal)3.6, (decimal)4.8, (decimal)6);

            var deposit = dbContext.Deposits.FirstOrDefault();

            items.Remove(deposit.Id);
            var result = dbContext.Deposits.Count();

            Assert.AreEqual(0, result);
        }
Example #3
0
        public void AddMethodShouldAddDeposit()
        {
            var options = new DbContextOptionsBuilder <ApplicationDbContext>()
                          .UseInMemoryDatabase(databaseName: "AddDeposit_Deposits_DB")
                          .Options;
            var dbContext = new ApplicationDbContext(options);

            var bank = new Bank()
            {
                Id   = 1,
                Name = "ProCredit"
            };
            var banks = new BanksService(dbContext);

            dbContext.Banks.Add(bank);
            var items = new DepositsService(dbContext, banks);

            items.Add("БНП Париба С.А.", 2000, 20000, DepositType.AdvancePaymentInterestDeposit,
                      @"В зависимост от срока и сумата:
            За срок от 12 месеца - 0.50 % ", Currency.BGN, InterestPayment.NoMatter, DepositFor.Retirees,
                      InterestType.Fixed, IncreasingAmount.No, OverdraftOpportunity.No, CreditOpportunity.No,
                      InterestCapitalize.No, "36",
                      "12", "12,24,36", ValidForCustomer.No, MonthlyAccrual.No, "няма", "няма", bank.Id, (decimal)0.1,
                      (decimal)0.3, (decimal)0.6, (decimal)0.9,
                      (decimal)1.2, (decimal)1.8, (decimal)2.4, (decimal)3.6, (decimal)4.8, (decimal)6);

            var result = dbContext.Deposits.Count();

            Assert.AreEqual(1, result);
        }
Example #4
0
        public GDAXClient(Authenticator authenticator, bool sandBox = false)
        {
            this.authenticator = authenticator;

            var httpClient = new HttpClient.HttpClient();
            var clock      = new Clock();
            var httpRequestMessageService = new Services.HttpRequest.HttpRequestMessageService(clock, sandBox);

            AccountsService         = new AccountsService(httpClient, httpRequestMessageService, authenticator);
            CoinbaseAccountsService = new CoinbaseAccountsService(httpClient, httpRequestMessageService, authenticator);
            OrdersService           = new OrdersService(httpClient, httpRequestMessageService, authenticator);
            PaymentsService         = new PaymentsService(httpClient, httpRequestMessageService, authenticator);
            WithdrawalsService      = new WithdrawalsService(httpClient, httpRequestMessageService, authenticator);
            DepositsService         = new DepositsService(httpClient, httpRequestMessageService, authenticator);
            ProductsService         = new ProductsService(httpClient, httpRequestMessageService, authenticator);
            CurrenciesService       = new CurrenciesService(httpClient, httpRequestMessageService, authenticator);
        }
        public GDAXClient(
            IAuthenticator authenticator,
            bool sandBox = false)
        {
            var httpClient = new HttpClient.HttpClient();
            var clock      = new Clock();
            var httpRequestMessageService = new HttpRequestMessageService(clock, sandBox);
            var queryBuilder = new QueryBuilder();

            AccountsService         = new AccountsService(httpClient, httpRequestMessageService, authenticator);
            CoinbaseAccountsService = new CoinbaseAccountsService(httpClient, httpRequestMessageService, authenticator);
            OrdersService           = new OrdersService(httpClient, httpRequestMessageService, authenticator);
            PaymentsService         = new PaymentsService(httpClient, httpRequestMessageService, authenticator);
            WithdrawalsService      = new WithdrawalsService(httpClient, httpRequestMessageService, authenticator);
            DepositsService         = new DepositsService(httpClient, httpRequestMessageService, authenticator);
            ProductsService         = new ProductsService(httpClient, httpRequestMessageService, authenticator, queryBuilder);
            CurrenciesService       = new CurrenciesService(httpClient, httpRequestMessageService, authenticator);
            FillsService            = new FillsService(httpClient, httpRequestMessageService, authenticator);
            FundingsService         = new FundingsService(httpClient, httpRequestMessageService, authenticator, queryBuilder);
        }
Example #6
0
        public GDAXClient(
            IAuthenticator authenticator,
            IHttpClient httpClient,
            bool sandBox = false)
        {
            var clock = new Clock();
            var httpRequestMessageService = new HttpRequestMessageService(authenticator, clock, sandBox);
            var webSocket    = new WebSocket.WebSocket(authenticator, clock, sandBox);
            var queryBuilder = new QueryBuilder();

            AccountsService         = new AccountsService(httpClient, httpRequestMessageService);
            CoinbaseAccountsService = new CoinbaseAccountsService(httpClient, httpRequestMessageService);
            OrdersService           = new OrdersService(httpClient, httpRequestMessageService);
            PaymentsService         = new PaymentsService(httpClient, httpRequestMessageService);
            WithdrawalsService      = new WithdrawalsService(httpClient, httpRequestMessageService);
            DepositsService         = new DepositsService(httpClient, httpRequestMessageService);
            ProductsService         = new ProductsService(httpClient, httpRequestMessageService, queryBuilder);
            CurrenciesService       = new CurrenciesService(httpClient, httpRequestMessageService);
            FillsService            = new FillsService(httpClient, httpRequestMessageService);
            FundingsService         = new FundingsService(httpClient, httpRequestMessageService, queryBuilder);
            ReportsService          = new ReportsService(httpClient, httpRequestMessageService);
            UserAccountService      = new UserAccountService(httpClient, httpRequestMessageService);
            WebSocket = webSocket;
        }