From 77422b95cdcb24db6256ee39d5799c5a7aa66fbd Mon Sep 17 00:00:00 2001 From: QWERTZ4 <89351893+QWERTZ4@users.noreply.github.com> Date: Fri, 27 Aug 2021 11:37:58 +0200 Subject: [PATCH] Added option to start mining rig Start mining rig with my_accounts = private_api.get_accounts() status = private_api.start_rig(rig_id) print(status) --- python/nicehash.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/python/nicehash.py b/python/nicehash.py index 99e951b..b73947b 100644 --- a/python/nicehash.py +++ b/python/nicehash.py @@ -292,6 +292,24 @@ def create_exchange_sell_market_order(self, market, quantity): def cancel_exchange_order(self, market, order_id): query = "market={}&orderId={}".format(market, order_id) return self.request('DELETE', '/exchange/api/v2/order', query, None) + + def start_rig(self, rig_id): + + rig_data = { + "rigId": rig_id, + "action": "START" + } + return self.request('POST', '/main/api/v2/mining/rigs/status2', '', + rig_data) + + def stop_rig(self, rig_id): + + rig_data = { + "rigId": rig_id, + "action": "STOP" + } + return self.request('POST', '/main/api/v2/mining/rigs/status2', '', + rig_data) if __name__ == "__main__":