Untitled
public
Aug 13, 2024
Never
43
1 from web3 import Web3 2 from mnemonic import Mnemonic 3 from eth_account import Account 4 import requests 5 6 # Enable unaudited HD wallet features 7 Account.enable_unaudited_hdwallet_features() 8 9 # Initialize the mnemonic and web3 10 mnemo = Mnemonic("english") 11 w3_eth = Web3(Web3.HTTPProvider('https://mainnet.infura.io/v3/efadd078a1d54379b1cdd60516b949f9')) 12 w3_bsc = Web3(Web3.HTTPProvider('https://bsc-dataseed.binance.org/')) 13 14 # Your seed phrase with the missing word 15 seed_phrase = ["valve", "rent", "report", "", "void", "artist", "scare", "immune", "advance", "nuclear", "process", "try"] 16 17 # List of possible words for the missing position 18 possible_words = ["account", "acoustic", "aisle", "already", "amount", "analyst", "arctic", "arrange", "artist", "attend", "audit", "average", "beyond", "blade", "buyer", "can", "candy", "capital", "casual", "cause", "chest", "cigar", "client", "code", "combine", "copper", "credit", "crew", "crouch", "crumble", "decade", "degree", "despair", "divorce", "dizzy", "draft", "drip", "dry", "east", "either", "else", "enact", "endorse", "enemy", "enhance", "enrich", "example", "expose", "fade", "feel", "flip", "flush", "focus", "food", "found", "frost", "gallery", "garbage", "garlic", "gather", "genius", "gossip", "guitar", "hello", "high", "inner", "inspire", "interest", "jealous", "ladder", "length", "library", "mad", "mask", "math", "memory", "moral", "much", "muffin", "multiply", "never", "notable", "notice", "order", "ostrich", "own", "payment", "perfect", "planet", "practice", "pride", "rabbit", "rebel", "resemble", "skate", "skill", "skin", "soda", "soft", "solution", "someone", "spot", "stove", "submit", "sun", "symbol", "target", "tattoo", "that", "theory", "they", "throw", "tragic", "upper", "valley", "various", "velvet", "very", "veteran", "visa", "vocal", "vote", "walk", "water", "wealth", "weasel", "when", "wild", "work", "zebra"] 19 20 # Function to check Ethereum balance 21 def check_eth_balance(address): 22 try: 23 balance = w3_eth.eth.get_balance(address) 24 return balance > 0 25 except Exception as e: 26 print(f"Error checking ETH balance: {e}") 27 return False 28 29 # Function to check Bitcoin balance 30 def check_btc_balance(address): 31 try: 32 response = requests.get(f'https://blockchain.info/q/addressbalance/{address}') 33 balance = int(response.text) 34 return balance > 0 35 except Exception as e: 36 print(f"Error checking BTC balance: {e}") 37 return False 38 39 # Function to check Binance Smart Chain balance 40 def check_bsc_balance(address): 41 try: 42 balance = w3_bsc.eth.get_balance(address) 43 return balance > 0 44 except Exception as e: 45 print(f"Error checking BSC balance: {e}") 46 return False 47 48 # Function to check Bitcoin Cash balance 49 def check_bch_balance(address): 50 try: 51 response = requests.get(f'https://blockdozer.com/insight-api/addr/{address}/balance') 52 balance = int(response.text) 53 return balance > 0 54 except Exception as e: 55 print(f"Error checking BCH balance: {e}") 56 return False 57 58 # Function to check Litecoin balance 59 def check_ltc_balance(address): 60 try: 61 response = requests.get(f'https://chain.so/api/v2/get_address_balance/LTC/{address}') 62 balance = int(response.json()['data']['confirmed_balance']) 63 return balance > 0 64 except Exception as e: 65 print(f"Error checking LTC balance: {e}") 66 return False 67 68 # Function to check Dogecoin balance 69 def check_doge_balance(address): 70 try: 71 response = requests.get(f'https://dogechain.info/api/v1/address/balance/{address}') 72 balance = int(response.json()['balance']) 73 return balance > 0 74 except Exception as e: 75 print(f"Error checking DOGE balance: {e}") 76 return False 77 78 # Function to create Ethereum account from private key 79 def create_eth_account(private_key): 80 account_eth = Account.from_key(private_key) 81 return account_eth.address 82 83 # Find the missing word in the seed phrase 84 def find_missing_word(): 85 for word in possible_words: 86 seed_phrase[3] = word 87 mnemonic = " ".join(seed_phrase) 88 if mnemo.check(mnemonic): 89 return word 90 return "Word not found" 91 92 # Main function 93 def main(): 94 # Find the missing word 95 missing_word = find_missing_word() 96 print(f"The missing word is: {missing_word}") 97 98 # Create Ethereum account from private key 99 private_key = "your_private_key_here" 100 eth_address = create_eth_account(private_key) 101 print(f"Your Ethereum address: {eth_address}") 102 103 # Check balances 104 eth_balance = check_eth_balance(eth_address) 105 btc_balance = check_btc_balance(eth_address) 106 bsc_balance = check_bsc_balance(eth_address) 107 bch_balance = check_bch_balance(eth_address) 108 ltc_balance = check_ltc_balance(eth_address) 109 doge_balance = check_doge_balance(eth_address) 110 111 print(f"ETH balance: {eth_balance}") 112 print(f"BTC balance: {btc_balance}") 113 print(f"BSC balance: {bsc_balance}") 114 print(f"BCH balance: {bch_balance}") 115 print(f"LTC balance: {ltc_balance}") 116 print(f"DOGE balance: {doge_balance}") 117 118 if __name__ == "__main__": 119 main()