#NEWLINE# def get_unspent_outputs( self , crypto , address , confirmations = 1 ) : #NEWLINE# #INDENT# url = ( 'http://chainz.cryptoid.info/%s/api.dws?q=unspent&active=%s&key=%s' % ( crypto , address , self . api_key ) ) #NEWLINE# resp = self . get_url ( url ) #NEWLINE# if ( resp . status_code != 200 ) : #NEWLINE# #INDENT# raise Exception ( ( 'CryptoID returned Error: %s' % resp . content ) ) #NEWLINE# #UNINDENT# ret = [ ] #NEWLINE# for utxo in resp . json ( ) [ 'unspent_outputs' ] : #NEWLINE# #INDENT# ret . append ( dict ( output = ( '%s:%s' % ( utxo [ 'tx_hash' ] , utxo [ 'tx_ouput_n' ] ) ) , amount = int ( utxo [ 'value' ] ) , confirmations = utxo [ 'confirmations' ] , address = address ) ) #NEWLINE# #UNINDENT# return ret