extend status bot command to query specific trades

This commit is contained in:
Andreas Brunner
2021-01-17 20:39:35 +01:00
parent 572f5f9186
commit 6d40814dbf
2 changed files with 14 additions and 4 deletions

View File

@@ -144,13 +144,17 @@ class RPC:
}
return val
def _rpc_trade_status(self) -> List[Dict[str, Any]]:
def _rpc_trade_status(self, trade_ids=None) -> List[Dict[str, Any]]:
"""
Below follows the RPC backend it is prefixed with rpc_ to raise awareness that it is
a remotely exposed function
"""
# Fetch open trade
trades = Trade.get_open_trades()
# Fetch open trades
if trade_ids:
trades = Trade.get_trades(trade_filter=Trade.id.in_(trade_ids))
else:
trades = Trade.get_open_trades()
if not trades:
raise RPCException('no active trade')
else: