Ejemplo n.º 1
0
        public async Task <CurrenciesResponse> GetCurrencies(string brokerAccountId = null,
                                                             CancellationToken cancellationToken = default)
        {
            var query = new Dictionary <string, string>();

            if (!string.IsNullOrWhiteSpace(brokerAccountId))
            {
                query.Add("brokerAccountId", brokerAccountId);
            }

            return(await _http.Get <CurrenciesResponse>($"portfolio/currencies",
                                                        query,
                                                        cancellationToken : cancellationToken));
        }
        public async Task <OperationsResponse> Get(OperationsFilter filter, string brokerAccountId = null,
                                                   CancellationToken cancellationToken             = default)
        {
            var query = new Dictionary <string, string>
            {
                { "to", filter.To.ToString("yyyy-MM-ddTHH:mm:ss.ffffffK") },
                { "from", filter.From.ToString("yyyy-MM-ddTHH:mm:ss.ffffffK") },
                { "interval", filter.Interval.GetEnumMemberAttributeValue() }
            };

            if (!string.IsNullOrWhiteSpace(brokerAccountId))
            {
                query.Add("brokerAccountId", brokerAccountId);
            }

            if (!string.IsNullOrEmpty(filter.Figi))
            {
                query.Add("figi", filter.Figi);
            }

            return(await _http.Get <OperationsResponse>(
                       "operations",
                       query,
                       cancellationToken : cancellationToken));
        }
Ejemplo n.º 3
0
        public Task <OrdersResponse> Get(string brokerAccountId = null, CancellationToken cancellationToken = default)
        {
            var query = new Dictionary <string, string>();

            if (!string.IsNullOrWhiteSpace(brokerAccountId))
            {
                query.Add("brokerAccountId", brokerAccountId);
            }

            return(_http.Get <OrdersResponse>("orders",
                                              query,
                                              cancellationToken: cancellationToken));
        }
Ejemplo n.º 4
0
 public async Task <AccountsResponse> GetAccounts(CancellationToken cancellationToken = default)
 {
     return(await _http.Get <AccountsResponse>("user/accounts", cancellationToken : cancellationToken));
 }
 public Task <MarketInstrumentListResponse> GetBonds(CancellationToken cancellationToken = default)
 {
     return(_http.Get <MarketInstrumentListResponse>("market/bonds", cancellationToken: cancellationToken));
 }