From e5faaaacad328bb60085e1d898b6ef9413f2553d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20S=C3=A1nchez?= Date: Mon, 23 Jun 2025 17:47:20 -0300 Subject: [PATCH] commander update --- utils/commander.py | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/utils/commander.py b/utils/commander.py index 7743c85..d4159bc 100644 --- a/utils/commander.py +++ b/utils/commander.py @@ -45,7 +45,7 @@ EARN 39) set_time_between_redemptions 40) get_minimum_amount_in_trading_account 41) set_minimum_amount_in_trading_account 42) get_last_subscription 43) get_last_redemption 44) get_total_balance -45) get_global_status +45) get_global_status 46) subscribe 47) redeem TRADERS 51) worker_status 52) get_all_worker_status @@ -444,7 +444,37 @@ if __name__=="__main__": print("get_global_status returns the status of all the earners.") url = f"{base_url}/earn/get_global_status" print(json.loads(requests.get(url,headers=earn_headers).content)) - input("Press ENTER to continue ") + input("Press ENTER to continue ") + + elif command==46: + print("subscribe forces funds subscription") + amount_to_subscribe = input("Enter the amount to subscribe: ") + if not validate_float_or_int(amount_to_subscribe): + print("The input is invalid") + break + if input("Proceed? (Y/n) ") in ["Y","y",""]: + url = f"{base_url}/earn/subscribe" + parameters = { + "broker": earn_broker, + "amount": amount_to_subscribe} + print(json.loads(requests.post(url,headers=earn_headers, json=parameters).content)) + input("Press ENTER to continue ") + + elif command==47: + print("redeem forces funds redemption") + amount_to_redeem = input("Enter the amount to redeem: ") + if not validate_float_or_int(amount_to_redeem): + print("The input is invalid") + break + if input("Proceed? (Y/n) ") in ["Y","y",""]: + url = f"{base_url}/earn/redeem" + parameters = { + "broker": earn_broker, + "amount": amount_to_redeem} + print(json.loads(requests.post(url,headers=earn_headers, json=parameters).content)) + input("Press ENTER to continue ") + + ###################### ####### TRADER #######