Repository navigation
Expand file tree
/
Copy pathmain.py
More file actions
62 lines (50 loc) · 1.71 KB
/
Copy pathmain.py
File metadata and controls
62 lines (50 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
from random import randint, uniform
from time import sleep
import ccxt
from tqdm import tqdm
import config
from ccxt.base.errors import InsufficientFunds
from Logs.Loging import log
def sleeping(from_sleep: int, to_sleep: int) -> None:
x = randint(from_sleep, to_sleep)
for _ in tqdm(range(x), desc='sleep ', bar_format='{desc}: {n_fmt}/{total_fmt}'):
sleep(1)
def binance_withdraw(address: str) -> None:
try:
exchange = ccxt.binance({
'apiKey': config.api_key,
'secret': config.secret_key,
'enableRateLimit': False,
'options': {
'defaultType': 'spot'
}
})
rand = {1: randint, 2: uniform}
value = rand[config.randoms](config.value[0], config.value[1])
if isinstance(value, float):
value = round(value, 4)
exchange.withdraw(
code=config.token,
amount=value,
address=address,
params={
"network": config.ntwork
}
)
log(address).success(f'The output is successful token({config.token}), value({value})')
except InsufficientFunds as error:
if str(error) == 'binance {"code":-4026,"msg":"User has insufficient balance"}':
log(address).error(f'Not enough balance - {address}')
except BaseException as error:
log(address).error(error)
def wallet() -> list:
with open('wallet.txt', 'r') as file:
wallets = file.read().splitlines()
return wallets
def main() -> None:
wallets = wallet()
for address in wallets:
binance_withdraw(address)
sleeping(config.Delay[0], config.Delay[1])
if __name__ == "__main__":
main()