feat: add log_responses to /balance endpoint

part of #10994
This commit is contained in:
Matthias
2024-11-26 10:23:03 +01:00
committed by GitHub
parent 472132c236
commit e0c6cc1563
2 changed files with 3 additions and 1 deletions

View File

@@ -1657,6 +1657,7 @@ class Exchange:
balances.pop("total", None) balances.pop("total", None)
balances.pop("used", None) balances.pop("used", None)
self._log_exchange_response("fetch_balances", balances)
return balances return balances
except ccxt.DDoSProtection as e: except ccxt.DDoSProtection as e:
raise DDosProtection(e) from e raise DDosProtection(e) from e

View File

@@ -68,7 +68,7 @@ class Kraken(Exchange):
balances.pop("free", None) balances.pop("free", None)
balances.pop("total", None) balances.pop("total", None)
balances.pop("used", None) balances.pop("used", None)
self._log_exchange_response("fetch_balances", balances)
orders = self._api.fetch_open_orders() orders = self._api.fetch_open_orders()
order_list = [ order_list = [
( (
@@ -86,6 +86,7 @@ class Kraken(Exchange):
balances[bal]["used"] = sum(order[1] for order in order_list if order[0] == bal) balances[bal]["used"] = sum(order[1] for order in order_list if order[0] == bal)
balances[bal]["free"] = balances[bal]["total"] - balances[bal]["used"] balances[bal]["free"] = balances[bal]["total"] - balances[bal]["used"]
self._log_exchange_response("fetch_balances2", balances)
return balances return balances
except ccxt.DDoSProtection as e: except ccxt.DDoSProtection as e:
raise DDosProtection(e) from e raise DDosProtection(e) from e