Skip to content

Commit

Permalink
feat: add log_responses to /balance endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
xmatthias authored Nov 26, 2024
1 parent 472132c commit e0c6cc1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions freqtrade/exchange/exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -1657,6 +1657,7 @@ def get_balances(self) -> CcxtBalances:
balances.pop("total", None)
balances.pop("used", None)

self._log_exchange_response("fetch_balances", balances)
return balances
except ccxt.DDoSProtection as e:
raise DDosProtection(e) from e
Expand Down
3 changes: 2 additions & 1 deletion freqtrade/exchange/kraken.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def get_balances(self) -> CcxtBalances:
balances.pop("free", None)
balances.pop("total", None)
balances.pop("used", None)

self._log_exchange_response("fetch_balances", balances)
orders = self._api.fetch_open_orders()
order_list = [
(
Expand All @@ -86,6 +86,7 @@ def get_balances(self) -> CcxtBalances:
balances[bal]["used"] = sum(order[1] for order in order_list if order[0] == bal)
balances[bal]["free"] = balances[bal]["total"] - balances[bal]["used"]

self._log_exchange_response("fetch_balances2", balances)
return balances
except ccxt.DDoSProtection as e:
raise DDosProtection(e) from e
Expand Down

0 comments on commit e0c6cc1

Please sign in to comment.