We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
from time import sleep import requests import json from btcaddr import Wallet from time import sleep from fake_user_agent import user_agent
def generate_addresses(count): addresses = {} for i in range(count): wallet = Wallet() pub = wallet.address.dict["mainnet"].dict["pubaddr1"] prv = wallet.key.dict["mainnet"].dict["wif"] addresses[pub] = prv return addresses
def check_balance_btc(): try: data=generate_addresses(20) addresses = "|".join(data.keys()) headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Firefox/116.0" } url = f"https://blockchain.info/multiaddr?active={addresses}" response = requests.get(url, headers=headers).json() sleep(0.5) extract = [] for address in response["addresses"]: # add all data into a list extract.append({ "address": address["address"], "balance": address["final_balance"], "private": data[address["address"]] }) return extract except: pass generate_addresses(10)
New code for check.py
The text was updated successfully, but these errors were encountered:
No branches or pull requests
from time import sleep
import requests
import json
from btcaddr import Wallet
from time import sleep
from fake_user_agent import user_agent
def generate_addresses(count):
addresses = {}
for i in range(count):
wallet = Wallet()
pub = wallet.address.dict["mainnet"].dict["pubaddr1"]
prv = wallet.key.dict["mainnet"].dict["wif"]
addresses[pub] = prv
return addresses
def check_balance_btc():
try:
data=generate_addresses(20)
addresses = "|".join(data.keys())
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Firefox/116.0"
}
url = f"https://blockchain.info/multiaddr?active={addresses}"
response = requests.get(url, headers=headers).json()
sleep(0.5)
extract = []
for address in response["addresses"]:
# add all data into a list
extract.append({
"address": address["address"],
"balance": address["final_balance"],
"private": data[address["address"]]
})
return extract
except:
pass
generate_addresses(10)
New code for check.py
The text was updated successfully, but these errors were encountered: