Merge pull request #4228 from baartch/develop

Extending the Telegram Bot command /status with the possibility to query specific trade_ids
This commit is contained in:
Matthias
2021-01-19 20:08:49 +01:00
committed by GitHub
5 changed files with 39 additions and 9 deletions

View File

@@ -145,13 +145,17 @@ class RPC:
}
return val
def _rpc_trade_status(self) -> List[Dict[str, Any]]:
def _rpc_trade_status(self, trade_ids: List[int] = []) -> 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)).all()
else:
trades = Trade.get_open_trades()
if not trades:
raise RPCException('no active trade')
else: