#NEWLINE# def get_block( self , crypto , block_hash = '' , block_number = '' , latest = False ) : #NEWLINE# #INDENT# if block_hash : #NEWLINE# #INDENT# url = self . json_blockhash_url . format ( blockhash = block_hash , crypto = crypto ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if block_number : #NEWLINE# #INDENT# url = self . json_blocknum_url . format ( blocknum = block_number , crypto = crypto ) #NEWLINE# #UNINDENT# #UNINDENT# r = self . get_url ( url ) . json ( ) #NEWLINE# return dict ( block_number = r [ 'height' ] , confirmations = ( r [ 'depth' ] + 1 ) , time = arrow . get ( latest [ 'received_time' ] ) . datetime , sent_value = ( r [ 'total' ] / 100000000.0 ) , total_fees = ( r [ 'fees' ] / 100000000.0 ) , hash = r [ 'hash' ] , merkle_root = r [ 'mrkl_root' ] , previous_hash = r [ 'prev_block' ] , tx_count = r [ 'n_tx' ] , txids = r [ 'txids' ] )