Example #1
0
        public async Task <double> GetBalance(string currency)
        {
            if (_dryRun)
            {
                return(999.99);
            }

            var result = await _api.GetBalance(currency);

            if (!result.Success)
            {
                throw new Exception($"Bittrex API failure {result.Message}");
            }

            return(result.Result.Balance);
        }
Example #2
0
        public async Task <Core.Models.AccountBalance> GetBalance(string currency)
        {
            if (_dryRun)
            {
                return(new Core.Models.AccountBalance(currency, 999.99, 0));
            }

            var result = await _api.GetBalance(currency);

            if (!result.Success)
            {
                throw new Exception($"Bittrex API failure {result.Message}");
            }

            return(new Core.Models.AccountBalance(result.Result.Currency, result.Result.Available, result.Result.Pending));
        }