global_status now includes currency

This commit is contained in:
Nicolás Sánchez 2025-03-13 12:41:39 -03:00
parent 866a130c35
commit 17a5081f8a
2 changed files with 6 additions and 2 deletions

View File

@ -33,6 +33,9 @@ class earner:
def __str__(self):
return str(self.connector)
def get_currency(self):
return self.currency
def write_to_log(self,message):
with open("earn.log", "a") as f:
f.write(datetime.datetime.now().strftime(f"[%Y/%m/%d %H:%M:%S] {str(self.connector).upper()} | {message}\n"))

View File

@ -129,7 +129,8 @@ def get_global_status():
if "X-API-KEY" in request.headers and request.headers.get("X-API-KEY") in valid_keys:
response = {}
for item in earners:
response[str(item.connector)] = {"trading_balance": item.get_trading_balance(),
response[str(item.connector)] = {"currency": item.get_currency(),
"trading_balance": item.get_trading_balance(),
"earning_balance": item.get_earning_balance(),
"is_paused": item.get_is_paused(),
"step_size": item.get_step_size(),
@ -480,7 +481,7 @@ def run_API(port):
if __name__=="__main__":
version = "2025.03.10"
version = "2025.03.13"
start_time = time.time()
with open("config.json") as f: