Ejemplo n.º 1
0
        /// <summary>
        /// Return the latest wallet state.
        /// </summary>
        public async Task <Dictionary <string, decimal> > getWallet()
        {
            // update wallet if live trading.
            Dictionary <string, decimal> wallet = new Dictionary <string, decimal>();

            if (isLiveTrading)
            {
                wallet = await api.GetAmountsAvailableToTradeAsync();
            }

            return(wallet);
        }
Ejemplo n.º 2
0
        public async Task <AccountBalance> GetBalance(string currency)
        {
            var balances = await _api.GetAmountsAvailableToTradeAsync();

            if (balances.ContainsKey(currency))
            {
                return(new AccountBalance(currency, balances[currency], 0));
            }
            else
            {
                return(new AccountBalance(currency, 0, 0));
            }
        }