X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=ccxt_wrapper.py;h=260d49dccbe2a2221b79fe8c36be70d940a24ab3;hb=90d7423eec074a0ed0af680c223180f8d7e1d4e6;hp=4ed37d9376e53f9935c21db0c40944eb9daef95b;hpb=45fffd4963005a1f3957868f9ddb1aa7ec66c0e3;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FTrader.git diff --git a/ccxt_wrapper.py b/ccxt_wrapper.py index 4ed37d9..260d49d 100644 --- a/ccxt_wrapper.py +++ b/ccxt_wrapper.py @@ -21,7 +21,7 @@ class poloniexE(poloniex): Wrapped to allow retry of non-posting requests" """ - origin_request = super(poloniexE, self).request + origin_request = super().request kwargs = { "api": api, "method": method, @@ -33,12 +33,12 @@ class poloniexE(poloniex): retriable = any(re.match(call, path) for call in self.RETRIABLE_CALLS) if api == "public" or method == "GET" or retriable: return retry_call(origin_request, fargs=[path], fkwargs=kwargs, - tries=10, delay=1, exceptions=(RequestTimeout,)) + tries=10, delay=1, exceptions=(RequestTimeout, InvalidNonce)) else: return origin_request(path, **kwargs) def __init__(self, *args, **kwargs): - super(poloniexE, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) # For requests logging self.session.origin_request = self.session.request @@ -223,7 +223,7 @@ class poloniexE(poloniex): return all_balances def create_exchange_order(self, symbol, type, side, amount, price=None, params={}): - return super(poloniexE, self).create_order(symbol, type, side, amount, price=price, params=params) + return super().create_order(symbol, type, side, amount, price=price, params=params) def create_margin_order(self, symbol, type, side, amount, price=None, lending_rate=None, params={}): if type == 'market':