Добро пожаловать в канал E-BEGGAR! Здесь вы встретите @PaIyanytsya, который делится своими кодами на GitHub (https://github.com/true-ebeggar) и приглашает вас стать подписчиком канала @Six_Star_Chicken_McNuggets_Bot. E-BEGGAR открыт для любого сотрудничества, особенно если речь идет о деньгах. Присоединяйтесь к нам, чтобы узнать больше об интересных проектах и возможностях для сотрудничества!
26 Jan, 02:04
21 Jan, 09:36
18 Jan, 22:19
18 Jan, 22:04
14 Jan, 22:33
08 Jan, 08:00
09 Nov, 05:38
19 Oct, 20:26
import asyncio
import json
import random
from concurrent.futures import ThreadPoolExecutor
from aptos_sdk.account import Account
from aptos_sdk.client import RestClient
from loguru import logger
from aptos_sdk.client import ClientConfig
import httpx
# Base configuration
WEI_TO_APT = 10 ** 8
semaphore_restr = 10
config = ClientConfig()
config.max_gas_amount = 100_0
FILE = "key_for_mint.txt"
PROXY_FILE = "proxies.txt"
BATCH_SIZE = 10
def format_proxy(proxy_str):
# Add the scheme if it's missing
if not proxy_str.startswith("http://") and not proxy_str.startswith("https://"):
proxy_str = f"http://{proxy_str}"
return proxy_str
async def get_ip_from_proxy(proxy_url: str):
proxies = {
"http://": proxy_url,
"https://": proxy_url
}
try:
async with httpx.AsyncClient(proxies=proxies, timeout=10) as client:
response = await client.get("https://api.ipify.org?format=json")
if response.status_code == 200:
ip_info = response.json()
# print(json.dumps(ip_info, indent=4))
logger.success(f"Proxy {proxy_url} confirmed, IP: {ip_info['ip']}")
return True
else:
logger.error(f"Failed with status code: {response.status_code}")
except httpx.HTTPStatusError as http_err:
logger.error(f"HTTP error occurred: {http_err}")
except httpx.ProxyError as proxy_err:
logger.error(f"Proxy error occurred: {proxy_err}")
except Exception as e:
logger.error(f"General error during proxy test: {e}")
return False
async def submit_and_log_transaction(account, payload, proxy_url: str):
logger.debug(f"Submitting transaction for account: {account.address()}")
proxies = {
"http://": proxy_url,
"https://": proxy_url
}
async with httpx.AsyncClient(proxies=proxies, timeout=10) as session:
client = RestClient(base_url="https://fullnode.mainnet.aptoslabs.com/v1", client_config=config)
client.client = httpx.Client(proxies=proxies, timeout=10)
try:
loop = asyncio.get_running_loop()
txn = await loop.run_in_executor(None, client.submit_transaction, account, payload)
await loop.run_in_executor(None, client.wait_for_transaction, txn)
logger.success(f'https://explorer.aptoslabs.com/txn/{txn}?network=mainnet')
await asyncio.sleep(random.randint(1, 10))
return 0
except AssertionError as e:
logger.error(f"AssertionError caught: {e}")
return 1
except Exception as e:
logger.critical(f"An unexpected error occurred: {e}")
return 1
finally:
await session.aclose()
async def mint_free_nft(account, semaphore, proxies):
payload = {
"type": "entry_function_payload",
"function": "0x96c192a4e3c529f0f6b3567f1281676012ce65ba4bb0a9b20b46dec4e371cccd::unmanaged_launchpad::mint",
"type_arguments": [],
"arguments": [
'0xd42cd397c41a62eaf03e83ad0324ff6822178a3e40aa596c4b9930561d4753e5',
{
"vec": [str(1)]
}
]
}
while True:
proxy_url = format_proxy(random.choice(proxies))
if await get_ip_from_proxy(proxy_url):
async with semaphore:
return await submit_and_log_transaction(account, payload, proxy_url)
else:
continue
async def load_accounts_from_keys(private_keys):
with ThreadPoolExecutor() as executor:
loop = asyncio.get_running_loop()
accounts = await loop.run_in_executor(executor,
lambda: [Account.load_key(private_key) for private_key in private_keys])
return accounts
async def main():
with open(FILE, "r") as file:
private_keys = [line.strip() for line in file.readlines()]
19 Oct, 20:26
with open(PROXY_FILE, "r") as proxy_file:
proxies = [line.strip() for line in proxy_file.readlines()]
random.shuffle(proxies)
logger.info(f"Loaded {len(private_keys)} private keys and {len(proxies)} proxies")
logger.info(f"Semaphore restriction: {semaphore_restr}")
semaphore = asyncio.Semaphore(semaphore_restr)
accounts = await load_accounts_from_keys(private_keys)
for i in range(0, len(accounts), BATCH_SIZE):
batch_accounts = accounts[i:i + BATCH_SIZE]
tasks = [mint_free_nft(account, semaphore, proxies) for account in batch_accounts]
logger.info(f"Processing batch {i // BATCH_SIZE + 1}: {len(tasks)} tasks...")
results = await asyncio.gather(*tasks)
logger.info(f"Batch {i // BATCH_SIZE + 1} completed")
logger.info("All batches completed")
if __name__ == "__main__":
asyncio.run(main())
26 Sep, 17:26
28 Aug, 17:23
05 Aug, 10:58
21 Jun, 16:26
18 Jun, 16:39
17 Jun, 23:12
08 Jun, 18:07