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