-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbinance_withdraw.py
61 lines (51 loc) · 1.83 KB
/
binance_withdraw.py
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
"""
@ Author: Mr.Hat
@ Date: 2024/4/7 19:45
@ Description:
@ History:
"""
import os
import time
import ccxt
from loguru import logger
import random
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'
}
})
try:
account_binance.withdraw(
code=symbolWithdraw,
amount=amount_to_withdrawal,
address=address,
tag=None,
params={
"network": network
}
)
logger.success(f">>> 转账至 | {address} | {amount_to_withdrawal}")
except Exception as error:
logger.error(f">>> 转账至 | {address} | 出错 : {error}")
if __name__ == "__main__":
current_directory = os.path.dirname(os.path.abspath(__file__))
# 从多个文件中读取钱包数据
file_name = os.path.join(current_directory, "data", "wallets.txt")
with open(file_name, "r") as f:
wallets_list = [row.strip() for row in f]
symbolWithdraw = 'BNB'
network = 'BSC' # ETH | BSC | AVAXC | MATIC | ARBITRUM | OPTIMISM | APT
# 填入Binance的账户私钥,这里需要绑定一个IP,如果使用本地代理,绑定代理IP,如果使用服务器,绑定服务器IP。
API_KEY = ""
API_SECRET = ""
AMOUNT_FROM = 0.011
AMOUNT_TO = 0.015
logger.info('...............开始转账...............')
for wallet in wallets_list:
amount_to_withdrawal = round(random.uniform(AMOUNT_FROM, AMOUNT_TO), 6) # amount from ... to ...
binance_withdraw(wallet, amount_to_withdrawal, symbolWithdraw, network, API_KEY, API_SECRET)
time.sleep(random.randint(10, 30))