Created
June 6, 2022 14:32
-
-
Save lumunge/5fa87b5f51524dad597bb38e37859f52 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
address = input('Paste Wallet Address: ') | |
response = requests.get(f'https://blockchain.info/unspent?active={address}') | |
# utxo list | |
utxo_list = json.loads(response.text)["unspent_outputs"] | |
total = 0 | |
for utxo in utxo_list: | |
print(f"BTC: {utxo['tx_hash'], utxo['tx_output_n'], float(utxo['value']) / 100000000}") | |
total += utxo['value'] + 0 | |
print(f"Total Spendable BTC: {float(total) / 100000000}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment