fixed error with exchange.fill_leverage_tiers
This commit is contained in:
parent
41d8330fbc
commit
18b4d0be95
@ -252,12 +252,10 @@ class Binance(Exchange):
|
|||||||
Path(__file__).parent / 'binance_leverage_tiers.json'
|
Path(__file__).parent / 'binance_leverage_tiers.json'
|
||||||
)
|
)
|
||||||
with open(leverage_tiers_path) as json_file:
|
with open(leverage_tiers_path) as json_file:
|
||||||
leverage_tiers = json.load(json_file)
|
return json.load(json_file)
|
||||||
return leverage_tiers
|
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
leverage_tiers = self._api.fetch_leverage_tiers()
|
return self._api.fetch_leverage_tiers()
|
||||||
return leverage_tiers
|
|
||||||
except ccxt.DDoSProtection as e:
|
except ccxt.DDoSProtection as e:
|
||||||
raise DDosProtection(e) from e
|
raise DDosProtection(e) from e
|
||||||
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
||||||
|
@ -1880,10 +1880,10 @@ class Exchange:
|
|||||||
"""
|
"""
|
||||||
leverage_tiers = self.load_leverage_tiers()
|
leverage_tiers = self.load_leverage_tiers()
|
||||||
for pair, tiers in leverage_tiers.items():
|
for pair, tiers in leverage_tiers.items():
|
||||||
tiers = []
|
pair_tiers = []
|
||||||
for tier in tiers:
|
for tier in tiers:
|
||||||
tiers.append(self.parse_leverage_tier(tier))
|
pair_tiers.append(self.parse_leverage_tier(tier))
|
||||||
self._leverage_tiers[pair] = tiers
|
self._leverage_tiers[pair] = pair_tiers
|
||||||
|
|
||||||
def parse_leverage_tier(self, tier) -> Dict:
|
def parse_leverage_tier(self, tier) -> Dict:
|
||||||
info = tier['info']
|
info = tier['info']
|
||||||
|
Loading…
Reference in New Issue
Block a user