4 from electrum import TcpStratumInterface
9 print "usage: watch_address <bitcoin_address>"
12 i = TcpStratumInterface('ecdsa.org', 50001)
15 i.send([('blockchain.address.subscribe',[addr])])
18 r = i.responses.get(True, 100000000000)
19 method = r.get('method')
20 if method == 'blockchain.address.subscribe':
21 i.send([('blockchain.address.get_history',[addr])])
22 elif method == 'blockchain.address.get_history':
23 confirmed = unconfirmed = 0
33 print (confirmed+unconfirmed)/1.e8