|
|
|
|
@@ -1122,7 +1122,7 @@ class Exchange:
|
|
|
|
|
f'Message: {e}') from e
|
|
|
|
|
except ccxt.DDoSProtection as e:
|
|
|
|
|
raise DDosProtection(e) from e
|
|
|
|
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
|
|
|
|
except (ccxt.OperationFailed, ccxt.ExchangeError) as e:
|
|
|
|
|
raise TemporaryError(
|
|
|
|
|
f'Could not place {side} order due to {e.__class__.__name__}. Message: {e}') from e
|
|
|
|
|
except ccxt.BaseError as e:
|
|
|
|
|
@@ -1259,7 +1259,7 @@ class Exchange:
|
|
|
|
|
f'stop-price {stop_price_norm}. Message: {e}') from e
|
|
|
|
|
except ccxt.DDoSProtection as e:
|
|
|
|
|
raise DDosProtection(e) from e
|
|
|
|
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
|
|
|
|
except (ccxt.OperationFailed, ccxt.ExchangeError) as e:
|
|
|
|
|
raise TemporaryError(
|
|
|
|
|
f"Could not place stoploss order due to {e.__class__.__name__}. "
|
|
|
|
|
f"Message: {e}") from e
|
|
|
|
|
@@ -1290,7 +1290,7 @@ class Exchange:
|
|
|
|
|
f'Tried to get an invalid order (pair: {pair} id: {order_id}). Message: {e}') from e
|
|
|
|
|
except ccxt.DDoSProtection as e:
|
|
|
|
|
raise DDosProtection(e) from e
|
|
|
|
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
|
|
|
|
except (ccxt.OperationFailed, ccxt.ExchangeError) as e:
|
|
|
|
|
raise TemporaryError(
|
|
|
|
|
f'Could not get order due to {e.__class__.__name__}. Message: {e}') from e
|
|
|
|
|
except ccxt.BaseError as e:
|
|
|
|
|
@@ -1315,7 +1315,7 @@ class Exchange:
|
|
|
|
|
f'Tried to get an invalid order (pair: {pair} id: {order_id}). Message: {e}') from e
|
|
|
|
|
except ccxt.DDoSProtection as e:
|
|
|
|
|
raise DDosProtection(e) from e
|
|
|
|
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
|
|
|
|
except (ccxt.OperationFailed, ccxt.ExchangeError) as e:
|
|
|
|
|
raise TemporaryError(
|
|
|
|
|
f'Could not get order due to {e.__class__.__name__}. Message: {e}') from e
|
|
|
|
|
except ccxt.BaseError as e:
|
|
|
|
|
@@ -1367,7 +1367,7 @@ class Exchange:
|
|
|
|
|
f'Could not cancel order. Message: {e}') from e
|
|
|
|
|
except ccxt.DDoSProtection as e:
|
|
|
|
|
raise DDosProtection(e) from e
|
|
|
|
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
|
|
|
|
except (ccxt.OperationFailed, ccxt.ExchangeError) as e:
|
|
|
|
|
raise TemporaryError(
|
|
|
|
|
f'Could not cancel order due to {e.__class__.__name__}. Message: {e}') from e
|
|
|
|
|
except ccxt.BaseError as e:
|
|
|
|
|
@@ -1449,7 +1449,7 @@ class Exchange:
|
|
|
|
|
return balances
|
|
|
|
|
except ccxt.DDoSProtection as e:
|
|
|
|
|
raise DDosProtection(e) from e
|
|
|
|
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
|
|
|
|
except (ccxt.OperationFailed, ccxt.ExchangeError) as e:
|
|
|
|
|
raise TemporaryError(
|
|
|
|
|
f'Could not get balance due to {e.__class__.__name__}. Message: {e}') from e
|
|
|
|
|
except ccxt.BaseError as e:
|
|
|
|
|
@@ -1473,7 +1473,7 @@ class Exchange:
|
|
|
|
|
return positions
|
|
|
|
|
except ccxt.DDoSProtection as e:
|
|
|
|
|
raise DDosProtection(e) from e
|
|
|
|
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
|
|
|
|
except (ccxt.OperationFailed, ccxt.ExchangeError) as e:
|
|
|
|
|
raise TemporaryError(
|
|
|
|
|
f'Could not get positions due to {e.__class__.__name__}. Message: {e}') from e
|
|
|
|
|
except ccxt.BaseError as e:
|
|
|
|
|
@@ -1517,7 +1517,7 @@ class Exchange:
|
|
|
|
|
return orders
|
|
|
|
|
except ccxt.DDoSProtection as e:
|
|
|
|
|
raise DDosProtection(e) from e
|
|
|
|
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
|
|
|
|
except (ccxt.OperationFailed, ccxt.ExchangeError) as e:
|
|
|
|
|
raise TemporaryError(
|
|
|
|
|
f'Could not fetch positions due to {e.__class__.__name__}. Message: {e}') from e
|
|
|
|
|
except ccxt.BaseError as e:
|
|
|
|
|
@@ -1538,7 +1538,7 @@ class Exchange:
|
|
|
|
|
return trading_fees
|
|
|
|
|
except ccxt.DDoSProtection as e:
|
|
|
|
|
raise DDosProtection(e) from e
|
|
|
|
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
|
|
|
|
except (ccxt.OperationFailed, ccxt.ExchangeError) as e:
|
|
|
|
|
raise TemporaryError(
|
|
|
|
|
f'Could not fetch trading fees due to {e.__class__.__name__}. Message: {e}') from e
|
|
|
|
|
except ccxt.BaseError as e:
|
|
|
|
|
@@ -1569,7 +1569,7 @@ class Exchange:
|
|
|
|
|
f'Message: {e}') from e
|
|
|
|
|
except ccxt.DDoSProtection as e:
|
|
|
|
|
raise DDosProtection(e) from e
|
|
|
|
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
|
|
|
|
except (ccxt.OperationFailed, ccxt.ExchangeError) as e:
|
|
|
|
|
raise TemporaryError(
|
|
|
|
|
f'Could not load bids/asks due to {e.__class__.__name__}. Message: {e}') from e
|
|
|
|
|
except ccxt.BaseError as e:
|
|
|
|
|
@@ -1606,7 +1606,7 @@ class Exchange:
|
|
|
|
|
raise TemporaryError from e
|
|
|
|
|
except ccxt.DDoSProtection as e:
|
|
|
|
|
raise DDosProtection(e) from e
|
|
|
|
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
|
|
|
|
except (ccxt.OperationFailed, ccxt.ExchangeError) as e:
|
|
|
|
|
raise TemporaryError(
|
|
|
|
|
f'Could not load tickers due to {e.__class__.__name__}. Message: {e}') from e
|
|
|
|
|
except ccxt.BaseError as e:
|
|
|
|
|
@@ -1624,7 +1624,7 @@ class Exchange:
|
|
|
|
|
return data
|
|
|
|
|
except ccxt.DDoSProtection as e:
|
|
|
|
|
raise DDosProtection(e) from e
|
|
|
|
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
|
|
|
|
except (ccxt.OperationFailed, ccxt.ExchangeError) as e:
|
|
|
|
|
raise TemporaryError(
|
|
|
|
|
f'Could not load ticker due to {e.__class__.__name__}. Message: {e}') from e
|
|
|
|
|
except ccxt.BaseError as e:
|
|
|
|
|
@@ -1665,7 +1665,7 @@ class Exchange:
|
|
|
|
|
f'Message: {e}') from e
|
|
|
|
|
except ccxt.DDoSProtection as e:
|
|
|
|
|
raise DDosProtection(e) from e
|
|
|
|
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
|
|
|
|
except (ccxt.OperationFailed, ccxt.ExchangeError) as e:
|
|
|
|
|
raise TemporaryError(
|
|
|
|
|
f'Could not get order book due to {e.__class__.__name__}. Message: {e}') from e
|
|
|
|
|
except ccxt.BaseError as e:
|
|
|
|
|
@@ -1844,7 +1844,7 @@ class Exchange:
|
|
|
|
|
return matched_trades
|
|
|
|
|
except ccxt.DDoSProtection as e:
|
|
|
|
|
raise DDosProtection(e) from e
|
|
|
|
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
|
|
|
|
except (ccxt.OperationFailed, ccxt.ExchangeError) as e:
|
|
|
|
|
raise TemporaryError(
|
|
|
|
|
f'Could not get trades due to {e.__class__.__name__}. Message: {e}') from e
|
|
|
|
|
except ccxt.BaseError as e:
|
|
|
|
|
@@ -1878,7 +1878,7 @@ class Exchange:
|
|
|
|
|
price=price, takerOrMaker=taker_or_maker)['rate']
|
|
|
|
|
except ccxt.DDoSProtection as e:
|
|
|
|
|
raise DDosProtection(e) from e
|
|
|
|
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
|
|
|
|
except (ccxt.OperationFailed, ccxt.ExchangeError) as e:
|
|
|
|
|
raise TemporaryError(
|
|
|
|
|
f'Could not get fee info due to {e.__class__.__name__}. Message: {e}') from e
|
|
|
|
|
except ccxt.BaseError as e:
|
|
|
|
|
@@ -2262,7 +2262,7 @@ class Exchange:
|
|
|
|
|
f'candle (OHLCV) data. Message: {e}') from e
|
|
|
|
|
except ccxt.DDoSProtection as e:
|
|
|
|
|
raise DDosProtection(e) from e
|
|
|
|
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
|
|
|
|
except (ccxt.OperationFailed, ccxt.ExchangeError) as e:
|
|
|
|
|
raise TemporaryError(f'Could not fetch historical candle (OHLCV) data '
|
|
|
|
|
f'for pair {pair} due to {e.__class__.__name__}. '
|
|
|
|
|
f'Message: {e}') from e
|
|
|
|
|
@@ -2322,7 +2322,7 @@ class Exchange:
|
|
|
|
|
f'Message: {e}') from e
|
|
|
|
|
except ccxt.DDoSProtection as e:
|
|
|
|
|
raise DDosProtection(e) from e
|
|
|
|
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
|
|
|
|
except (ccxt.OperationFailed, ccxt.ExchangeError) as e:
|
|
|
|
|
raise TemporaryError(f'Could not load trade history due to {e.__class__.__name__}. '
|
|
|
|
|
f'Message: {e}') from e
|
|
|
|
|
except ccxt.BaseError as e:
|
|
|
|
|
@@ -2521,7 +2521,7 @@ class Exchange:
|
|
|
|
|
return sum(fee['amount'] for fee in funding_history)
|
|
|
|
|
except ccxt.DDoSProtection as e:
|
|
|
|
|
raise DDosProtection(e) from e
|
|
|
|
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
|
|
|
|
except (ccxt.OperationFailed, ccxt.ExchangeError) as e:
|
|
|
|
|
raise TemporaryError(
|
|
|
|
|
f'Could not get funding fees due to {e.__class__.__name__}. Message: {e}') from e
|
|
|
|
|
except ccxt.BaseError as e:
|
|
|
|
|
@@ -2533,7 +2533,7 @@ class Exchange:
|
|
|
|
|
return self._api.fetch_leverage_tiers()
|
|
|
|
|
except ccxt.DDoSProtection as e:
|
|
|
|
|
raise DDosProtection(e) from e
|
|
|
|
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
|
|
|
|
except (ccxt.OperationFailed, ccxt.ExchangeError) as e:
|
|
|
|
|
raise TemporaryError(
|
|
|
|
|
f'Could not load leverage tiers due to {e.__class__.__name__}. Message: {e}'
|
|
|
|
|
) from e
|
|
|
|
|
@@ -2548,7 +2548,7 @@ class Exchange:
|
|
|
|
|
return symbol, tier
|
|
|
|
|
except ccxt.DDoSProtection as e:
|
|
|
|
|
raise DDosProtection(e) from e
|
|
|
|
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
|
|
|
|
except (ccxt.OperationFailed, ccxt.ExchangeError) as e:
|
|
|
|
|
raise TemporaryError(
|
|
|
|
|
f'Could not load leverage tiers for {symbol}'
|
|
|
|
|
f' due to {e.__class__.__name__}. Message: {e}'
|
|
|
|
|
@@ -2762,7 +2762,7 @@ class Exchange:
|
|
|
|
|
if not accept_fail:
|
|
|
|
|
raise TemporaryError(
|
|
|
|
|
f'Could not set leverage due to {e.__class__.__name__}. Message: {e}') from e
|
|
|
|
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
|
|
|
|
except (ccxt.OperationFailed, ccxt.ExchangeError) as e:
|
|
|
|
|
raise TemporaryError(
|
|
|
|
|
f'Could not set leverage due to {e.__class__.__name__}. Message: {e}') from e
|
|
|
|
|
except ccxt.BaseError as e:
|
|
|
|
|
@@ -2804,7 +2804,7 @@ class Exchange:
|
|
|
|
|
if not accept_fail:
|
|
|
|
|
raise TemporaryError(
|
|
|
|
|
f'Could not set margin mode due to {e.__class__.__name__}. Message: {e}') from e
|
|
|
|
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
|
|
|
|
except (ccxt.OperationFailed, ccxt.ExchangeError) as e:
|
|
|
|
|
raise TemporaryError(
|
|
|
|
|
f'Could not set margin mode due to {e.__class__.__name__}. Message: {e}') from e
|
|
|
|
|
except ccxt.BaseError as e:
|
|
|
|
|
|