Example #1
0
        public async Task <XCommasResponse <SmartTrade> > CreateSmartCoverAsync(SmartCoverCreateParameters data)
        {
            var path = $"{BaseAddress}/ver1/smart_trades/create_smart_cover";

            using (var request = XCommasRequest.Post(path).WithSerializedContent(data).Sign(this))
            {
                return(await this.GetResponse <SmartTrade>(request).ConfigureAwait(false));
            }
        }
Example #2
0
        public async Task <XCommasResponse <BotStats> > GetBotStatsAsync()
        {
            var path = $"{BaseAddress}/ver1/bots/stats";

            using (var request = XCommasRequest.Get(path).Sign(this))
            {
                return(await this.GetResponse <BotStats>(request).ConfigureAwait(false));
            }
        }
Example #3
0
        public async Task <XCommasResponse <bool> > DeleteBotAsync(int botId)
        {
            var path = $"{BaseAddress}/ver1/bots/{botId}/delete";

            using (var request = XCommasRequest.Post(path).Sign(this))
            {
                return(await this.GetResponse <bool>(request).ConfigureAwait(false));
            }
        }
Example #4
0
        public async Task <XCommasResponse <BotPairsBlackListData> > GetBotPairsBlackListAsync()
        {
            var path = $"{BaseAddress}/ver1/bots/pairs_black_list";

            using (var request = XCommasRequest.Get(path).Sign(this))
            {
                return(await this.GetResponse <BotPairsBlackListData>(request).ConfigureAwait(false));
            }
        }
Example #5
0
        public async Task <XCommasResponse <Bot> > CreateBotAsync(int accountId, Strategy strategy, BotData data)
        {
            var path = $"{BaseAddress}/ver1/bots/create_bot";

            using (var request = XCommasRequest.Post(path).WithSerializedContent(new BotCreateData(accountId, strategy, data)).Sign(this))
            {
                return(await this.GetResponse <Bot>(request).ConfigureAwait(false));
            }
        }
Example #6
0
        public async Task <XCommasResponse <AccountTableData[]> > GetAccountTableDataAsync(int accountId)
        {
            var path = $"{BaseAddress}/ver1/accounts/{accountId}/account_table_data";

            using (var request = XCommasRequest.Post(path).Sign(this))
            {
                return(await this.GetResponse <AccountTableData[]>(request).ConfigureAwait(false));
            }
        }
Example #7
0
        public async Task <XCommasResponse <GridBot> > UpdateGridBotAsync(int gridBotId, GridBotData data)
        {
            var path = $"{BaseAddress}/ver1/grid_bots/{gridBotId}/manual";

            using (var request = XCommasRequest.Patch(path).WithSerializedContent(new GridBotUpdateData(gridBotId, data)).Sign(this))
            {
                return(await this.GetResponse <GridBot>(request).ConfigureAwait(false));
            }
        }
Example #8
0
        public async Task <XCommasResponse <bool> > ChangeUserModeAsync(UserMode userMode)
        {
            var path = $"{BaseAddress}/ver1/users/change_mode?mode={userMode.GetEnumMemberAttrValue()}";

            using (var request = XCommasRequest.Post(path).Sign(this))
            {
                return(await this.GetResponse <bool>(request).ConfigureAwait(false));
            }
        }
Example #9
0
        public async Task <XCommasResponse <Deal> > ShowDealAsync(int dealId)
        {
            var path = $"{BaseAddress}/ver1/deals/{dealId}/show";

            using (var request = XCommasRequest.Get(path).Sign(this))
            {
                return(await this.GetResponse <Deal>(request).ConfigureAwait(false));
            }
        }
Example #10
0
        public async Task <XCommasResponse <SmartTradeStep> > AddFundsToSmartTradeAsync(SmartTradeAddFundsParameters data)
        {
            var path = $"{BaseAddress}/ver1/smart_trades/{data.SmartTradeId}/add_funds";

            using (var request = XCommasRequest.Post(path).WithSerializedContent(data).Sign(this))
            {
                return(await this.GetResponse <SmartTradeStep>(request).ConfigureAwait(false));
            }
        }
Example #11
0
        public async Task <XCommasResponse <SmartTrade> > CancelSmartTradeOrderAsync(int smartTradeId, int stepId)
        {
            var path = $"{BaseAddress}/ver1/smart_trades/{smartTradeId}/cancel_order?step_id={stepId}";

            using (var request = XCommasRequest.Post(path).Sign(this))
            {
                return(await this.GetResponse <SmartTrade>(request).ConfigureAwait(false));
            }
        }
Example #12
0
        public async Task <XCommasResponse <SmartTrade> > RefreshSmartTradeAsync(int smartTradeId)
        {
            var path = $"{BaseAddress}/ver1/smart_trades/{smartTradeId}/force_process";

            using (var request = XCommasRequest.Post(path).Sign(this))
            {
                return(await this.GetResponse <SmartTrade>(request).ConfigureAwait(false));
            }
        }
Example #13
0
        public async Task <XCommasResponse <SmartTrade> > UpdateSmartTradeAsync(int smartTradeId, SmartTradeUpdateParameters data)
        {
            var path = $"{BaseAddress}/ver1/smart_trades/{smartTradeId}/update";

            using (var request = XCommasRequest.Patch(path).WithSerializedContent(data).Sign(this))
            {
                return(await this.GetResponse <SmartTrade>(request).ConfigureAwait(false));
            }
        }
Example #14
0
        public async Task <XCommasResponse <SmartTrade[]> > GetSmartTradesAsync(int limit = 50, int?offset = null, int?accountId = null, SmartTradeScope smartTradeScope = SmartTradeScope.All, string type = null)
        {
            var path = $"{BaseAddress}/ver1/smart_trades?limit={limit}&offset={offset}&account_id={accountId}&scope={smartTradeScope.GetEnumMemberAttrValue()}&type={type}";

            using (var request = XCommasRequest.Get(path).Sign(this))
            {
                return(await this.GetResponse <SmartTrade[]>(request).ConfigureAwait(false));
            }
        }
Example #15
0
        public async Task <XCommasResponse <Account> > LoadBalancesAsync(int accountId)
        {
            var path = $"{BaseAddress}/ver1/accounts/{accountId}/load_balances";

            using (var request = XCommasRequest.Post(path).Sign(this))
            {
                return(await this.GetResponse <Account>(request).ConfigureAwait(false));
            }
        }
Example #16
0
        public async Task <XCommasResponse <Deal> > UpdateDealAsync(int dealId, DealUpdateData data)
        {
            var path = $"{BaseAddress}/ver1/deals/{dealId}/update_deal";

            using (var request = XCommasRequest.Patch(path).WithSerializedContent(data).Sign(this))
            {
                return(await this.GetResponse <Deal>(request).ConfigureAwait(false));
            }
        }
Example #17
0
        public async Task <XCommasResponse <PieChartPiece[]> > GetPieChartDataAsync(int accountId)
        {
            var path = $"{BaseAddress}/ver1/accounts/{accountId}/pie_chart_data";

            using (var request = XCommasRequest.Post(path).Sign(this))
            {
                return(await this.GetResponse <PieChartPiece[]>(request).ConfigureAwait(false));
            }
        }
Example #18
0
        public async Task <XCommasResponse <Deal> > AddFundsToDealAsync(DealAddFundsParameters data)
        {
            var path = $"{BaseAddress}/ver1/deals/{data.DealId}/add_funds";

            using (var request = XCommasRequest.Post(path).WithSerializedContent(data).Sign(this))
            {
                return(await this.GetResponse <Deal>(request).ConfigureAwait(false));
            }
        }
Example #19
0
        public async Task <XCommasResponse <string> > RemoveAccountAsync(int accountId)
        {
            var path = $"{BaseAddress}/ver1/accounts/{accountId}/remove";

            using (var request = XCommasRequest.Post(path).Sign(this))
            {
                return(await this.GetResponse <string>(request).ConfigureAwait(false));
            }
        }
Example #20
0
        public async Task <XCommasResponse <Account[]> > GetAccountsAsync()
        {
            var path = $"{BaseAddress}/ver1/accounts";

            using (var request = XCommasRequest.Get(path).Sign(this))
            {
                return(await this.GetResponse <Account[]>(request).ConfigureAwait(false));
            }
        }
Example #21
0
        public async Task <XCommasResponse <GridBot> > ShowGridBotAsync(int botId)
        {
            var path = $"{BaseAddress}/ver1/grid_bots/{botId}";

            using (var request = XCommasRequest.Get(path).Sign(this))
            {
                return(await this.GetResponse <GridBot>(request).ConfigureAwait(false));
            }
        }
Example #22
0
        public async Task <XCommasResponse <Market[]> > GetMarketsAsync()
        {
            var path = $"{BaseAddress}/ver1/accounts/market_list";

            using (var request = XCommasRequest.Get(path))
            {
                return(await this.GetResponse <Market[]>(request).ConfigureAwait(false));
            }
        }
Example #23
0
        public async Task <XCommasResponse <bool> > SetBotPairsBlackListAsync(BotPairsBlackListData data)
        {
            var path = $"{BaseAddress}/ver1/bots/update_pairs_black_list";

            using (var request = XCommasRequest.Post(path).WithSerializedContent(data).Sign(this))
            {
                return(await this.GetResponse <bool>(request).ConfigureAwait(false));
            }
        }
Example #24
0
        public async Task <XCommasResponse <string[]> > GetMarketPairsAsync(string marketCode)
        {
            var path = $"{BaseAddress}/ver1/accounts/market_pairs?market_code={marketCode}";

            using (var request = XCommasRequest.Get(path))
            {
                return(await this.GetResponse <string[]>(request).ConfigureAwait(false));
            }
        }
Example #25
0
        public async Task <XCommasResponse <Deal[]> > GetDealsAsync(int limit = 50, int?offset = null, int?accountId = null, int?botId = null, DealScope dealScope = DealScope.All, DealOrder dealOrder = DealOrder.CreatedAt)
        {
            var path = $"{BaseAddress}/ver1/deals?limit={limit}&offset={offset}&account_id={accountId}&bot_id={botId}&scope={dealScope.GetEnumMemberAttrValue()}&order={dealOrder.GetEnumMemberAttrValue()}";

            using (var request = XCommasRequest.Get(path).Sign(this))
            {
                return(await this.GetResponse <Deal[]>(request).ConfigureAwait(false));
            }
        }
Example #26
0
        public async Task <XCommasResponse <string> > CreateAccountAsync(AccountCreateData data)
        {
            var path = $"{BaseAddress}/ver1/accounts/new";

            using (var request = XCommasRequest.Post(path).WithSerializedContent(data).Sign(this))
            {
                return(await this.GetResponse <string>(request).ConfigureAwait(false));
            }
        }
Example #27
0
        public async Task <XCommasResponse <Bot> > UpdateBotAsync(int botId, BotUpdateData data)
        {
            var path = $"{BaseAddress}/ver1/bots/{botId}/update";

            using (var request = XCommasRequest.Patch(path).WithSerializedContent(data).Sign(this))
            {
                return(await this.GetResponse <Bot>(request).ConfigureAwait(false));
            }
        }
Example #28
0
        public async Task <XCommasResponse <CurrencyRate> > GetCurrencyRateAsync(string pair, string marketcode = "binance")
        {
            var path = $"{BaseAddress}/ver1/accounts/currency_rates?market_code={marketcode}&pair={pair}";

            using (var request = XCommasRequest.Get(path))
            {
                return(await this.GetResponse <CurrencyRate>(request).ConfigureAwait(false));
            }
        }
Example #29
0
        public async Task <XCommasResponse <Bot> > PanicSellAllBotDealsAsync(int botId)
        {
            var path = $"{BaseAddress}/ver1/bots/{botId}/panic_sell_all_deals";

            using (var request = XCommasRequest.Post(path).Sign(this))
            {
                return(await this.GetResponse <Bot>(request).ConfigureAwait(false));
            }
        }
Example #30
0
        public async Task <XCommasResponse <SmartTrade> > CreateSimpleSellAsync(SimpleTradeData data)
        {
            var path = $"{BaseAddress}/ver1/smart_trades/create_simple_sell";

            using (var request = XCommasRequest.Post(path).WithSerializedContent(data).Sign(this))
            {
                return(await this.GetResponse <SmartTrade>(request).ConfigureAwait(false));
            }
        }