Disable automatic withdrawals

This commit is contained in:
Mark Veidemanis 2022-02-15 22:28:14 +00:00
parent 1dbdb3acc7
commit 9a50865480
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 8 additions and 4 deletions

View File

@ -685,10 +685,12 @@ class Agora(object):
rtrn = self.agora._api_call(api_method=f"contact_release/{contact_id}", http_method="POST", query_values=payload)
# Check if we can withdraw funds
self.withdraw_funds()
# TODO: write test for withdraw_funds before re-enabling
# self.withdraw_funds()
return rtrn
# TODO: write test before re-enabling adding total_trades
@handle_exceptions
def withdraw_funds(self):
"""
@ -705,12 +707,14 @@ class Agora(object):
# Get the wallet balances in USD
total_usd = totals_all[0][1]
print("total_usd", total_usd)
total_trades_usd = self.tx.get_open_trades_usd()
print("total_trades_usd", total_trades_usd)
print("UNUSED total_trades_usd", total_trades_usd)
if not total_usd:
return False
total_usd += total_trades_usd
print("total_usd after trades add", total_usd)
# total_usd += total_trades_usd
# print("total_usd after trades add", total_usd)
profit_usd = total_usd - float(settings.Money.BaseUSD)
print("profit_usd", profit_usd)
# Get the XMR -> USD exchange rate