From b8fbbb0d41cc911559c8747544c9fac48f254428 Mon Sep 17 00:00:00 2001 From: catalyst002 <108342453+catalyst002@users.noreply.github.com> Date: Sat, 18 Mar 2023 11:55:48 +0700 Subject: [PATCH] Update main.py --- main.py | 68 ++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 23 deletions(-) diff --git a/main.py b/main.py index 967ab69..590c408 100644 --- a/main.py +++ b/main.py @@ -3,25 +3,19 @@ from termcolor import cprint import random +API_KEY = "" +API_SECRET = "" -def binance_withdraw(address, amount_to_withdrawal, symbolWithdraw, network, API_KEY, API_SECRET): - account_binance = ccxt.binance({ - 'apiKey': API_KEY, - 'secret': API_SECRET, - 'enableRateLimit': True, - 'options': { - 'defaultType': 'spot' - } - }) +def binance_withdraw(address, amount_to_withdrawal, symbolWithdraw, network, API_KEY, API_SECRET): try: account_binance.withdraw( - code = symbolWithdraw, - amount = amount_to_withdrawal, - address = address, - tag = None, - params = { + code=symbolWithdraw, + amount=amount_to_withdrawal, + address=address, + tag=None, + params={ "network": network } ) @@ -29,22 +23,50 @@ def binance_withdraw(address, amount_to_withdrawal, symbolWithdraw, network, API except Exception as error: cprint(f">>> Неудачно | {address} | ошибка : {error}", "red") + if __name__ == "__main__": - + with open("wallets.txt", "r") as f: wallets_list = [row.strip() for row in f] + account_binance = ccxt.binance({ + 'apiKey': API_KEY, + 'secret': API_SECRET, + 'enableRateLimit': True, + 'options': { + 'defaultType': 'spot' + } + }) + + balances = account_binance.fetch_balance()['info']['balances'] + for i in balances: + if i['asset'] == 'ETH': + balance = i['free'] + print(f'Your ETH balance is {balance}') + break + symbolWithdraw = 'ETH' - network = 'Arbitrum' + network = '' + + network_input = int( + input('Select Chain (min amount): \n 1. ETH 0.0098 \n 2. ARB 0.0008 \n 3. OP 0.001 \n 4. BSC 0.00011 \n ')) - # api_keys of binance - API_KEY = "your_api_key" - API_SECRET = "your_api_secret" + match (network_input): + case (1): + network = 'ETH' + case (2): + network = 'Arbitrum' + case (3): + network = 'Optimism' + case (4): + network = 'BSC' + + amount_input = float(input('Input amount of ETH: ')) cprint('\a\n/// start withdrawing...', 'white') for wallet in wallets_list: - amount_to_withdrawal = round(random.uniform(0.001, 0.002), 6) # amount from ... to ... - binance_withdraw(wallet, amount_to_withdrawal, symbolWithdraw, network, API_KEY, API_SECRET) + # amount from ... to ... + amount_to_withdrawal = amount_input + binance_withdraw(wallet, amount_to_withdrawal, + symbolWithdraw, network, API_KEY, API_SECRET) time.sleep(random.randint(10, 30)) - -