-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathconfig.py
More file actions
36 lines (28 loc) · 1.08 KB
/
config.py
File metadata and controls
36 lines (28 loc) · 1.08 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
# -*- coding: utf-8 -*-
"""Configuration loader for AutoStaking BOT — accounts and proxy lists."""
from pathlib import Path
BASE_DIR = Path(__file__).parent
def load_accounts() -> list[str]:
"""Load private keys from accounts.txt (one per line, with or without 0x)."""
accounts_path = BASE_DIR / "accounts.txt"
if not accounts_path.exists():
return []
accounts: list[str] = []
with open(accounts_path, "r", encoding="utf-8") as f:
for line in f:
key = line.strip()
if key and not key.startswith("#"):
accounts.append(key)
return accounts
def load_proxies() -> list[str]:
"""Load proxy list from proxy.txt (ip:port or protocol://...)."""
proxy_path = BASE_DIR / "proxy.txt"
if not proxy_path.exists():
return []
proxies: list[str] = []
with open(proxy_path, "r", encoding="utf-8") as f:
for line in f:
proxy = line.strip()
if proxy and not proxy.startswith("#"):
proxies.append(proxy)
return proxies