Add fetch_order_or_stoploss wrapper

This commit is contained in:
Matthias
2020-08-22 09:24:14 +02:00
parent fc2104bfad
commit f2b390a271
2 changed files with 36 additions and 0 deletions

View File

@@ -1039,6 +1039,17 @@ class Exchange:
# Assign method to fetch_stoploss_order to allow easy overriding in other classes
fetch_stoploss_order = fetch_order
def fetch_order_or_stoploss_order(self, order_id: str, pair: str,
stoploss_order: bool = False) -> Dict:
"""
Simple wrapper calling either fetch_order or fetch_stoploss_order depending on
the stoploss_order parameter
:param stoploss_order: If true, uses fetch_stoploss_order, otherwise fetch_order.
"""
if stoploss_order:
return self.fetch_stoploss_order(order_id, pair)
return self.fetch_order(order_id, pair)
@retrier
def fetch_l2_order_book(self, pair: str, limit: int = 100) -> dict:
"""