├── README.md
├── lock.py
├── main.py
├── proxies.txt
├── referral.py
└── requirements.txt
/README.md:
--------------------------------------------------------------------------------
1 |
2 | Automation for l a y e r e d g e
3 |
4 |
5 | # How to Use
6 |
7 | ## Auto Claim Daily and Start Light Node
8 |
9 | 1. Make sure Python and Git are installed on your device.
10 |
11 | 2. Clone this repository:
12 |
13 | ```
14 | git clone https://github.com/akasakaid/lazy-yerge.git
15 | ```
16 |
17 | 3. Navigate into the `lazy-yerge` folder:
18 |
19 | ```
20 | cd lazy-yerge
21 | ```
22 |
23 | 4. Install the required libraries:
24 |
25 | ```
26 | pip install -r requirements.txt
27 | ```
28 |
29 | 5. Run the `main.py` file:
30 |
31 | ```
32 | python main.py
33 | ```
34 |
35 |
36 | ## Auto Referral
37 |
38 | 1. Make sure Python and Git are installed on your device.
39 |
40 | 2. Clone this repository:
41 |
42 | ```
43 | git clone https://github.com/akasakaid/lazy-yerge.git
44 | ```
45 |
46 | 3. Navigate into the `lazy-yerge` folder:
47 |
48 | ```
49 | cd lazy-yerge
50 | ```
51 |
52 | 4. Install the required libraries:
53 |
54 | ```
55 | pip install -r requirements.txt
56 | ```
57 |
58 | 5. Run the `referral.py` file:
59 |
60 | ```
61 | python referral.py
62 | ```
63 | 6. The account results (private keys) will be saved in the `privatekeys.txt` file.
64 |
65 | # Buy me a coffee
66 |
67 | - [https://sociabuzz.com/fawwazthoerif/tribe](https://sociabuzz.com/fawwazthoerif/tribe)
68 |
69 | # Discussion and Contact
70 |
71 | Telegram group: t.me/sdsproject_chat
72 |
--------------------------------------------------------------------------------
/lock.py:
--------------------------------------------------------------------------------
1 | import os
2 | import sys
3 | import time
4 | import web3
5 | import json
6 | import string
7 | import random
8 | import requests
9 | import ua_generator
10 | from datetime import datetime, timedelta
11 | from eth_account.messages import encode_defunct
12 | from base64 import b64decode
13 |
14 |
15 | def log(msg):
16 | now = datetime.now().isoformat(" ").split(".")[0]
17 | print(f"[{now}] {msg}")
18 |
19 |
20 | def ipinfo(ses):
21 | try:
22 | res = http(ses=ses, url="https://api64.ipify.org")
23 | log(f"ip proxy : {res.text}")
24 | return res.text
25 | except KeyboardInterrupt:
26 | sys.exit()
27 | except:
28 | log("ip proxy : None")
29 |
30 |
31 | def http(ses: requests.Session, url, data=None):
32 | attemp = 0
33 | while True:
34 | try:
35 | if attemp == 3:
36 | return None
37 | if data is None:
38 | res = ses.get(url=url)
39 | elif data == "":
40 | res = ses.post(url=url)
41 | else:
42 | res = ses.post(url=url, data=data)
43 | if (
44 | not os.path.exists("http.log")
45 | or os.path.getsize("http.log") / 1024 > 1024
46 | ):
47 | open("http.log", "a")
48 | open("http.log", "a").write(f"{res.status_code} {res.text}\n")
49 | if "
502 Bad Gateway" in res.text:
50 | log("error : 502 bad gateway !")
51 | time.sleep(3)
52 | continue
53 | if "504 Gateway Time-out" in res.text:
54 | log("error : 504 gateway timeout !")
55 | time.sleep(3)
56 | continue
57 | return res
58 | except (
59 | requests.exceptions.ConnectTimeout,
60 | requests.exceptions.ConnectionError,
61 | requests.exceptions.ReadTimeout,
62 | requests.exceptions.ProxyError,
63 | ):
64 | log("connection error !")
65 | attemp += 1
66 |
67 |
68 | def lock(privatekey, proxy=None):
69 | ses = requests.Session()
70 | ses.proxies.update({"http": proxy, "https": proxy})
71 | ip = ipinfo(ses=ses)
72 | if ip is None:
73 | return "bad_proxy"
74 | wallet = web3.Account.from_key(privatekey)
75 | address = wallet.address
76 | log(f"addr : {address}")
77 | data_lock = {
78 | "userId": "67975c953d8d8ab4310ed8af",
79 | "restakePoints": 480655,
80 | "sign": "0x7f7d7e4af7bb8945597eef4c1d4e4a9830377fef5c74c72f6bf7724a4eaf203d0c004762e538d7d02cd5a99e16371df42e360f6b9cd2cead705b560a676cb0291b",
81 | "timestamp": "1745657510009",
82 | "captchaToken": "03AFcWeA52dyLAIHTqCl1DDYtCPQEqJC5oTCi6rrlGjCrhqbfTM1SUh25a6_wgKx19PYQXT8bdmPCfK5jaEDIM5pYX9oi5XX7v2CSYig5b9Eh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io/api/epoch/restake-previous-epoch-points"
85 | wallet_detail_url = (
86 | f"https://api.layeredge.io/api/referral/wallet-details/{address}"
87 | )
88 | headers = {
89 | "Accept": "application/json, text/plain, */*",
90 | "Accept-Language": "en-US,en;q=0.9",
91 | "Connection": "keep-alive",
92 | "Host": "api.layeredge.io",
93 | "Origin": "https://dashboard.layeredge.io",
94 | "Referer": "https://dashboard.layeredge.io/",
95 | "sec-ch-ua": '"Google Chrome";v="135", "Not-A.Brand";v="8", "Chromium";v="135"',
96 | "sec-ch-ua-mobile": "?0",
97 | "sec-ch-ua-platform": '"Windows"',
98 | "Sec-Fetch-Dest": "empty",
99 | "Sec-Fetch-Mode": "cors",
100 | "Sec-Fetch-Site": "same-site",
101 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36",
102 | }
103 | ses.headers.update(headers)
104 | res = http(ses=ses, url=wallet_detail_url)
105 | if res is None:
106 | return "bad_proxy"
107 | message = res.json().get('message')
108 | if message == "user not found":
109 | log("user not found ???")
110 | return False
111 | userid = res.json().get("data", {}).get("id")
112 | poh_point = res.json().get("data", {}).get("pohPoints")
113 | if poh_point <= 0:
114 | log("not eligible for phase 1 & 2.")
115 | else:
116 | log("eligible for phase 1 & 2.")
117 | return True
118 | data_lock["userId"] = userid
119 | timestamp_now = int(datetime.now().timestamp() * 1000)
120 | data_lock["timestamp"] = str(timestamp_now)
121 | epoch_status_url = f"https://api.layeredge.io/api/epoch/epoch-stats/{userid}"
122 | res = http(ses=ses, url=epoch_status_url)
123 | if res is None:
124 | return "bad_proxy"
125 | total_point = res.json().get("data", {}).get("totalPoints")
126 | restake_point = res.json().get("data", {}).get("restakePoints")
127 | log(f"total point : {total_point}")
128 | if restake_point == total_point:
129 | log("already stake/lock point !")
130 | return True
131 | data_lock["restakePoints"] = total_point
132 | message_sign = (
133 | f"locking my points for my wallet {wallet.address} and {timestamp_now}"
134 | )
135 | encode_message_sign = encode_defunct(text=message_sign)
136 | sign = web3.Web3.to_hex(
137 | web3.Account.sign_message(encode_message_sign, private_key=wallet.key).signature
138 | )
139 | data_lock["sign"] = sign
140 | ses2 = requests.Session()
141 | headers2 = {
142 | "User-Agent": "SdsProject/7.7.7",
143 | "Connection": "keep-alive",
144 | "Accept": "*/*",
145 | "Content-Type": "application/x-www-form-urlencoded",
146 | "group": "t.me/sdsproject",
147 | "my-istri": "marinkitagawa",
148 | }
149 | ses2.headers.update(headers2)
150 | ses2.proxies.update({"http":proxy,"https":proxy})
151 | try:
152 | res = http(ses=ses2, url="https://sdsproject000.pythonanywhere.com/", data="")
153 | if res is None:
154 | return "bad_proxy"
155 | error = res.json().get("error")
156 | token = res.json().get("token")
157 | except:
158 | log("failed get google captcha token !")
159 | return None
160 | if error is not None:
161 | log("failed get google captcha token !")
162 | return None
163 | data_lock["captchaToken"] = token
164 | ses.headers.update({"Content-Type": "application/json"})
165 | # print(data)
166 | res = http(ses=ses, url=restake_url, data=json.dumps(data_lock))
167 | if res is None:
168 | return "bad_proxy"
169 | message = res.json().get("message")
170 | if message == "Previous Epoch Points restaked successfully":
171 | log("success stake point !")
172 | return True
173 | else:
174 | log("failed stake point !")
175 | return False
176 |
177 |
178 | def main():
179 | print("""
180 | >
181 | > Auto Stake Point Layeredge
182 | > Join t.me/sdsproject
183 | >
184 | """)
185 |
186 | pks = open("privatekeys2.txt").read().splitlines()
187 | proxies = open("proxies.txt").read().splitlines()
188 | print(f"total privatekey : {len(pks)}")
189 | print(f"total proxy : {len(proxies)}")
190 | print()
191 | if len(pks) <= 0:
192 | print("total privatekey is 0, exit !")
193 | sys.exit()
194 | p = 0
195 | for pk in pks:
196 | print("~" * 50)
197 | while True:
198 | proxy = None if len(proxies) <= 0 else proxies[p % len(proxies)]
199 | result = lock(privatekey=pk, proxy=proxy)
200 | if result == "bad_proxy":
201 | p += 1
202 | continue
203 | p += 1
204 | break
205 |
206 |
207 |
208 |
209 | if __name__ == "__main__":
210 | try:
211 | main()
212 | except KeyboardInterrupt:
213 | sys.exit()
214 |
--------------------------------------------------------------------------------
/main.py:
--------------------------------------------------------------------------------
1 | import os
2 | import sys
3 | import time
4 | import web3
5 | import json
6 | import string
7 | import random
8 | import requests
9 | import ua_generator
10 | from datetime import datetime, timedelta
11 | from eth_account.messages import encode_defunct
12 | from base64 import b64decode
13 |
14 |
15 | def log(msg):
16 | now = datetime.now().isoformat(" ").split(".")[0]
17 | print(f"[{now}] {msg}")
18 |
19 |
20 | def http(ses: requests.Session, url, data=None):
21 | attemp = 0
22 | while True:
23 | try:
24 | if attemp == 3:
25 | return None
26 | if data is None:
27 | res = ses.get(url=url)
28 | elif data == "":
29 | res = ses.post(url=url)
30 | else:
31 | res = ses.post(url=url, data=data)
32 | if (
33 | not os.path.exists("http.log")
34 | or os.path.getsize("http.log") / 1024 > 1024
35 | ):
36 | open("http.log", "w").write("")
37 | open("http.log", "a").write(f"{res.status_code} {res.text}\n")
38 | if "502 Bad Gateway" in res.text:
39 | log("error : 502 bad gateway !")
40 | time.sleep(3)
41 | continue
42 | if "504 Gateway Time-out" in res.text:
43 | log("error : 504 gateway timeout !")
44 | time.sleep(3)
45 | continue
46 | return res
47 | except (
48 | requests.exceptions.ConnectTimeout,
49 | requests.exceptions.ConnectionError,
50 | requests.exceptions.ReadTimeout,
51 | requests.exceptions.ProxyError,
52 | ):
53 | log("connection error !")
54 | attemp += 1
55 |
56 |
57 | class Start:
58 | def __init__(self, privatekey, proxy):
59 | headers = {"user-agent": ua_generator.generate(device=("desktop")).text}
60 | proxy = {"http": proxy, "https": proxy}
61 | self.ses = requests.Session()
62 | self.ses.headers.update(headers)
63 | self.ses.proxies.update(proxy)
64 | self.wallet = web3.Account.from_key(private_key=privatekey)
65 | self.hostname = b64decode("bGF5ZXJlZGdlLmlv").decode()
66 |
67 | def start(self):
68 | try:
69 | res = http(ses=self.ses, url="https://ipv4.webshare.io")
70 | if res is None:
71 | return None
72 | log(f"start with ip {res.text}")
73 | self.ses.headers.update(
74 | {
75 | "host": f"referralapi.{self.hostname}",
76 | "connection": "keep-alive",
77 | "sec-ch-ua-platform": '"Windows"',
78 | "accept": "*/*",
79 | "content-type": "application/json",
80 | "sec-ch-ua-mobile": "?0",
81 | "origin": f"https://dashboard.{self.hostname}",
82 | "sec-fetch-site": "same-site",
83 | "sec-fetch-mode": "cors",
84 | "sec-fetch-dest": "empty",
85 | "referer": f"https://dashboard.{self.hostname}/",
86 | "accept-language": "en-US,en;q=0.9",
87 | }
88 | )
89 | log(f"wallet addr : {self.wallet.address}")
90 | wallet_detail_url = f"https://referralapi.{self.hostname}/api/referral/wallet-details/{self.wallet.address}"
91 | node_status_url = f"https://referralapi.{self.hostname}/api/light-node/node-status/{self.wallet.address}"
92 | daily_claim_url = (
93 | f"https://referralapi.{self.hostname}/api/light-node/claim-node-points"
94 | )
95 | res = http(ses=self.ses, url=wallet_detail_url)
96 | ref_code = res.json().get("data", {}).get("referralCode")
97 | point = res.json().get("data", {}).get("nodePoints")
98 | last_claim = res.json().get("data", {}).get("lastClaimed")
99 | if last_claim is None:
100 | last_claim = (datetime.now() - timedelta(days=1)).isoformat()
101 | last_claim_day = last_claim.split("T")[0]
102 | log(f"referral code : {ref_code}")
103 | log(f"node point : {point}")
104 | now = datetime.now()
105 | message_claim = f"I am claiming my daily node point for {self.wallet.address} at {int(now.timestamp() * 1000)}"
106 | daily_claim_data = {
107 | "walletAddress": self.wallet.address,
108 | "timestamp": int(now.timestamp() * 1000),
109 | "sign": "",
110 | }
111 | if last_claim_day != now.isoformat().split("T")[0]:
112 | enmessage = encode_defunct(text=message_claim)
113 | sign = web3.Account.sign_message(enmessage, private_key=self.wallet.key)
114 | signature = f"0x{sign.signature.hex()}"
115 | daily_claim_data["sign"] = signature
116 | res = http(
117 | ses=self.ses, url=daily_claim_url, data=json.dumps(daily_claim_data)
118 | )
119 | if res.json().get("message") == "node points claimed successfully":
120 | log(f"success claim daily point !")
121 | else:
122 | log(f"failed claim daily point !")
123 | res = http(ses=self.ses, url=node_status_url)
124 | if res is None:
125 | return None
126 | start_time = res.json().get("data", {}).get("startTimestamp")
127 | if start_time is None:
128 | start_url = f"https://referralapi.{self.hostname}/api/light-node/node-action/{self.wallet.address}/start"
129 | timet = int(datetime.now().timestamp() * 1000)
130 | message = (
131 | f"Node activation request for {self.wallet.address} at {timet}"
132 | )
133 | enmessage = encode_defunct(text=message)
134 | sign = web3.Account.sign_message(enmessage, private_key=self.wallet.key)
135 | signature = f"0x{sign.signature.hex()}"
136 | data = {
137 | "sign": signature,
138 | "timestamp": timet,
139 | }
140 | res = http(ses=self.ses, url=start_url, data=json.dumps(data))
141 | if res is None:
142 | return None
143 | if not "node action executed successfully" in res.json().get("message"):
144 | log(f"failed start node !")
145 | log(f"http response : {res.text}")
146 | return None
147 | log("success start node !")
148 | else:
149 | log("node already started !")
150 | proof_status_url = f"https://referralapi.{self.hostname}/api/card/proof-status/{self.wallet.address}"
151 | res = http(ses=self.ses, url=proof_status_url)
152 | if res.status_code != 200:
153 | log("failed get proof status !")
154 | return False
155 | is_submit = res.json().get("data", {}).get("hasSubmitted")
156 | if is_submit:
157 | log("already submit proof !")
158 | return True
159 | now = datetime.now().isoformat()
160 | message = f"I am submitting a proof for LayerEdge at {now[:-3]}Z"
161 | sign_message = encode_defunct(text=message)
162 | signature = web3.Web3.to_hex(
163 | web3.Account.sign_message(
164 | sign_message, private_key=self.wallet.key
165 | ).signature
166 | )
167 | sendproof_url = f"https://referralapi.{self.hostname}/api/card/submit-proof"
168 | sendproof_data = {
169 | "proof": "LayerEdge enhances zero-knowledge proofs (ZKPs) by optimizing scalability and efficiency. It enables off-chain computation with succinct validity proofs, reducing on-chain load. Using advanced cryptographic techniques, LayerEdge ensures privacy, security, and seamless integration for blockchain applications. #ZKProof #Blockchain",
170 | "signature": signature,
171 | "message": message,
172 | "walletAddress": self.wallet.address,
173 | }
174 |
175 | res = http(ses=self.ses, url=sendproof_url, data=json.dumps(sendproof_data))
176 | if res is None:
177 | log("failed send proof data !")
178 | return None
179 | message = res.json().get("message")
180 | if "queued" in message:
181 | log("proof submitted but pending.")
182 | return True
183 | if not res.json().get("success"):
184 | log("failed send proof data !")
185 | return False
186 | log("success send proof data !")
187 | return True
188 | except Exception as e:
189 | log(f"error : {e}")
190 | return None
191 |
192 |
193 | def get_proxy(i, p):
194 | if len(p) <= 0:
195 | return None
196 | proxy = p[i % len(p)]
197 | return proxy
198 |
199 |
200 | def main():
201 | os.system("cls" if os.name == "nt" else "clear")
202 | print(">\n> active node l a y e r e d g e !\n>")
203 | print()
204 | privatekeys = open("privatekeys.txt").read().splitlines()
205 | proxies = open("proxies.txt").read().splitlines()
206 | if len(proxies) <= 0:
207 | q = input(f"Do you want to continue without a proxy? [y/n] ")
208 | if q.lower() == "n":
209 | sys.exit()
210 | print(f"total private key : {len(privatekeys)}")
211 | print(f"total proxy : {len(proxies)}")
212 | print()
213 | for i, privatekey in enumerate(privatekeys):
214 | proxy = get_proxy(i, proxies)
215 | while True:
216 | st = Start(proxy=proxy, privatekey=privatekey).start()
217 | if st is None:
218 | proxy = get_proxy(random.randint(1, len(privatekeys)), proxies)
219 | continue
220 | break
221 |
222 | print("~" * 50)
223 |
224 |
225 | if __name__ == "__main__":
226 | try:
227 | main()
228 | except KeyboardInterrupt:
229 | sys.exit()
230 |
--------------------------------------------------------------------------------
/proxies.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/akasakaid/lazy-yerge/34d616e6787fa627d125ca375bb68b4fb91a31ea/proxies.txt
--------------------------------------------------------------------------------
/referral.py:
--------------------------------------------------------------------------------
1 | #
2 | # read the readme.
3 | #
4 |
5 | import os
6 | import time
7 | import sys
8 | import web3
9 | import json
10 | import string
11 | import random
12 | import requests
13 | import ua_generator
14 | from datetime import datetime
15 | from eth_account.messages import encode_defunct
16 | from base64 import b64decode
17 |
18 |
19 | def log(msg):
20 | now = datetime.now().isoformat(" ").split(".")[0]
21 | print(f"[{now}] {msg}")
22 |
23 |
24 | def http(ses: requests.Session, url, data=None):
25 | attemp = 0
26 | while True:
27 | try:
28 | if attemp == 3:
29 | return None
30 | if data is None:
31 | res = ses.get(url=url)
32 | elif data == "":
33 | res = ses.post(url=url)
34 | else:
35 | res = ses.post(url=url, data=data)
36 | if "502 Bad Gateway" in res.text:
37 | log("error : 502 bad gateway !")
38 | time.sleep(3)
39 | continue
40 | if "504 Gateway Time-out" in res.text:
41 | log("error : 504 gateway timeout !")
42 | time.sleep(3)
43 | continue
44 | return res
45 | except (
46 | requests.exceptions.ConnectTimeout,
47 | requests.exceptions.ConnectionError,
48 | requests.exceptions.ReadTimeout,
49 | requests.exceptions.ProxyError,
50 | ):
51 | log(f"connection error !")
52 | attemp += 1
53 |
54 |
55 | class Referral:
56 | def __init__(self, proxy):
57 | proxy = {"http": proxy, "https": proxy}
58 | self.ses = requests.Session()
59 | self.ses.proxies.update(proxy)
60 | headers = {
61 | "user-agent": ua_generator.generate().text,
62 | }
63 |
64 | self.ses.headers.update(headers)
65 | # self.wallet = eth_account.Account.create()
66 | self.wallet = web3.Account.create()
67 | self.hostname = b64decode("bGF5ZXJlZGdlLmlv").decode()
68 |
69 | def start(self, referral_code):
70 | try:
71 | res = http(ses=self.ses, url="https://ipv4.webshare.io")
72 | if res is None:
73 | return
74 | log(f"register with ip {res.text}")
75 | self.ses.headers.update(
76 | {
77 | "host": f"referralapi.{self.hostname}",
78 | "connection": "keep-alive",
79 | "sec-ch-ua-platform": '"Windows"',
80 | "accept": "application/json, text/plain, */*",
81 | "content-type": "application/json",
82 | "sec-ch-ua-mobile": "?0",
83 | "origin": f"https://dashboard.{self.hostname}",
84 | "sec-fetch-site": "same-site",
85 | "sec-fetch-mode": "cors",
86 | "sec-fetch-dest": "empty",
87 | "referer": f"https://dashboard.{self.hostname}/",
88 | "accept-language": "en-US,en;q=0.9",
89 | }
90 | )
91 | verify_referral_code_url = (
92 | f"https://referralapi.{self.hostname}/api/referral/verify-referral-code"
93 | )
94 |
95 | data = {"invite_code": referral_code}
96 | res = http(
97 | ses=self.ses, url=verify_referral_code_url, data=json.dumps(data)
98 | )
99 | if res is None:
100 | return None
101 | if res.status_code != 200:
102 | log(f"http code : {res.status_code}")
103 | log(f"http response : {res.text}")
104 | return None
105 | if not res.json().get("data", {}).get("valid"):
106 | log("referral code is not valid !")
107 | log(f"http response : {res.text}")
108 | return None
109 | register_url = f"https://referralapi.{self.hostname}/api/referral/register-wallet/{referral_code}"
110 | data = {"walletAddress": self.wallet.address}
111 | res = http(ses=self.ses, url=register_url, data=json.dumps(data))
112 | if res is None:
113 | return None
114 | if not "registered wallet address successfully" in res.json().get(
115 | "message"
116 | ):
117 | log("failed register !")
118 | log(f"http response : {res.text} ")
119 | return None
120 | log("success register !")
121 | privatekey = f"0x{self.wallet.key.hex()}"
122 | with open("privatekeys.txt", "a") as w:
123 | w.write(f"{privatekey}\n")
124 | ref_code = res.json().get("data", {}).get("referralCode")
125 | node_status_url = f"https://referralapi.{self.hostname}/api/light-node/node-status/{self.wallet.address}"
126 | res = http(ses=self.ses, url=node_status_url)
127 | if res is None:
128 | return None
129 | start_time = res.json().get("data", {}).get("startTimestamp")
130 | if start_time is None:
131 | start_url = f"https://referralapi.{self.hostname}/api/light-node/node-action/{self.wallet.address}/start"
132 | timet = int(datetime.now().timestamp() * 1000)
133 | message = (
134 | f"Node activation request for {self.wallet.address} at {timet}"
135 | )
136 | enmessage = encode_defunct(text=message)
137 | sign = web3.Account.sign_message(enmessage, private_key=self.wallet.key)
138 | signature = f"0x{sign.signature.hex()}"
139 | data = {
140 | "sign": signature,
141 | "timestamp": timet,
142 | }
143 | res = http(ses=self.ses, url=start_url, data=json.dumps(data))
144 | if res is None:
145 | return None
146 | if not "node action executed successfully" in res.json().get("message"):
147 | log(f"failed start node !")
148 | log(f"http response : {res.text}")
149 | return None
150 | log("success start node !")
151 | return True
152 | log("node already started !")
153 | return True
154 | except Exception as e:
155 | log(f"error : {e}")
156 | return None
157 |
158 |
159 | def get_proxy(i, p):
160 | if len(p) <= 0:
161 | return None
162 | proxy = p[i % len(p)]
163 | return proxy
164 |
165 |
166 | def main():
167 | os.system("cls" if os.name == "nt" else "clear")
168 | print(">\n> auto referrral l a y e r e d g e !\n>")
169 | print()
170 | proxies = open("proxies.txt").read().splitlines()
171 | print(f"total proxy : {len(proxies)}")
172 | referral_code = input("input referral code : ")
173 | total_referral = input("input total referral : ")
174 | if len(proxies) <= 0:
175 | q = input(f"Do you want to continue without a proxy? [y/n] ")
176 | if q.lower() == "n":
177 | sys.exit()
178 | print()
179 | for i in range(int(total_referral)):
180 | proxy = get_proxy(i, proxies)
181 | Referral(proxy=proxy).start(referral_code=referral_code)
182 | print("~" * 50)
183 |
184 |
185 | if __name__ == "__main__":
186 | try:
187 | main()
188 | except KeyboardInterrupt:
189 | sys.exit()
190 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | requests
2 | web3
3 | ua-generator
--------------------------------------------------------------------------------