remove the calculation of address balance in watch_address
[electrum-nvc.git] / scripts / watch_address
1 #!/usr/bin/env python
2
3 import sys, time
4 from electrum import Interface
5
6 try:
7     addr = sys.argv[1]
8 except:
9     print "usage: watch_address <bitcoin_address>"
10     sys.exit(1)
11
12 i = Interface()
13 i.start()
14 i.send([('blockchain.address.subscribe',[addr])] )
15 time.sleep(1)
16
17 while True:
18     r = i.get_response()
19     method = r.get('method') 
20     if method == 'blockchain.address.subscribe':
21         i.send([('blockchain.address.get_history',[addr])])
22         
23     elif method == 'blockchain.address.get_history':
24         for line in r.get('result'):
25             print line
26         print "---"