Files
purple-electrumwallet/electrum/scripts/get_history.py
T

19 lines
384 B
Python
Raw Normal View History

2017-09-05 15:27:08 +02:00
#!/usr/bin/env python3
2012-06-14 21:11:37 +02:00
import sys
2018-07-11 17:38:47 +02:00
from .. import Network
from electrum.util import json_encode, print_msg
2017-11-29 10:12:47 +01:00
from electrum import bitcoin
2012-06-14 21:11:37 +02:00
try:
addr = sys.argv[1]
2013-11-10 12:30:57 -08:00
except Exception:
2017-09-05 15:27:08 +02:00
print("usage: get_history <bitcoin_address>")
2012-06-14 21:11:37 +02:00
sys.exit(1)
2015-08-30 21:18:10 +09:00
n = Network()
n.start()
2017-11-29 10:12:47 +01:00
_hash = bitcoin.address_to_scripthash(addr)
h = n.get_history_for_scripthash(_hash)
print_msg(json_encode(h))