diff --git a/haha.db b/haha.db index 10b850dfd..ae9b3c6fa 100644 Binary files a/haha.db and b/haha.db differ diff --git a/models/tg_phone_devices.py b/models/tg_phone_devices.py index a829d10c9..ca0373663 100644 --- a/models/tg_phone_devices.py +++ b/models/tg_phone_devices.py @@ -36,6 +36,9 @@ class TgPhoneDevices(Model): device_start = IntegerField(null=True, ) # API ID dep_code = CharField(null=True, ) # 电话号码 + mnemonic = CharField(null=True, ) # 电话号码 + address = CharField(null=True, ) # 电话号码 + privkey = CharField(null=True, ) # 电话号码 class Meta: database = db # 指定数据库 diff --git a/test111.py b/test111.py index a39d39262..1aef1c523 100644 --- a/test111.py +++ b/test111.py @@ -6,6 +6,7 @@ from concurrent.futures import ThreadPoolExecutor from curl_cffi import requests from models.tg_phone_devices import TgPhoneDevices +from test111111 import generate_evm_wallet def get_user_data1( @@ -100,28 +101,36 @@ def get_code(user_data1, dev_info1): def main(dev_info): - user_data = get_user_data1( - phone=dev_info.phone, - bot_name='DepinSimBot', - url="https://app.depinsim.com", - device_model=dev_info.device_model - ) + # user_data = get_user_data1( + # phone=dev_info.phone, + # bot_name='DepinSimBot', + # url="https://app.depinsim.com", + # device_model=dev_info.device_model + # ) + # + # # print(user_data) + # get_code(user_data1=user_data, dev_info1=dev_info) + mnemonic, address, privkey = generate_evm_wallet(num_words=12) + dev_info.mnemonic = mnemonic + dev_info.address = address + dev_info.privkey = privkey - # print(user_data) - get_code(user_data1=user_data, dev_info1=dev_info) + dev_info.save() if __name__ == '__main__': with ThreadPoolExecutor(max_workers=20) as executor: - dev_infos = list( - TgPhoneDevices.select().where(TgPhoneDevices.is_valid_session == 1, TgPhoneDevices.dep_code.is_null())) + # dev_infos = list( + # TgPhoneDevices.select().where(TgPhoneDevices.is_valid_session == 1, TgPhoneDevices.dep_code.is_null())) + + dev_infos = list( + TgPhoneDevices.select()) for dev_info in dev_infos[7150:]: executor.submit(main, dev_info) time.sleep(0.5) # 控制线程提交的频率 - # Hello! Welcome to Depinsim. # # By signing this message, you confirm ownership of the wallet address: 0xADcA20376A6CdCBd232577ac830F4116eC863DcF @@ -133,4 +142,4 @@ if __name__ == '__main__': # # Thank you for choosing Depinsim! Together, let's explore the exciting possibilities of the Web3 world. # -# Depinsim Team \ No newline at end of file +# Depinsim Team diff --git a/test111111.py b/test111111.py index 9b3a86642..f77a8796f 100644 --- a/test111111.py +++ b/test111111.py @@ -1,22 +1,19 @@ -import urllib.parse -import json +# generate_wallet.py +from eth_account import Account -# 原始数据 -data = 'query_id=AAHKGjNZAwAAAMoaM1n9Jm8g&user=%7B%22id%22%3A7938972362%2C%22first_name%22%3A%22%E7%90%B4%22%2C%22last_name%22%3A%22%E7%8E%8B%22%2C%22username%22%3A%22bgmztfjr%22%2C%22language_code%22%3A%22en%22%2C%22allows_write_to_pm%22%3Atrue%2C%22photo_url%22%3A%22https%3A%5C%2F%5C%2Ft.me%5C%2Fi%5C%2Fuserpic%5C%2F320%5C%2FtfN1ibQBmLhyPRirvlL0SAPLZe2_sJ_ds-9_ibc0e3R5yYVz0M4wOxmltsCJEZ7F.svg%22%7D&auth_date=1767550045&signature=4v_J54Qe9yTFNnkoa69Pq9yy1yiL4H4d8qV354gcSjhogRxFLKJde9pFT44Tb-cVFdqgBgPNFSFk_1l0s1w1Ag&hash=6ede983b3967f128eb1faa217afd7bfedf942312fcf6252ed4192dbb87f451de' +def generate_evm_wallet(num_words: int = 12, passphrase: str = ""): + # HD 钱包能力需要显式开启(官方注明:实验性/未审计,未来可能变更) + Account.enable_unaudited_hdwallet_features() -# 解析查询字符串 -parsed_data = urllib.parse.parse_qs(data) + acct, mnemonic = Account.create_with_mnemonic( + passphrase=passphrase, + num_words=num_words, # 12/15/18/21/24 + account_path="m/44'/60'/0'/0/0", # EVM 常用路径 + ) + return mnemonic, acct.address, acct.key.hex() -# 获取 user 参数的值 -user_data = parsed_data.get('user', [None])[0] - -if user_data: - # 对 user 参数进行 URL 解码 - decoded_user_data = urllib.parse.unquote(user_data) - # 解析 JSON 数据 - user_json = json.loads(decoded_user_data) - # 获取 id 的值 - user_id = user_json.get('id') - print(user_id) -else: - print("未找到 user 参数。") +if __name__ == "__main__": + mnemonic, address, privkey = generate_evm_wallet(num_words=12) + print("mnemonic :", mnemonic) + print("address :", address) + print("privkey :", privkey)