Merge branch 'develop' into rpc-refactor

This commit is contained in:
kryofly
2018-01-29 14:33:46 +01:00
17 changed files with 238 additions and 52 deletions

View File

@@ -322,7 +322,10 @@ def rpc_balance(fiat_display_currency):
if coin == 'BTC':
currency["Rate"] = 1.0
else:
currency["Rate"] = exchange.get_ticker('BTC_' + coin, False)['bid']
if coin == 'USDT':
currency["Rate"] = 1.0 / exchange.get_ticker('USDT_BTC', False)['bid']
else:
currency["Rate"] = exchange.get_ticker('BTC_' + coin, False)['bid']
currency['BTC'] = currency["Rate"] * currency["Balance"]
total = total + currency['BTC']
output.append({'currency': currency['Currency'],

View File

@@ -244,7 +244,6 @@ def _profit(bot: Bot, update: Update) -> None:
def _balance(bot: Bot, update: Update) -> None:
"""
Handler for /balance
Returns current account balance per crypto
"""
(error, result) = rpc_balance(_CONF['fiat_display_currency'])
if error:
@@ -259,7 +258,6 @@ def _balance(bot: Bot, update: Update) -> None:
*Balance*: {balance}
*Pending*: {pending}
*Est. BTC*: {est_btc: .8f}
""".format(**currency)
output += """*Estimated Value*: