Esempio n. 1
0
        /// <summary>
        /// Add security.
        /// </summary>
        /// <param name="portfolio">Portfolio.</param>
        public void Add(Portfolio portfolio)
        {
            if (portfolio is null)
            {
                throw new ArgumentNullException(nameof(portfolio));
            }

            _inner.Add(portfolio.Name, portfolio);
            NewPortfolio?.Invoke(portfolio);
        }
Esempio n. 2
0
        public void GetPortfolios()
        {
            string endPoint = "payment/balances";

            var res = SendQuery(true, endPoint, _pubKey, _secKey);

            List <Balance> balances = JsonConvert.DeserializeAnonymousType(res, new List <Balance>());

            BalanceInfo balanceInfo = new BalanceInfo();

            balanceInfo.Balances = balances;
            balanceInfo.Name     = _portfolioName;

            NewPortfolio?.Invoke(balanceInfo);
        }
Esempio n. 3
0
 private void RaiseNewPortfolio(Portfolio portfolio)
 {
     NewPortfolio?.Invoke(portfolio);
     NewPortfolios?.Invoke(new[] { portfolio });
 }