mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-15 20:31:43 +00:00
Fix some more default argument usage in exchange classes
This commit is contained in:
@@ -1350,7 +1350,7 @@ class Exchange:
|
|||||||
and order.get('filled') == 0.0)
|
and order.get('filled') == 0.0)
|
||||||
|
|
||||||
@retrier
|
@retrier
|
||||||
def cancel_order(self, order_id: str, pair: str, params: Dict = {}) -> Dict:
|
def cancel_order(self, order_id: str, pair: str, params: Optional[Dict] = None) -> Dict:
|
||||||
if self._config['dry_run']:
|
if self._config['dry_run']:
|
||||||
try:
|
try:
|
||||||
order = self.fetch_dry_run_order(order_id)
|
order = self.fetch_dry_run_order(order_id)
|
||||||
@@ -1360,6 +1360,8 @@ class Exchange:
|
|||||||
except InvalidOrderException:
|
except InvalidOrderException:
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
if params is None:
|
||||||
|
params = {}
|
||||||
try:
|
try:
|
||||||
order = self._api.cancel_order(order_id, pair, params=params)
|
order = self._api.cancel_order(order_id, pair, params=params)
|
||||||
self._log_exchange_response('cancel_order', order)
|
self._log_exchange_response('cancel_order', order)
|
||||||
@@ -1376,7 +1378,8 @@ class Exchange:
|
|||||||
except ccxt.BaseError as e:
|
except ccxt.BaseError as e:
|
||||||
raise OperationalException(e) from e
|
raise OperationalException(e) from e
|
||||||
|
|
||||||
def cancel_stoploss_order(self, order_id: str, pair: str, params: Dict = {}) -> Dict:
|
def cancel_stoploss_order(
|
||||||
|
self, order_id: str, pair: str, params: Optional[Dict] = None) -> Dict:
|
||||||
return self.cancel_order(order_id, pair, params)
|
return self.cancel_order(order_id, pair, params)
|
||||||
|
|
||||||
def is_cancel_order_result_suitable(self, corder) -> bool:
|
def is_cancel_order_result_suitable(self, corder) -> bool:
|
||||||
|
|||||||
@@ -119,7 +119,8 @@ class Gate(Exchange):
|
|||||||
return order1
|
return order1
|
||||||
return order
|
return order
|
||||||
|
|
||||||
def cancel_stoploss_order(self, order_id: str, pair: str, params: Dict = {}) -> Dict:
|
def cancel_stoploss_order(
|
||||||
|
self, order_id: str, pair: str, params: Optional[Dict] = None) -> Dict:
|
||||||
return self.cancel_order(
|
return self.cancel_order(
|
||||||
order_id=order_id,
|
order_id=order_id,
|
||||||
pair=pair,
|
pair=pair,
|
||||||
|
|||||||
@@ -232,7 +232,8 @@ class Okx(Exchange):
|
|||||||
return safe_value_fallback2(order, order, 'id_stop', 'id')
|
return safe_value_fallback2(order, order, 'id_stop', 'id')
|
||||||
return order['id']
|
return order['id']
|
||||||
|
|
||||||
def cancel_stoploss_order(self, order_id: str, pair: str, params: Dict = {}) -> Dict:
|
def cancel_stoploss_order(
|
||||||
|
self, order_id: str, pair: str, params: Optional[Dict] = None) -> Dict:
|
||||||
params1 = {'stop': True}
|
params1 = {'stop': True}
|
||||||
# 'ordType': 'conditional'
|
# 'ordType': 'conditional'
|
||||||
#
|
#
|
||||||
|
|||||||
Reference in New Issue
Block a user