Small stylistic updates
This commit is contained in:
parent
492c2799dc
commit
02192f28cd
@ -226,18 +226,14 @@ class RPC:
|
|||||||
for key, value in profit_days.items()
|
for key, value in profit_days.items()
|
||||||
]
|
]
|
||||||
|
|
||||||
def _rpc_trade_history(
|
def _rpc_trade_history(self, limit: int) -> Dict:
|
||||||
self, limit: int) -> Dict:
|
|
||||||
""" Returns the X last trades """
|
""" Returns the X last trades """
|
||||||
if limit > 0:
|
if limit > 0:
|
||||||
trades = Trade.get_trades().order_by(Trade.id.desc()).limit(limit)
|
trades = Trade.get_trades().order_by(Trade.id.desc()).limit(limit)
|
||||||
else:
|
else:
|
||||||
trades = Trade.get_trades().order_by(Trade.id.desc()).all()
|
trades = Trade.get_trades().order_by(Trade.id.desc()).all()
|
||||||
|
|
||||||
output = []
|
output = [trade.to_json() for trade in trades]
|
||||||
|
|
||||||
for trade in trades:
|
|
||||||
output.append(trade.to_json())
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"trades": output,
|
"trades": output,
|
||||||
|
Loading…
Reference in New Issue
Block a user